[Banana Pi BPI-R64] Mainline OpenWRT image

There were pcie hardware-issues on r64

  • missing capacitors on tx lines (causing some cards not detected,maybe depend on bus speed)
  • limited current (causing tx power limited on mt7615)

Maybe you fall into one of these.they are known and should be fixed in next hw-rev,but idk if this hardware is ready

there is a limitation that only one pcie-slot supports usb passthrough (afair the one shared with sata). So if card needs this (like some 4g modems) cards do not work correctly (but should shown up in lspci)

I was looking through this thread, and yes there are some issues with those cards at least on older kernels (Iā€™m using 5.10).

Do you have any info about those caps? May be it possible to add them like changing protective resistors?

only this: [BPI-R64] PCIe issues

pcie-splitting is not yet merged to mainline, but maybe existent in openwrt

https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

Yes, we got both patches in recent OpenWrt with Linux 5.10:

I know it has been discussed before, but the Sinovoip support pages disappeared, so I canā€™t find the method for setting permanent eth1 (wan) and eth0 (br-lan) MAC address. Is there any way to set it in U-boot or elsewhere?

Afair that was nowhere in official documents,but i have it written down here (os independ,but ifupdown/systemd maybe not working in openwrt):

https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/network/start#mac-address

Thanks, but unfortunately I couldnā€™t make it in OpenWRT. There was a setenv command in previous u-boot menu, for setting mac address, but it is gone.

afair uboot-way depends on right dts. it needs mac-address property and alias for ethernet-node

Run this in openwrt:

fw_setenv ethaddr newaddress

Or in uboot

setenv ethaddr newaddress

saveenv

1 Like

I applied the fw_setenv ethaddr command, and it changed the MAC address indeed (after rebooting). Now every interface has the same MAC address. I think it changed the internal bridge address. Is there any way to specify it separately for the wan/eth1 also? Perhaps it is not so important, because br-lan and wan are on different segments, so there should be no ARP conflict.

It changes adress of eth0 (gmac between soc and switch). eth1 should not exist and wan (dsa port) is connected to eth0 too

Independently of the main MAC address you may configure an individual mac address for wan port (or any other port) in OpenWrt. This works in LuCI:

or in CLI:

uci add network device
uci set network.@device[-1].name= 'wan'
uci set network.@device[-1].macaddr= '02:03:04:05:06:07'

Thanks, it worked :+1:

I upgraded luci-mod-network and it handles the bridge interface differently that it used before. But now the LAN bridge does not have any fixed IP address and it does not act as a DHCP server. What should I change in the new config? Here is the bridge related section in the /etc/network/config:

config interface 'lan'
    option proto 'static'
    option ipaddr '192.168.0.1'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option ifname 'br-lan'

config device
    option name 'br-lan'
    option type 'bridge'
    list ports 'lan1'
    list ports 'lan2'
    list ports 'lan3'
    list ports 'lan4'

I guess you need to define br-lan before assign ip-address to itā€¦so basicly swapping both blocks

If I add Option type 'bridge' to the config interface 'lan' section, it already gets IP address, but still not leasing DHCP addresses to clientsā€¦ I wonder if there is a comprehensive description of the network config options, or at least a sample configuration with the changed syntax.

Edit: I can add br-lan and the ports manually with brctl. Then it works. But when I open the Network - Interfaces configuration page, it says:

The existing network configuration needs to be changed for LuCi to function properly. Upon pressing ā€œContinueā€, bridges configuration will be moved from ā€œinterfaceā€ sections to ā€œdeviceā€ sections the network will be restarted to apply the updated configuration.

But after this change the lan1ā€¦lan4 ports are not bridged to eth0, and the bridged ports are down. I can restore it only if I add option type 'bridge to the config interface ā€˜lanā€™ section, and add the lan1 ā€¦ lan4 interfaces to the bridge manually with brctl addif br-lan lan1 and same for lan2 lan3 lan4. However, this is not compatible with LuCi. LuCi version: git-21.140.43486-398982f

After upgrading the kernel to 5.10.39 it works fine. Edit: it worked fine, but today my wan6 interface ā€œdisappearedā€. It is present in LuCi, but not showing up by ifconfig:

root@OpenWrt:/sys/class/net# ifconfig | grep Link
`br-lan    Link encap:Ethernet  HWaddr 6A:55:75:51:DE:5A`
      inet6 addr: fe80::6855:75ff:fe51:de5a/64 Scope:Link
eth0      Link encap:Ethernet  HWaddr 6A:55:75:51:DE:5A
      inet6 addr: fe80::6855:75ff:fe51:de5a/64 Scope:Link
ifb4eth1  Link encap:Ethernet  HWaddr 4A:80:25:54:53:95
      inet6 addr: fe80::4880:25ff:fe54:5395/64 Scope:Link
lan1      Link encap:Ethernet  HWaddr 6A:55:75:51:DE:5A
lan2      Link encap:Ethernet  HWaddr 6A:55:75:51:DE:5A
lan3      Link encap:Ethernet  HWaddr 6A:55:75:51:DE:5A
lan4      Link encap:Ethernet  HWaddr 6A:55:75:51:DE:5A
lo        Link encap:Local Loopback
wan       Link encap:Ethernet  HWaddr 6A:55:75:51:DE:5B
      inet6 addr: fe80::6855:75ff:fe51:de5b/64 Scope:Link
root@OpenWrt:/sys/class/net# ls
6in4-WAN6  br-lan     eth1       lan1       lan3       lo         wan
6in4-wan6  eth0       ifb4eth1   lan2       lan4       sit0       wlan0

Also I created a second 6in4-WAN6 device by mistake. Maybe this caused the confusion. Is there any way to remove it? And how could I restore the wan6 interface? My kernel is 5.10.39 from snapshot image.

I try to setup Samba4 server via Lui. It seems no working anymore after update to 5.10.39.

For those who interested in fully-working internal Wi-Fi - since mt76 driver loads EEPROM data for MT7622 from MTD partition, itā€™s possible to place this data into SPI-NAND chip where mt76 driver can found it.

You will need this patch for kernel (place to target/linux/mediatek/patches-5.10/): 116-dts-bpi64-add-wmac-eeprom-partition.patch (504 Š‘Š°Š¹Ń‚Š°) and this for u-boot (place to package/boot/uboot-mediatek/patches/): 405-bananapi_bpi_r64_add_wmac_eeprom_partition.patch (796 Š‘Š°Š¹Ń‚Ń‹)

This patches adds partition with eeprom (called ā€œrfā€) to SPI-NAND/mtd. After building and installing youā€™ll need to flash MT7622_EEPROM.bin (1 ŠšŠ‘) into ā€œrfā€ partition:

mtd erase rf
mtd write MT7622_EEPROM.bin rf

After reboot youā€™ll get fully-working internal Wi-Fi with fixed MAC-address.

1 Like

Is there a way to add rf only to spi-nand without touching gpt from sdcard/emmc? I do not see link to spi-nandā€¦it seems to use current bootdevice as bootargs are changed too

How do mt76 driver search in spi nandā€¦afair it looks only in current devices mtd partitions which is sd/emmc