All of lore.kernel.org
 help / color / mirror / Atom feed
From: antoine.tenart@free-electrons.com (Antoine Ténart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND 5/5] ARM: dts: berlin: add the pinctrl node and muxing setup for uarts
Date: Fri, 11 Apr 2014 11:09:36 +0200	[thread overview]
Message-ID: <20140411090936.GC20147@kwain> (raw)
In-Reply-To: <20140411081859.GL10240@lunn.ch>

Hi Andrew,

On Fri, Apr 11, 2014 at 10:18:59AM +0200, Andrew Lunn wrote:
> On Thu, Apr 10, 2014 at 03:07:54PM +0200, Antoine T?nart wrote:
> > The uart0 pinmux configuration is in the dtsi because uart0 will always
> > use uart0-pmux to work, no other possibility. Same thing for uart1.
> > 
> > Signed-off-by: Antoine T?nart <antoine.tenart@free-electrons.com>
> > ---
> >  arch/arm/boot/dts/berlin2.dtsi   | 20 ++++++++++++++++++++
> >  arch/arm/boot/dts/berlin2cd.dtsi | 13 +++++++++++++
> >  arch/arm/boot/dts/berlin2q.dtsi  | 20 ++++++++++++++++++++
> >  3 files changed, 53 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/berlin2.dtsi b/arch/arm/boot/dts/berlin2.dtsi
> > index 56a1af2f1052..43eb90c36050 100644
> > --- a/arch/arm/boot/dts/berlin2.dtsi
> > +++ b/arch/arm/boot/dts/berlin2.dtsi
> > @@ -176,6 +176,22 @@
> >  			};
> >  		};
> >  
> > +		pinctrl: pinctrl at 0 {
> > +			compatible = "marvell,berlin2-pinctrl";
> > +			reg = <0xea0000 0x08>, <0xfc0000 0x44>;
> > +			reg-names = "global_base", "apb_base";
> > +
> > +			uart0_pmux: uart0-pmux {
> > +				berlin,group = "GSM4";
> > +				berlin,function = <0>;
> > +			};
> > +
> > +			uart1_pmux: uart1-pmux {
> > +				berlin,group = "GSM5";
> > +				berlin,function = <1>;
> 
> Hi Antoine
> 
> This very much looks like black magic.
> 
> I assume the data sheet is not available? So i think you need to
> document all possible combinations of values of group and function.
> Maybe you can add a file in
> 
> arch/arm/boot/dts/include/dt-bindings/pinctrl/
> 
> with something like
> 
> #define GSM4_UART0	0
> #define GSM5_UART1	1
> #define GSM12_UART0	1
> #define GSM12_IrDA0	1
> #define GSM12_GPIO	2

Groups' functions are not the same between BG2/BG2CD and BG2Q so multiple
headers would be needed which may not be a good thing. Some platforms use black
magic, and we can find a pinmux configuration for OMAP looking like:

0x128 (PIN_INPUT_PULLUP | MUX_MODE0)

Weel, we could explicitly define the functions in the driver itself and use in
the dt something like:

berlin,group = "GSM4";
berlin,function = "uart0";

This is what's done on the sunxi's pinctrl.

Antoine

-- 
Antoine T?nart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: "Antoine Ténart" <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Cc: sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	zmxu-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
	jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH RESEND 5/5] ARM: dts: berlin: add the pinctrl node and muxing setup for uarts
Date: Fri, 11 Apr 2014 11:09:36 +0200	[thread overview]
Message-ID: <20140411090936.GC20147@kwain> (raw)
In-Reply-To: <20140411081859.GL10240-g2DYL2Zd6BY@public.gmane.org>

Hi Andrew,

On Fri, Apr 11, 2014 at 10:18:59AM +0200, Andrew Lunn wrote:
> On Thu, Apr 10, 2014 at 03:07:54PM +0200, Antoine Ténart wrote:
> > The uart0 pinmux configuration is in the dtsi because uart0 will always
> > use uart0-pmux to work, no other possibility. Same thing for uart1.
> > 
> > Signed-off-by: Antoine Ténart <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> > ---
> >  arch/arm/boot/dts/berlin2.dtsi   | 20 ++++++++++++++++++++
> >  arch/arm/boot/dts/berlin2cd.dtsi | 13 +++++++++++++
> >  arch/arm/boot/dts/berlin2q.dtsi  | 20 ++++++++++++++++++++
> >  3 files changed, 53 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/berlin2.dtsi b/arch/arm/boot/dts/berlin2.dtsi
> > index 56a1af2f1052..43eb90c36050 100644
> > --- a/arch/arm/boot/dts/berlin2.dtsi
> > +++ b/arch/arm/boot/dts/berlin2.dtsi
> > @@ -176,6 +176,22 @@
> >  			};
> >  		};
> >  
> > +		pinctrl: pinctrl@0 {
> > +			compatible = "marvell,berlin2-pinctrl";
> > +			reg = <0xea0000 0x08>, <0xfc0000 0x44>;
> > +			reg-names = "global_base", "apb_base";
> > +
> > +			uart0_pmux: uart0-pmux {
> > +				berlin,group = "GSM4";
> > +				berlin,function = <0>;
> > +			};
> > +
> > +			uart1_pmux: uart1-pmux {
> > +				berlin,group = "GSM5";
> > +				berlin,function = <1>;
> 
> Hi Antoine
> 
> This very much looks like black magic.
> 
> I assume the data sheet is not available? So i think you need to
> document all possible combinations of values of group and function.
> Maybe you can add a file in
> 
> arch/arm/boot/dts/include/dt-bindings/pinctrl/
> 
> with something like
> 
> #define GSM4_UART0	0
> #define GSM5_UART1	1
> #define GSM12_UART0	1
> #define GSM12_IrDA0	1
> #define GSM12_GPIO	2

Groups' functions are not the same between BG2/BG2CD and BG2Q so multiple
headers would be needed which may not be a good thing. Some platforms use black
magic, and we can find a pinmux configuration for OMAP looking like:

0x128 (PIN_INPUT_PULLUP | MUX_MODE0)

Weel, we could explicitly define the functions in the driver itself and use in
the dt something like:

berlin,group = "GSM4";
berlin,function = "uart0";

This is what's done on the sunxi's pinctrl.

Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: "Antoine Ténart" <antoine.tenart@free-electrons.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: sebastian.hesselbarth@gmail.com, linus.walleij@linaro.org,
	zmxu@marvell.com, jszhang@marvell.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	alexandre.belloni@free-electrons.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH RESEND 5/5] ARM: dts: berlin: add the pinctrl node and muxing setup for uarts
Date: Fri, 11 Apr 2014 11:09:36 +0200	[thread overview]
Message-ID: <20140411090936.GC20147@kwain> (raw)
In-Reply-To: <20140411081859.GL10240@lunn.ch>

Hi Andrew,

On Fri, Apr 11, 2014 at 10:18:59AM +0200, Andrew Lunn wrote:
> On Thu, Apr 10, 2014 at 03:07:54PM +0200, Antoine Ténart wrote:
> > The uart0 pinmux configuration is in the dtsi because uart0 will always
> > use uart0-pmux to work, no other possibility. Same thing for uart1.
> > 
> > Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com>
> > ---
> >  arch/arm/boot/dts/berlin2.dtsi   | 20 ++++++++++++++++++++
> >  arch/arm/boot/dts/berlin2cd.dtsi | 13 +++++++++++++
> >  arch/arm/boot/dts/berlin2q.dtsi  | 20 ++++++++++++++++++++
> >  3 files changed, 53 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/berlin2.dtsi b/arch/arm/boot/dts/berlin2.dtsi
> > index 56a1af2f1052..43eb90c36050 100644
> > --- a/arch/arm/boot/dts/berlin2.dtsi
> > +++ b/arch/arm/boot/dts/berlin2.dtsi
> > @@ -176,6 +176,22 @@
> >  			};
> >  		};
> >  
> > +		pinctrl: pinctrl@0 {
> > +			compatible = "marvell,berlin2-pinctrl";
> > +			reg = <0xea0000 0x08>, <0xfc0000 0x44>;
> > +			reg-names = "global_base", "apb_base";
> > +
> > +			uart0_pmux: uart0-pmux {
> > +				berlin,group = "GSM4";
> > +				berlin,function = <0>;
> > +			};
> > +
> > +			uart1_pmux: uart1-pmux {
> > +				berlin,group = "GSM5";
> > +				berlin,function = <1>;
> 
> Hi Antoine
> 
> This very much looks like black magic.
> 
> I assume the data sheet is not available? So i think you need to
> document all possible combinations of values of group and function.
> Maybe you can add a file in
> 
> arch/arm/boot/dts/include/dt-bindings/pinctrl/
> 
> with something like
> 
> #define GSM4_UART0	0
> #define GSM5_UART1	1
> #define GSM12_UART0	1
> #define GSM12_IrDA0	1
> #define GSM12_GPIO	2

Groups' functions are not the same between BG2/BG2CD and BG2Q so multiple
headers would be needed which may not be a good thing. Some platforms use black
magic, and we can find a pinmux configuration for OMAP looking like:

0x128 (PIN_INPUT_PULLUP | MUX_MODE0)

Weel, we could explicitly define the functions in the driver itself and use in
the dt something like:

berlin,group = "GSM4";
berlin,function = "uart0";

This is what's done on the sunxi's pinctrl.

Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-04-11  9:09 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 13:07 [PATCH RESEND 0/5] ARM: berlin: add pinctrl support Antoine Ténart
2014-04-10 13:07 ` Antoine Ténart
2014-04-10 13:07 ` Antoine Ténart
2014-04-10 13:07 ` [PATCH RESEND 1/5] pinctrl: allows not to define the get_group_pins operation Antoine Ténart
2014-04-10 13:07   ` Antoine Ténart
2014-04-11  9:21   ` Sebastian Hesselbarth
2014-04-11  9:21     ` Sebastian Hesselbarth
2014-04-11  9:21     ` Sebastian Hesselbarth
2014-04-22 12:48   ` Linus Walleij
2014-04-22 12:48     ` Linus Walleij
2014-04-22 12:48     ` Linus Walleij
2014-04-22 15:58     ` Antoine Ténart
2014-04-22 15:58       ` Antoine Ténart
2014-04-22 15:58       ` Antoine Ténart
2014-04-10 13:07 ` [PATCH RESEND 2/5] pinctrl: berlin: add a pinctrl driver for Marvell Berlin SoCs Antoine Ténart
2014-04-10 13:07   ` Antoine Ténart
2014-04-11  6:44   ` Jisheng Zhang
2014-04-11  6:44     ` Jisheng Zhang
2014-04-11  6:44     ` Jisheng Zhang
2014-04-11  8:18     ` Antoine Ténart
2014-04-11  8:18       ` Antoine Ténart
2014-04-11  8:18       ` Antoine Ténart
2014-04-11  8:27       ` Jisheng Zhang
2014-04-11  8:27         ` Jisheng Zhang
2014-04-11  8:27         ` Jisheng Zhang
2014-04-11  9:21         ` Antoine Ténart
2014-04-11  9:21           ` Antoine Ténart
2014-04-11  9:21           ` Antoine Ténart
2014-04-11  9:03   ` Sebastian Hesselbarth
2014-04-11  9:03     ` Sebastian Hesselbarth
2014-04-11  9:03     ` Sebastian Hesselbarth
2014-04-11 12:37     ` Antoine Ténart
2014-04-11 12:37       ` Antoine Ténart
2014-04-11 13:35       ` Sebastian Hesselbarth
2014-04-11 13:35         ` Sebastian Hesselbarth
2014-04-11 13:35         ` Sebastian Hesselbarth
2014-04-22 12:52         ` Linus Walleij
2014-04-22 12:52           ` Linus Walleij
2014-04-22 15:56           ` Antoine Ténart
2014-04-22 15:56             ` Antoine Ténart
2014-04-22 15:56             ` Antoine Ténart
2014-04-23 14:05             ` Linus Walleij
2014-04-23 14:05               ` Linus Walleij
2014-04-23 14:05               ` Linus Walleij
2014-04-10 13:07 ` [PATCH RESEND 3/5] ARM: berlin: add the pinctrl dependency for the " Antoine Ténart
2014-04-10 13:07   ` Antoine Ténart
2014-04-11  9:05   ` Sebastian Hesselbarth
2014-04-11  9:05     ` Sebastian Hesselbarth
2014-04-11  9:05     ` Sebastian Hesselbarth
2014-04-17 13:13     ` Antoine Ténart
2014-04-17 13:13       ` Antoine Ténart
2014-04-17 13:13       ` Antoine Ténart
2014-04-17 13:24       ` Sebastian Hesselbarth
2014-04-17 13:24         ` Sebastian Hesselbarth
2014-04-17 13:24         ` Sebastian Hesselbarth
2014-04-10 13:07 ` [PATCH RESEND 4/5] Documentation: add the Marvell Berlin pinctrl documentation Antoine Ténart
2014-04-10 13:07   ` Antoine Ténart
2014-04-11  6:33   ` Jisheng Zhang
2014-04-11  6:33     ` Jisheng Zhang
2014-04-11  6:33     ` Jisheng Zhang
2014-04-11  8:12     ` Antoine Ténart
2014-04-11  8:12       ` Antoine Ténart
2014-04-11  8:18       ` Jisheng Zhang
2014-04-11  8:18         ` Jisheng Zhang
2014-04-11  8:18         ` Jisheng Zhang
2014-04-11  8:22       ` Andrew Lunn
2014-04-11  8:22         ` Andrew Lunn
2014-04-11  8:22         ` Andrew Lunn
2014-04-11  9:13   ` Sebastian Hesselbarth
2014-04-11  9:13     ` Sebastian Hesselbarth
2014-04-11  9:13     ` Sebastian Hesselbarth
2014-04-10 13:07 ` [PATCH RESEND 5/5] ARM: dts: berlin: add the pinctrl node and muxing setup for uarts Antoine Ténart
2014-04-10 13:07   ` Antoine Ténart
2014-04-10 13:07   ` Antoine Ténart
2014-04-11  8:18   ` Andrew Lunn
2014-04-11  8:18     ` Andrew Lunn
2014-04-11  9:09     ` Antoine Ténart [this message]
2014-04-11  9:09       ` Antoine Ténart
2014-04-11  9:09       ` Antoine Ténart
2014-04-11  9:19       ` Sebastian Hesselbarth
2014-04-11  9:19         ` Sebastian Hesselbarth
2014-04-11  9:19         ` Sebastian Hesselbarth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140411090936.GC20147@kwain \
    --to=antoine.tenart@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.