User Tools

Site Tools



en:bpi-r3mini: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
Last revisionBoth sides next revision
en:bpi-r3mini:start [2024/02/11 17:27] – [pcie/nvme] franken:bpi-r3mini:start [2024/04/21 19:16] – [network support] frank
Line 1: Line 1:
-====== BananaPi R3 ======+====== BananaPi R3 Mini ======
  
 https://wiki.banana-pi.org/Banana_Pi_BPI-R3_Mini https://wiki.banana-pi.org/Banana_Pi_BPI-R3_Mini
Line 39: Line 39:
   dd if=/mnt/sda1/r3mini/fip_r3mini_emmc_pcie.bin bs=1024 conv=notrunc,fsync of=/dev/mmcblk0p4   dd if=/mnt/sda1/r3mini/fip_r3mini_emmc_pcie.bin bs=1024 conv=notrunc,fsync of=/dev/mmcblk0p4
  
 +booted original openwrt from nand....
 +<code>
 +root@OpenWrt:/mnt/r3mini# dd of=/dev/mmcblk0p4 if=/mnt/r3mini/bpi-r3mini_emmc_fip.bin
 +631+1 records in
 +631+1 records out
 +root@OpenWrt:/mnt/r3mini# dd of=/dev/mmcblk0boot0 if=/mnt/r3mini/bpi-r3mini_emmc_bl2.img
 +dd: error writing '/dev/mmcblk0boot0': Operation not permitted
 +1+0 records in
 +0+0 records out
 +root@OpenWrt:/mnt/r3mini# echo 0 > /sys/block/mmcblk0boot0/force_ro
 +root@OpenWrt:/mnt/r3mini# dd of=/dev/mmcblk0boot0 if=/mnt/r3mini/bpi-r3mini_emmc_bl2.img
 +392+1 records in
 +392+1 records out
 +root@OpenWrt:/mnt/r3mini#
 +</code>
  
 Kernel (creates the bpi-r3.itb with conf-emmc-mini bootconfig): Kernel (creates the bpi-r3.itb with conf-emmc-mini bootconfig):
Line 57: Line 72:
  
   dumpimage -l /media/frank/Android-x86/r3mini/bpi-r3.itb   dumpimage -l /media/frank/Android-x86/r3mini/bpi-r3.itb
 +
 +
 +==== thermal ====
 +
 +  root@bpi-r3-mini:~# cat /sys/class/thermal/thermal_zone0/temp                   
 +  48408
 +
 +manipulating trip points...this lets the fan run at 45°C silently and faster at 55°C (Case for R3mini gets really hot)
 +
 +  root@bpi-r3-mini:~# echo 45000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
 +  root@bpi-r3-mini:~# echo 55000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
 +==== my kernel ====
 +
 +i merged R3Mini support to my 6.6-main
 +
 +https://github.com/frank-w/BPI-Router-Linux/tree/6.6-main
  
 ==== vendor-kernel ==== ==== vendor-kernel ====
Line 114: Line 145:
 </code> </code>
  
-we will wait till phy driver is in linux mainline and use this as base for rewriting uboot driver+This is fixed in my 2024-04 uboot by always run autonegotiation code (genphy code seems not working here). 
 + 
 +Writing firmware to emmc boot1: 
 +<code> 
 +usb start 
 +mmc partconf 0 1 2 2 
 +mmc erase 0x0 0x120 
 +load usb 0:1 $loadaddr EthMD32.dm.bin 
 +mmc write $loadaddr 0x0 0x20 
 +load usb 0:1 $loadaddr EthMD32.DSP.bin 
 +mmc write $loadaddr 0x20 0x100 
 +mmc partconf 0 1 1 0 
 +</code> 
 + 
 +daniel wrote it here: https://forum.banana-pi.org/t/bpi-r3-mini-boot-from-nand-fails/17340/27 
 + 
 +Linux way: 
 +<code> 
 +echo 0 > /sys/block/mmcblk0boot1/force_ro 
 +dd if=/lib/firmware/airoha/EthMD32.dm.bin of=/dev/mmcblk0boot1 
 +dd if=/lib/firmware/airoha/EthMD32.DSP.bin bs=16384 seek=1 of=/dev/mmcblk0boot1 
 +</code> 
 + 
 +<hidden> 
 +checking content of boot1 is same as concatenated firmware-files: 
 +<code> 
 +# cat /dev/mmcblk0boot1 > airoha_boot1.bin 
 +# cat /mnt/r3mini/EthMD32.dm.bin /mnt/r3mini/EthMD32.DSP.bin > airoha_usb.bin 
 +# ls -l airoha_usb.bin 
 +-rw-r--r-- 1 root root 147456 Jan  1 00:03 airoha_usb.bin 
 +# ls -l airoha_boot1.bin 
 +-rw-r--r-- 1 root root 4194304 Jan  1 00:00 airoha_boot1.bin 
 +# truncate --size=147456 airoha_boot1.bin   
 +# ls -l airoha_boot1.bin 
 +-rw-r--r-- 1 root root 147456 Jan  1 00:05 airoha_boot1.bin 
 +# diff -u airoha_boot1.bin airoha_usb.bin 
 +#  
 +</code> 
 +</hidden> 
 +==== Fix bricked boot ==== 
 + 
 +In case nand and emmc are broken there is a way to load uboot via uart for reflash/fix bootchain of the storages. 
 + 
 +https://forum.banana-pi.org/t/bpi-r3-mini-boot-from-nand-fails/17340/24 
 + 
 +files here: 
 +https://drive.google.com/drive/folders/1b8KWe0p7fZmsRs9eBZUJBBISv3r2oUOR?usp=drive_link 
 + 
 +<code> 
 +$ ./mtk_uartboot -s /dev/ttyUSB5 --aarch64 --payload bpi-r3mini_ram_bl2.bin --fip bpi-r3mini_ram_fip.bin 
 +mtk_uartboot - 0.1.1 
 +Using serial port: /dev/ttyUSB5 
 +Handshake... 
 +hw code: 0x7986 
 +hw sub code: 0x8a00 
 +hw ver: 0xca01 
 +sw ver: 0x1 
 +Baud rate set to 460800 
 +sending payload to 0x201000... 
 +Checksum: 0x3663 
 +Setting baudrate back to 115200 
 +Jumping to 0x201000 in aarch64... 
 +Waiting for BL2. Message below: 
 +================================== 
 +NOTICE:  BL2: v2.9(release):v2.9.0-357-g553a16af808e ram 
 +NOTICE:  BL2: Built : 17:17:10, Mar  3 2024 
 +NOTICE:  WDT: Cold boot 
 +NOTICE:  WDT: disabled 
 +NOTICE:  CPU: MT7986 (1998MHz) 
 +NOTICE:  EMI: Using DDR4 settings 
 +NOTICE:  EMI: Detected DRAM size: 2048MB 
 +NOTICE:  EMI: complex R/W mem test passed 
 +NOTICE:  Starting UART download handshake ... 
 +================================== 
 +BL2 UART DL version: 0x10 
 +Baudrate set to: 921600 
 +FIP sent. 
 +================================== 
 +NOTICE:  Received FIP 0x4d695 @ 0x40400000 ... 
 +================================== 
 +</code> 
 + 
 +now you can use minicom or similar tool to get uboot-console and reflash bl2/fip to nand/emmc
en/bpi-r3mini/start.txt · Last modified: 2024/04/21 19:19 by frank