U-boot not loading NVMe driver on Pi CM4

Ignatius Rivaldi minecraft2048 at gmail.com
Wed Feb 15 06:18:06 CET 2023


On Wed, Feb 15, 2023 at 3:52 PM Ignatius Rivaldi <minecraft2048 at gmail.com>
wrote:

>
> Hi Stefan,
> On Tue, Feb 14, 2023 at 2:00 AM Stefan Roese <sr at denx.de> wrote:
>
>> Hi Ignatius,
>>
>> On 2/10/23 17:05, Simon Glass wrote:
>> > Hi Ignatius,
>> >
>> > On Thu, 9 Feb 2023 at 17:29, Ignatius Rivaldi <minecraft2048 at gmail.com>
>> wrote:
>> >>
>> >> Added more debug logging and for some reason the nvme driver tries to
>> bind
>> >> to pcie root bridge instead of the SSD
>> >> drivers/pinctrl/pinctrl-uclass.c:300-pinctrl_select_state_simple()
>> >> pcie_brcm pcie at 7d500000: set_state_simple op missing
>> >> PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
>> >> drivers/core/device.c:184-  device_bind_common() Bound device
>> pci_0:0.0 to
>> >> pcie at 7d500000
>> >> drivers/core/uclass.c:338-uclass_find_device_by_seq() 0
>> >> drivers/core/uclass.c:346-uclass_find_device_by_seq()    - 0
>> 'gpio at 7e200000'
>> >>
>> >> drivers/core/uclass.c:349-uclass_find_device_by_seq()    - found
>> >> drivers/pinctrl/pinctrl-uclass.c:300-pinctrl_select_state_simple()
>> >> pci_bridge_drv pci_0:0.0: set_state_simple op missing
>> >> drivers/core/device.c:184-  device_bind_common() Bound device nvme#0 to
>> >> pci_0:0.0
>> >> U-Boot> pci
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:338-uclass_find_device_by_seq() 0
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:346-uclass_find_device_by_seq()
>> >>     - 0 'pcie at 7d500000'
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:349-uclass_find_device_by_seq()
>> >>     - found
>> >> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> >> _____________________________________________________________
>> >> 00.00.00   0x14e4     0x2711     Bridge device           0x04
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:338-uclass_find_device_by_seq() 1
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:346-uclass_find_device_by_seq()
>> >>     - 0 'pcie at 7d500000'
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:346-uclass_find_device_by_seq()
>> >>     - 1 'pci_0:0.0'
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:349-uclass_find_device_by_seq()
>> >>     - found
>> >> 01.00.00   0x1e0f     0x0001     Mass storage controller 0x08
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:338-uclass_find_device_by_seq() 2
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:346-uclass_find_device_by_seq()
>> >>     - 0 'pcie at 7d500000'
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:346-uclass_find_device_by_seq()
>> >>     - 1 'pci_0:0.0'
>> >>
>> DEBUG.driver-model,drivers/core/uclass.c:353-uclass_find_device_by_seq()
>> >>     - not found
>> >>
>> >> It should be pci_1:0.0 I think
>> >>
>> >> On Thu, Feb 9, 2023 at 11:22 AM Ignatius Rivaldi <
>> minecraft2048 at gmail.com>
>> >> wrote:
>> >
>> > (please try not to top post)
>> >
>> > I don't know what is going on here. The PCI scan seems to show the
>> > wrong device, as you say. Perhaps it is a bug in the bcm controller
>> > driver?
>> >
>> > +Michal Suchanek
>> > +Stefan Roese
>>
>> I've not used the NVMe driver in U-Boot yet, but at least the PCI class
>> and subclass ID seem to be fine AFAIT:
>>
>> class code =                  0x01 (Mass storage controller)
>> sub class code =              0x08
>> programming interface =       0x02
>>
>> Are other PCI drivers probed correctly, if you can test this on your
>> board? E.g. an Intel E1000 PCIe board perhaps?
>>
>> Added Bin, perhaps he has some further ideas.
>>
>> Thanks,
>> Stefan
>>
>> (for some reason your email got sent to my spam folder)
>
> I'm installing the u-boot to the NVMe drive as the CM4 I have doesn't have
> eMMC
> And CM4 only have 1 PCIe lane so I can't add another PCIe device
>
> I think Home Assistant OS 9.5 which is based on u-boot 2022.1 works with
> my hardware,
> as the green LED is blinking. But I'm not sure as it seems that their rpi4
> build doesn't enable
> serial console.
>
> Thanks
> Ignatius
>
>

I've got serial out working with Home Assistant OS 9.5:
https://github.com/home-assistant/operating-system/releases/tag/9.5
and I can confirm that their u-boot works with my hardware:

U-Boot 2022.01 (Feb 15 2023 - 02:55:50 +0000)

DRAM:  948 MiB
RPI Compute Module 4 (0xa03140)
MMC:   mmcnr at 7e300000: 1, mmc at 7e340000: 0
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet at 7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
No working controllers found
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
MMC Device 2 not found
no mmc device at slot 2

Device 0: Vendor: 0x1e0f Rev: 10410106 Prod: X15PD1GSQX93
           Type: Hard Disk
           Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
... is now current device
Scanning nvme 0:1...
Found U-Boot script /boot.scr
2411 bytes read in 0 ms
## Executing script at 02400000

Device 0: Vendor: 0x1e0f Rev: 10410106 Prod: X15PD1GSQX93
           Type: Hard Disk
           Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
... is now current device
loading env...

nvme read: device 0 block # 1214464, count 32 ... 32 blocks read: OK
Trying to boot slot A, 0 attempts remaining. Loading kernel ...
23677440 bytes read in 400 ms (56.5 MiB/s)
storing env...

nvme write: device 0 block # 1214464, count 32 ... 32 blocks written: OK
Starting kernel
Moving Image from 0x80000 to 0x200000, end=19a0000
## Flattened Device Tree blob at 2eff2900
  Booting using the fdt blob at 0x2eff2900
  Using Device Tree in place at 000000002eff2900, end 000000002f002f2b

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]

I can't press any key to enter the u-boot prompt, so I can't run nvme scan
command.
But this show that there's a certain combination of:
- U boot version
- U boot build config
- RPI4 firmware

that works



> >
>> > Regards,
>> > SImon
>> >
>> >
>> >>
>> >>> Hi all,
>> >>>
>> >>> I'm using U-boot 2022.07 from Yocto Langdale distribution, with the
>> >>> following NVMe related kconfigs manually enabled through menuconfig:
>> >>>
>> >>> CONFIG_NVME
>> >>> CONFIG_NVME_PCI
>> >>> CONFIG_CMD_NVME
>> >>>
>> >>> and logging turned into max
>> >>>
>> >>> The SSD is Kioxia SSD, and it works with Pi 4 bootloader as I can boot
>> >>> Raspberry Pi OS from the NVMe drive.
>> >>>
>> >>> U boot is installed in the fat32 partition in the NVMe SSD for this
>> Yocto
>> >>> poky build.
>> >>>
>> >>> When I boot to U boot prompt, I can see that the SSD is detected by
>> pci
>> >>> U-Boot> pci long
>> >>> 0
>> >>>    - 0 'pcie at 7d500000'
>> >>>    - found
>> >>>
>> >>> Found PCI device 00.00.00:
>> >>>   vendor ID =                   0x14e4
>> >>>   device ID =                   0x2711
>> >>>   command register ID =         0x0006
>> >>>   status register =             0x0010
>> >>>   revision ID =                 0x20
>> >>>   class code =                  0x06 (Bridge device)
>> >>>   sub class code =              0x04
>> >>>   programming interface =       0x00
>> >>>   cache line =                  0x08
>> >>>   latency time =                0x00
>> >>>   header type =                 0x01
>> >>>   BIST =                        0x00
>> >>>   base address 0 =              0x00000000
>> >>>   base address 1 =              0x00000000
>> >>>   primary bus number =          0x00
>> >>>   secondary bus number =        0x01
>> >>>   subordinate bus number =      0x01
>> >>>   secondary latency timer =     0x00
>> >>>   IO base =                     0x00
>> >>>   IO limit =                    0x00
>> >>>   secondary status =            0x0000
>> >>>   memory base =                 0xc000
>> >>>   memory limit =                0xc000
>> >>>   prefetch memory base =        0xfff1
>> >>>   prefetch memory limit =       0x0001
>> >>>   prefetch memory base upper =  0x00000000
>> >>>   prefetch memory limit upper = 0x00000000
>> >>>   IO base upper 16 bits =       0x0000
>> >>>   IO limit upper 16 bits =      0x0000
>> >>>   expansion ROM base address =  0x00000000
>> >>>   interrupt line =              0x00
>> >>>   interrupt pin =               0x01
>> >>>   bridge control =              0x0000
>> >>> 1
>> >>>    - 0 'pcie at 7d500000'
>> >>>    - 1 'pci_0:0.0'
>> >>>    - found
>> >>>
>> >>> Found PCI device 01.00.00:
>> >>>   vendor ID =                   0x1e0f
>> >>>   device ID =                   0x0001
>> >>>   command register ID =         0x0006
>> >>>   status register =             0x0010
>> >>>   revision ID =                 0x00
>> >>>   class code =                  0x01 (Mass storage controller)
>> >>>   sub class code =              0x08
>> >>>   programming interface =       0x02
>> >>>   cache line =                  0x08
>> >>>   latency time =                0x00
>> >>>   header type =                 0x00
>> >>>   BIST =                        0x00
>> >>>   base address 0 =              0xc0000004
>> >>>   base address 1 =              0x00000000
>> >>>   base address 2 =              0x00000000
>> >>>   base address 3 =              0x00000000
>> >>>   base address 4 =              0x00000000
>> >>>   base address 5 =              0x00000000
>> >>>   cardBus CIS pointer =         0x00000000
>> >>>   sub system vendor ID =        0x1e0f
>> >>>   sub system ID =               0x0001
>> >>>   expansion ROM base address =  0x00000000
>> >>>   interrupt line =              0x00
>> >>>   interrupt pin =               0x01
>> >>>   min Grant =                   0x00
>> >>>   max Latency =                 0x00
>> >>> 2
>> >>>    - 0 'pcie at 7d500000'
>> >>>    - 1 'pci_0:0.0'
>> >>>    - not found
>> >>>
>> >>> but it doesn't show up in nvme scan or nvme info
>> >>> U-Boot> nvme info
>> >>> U-Boot> nvme scan
>> >>>
>> >>> I know that U boot can boot from NVMe, as I can run Home Assistant OS
>> that's
>> >>> based on U boot on NVMe drive. I just don't know if I missed a kconfig
>> >>> somewhere, or this U boot version haven't implement it
>> >>>
>> >>> Can anyone help me with this?
>> >>>
>> >>> Thanks
>> >>> Ignatius
>> >>>
>>
>> Viele Grüße,
>> Stefan Roese
>>
>> --
>> DENX Software Engineering GmbH,      Managing Director: Erika Unter
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
>>
>


More information about the U-Boot mailing list