Finding Hardware Drivers

Preamble: New to SBC’s so still wrapping my head around things in this space .vs. the MCU world.

Questions below are for the AML-S905X-CC Le Potato. Running Debian 12.

I general terms, I understand that the device tree is used to map physical pins of the 40-pin header to certain functions. So to enable an SPI bus, use the ldto tool with the appropriate overlay, etc. and we can now connect an SPI device.

That gets us the physical connections, but we still need a driver with an API to interact with the physical device. Correct?

For example, if I want to connect an NRF24L01 module. Set up the SPI bus as noted. Now, how would I find a library to interact with the device?

And, how can I find out what drivers for what external bits of hardware are included in a Libre endorsed distribution/image?

And to follow on, is there a way to find what drivers might be available for external hardware (thinking small LCD displays with ILI and ST driver chips, ultrasonic distance modules, WS2812 LED strips, BME & BMP pressure & temperature sensors, etc.) other than many internet searches?

If Debian isn’t a good choice for this, other suggestions?

Many thanks.

MCUs usually have no operating systems. They run a sequence of commands from flash on start.

Application processors run full operating systems with processes, isolation, and much more. There’s dozens of layers of abstraction between the hardware and the final software.

  1. SPI interface can be exposed directly to userspace software. Userspace libraries can drive the raw SPI interface in a non-realtime fashion via an userspace driver. Software can be dynamically compiled in userspace as needed to change how it drives the hardware.
  2. SPI interface is not exposed to userspace. The kernel must have a driver for the device and exposes subsystem API to userspace. Instead of userspace libraries driving the hardware, an userspace software interacts with the kernel via high level APIs and the kernel driver translates actions into raw SPI commands sent over the SPI bus.

Drivers are called modules in the kernel and you can check if they are enabled in the config file in the boot directory. You can check for the modules on our GitHub kernel tree.

The overlays links the hardware to the driver. It tells the kernel that a specific hardware exists at a certain location.

If you want to learn more, order a book on embedded systems and it will teach you the necessary bits. There’s too many details to cover here.

Thank-you for the reply. I’m certainly open to learning more on how things tick in this environment.

If I may rephrase, in examining the list of modules in the kernel, how do I know what the purpose of each module is? That is, what bit of hardware is a module designed to interact with and then, how do I find the API for that module?

Appreciate your time.

You have to do research yourself as this is way out of scope.

Good question. My Libre is still in the mail on its way when I ran across your question. I started reading the tutorials and guides forum starting with the how to control the GPIO blah blah blah thingies. So far the information has been informative. Thansk for the question.