arm64: a37xx: pinctrl: Fix definitions for MPP pins 20-22
Subsystems (2)
PATCH 1/3 arm64: a37xx: pinctrl: Fix definitions for MPP pins 20-22
All 3 MPP pins (20, 21 and 22) can be configured individually and also can be configured to GPIO functions. Fix definitions for these MPP pins in existing pin groups. After this change GPIO function can be enabled just for one of these 3 pins.
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +5 -3
@@ -200,9 +200,11 @@ static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {PIN_GRP_GPIO ("pcie1" ,3 ,1 ,BIT (5 ),"pcie" ),/* this actually controls "pcie1_reset" */ PIN_GRP_GPIO ("pcie1_clkreq" ,4 ,1 ,BIT (9 ),"pcie" ),PIN_GRP_GPIO ("pcie1_wakeup" ,5 ,1 ,BIT (10 ),"pcie" ), -PIN_GRP_GPIO ("ptp" ,20 ,3 ,BIT (11 ) |BIT (12 ) |BIT (13 ),"ptp" ), -PIN_GRP ("ptp_clk" ,21 ,1 ,BIT (6 ),"ptp" ,"mii" ), -PIN_GRP ("ptp_trig" ,22 ,1 ,BIT (7 ),"ptp" ,"mii" ), +PIN_GRP_GPIO ("ptp" ,20 ,1 ,BIT (11 ),"ptp" ), +PIN_GRP_GPIO_3 ("ptp_clk" ,21 ,1 ,BIT (6 ) |BIT (12 ),0 ,BIT (6 ),BIT (12 ), +"ptp" ,"mii" ), +PIN_GRP_GPIO_3 ("ptp_trig" ,22 ,1 ,BIT (7 ) |BIT (13 ),0 ,BIT (7 ),BIT (13 ), +"ptp" ,"mii" ),PIN_GRP_GPIO_3 ("mii_col" ,23 ,1 ,BIT (8 ) |BIT (14 ),0 ,BIT (8 ),BIT (14 ), "mii", "mii_err"), };
Signature · 1 line
2.20.1
PATCH 3/3 arm64: a37xx: pinctrl: Improve description for pinmux command
In more cases group name consist of function name followed by function number. So if function name is just prefix of group name, show group name.
So in 'pinmux status -a' command output would be visible also extended function number, which is useful for debugging.
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +11 -1
@@ -406,7 +406,17 @@ static int armada_37xx_pmx_get_pin_muxing(struct udevice *dev, unsigned int selefor (f =0 ; f <NB_FUNCS && grp->funcs[f]; f++) {if (grp->val[f] == val) { -strlcpy (buf, grp->funcs[f], size); +/* +* In more cases group name consist of +* function name followed by function +* number. So if function name is just +* prefix of group name, show group name. +*/ +if (strncmp (grp->name, grp->funcs[f], +strlen (grp->funcs[f])) ==0 ) +strlcpy (buf, grp->name, size); +else +strlcpy (buf, grp->funcs[f], size);return 0 ; } }
Signature · 1 line
2.20.1
PATCH 2/3 arm64: a37xx: pinctrl: Remove unused macro PIN_GRP()
In reply to Pali RohárMacro PIN_GRP() is not used, remove it.
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +0 -10
@@ -99,16 +99,6 @@ struct armada_37xx_pinctrl {unsigned int nfuncs; }; -#define PIN_GRP (_name, _start, _nr, _mask, _func1, _func2) \ - { \ - .name = _name, \ - .start_pin = _start, \ - .npins = _nr, \ - .reg_mask = _mask, \ - .val = {0, _mask}, \ - .funcs = {_func1, _func2} \ - } -#define PIN_GRP_GPIO_0 (_name, _start, _nr) \ { \ .name = _name, \
Signature · 1 line
2.20.1
Quoted 6 lines · Pali Rohár
All 3 MPP pins (20, 21 and 22) can be configured individually and also can be configured to GPIO functions. Fix definitions for these MPP pins in existing pin groups. After this change GPIO function can be enabled just for one of these 3 pins.
Signed-off-by Pali Rohár <[email protected]>
Thanks,
Stefan
Quoted 13 lines
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +0
-1@@ -200,9 +200,11 @@ static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {PIN_GRP_GPIO ("pcie1" ,3 ,1 ,BIT (5 ),"pcie" ),/* this actually controls "pcie1_reset" */ PIN_GRP_GPIO ("pcie1_clkreq" ,4 ,1 ,BIT (9 ),"pcie" ), PIN_GRP_GPIO("pcie1_wakeup", 5, 1, BIT(10), "pcie"), - PIN_GRP_GPIO("ptp", 20, 3, BIT(11) | BIT(12) | BIT(13), "ptp"),
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c static struct armada_37xx_pin_group armada_37xx_sb_groups[] = { · line 210
Quoted 10 lines
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +5
-2-PIN_GRP ("ptp_clk" ,21 ,1 ,BIT (6 ),"ptp" ,"mii" ), -PIN_GRP ("ptp_trig" ,22 ,1 ,BIT (7 ),"ptp" ,"mii" ), +PIN_GRP_GPIO ("ptp" ,20 ,1 ,BIT (11 ),"ptp" ), +PIN_GRP_GPIO_3 ("ptp_clk" ,21 ,1 ,BIT (6 ) |BIT (12 ),0 ,BIT (6 ),BIT (12 ), +"ptp" ,"mii" ), +PIN_GRP_GPIO_3 ("ptp_trig" ,22 ,1 ,BIT (7 ) |BIT (13 ),0 ,BIT (7 ),BIT (13 ), +"ptp" ,"mii" ),PIN_GRP_GPIO_3 ("mii_col" ,23 ,1 ,BIT (8 ) |BIT (14 ),0 ,BIT (8 ),BIT (14 ), "mii", "mii_err"), };
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Re: [PATCH u-boot-marvell 2/3] arm64: a37xx: pinctrl: Remove unused macro PIN_GRP()
In reply to Pali RohárQuoted 3 lines · Pali Rohár
Macro
PIN_GRP()is not used, remove it.Signed-off-by Pali Rohár <[email protected]>
Thanks,
Stefan
Quoted 15 lines
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 10 ---------- 1 file changed, 10 deletions(-)drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +0
-3@@ -99,16 +99,6 @@ struct armada_37xx_pinctrl {unsigned int nfuncs; }; -#define PIN_GRP (_name, _start, _nr, _mask, _func1, _func2) \ - { \ - .name = _name, \
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c struct armada_37xx_pinctrl { · line 104
Quoted 10 lines
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +0
-7- .start_pin = _start, \ - .npins = _nr, \ - .reg_mask = _mask, \ - .val = {0, _mask}, \ - .funcs = {_func1, _func2} \ - } -#define PIN_GRP_GPIO_0 (_name, _start, _nr) \ { \ .name = _name, \
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Re: [PATCH u-boot-marvell 3/3] arm64: a37xx: pinctrl: Improve description for pinmux command
In reply to Pali RohárQuoted 7 lines · Pali Rohár
In more cases group name consist of function name followed by function number. So if function name is just prefix of group name, show group name.
So in 'pinmux status -a' command output would be visible also extended function number, which is useful for debugging.
Signed-off-by Pali Rohár <[email protected]>
Thanks,
Stefan
Quoted 17 lines
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +4
-1@@ -406,7 +406,17 @@ static int armada_37xx_pmx_get_pin_muxing(struct udevice *dev, unsigned int selefor (f =0 ; f <NB_FUNCS && grp->funcs[f]; f++) {if (grp->val[f] == val) { -strlcpy (buf, grp->funcs[f], size); +/* +* In more cases group name consist of +* function name followed by function +* number. So if function name is just
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c static int armada_37xx_pmx_get_pin_muxing(struct udevice *dev, unsigned int sele · line 422
Quoted 10 lines
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +7
-0+* prefix of group name, show group name. +*/ +if (strncmp (grp->name, grp->funcs[f], +strlen (grp->funcs[f])) ==0 ) +strlcpy (buf, grp->name, size); +else +strlcpy (buf, grp->funcs[f], size);return 0 ; } }
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Quoted 6 lines · Pali Rohár
All 3 MPP pins (20, 21 and 22) can be configured individually and also can be configured to GPIO functions. Fix definitions for these MPP pins in existing pin groups. After this change GPIO function can be enabled just for one of these 3 pins.
Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 13 lines
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +0
-1@@ -200,9 +200,11 @@ static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {PIN_GRP_GPIO ("pcie1" ,3 ,1 ,BIT (5 ),"pcie" ),/* this actually controls "pcie1_reset" */ PIN_GRP_GPIO ("pcie1_clkreq" ,4 ,1 ,BIT (9 ),"pcie" ), PIN_GRP_GPIO("pcie1_wakeup", 5, 1, BIT(10), "pcie"), - PIN_GRP_GPIO("ptp", 20, 3, BIT(11) | BIT(12) | BIT(13), "ptp"),
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c static struct armada_37xx_pin_group armada_37xx_sb_groups[] = { · line 210
Quoted 10 lines
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +5
-2-PIN_GRP ("ptp_clk" ,21 ,1 ,BIT (6 ),"ptp" ,"mii" ), -PIN_GRP ("ptp_trig" ,22 ,1 ,BIT (7 ),"ptp" ,"mii" ), +PIN_GRP_GPIO ("ptp" ,20 ,1 ,BIT (11 ),"ptp" ), +PIN_GRP_GPIO_3 ("ptp_clk" ,21 ,1 ,BIT (6 ) |BIT (12 ),0 ,BIT (6 ),BIT (12 ), +"ptp" ,"mii" ), +PIN_GRP_GPIO_3 ("ptp_trig" ,22 ,1 ,BIT (7 ) |BIT (13 ),0 ,BIT (7 ),BIT (13 ), +"ptp" ,"mii" ),PIN_GRP_GPIO_3 ("mii_col" ,23 ,1 ,BIT (8 ) |BIT (14 ),0 ,BIT (8 ),BIT (14 ), "mii", "mii_err"), };
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Re: [PATCH u-boot-marvell 2/3] arm64: a37xx: pinctrl: Remove unused macro PIN_GRP()
In reply to Pali RohárQuoted 3 lines · Pali Rohár
Macro
PIN_GRP()is not used, remove it.Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 15 lines
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 10 ---------- 1 file changed, 10 deletions(-)drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +0
-3@@ -99,16 +99,6 @@ struct armada_37xx_pinctrl {unsigned int nfuncs; }; -#define PIN_GRP (_name, _start, _nr, _mask, _func1, _func2) \ - { \ - .name = _name, \
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c struct armada_37xx_pinctrl { · line 104
Quoted 10 lines
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +0
-7- .start_pin = _start, \ - .npins = _nr, \ - .reg_mask = _mask, \ - .val = {0, _mask}, \ - .funcs = {_func1, _func2} \ - } -#define PIN_GRP_GPIO_0 (_name, _start, _nr) \ { \ .name = _name, \
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Re: [PATCH u-boot-marvell 3/3] arm64: a37xx: pinctrl: Improve description for pinmux command
In reply to Pali RohárQuoted 7 lines · Pali Rohár
In more cases group name consist of function name followed by function number. So if function name is just prefix of group name, show group name.
So in 'pinmux status -a' command output would be visible also extended function number, which is useful for debugging.
Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 17 lines
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +4
-1@@ -406,7 +406,17 @@ static int armada_37xx_pmx_get_pin_muxing(struct udevice *dev, unsigned int selefor (f =0 ; f <NB_FUNCS && grp->funcs[f]; f++) {if (grp->val[f] == val) { -strlcpy (buf, grp->funcs[f], size); +/* +* In more cases group name consist of +* function name followed by function +* number. So if function name is just
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c static int armada_37xx_pmx_get_pin_muxing(struct udevice *dev, unsigned int sele · line 422
Quoted 10 lines
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +7
-0+* prefix of group name, show group name. +*/ +if (strncmp (grp->name, grp->funcs[f], +strlen (grp->funcs[f])) ==0 ) +strlcpy (buf, grp->name, size); +else +strlcpy (buf, grp->funcs[f], size);return 0 ; } }
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]