Banana Pi BPI-R2 OPENWRT 19.07 Image

I downloaded bpi_bananapi-r2-squashfs-img.gz file.

The bpi_bananapi-r2-squashfs-img.gz image will boot if you write it to an SD card.

To boot from eMMC it also works (despite saying SDMMC_BOOT at the start) because the important part which needs to says EMMC_BOOT is in the boot partition /dev/mmcblk0boot0.

To install manually you need not only to write the image to the main user area of the eMMC as you did, but also write the eMMCboot.bin file (from the FAT boot partition /dev/mmcblk0p2) to the eMMC boot region.

If you boot from SD there is an option in the U-Boot menu to install it to eMMC, which should set up the boot partition for you. Please let me know if it doesn’t work for you.

Hi, I applied what you said and failed again. I write the commands I tried below: (I named the file I downloaded as “mtk-bpi-r2-EMMC.img”)

dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0
dd if=eMMCboot.bin of=/dev/mmcblk0p2

partitions like this. but not starting.

can you prepare a guide from the beginning? I don’t know much. thanks a lot :slight_smile:

echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=eMMCboot.bin of=/dev/mmcblk0boot0

You’ll also want to fix the contents of /dev/mmcblk0p2 now you overwrote them.

But the easiest option is just to write the image to an SD card, boot from that, then select 'Install OpenWrt from SD to internal eMMC" from the boot menu.

I was finally able to see the u-boot line you mentioned. but again there is a problem. I write all commands:

echo 0 > /sys/block/mmcblk0boot0/force_ro
zcat /tmp/BPI-R2-EMMC-boot0-DDR1600-20191024-0k.img.gz | dd of=/dev/mmcblk0boot0 bs=1  seek=0 conv=notrunc
zcat /tmp/openwrt-mediatek-mt7623-bpi_bananapi-r2-squashfs-img.gz | dd of=/dev/mmcblk0 bs=10M conv=notrunc
sync

I turn off the device. I remove the sd card and install the latest snapshot version from the computer. I see the line you mentioned when I plug it in and open it again.

1

I select “install openwrt from sd to internal emmc”. and it starts to load.

When the process is completed, OPENWRT text is displayed. but I cannot connect to the device with win-scp. also does not give ip-address. Giving a manual ip-address does not work. In addition, when I try to restart the device, it does not turn on. I remove the sd card and it does not open again.

You can find the transaction details in the attachment.

process.txt (46.7 KB)

I think that should be the same as the OpenWrt eMMCboot.bin file that I told you to use. I also think it doesn’t matter because the ‘Install to internal eMMC’ option from U-Boot will overwrite it with eMMCboot.bin anyway.

Let’s try to do one thing at a time. You can boot into OpenWrt either just from the SD card, or by selecting ‘Boot from eMMC’ from the boot menu when it starts from SD. Remember the two systems are different so config changes you apply in one won’t apply to the other, of course. They’ll even have different MAC addresses. So you can investigate the Ethernet problem that way and give more details.

Probably best to start with the preloader problem though. Can you show the output of “mmc partconf 0” at the U-Boot prompt? And the output of “hexdump -C /dev/mmcblk0boot0 | head -50” from Linux?

network config can be a bit tricky because of dsa-driver.

You have to put first eth0 up and then assign ip-address to wan/lanX (or create a bridge for all lan-ports) and put this up.

Ah yes, if you’re just poking at eth0 with ifconfig you’re not going to get far. But the standard OpenWrt config ought to work; it should have attempted DHCP/RA and got IPv6 and Legacy IP addresses on the ‘wan’ port, and it should be 192.168.1.1 on the LAN ports by default out of the box.

At this point I suspect @frank-w might be the best person to help walk through the preloader installation. I’ll watch and learn how to fix my u-boot scripting, when you find what’s wrong :slight_smile:

how can i do what you mentioned? what commands should I write?

ip link set eth0 up
ip addr add 192.168.1.1/24 dev lan0 #or lanbr0 if using bridge
ip link set lan0 up

Maybe putting them down before if they set up in wrong order

https://github.com/openwrt/openwrt/pull/3230 may well fix the Ethernet issue. I’m more interested in the preloader not working when written to flash.

Can you show the contents of /dev/mmcblk0boot0, and the output of “mmc partconf 0” from u-boot please?

For the ethernet patch i remember that there was a discussion that mac_config-callback was misused here. The only info i found now on quick search was this: https://www.spinics.net/lists/netdev/msg642532.html

I can’t thank you enough. “0402-net-ethernet-mtk_eth_soc-Always-call-mtk_gmac0_rgmii.patch” I added and compiled this patch. solved my problem. I can now enter the luci interface. I can connect with win-scp. I use the device as a pppoe router. there is an interesting situation. When I download a file with IDM, 100 mbps download speed. but when I do speed tests from sites like speedtest.net, fast.com, dslreports.com, I get 4-5 mbps results. what could be the reason for this?

Your partconf remembers me on this setting…

This needs to have value 0x48 to boot from it

My boards all had 0x0

You can set it in running linux (my wiki) with mmc-utils (compiled version on my repo

mmc extcsd read /dev/mmcblk0 | grep PARTITION_CONFIG
mmc bootpart enable 1 1 /dev/mmcblk0

Or with uboot (my wiki)

mmc partconf 0
mmc partconf 0 1 1 0

btw. i’ve pointed david to the missing Patch :wink: https://lore.kernel.org/linux-mediatek/[email protected]/

and how do you make download (from/to - using routing,nat, encryption,…) and speedtest (encryption,packetsize,…)

The Ethernet patch is now included in my OpenWrt PR#3230.

My U-Boot script to install to eMMC should be setting the partconf correctly with “mmc partconf 0 1 1 0”

The ethernet patch was not merged because in mac_config speed should not be used. These parts should be set in mac_link_up…so basicly the mainline rgmii_adjust function and trgmii clock setup should be done in mac_config.

I prepared a patch and send to rene,because call of rgmii_adjust is only called after a long condition which needs to be also checked in mac_link_up

https://github.com/frank-w/BPI-R2-4.14/commits/5.8-trgmii

Original patch was now merged to netdev

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/log/

Forwarded to stable-mail to get it fixed in 5.4

Guys, did anyone do a Iperf on BPI-R2 on Openwrt Master Trunk? My top speeds on Iperf on WAN to LAN are around 450/500Mbps tops on a Gigabit connection. Network design is simple: PFsense x86 firewall (acts as WAN Iperf) -> BPI-R2 -> Windows 10 desktop (acts as LAN Iperf). Activating Software offloading doesn’t seem to help at all. CPU usage is fine, highest core usage tops at around 55%.

I replaced BPI-R2 for similar hardware (NanoPi R2s) and I get 850Mbps speed on the same setup (700Mbps with software offloading disabled).

Anyone else tried a Iperf speed test on it?

Have you tried adding trgmii-patch or changing to rgmii in dts?