Hi guys, could someone please explain how to run u-boot 64 bits on bpi-r64 ?
I built frank-w branch 2020-04-bpi-all like this:
changed build.conf
board=bpi-r64
arch=arm64
The ram issue is caused by memory-node in ref-board dtsā¦take a look to the bpi-r64 dts i used for 32bit mode to change it
For 64bit-mode you need a different atf like this: BPI-R64 current u-boot support preloader is same and you need to change arch in build.conf (i guess you already did). And you can use the 2020-04-bpi tree that should include some more patches (bpi-all was afair test-tree i uploaded accidentially) also switch-driver
xhci-driver itself is on the way to be merged but has no support for r2/r64 yetā¦support is reported to get added after base driver is merged
for r2 i know that driver in current state does not support xhci version below 1 (r2 has 0.96). for r64 i have a probe-error where i do not know where it happen (can be ssusbsys,xhci itselfā¦checked both, but seem to happen anywhere else)
Iāve updated the U-Boot build for MediaTek targets in OpenWrt to U-Boot 2021.04-rc3 with patches from MediaTek on top. Iāve checked and the USB patches you mentioned, both yours and Chunfengās, have already been merged and made it into that version. Yet USB still doesnāt detect any devices. I suspect that switching to build for 64-bit may have broken thingsā¦ Apart from that it now works great, @hackpascal had to help me to fix MMC a bit, but now itās even fast
Yes they are already merged (imho 2020-10 only misses the xhci 0.96 patches,my dts were already in)
I had not tested it after changing to new bootchainā¦my tests were done with 32bit version. Maybe dts needs to be changed for 64bit-mode?
What problems do you have with mmc?
Which patch fixes mmc?
edit made a quick test for USB on my R64 v1.1:
NOTICE: BL2: v2.4(release):v2.4-15-g54397dca8
NOTICE: BL2: Built : 19:09:59, Jan 15 2021
NOTICE: BL2: Booting BL31
NOTICE: BL31: v2.4(release):v2.4-15-g54397dca8
NOTICE: BL31: Built : 19:10:01, Jan 15 2021
U-Boot 2021.01-bpi (Jan 13 2021 - 19:46:11 +0100)
CPU: MediaTek MT7622
Model: mt7622-bpi-r64
DRAM: 1 GiB
WDT: Started with servicing (60s timeout)
MMC: mmc@11230000: 0, mmc@11240000: 1
In: serial@11002000
Out: serial@11002000
Err: serial@11002000
Net:
Warning: ethernet@1b100000 (eth0) using random MAC address - aa:ae:96:0b:a1:f7
eth0: ethernet@1b100000
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc1 is current device
Boot from SD
2bd17853-102b-4500-aa1a-8a21d4d7984d
success!
362 bytes read in 3 ms (117.2 KiB/s)
*** U-Boot Boot Menu ***
1. Enter kernel-name to boot from SD/EMMC.
2. Boot kernel from TFTP.
3. Boot from SD/EMMC.
U-Boot console
Press UP/DOWN to move, ENTER to select
BPI-R64> usb start
starting USB...
Bus usb@1a0c0000: xhci-mtk usb@1a0c0000: hcd: 0x000000001a0c0000, ippc: 0x000000
xhci-mtk usb@1a0c0000: u2p:2, u3p:1
Register 300010f NbrPorts 3
Starting the controller
USB XHCI 0.96
scanning bus usb@1a0c0000 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
BPI-R64> ls usb 0:1
efi/
1023582 ramdisk.img
1365903 initrd.img
2956137 install.img
456908800 system.sfs
4767728 kernel
5 file(s), 1 dir(s)
BPI-R64>
as you can see USB is workingā¦maybe you miss only a config-option for mass storage devices (see last option)
I got all the config options selected in the OpenWrt-build as well, see the defconfigs I create for eMMC and SD Card boot variants:
@hackpascal figured out that MMC was broken recently by
So Iām reverting that. So also get SD Card back to work I always had to lower the max. clock to 12MHz as otherwise (at least with the no-name card I got here) things wouldnāt work. See the DTS changes Iām using for the Bananapi BPi-R64 with U-Boot:
Limiting the max. clock frequency of the MMC bus used for the SD Card, however, was no longer possible after commit
So I had to fix that and made a patch
So that now all works. Just USB still doesnāt.
As all that is part of OpenWrt, it should be easy for everyone to build everything from source themselves and (hopefully) help improving and fixing things where ever needed.
What I still miss in U-Boot right how:
USB edit: 2.0 working well enough to allow UEFI USB boot by default (for MemTest86 and such, already works fine on MMC). USB controller is detected, but USB 2.0 devices are not detected:
MT7622> usb start
starting USB...
Bus usb@1a0c0000: xhci-mtk usb@1a0c0000: hcd: 0x000000001a0c0000, ippc: 0x000000001a0c4700
xhci-mtk usb@1a0c0000: ports disabled mask: u3p-0x0, u2p-0x0
xhci-mtk usb@1a0c0000: u2p:2, u3p:1
Register 300010f NbrPorts 3
Starting the controller
USB XHCI 0.96
scanning bus usb@1a0c0000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
(that 1 USB Device which is found is the root hub and is always there, no matter if an actual USB device is plugged in or not)
PSTORE (formally/also known as ramoops) working with Linux and U-Boot. As hard reset through SoC reset controller also re-initializes the DDR controller, RAM content gets corrupted by crash/oops/reboot. Implementing reset through ATF pcsc for Linux to use rather than triggering register may be a good work-around.
Iām not sure whether just reverting is an option for upstream or if we have to find a better fix for
(ie. introducing uint64_t log_msg_ret64(char *, uint64_t) would be the proper fix, I guess)
Regarding DTS for BPi-R64 (outdated in U-Boot tree) and default config (missing), @frank-w had been working on that before and Iām not sure what their plans are, if there is going to be a re-spin with fixes for upcoming U-Boot 2021.04:
Iāve added LEDs and buttons, had to lower MMC frequency to make SD Card work reliable (at least for the card I got here) and added the ethernet0 alias to make U-Boot pass down ethaddr to Linux. Should I send a patch for that you reckon?