Post-mainline updates of serial_arc driver
cover Post-mainline updates of serial_arc driver
serial_arc driver didn't exist in U-Boot Master branch until supoort of ARC700 architecture was accepted yesterday.
Because of that there was no way to apply pathes to initially approved version searial_arc driver.
So now when driver is in U-Boot source tree it's time to submit 2 minor fixes that are required for propoer driver operation in:
* Simulation
* On big-endian machines
Alexey Brodkin (2):
serial/serial_arc: add work-around of ISS bug serial/serial_arc: switch from {read|write}l to {read|write}b
accessors
drivers/serial/serial_arc.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.5.3
PATCH 1/2 serial/serial_arc: add work-around of ISS bug
Explanation is in in-lined comment.
--- drivers/serial/serial_arc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/serial/serial_arc.c +16 -0
@@ -39,7 +39,23 @@ static void arc_serial_setbrg(void) arc_console_baud = gd->cpu_clk / (gd->baudrate *4 ) -1 ;writel (arc_console_baud &0xff , ®s->baudl); + +#ifdef CONFIG_ARC +/* +* UART ISS(Instruction Set simulator) emulation has a subtle bug: +* A existing value of Baudh = 0 is used as a indication to startup +* it's internal state machine. +* Thus if baudh is set to 0, 2 times, it chokes. +* This happens with BAUD=115200 and the formaula above +* Until that is fixed, when running on ISS, we will set baudh to !0 +*/ +if (gd->arch.running_on_hw) +writel ((arc_console_baud &0xff00 ) >>8 , ®s->baudh); +else +writel (1 , ®s->baudh); +#else writel ((arc_console_baud &0xff00 ) >>8 , ®s->baudh); +#endif }static int arc_serial_init (void )
Signature · 1 line
1.8.5.3
PATCH 1/2 serial/serial_arc: add work-around of ISS bug
Quoted 7 lines · Alexey Brodkin
Explanation is in in-lined comment.
Signed-off-by Alexey Brodkin <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140221/72bc423f/attachment.pgp>
PATCH 2/2 serial/serial_arc: switch from {read|write}l to {read|write}b accessors
In reply to Alexey BrodkinThis is required for proper functionality on big-endian targets. Memory-mapped registres of ARC UART are not 32-bit words but 8-bit bytes so on little-endian target either acessor (_l or _b) works fine. On big-endian only _b accessors works as expected.
--- drivers/serial/serial_arc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/serial/serial_arc.c +9 -9
@@ -38,7 +38,7 @@ static void arc_serial_setbrg(void) gd->baudrate =CONFIG_BAUDRATE ; arc_console_baud = gd->cpu_clk / (gd->baudrate *4 ) -1 ; -writel (arc_console_baud &0xff , ®s->baudl); +writeb (arc_console_baud &0xff , ®s->baudl);#ifdef CONFIG_ARC /*
@@ -50,11 +50,11 @@ static void arc_serial_setbrg(void)* Until that is fixed, when running on ISS, we will set baudh to !0 */ if (gd->arch.running_on_hw) -writel ((arc_console_baud &0xff00 ) >>8 , ®s->baudh); +writeb ((arc_console_baud &0xff00 ) >>8 , ®s->baudh);else -writel (1 , ®s->baudh); +writeb (1 , ®s->baudh);#else -writel ((arc_console_baud &0xff00 ) >>8 , ®s->baudh); +writeb ((arc_console_baud &0xff00 ) >>8 , ®s->baudh);#endif }
@@ -70,15 +70,15 @@ static void arc_serial_putc(const char c)if (c =='\n' )arc_serial_putc ('\r' ); -while (!(readl (®s->status) &UART_TXEMPTY )) +while (!(readb (®s->status) &UART_TXEMPTY )) ; -writel (c, ®s->data); +writeb (c, ®s->data); }static int arc_serial_tstc (void ) { -return !(readl (®s->status) &UART_RXEMPTY ); +return !(readb (®s->status) &UART_RXEMPTY ); }static int arc_serial_getc (void )
@@ -87,10 +87,10 @@ static int arc_serial_getc(void) ;/* Check for overflow errors */ -if (readl (®s->status) &UART_OVERFLOW_ERR ) +if (readb (®s->status) &UART_OVERFLOW_ERR )return 0 ; -return readl (®s->data) &0xFF ; +return readb (®s->data) &0xFF ; }static void arc_serial_puts (const char *s)
Signature · 1 line
1.8.5.3
PATCH 2/2 serial/serial_arc: switch from {read|write}l to {read|write}b accessors
Quoted 10 lines · Alexey Brodkin
This is required for proper functionality on big-endian targets. Memory-mapped registres of ARC UART are not 32-bit words but 8-bit bytes so on little-endian target either acessor (_l or _b) works fine. On big-endian only _b accessors works as expected.
Signed-off-by Alexey Brodkin <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140221/7cb6c950/attachment.pgp>
cover Post-mainline updates of serial_arc driver
In reply to Alexey BrodkinQuoted 11 lines · Alexey Brodkin
serial_arcdriver didn't exist in U-Boot Master branch until supoort of ARC700 architecture was accepted yesterday.Because of that there was no way to apply pathes to initially approved version
searial_arcdriver.So now when driver is in U-Boot source tree it's time to submit 2 minor fixes that are required for propoer driver operation in:
* Simulation
* On big-endian machines
Quoted 8 lines
Alexey Brodkin (2):
serial/serial_arc: add work-around of ISS bug serial/serial_arc: switch from {read|write}l to {read|write}b
accessorsdrivers/serial/serial_arc.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-)
Hello Tom,
Please treat it as a polite reminder.
Would be good to apply this series sometime soon
http://patchwork.ozlabs.org/patch/318373/
http://patchwork.ozlabs.org/patch/318374/
Regards,
Alexey