Problem reading imx7ulp uboot gpio input value

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem reading imx7ulp uboot gpio input value

192 Views
sjkim
Contributor II

I want to read gpio input value from u-boot.

 

--------------------------------------------------------------------------------------------------------

static iomux_cfg_t const_board_pad[] = {
MX7ULP_PAD_PTE6__PTE6 | MUX_PAD_CTRL(PAD_CTL_IBE_ENABLE),
MX7ULP_PAD_PTE7__PTE7 | MUX_PAD_CTRL(PAD_CTL_IBE_ENABLE),
MX7ULP_PAD_PTE10__PTE10 | MUX_PAD_CTRL(PAD_CTL_IBE_ENABLE),
MX7ULP_PAD_PTE11__PTE11 | MUX_PAD_CTRL(PAD_CTL_IBE_ENABLE),
};

int show_hardware_version(void);

#define HW0_GPIO IMX_GPIO_NR(5, 7)
#define HW1_GPIO IMX_GPIO_NR(5, 6)
#define HW2_GPIO IMX_GPIO_NR(5, 10)
#define HW3_GPIO IMX_GPIO_NR(5, 11)

 

mx7ulp_iomux_setup_multiple_pads(const_board_pad, ARRAY_SIZE(const_board_pad));
if (gpio_request(HW0_GPIO, "hw0"))
printf("request error hw0\n");
if (gpio_request(HW1_GPIO, "hw1"))
printf("request error hw1\n");
if (gpio_request(HW2_GPIO, "hw2"))
printf("request error hw2\n");
if (gpio_request(HW3_GPIO, "hw3"))
printf("request error hw3\n");

gpio_direction_input(HW0_GPIO);
gpio_direction_input(HW1_GPIO);
gpio_direction_input(HW2_GPIO);
gpio_direction_input(HW3_GPIO);

hw_pin[0] = gpio_get_value(HW0_GPIO);
hw_pin[1] = gpio_get_value(HW1_GPIO);
hw_pin[2] = gpio_get_value(HW2_GPIO);
hw_pin[3] = gpio_get_value(HW3_GPIO);

printf("####################### %d %d %d %d\n", hw_pin[0], hw_pin[1], hw_pin[2], hw_pin[3]);

-------------------------------------------------------------------

PMC_1V8 pull up is applied to MX7ULP_PAD_PTE6__PTE 6 pin.

However, all gpio values ​​are displayed as 0 .
The scope shows 1.8v high, but the value doesn't change.

Conversely, after setting the output, it was confirmed that it is controlled.

--------------------------------------

md 40AC0118  1

40ac0118: 00010100

-------------------------------------

I checked the registry value in u boot and there was no problem.

But when I read the values ​​below, there is no change.

--------------------------------------

md 400f0090 1

400f0090: 00000000

---------------------------------------

I tried to read the value in various ways, but it didn't solve the problem.

Can you tell me how to solve it?

 

 

 

0 Kudos
0 Replies