[BPI-R4] Boot from M.2 NVMe SSD [closed]

The goal for this topic is to track the current status and steps necessary to boot any OS “directly” from an attached M.2 NVMe SSD.

Directly here means, that there will be a U-Boot image on the NAND storage, that has the required PCIe and NVMe drivers built in to boot any OS (OpenWRT, other Linux) from the SSD. Similar to this proposal: [BPI-R3] [BPi-R3-Mini] Imagebuilder R3 ArchlinuxArm, linux-rolling-stable - #80 by dangowrt

Current status

Not possible, due to missing PCIe driver for R4 Mediatek chip in U-Boot.

This post will be updated as new information is added through replies and other sources.

1 Like

I already got the driver from john (should be posted to ML soon).

afaik it currently supports mt7986 and mt7981,not sure if changes for mt7988 needed…

You can try it if you have nvme working on r4 linux (have no nvme ready and resitors not removed).

Edit: You will need to add clocks and dtsi changes for r4/mt7988.

Edit2: clocks already defined so i added the dts-nodes from linux (only compile-tested):

@totkeks can you test nvme with johns Patch, my dts-patch and the options i added for r3 (cache not needed for nvme)

1 Like

Big thanks for compiling that information. I will try it out right now. Already got the code, just need to setup a working build environment locally, on Windows or WSL or Docker.

After having issues with building locally, I just went with the GitHub workflow.

Unfortunately, the result is negative. No PCIe bus found, therefore the nvme command also doesn’t show anything.

BPI-R4> pci
drivers/pci/pcie_mediatek_gen3.c:mtk_pcie_startup_port[258] no card detected

Not sure what that means though. If you got any idea or someone else, feel free to chime in. I will probably spend some more time on getting the local build done easy and repeatedly.

you can try to add debugs in the drivers code to see if probe is called and at which step it maybe breaks

maybe you need a status=“okay” for all dts-nodes i have added…in linux okay is default, but john has added okay to his nodes

updated my tree with the status-properties

Tried it with those status properties, but still no luck. Also increased the wait time in the driver from 100ms to 1s. Didn’t change anything.

This is the boot output with log level set to 7 (DEBUG). The dts part is fine, it seems and matches the controller. But the driver itself doesn’t load properly. It goes through it’s reset routine mtk_pcie_startup_port, but then doesn’t detect the bus or port or whatever it wants to find.

resetting ...

F0: 102B 0000
FA: 1042 0000
FA: 1042 0000 [0200]
F9: 1041 0000
F3: 1001 0000 [0200]
F3: 1001 0000
F6: 380E 5800
F5: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 0600 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [3000]
MK: 0000 0000 [0000]
T0: 0000 013D [0101]
Jump to BL

NOTICE:  BL2: v2.9(release):310ed284c sdmmc
NOTICE:  BL2: Built : 21:22:26, Feb 11 2024
NOTICE:  WDT: [40000000] Software reset (reboot)
NOTICE:  CPU: MT7988
NOTICE:  EMI: Using DDR unknown settings
NOTICE:  EMI: Detected DRAM size: 4096 MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.9(release):310ed284c sdmmc
NOTICE:  BL31: Built : 21:22:30, Feb 11 2024
size=30, ptr=30, limit=4000: 41f27cf0
size=30, ptr=60, limit=4000: 41f27d20
size=98, ptr=f8, limit=4000: 41f27d50
bind node cpus
Device 'cpus' has no compatible string
bind node dummy40m
   - attempt to match compatible string 'fixed-clock'
   - found match at 'fixed_clock': 'fixed-clock' matches 'fixed-clock'
size=30, ptr=128, limit=4000: 41f27de8
size=98, ptr=1c0, limit=4000: 41f27e18
size=30, ptr=1f0, limit=4000: 41f27eb0
bind node dummy208m
   - attempt to match compatible string 'fixed-clock'
   - found match at 'fixed_clock': 'fixed-clock' matches 'fixed-clock'
size=98, ptr=288, limit=4000: 41f27ee0
size=30, ptr=2b8, limit=4000: 41f27f78
bind node hwver
   - attempt to match compatible string 'mediatek,hwver'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node timer
   - attempt to match compatible string 'arm,armv8-timer'
No match for node 'timer'
bind node watchdog@1001c000
   - attempt to match compatible string 'mediatek,mt7622-wdt'
   - attempt to match compatible string 'mediatek,mt6589-wdt'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node interrupt-controller@c000000
   - attempt to match compatible string 'arm,gic-v3'
No match for node 'interrupt-controller@c000000'
bind node infracfg_ao_cgs@10001000
   - attempt to match compatible string 'mediatek,mt7988-infracfg_ao_cgs'
   - found match at 'mt7988-clock-infracfg_ao_cgs': 'mediatek,mt7988-infracfg_ao_cgs' matches 'mediatek,mt7988-infracfg_ao_cgs'
size=98, ptr=350, limit=4000: 41f27fa8
bind node apmixedsys@1001e000
   - attempt to match compatible string 'mediatek,mt7988-fixed-plls'
   - found match at 'mt7988-clock-fixed-pll': 'mediatek,mt7988-fixed-plls' matches 'mediatek,mt7988-fixed-plls'
