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?
btw. i added (locally) the mmc-patches and the dts-patch…sdmmc seems slower (~1 sec on ls fat-partition) compared to my 2021-01 uboot (content is directly shown…not much delay)
4954a8a54c 2021-03-13 dts64: update bananapi-bpi-r64 device-tree (HEAD -> 2021-04-bpi)
4a0b6999d0 2021-03-11 mmc: mtk-sd: don't ignore max-frequency from device tree
642d801e05 2021-03-02 mmc: mtk-sd: increase the minimum bus frequency
have not done the revert (why do you need to revert the clk-patch?)…usb working without additional patch
U-Boot 2021.04-rc3-bpi (Mar 13 2021 - 14:36:36 +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 - 12:48:4a:61:a2:29
eth0: ethernet@1b100000
Hit any key to stop autoboot: 0
BPI-R64> 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... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
BPI-R64> ls usb 0
efi/
1023582 ramdisk.img
1365903 initrd.img
2956137 install.img
456908800 system.sfs
4767728 kernel
5 file(s), 1 dir(s)