[Banana Pi BPI-R64] Mainline OpenWRT image

Can you describe this a bit more? I have same behaviour like on r2 and no üroblems in bootmenu/uboot. Do you use a modified or upstream uboot? Maybe compare config with my one

I use upstream 2020.10 with the few patches on top (see package/boot/uboot-mediatek in OpenWrt tree). It works well with other MT7622 boards (Belkin RT3200/Linksys E8450), no problems with the serial port there. On the Bananapi serial RX has problems only with specific bytes sent, so maybe baud clocking slightly off or something like that.

Assigning GPIO function to PIN 88 happens automatically by the pinctrl-mt7622 driver when you request the GPIO PIN. Ie. that’s the mode which is set once you add the LED to gpio-leds, as that will request the PIN and thereby set it to GPIO mode (at least this is how pinctrl on those mtk SoCs is supposed to work)

I noticed that my 2 bpi boards (r2,r64) do not support specific usb2uart (e.g. with profilic chips),maybe this is the cause. I currently only using cp2102

You are right. I swapped the FTDI FT232R (could be a fake) for FTDI FT2232HL and now it works perfectly.

I want to tall that u-boot from graphin firmwere or firmware witch posted sinovoip don’t has this truble with serial console, they only appear in last OpenWRT.

I have try new build. Settings is saved fine. And I have noticed one detail, If you press arrow button many time during loading u-boot It will start response to keyboard.

Maybe there are more patches or DTS changes bundled into this U-Boot binary from @sinovoip? And yes, I’ve also noticed that only arrow keys in menu are affected and they do work after trying a lot of times. I suspect pinconf/pinctrl issue.

I have one more trouble, if I picked “Install bootloader and recovery to eMMC.” and try load from eMMC I take this:

[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000000000-0x00000000000001FF] "" (1 blocks)
[PART] [0x0000000000004400-0x00000000001FFFFF] "" (4062 blocks)

Device APC domain init setup:

Domain Setup (0x0)
Domain Setup (0x0)
Device APC domain after setup:
Domain Setup (0x0)
Domain Setup (0x0)
[get_part] part->nr_sects=2048, part->info->name=fip
[get_part] part->nr_sects=2048, part->info->name=ubootenv
[get_part] part->nr_sects=65536, part->info->name=recovery
[get_part] part->nr_sects=2007040, part->info->name=production
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=1, part->info->name=
[get_part] part->nr_sects=4062, part->info->name=
[BLDR] lk partition not found
load lk (ret=-1)
[BLDR] Second Bootloader Load Failed
PL fatal error...

And during Banana PI loading, Windows find new network. On earlier builds It Fixed by set MAC address in Network interface options but in last build it dont work.

Maybe try setting a fixed address in the bootloader environment as well, because apparently bootloader also brings up the interface to some level (haven’t checked).

fw_setenv ethaddr 11:22:33:44:55:66

(in OpenWrt)

or

setenv  ethaddr 11:22:33:44:55:66

(in U-Boot)

I have set ethaddr in U-boot, but this is don’t help. But if I open network settings in Windows It connect to network witch I set in Network interface ( for example Windows have find new network 68, but connected to network 60 witch mac addres set in Network interface options)

We need to tell U-Boot to pass down the MAC address to Linux. It works like that:

--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts	2021-02-18 18:06:59.890603978 +0000
+++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts	2021-03-03 21:47:52.562303132 +0000
@@ -18,6 +18,8 @@
 
 	aliases {
 		serial0 = &uart0;
+		ethernet0 = &gmac0;
+		ethernet1 = &gmac1;
 	};
 
 	chosen {

(at least this is how they do with U-Boot on sunxi, guess it’d work the same on this platform)

Was the eMMC empty at the time of installation? Because there is something lokking for lk partition, we don’t have such a partition. It should be bl2 looking for partition fip instead. Maybe your eMMC was already installed and the boot partition write protected, so the installer could not overwrite that old Preloader?

Yes on my eMMC had been install this is image https://cloud.mail.ru/public/cq89/AVqxejYqM . It contain 7 partitions:

But I don’t lock eMMC. And after that I had recovered previous firmware by command dd of=/dev/mmcblk0 bs=512 seek=0 if=openwrt-mediatek-mt7622-bpi_bananapi-r64-rootdisk-ext4-fullimage-emmc.bin And it flashed without troubles.

Apart from the content of the generic partition which you show above there are also two hardware protected boot areas on the eMMC (boot0 and boot1). The installer also needs to have write access to the boot0 partition of the eMMC. If this is write protected, the installer cannot work and will result in previous Preloader still sitting in boot0 hardware partition fail finding it’s lk partition. You will need to make sure that the boot0 hardware partition is not write protected in hardware. (ie. look into how to control eMMC in U-Boot, this is not not about GPT software partition on generic hardware partition but a whole separate thing)

Hi, this is my mmc info

MT7622> mmc info
Device: mmc@11230000
Manufacturer ID: 11
OEM: 100
Name: 008G3
Bus Speed: 26000000
Mode: MMC High Speed (26MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 7.3 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 7.3 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected

That looks all normal. I assume you prepared the installer SD Card in the proposed way, ie.

wget https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/openwrt-mediatek-mt7622-bananapi_bpi-r64-sdcard.img
wget https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/openwrt-mediatek-mt7622-bananapi_bpi-r64-initramfs-recovery.itb
wget https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/openwrt-mediatek-mt7622-bananapi_bpi-r64-squashfs-sysupgrade.itb

cat openwrt-mediatek-mt7622-bananapi_bpi-r64-sdcard.img openwrt-mediatek-mt7622-bananapi_bpi-r64-initramfs-recovery.itb > /dev/mmcblkX

blockdev --rereadpt /dev/mmcblkX

dd if=openwrt-mediatek-mt7622-bananapi_bpi-r64-squashfs-sysupgrade.itb of=/dev/mmcblkXp4

If installation using that does not work, please enter U-Boot console and make sure each step succeeds:

run sdmmc_read_emmc_hdr
run emmc_write_hdr
run sdmmc_read_emmc_bl3
run emmc_write_bl3
run sdmmc_read_recovery
run emmc_write_recovery
run sdmmc_read_emmc_bl2
run emmc_write_bl2

Thing is that the installer will only write new bl2 if everything else has succeeded, and that includes writing the recovery image which needs to be on the SD Card as well. I can see that this order is a bit stupid and I may change things in U-Boot after dinner :wink:

All troubles have been because I don’t install recovery image. After I install recovery image all work good. I think it need write big red letters, because initramfs imge perceived as preview system.

The idea behind requiring to also write the initramfs image is that this can then be used for dual-boot (recovery vs. production) in future and also allow flashing production image using that, so no serial console is required during installation as it can also be triggered on next reboot by using fw_setenv on system running from the SD Card.