Banana Pi BPI-R2 OPENWRT 19.07 Image

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?

Will do later this week @frank-w and try to report back the findings.

Although in the Openwrt Kernel bump to 5.4.58 they specifically deleted the rgmii patch according to the commit https://github.com/openwrt/openwrt/commit/da986035973a8c803e6f193ae502ff65e6d551c3

Regards, Rod.

He guys, please go two steps back. In the middle of the thread I lost the trail.

my environment: R2 running Lexas 18.06.2 openwrt forks

I have successfully compiled the official openwrt 19.7.3-bins, created an img using a shellscript bpi-image.sh, but cant get boot the sd-card (after some screens u-boot says volume missing)

Transferring the images to the running system and burn them into mmc according to the howto by frank-w (https://openwrt.org/toh/sinovoip/sinovoip_banana_pi_r2) not working because /cat/proc/mtd is empty atm.

  1. Which settings had to set in menuconfig for running kernel.bin and sysupgrade.bin?
  2. Howto insert the needed patches in buildroot?
  3. Often asked, rarely answered: Howto right create the sd-card image from the bin´s? Are there relatives between menuconfig settings and the dd-commands?

Thanks in advance. I´m willing to document the full process in a howto for newbies

Regards Gotthard

Mtd on 5.4 ist broken, at least in openwrt…try ext4-rootfs

David posted some patches to create an image which can be burned to sdcard. Imho they should be upstream…but you have to change mtd rootfs to ext4

is Lexas 18.06.2 fork running kernel 5.4? in menuconfig I have activated ext4 for my 19.07.3 image

Thanks for fast reply, much appreciated

I´m longing for the weekend, the best of all wifes is outside, so I can hack without end

Gotthard