Message ID | 20181028212457.1017-3-wsa+renesas@sang-engineering.com |
---|---|
State | New |
Headers | show |
Series | pinctrl: sh-pfc: gen2: initialize TDSEL register | expand |
On Sun, Oct 28, 2018 at 09:24:57PM +0000, Wolfram Sang wrote: > Documentation says that some bits in TDSEL must be set (ch 5.3.35 in > R-Car E2 v0.5). However, the reset value of the register is 0, so > software has to do it. Add this to the kernel driver to ensure this is > really done independent of firmware versions. This is needed for some SD > cards supporting SDR104 transfer mode. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
On 10/28/2018 10:24 PM, Wolfram Sang wrote: > Documentation says that some bits in TDSEL must be set (ch 5.3.35 in > R-Car E2 v0.5). However, the reset value of the register is 0, so > software has to do it. Add this to the kernel driver to ensure this is > really done independent of firmware versions. This is needed for some SD > cards supporting SDR104 transfer mode. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> > --- > drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7794.c b/drivers/pinctrl/sh-pfc/pfc-r8a7794.c > index 6d1e5fdc03f8..8a16053d2bec 100644 > --- a/drivers/pinctrl/sh-pfc/pfc-r8a7794.c > +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7794.c > @@ -5560,7 +5560,16 @@ static int r8a7794_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *poc > return -EINVAL; > } > > +static int r8a7794_pinmux_soc_init(struct sh_pfc *pfc) > +{ > + /* Initialize TDSEL according to datasheet */ > + sh_pfc_write(pfc, 0xe6060068, 0x55555500); > + > + return 0; > +} > + > static const struct sh_pfc_soc_operations r8a7794_pinmux_ops = { > + .init = r8a7794_pinmux_soc_init, > .pin_to_pocctrl = r8a7794_pin_to_pocctrl, > }; > >
On Sun, Oct 28, 2018 at 10:25 PM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > Documentation says that some bits in TDSEL must be set (ch 5.3.35 in > R-Car E2 v0.5). However, the reset value of the register is 0, so > software has to do it. Add this to the kernel driver to ensure this is > really done independent of firmware versions. This is needed for some SD > cards supporting SDR104 transfer mode. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7794.c b/drivers/pinctrl/sh-pfc/pfc-r8a7794.c index 6d1e5fdc03f8..8a16053d2bec 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7794.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7794.c @@ -5560,7 +5560,16 @@ static int r8a7794_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *poc return -EINVAL; } +static int r8a7794_pinmux_soc_init(struct sh_pfc *pfc) +{ + /* Initialize TDSEL according to datasheet */ + sh_pfc_write(pfc, 0xe6060068, 0x55555500); + + return 0; +} + static const struct sh_pfc_soc_operations r8a7794_pinmux_ops = { + .init = r8a7794_pinmux_soc_init, .pin_to_pocctrl = r8a7794_pin_to_pocctrl, };
Documentation says that some bits in TDSEL must be set (ch 5.3.35 in R-Car E2 v0.5). However, the reset value of the register is 0, so software has to do it. Add this to the kernel driver to ensure this is really done independent of firmware versions. This is needed for some SD cards supporting SDR104 transfer mode. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 9 +++++++++ 1 file changed, 9 insertions(+)