User Tools

Site Tools



en:bpi-r3:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:bpi-r3:start [2022/11/30 22:47] – [Network connections] franken:bpi-r3:start [2024/03/25 18:07] (current) – [Network connections] frank
Line 4: Line 4:
 ===== Hardware ===== ===== Hardware =====
  
-  * mt7986a SoC +  * MT7986(Filogic 830) quad core ARM A53 SoC 
-  * mt7531 Ethernet-switch+  * MT7531A Ethernet-switch 
 +  * 2G DDR RAM 
 +  * 8G eMMC flash, SPI-NAND (128 MiB), SPI-NOR (32 MiB) 
 +  * dual-band wifi: 
 +    * 2.4G use MT7975N 
 +    * 5G (wifi 6/5.8GHz,not 6E) use MT7975P frontend 
 +  * 2 SFP 2.5GbE and 5 GbE RJ45 ports 
 +  * mPCIe slot with only USB 2.0 connected for 4G modem 
 +  * M.2 slot key-M with only PCIe x2 interface (no sata/usb) for nvme (key B+M) or wifi-card for 6E (maybe adapter needed)
  
 +V1.0:
 +
 +{{:en:bpi-r3:bpi-r3_top.jpg?direct&300 |}}{{ :en:bpi-r3:bpi-r3_bottom.jpg?direct&300 |}}
 +
 +
 +V1.1:
 +
 +{{:en:bpi-r3:bpi-r3_11_top.jpg?direct&300 |}}{{ :en:bpi-r3:bpi-r3_11_bottom.jpg?direct&300 |}}
 +==== debug-uart ====
 +
 +3v3 TTL
 +
 +Usb2serial adapters supported: ch340 (no G),cp2104,FT4232
 +
 +With Profilic, cp2102, ch340G wifi firmware does not start [[https://github.com/openwrt/mt76/issues/702|issue-report]]
  
-{{:en:bpi-r3:bpi-r3_top.jpg?direct&400 |}}{{ :en:bpi-r3:bpi-r3_bottom.jpg?direct&400|}}+Gnd-gnd,rx-tx,tx-rx
  
 +115200 8n1 (8databits,1 startbit), no flow control
 ==== bootmedium ==== ==== bootmedium ====
  
   * SD / eMMC sharing 1 mmc-controller in SoC   * SD / eMMC sharing 1 mmc-controller in SoC
     * SD 4bit bus, eMMC 8bit     * SD 4bit bus, eMMC 8bit
-    * switched first 4 data-lanes by sw6 (bottom)+    * switched first 4 data-lanes by sw6/D (bottom on v1.0)
   * SPI NAND/NOR sharing SPI0-Bus   * SPI NAND/NOR sharing SPI0-Bus
-    * CS switched by sw5+    * CS switched by sw5/C
  
-sw2 on top of board near debug-uart chooses between SPI and MMC+sw2/B on top of board near debug-uart chooses between SPI and MMC
  
-{{ :en:bpi-r3:bpi-r3-bootsel.png?nolink |}}+see [[uboot#bootmedium_selection]] for boot selection table
 ==== Network connections ==== ==== Network connections ====
  
  
 <code> <code>
-gmac1----(p6)mt7531(P1-4)--LANx4 +gmac1 (eth0) ---- (p6)mt7531(P0) ---- WAN 
-                     (P0)----WAN +                            (P1-4) -- LANx4 
-                     (p5)---right SFP slot +                            (p5/lan4---- right SFP slot (sfp2) 
-gmac2----left SFP slot+gmac2 (eth1) ---- left SFP slot (sfp1)
 </code> </code>
  
Line 35: Line 59:
 === SFP === === SFP ===
  
-We have both sfp recognized and working +We have both sfp slots recognized and working
  
   mount -t debugfs none /sys/kernel/debug/   mount -t debugfs none /sys/kernel/debug/
-  cat /sys/kernel/debug/sfp1/state+  ethtool -m eth1 
 +  cat /sys/kernel/debug/sfp*/state 
 + 
 +Some sfp are still not recognized (e.g. gpon).maybe quirks are needed. 
 + 
 +After some phylink-conversion there are some issues with 2g5 sfp on left sfp/eth1. A workaround is disabling autoneg on the interface 
 + 
 +  ethtool -s eth1 autoneg off 
 + 
 +Left sfp does not support vlan in linux 6.1 because tag is stripped. 
 + 
 +Power: "All SFP power supplies are connected to the system VDD33" which is 3v3/8A [[https://forum.banana-pi.org/t/banana-pi-bpi-r3-router-board-with-mediatek-mt7986-filogic-830-support-wi-fi-6-6e-2-5gbe-sfp/12933/31|source]] [[https://forum.banana-pi.org/t/bpi-r3-support-for-sfp-vdsl-modem/15320/5|Dts patch from Daniel]] I sent 3W patch to ML... 
 + 
 +== compatibility == 
 + 
 +  * class: Fibre MM/SM, Copper RJ45, ONT 
 +  * bandwidth: 1G/2G5 (only) 
 + 
 +^ class ^ vendor / short ^ part no ^ supported bandwidth ^ state ^ Link ^ comment ^ 
 +| Fibre MM | H!Fibre for cisco | ASF85-24-X2-D | 1000baseX only | working | [[https://www.amazon.de/gp/product/B073VM49BK?th=1|Amazon]] [[https://www.hifiber.com/item/ASF85-24-X2-D/1000base-sx-sfp-850nm-550m-mmf-transceiver-module-customized.html|vendor]] | {{ :en:bpi-r3:hifibre_glc-sx-mmd.txt |}} | 
 + 
 +2g5 sfp currently detected only if autoneg is turned off. 
 + 
 +  ethtool -s eth1 autoneg off 
 +  ethtool -s lan4 autoneg off 
 + 
 +Eric works on phy driver which looks very good now for 6.6 (6.5-next),but now yet posted upstream.
  
 === WIFI === === WIFI ===
Line 46: Line 95:
  
 [[WLAN]] [[WLAN]]
 +
 +Antenna mounting https://forum.banana-pi.org/t/how-to-mount-the-antenna-to-the-box/14429/4
 +
 +Antenna order by band (5g in corners): https://forum.banana-pi.org/t/how-to-mount-the-antenna-to-the-box/14429/15
 +
 +WED (wireless dispatch - hw offloading):
 +
 +https://forum.banana-pi.org/t/wed-and-beamforming-on-bpi-r3/15099/16
 +
 +> You need to edit /etc/modules.conf to enable WED. Add a line as follow:
 +> options mt7915e wed_enable=Y
 +
 +
 +  zgrep 'WED' /proc/config.gz
 +  lsmod
 +  cat /sys/module/mt7915e/parameters/wed_enable
 +  conntrack -L #should show HW_OFFLOAD when traffic is offloaded
 +  cat /sys/kernel/debug/ppe*/bind #should show BND (same for entries file)
 +  
 +Example configs: https://forum.banana-pi.org/t/hostapd-wifi-speed-not-reach-the-maximum-in-debian11/17642/14
 ==== USB / PCIe ==== ==== USB / PCIe ====
 +
 +The USB3.0 socket of R3 can only provide a maximum current of 1400mA. [[https://forum.banana-pi.org/t/usb-device-constantly-reconnects-on-bpi-r3/14838/3?u=frank-w|source]]
  
 {{ :en:bpi-r3:bpi-r3-usb-pcie.png?nolink |}} {{ :en:bpi-r3:bpi-r3-usb-pcie.png?nolink |}}
Line 52: Line 123:
 mPCIe slot is usb-only with SIM connector (bottom of board). PCIe is mapped to m.2 key-m slot for nvme SSD mPCIe slot is usb-only with SIM connector (bottom of board). PCIe is mapped to m.2 key-m slot for nvme SSD
  
-Sata possible via M.2 KEY-M 2lane interface on bottom side of board+Sata possible via M.2 KEY-M 2lane interface on bottom side of board (needs PCIe-2-Sata controller!)
  
 I tested mpcie slot with an em7455 [[LTE]] module (+key b adapter) I tested mpcie slot with an em7455 [[LTE]] module (+key b adapter)
 +
 +for m.2-slot there is a patch if nvme is not recognized: https://forum.banana-pi.org/t/bpi-r3-nvme-connection-issue/14563/17
 ==== GPIO ==== ==== GPIO ====
  
 [[gpio]] [[gpio]]
  
 +==== thermal ====
 +
 +  cat /sys/class/thermal/thermal_zone0/temp
 +
 +Thermalpad size: https://forum.banana-pi.org/t/banana-pi-r3-fan-with-pwm/14406/28
 +
 +Change pwm of fan from 5v to 12v (R317/R318):
 +[[https://forum.banana-pi.org/t/banana-pi-r3-fan-with-pwm/14406/47|Shematic]]
 +[[https://forum.banana-pi.org/t/banana-pi-r3-fan-with-pwm/14406/56|location on board]]
 +
 +Mt76:
 +
 +  cat /sys/class/ieee80211/phy*/hwmon*/temp1_input
 +
 +2g4/5g difference: https://github.com/openwrt/mt76/issues/729
 +
 +FAN-Connector: JST PH 2mm pin-spacing
 +
 +5V pwm fan: https://de.aliexpress.com/item/1005003663915828.html
 +
 +trigger pwm-fan:
 +
 +    echo 1 > /sys/class/thermal/cooling_device0/cur_state
 +==== leds ====
 +
 +available via sysfs:
 +
 +  * green: power
 +  * blue: status
 +
 +additional with function
 +
 +  * wf2g
 +  * wf5g
 +  * ssd: blinks on write access on m2-slot (nvme)
 +  * lte: reported to work by daniel
 +
 +Wifi-leds are fixed in my 6.1 tree and in mt76 master.
 +
 +==== case ====
 +
 +https://forum.banana-pi.org/t/banana-bpi-r3-3d-printed-case/14246/
 +
 +Case from finas:
 +https://www.printables.com/model/335936-banana-pi-bpi-r3-modular-case
 +
 +Higher version added here:
 +
 +
 +https://www.dropbox.com/s/tng2pi2ud6qd2vo/Banana%20PI%20RPI-3%20case.stl?dl=0
 ===== Software ===== ===== Software =====
  
 ==== partition layout ==== ==== partition layout ====
 +
 +blocks á 512 byte
 +
 +^      SD  ^  eMMC  ^
 +^ bl2 |  34 - 8191  |  in boot0  |
 +^ u-boot-env |  8192 - 9215  ||
 +^ factory |  9216 - 13311  ||
 +^ fip |  13312 - 17407  ||
 +^ kernel |  17408 - 222207 (100MB)  ||
 +^ rootfs |  222208 - 12805120 (6144 MB)  ||
 +
 +bytes (start,size in hex)
 +^      NAND  ^  NOR  ^
 +^ bl2 |  0x0, 0x80000  |  0x0, 0x40000  |
 +^ u-boot-env |  -  |  0x40000, 0x40000  |
 +^ reserved  |  -  |  0x80000, 0x80000  |
 +^ factory |  0x80000, 0x300000  |  -  |
 +^ fip |  0x380000, 0x200000  |  0x100000, 0x80000  |
 +^ recovery |  -  |  0x180000, 0xa80000  |
 +^ fit |  -  |  0xc00000, 0x1400000  |
 +^ ubi |  0x580000, 0x7a80000  |  -  |
 +
 +
 +=== GPT binaries ===
  
 32MB kernel/256MB root: 32MB kernel/256MB root:
 {{ :en:bpi-r3:gpt_sd-20220216.bin |}} {{ :en:bpi-r3:gpt_sd-20220216.bin |}}
  
-create own partition table: (currently i try to port to python3,but get crc error, so only python2-support):+create own partition table: (currently i tried to port to python3,but get crc error, so only python2-support):
  
 https://github.com/frank-w/BPI-R3-bsp/tree/r3-atf/tools/mediatek/gpt_editor https://github.com/frank-w/BPI-R3-bsp/tree/r3-atf/tools/mediatek/gpt_editor
Line 74: Line 221:
 Created a gpt with 100mb kernel+6GB root partition with an python2 venv Created a gpt with 100mb kernel+6GB root partition with an python2 venv
  
-https://github.com/frank-w/BPI-R3-bsp/blob/r3-atf/gpt_sdmmc_100m6g.img 
  
 +https://github.com/frank-w/u-boot/blob/r3-atf/gpt_sdmmc_100m6g.img
 +
 +https://github.com/frank-w/u-boot/blob/r3-atf/gpt_emmc_100m6g.img
 +
 +Gpt img file may cause errors when using parted (main and backup gpt corrupt) or gpt errors in uboot on reboot. This can be also caused by backup-gpt not overridden by image (end of disk).
 +
 +Parted:
 +
 +  Error: Both the primary and backup GPT tables are corrupt.  Try making a fresh table, and using Parted's rescue feature to recover partitions.
 +
 +Uboot (sw reboot):
 +<code>*** ERROR: Can't read GPT Entries ***
 +find_valid_gpt: *** ERROR: Invalid GPT ***</code>
 +
 +This can be fixed with sgdisk by exporting and re-importing the gpt
 +
 +  sudo sgdisk --backup=bpi-r3_sgdisk.gpt /dev/sdb
 +  sudo sgdisk --load-backup=bpi-r3_sgdisk.gpt /dev/sdb
 +
 +=== manual GPT creation ===
 +
 +{{ :en:bpi-r3:creategpt.sh |script for creating gpt with sgdisk/losetup}} bl2-partition needs legacy-boot flag!
 +
 +=== Emmc partition creation ===
 +
 +Todo...currently only via linux initrd from nor/usb
 +
 +It is possible to create gpt in uboot. Example for rk3568:
 +
 +https://source.denx.de/u-boot/u-boot/-/blob/master/include/configs/rk3568_common.h#L29
 +
 +https://elixir.bootlin.com/u-boot/latest/source/include/configs/rockchip-common.h#L85
 +
 +This creates a env var with the partition definition for rk3568 (not bpi-r3):
 +
 +<code>
 +"uuid_disk=${uuid_gpt_disk};" \
 +"name=loader1,start=32K,size=4000K,uuid=${uuid_gpt_loader1};" \
 +"name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};" \
 +"name=trust,size=4M,uuid=${uuid_gpt_atf};" \
 +"name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \
 +"name=rootfs,size=-,uuid="ROOT_UUID
 +</code>
 +
 +Which can be used like this:
 +
 +  mmc dev 0
 +  gpt write mmc 0 $partitions
 +
 +defined table this way (blocks only):
 +
 +<code>
 +setenv partitions "uuid_disk=${uuid_gpt_disk};name=gpt,start=0,size=34,uuid=${uuid_gpt_table};name=u-boot-env,start=8192,size=1024,uuid=${uuid_gpt_env};name=factory,start=9216,size=4096,uuid=${uuid_gpt_factory};name=fip,start=13312,size=4096,uuid=${uuid_gpt_fip};name=kernel,size=100M,uuid=${uuid_gpt_kernel};name=rootfs,size=0,uuid=${uuid_gpt_rootfs}"
 +</code>
 +
 +but i got error on write...maybe because a gpt already exists
 +
 +<code>
 +MT7986> printenv partitions
 +partitions=uuid_disk=;name=gpt,start=0,size=34,uuid=;name=u-boot-env,start=8192,size=1024,uuid=;name=factory,start=9216,size=4096,uuid=;name=fip,start=13312,size=4096,uuid=;name=kernel,size=100M,uuid=;name=rootfs,size=0,uuid=
 +MT7986> mmc dev 0
 +switch to partitions #0, OK
 +mmc0(part 0) is current device
 +MT7986> gpt write mmc 0 $partitions
 +Writing GPT: error!
 +</code>
 ==== atf / u-boot ==== ==== atf / u-boot ====
  
Line 86: Line 298:
 ==== linux ==== ==== linux ====
  
-[[https://patchwork.kernel.org/project/linux-mediatek/list/?series=&submitter=&state=*&q=Mt7986&archive=true&delegate=|patches for mt7986]] +Own repo: https://github.com/frank-w/BPI-R2-4.14/commits/6.1-main
- +
-Own repo: https://github.com/frank-w/BPI-R2-4.14/commits/5.19-r3+
  
 <code> <code>
Line 94: Line 304:
 ./build.sh #build kernel ./build.sh #build kernel
 </code> </code>
-Then copy bpi-r3.itb to card and start from uboot with commands listed above (setenv, fatload, bootm)+Then copy bpi-r3.itb to card and start from [[uboot#booting_kernel|u-boot]]
  
 === openwrt === === openwrt ===
  
-https://git.openwrt.org/?p=openwrt/staging/nbd.git;a=tree;f=target/linux/mediatek/patches-5.15;hb=HEAD+configuration[[openwrt]]
  
-https://git.openwrt.org/?p=openwrt/staging/dangole.git;a=shortlog;h=refs/heads/r3-mt7986+https://git.openwrt.org/openwrt/openwrt.git
  
 Build instructions: Build instructions:
 https://forum.banana-pi.org/t/banana-pi-r3-bsp-source-code/14257/2 https://forum.banana-pi.org/t/banana-pi-r3-bsp-source-code/14257/2
 +
 +Or using firmware selector (currently only snapshot): https://firmware-selector.openwrt.org/ (adding luci-ssl)
 +
 +changing to kernel 6.1: https://forum.banana-pi.org/t/wed-and-beamforming-on-bpi-r3/15099/37
 +
 +Install: https://forum.banana-pi.org/t/install-openwrt-snapshot-on-bpi-r3/14231/7?u=frank-w
 +
 +  opkg update
 +  opkg install luci-ssl
 +
 +Change network config without luci: https://forum.banana-pi.org/t/banana-pi-r3-cant-save-anything-in-luci/14658/15?u=frank-w
 +
 +Add more space on storage:
 +https://forum.banana-pi.org/t/bpi-r3-change-or-add-partion-to-overlay/14240/12
 +https://forum.banana-pi.org/t/cannot-resize-my-root-partition-on-bpi-r3/13937/5
 +
 +Modifications from user va1der: https://forum.banana-pi.org/t/bpi-r3-openwrt-whats-the-best-way-to-use-the-rest-of-my-space-on-my-sd-card/15675/10
 +
 +parted way from user ned14: https://forum.banana-pi.org/t/bpi-r3-openwrt-23-05-0-how-to-extend-production-partition/16572/4
  
 === debian === === debian ===
 +
 +create image with build.sh createimg from my uboot-repo (atf-r3 branch after building uboot+atf) and add rootfs+kernel
 +
 +generated GPT from mtk-script has some problems with parted (partprobe reports main gpt is damaged), but it can be mounted with losetup -P
 +
 +  sudo losetup -P $LDEV $IMGDIR/$IMGNAME.img
 +
 +writing image to sdcard (image not ready yet):
 +
 +  gunzip -c bpi-r3_sdmmc_bullseye.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX
 +
 +/etc/apt/sources.list:
 +<code>
 +deb http://ftp.de.debian.org/debian bullseye main contrib non-free
 +deb-src http://ftp.de.debian.org/debian bullseye main contrib non-free
 +deb http://ftp.de.debian.org/debian bullseye-updates main contrib non-free
 +deb-src http://ftp.de.debian.org/debian bullseye-updates main contrib non-free
 +deb https://security.debian.org/debian-security bullseye-security main contrib non-free
 +deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free
 +</code>
  
 <code> <code>
Line 115: Line 364:
 root@bpi-r3:~# apt install pciutils usbutils traceroute iperf3 net-tools psmisc wget curl root@bpi-r3:~# apt install pciutils usbutils traceroute iperf3 net-tools psmisc wget curl
 </code> </code>
 +
 +dnsmasq vs. systemd-resolved:
 +"Another process is already listening on TCP socket 127.0.0.53:53"
 +
 +https://unix.stackexchange.com/a/319501
 +
  
 ===== issues ===== ===== issues =====
Line 122: Line 377:
  
 V1.1: V1.1:
-  * wifi is not recognized when debug-uart connected ([[https://github.com/openwrt/mt76/issues/702#issuecomment-1264637131|link]])+  * wifi firmware cannot be started when debug-uart connected ([[https://github.com/openwrt/mt76/issues/702#issuecomment-1264637131|link]])
     * bpi reports only affects profilic adapters, ch340,cp2102,FT4232 are ok ([[https://forum.banana-pi.org/t/bpi-r3-hw-issues/14027/3?u=frank-w|link]])     * bpi reports only affects profilic adapters, ch340,cp2102,FT4232 are ok ([[https://forum.banana-pi.org/t/bpi-r3-hw-issues/14027/3?u=frank-w|link]])
 +    * I tested cp2102 (not working),cp2104 (working),ch340G (not working) and ft232rl (working)
 +    * Possible fix:https://github.com/openwrt/mt76/issues/702#issuecomment-1312284560
   * reset-bug still there   * reset-bug still there
-    * is reported to be fixed in v1.2 (untested)+    * is reported to be fixed (removed R171 and R173) in newer v1.1 
 +    * tested in uboot with my v1.1 r3 in uboot and plugged m.2 nvme: 
 +      * <code>MT7986> gpio input 9 
 +gpio: pin 9 (gpio 9) value is 1 //initial value 
 +MT7986> gpio input 9 
 +gpio: pin 9 (gpio 9value is 0 //pressed</code>
   * dual-nor (no nand) reported by 1 user [[https://forum.banana-pi.org/t/dual-nor-flash-bpi-r3/13962|link]]   * dual-nor (no nand) reported by 1 user [[https://forum.banana-pi.org/t/dual-nor-flash-bpi-r3/13962|link]]
 +  * wifi temperature issue (2g4 seems wrong): https://github.com/openwrt/mt76/issues/729
  
en/bpi-r3/start.1669844871.txt.gz · Last modified: 2023/06/08 17:06 (external edit)