devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IMX27: How to do 22k pull-up with the pinctrl ?
@ 2013-11-11 10:45 Chris Ruehl
       [not found] ` <5280B54A.1050503-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Ruehl @ 2013-11-11 10:45 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Hi,

while I port the static code to the DT I step into the problem to
set the PSCR for the sdhc2 ports to 22k pull-up
I look for something like described in
     pinctrl/fsl,imx-pinctrl.txt

the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.


pinctrl_sdhc2_1: sdhc2-1 {
                         fsl,pins = <
                                 MX27_PAD_SD2_D0__SD2_D0  0x1
                                 MX27_PAD_SD2_D1__SD2_D1  0x1
                                 MX27_PAD_SD2_D2__SD2_D2  0x1
                                 MX27_PAD_SD2_D3__SD2_D3  0x1
                                 MX27_PAD_SD2_CLK__SD2_CLK  0x1
                                 MX27_PAD_SD2_CMD__SD2_CMD  0x1
                         >;
                 };

its setup in board specific c-file

/* 22k pull-up for sd2 pins  */
         reg = __raw_readw(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
         reg &= ~0xfff0;
         reg |= 0xfff0;
         __raw_writew(reg, MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));


Any successions?

Regards
Chris
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found] ` <5280B54A.1050503-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
@ 2013-11-11 12:03   ` Mark Rutland
       [not found]     ` <20131111120357.GE21201-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Rutland @ 2013-11-11 12:03 UTC (permalink / raw)
  To: Chris Ruehl
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dong Aisheng,
	Shawn Guo, Linus Walleij

On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:
> Hi,

Hi,

While this does involve device tree, it's not strictly a device tree
problem, and the people best placed to answer your question don't seem
to be on Cc. You'd get better responses if you used get_maintainer.pl,
or looked at the commit history of the driver or binding to find people
likely to be able to help.

I've added Dong Aisheng, Shawn Guo, and Linus Walleij to Cc, as they had
signed-off-bys on the binding document.

Mark.

> 
> while I port the static code to the DT I step into the problem to
> set the PSCR for the sdhc2 ports to 22k pull-up
> I look for something like described in
>      pinctrl/fsl,imx-pinctrl.txt
> 
> the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.
> 
> 
> pinctrl_sdhc2_1: sdhc2-1 {
>                          fsl,pins = <
>                                  MX27_PAD_SD2_D0__SD2_D0  0x1
>                                  MX27_PAD_SD2_D1__SD2_D1  0x1
>                                  MX27_PAD_SD2_D2__SD2_D2  0x1
>                                  MX27_PAD_SD2_D3__SD2_D3  0x1
>                                  MX27_PAD_SD2_CLK__SD2_CLK  0x1
>                                  MX27_PAD_SD2_CMD__SD2_CMD  0x1
>                          >;
>                  };
> 
> its setup in board specific c-file
> 
> /* 22k pull-up for sd2 pins  */
>          reg = __raw_readw(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
>          reg &= ~0xfff0;
>          reg |= 0xfff0;
>          __raw_writew(reg, MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
> 
> 
> Any successions?
> 
> Regards
> Chris
> --
> 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
> 
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found]     ` <20131111120357.GE21201-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
@ 2013-11-11 14:26       ` Shawn Guo
       [not found]         ` <20131111142639.GC11083-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
  2013-11-11 14:29       ` Linus Walleij
  2013-11-13  4:38       ` Chris Ruehl
  2 siblings, 1 reply; 9+ messages in thread
From: Shawn Guo @ 2013-11-11 14:26 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Chris Ruehl, Markus Pargmann,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Walleij,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Copy Markus who is working on imx27 pinctrl driver.

On Mon, Nov 11, 2013 at 12:03:57PM +0000, Mark Rutland wrote:
> On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:
> > Hi,
> 
> Hi,
> 
> While this does involve device tree, it's not strictly a device tree
> problem, and the people best placed to answer your question don't seem
> to be on Cc. You'd get better responses if you used get_maintainer.pl,
> or looked at the commit history of the driver or binding to find people
> likely to be able to help.
> 
> I've added Dong Aisheng, Shawn Guo, and Linus Walleij to Cc, as they had
> signed-off-bys on the binding document.

Thanks, Mark.

<snip>

> > while I port the static code to the DT I step into the problem to
> > set the PSCR for the sdhc2 ports to 22k pull-up

Is the code from mainline kernel or private tree?  I'm asking because I
do not see non-DT imx27 iomux-v1 driver has interface for setting up
DSCR or PSCR in SYSCTRL block.  That's probably why Markus did not
support that in the imx27 pinctrl driver, I guess.

Shawn

> > I look for something like described in
> >      pinctrl/fsl,imx-pinctrl.txt
> > 
> > the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.
> > 
> > 
> > pinctrl_sdhc2_1: sdhc2-1 {
> >                          fsl,pins = <
> >                                  MX27_PAD_SD2_D0__SD2_D0  0x1
> >                                  MX27_PAD_SD2_D1__SD2_D1  0x1
> >                                  MX27_PAD_SD2_D2__SD2_D2  0x1
> >                                  MX27_PAD_SD2_D3__SD2_D3  0x1
> >                                  MX27_PAD_SD2_CLK__SD2_CLK  0x1
> >                                  MX27_PAD_SD2_CMD__SD2_CMD  0x1
> >                          >;
> >                  };
> > 
> > its setup in board specific c-file
> > 
> > /* 22k pull-up for sd2 pins  */
> >          reg = __raw_readw(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
> >          reg &= ~0xfff0;
> >          reg |= 0xfff0;
> >          __raw_writew(reg, MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
> > 
> > 
> > Any successions?
> > 
> > Regards
> > Chris
> > --
> > 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
> > 

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found]     ` <20131111120357.GE21201-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
  2013-11-11 14:26       ` Shawn Guo
@ 2013-11-11 14:29       ` Linus Walleij
       [not found]         ` <CACRpkdatZfGDn-K-PRxCz53AKF+Q4CAwAbA+ufSKnXapZQkPyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2013-11-13  4:38       ` Chris Ruehl
  2 siblings, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2013-11-11 14:29 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Chris Ruehl, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dong Aisheng, Shawn Guo

On Mon, Nov 11, 2013 at 1:03 PM, Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org> wrote:
> On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:

>> while I port the static code to the DT I step into the problem to
>> set the PSCR for the sdhc2 ports to 22k pull-up
>> I look for something like described in
>>      pinctrl/fsl,imx-pinctrl.txt
>>
>> the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.

So in the generic pin configuration, which we nowadays recommend new
platforms to use, there is this (include/linux/pinctrl/pinconf-generic):

 * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
 *      impedance to VDD). If the argument is != 0 pull-up is enabled,
 *      if it is 0, pull-up is total, i.e. the pin is connected to VDD.
 * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
 *      impedance to GROUND). If the argument is != 0 pull-down is enabled,
 *      if it is 0, pull-down is total, i.e. the pin is connected to GROUND.

The idea was to extend that with an argument for the number of
Ohms the day it was needed and supported by some platform.

We would then use the bindings from
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
by adding something like this:

(...)
bias-pull-up-ohms = <22000>;
(...)

So in the generic world it can be accomodated in a quite
straight-forward way.

When the i.MX pin control was added in v3.5 the generic
pin config was available but it was opted to use another
pattern. One way to solve this is to migrate i.MX to use the
generic pin config, which is going to be hard work. But as
a subsystem maintainer that is still what I would recommend.

Yours,
Linus Walleij
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found]         ` <20131111142639.GC11083-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
@ 2013-11-11 16:21           ` Markus Pargmann
       [not found]             ` <20131111162138.GB30263-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  2013-11-13  4:43           ` Chris Ruehl
  1 sibling, 1 reply; 9+ messages in thread
