Bpi-r64 quick start (boot from eMMC)

@frank-w @bourne_hlm the OpenWRT 5.4 kernel’s mtd driver have some issue. when I assign the MTD pattion on SD card or EMMC, the kernel can’t mount the rootfs. I think that it should be one kernel’s mtd driver issue. But you may don’t use the MTD partiotn on the EMMC, you can use the standard linux partition structure, then mount the mmc0blk0p1 block device. the path can work fine.

Basicly it sounds like a generic issue because it is mtd layer which should not be mtk related, am i right? Have you any more information?

Openwrt allows to create (packed) rootfs which can be used on additional partition on my debian-image. This needs only some uboot justification to pass different rootfs-partition to kernel (if you don’t overwrite my debian rootfs)

An error occurs when building on kernel 4.19. Please tell me what could be wrong

 >    cc1: some warnings being treated as errors
> scripts/Makefile.build:303: recipe for target '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615/main.o' failed
> make[6]: *** [/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615/main.o] Error 1
> scripts/Makefile.build:544: recipe for target '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615' failed
> make[5]: *** [/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615] Error 2
> Makefile:1528: recipe for target '_module_/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a' failed
> make[4]: *** [_module_/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a] Error 2
> make[4]: Leaving directory '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138'
> Makefile:392: recipe for target '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/.built' failed
> make[3]: *** [/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/.built] Error 2
> make[3]: Leaving directory '/home/redevice/openwrt/package/kernel/mt76'
> time: package/kernel/mt76/compile#3.05#0.68#3.74
> package/Makefile:111: recipe for target 'package/kernel/mt76/compile' failed
> make[2]: *** [package/kernel/mt76/compile] Error 2
> make[2]: Leaving directory '/home/redevice/openwrt'
> package/Makefile:107: recipe for target '/home/redevice/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile' failed
> make[1]: *** [/home/redevice/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile] Error 2
> make[1]: Leaving directory '/home/redevice/openwrt'
> /home/redevice/openwrt/include/toplevel.mk:234: recipe for target 'world' failed
> make: *** [world] Error 2

try to build with

make -j1 V=s

and please put output in code-tags to be more readable

I tried make -j1 V=s, the output is the same as in the previous post.

V=s enables debug and should say whats wrong before first failed from your previous post…this only says that build of mt7615/main.o is failed…so it’s the mt7615/7622 wifi driver. Just look in latest build log which code breaks it

Really, there is a build error in mt7615. I disabled this driver and repeated the build, but this time there is an error, the file mt7622-bananapi-bpi-r64 rootdisk.dts is missing, this file was not originally in the directory.

Target Profile (Banana Pi R64)

Initially, it is impossible to make build for the 4.19 kernel

the file should be named mt7622-bananapi-bpi-r64.dts …i don’t know where “rootdisk” came from…maybe overlapping in output (dispaly-issue)?

the dts file is imho not part of 4.19 and needs to be added over the files-folder in target/linux/mediatek or via patches

maybe you should try openwrt master for creating rootfs (and unpack this to an existing debian/ubuntu-image)

I have set up a new builder. Removed the mt7615 driver and enabled the mt7622 driver. Here is the error output below. Here I already understand little

Settings used by this post [BPI-R64] mt7622 mac80211 WiFi driver and Bpi-r64 quick start (boot from eMMC)

>/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/scripts/dtc/dtc -O dtb -i/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/mediatek/ -Wno-unit_address_vs_reg -Wno-simple_bus_reg -Wno-unit_address_format -Wno-pci_bridge -Wno-pci_device_bus_num -Wno-pci_device_reg -Wno-avoid_unnecessary_addr_size -Wno-alias_paths -Wno-graph_child_address -Wno-graph_port -Wno-unique_unit_address  -o  
>/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb.tmp
> /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb: Warning (reg_format): /mmc@11230000/emmc@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
> /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb: Warning (avoid_default_addr_size): /mmc@11230000/emmc@0: Relying on default #address-cells value
> /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb: Warning (avoid_default_addr_size): /mmc@11230000/emmc@0: Relying on default #size-cells value
> rm -f /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb.tmp
> aarch64-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp -I/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts -I/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/include -I/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/include/ -undef -D__DTS__  -o /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64-rootdisk.dtb.tmp /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts
> aarch64-openwrt-linux-musl-cpp: error: /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts: No such file or directory
> aarch64-openwrt-linux-musl-cpp: warning: '-x assembler-with-cpp' after last input file has no effect
> aarch64-openwrt-linux-musl-cpp: fatal error: no input files
> compilation terminated.
> make[5]: *** [Makefile:43: /home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64-rootdisk.dtb] Error 1
> make[5]: Leaving directory '/home/redevice/openwrt/target/linux/mediatek/image'
> make[4]: *** [Makefile:18: install] Error 2
> make[4]: Leaving directory '/home/redevice/openwrt/target/linux/mediatek'
> make[3]: *** [Makefile:13: install] Error 2
> make[3]: Leaving directory '/home/redevice/openwrt/target/linux'
> time: target/linux/install#34.48#10.09#53.28
> make[2]: *** [target/Makefile:25: target/linux/install] Error 2
> make[2]: Leaving directory '/home/redevice/openwrt' 
> make[1]: *** [target/Makefile:19: /home/redevice/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.target_install] Error 2
> make[1]: Leaving directory '/home/redevice/openwrt'
> make: *** [/home/redevice/openwrt/include/toplevel.mk:236: world] Error 2