size=98, ptr=3e8, limit=4000: 41f28040
bind node topckgen@1001b000
   - attempt to match compatible string 'mediatek,mt7988-topckgen'
   - found match at 'mt7988-clock-topckgen': 'mediatek,mt7988-topckgen' matches 'mediatek,mt7988-topckgen'
size=98, ptr=480, limit=4000: 41f280d8
bind node pinctrl@1001f000
   - attempt to match compatible string 'mediatek,mt7988-pinctrl'
Skipping device pre-relocation
bind node syscon@10060000
   - attempt to match compatible string 'mediatek,mt7988-sgmiisys_0'
Skipping device pre-relocation
bind node syscon@10070000
   - attempt to match compatible string 'mediatek,mt7988-sgmiisys_1'
Skipping device pre-relocation
bind node syscon@10080000
   - attempt to match compatible string 'mediatek,mt7988-usxgmiisys_0'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node syscon@10081000
   - attempt to match compatible string 'mediatek,mt7988-usxgmiisys_1'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node dummy12m
   - attempt to match compatible string 'fixed-clock'
   - found match at 'fixed_clock': 'fixed-clock' matches 'fixed-clock'
size=98, ptr=518, limit=4000: 41f28170
size=30, ptr=548, limit=4000: 41f28208
bind node xhci@11200000
   - attempt to match compatible string 'mediatek,mt7988-xhci'
   - attempt to match compatible string 'mediatek,mtk-xhci'
Skipping device pre-relocation
bind node pcie@11280000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
Skipping device pre-relocation
bind node pcie@11290000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
Skipping device pre-relocation
bind node pcie@11300000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
Skipping device pre-relocation
bind node pcie@11310000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
Skipping device pre-relocation
bind node usb-phy@11c50000
   - attempt to match compatible string 'mediatek,mt7988'
   - attempt to match compatible string 'mediatek,generic-tphy-v2'
Skipping device pre-relocation
bind node syscon@11f20000
   - attempt to match compatible string 'mediatek,mt7988-xfi_pextp_0'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node syscon@11f30000
   - attempt to match compatible string 'mediatek,mt7988-xfi_pextp_1'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node syscon@11f40000
   - attempt to match compatible string 'mediatek,mt7988-xfi_pll'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node topmisc@11d10000
   - attempt to match compatible string 'mediatek,mt7988-topmisc'
   - attempt to match compatible string 'syscon'
Skipping device pre-relocation
bind node infracfg@10001000
   - attempt to match compatible string 'mediatek,mt7988-infracfg'
   - found match at 'mt7988-clock-infracfg': 'mediatek,mt7988-infracfg' matches 'mediatek,mt7988-infracfg'
size=98, ptr=5e0, limit=4000: 41f28238
bind node serial@11000000
   - attempt to match compatible string 'mediatek,hsuart'
   - found match at 'serial_mtk': 'mediatek,hsuart' matches 'mediatek,hsuart'
size=30, ptr=610, limit=4000: 41f282d0
size=98, ptr=6a8, limit=4000: 41f28300
bind node i2c@11004000
   - attempt to match compatible string 'mediatek,mt7988-i2c'
   - attempt to match compatible string 'mediatek,mt7981-i2c'
No match for node 'i2c@11004000'
bind node pwm@10048000
   - attempt to match compatible string 'mediatek,mt7988-pwm'
Skipping device pre-relocation
bind node spi@1100a000
   - attempt to match compatible string 'mediatek,ipm-spi'
Skipping device pre-relocation
bind node mmc@11230000
   - attempt to match compatible string 'mediatek,mt7988-mmc'
   - attempt to match compatible string 'mediatek,mt7986-mmc'
Skipping device pre-relocation
bind node syscon@15000000
   - attempt to match compatible string 'mediatek,mt7988-ethdma'
Skipping device pre-relocation
bind node syscon@15031000
   - attempt to match compatible string 'mediatek,mt7988-ethwarp'
Skipping device pre-relocation
bind node ethernet@15100000
   - attempt to match compatible string 'mediatek,mt7988-eth'
Skipping device pre-relocation
bind node chosen
Device 'chosen' has no compatible string
bind node memory@40000000
Device 'memory@40000000' has no compatible string
bind node regulator-3p3v
   - attempt to match compatible string 'regulator-fixed'
No match for node 'regulator-3p3v'
bind node __symbols__
Device '__symbols__' has no compatible string
size=38, ptr=6e0, limit=4000: 41f28398
size=18, ptr=6f8, limit=4000: 41f283d0
Looking for infracfg_ao_cgs@10001000
Looking for infracfg_ao_cgs@10001000
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
size=20, ptr=718, limit=4000: 41f283e8
size=18, ptr=730, limit=4000: 41f28408
size=18, ptr=748, limit=4000: 41f28420
size=18, ptr=760, limit=4000: 41f28438


U-Boot 2024.04-rc1-bpi-r4-nvme-g244556540-dirty (Feb 11 2024 - 21:22:00 +0000)

size=30, ptr=790, limit=4000: 41f28450
size=30, ptr=7c0, limit=4000: 41f28480
size=98, ptr=858, limit=4000: 41f284b0
size=18, ptr=870, limit=4000: 41f28548
bind node cpu@0
   - attempt to match compatible string 'arm,cortex-a73'
   - found match at 'mtk-cpu': 'arm,cortex-a7' matches 'arm,cortex-a73'
