[Banana Pi BPI-R64] Mainline OpenWRT image

Seems like partitions have same size in your images only ext4 filesystem is resized which leads to this error:

So fdisk-params in buildscript seems wrong.

I’m not sure if this does create the partition itself

@dwmw2 can you help here?

You need to modify partition table inside https://github.com/graphine27/openwrt/blob/r64-emmc/target/linux/mediatek/image/mtk-bin-r64/GPT_EMMC You can do it by booting a distribution from SD, then use fdisk/gdisk to modify. Then use the backup partition table function to replace GPT_EMMC with modified one.

Yes, ptgen generates a (DOS) partition table. That script is creating the full device image, with preloader, U-Boot in the first partition (at the fixed location because we haven’t fixed the preloader to use the partition table yet), etc.

Thank you. But I think easier change it in HexEditor

01

01 00 01 = 10001hex = 65537 dec = beginning of section

00 20 04 = 42000hex=270337dec = end of section or beginning of next section + 1

105 Mb * 1024 *1024 = 110100480 byte / 512 (size of sector) =215040 + 65537 = 280577 dec = 44801hex - 1 = 44800 = 00 48 04

00 20 04 need change to 00 48 04

Mainline openwrt creates a mbr only partition table? Where does @deema gets the gpt (from @graphine s repo)? I did not see the gpt file in upstream

Hi. I have create GPT_EMMC with 7Gb root partition. Now you can set root section size up to 7Gb.

But I want notice that just resize partition not enough. You need change header CRC32 and partition table CRC32. Here they are:

header

Gpt file locate in r64-emmc branch.

i don’t see it: https://github.com/openwrt/openwrt/branches

so i guess you talk about graphines repo (topic is “Mainline Openwrt”): https://github.com/graphine27/openwrt/tree/r64-emmc/target/linux/mediatek/image/mtk-bin-r64

The ptgen utility can generate GPT too, but doesn’t for Banana Pi. It generates MBR for the Banana Pi R2 image, and I haven’t finished adding full-image support for Banana Pi R64 yet because I need to get a workable build of ATF and other things (isn’t there an open source one now?). But R64 probably would use GPT, when I get there.

Atf for r64 is available in my github. I only have problem on reboot where mmc is not recognized

I’ve rebased the repo to the latest openwrt sources. I also see in nbd’s staging tree there is WIP support for linux 5.10 on mediatek target, looking good. Firewall4 is also introduced in jow’s staging tree, which uses nftables, this should allow better flow offloading without that many patches (like iptables has now).

5.10 has a unfixed issue for bpi-r2 pcie. My repo is fixed, maybe you can add the 2 Patches if 5.10 is still unfixed

Whoever tried to try to build with the overlays section? This is very critical. If a failure occurs while writing, mmcblk0p7 is in read-only mode. This causes a number of problems that will not allow the router to work fully.

But this is flash memory nature. If you shat down electricity when writing occurs it can be fail. So there is a safe extraction in windows.

How to get the SATA port worked?

it’s said in the Wiki that it needs to to give GPIO90 low level

the gpio chip is visible but not accessible for me

root@OpenWrt:~# cat /sys/kernel/debug/gpio gpiochip0: GPIOs 409-511, parent: platform/10211000.pinctrl, pinctrl_moore: gpio-409 ( |factory ) in hi IRQ gpio-463 ( |mt753x-reset ) out hi gpio-490 ( |cd ) in hi IRQ ACTIVE LOW gpio-497 ( |bpi-r64:pio:red ) out lo gpio-498 ( |bpi-r64:pio:green ) out lo gpio-499 ( |asm_sel ) in lo gpio-511 ( |wps ) in hi IRQ

root@OpenWrt:~# echo 499 > /sys/class/gpio/export ash: write error: Resource busy

any idea?

You have to define in dts see here

edit: changed link to new version with fixed “okay”

Just like @frank-w said. The dts used in my repo is https://github.com/graphine27/openwrt/blob/r64-emmc/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts

But you have sata and sata_phy still disabled (any asm_sel needs to be output-low). I see i have ok instead of okay…it needs to be “okay”

btw. your “resource busy” is because the gpio is blocked by gpio-hog driver so you cannot access it via sysfs or similar

thank you, it works!