[U-Boot] Using sspi for hardware detection?

Romain Naour romain.naour at smile.fr
Wed Nov 27 10:58:47 UTC 2019


I'm working on a modular socfpga based system with several optional boards.
Each optional board contain a board ID that can be read through a SPI bus.

Since we want just read the board ID, we used manually the sspi command,
something like:

=> sspi 1:1.0 8 0

But it seems that the sspi command can't be used in a uboot script. sspi seems
only used to manually test spi drivers.

If we compare with i2c command, we have a i2c read to memory:

i2c read chip address[.0, .1, .2] length memaddress - read to memory

Why there is no such feature for spi ?
Is there an interest to evolve the sspi command to add a read to memory?

sspi <bus id>: <chip select>.<mode> <bit length> <data> <memaddress>

By looking at existing code, it seems that hardware detection in uboot is
handled by architecture/board specific code to set custom environment variable
like "fpgatype" [1] or "unit_ident" "unit_serial" [2] (misc_init_r).

What do you recommend?
Implement a custom misc_init_r() for hardware detection?


Best regards,

More information about the U-Boot mailing list