DTS files- syntax for gpio-ranges with iomuxc?

cancel
Showing results for 
Search instead for 
Did you mean: 

DTS files- syntax for gpio-ranges with iomuxc?

3,479 Views
charlieschultz
Contributor II

In the following snip from imx6ul.dtsi:, what do the numbers following iomuxc mean?

gpio-ranges = <&iomuxc  0 23 10>, <&iomuxc 10 17 6>, <&iomuxc 16 33 16>;
Labels (1)
0 Kudos
7 Replies

1,052 Views
charlieschultz
Contributor II

Thanks Carlos- yes, it describes gpio-ranges, but not the iomuxc part of it.

Empirically I think I've figured it out- it seems that that the first number is the start of the range, the 2nd number, when multiplied by 4 is the offset to the iomuxc control register (starting at 20E_0000h) and the third number is the number of bits in the group.

So for this entry (gpio1):

gpio-ranges = <&iomuxc  0 23 10>, <&iomuxc 10 17 6>, <&iomuxc 16 33 16>;

Now the GPIO1 registers aren't contiguous, there are 3 groups, hence 3 entries in the gpio-ranges statement.

First group is GPIO1.0 - GPIO1.9, base offset = 23 * 4 = 0x5c which is IOMUXC_SW_MUX_CTL_PAD_GPIO1_IO00

Second group is GPIO1.10 - GPIO1.15, base offset = 17 * 4 = 0x44 which is IOMUXC_SW_MUX_CTL_PAD_JTAG_MOD

Third group is GPIO1.16 - GPIO1.31, base offset = 33 * 4 = 0x84 which is IOMUXC_SW_MUX_CTL_PAD_UART1_TX_DATA

1,052 Views
BiyongSUN
NXP Employee
NXP Employee

Could you please point out which version NXP official release uses the gpio-ranges?

Here is the NXP git. Please confirm which tag .

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/

0 Kudos

1,052 Views
charlieschultz
Contributor II

rel_4.1.15-1.0.0_ga

0 Kudos

1,052 Views
charlieschultz
Contributor II

That's what repo info says. When I run bitbake, it says 4.1.15-1.2.0 is my distro version.

0 Kudos

1,052 Views
BiyongSUN
NXP Employee
NXP Employee

Where is the statement of gpio-ranges you mentioned in the imx6ul.dtsi of the NXP official release BSP rel_imx_4.1.15_1.2.0_ga ?

Please check the following link:

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/boot/dts/imx6ul.dtsi?id=re...

0 Kudos

1,052 Views
charlieschultz
Contributor II

Thanks Biyong- clearly I did not get it from the right place. My version of the file only has a 2015 copyright date (as opposed to 2015-2016) so I see now it is an old file. Google "gpio-ranges = <&iomuxc 0 49 16>, <&iomuxc 16 111 6>" and you'll see a number of places where you can find the out-of-date file- I probably picked it up there with my Windows PC (my build PC has the correct file).

0 Kudos

1,052 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Charlie,

please take a look to kernel-source/Documentation/devicetree/bindigns/gpio/gpio.txt, here is described gpio-ranges property.


Regards,
Carlos

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

0 Kudos