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.

Linux/DM385: Can't preserve U-Boot GPIO setting in Linux

Part Number: DM385

Tool/software: Linux

I have a DM38x TI Camera Starter Kit, and I’m using the ipnc_rdk-3.9.1 TI Linux distribution. I’m also running off the NAND flash device.

I want to set the value of a GPIO pin at U-Boot time and have that value preserved (i.e., not rewritten) after Linux begins. The values are correctly set by U-Boot, and by Linux; I can see one of the LEDs on the board is lit.  However, there is a gap when the light is off after Linux starts, until maybe 3 seconds goes by.

I determined that I was using the file omap_hwmod_3xxx_data.c file for some of the initialization. I checked out previous forum queries, and found suggestions to remove the value of SYSC_HAS_SOFTRESET from the flags element of struct omap3xxx_gpio_sysc. I also appended the value of HWMOD_INIT_NO_RESET to the flags element of the struct omap3xxx_gpio1_hwmod, and the other omap3xxx gpio hwmod structs. Both of these changes were in the file omap_hwmod_3xxx_data.c.

However, neither of these changes enables Linux to run with my GPIO pin value preserved. Can you help me?

Thanks,

Larry

  • Hi ,

    This is already been done IPNC RDK 3.9.1,

    HWMOD used for DM385 is "omap_hwmod_81xx_data.c" - HWMOD_INIT_NO_RESET is already been done. Check if any of platform related files actually modify that.

    If you still doubt HWMOD I suggest read controller register and set few more GPIO's and cross check if value is preserved. Be careful GPIO bank1 is not enabled in U-Boot as I remember.

  • Are saying that I am actually using "omap_hwmod_81xx_data.c" to set my struct values? I have been changing the values of two structs. Do you mean that I only need to modify the omap_hwmon struct? But that one already uses HWMOD_INIT_NO_RESET for flags, and then I would be able to persist my value across Linux boots. What are the “platform related files” I should take a look at?

    In the omap_hwmod_81xx_data.c file, the struct dm81xx_gpio_sync has the value SYS_HAS_SOFTRESET included in the sysc flags; is this the value I should remove?

    Do you mean that I can’t set any GPIO values from bank 1 (the second bank, right?) in U-Boot? Or that I just can’t get them to persist through Linux booting?

    Thanks again,
    Larry
  • Hi,

    I meant ti81xx-common but anyhow that wouldn't be changing any LED, GPIO Bank1 clocks are not enabled in U-Boot so you can't configure them in u-boot.
    Please stop ipnc default service which starts IPNC application and try.

    i.e
    Use linux systemctl command,
    "systemctl disable ipnc-rdk-usecase.service"
  • Thanks for writing back so quickly.

    First, I’m not building the ti81xx-common file. Apparently it’s not specified in the “config fragments” build. Is this something I need to add? Is there some code that I need that I am not building right now?

    If I am running “out of the box” ipnc-rdk-3.9.1, are there any variables that I need to change in the two structs I mentioned?

    I don’t need to change any code in bank 1 of GPIOs. Was this the reason I would run the “systemctl disable” command?

    Thanks again,
    Larry
  • Hi,

    Anyhow I am not sure. Default build I presume ti81xx-common should build without any change in config. Why I suggest you to disable applications is it loads firmware for other cores. If other cores doing any muxing that would have caused LED is to lit off is my doubt. So I asked you to confirm by disabling RDK use case service which loads firmware.