Start a device after boot

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

dormand
Posts: 1
Joined: Fri Feb 22, 2019 10:13 pm

Start a device after boot

Sat Feb 23, 2019 2:47 am

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.
blue_z
Location: USA
Posts: 1943
Joined: Thu Apr 19, 2007 10:15 pm

Re: Start a device after boot

Wed Feb 27, 2019 1:45 am

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

Return to “LINUX”

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests