Page 1 of 1

Start a device after boot

Posted: Sat Feb 23, 2019 2:47 am
by dormand
Our project involves a module that contains a serial (QSPI) flash device that is plugged into the base unit after the base unit has been powered and booted. We are modeling this on the at91-sama5d27_som1_ek, and in the device tree for that board (actually the SOM on that board), I find the settings that start the driver and query the part. I tweaked the driver to include the ISSI flash device we are actually using, and sure enough, if the flash device is there at boot-time, it talks to it and correctly identifies it from the JEDEC info.

But this is at boot time. I can strip out the partition info from the device tree, and now it doesn't look for the flash device at boot. The tweaked driver is of course still compiled into the kernel (not a module).

Our use-case is for the operator to push a button on the base unit to tell it that the module has been installed. How do I tell the kernel to tell the driver to look for the flash device upon detecting a GPIO event? It isn't clear to me that udev is going to be useful. I'm suspecting I will need to use mknod to create the device files and connect them to the driver.

Re: Start a device after boot

Posted: Wed Feb 27, 2019 1:45 am
by blue_z
dormand wrote: I can strip out the partition info from the device tree, and now it doesn't look for the flash device at boot.
FYI if there's no description of a device in your DT, then that device will never be installed (during boot or anytime after boot).

dormand wrote: The tweaked driver is of course still compiled into the kernel (not a module).
Why not make it a loadable module?
If a built-in module has __init sections, then that code can only be executed during boot.


Regards