From: Markus Pargmann @ 2013-11-11 16:21 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Mark Rutland, Chris Ruehl,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Walleij,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Mon, Nov 11, 2013 at 10:26:41PM +0800, Shawn Guo wrote:
> Copy Markus who is working on imx27 pinctrl driver.
> 
> On Mon, Nov 11, 2013 at 12:03:57PM +0000, Mark Rutland wrote:
> > On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:
> > > Hi,
> > 
> > Hi,
> > 
> > While this does involve device tree, it's not strictly a device tree
> > problem, and the people best placed to answer your question don't seem
> > to be on Cc. You'd get better responses if you used get_maintainer.pl,
> > or looked at the commit history of the driver or binding to find people
> > likely to be able to help.
> > 
> > I've added Dong Aisheng, Shawn Guo, and Linus Walleij to Cc, as they had
> > signed-off-bys on the binding document.
> 
> Thanks, Mark.
> 
> <snip>
> 
> > > while I port the static code to the DT I step into the problem to
> > > set the PSCR for the sdhc2 ports to 22k pull-up
> 
> Is the code from mainline kernel or private tree?  I'm asking because I
> do not see non-DT imx27 iomux-v1 driver has interface for setting up
> DSCR or PSCR in SYSCTRL block.  That's probably why Markus did not
> support that in the imx27 pinctrl driver, I guess.

DSCR controls groups of pins, for example DS_SLOW10 (DSCR1) controls all
pins of SDHC1 and CSPI3. I don't think a config option for a pin should
influence the behaviour of other pins.
PSCR could be managed by the imx27 pinctrl driver but it is not included
in the GPIO/pinmux module. It is included in "System control module"
which does not exist on imx21 for example.

Regards,

Markus Pargmann

