GPIO in u-boot

      GPIO in u-boot

      Dear support-team,

      I want to set pin 32 of gpio expander (armstoneA9) to high level in u-boot.
      I added following lines to function board_init into file board/F+S/fsimx6/fsimx6.c

      Source Code

      1. gpio_direction_output(IMX_GPIO_NR(1, 21), 0);
      2. gpio_set_value(IMX_GPIO_NR(1, 21), 1);

      The pin value still is at 0V while booting (also before kernel is starting).

      Any idea? Thanks.
      The pin may not be configured for GPIO in the pin MUX. So you also have to add pad settings for this pad before you use it with the gpio functions.

      Source Code

      1. static iomux_v3_cfg_t const mypad[] = {
      2. IOMUX_PADS(PAD_SD1_DAT3_GPIO1_IO21 | MUX_PAD_CTRL(NO_PAD_CTRL)),
      3. };
      4. ...
      5. SETUP_IOMUX_PADS(mypad);


      Remark: Instead of adding own code to fsimx6.c, you can also directly modify the appropriate registers on the U-Boot command line with command mw.l. However then you have to keep track on what CPU version you are on, as the IOMUXC addresses differ between Solo/DualLite and Dual/Quad. You can use environment variable $platform to detect the CPU type.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.