serial: uartlite: Support for SERIAL_MULTI
PATCH v4 1/1 serial: uartlite: Support for SERIAL_MULTI
Add support for SERIAL MULTI for uartlite.
---
v2: Use in/out_be32 functions
v3: Clean coding style
v4: Simplify userial_ports array initialization
--- common/serial.c | 14 ++++ drivers/serial/serial_xuartlite.c | 134 ++++++++++++++++++++++++++++++++----- include/serial.h | 7 ++ 3 files changed, 137 insertions(+), 18 deletions(-)
common/serial.c +14 -0
@@ -108,6 +108,20 @@ void serial_initialize (void)#if defined(CONFIG_SYS_BFIN_UART )serial_register_bfin_uart ();#endif +#if defined(CONFIG_XILINX_UARTLITE ) +# ifdef XILINX_UARTLITE_BASEADDR +serial_register (&uartlite_serial0_device); +# endif /* XILINX_UARTLITE_BASEADDR */ +# ifdef XILINX_UARTLITE_BASEADDR1 +serial_register (&uartlite_serial1_device); +# endif /* XILINX_UARTLITE_BASEADDR1 */ +# ifdef XILINX_UARTLITE_BASEADDR2 +serial_register (&uartlite_serial2_device); +# endif /* XILINX_UARTLITE_BASEADDR2 */ +# ifdef XILINX_UARTLITE_BASEADDR3 +serial_register (&uartlite_serial3_device); +# endif /* XILINX_UARTLITE_BASEADDR3 */ +#endif /* CONFIG_XILINX_UARTLITE */ serial_assign (default_serial_console ()->name); }
drivers/serial/serial_xuartlite.c +116 -18
162 lines not on this page · raw message
include/serial.h +7 -0
@@ -50,6 +50,13 @@ extern struct serial_device serial4_device;extern struct serial_device serial6_device;#endif +#if defined(CONFIG_XILINX_UARTLITE ) +extern struct serial_device uartlite_serial0_device; +extern struct serial_device uartlite_serial1_device; +extern struct serial_device uartlite_serial2_device; +extern struct serial_device uartlite_serial3_device; +#endif +#if defined(CONFIG_S3C2410 )extern struct serial_device s3c24xx_serial0_device;extern struct serial_device s3c24xx_serial1_device;
Signature · 1 line
1.5.5.6
PATCH v4 1/1 serial: uartlite: Support for SERIAL_MULTI
Quoted 7 lines · Michal Simek
Add support for SERIAL MULTI for uartlite.
Signed-off-by Michal Simek <[email protected]>---
v2: Use in/out_be32 functions
Quoted 8 lines
v3: Clean coding style
v4: Simplify
userial_portsarray initialization--- common/serial.c | 14 ++++ drivers/serial/serial_xuartlite.c | 134 ++++++++++++++++++++++++++++++++----- include/serial.h | 7 ++ 3 files changed, 137 insertions(+), 18 deletions(-)
Any comment?
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
PATCH v4 1/1 serial: uartlite: Support for SERIAL_MULTI
Quoted 13 lines · Michal Simek
Quoted 12 lines · Michal Simek
Add support for SERIAL MULTI for uartlite.
Signed-off-by Michal Simek <[email protected]>---
v2: Use in/out_be32 functionsv3: Clean coding style
v4: Simplify
userial_portsarray initialization
---
Quoted 7 lines
Quoted 5 lines
common/serial.c | 14 ++++ drivers/serial/serial_xuartlite.c | 134 ++++++++++++++++++++++++++++++++----- include/serial.h | 7 ++ 3 files changed, 137 insertions(+), 18 deletions(-)Any comment?
Avoid endless loops
Quoted 2 lines
Michal
PATCH v4 1/1 serial: uartlite: Support for SERIAL_MULTI
Quoted 14 lines · Marek Vasut
Quoted 13 lines · Michal Simek
Quoted 12 lines · Michal Simek
Add support for SERIAL MULTI for uartlite.
Signed-off-by Michal Simek <[email protected]>---
v2: Use in/out_be32 functionsv3: Clean coding style
v4: Simplify
userial_portsarray initialization
---
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
common/serial.c | 14 ++++ drivers/serial/serial_xuartlite.c | 134 ++++++++++++++++++++++++++++++++----- include/serial.h | 7 ++ 3 files changed, 137 insertions(+), 18 deletions(-)Any comment?
Avoid endless loops
No problem to do it for putc but for getc?
What would you like to return if there is no character available?
If generic code always checked if there is any character available through tstc and then call getc I can keep there just reading buffer but from my test I see that it doesn't do that.
Please point me to any existing u-boot serial driver which does it in way you like. I wasn't able to find it out.
Thanks,
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
PATCH v4 1/1 serial: uartlite: Support for SERIAL_MULTI
Quoted 11 lines · On Wednesday, September 21, 2011 08:21:35 Michal Simek wrote:
Quoted 7 lines · Marek Vasut
Quoted 4 lines · Michal Simek
Quoted 1 line · Michal Simek
Add support for SERIAL MULTI for uartlite.
Any comment?
Avoid endless loops
No problem to do it for putc but for getc?
What would you like to return if there is no character available?
getc() is allowed to loop forever. pretty much most drivers also wait forever with putc(). i dont think serial drivers really matter as if the hardware breaks, u-boot itself isn't terribly useful anymore. just make sure flow control doesn't bite you (CTS/RTS).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110921/eba26152/attachment.pgp
PATCH v4 1/1 serial: uartlite: Support for SERIAL_MULTI
In reply to Michal Simekdrivers/serial/serial_xuartlite.c line 43
Quoted 4 lines · On Thursday, September 15, 2011 09:50:00 Michal Simek wrote:
drivers/serial/serial_xuartlite.c +1
-0+static struct uartlite *userial_ports[4 ] = {
i think you missed my previous feedback here. pretty sure this should be:
static struct uartlite * const userial_ports[4] = {-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110920/81a0dc72/attachment.pgp
PATCH v4 1/1 serial: uartlite: Support for SERIAL_MULTI
Quoted 8 lines · Mike Frysinger
drivers/serial/serial_xuartlite.c line 43
Quoted 4 lines · On Thursday, September 15, 2011 09:50:00 Michal Simek wrote:
drivers/serial/serial_xuartlite.c +1
-0+static struct uartlite *userial_ports[4 ] = {i think you missed my previous feedback here. pretty sure this should be:
static struct uartlite * const userial_ports[4] = {
yeah - just read the second message not the first one.
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian