Does imx.6 device tree gpio config just need to set bit 31 as high?

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

Does imx.6 device tree gpio config just need to set bit 31 as high?

2,310 Views
wallyyeh
Contributor V

Hi, guys:

    Recently I'm trying kernel 4.1(I was working in kernel 3.0.35 for a long time), now one question is made me crazy:

Does gpio's config in device tree always just set bit 31 as high(and leave all ohter bits 0)?

In arch/arm/boot/dts/imx6qdl-sabresd.dtsi:

pinctrl_hog: hoggrp {
fsl,pins = <
MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x80000000
MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000
MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000
MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x80000000

...}

seems use PAD as GPIO all I need to do is set its config as 0x8000000.

    But I got an except here, in the same file:

pinctrl_gpio_keys: gpio_keysgrp {
fsl,pins = <
MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x1b0b0
MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x1b0b0
MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x1b0b0
>;
};

    From Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt, I got a brief described:

Bits used for CONFIG:
NO_PAD_CTL(1 << 31): indicate this pin does not need config.

    Geez, why pinctrl_gpio_keys need to set these gpio configs as 0x1b0b0?

I also check the IMX6QDRM, and found 0x1b0b0 is the default value of IOMUXC_SW_PAD_CTL_PAD_XXX_XXX.

Any suggestion will be appreciated, thanks.

Wally

Labels (2)
4 Replies

1,097 Views
wallyyeh
Contributor V

Hi, Igorpadykov:

    Thankyou, I appreciated your answer.    :smileygrin:

    You mean pinctrl_gpio_keys will be changed during U-Boot, so I suppose gpios in pinctrl_hog are not changed during U-Boot, is it correct?

Wally

0 Kudos

1,097 Views
igorpadykov
NXP Employee
NXP Employee

I meant they can be changed in uboot, so linux sets them in predefined

state for usage with linux drivers

~igor

0 Kudos

1,097 Views
wallyyeh
Contributor V

Hi, Igor:

igorpadykov 留言:

I meant they can be changed in uboot, so linux sets them in predefined

state for usage with linux drivers

 

~igor

It sounds reasonable that we should set all gpio in predefined state if we wanna use them.

your answer let me understand that why setting pinctrl_gpio_keys group as 0x1b0b0, but I still can not understand why don't do the same setting to the pinctrl_hog gruop? I think they are under the same purpose - for gpio.

So I think they(pinctrl_gpio_keys and pinctrl_hog) should be different, maybe the input/output is different?

Wally

1,097 Views
igorpadykov
NXP Employee
NXP Employee

Hi Wally

>why pinctrl_gpio_keys need to set these gpio configs as 0x1b0b0?

it could be changed before in bootloader, so linux sets them in some predefined

state.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos