serial: sh-sci: byte allocated register support
Subsystems (2)
Yoshinori Sato
maintainerPATCH v2 1/1 serial: sh-sci: byte allocated register support
H8/300 SCI registers allocated byte address. It must support to the case where shift count is 0.
Changes v2.
more simply code.
--- drivers/tty/serial/sh-sci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/tty/serial/sh-sci.c +6 -4
@@ -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 ; }/*
Signature · 1 line
2.11.0
Yoshinori Sato
maintainerPATCH v2 1/1 serial: sh-sci: byte allocated register support
H8/300 SCI registers allocated byte address. It must support to the case where shift count is 0.
Changes v2.
more simply code.
--- drivers/tty/serial/sh-sci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/tty/serial/sh-sci.c +6 -4
@@ -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 ; }/*
Signature · 1 line
2.11.0
CC gregkh, linux-serial
Quoted 8 lines · Yoshinori Sato
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 <[email protected]>
Quoted 9 lines
drivers/tty/serial/sh-sci.c +0
-3@@ -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
drivers/tty/serial/sh-sci.c static int sci_init_single(struct platform_device *dev, · line 2874
Quoted 10 lines
drivers/tty/serial/sh-sci.c +6
-1- 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
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] 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
Hi Sato-san,
Quoted 33 lines · Geert Uytterhoeven
CC gregkh, linux-serial
Quoted 8 lines · Yoshinori Sato
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 <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Quoted 18 lines
drivers/tty/serial/sh-sci.c +6
-4@@ -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 ; }
Quoted 1 line
drivers/tty/serial/sh-sci.c static int sci_init_single(struct platform_device *dev, · line 2874
Quoted 1 line
drivers/tty/serial/sh-sci.c +0
-0/*
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 -- [email protected]
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
Yoshinori Sato
maintainerQuoted 45 lines · Geert Uytterhoeven
Hi Sato-san,
Quoted 33 lines · Geert Uytterhoeven
CC gregkh, linux-serial
Quoted 8 lines · Yoshinori Sato
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 <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Quoted 18 lines
drivers/tty/serial/sh-sci.c +6
-4@@ -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 ; }Quoted 1 line
drivers/tty/serial/sh-sci.c static int sci_init_single(struct platform_device *dev, · line 2874
Quoted 1 line
drivers/tty/serial/sh-sci.c +0
-0/* Considering the regshift issues introduced by RZ/A2 SCIF support, I think it's better to not rely on the
reg_sizevalue, and change the check toif (!dev->dev.of_node && port->type = PORT_SCI)
Quoted 9 lines
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.
Quoted 6 lines
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]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
Signature · 1 line
Yosinori Sato