* [PATCH v2] serial: sh-sci: byte allocated register support
@ 2018-07-21 14:34 Yoshinori Sato
2018-07-22 13:02 ` Yoshinori Sato
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Yoshinori Sato @ 2018-07-21 14:34 UTC (permalink / raw)
To: linux-sh
H8/300 SCI registers allocated byte address.
It must support to the case where shift count is 0.
Changes v2.
more simply code.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
drivers/tty/serial/sh-sci.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index c181eb37f985..3c7326e11d37 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2863,10 +2863,12 @@ static int sci_init_single(struct platform_device *dev,
port->fifosize = sci_port->params->fifosize;
if (port->type = PORT_SCI) {
- if (sci_port->reg_size >= 0x20)
- port->regshift = 2;
- else
- port->regshift = 1;
+ /*
+ * reg_size < 0x10: BYTE aligned (scale factor=1).
+ * reg_size >= 0x10 and < 0x20: WORD aligned (scale factor=2).
+ * reg_size >= 0x20: DWORD aligned (scale factor=4).
+ */
+ port->regshift = sci_port->reg_size >> 4;
}
/*
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] serial: sh-sci: byte allocated register support
2018-07-21 14:34 [PATCH v2] serial: sh-sci: byte allocated register support Yoshinori Sato
@ 2018-07-22 13:02 ` Yoshinori Sato
2018-07-23 8:17 ` Geert Uytterhoeven
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Yoshinori Sato @ 2018-07-22 13:02 UTC (permalink / raw)
To: linux-sh
H8/300 SCI registers allocated byte address.
It must support to the case where shift count is 0.
Changes v2.
more simply code.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
drivers/tty/serial/sh-sci.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index c181eb37f985..3c7326e11d37 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2863,10 +2863,12 @@ static int sci_init_single(struct platform_device *dev,
port->fifosize = sci_port->params->fifosize;
if (port->type = PORT_SCI) {
- if (sci_port->reg_size >= 0x20)
- port->regshift = 2;
- else
- port->regshift = 1;
+ /*
+ * reg_size < 0x10: BYTE aligned (scale factor=1).
+ * reg_size >= 0x10 and < 0x20: WORD aligned (scale factor=2).
+ * reg_size >= 0x20: DWORD aligned (scale factor=4).
+ */
+ port->regshift = sci_port->reg_size >> 4;
}
/*
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] serial: sh-sci: byte allocated register support
2018-07-21 14:34 [PATCH v2] serial: sh-sci: byte allocated register support Yoshinori Sato
2018-07-22 13:02 ` Yoshinori Sato
@ 2018-07-23 8:17 ` Geert Uytterhoeven
2018-08-08 17:52 ` Geert Uytterhoeven
2018-08-09 14:41 ` Yoshinori Sato
3 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-07-23 8:17 UTC (permalink / raw)
To: linux-sh
CC gregkh, linux-serial
On Sun, Jul 22, 2018 at 3:02 PM Yoshinori Sato
<ysato@users.sourceforge.jp> wrote:
>
> H8/300 SCI registers allocated byte address.
> It must support to the case where shift count is 0.
>
> Changes v2.
> more simply code.
>
> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -2863,10 +2863,12 @@ static int sci_init_single(struct platform_device *dev,
> port->fifosize = sci_port->params->fifosize;
>
> if (port->type = PORT_SCI) {
> - if (sci_port->reg_size >= 0x20)
> - port->regshift = 2;
> - else
> - port->regshift = 1;
> + /*
> + * reg_size < 0x10: BYTE aligned (scale factor=1).
> + * reg_size >= 0x10 and < 0x20: WORD aligned (scale factor=2).
> + * reg_size >= 0x20: DWORD aligned (scale factor=4).
> + */
> + port->regshift = sci_port->reg_size >> 4;
> }
>
> /*
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] serial: sh-sci: byte allocated register support
2018-07-21 14:34 [PATCH v2] serial: sh-sci: byte allocated register support Yoshinori Sato
2018-07-22 13:02 ` Yoshinori Sato
2018-07-23 8:17 ` Geert Uytterhoeven
@ 2018-08-08 17:52 ` Geert Uytterhoeven
2018-08-09 14:41 ` Yoshinori Sato
3 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-08-08 17:52 UTC (permalink / raw)
To: linux-sh
Hi Sato-san,
On Mon, Jul 23, 2018 at 10:17 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> CC gregkh, linux-serial
>
> On Sun, Jul 22, 2018 at 3:02 PM Yoshinori Sato
> <ysato@users.sourceforge.jp> wrote:
> >
> > H8/300 SCI registers allocated byte address.
> > It must support to the case where shift count is 0.
> >
> > Changes v2.
> > more simply code.
> >
> > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> > --- a/drivers/tty/serial/sh-sci.c
> > +++ b/drivers/tty/serial/sh-sci.c
> > @@ -2863,10 +2863,12 @@ static int sci_init_single(struct platform_device *dev,
> > port->fifosize = sci_port->params->fifosize;
> >
> > if (port->type = PORT_SCI) {
> > - if (sci_port->reg_size >= 0x20)
> > - port->regshift = 2;
> > - else
> > - port->regshift = 1;
> > + /*
> > + * reg_size < 0x10: BYTE aligned (scale factor=1).
> > + * reg_size >= 0x10 and < 0x20: WORD aligned (scale factor=2).
> > + * reg_size >= 0x20: DWORD aligned (scale factor=4).
> > + */
> > + port->regshift = sci_port->reg_size >> 4;
> > }
> >
> > /*
Considering the regshift issues introduced by RZ/A2 SCIF support, I think it's
better to not rely on the reg_size value, and change the check to
if (!dev->dev.of_node && port->type = PORT_SCI)
If/when SuperH receives DT support, SCI ports with regshift 1 or 2 instantiated
from DT can be supported using "reg-shift = <1>" or "reg-shift = <2>" in DT.
Reference: https://www.spinics.net/lists/linux-serial/msg31573.html
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] serial: sh-sci: byte allocated register support
2018-07-21 14:34 [PATCH v2] serial: sh-sci: byte allocated register support Yoshinori Sato
` (2 preceding siblings ...)
2018-08-08 17:52 ` Geert Uytterhoeven
@ 2018-08-09 14:41 ` Yoshinori Sato
3 siblings, 0 replies; 5+ messages in thread
From: Yoshinori Sato @ 2018-08-09 14:41 UTC (permalink / raw)
To: linux-sh
On Thu, 09 Aug 2018 02:52:10 +0900,
Geert Uytterhoeven wrote:
>
> Hi Sato-san,
>
> On Mon, Jul 23, 2018 at 10:17 AM Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > CC gregkh, linux-serial
> >
> > On Sun, Jul 22, 2018 at 3:02 PM Yoshinori Sato
> > <ysato@users.sourceforge.jp> wrote:
> > >
> > > H8/300 SCI registers allocated byte address.
> > > It must support to the case where shift count is 0.
> > >
> > > Changes v2.
> > > more simply code.
> > >
> > > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > > --- a/drivers/tty/serial/sh-sci.c
> > > +++ b/drivers/tty/serial/sh-sci.c
> > > @@ -2863,10 +2863,12 @@ static int sci_init_single(struct platform_device *dev,
> > > port->fifosize = sci_port->params->fifosize;
> > >
> > > if (port->type = PORT_SCI) {
> > > - if (sci_port->reg_size >= 0x20)
> > > - port->regshift = 2;
> > > - else
> > > - port->regshift = 1;
> > > + /*
> > > + * reg_size < 0x10: BYTE aligned (scale factor=1).
> > > + * reg_size >= 0x10 and < 0x20: WORD aligned (scale factor=2).
> > > + * reg_size >= 0x20: DWORD aligned (scale factor=4).
> > > + */
> > > + port->regshift = sci_port->reg_size >> 4;
> > > }
> > >
> > > /*
>
> Considering the regshift issues introduced by RZ/A2 SCIF support, I think it's
> better to not rely on the reg_size value, and change the check to
>
> if (!dev->dev.of_node && port->type = PORT_SCI)
>
> If/when SuperH receives DT support, SCI ports with regshift 1 or 2 instantiated
> from DT can be supported using "reg-shift = <1>" or "reg-shift = <2>" in DT.
>
> Reference: https://www.spinics.net/lists/linux-serial/msg31573.html
>
> Gr{oetje,eeting}s,
>
> Geert
>
OK.
Thanks.
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
--
Yosinori Sato
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-08-09 14:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-21 14:34 [PATCH v2] serial: sh-sci: byte allocated register support Yoshinori Sato
2018-07-22 13:02 ` Yoshinori Sato
2018-07-23 8:17 ` Geert Uytterhoeven
2018-08-08 17:52 ` Geert Uytterhoeven
2018-08-09 14:41 ` Yoshinori Sato
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).