size=98, ptr=908, limit=4000: 41f28560
size=8, ptr=910, limit=4000: 41f285f8
size=20, ptr=930, limit=4000: 41f28600
bind node cpu@1
   - attempt to match compatible string 'arm,cortex-a73'
   - found match at 'mtk-cpu': 'arm,cortex-a7' matches 'arm,cortex-a73'
size=98, ptr=9c8, limit=4000: 41f28620
size=8, ptr=9d0, limit=4000: 41f286b8
size=20, ptr=9f0, limit=4000: 41f286c0
bind node cpu@2
   - attempt to match compatible string 'arm,cortex-a73'
   - found match at 'mtk-cpu': 'arm,cortex-a7' matches 'arm,cortex-a73'
size=98, ptr=a88, limit=4000: 41f286e0
size=8, ptr=a90, limit=4000: 41f28778
size=20, ptr=ab0, limit=4000: 41f28780
bind node cpu@3
   - attempt to match compatible string 'arm,cortex-a73'
   - found match at 'mtk-cpu': 'arm,cortex-a7' matches 'arm,cortex-a73'
size=98, ptr=b48, limit=4000: 41f287a0
size=8, ptr=b50, limit=4000: 41f28838
size=20, ptr=b70, limit=4000: 41f28840
Looking for hwver
Looking for hwver
size=30, ptr=ba0, limit=4000: 41f28860
   - result for hwver: (none) (ret=-19)
   - result for hwver: (none) (ret=-19)
size=98, ptr=c38, limit=4000: 41f28890
size=8, ptr=c40, limit=4000: 41f28928
size=20, ptr=c60, limit=4000: 41f28930
Looking for hwver
Looking for hwver
   - result for hwver: hwver (ret=0)
   - result for hwver: hwver (ret=0)
Looking for hwver
Looking for hwver
   - result for hwver: hwver (ret=0)
   - result for hwver: hwver (ret=0)
Looking for hwver
Looking for hwver
   - result for hwver: hwver (ret=0)
   - result for hwver: hwver (ret=0)
CPU:   MediaTek MT7988
Model: mt7988-rfb
DRAM:  4 GiB
bind node cpus
Device 'cpus' has no compatible string
bind node dummy40m
   - attempt to match compatible string 'fixed-clock'
   - found match at 'fixed_clock': 'fixed-clock' matches 'fixed-clock'
bind node dummy208m
   - attempt to match compatible string 'fixed-clock'
   - found match at 'fixed_clock': 'fixed-clock' matches 'fixed-clock'
bind node hwver
   - attempt to match compatible string 'mediatek,hwver'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node timer
   - attempt to match compatible string 'arm,armv8-timer'
No match for node 'timer'
bind node watchdog@1001c000
   - attempt to match compatible string 'mediatek,mt7622-wdt'
   - attempt to match compatible string 'mediatek,mt6589-wdt'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node interrupt-controller@c000000
   - attempt to match compatible string 'arm,gic-v3'
No match for node 'interrupt-controller@c000000'
bind node infracfg_ao_cgs@10001000
   - attempt to match compatible string 'mediatek,mt7988-infracfg_ao_cgs'
   - found match at 'mt7988-clock-infracfg_ao_cgs': 'mediatek,mt7988-infracfg_ao_cgs' matches 'mediatek,mt7988-infracfg_ao_cgs'
bind node apmixedsys@1001e000
   - attempt to match compatible string 'mediatek,mt7988-fixed-plls'
   - found match at 'mt7988-clock-fixed-pll': 'mediatek,mt7988-fixed-plls' matches 'mediatek,mt7988-fixed-plls'
bind node topckgen@1001b000
   - attempt to match compatible string 'mediatek,mt7988-topckgen'
   - found match at 'mt7988-clock-topckgen': 'mediatek,mt7988-topckgen' matches 'mediatek,mt7988-topckgen'
bind node pinctrl@1001f000
   - attempt to match compatible string 'mediatek,mt7988-pinctrl'
   - found match at 'mt7988_pinctrl': 'mediatek,mt7988-pinctrl' matches 'mediatek,mt7988-pinctrl'
bind node syscon@10060000
   - attempt to match compatible string 'mediatek,mt7988-sgmiisys_0'
   - found match at 'mt7988-clock-sgmiisys_0': 'mediatek,mt7988-sgmiisys_0' matches 'mediatek,mt7988-sgmiisys_0'
bind node syscon@10070000
   - attempt to match compatible string 'mediatek,mt7988-sgmiisys_1'
   - found match at 'mt7988-clock-sgmiisys_1': 'mediatek,mt7988-sgmiisys_1' matches 'mediatek,mt7988-sgmiisys_1'
bind node syscon@10080000
   - attempt to match compatible string 'mediatek,mt7988-usxgmiisys_0'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node syscon@10081000
   - attempt to match compatible string 'mediatek,mt7988-usxgmiisys_1'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node dummy12m
   - attempt to match compatible string 'fixed-clock'
   - found match at 'fixed_clock': 'fixed-clock' matches 'fixed-clock'
bind node xhci@11200000
   - attempt to match compatible string 'mediatek,mt7988-xhci'
   - attempt to match compatible string 'mediatek,mtk-xhci'
   - found match at 'xhci-mtk': 'mediatek,mtk-xhci' matches 'mediatek,mtk-xhci'
bind node pcie@11280000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
   - found match at 'pcie_mediatek_gen3': 'mediatek,mt8192-pcie' matches 'mediatek,mt8192-pcie'
bind node interrupt-controller
Device 'interrupt-controller' has no compatible string
bind node pcie@11290000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
   - found match at 'pcie_mediatek_gen3': 'mediatek,mt8192-pcie' matches 'mediatek,mt8192-pcie'
bind node interrupt-controller
Device 'interrupt-controller' has no compatible string
bind node pcie@11300000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
   - found match at 'pcie_mediatek_gen3': 'mediatek,mt8192-pcie' matches 'mediatek,mt8192-pcie'
bind node interrupt-controller
Device 'interrupt-controller' has no compatible string
bind node pcie@11310000
   - attempt to match compatible string 'mediatek,mt7988-pcie'
   - attempt to match compatible string 'mediatek,mt7986-pcie'
   - attempt to match compatible string 'mediatek,mt8192-pcie'
   - found match at 'pcie_mediatek_gen3': 'mediatek,mt8192-pcie' matches 'mediatek,mt8192-pcie'
bind node interrupt-controller
Device 'interrupt-controller' has no compatible string
bind node usb-phy@11c50000
   - attempt to match compatible string 'mediatek,mt7988'
   - attempt to match compatible string 'mediatek,generic-tphy-v2'
   - found match at 'mtk-tphy': 'mediatek,generic-tphy-v1' matches 'mediatek,generic-tphy-v2'
bind node syscon@11f20000
   - attempt to match compatible string 'mediatek,mt7988-xfi_pextp_0'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node syscon@11f30000
   - attempt to match compatible string 'mediatek,mt7988-xfi_pextp_1'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node syscon@11f40000
   - attempt to match compatible string 'mediatek,mt7988-xfi_pll'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node topmisc@11d10000
   - attempt to match compatible string 'mediatek,mt7988-topmisc'
   - attempt to match compatible string 'syscon'
   - found match at 'syscon': 'syscon' matches 'syscon'
bind node infracfg@10001000
   - attempt to match compatible string 'mediatek,mt7988-infracfg'
   - found match at 'mt7988-clock-infracfg': 'mediatek,mt7988-infracfg' matches 'mediatek,mt7988-infracfg'
bind node serial@11000000
   - attempt to match compatible string 'mediatek,hsuart'
   - found match at 'serial_mtk': 'mediatek,hsuart' matches 'mediatek,hsuart'
bind node i2c@11004000
   - attempt to match compatible string 'mediatek,mt7988-i2c'
   - attempt to match compatible string 'mediatek,mt7981-i2c'
No match for node 'i2c@11004000'
bind node pwm@10048000
   - attempt to match compatible string 'mediatek,mt7988-pwm'
   - found match at 'mtk_pwm': 'mediatek,mt7622-pwm' matches 'mediatek,mt7988-pwm'
bind node spi@1100a000
   - attempt to match compatible string 'mediatek,ipm-spi'
   - found match at 'mtk_spim': 'mediatek,ipm-spi' matches 'mediatek,ipm-spi'
bind node spi_nand@0
   - attempt to match compatible string 'spi-nand'
   - found match at 'spi_nand': 'spi-nand' matches 'spi-nand'
bind node mmc@11230000
   - attempt to match compatible string 'mediatek,mt7988-mmc'
   - attempt to match compatible string 'mediatek,mt7986-mmc'
   - found match at 'mtk_sd': 'mediatek,mt7620-mmc' matches 'mediatek,mt7986-mmc'
bind node syscon@15000000
   - attempt to match compatible string 'mediatek,mt7988-ethdma'
   - found match at 'mt7988-clock-ethdma': 'mediatek,mt7988-ethdma' matches 'mediatek,mt7988-ethdma'
bind node syscon@15031000
   - attempt to match compatible string 'mediatek,mt7988-ethwarp'
   - found match at 'mt7988-clock-ethwarp': 'mediatek,mt7988-ethwarp' matches 'mediatek,mt7988-ethwarp'
bind node ethernet@15100000
   - attempt to match compatible string 'mediatek,mt7988-eth'
   - found match at 'mtk-eth': 'mediatek,mt7988-eth' matches 'mediatek,mt7988-eth'
bind node chosen
Device 'chosen' has no compatible string
bind node memory@40000000
Device 'memory@40000000' has no compatible string
bind node regulator-3p3v
   - attempt to match compatible string 'regulator-fixed'
No match for node 'regulator-3p3v'
bind node __symbols__
Device '__symbols__' has no compatible string
Looking for infracfg_ao_cgs@10001000
Looking for infracfg_ao_cgs@10001000
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
Looking for topckgen@1001b000
Looking for topckgen@1001b000
   - result for topckgen@1001b000: topckgen@1001b000 (ret=0)
   - result for topckgen@1001b000: topckgen@1001b000 (ret=0)
Looking for topckgen@1001b000
Looking for topckgen@1001b000
   - result for topckgen@1001b000: topckgen@1001b000 (ret=0)
   - result for topckgen@1001b000: topckgen@1001b000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Core:  51 devices, 19 uclasses, devicetree: separate (ret=0)
MMC:   0
   - 0 'mmc@11230000'
   - found
Looking for infracfg_ao_cgs@10001000
Looking for infracfg_ao_cgs@10001000
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
Looking for infracfg_ao_cgs@10001000
Looking for infracfg_ao_cgs@10001000
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
Looking for infracfg_ao_cgs@10001000
Looking for infracfg_ao_cgs@10001000
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
   - result for infracfg_ao_cgs@10001000: infracfg_ao_cgs@10001000 (ret=0)
1
   - 0 'mmc@11230000'
   - not found
mmc@11230000: 0
Loading Environment from nowhere... OK
In:    serial@11000000
Out:   serial@11000000
Err:   serial@11000000
Net:   Looking for syscon@15000000
Looking for syscon@15000000
   - result for syscon@15000000: (none) (ret=-19)
   - result for syscon@15000000: (none) (ret=-19)
Looking for topmisc@11d10000
Looking for topmisc@11d10000
   - result for topmisc@11d10000: topmisc@11d10000 (ret=0)
   - result for topmisc@11d10000: topmisc@11d10000 (ret=0)
Looking for syscon@15000000
Looking for syscon@15000000
   - result for syscon@15000000: reset (ret=0)
   - result for syscon@15000000: reset (ret=0)
Looking for syscon@15000000
Looking for syscon@15000000
   - result for syscon@15000000: syscon@15000000 (ret=0)
   - result for syscon@15000000: syscon@15000000 (ret=0)
Looking for syscon@10080000
Looking for syscon@10080000
   - result for syscon@10080000: syscon@10080000 (ret=0)
   - result for syscon@10080000: syscon@10080000 (ret=0)
Looking for syscon@11f20000
Looking for syscon@11f20000
   - result for syscon@11f20000: syscon@11f20000 (ret=0)
   - result for syscon@11f20000: syscon@11f20000 (ret=0)
Looking for syscon@11f40000
Looking for syscon@11f40000
   - result for syscon@11f40000: syscon@11f40000 (ret=0)
   - result for syscon@11f40000: syscon@11f40000 (ret=0)
Looking for watchdog@1001c000
Looking for watchdog@1001c000
   - result for watchdog@1001c000: watchdog@1001c000 (ret=0)
   - result for watchdog@1001c000: watchdog@1001c000 (ret=0)
Looking for syscon@15031000
Looking for syscon@15031000
   - result for syscon@15031000: reset (ret=0)
   - result for syscon@15031000: reset (ret=0)
Looking for syscon@15031000
Looking for syscon@15031000
   - result for syscon@15031000: (none) (ret=-19)
   - result for syscon@15031000: (none) (ret=-19)

Warning: ethernet@15100000 (eth0) using random MAC address - a6:e3:73:c7:ab:f3
0
   - 0 'ethernet@15100000'
   - found
