cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
1,437 Views
Registered: ‎02-29-2016

How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution

How do you determine which pins are associated with i2c0_3_grp, as show below?  The mapping is not explicitly written out in the devicetree binding documentation.

 

pinctrl_i2c0_default: i2c0-default {
		mux {
			groups = "i2c0_3_grp";
			function = "i2c0";
		};

		conf {
			groups = "i2c0_3_grp";
			bias-pull-up;
			slew-rate = <SLEW_RATE_SLOW>;
			io-standard = <IO_STANDARD_LVCMOS18>;
		};
	};

Thanks,

Sam

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
1,354 Views
Registered: ‎05-26-2017

Re: How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution

This was quite frustrating for me as well.. But the information you want is in 

 

/sys/kernel/debug/pinctrl/ff180000.pinctrl

 

for instance, check out the pingroups file

 

group: mdio1_0_grp
pin 50 (MIO50)
pin 51 (MIO51)

 

group: mdio1_1_grp
pin 76 (MIO76)
pin 77 (MIO77)

 

group: mdio2_0_grp
pin 76 (MIO76)
pin 77 (MIO77)

group: mdio3_0_grp
pin 76 (MIO76)
pin 77 (MIO77)

 

group: qspi0_0_grp
pin 0 (MIO0)
pin 1 (MIO1)
pin 2 (MIO2)
pin 3 (MIO3)
pin 4 (MIO4)
pin 8 (MIO8)
pin 9 (MIO9)
pin 10 (MIO10)
pin 11 (MIO11)
pin 12 (MIO12)

 

etc

 

Have a great weekend !

 

/Otto

View solution in original post

6 Replies
Highlighted
Voyager
Voyager
1,393 Views
Registered: ‎09-14-2016

Re: How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution

 

	DEFINE_ZYNQ_PINCTRL_GRP(i2c0_3),

Hi @swinchen,

 

 

I'm not an expert but:

 

If you take a look in linux-xlnx/drivers/pinctrl/pinctrl-zynq.c (line 302):

 

 

static const unsigned int i2c0_3_pins[] = {22, 23};

After that we can see a macro (DEFINE_ZYNQ_PINCTRL_GRP @line 391)

 

 

 

#define DEFINE_ZYNQ_PINCTRL_GRP(nm) \
	{ \
		.name = #nm "_grp", \
		.pins = nm ## _pins, \
		.npins = ARRAY_SIZE(nm ## _pins), \
	}

So when the macro is called with 

 

 

DEFINE_ZYNQ_PINCTRL_GRP(i2c0_3),

the "_grp" is added to the name.

 

 

At the end we have i2c0_3_grp -->  {22, 23};

 

I'm not sure if it's really clear so feel free to ask if you more info about that :)

 

Good luck,

Cheers.

Trigger

0 Kudos
Highlighted
Observer
Observer
1,382 Views
Registered: ‎02-29-2016

Re: How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution

Hi , Trigger.

 

Thanks for the response.

 

We are using the ZynqMP (Ultrascale+ SoC), not the Zynq-7000.  The pinctrl driver is linux-xlnx/drivers/pinctrl/pinctrl-zynqmp.c which behaves much differently than the Zynq-7000 pinctrl.  It appears as though the pinctrl driver for the ZynqMP queries the PMU firmware to determine groups and pins.

 

Thanks,

Sam

0 Kudos
Highlighted
Voyager
Voyager
1,365 Views
Registered: ‎09-14-2016

Re: How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution

Hi Swinchen,

 

Sorry, my bad :-( I'm not able to read the title correctly ...

 

Cheers,

Trigger

0 Kudos
Highlighted
Adventurer
Adventurer
1,355 Views
Registered: ‎05-26-2017

Re: How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution

This was quite frustrating for me as well.. But the information you want is in 

 

/sys/kernel/debug/pinctrl/ff180000.pinctrl

 

for instance, check out the pingroups file

 

group: mdio1_0_grp
pin 50 (MIO50)
pin 51 (MIO51)

 

group: mdio1_1_grp
pin 76 (MIO76)
pin 77 (MIO77)

 

group: mdio2_0_grp
pin 76 (MIO76)
pin 77 (MIO77)

group: mdio3_0_grp
pin 76 (MIO76)
pin 77 (MIO77)

 

group: qspi0_0_grp
pin 0 (MIO0)
pin 1 (MIO1)
pin 2 (MIO2)
pin 3 (MIO3)
pin 4 (MIO4)
pin 8 (MIO8)
pin 9 (MIO9)
pin 10 (MIO10)
pin 11 (MIO11)
pin 12 (MIO12)

 

etc

 

Have a great weekend !

 

/Otto

View solution in original post

Highlighted
Observer
Observer
756 Views
Registered: ‎02-29-2016

Re: How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution

How do you enable that debug interface? is that a dyndbg thing?

0 Kudos
Highlighted
Observer
Observer
740 Views
Registered: ‎02-29-2016

Re: How do you determine which pins correspond to a devicetree group on the ZynqMP?

Jump to solution
mount -t debugfs none /sys/kernel/debug/

This did it.  Thanks!

0 Kudos