[BPI-R64] Custom OpenWrt build for Banana Pi R64

Hi guys. I have create custom build OpenWrt from 16 april 2020.

Features:

  1. Include transsmission with web interfase.
  2. Include samba
  3. Include ntfs 3G driver details there
  4. Include mc, nano and other utilits.

For install it. Go to U-boot menu and selecte: 2) System Load Linux Kernel then write to Flash via TFTP.

Image

My config for menuconfig

1 Like

did you prepare the eMMC with the singleimage fromthis post ?

When I use your config to build an image i get this as the last part of my boot log 
   >  [    6.522903] xhci-mtk 1a0c0000.usb: xHCI Host Controller
>     [    6.528134] xhci-mtk 1a0c0000.usb: new USB bus registered, assigned bus number 2
>     [    6.535533] xhci-mtk 1a0c0000.usb: Host supports USB 3.0 SuperSpeed
>     [    6.541834] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
>     [    6.550155] hub 2-0:1.0: USB hub found
>     [    6.553923] hub 2-0:1.0: 1 port detected
>     [    6.558295] Creating 1 MTD partitions on "eMMC":
>     [    6.562918] 0x000000000000-0x0001d2000000 : "eMMC"
>     [    6.568178] block2mtd: mtd0: [eMMC] erase_size = 64KiB [65536]
>     [    6.574039] rtc_mt7622 10212800.rtc: setting system clock to 2000-01-01T02:22:23 UTC (946693343)
>     [    6.583731] /dev/root: Can't open blockdev
>     [    6.587835] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
>     [    6.595326] Please append a correct "root=" boot option; here are the available partitions:
>     [    6.603676] b300         7634944 mmcblk0
>     [    6.603678]  driver: mmcblk
>     [    6.610466]   b301             256 mmcblk0p1 f6ff0fdd-1e96-4a94-ba9b-89e55b8ea4ed
>     [    6.610468]
>     [    6.619428]   b302             512 mmcblk0p2 e34c411c-1fb5-47f3-a295-4aa8686eff6e
>     [    6.619429]
>     [    6.628388]   b303             512 mmcblk0p3 8660b620-97ca-4c76-b55b-bd47b11a37d9
>     [    6.628389]
>     [    6.637345]   b304             256 mmcblk0p4 c246f1d0-56ee-4fd8-859a-c92f8e636e79
>     [    6.637346]
>     [    6.646302]   b305           65536 mmcblk0p5 370fdf4f-9e4f-4b6d-a7e0-8c951452211a
>     [    6.646303]
>     [    6.655268] 1f00         7634944 mtdblock0
>     [    6.655269]  (driver?)
>     [    6.661794] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
>     [    6.670048] SMP: stopping secondary CPUs
>     [    6.673962] Kernel Offset: disabled
>     [    6.677442] CPU features: 0x0002,20002000
>     [    6.681440] Memory Limit: none
>     [    6.684485] Rebooting in 1 seconds..

I have do it for guide, from thise post [BPI-R64] loading OpenWRT built files into the board I have only one difference. I can not apply patch and I have patched files manualy there: target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts.

can you install packages via opkg and are settings persistent?

could you try creating image with kernel 5.4 and explain how you created the image (e.g. how to include the use your config, how to prepare bootheaders+uboot+partitiontable)

1)I can not install opkg pacages because I use kernel 4.19.

2)I can try create image with kernel 5.4 but if niebieski20 failed with this, I think I will failed too.

3)Image can create in hexeditor by copy sysugrade image to five partition of emmc_singleimage.img from this Bpi-r64 quick start (boot from eMMC)

I have try compile with kernel 5.4 and got error:

[    0.123574] DMA: preallocated 256 KiB pool for atomic allocations
[    0.140463] GPIO line 499 (asm_sel) hogged as output/high
[    0.157645] SCSI subsystem initialized
[    0.161707] usbcore: registered new interface driver usbfs
[    0.167239] usbcore: registered new interface driver hub
[    0.172613] usbcore: registered new device driver usb
[    0.178457] Bluetooth: Core ver 2.22
[    0.182072] NET: Registered protocol family 31
[    0.186529] Bluetooth: HCI device and connection manager initialized
[    0.192909] Bluetooth: HCI socket layer initialized
[    0.197804] Bluetooth: L2CAP socket layer initialized
[    0.202878] Bluetooth: SCO socket layer initialized
[    0.208029] clocksource: Switched to clocksource arch_sys_counter
[    0.214747] thermal_sys: Registered thermal governor 'fair_share'
[    0.214750] thermal_sys: Registered thermal governor 'bang_bang'
[    0.220874] thermal_sys: Registered thermal governor 'step_wise'
[    0.226902] thermal_sys: Registered thermal governor 'user_space'
[    0.232930] thermal_sys: Registered thermal governor 'power_allocator'
[    0.239307] NET: Registered protocol family 2
[    0.250479] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.258880] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.266701] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.274049] TCP: Hash tables configured (established 8192 bind 8192)
[    0.280512] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.287171] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.294332] NET: Registered protocol family 1
[    0.298719] PCI: CLS 0 bytes, default 64
[    0.303403] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.312783] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.318660] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.341263] mtk-tphy 1a0c4000.usb-phy: failed to get ref_clk(id-1)
[    0.350645] mt-pmic-pwrap 10001000.pwrap: unexpected interrupt int=0x1
[    0.371195] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.378254] printk: console [ttyS0] disabled
[    0.402893] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 118, base_baud = 1562500) is a ST16650V2
[    0.412192] printk: console [ttyS0] enabled
[    0.412192] printk: console [ttyS0] enabled
[    0.420560] printk: bootconsole [uart8250] disabled
[    0.420560] printk: bootconsole [uart8250] disabled
[    0.450995] 11004000.serial: ttyS1 at MMIO 0x11004000 (irq = 119, base_baud = 1562500) is a ST16650V2
[    0.460682] 1100c000.serial: ttyS2 at MMIO 0x1100c000 (irq = 125, base_baud = 17499995) is a MediaTek BTIF
[    0.470413] serial serial0: tty port ttyS2 registered
[    0.475674] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.483247] libphy: Fixed MDIO Bus: probed
[    0.510714] libphy: mdio: probed
[    0.513983] mtk_soc_eth 1b100000.ethernet: generated random MAC address 62:19:22:63:97:0b
[    0.522427] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xffffffc0112e0000, irq 134
[    0.531580] mtk_soc_eth 1b100000.ethernet: generated random MAC address e2:e7:8c:2d:b5:0e
[    0.539964] mtk_soc_eth 1b100000.ethernet eth1: mediatek frame engine at 0xffffffc0112e0000, irq 134
[    0.550013] rtc_mt7622 10212800.rtc: registered as rtc0
[    0.555499] mtk-thermal 1100b000.thermal: Device not calibrated, using default calibration values
[    0.564712] mtk-wdt 10212000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    0.572545] Bluetooth: HCI UART driver ver 2.3
[    0.576985] Bluetooth: HCI UART protocol H4 registered
[    0.582117] Bluetooth: HCI UART protocol BCSP registered
[    0.587478] Bluetooth: HCI UART protocol Broadcom registered
[    0.593147] Bluetooth: HCI UART protocol QCA registered
[    0.599204] bluetooth hci0: Direct firmware load for mediatek/mt7622pr2h.bin failed with error -2
[    0.608110] bluetooth hci0: Falling back to sysfs fallback for: mediatek/mt7622pr2h.bin
[    0.624395] mtk-msdc 11240000.mmc: Got CD GPIO
[    0.654479] NET: Registered protocol family 10
[    0.659565] Segment Routing with IPv6
[    0.663277] NET: Registered protocol family 17
[    0.667739] 8021q: 802.1Q VLAN Support v1.8
[    0.682282] mtk-pcie 1a140000.pcie: host bridge /pcie@1a140000 ranges:
[    0.688842] mtk-pcie 1a140000.pcie:   MEM 0x20000000..0x2fffffff -> 0x20000000
[    0.739245] mtk-msdc 11230000.mmc: phase: [map:7ffffff] [maxlen:27] [final:9]
[    0.747156] mmc0: new HS200 MMC card at address 0001
[    0.753304] mmcblk0: mmc0:0001 008G30 7.28 GiB
[    0.758726] mmcblk0boot0: mmc0:0001 008G30 partition 1 4.00 MiB
[    0.765539] mmcblk0boot1: mmc0:0001 008G30 partition 2 4.00 MiB
[    0.771522] mmcblk0rpmb: mmc0:0001 008G30 partition 3 4.00 MiB, chardev (250:0)
[    0.780856] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    0.788253] GPT:1 != 15269887
[    0.791210] GPT:Alternate GPT header not at the end of the disk.
[    0.797210] GPT:1 != 15269887
[    0.800171] GPT: Use GNU Parted to correct GPT errors.
[    0.805325]  mmcblk0: p1 p2 p3 p4 p5
[    0.809160] mtk-pcie 1a140000.pcie: Port0 link down
[    0.914100] mtk-pcie 1a140000.pcie: Port1 link down
[    0.919126] mtk-pcie 1a140000.pcie: PCI host bridge to bus 0000:00
[    0.925310] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.930793] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.939161] mtk_hsdma 1b007000.dma-controller: Using 3 as missing dma-requests property
[    0.947355] mtk_hsdma 1b007000.dma-controller: MediaTek HSDMA driver registered
[    1.524035] mt753x gsw@0: LAN/WAN VLAN setting=wllll
[    1.529479] mt753x gsw@0: Switch is MediaTek MT7531BE rev 0
[    4.177153] xhci-mtk 1a0c0000.usb: xHCI Host Controller
[    4.182392] xhci-mtk 1a0c0000.usb: new USB bus registered, assigned bus number 1
[    4.191440] xhci-mtk 1a0c0000.usb: hcc params 0x01403198 hci version 0x96 quirks 0x0000000000210010
[    4.200510] xhci-mtk 1a0c0000.usb: irq 130, io mem 0x1a0c0000
[    4.206660] hub 1-0:1.0: USB hub found
[    4.210427] hub 1-0:1.0: 2 ports detected
[    4.214645] xhci-mtk 1a0c0000.usb: xHCI Host Controller
[    4.219874] xhci-mtk 1a0c0000.usb: new USB bus registered, assigned bus number 2
[    4.227271] xhci-mtk 1a0c0000.usb: Host supports USB 3.0 SuperSpeed
[    4.233568] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.241879] hub 2-0:1.0: USB hub found
[    4.245639] hub 2-0:1.0: 1 port detected
[    4.249924] 6 cmdlinepart partitions found on MTD device eMMC
[    4.255670] Creating 6 MTD partitions on "eMMC":
[    4.260285] 0x000000000000-0x0000000c0000 : "preloader"
[    4.265942] 0x0000000c0000-0x000000140000 : "uboot"
[    4.271156] 0x000000140000-0x0000001c0000 : "uboot-env"
[    4.276717] 0x0000001c0000-0x000000200000 : "Factory"
[    4.282115] 0x000000200000-0x000004200000 : "firmware"
[    4.288710] 2 fit-fw partitions found on MTD device firmware
[    4.294373] 0x000000200000-0x0000004f0000 : "kernel"
[    4.299711] 0x0000004e1ad0-0x000004200000 : "rootfs"
[    4.305007] mtd: device 6 (rootfs) set to be root filesystem
[    4.310670] 1 squashfs-split partitions found on MTD device rootfs
[    4.316850] 0x000001000000-0x000004200000 : "rootfs_data"
[    4.322593] 0x000004200000-0x000084200000 : "usrdata"
[    4.328010] block2mtd: mtd0: [eMMC] erase_size = 64KiB [65536]
[    4.333871] rtc_mt7622 10212800.rtc: setting system clock to 2020-04-16T17:52:39 UTC (1587059559)
[    4.806732] mt753x gsw@0: Port 1 Link is Down
[    5.606711] mt753x gsw@0: Port 0 Link is Up - 100Mbps/Full
[    7.614685] mt753x gsw@0: Port 1 Link is Up - 1Gbps/Full
Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x4035b394
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 6bff6000, end 6bfff12c ... OK

Starting kernel ...

[ATF][    23.332186]save kernel info
[ATF][    23.335123]Kernel_EL2
[ATF][    23.337793]Kernel is [   60.445419] random: fast init done
64Bit
[ATF][    23.340881]pc=0x41080000, r0=0x6bff6000, r1=0x0
INFO:    BL3-1: Preparing for EL3 exit to normal world, Kernel
INFO:    BL3-1: Next image address = 0x41080000
INFO:    BL3-1: Next image spsr = 0x3c9
[ATF][    23.358579]el3_exit
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.32 (osboxes@osboxes) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r12983-f814121600)) #0 SMP Tue Apr 14 22:38:08 2020
[    0.000000] Machine model: Bananapi BPI-R64
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000011002000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] percpu: Embedded 20 pages/cpu s43608 r8192 d30120 u81920
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: kernel page table isolation disabled by kernel configuration
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258000
[    0.000000] Kernel command line: earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512 debug loglevel=7 rootfstype=squashfs,ext4 earlyprintk block2mtd.block2mtd=/dev/mmcblk0,65536,eMMC,5 mtdparts=eMMC:768k(preloader)ro,512k(uboot),512k(uboot-env),256k(Factory),64M(firmware),2048M(usrdata)
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 1018944K/1048384K available (6142K kernel code, 398K rwdata, 1788K rodata, 448K init, 282K bss, 29440K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     CONFIG_RCU_FANOUT set to non-default value of 32.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
[    0.000000] random: get_random_bytes called from start_kernel+0x2d4/0x430 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 12.50MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049cda, max_idle_ns: 440795202628 ns
[    0.000003] sched_clock: 56 bits at 12MHz, resolution 80ns, wraps every 4398046511080ns
[    0.008231] Calibrating delay loop (skipped), value calculated using timer frequency.. 25.00 BogoMIPS (lpj=50000)
[    0.018538] pid_max: default: 32768 minimum: 301
[    0.023252] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.030684] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.039423] ASID allocator initialised with 65536 entries
[    0.044900] rcu: Hierarchical SRCU implementation.
[    0.049988] smp: Bringing up secondary CPUs ...
[    0.054864] Detected VIPT I-cache on CPU1
[    0.054899] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.054954] smp: Brought up 1 node, 2 CPUs
[    0.069637] SMP: Total of 2 processors activated.
[    0.074357] CPU features: detected: 32-bit EL0 Support
[    0.079513] CPU features: detected: CRC32 instructions
[    0.084766] CPU: All CPU(s) started at EL2
[    0.088882] alternatives: patching kernel code
[    0.096464] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.106267] futex hash table entries: 512 (order: 3, 32768 bytes, l[   62.484078] Bluetooth: hci0: Failed to load firmware file (-11)

I get to the same point with kernel 5.4 The following are enabled in my kernel_menuconfig

"Device Drivers"-->"Memory Technology Device (MTD) support"-->" Partition parsers"-->"Command line partition table parsing"
"Device Drivers"-->"Memory Technology Device (MTD) support""Self-contained MTD device drivers"-->"MTD using block device"
"Device Drivers"-->"MMC/SD/SDIO card suport"->"MMC block device driver"

The regular menuconfig is the same as Yours in this post and DTS was modified as in this post ( like yours )

  • note that when modifying the 5.4 dts you have to create a patch as they seem to “build up” the R64 dts using patches rather than ( like in 4.19) starting from an existing r64 dts and modifying it, so 5.4 is more tricky that way… patch is here , place it in
/openwrt/target/linux/mediatekpatches-5.4

if I unplug and re-insert the Ethernet cable I still get output on the console

[  522.606620] mt753x gsw@0: Port 0 Link is Down
[  527.934870] mt753x gsw@0: Port 0 Link is Up - 1Gbps/Full
[  618.738491] mt753x gsw@0: Port 3 Link is Up - 1Gbps/Full
[  622.437130] mt753x gsw@0: Port 3 Link is Down
[  626.833946] mt753x gsw@0: Port 2 Link is Up - 1Gbps/Full
[  649.522690] mt753x gsw@0: Port 2 Link is Down

my uBoot environment and the singleimage was also changed to allow for larger 64M kernel images, as from this thread

setenv wr_flashimage 'filesize_check 0x5000000;if test ${filesize_result} = good; then mmc device 0;mmc write ${loadaddr} 0x0 0x18000;fi'

setenv boot_wr_img 'filesize_check 0x3E00000;if test ${filesize_result} = good; then image_blks 512  ${filesize};mmc device 0;mmc write ${loadaddr} 0x1000 0x18000;fi'

setenv bootargs 'earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512 debug loglevel=7 rootfstype=squashfs,ext4 earlyprintk block2mtd.block2mtd=/dev/mmcblk0,65536,eMMC,5 mtdparts=eMMC:768k(preloader)ro,512k(uboot),512k(uboot-env),256k(Factory),64M(firmware),2048M(usrdata)'

If i change kernel to 4.19 i can get to the openWRT console ( this is for the current master )

BusyBox v1.31.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r12986-a7423fef32
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
1 Like