> 
> Shawn
> 
> > > I look for something like described in
> > >      pinctrl/fsl,imx-pinctrl.txt
> > > 
> > > the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.
> > > 
> > > 
> > > pinctrl_sdhc2_1: sdhc2-1 {
> > >                          fsl,pins = <
> > >                                  MX27_PAD_SD2_D0__SD2_D0  0x1
> > >                                  MX27_PAD_SD2_D1__SD2_D1  0x1
> > >                                  MX27_PAD_SD2_D2__SD2_D2  0x1
> > >                                  MX27_PAD_SD2_D3__SD2_D3  0x1
> > >                                  MX27_PAD_SD2_CLK__SD2_CLK  0x1
> > >                                  MX27_PAD_SD2_CMD__SD2_CMD  0x1
> > >                          >;
> > >                  };
> > > 
> > > its setup in board specific c-file
> > > 
> > > /* 22k pull-up for sd2 pins  */
> > >          reg = __raw_readw(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
> > >          reg &= ~0xfff0;
> > >          reg |= 0xfff0;
> > >          __raw_writew(reg, MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
> > > 
> > > 
> > > Any successions?
> > > 
> > > Regards
> > > Chris
> > > --
> > > 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
> > > 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found]     ` <20131111120357.GE21201-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
  2013-11-11 14:26       ` Shawn Guo
  2013-11-11 14:29       ` Linus Walleij
@ 2013-11-13  4:38       ` Chris Ruehl
  2 siblings, 0 replies; 9+ messages in thread
From: Chris Ruehl @ 2013-11-13  4:38 UTC (permalink / raw)
  To: Mark Rutland
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dong Aisheng,
	Shawn Guo, Linus Walleij



On Monday, November 11, 2013 08:03 PM, Mark Rutland wrote:
> On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:
>> Hi,
>
> Hi,
>
> While this does involve device tree, it's not strictly a device tree
> problem, and the people best placed to answer your question don't seem
> to be on Cc. You'd get better responses if you used get_maintainer.pl,
> or looked at the commit history of the driver or binding to find people
> likely to be able to help.
>
> I've added Dong Aisheng, Shawn Guo, and Linus Walleij to Cc, as they had
> signed-off-bys on the binding document.
>
> Mark.

Dear Mark
Thanks.
I'm late with my answer, my data-center support change switches and forget to 
told the users about this.. I had no email for a while. Welcome to Hong Kong!


>
>>
>> while I port the static code to the DT I step into the problem to
>> set the PSCR for the sdhc2 ports to 22k pull-up
>> I look for something like described in
>>       pinctrl/fsl,imx-pinctrl.txt
>>
>> the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.
>>
>>
>> pinctrl_sdhc2_1: sdhc2-1 {
>>                           fsl,pins =<
>>                                   MX27_PAD_SD2_D0__SD2_D0  0x1
>>                                   MX27_PAD_SD2_D1__SD2_D1  0x1
>>                                   MX27_PAD_SD2_D2__SD2_D2  0x1
>>                                   MX27_PAD_SD2_D3__SD2_D3  0x1
>>                                   MX27_PAD_SD2_CLK__SD2_CLK  0x1
>>                                   MX27_PAD_SD2_CMD__SD2_CMD  0x1
>>                           >;
>>                   };
>>
>> its setup in board specific c-file
>>
>> /* 22k pull-up for sd2 pins  */
>>           reg = __raw_readw(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
>>           reg&= ~0xfff0;
>>           reg |= 0xfff0;
>>           __raw_writew(reg, MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
>>
>>
>> Any successions?
>>
>> Regards
>> Chris
>> --
>> 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
>>

-- 
GTSYS Limited RFID Technology
A01 24/F Gold King Industrial Bld
35-41 Tai Lin Pai Road, Kwai Chung, Hong Kong
Fax (852) 8167 4060 - Tel (852) 3598 9488

Disclaimer: http://www.gtsys.com.hk/email/classified.html
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found]         ` <20131111142639.GC11083-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
  2013-11-11 16:21           ` Markus Pargmann
@ 2013-11-13  4:43           ` Chris Ruehl
  1 sibling, 0 replies; 9+ messages in thread
From: Chris Ruehl @ 2013-11-13  4:43 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Mark Rutland, Markus Pargmann,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Walleij,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ



On Monday, November 11, 2013 10:26 PM, Shawn Guo wrote:
> Copy Markus who is working on imx27 pinctrl driver.
>
> On Mon, Nov 11, 2013 at 12:03:57PM +0000, Mark Rutland wrote:
>> On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:
>>> Hi,
>>
>> Hi,
>>
>> While this does involve device tree, it's not strictly a device tree
>> problem, and the people best placed to answer your question don't seem
>> to be on Cc. You'd get better responses if you used get_maintainer.pl,
>> or looked at the commit history of the driver or binding to find people
>> likely to be able to help.
>>
>> I've added Dong Aisheng, Shawn Guo, and Linus Walleij to Cc, as they had
>> signed-off-bys on the binding document.
>
> Thanks, Mark.
>
> <snip>
>
>>> while I port the static code to the DT I step into the problem to
>>> set the PSCR for the sdhc2 ports to 22k pull-up
>
> Is the code from mainline kernel or private tree?  I'm asking because I
> do not see non-DT imx27 iomux-v1 driver has interface for setting up
> DSCR or PSCR in SYSCTRL block.  That's probably why Markus did not
> support that in the imx27 pinctrl driver, I guess.
>
> Shawn

Hi Shawn,

I work on a private tree using the 3.12-next source as my base. Mainboard is a 
new design using for RFID integrated readers. I include almost all available
features from the imx27.
OTG, USB2, SPI, I2C, MMC, DM9000 ..

To set the pull-strength would be a great thing.

Chris

>
>>> I look for something like described in
>>>       pinctrl/fsl,imx-pinctrl.txt
>>>
>>> the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.
>>>
>>>
>>> pinctrl_sdhc2_1: sdhc2-1 {
>>>                           fsl,pins =<
>>>                                   MX27_PAD_SD2_D0__SD2_D0  0x1
>>>                                   MX27_PAD_SD2_D1__SD2_D1  0x1
>>>                                   MX27_PAD_SD2_D2__SD2_D2  0x1
>>>                                   MX27_PAD_SD2_D3__SD2_D3  0x1
>>>                                   MX27_PAD_SD2_CLK__SD2_CLK  0x1
>>>                                   MX27_PAD_SD2_CMD__SD2_CMD  0x1
>>>                           >;
>>>                   };
>>>
>>> its setup in board specific c-file
>>>
>>> /* 22k pull-up for sd2 pins  */
>>>           reg = __raw_readw(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
>>>           reg&= ~0xfff0;
>>>           reg |= 0xfff0;
>>>           __raw_writew(reg, MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
>>>
>>>
>>> Any successions?
>>>
>>> Regards
>>> Chris
>>> --
>>> 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
>>>
>

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found]         ` <CACRpkdatZfGDn-K-PRxCz53AKF+Q4CAwAbA+ufSKnXapZQkPyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-11-13  5:50           ` Chris Ruehl
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Ruehl @ 2013-11-13  5:50 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dong Aisheng, Shawn Guo



On Monday, November 11, 2013 10:29 PM, Linus Walleij wrote:
> On Mon, Nov 11, 2013 at 1:03 PM, Mark Rutland<mark.rutland-5wv7dgnIgG8@public.gmane.org>  wrote:
>> On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:
>
>>> while I port the static code to the DT I step into the problem to
>>> set the PSCR for the sdhc2 ports to 22k pull-up
>>> I look for something like described in
>>>       pinctrl/fsl,imx-pinctrl.txt
>>>
>>> the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.
>
> So in the generic pin configuration, which we nowadays recommend new
> platforms to use, there is this (include/linux/pinctrl/pinconf-generic):
>
>   * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
>   *      impedance to VDD). If the argument is != 0 pull-up is enabled,
>   *      if it is 0, pull-up is total, i.e. the pin is connected to VDD.
>   * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
>   *      impedance to GROUND). If the argument is != 0 pull-down is enabled,
>   *      if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
>
> The idea was to extend that with an argument for the number of
> Ohms the day it was needed and supported by some platform.
>
> We would then use the bindings from
> Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
> by adding something like this:
>
> (...)
> bias-pull-up-ohms =<22000>;
> (...)
>
> So in the generic world it can be accomodated in a quite
> straight-forward way.
>
> When the i.MX pin control was added in v3.5 the generic
> pin config was available but it was opted to use another
> pattern. One way to solve this is to migrate i.MX to use the
> generic pin config, which is going to be hard work. But as
> a subsystem maintainer that is still what I would recommend.
>
> Yours,
> Linus Walleij

Hi Linus,
Thank you for that very interesting comment!

I agree with your idea to move the IMX code to that more generic solution, there 
are already different ways to setup the DT for imx27 vs. imx3x or imx6 etc. and 
its not going to be better, my guess!

Chris

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: IMX27: How to do 22k pull-up with the pinctrl ?
       [not found]             ` <20131111162138.GB30263-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2013-11-13  5:57               ` Chris Ruehl
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Ruehl @ 2013-11-13  5:57 UTC (permalink / raw)
  To: Markus Pargmann
  Cc: Shawn Guo, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Walleij,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ



On Tuesday, November 12, 2013 12:21 AM, Markus Pargmann wrote:
> On Mon, Nov 11, 2013 at 10:26:41PM +0800, Shawn Guo wrote:
>> Copy Markus who is working on imx27 pinctrl driver.
>>
>> On Mon, Nov 11, 2013 at 12:03:57PM +0000, Mark Rutland wrote:
>>> On Mon, Nov 11, 2013 at 10:45:30AM +0000, Chris Ruehl wrote:
>>>> Hi,
>>>
>>> Hi,
>>>
>>> While this does involve device tree, it's not strictly a device tree
>>> problem, and the people best placed to answer your question don't seem
>>> to be on Cc. You'd get better responses if you used get_maintainer.pl,
>>> or looked at the commit history of the driver or binding to find people
>>> likely to be able to help.
>>>
>>> I've added Dong Aisheng, Shawn Guo, and Linus Walleij to Cc, as they had
>>> signed-off-bys on the binding document.
>>
>> Thanks, Mark.
>>
>> <snip>
>>
>>>> while I port the static code to the DT I step into the problem to
>>>> set the PSCR for the sdhc2 ports to 22k pull-up
>>
>> Is the code from mainline kernel or private tree?  I'm asking because I
>> do not see non-DT imx27 iomux-v1 driver has interface for setting up
>> DSCR or PSCR in SYSCTRL block.  That's probably why Markus did not
>> support that in the imx27 pinctrl driver, I guess.
>
> DSCR controls groups of pins, for example DS_SLOW10 (DSCR1) controls all
> pins of SDHC1 and CSPI3. I don't think a config option for a pin should
> influence the behaviour of other pins.
> PSCR could be managed by the imx27 pinctrl driver but it is not included
> in the GPIO/pinmux module. It is included in "System control module"
> which does not exist on imx21 for example.
>
> Regards,
>
> Markus Pargmann

Hi Markus,

do you think its difficult to add the mentioned PSCR manipulations to a
new to add System control module?

Regards
Chris

>
>>
>> Shawn
>>
>>>> I look for something like described in
>>>>       pinctrl/fsl,imx-pinctrl.txt
>>>>
>>>> the fsl,imx27-pinctrl only say 0/1 dis/enable pull up but not the strength.
>>>>
>>>>
>>>> pinctrl_sdhc2_1: sdhc2-1 {
>>>>                           fsl,pins =<
>>>>                                   MX27_PAD_SD2_D0__SD2_D0  0x1
>>>>                                   MX27_PAD_SD2_D1__SD2_D1  0x1
>>>>                                   MX27_PAD_SD2_D2__SD2_D2  0x1
>>>>                                   MX27_PAD_SD2_D3__SD2_D3  0x1
>>>>                                   MX27_PAD_SD2_CLK__SD2_CLK  0x1
>>>>                                   MX27_PAD_SD2_CMD__SD2_CMD  0x1
>>>>                           >;
>>>>                   };
>>>>
>>>> its setup in board specific c-file
>>>>
>>>> /* 22k pull-up for sd2 pins  */
>>>>           reg = __raw_readw(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
>>>>           reg&= ~0xfff0;
>>>>           reg |= 0xfff0;
>>>>           __raw_writew(reg, MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + MX27_SYS_PSCR));
>>>>
>>>>
>>>> Any successions?
>>>>
>>>> Regards
>>>> Chris

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-11-13  5:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11 10:45 IMX27: How to do 22k pull-up with the pinctrl ? Chris Ruehl
     [not found] ` <5280B54A.1050503-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
2013-11-11 12:03   ` Mark Rutland
     [not found]     ` <20131111120357.GE21201-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-11-11 14:26       ` Shawn Guo
     [not found]         ` <20131111142639.GC11083-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-11-11 16:21           ` Markus Pargmann
     [not found]             ` <20131111162138.GB30263-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-11-13  5:57               ` Chris Ruehl
2013-11-13  4:43           ` Chris Ruehl
2013-11-11 14:29       ` Linus Walleij
     [not found]         ` <CACRpkdatZfGDn-K-PRxCz53AKF+Q4CAwAbA+ufSKnXapZQkPyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-13  5:50           ` Chris Ruehl
2013-11-13  4:38       ` Chris Ruehl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).