strange that build-system relies on the root-disk dts…

why not trying upstream-version? mt7615/22 driver should be merged in openwrt with 5.4, only mtd-support and maybe image-creation is broken. but you can use ext4-rootfs (tgz) and maybe my kernels to get an up-to-date openwrt

What does upstream-version mean? Where can I find your kernels to update openwrt?

I tried to build on the 5.4 kernel. The image was building fine, but it aborts on boot if squashfs. The system boots if the initramfs image. But I see no point in initramfs if I can’t save the router settings.

Example of interrupting the system at boot

>[   22.113426] mt7622-wmac 18000000.wmac: HW/SW Version: 0x8a108a10, Build Time: 20190801210006a
>[   22.113426] 
>[   22.216615] mt7622-wmac 18000000.wmac: N9 Firmware Version: 2.0, Build Time: 20200131180931

>F0: 102B 0000
>F6: 3800 00A0
>F3: 0000 0000
>V0: 0000 0000 [0001]
>00: 0000 0000
>BP: 0000 0041 [0000]
>G0: 0190 0000
>T0: 0000 032D [000F]
>Jump to BL

I did not know current state of r64 in openwrt,i guessed build-script was also updated by david woodhouse

You can build rootfs,just unpack this to my debian-image BPI-ROOT partition. Without initramfs or squashfs.

Then download any kernel from my github (releases) and install it like in debian (just unpack and update uenv.txt to point to new file)

Please help build OpenWRT for R64 board. Here is the Error. Already that just did not try to do to fix it.

Here are my config files and Makefile and patch .config (226.8 КБ) 1000-add-factory-eeprom-and-emmc-mtd.patch (1.1 КБ) config-4.19 (16.5 КБ) Makefile (368 Байты)

MODPOST 51 modules
make[5]: Leaving directory '/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138'
cmp -s /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/vmlinux /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/vmlinux.debug || { aarch64-openwrt-linux-musl-objcopy -O binary -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id -S /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/vmlinux /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/vmlinux; aarch64-openwrt-linux-musl-objcopy -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id -S /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/vmlinux /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/vmlinux.elf; cp -fpR /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/vmlinux /home/redev/openwrt/build_dir/target-aarch64_cortex-a    53_musl/linux-mediatek_mt7622/vmlinux.debug;  cp -fpR /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot//Image /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/Image;  }
touch /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/.image
make -C image compile install TARGET_BUILD=
make[5]: Entering directory '/home/redev/openwrt/target/linux/mediatek/image'
make[5]: Nothing to be done for 'compile'.
aarch64-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp -I/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts -I/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/include -I/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/include/ -undef -D__DTS__  -o /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb.tmp /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/scripts/dtc/dtc -O dtb -i/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/mediatek/ -Wno-unit_address_vs_reg -Wno-simple_bus_reg -Wno-unit_address_format -Wno-pci_bridge -Wno-pci_device_bus_num -Wno-pci_device_reg -Wno-avoid_unnecessary_addr_size -Wno-alias_paths -Wno-graph_child_address -Wno-graph_port -Wno-unique_unit_address  -o /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb.tmp
/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb: Warning (reg_format): /mmc@11230000/emmc@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb: Warning (avoid_default_addr_size): /mmc@11230000/emmc@0: Relying on default #address-cells value
/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb: Warning (avoid_default_addr_size): /mmc@11230000/emmc@0: Relying on default #size-cells value
rm -f /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64.dtb.tmp
aarch64-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp -I/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts -I/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/include -I/home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/include/ -undef -D__DTS__  -o /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64-rootdisk.dtb.tmp /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts
aarch64-openwrt-linux-musl-cpp: error: /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts: No such file or directory
aarch64-openwrt-linux-musl-cpp: warning: '-x assembler-with-cpp' after last input file has no effect
aarch64-openwrt-linux-musl-cpp: fatal error: no input files
compilation terminated.
make[5]: *** [Makefile:43: /home/redev/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/image-mt7622-bananapi-bpi-r64-rootdisk.dtb] Error 1
make[5]: Leaving directory '/home/redev/openwrt/target/linux/mediatek/image'
make[4]: *** [Makefile:18: install] Error 2
make[4]: Leaving directory '/home/redev/openwrt/target/linux/mediatek'
make[3]: *** [Makefile:13: install] Error 2
make[3]: Leaving directory '/home/redev/openwrt/target/linux'
time: target/linux/install#16.11#4.90#30.72
make[2]: *** [target/Makefile:25: target/linux/install] Error 2
make[2]: Leaving directory '/home/redev/openwrt'
make[1]: *** [target/Makefile:19: /home/redev/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/redev/openwrt'
make: *** [/home/redev/openwrt/include/toplevel.mk:236: world] Error 2

Why stay on old 4.19? 5.4 is latest lts and 5.9 is maybe the next…

I don’t care which kernel to use. It is important for me that the file system can save the settings, wifi and EC25-E and gpio work.

I still haven’t found a good and clear build guide. And also how to upload to the board. Here’s what I need to do at 5.4.

As a result, something still did not work, for example, there is no LAN IP by default, and there is no terminal, only log output and that’s it

[    5.058470] xhci-mtk 1a0c0000.usb: xHCI Host Controller
[    5.063710] xhci-mtk 1a0c0000.usb: new USB bus registered, assigned bus number 1
[    5.072763] xhci-mtk 1a0c0000.usb: hcc params 0x01403198 hci version 0x96 quirks 0x0000000000210010    
[    5.081836] xhci-mtk 1a0c0000.usb: irq 130, io mem 0x1a0c0000
[    5.087999] hub 1-0:1.0: USB hub found
[    5.091766] hub 1-0:1.0: 2 ports detected
[    5.096007] xhci-mtk 1a0c0000.usb: xHCI Host Controller
[    5.101237] xhci-mtk 1a0c0000.usb: new USB bus registered, assigned bus number 2
[    5.108635] xhci-mtk 1a0c0000.usb: Host supports USB 3.0 SuperSpeed
[    5.114933] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    5.123257] hub 2-0:1.0: USB hub found
[    5.127019] hub 2-0:1.0: 1 port detected
[    5.131307] 6 cmdlinepart partitions found on MTD device eMMC
[    5.137053] Creating 6 MTD partitions on "eMMC":
[    5.141670] 0x000000000000-0x0000000c0000 : "preloader"
[    5.147338] 0x0000000c0000-0x000000140000 : "uboot"
[    5.152568] 0x000000140000-0x0000001c0000 : "uboot-env"
[    5.158148] 0x0000001c0000-0x000000200000 : "Factory"
[    5.163538] 0x000000200000-0x000004200000 : "firmware"
[    5.170381] 2 fit-fw partitions found on MTD device firmware
[    5.176049] 0x000000200000-0x000000520000 : "kernel"
[    5.181402] 0x000000520000-0x000004200000 : "rootfs"
[    5.186725] mtd: device 6 (rootfs) set to be root filesystem
[    5.192390] 1 squashfs-split partitions found on MTD device rootfs
[    5.198570] 0x000000960000-0x000004200000 : "rootfs_data"
[    5.204355] 0x000004200000-0x000084200000 : "usrdata"
[    5.209757] block2mtd: mtd0: [eMMC] erase_size = 64KiB [65536]
[    5.215758] rtc_mt7622 10212800.rtc: setting system clock to 2000-01-01T00:00:05 UTC (946684805)



[   13.494140] usb 1-1: new high-speed USB device number 2 using xhci-mtk
[   62.502204] Bluetooth: hci0: Failed to load firmware file (-11)

I guess this is because of mtd is broken in 5.4 (rootfs not found). Your log says it is set, but it seems not to be used as i see no init-process