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
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
I meant they can be changed in uboot, so linux sets them in predefined
state for usage with linux drivers
~igor
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
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!
-----------------------------------------------------------------------------------------------------------------------