This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Conditional hardware validation in the board file



Good morning,

I'm using an AM335x processor in our new product with linux 3.2.

I changed the board file to match the hardware and everything is working just fine.

Here is my question:

During boot process I need to enable the wifi hardware and load the driver if the customer has paid for the option. So here is the idea, if the customer pay for the hardware option, I was thinking writing a flag in the emmc and during boot process I want to read the flag and turn on/off a GPIO that enable the hardware. Obviously the emmc would have to be enable before the wifi.

Is it actually doable and can anybody help me out?

Thank you so much

  • You can read out the file system in the bootloader uboot. And then, you can set a flag in the kernel command line.

    Inside the board file, you can examine the flag. Read about the kernel command line in the linux documentation.

    regards

    Wolfgang

  • If you use the syntax "flag=value" in the kernel command line, this statement is added to the environment of the init process. From there, it is inherited to any child of init.

    So if you add a "HAVE_WIFI=1" to the kernel command line, your linux program has the environment variable HAVE_WIFI with the value "1". Very easy.

    regards

    Wolfgang