eth0: ethernet@15100000
Hit any key to stop autoboot:  0
mtk_sd mmc@11230000: sclk: 259740, timing: 0
mtk_sd mmc@11230000: sclk: 50000000, timing: 2
Signature aa55 valid
count = 128 * 128 = 16384
start 0x22, size 0x1fde, name bl2
count = 128 * 128 = 16384
start 0x2000, size 0x400, name u-boot-env
count = 128 * 128 = 16384
start 0x2400, size 0x1000, name factory
count = 128 * 128 = 16384
start 0x3400, size 0x1000, name fip
count = 128 * 128 = 16384
start 0x4400, size 0x32000, name boot
count = 128 * 128 = 16384
start 0x36400, size 0x32001, name rootfs
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3DFC0
Invalid partition number 7
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E040
Invalid partition number 8
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E0C0
Invalid partition number 9
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E140
Invalid partition number 10
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E1C0
Invalid partition number 11
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E240
Invalid partition number 12
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E2C0
Invalid partition number 13
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E340
Invalid partition number 14
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E3C0
Invalid partition number 15
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E440
Invalid partition number 16
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E4C0
Invalid partition number 17
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E540
Invalid partition number 18
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E5C0
Invalid partition number 19
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E640
Invalid partition number 20
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E6C0
Invalid partition number 21
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E740
Invalid partition number 22
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E7C0
Invalid partition number 23
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E840
Invalid partition number 24
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E8C0
Invalid partition number 25
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E940
Invalid partition number 26
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3E9C0
Invalid partition number 27
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EA40
Invalid partition number 28
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EAC0
Invalid partition number 29
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EB40
Invalid partition number 30
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EBC0
Invalid partition number 31
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EC40
Invalid partition number 32
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3ECC0
Invalid partition number 33
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3ED40
Invalid partition number 34
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EDC0
Invalid partition number 35
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EE40
Invalid partition number 36
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EEC0
Invalid partition number 37
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EF40
Invalid partition number 38
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3EFC0
Invalid partition number 39
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F040
Invalid partition number 40
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F0C0
Invalid partition number 41
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F140
Invalid partition number 42
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F1C0
Invalid partition number 43
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F240
Invalid partition number 44
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F2C0
Invalid partition number 45
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F340
Invalid partition number 46
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F3C0
Invalid partition number 47
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F440
Invalid partition number 48
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F4C0
Invalid partition number 49
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F540
Invalid partition number 50
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F5C0
Invalid partition number 51
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F640
Invalid partition number 52
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F6C0
Invalid partition number 53
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F740
Invalid partition number 54
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F7C0
Invalid partition number 55
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F840
Invalid partition number 56
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F8C0
Invalid partition number 57
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F940
Invalid partition number 58
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3F9C0
Invalid partition number 59
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FA40
Invalid partition number 60
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FAC0
Invalid partition number 61
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FB40
Invalid partition number 62
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FBC0
Invalid partition number 63
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FC40
Invalid partition number 64
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FCC0
Invalid partition number 65
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FD40
Invalid partition number 66
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FDC0
Invalid partition number 67
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FE40
Invalid partition number 68
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FEC0
Invalid partition number 69
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FF40
Invalid partition number 70
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB3FFC0
Invalid partition number 71
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40040
Invalid partition number 72
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB400C0
Invalid partition number 73
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40140
Invalid partition number 74
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB401C0
Invalid partition number 75
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40240
Invalid partition number 76
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB402C0
Invalid partition number 77
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40340
Invalid partition number 78
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB403C0
Invalid partition number 79
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40440
Invalid partition number 80
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB404C0
Invalid partition number 81
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40540
Invalid partition number 82
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB405C0
Invalid partition number 83
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40640
Invalid partition number 84
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB406C0
Invalid partition number 85
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40740
Invalid partition number 86
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB407C0
Invalid partition number 87
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40840
Invalid partition number 88
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB408C0
Invalid partition number 89
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40940
Invalid partition number 90
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB409C0
Invalid partition number 91
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40A40
Invalid partition number 92
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40AC0
Invalid partition number 93
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40B40
Invalid partition number 94
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40BC0
Invalid partition number 95
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40C40
Invalid partition number 96
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40CC0
Invalid partition number 97
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40D40
Invalid partition number 98
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40DC0
Invalid partition number 99
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40E40
Invalid partition number 100
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40EC0
Invalid partition number 101
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40F40
Invalid partition number 102
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB40FC0
Invalid partition number 103
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41040
Invalid partition number 104
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB410C0
Invalid partition number 105
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41140
Invalid partition number 106
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB411C0
Invalid partition number 107
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41240
Invalid partition number 108
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB412C0
Invalid partition number 109
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41340
Invalid partition number 110
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB413C0
Invalid partition number 111
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41440
Invalid partition number 112
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB414C0
Invalid partition number 113
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41540
Invalid partition number 114
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB415C0
Invalid partition number 115
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41640
Invalid partition number 116
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB416C0
Invalid partition number 117
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41740
Invalid partition number 118
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB417C0
Invalid partition number 119
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41840
Invalid partition number 120
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB418C0
Invalid partition number 121
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41940
Invalid partition number 122
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB419C0
Invalid partition number 123
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41A40
Invalid partition number 124
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41AC0
Invalid partition number 125
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41B40
Invalid partition number 126
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41BC0
Invalid partition number 127
count = 128 * 128 = 16384
Found an unused PTE GUID at 0xFFB41C40
Invalid partition number 128
Signature aa55 valid
count = 128 * 128 = 16384
start 0x4400, size 0x32000, name boot
FAT read(sect=404), clust_size=4, read_size=4

  *** U-Boot Boot Menu ***

      1. Enter kernel-name to boot from SD/EMMC.
      2. Boot kernel from TFTP.
      3. Boot from SD/EMMC.
      Exit


  Press UP/DOWN to move, ENTER to select, ESC to quit
## Error: "initrd" not defined
PARTITION_CONFIG only exists on eMMC
sd available
bootconf=#conf-sd
fit=bpi-r4.itb
Signature aa55 valid
count = 128 * 128 = 16384
start 0x4400, size 0x32000, name boot
FAT read(sect=404), clust_size=4, read_size=4
FAT read(sect=404), clust_size=4, read_size=4
Failed to load 'bpi-r4.itb'
BPI-R4> pci enum
Looking for usb-phy@11e13000
Looking for usb-phy@11e13000
   - result for usb-phy@11e13000: (none) (ret=-19)
   - result for usb-phy@11e13000: (none) (ret=-19)
Looking for usb-phy@11c50000
Looking for usb-phy@11c50000
   - result for usb-phy@11c50000: usb-phy@11c50000 (ret=0)
   - result for usb-phy@11c50000: usb-phy@11c50000 (ret=0)
Looking for dummy12m
Looking for dummy12m
   - result for dummy12m: dummy12m (ret=0)
   - result for dummy12m: dummy12m (ret=0)
Looking for dummy12m
Looking for dummy12m
   - result for dummy12m: dummy12m (ret=0)
   - result for dummy12m: dummy12m (ret=0)
Looking for dummy12m
Looking for dummy12m
   - result for dummy12m: dummy12m (ret=0)
   - result for dummy12m: dummy12m (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
drivers/pci/pcie_mediatek_gen3.c:mtk_pcie_startup_port[258] no card detected
BPI-R4>

It looks like it scans only 2 pcie busses and skip the other 2. It matches and binds all nodes above.

I’m not sure which pcie is used for the pci enum command…this would be a interesting information…also probe itself. Afair in linux we had no specific handling for mt7988,also compatible is not added…it uses the fallback compatible for matching driver.

I guess we need to change at least ranges property…in johns mt7986 there are only 2 ranges,for mt7986 i had 8 with different format. But idk how to transform the values. It is also possible to define the pinctrl somewhere…in johns dts i do not see it,but maybe it is fixed somewhere else (pinctrl driver)

edit: ranges for mt7986 seem sane as in linux…wonder why mt7988 does have that much compared to mt7986.

According to the data sheet (MT7988A Wi-Fi7 Datasheet&Manual - Google Drive) there is actually just one big 256MB range for each pcie port. So that should be fine, though I do not know enough about the device trees to understand why that area is split up into two pieces, 2MB and 254MB, mapped to two different areas on the bus.

Also the pinctrl was missing from your current version. I found the one for openwrt and copied it. target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-gsw-10g-sfp-spim-nand.dts - openwrt/feeds/mtk-openwrt-feeds - Gitiles

Trying it out now, will report back. :wink:

One side note though, the code for me as a software dev who has not worked on kernel stuff before, is very hard to read. Every variable and function name is shortened and the device tree file names are not properly.

Currently we are using mt7988-sd-rfb.dts as our board tree. Instead it should be mt7988-bpi-r4.dts (same as r3) and then I would personally prefer to have one base config, that is then overlayed with the sd, emmc and nand device trees respectively instead of having the sd overlay as base. But this might be due to the work in progress nature of the current branch.

Edit: didn’t work :frowning:

You should use pinctrl from upstream kernel,but i guess they are not picked up by driver yet:

In linux we use overlays,but uboot is fixed as we do for r3.

Afaik it is splitted into configuration and “working” (afaik mapped to dma) area.

Okay, thanks didn’t know that. Just used google and it gave me the file I linked above. The pcie pinctrl is the same in both files though.

I also just realized while comparing the last console output, that I’m one step further.

BPI-R4> pci
0
   - 0 'pcie@11280000'
   - found
Looking for usb-phy@11e13000
Looking for usb-phy@11e13000
   - result for usb-phy@11e13000: (none) (ret=-19)
   - result for usb-phy@11e13000: (none) (ret=-19)
Looking for usb-phy@11c50000
Looking for usb-phy@11c50000
   - result for usb-phy@11c50000: usb-phy@11c50000 (ret=0)
   - result for usb-phy@11c50000: usb-phy@11c50000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
drivers/pci/pcie_mediatek_gen3.c:mtk_pcie_startup_port[258] no card detected
BPI-R4>

It is still weird, that it doesn’t go through all four pcie ports.

According to OpenWRT the nvme is attached to the 0x11290000 port.

I guess the problem is that only 1 pcie ( 11280000) has a phy

Maybe we need to make phy optional (not returning with error if it does not exist).

As you know that 0x11290000 is the right one you can try moving the phy properties to this one and may disable the others. My guess the phy is used for all pcie ports and is only defined on first to be powered on and configured once

Linux driver has this property optional

Uboot phy uclass seems not having optional function,so either ignore error (and later skip power on then) for testing or just only use 11290000 with the phy properties. Imho lookup for name (to get index) fails (-ENODATA). In this case phy pointer should be set to Null and then you can poweron/init phy only of it is not Null.

You can also add some debugs in the function above to look if its end is reached and where it maybe exists with which error

have updated dtsi, so please try again with latest change

Tried it with both changes. Just moving the PHY to the m.2 port, didn’t work. Then also disabling the other pcie ports, didn’t work either.

I don’t know enough about the kernel and hardware to debug this. I’d rather wait for the end of the Chinese new year and then hope to get input from the experts at mediatek or sinovoip.

i guess phy is used for all pcie, needs to be initialized once and then each controller picks out its “range” (e.g. pcie-lanes) from phy. so second pcie needs to pick second lane from phy to work.

changed code a bit and added some debugs…unfortunately it crashes on clk_enable of tl_26m (CK_INFRA_PCIE_GFMUX_TL_P0) on the 11300000 pci device. so i disabled last 2 pci again

can you please try this one?

btw. you can compile u-boot.bin and load it from file, so you don’t need the atf-part when having bootable system for testing in most cases

BPI-R4> ls mmc 0:5                                                              
...                                       
   700264   u-boot-pcidbg.bin                                                    
                                                                                
BPI-R4> fatload mmc 0:5 $loadaddr u-boot-pcidbg.bin                             
700264 bytes read in 49 ms (13.6 MiB/s)                                         
BPI-R4> go $loadaddr

i’m also no pcie expert…simply put debugs in code and look where it fails…but idk why enabling the clock above causes an “Synchronous Abort” in uboot…so i simply skip that device as we need only the 11290000 :slight_smile:

I tried your latest updates with the debug outputs. Unfortunately, no good news. It is still not bringing up the m.2 port. It does not “come back”, as far as I understand, after the reset procedure in mtk_pcie_startup_port.

BPI-R4> pci list
0
   - 0 'pcie@11290000'
   - found
mtk_pcie_power_on:282 dev:00000000ffb21790 start
mtk_pcie_power_on:284 dev:00000000ffb21790 base:0000000011290000
Looking for usb-phy@11e13000
Looking for usb-phy@11e13000
   - result for usb-phy@11e13000: (none) (ret=-19)
   - result for usb-phy@11e13000: (none) (ret=-19)
Looking for usb-phy@11c50000
Looking for usb-phy@11c50000
   - result for usb-phy@11c50000: usb-phy@11c50000 (ret=0)
   - result for usb-phy@11c50000: usb-phy@11c50000 (ret=0)
mtk_pcie_power_on:291 dev:00000000ffb21790 err:0
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
mtk_pcie_power_on:300 dev:00000000ffb21790 err:0
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
mtk_pcie_power_on:305 dev:00000000ffb21790 err:0
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
mtk_pcie_power_on:310 dev:00000000ffb21790 err:0
Looking for infracfg@10001000
Looking for infracfg@10001000
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
   - result for infracfg@10001000: infracfg@10001000 (ret=0)
mtk_pcie_power_on:315 dev:00000000ffb21790 err:0
mtk_pcie_power_on:322 dev:00000000ffb21790 err:0
mtk_pcie_power_on:327 dev:00000000ffb21790 err:0
mtk_pcie_power_on:333 dev:00000000ffb21790 err:0
mtk_pcie_power_on:338 dev:00000000ffb21790 err:0
mtk_pcie_power_on:343 dev:00000000ffb21790 err:0
mtk_pcie_power_on:348 dev:00000000ffb21790 err:0
drivers/pci/pcie_mediatek_gen3.c:mtk_pcie_startup_port[258] no card detected
mtk_pcie_power_on:353 dev:00000000ffb21790 err:-110
BPI-R4>

Strange that the second pcie 0x11290000 is not enumerated…(had forgot to push the change to pci-baseaddr)

on my board both ports are enumerated, but i have no card in…mhm, but only in pci enum

this is how it looks on my board

BPI-R4> pci list                                                                
BPI-R4> pci enum                                                                
mtk_pcie_power_on:282 start                                                     
mtk_pcie_power_on:284 dev:0000000011280000                                      
mtk_pcie_power_on:291 dev:0000000011280000 err:0                                
mtk_pcie_power_on:300 dev:0000000011280000 err:0                                
mtk_pcie_power_on:305 dev:0000000011280000 err:0                                
mtk_pcie_power_on:310 dev:0000000011280000 err:0                                
mtk_pcie_power_on:315 dev:0000000011280000 err:0                                
mtk_pcie_power_on:322 dev:0000000011280000 err:0                                
mtk_pcie_power_on:327 dev:0000000011280000 err:0                                
mtk_pcie_power_on:333 dev:0000000011280000 err:0                                
mtk_pcie_power_on:338 dev:0000000011280000 err:0                                
mtk_pcie_power_on:343 dev:0000000011280000 err:0                                
mtk_pcie_power_on:348 dev:0000000011280000 err:0                                
drivers/pci/pcie_mediatek_gen3.c:mtk_pcie_startup_port[258] no card detected    
mtk_pcie_power_on:353 dev:0000000011280000 err:-110                             
mtk_pcie_power_on:282 start                                                     
mtk_pcie_power_on:284 dev:0000000011290000                                      
mtk_pcie_power_on:291 dev:0000000011290000 err:-61                              
mtk_pcie_power_on:300 dev:0000000011290000 err:0                                
mtk_pcie_power_on:305 dev:0000000011290000 err:0                                
mtk_pcie_power_on:310 dev:0000000011290000 err:0                                
mtk_pcie_power_on:315 dev:0000000011290000 err:0                                
mtk_pcie_power_on:333 dev:0000000011290000 err:0                                
mtk_pcie_power_on:338 dev:0000000011290000 err:0                                
mtk_pcie_power_on:343 dev:0000000011290000 err:0                                
mtk_pcie_power_on:348 dev:0000000011290000 err:0                                
drivers/pci/pcie_mediatek_gen3.c:mtk_pcie_startup_port[258] no card detected    
mtk_pcie_power_on:353 dev:0000000011290000 err:-110                             
BPI-R4> pci list                                                                
mtk_pcie_power_on:282 start                                                     
mtk_pcie_power_on:284 dev:0000000011280000                                      
mtk_pcie_power_on:291 dev:0000000011280000 err:0                                
mtk_pcie_power_on:300 dev:0000000011280000 err:0                                
mtk_pcie_power_on:305 dev:0000000011280000 err:0                                
mtk_pcie_power_on:310 dev:0000000011280000 err:0                                
mtk_pcie_power_on:315 dev:0000000011280000 err:0                                
mtk_pcie_power_on:322 dev:0000000011280000 err:0                                
mtk_pcie_power_on:327 dev:0000000011280000 err:0                                
mtk_pcie_power_on:333 dev:0000000011280000 err:0                                
mtk_pcie_power_on:338 dev:0000000011280000 err:0                                
mtk_pcie_power_on:343 dev:0000000011280000 err:0                                
mtk_pcie_power_on:348 dev:0000000011280000 err:0                                
drivers/pci/pcie_mediatek_gen3.c:mtk_pcie_startup_port[258] no card detected    
mtk_pcie_power_on:353 dev:0000000011280000 err:-110                             
BPI-R4>

maybe pci list needs to set the pci device before like it is with mmc (mmc dev 1 => pci dev 1)?

mhm, tried pci dev 1 to switch to the second pci controller, but nothing…really strange because pci list have no help page and not listed in “pci help”

Closing this in favor of [BPI-R4] Failed attempt: add NVMe support on uboot to focus the discussion on a single thread.