[U-Boot] [PATCH] ZOOM2 Add serial support.

Wolfgang Denk
2009-04-01T20:25:32Z

Dear Tom Rix,

In message <1238602273-27252-4-git-send-email-Tom.Rix@windriver.com> you wrote:
> Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board.
> The default serial is from the USB connector on left side of the debug board.
> The USB connector will produce 2 of the 4 UARTS. On your host pick the first
> enumeration.
>
> The serial port set up is the same with Zoom1.
> Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.
>
> The kernel bootargs are
> console=ttyS3,115200n8
...
> diff --git a/board/omap3/zoom2/Makefile b/board/omap3/zoom2/Makefile
> index b8fa5a7..d27990c 100644
> --- a/board/omap3/zoom2/Makefile
> +++ b/board/omap3/zoom2/Makefile
> @@ -26,7 +26,8 @@ include $(TOPDIR)/config.mk
> LIB = $(obj)lib$(BOARD).a
>
> COBJS := zoom2.o \
> - debug_board.o
> + debug_board.o \
> + zoom2_serial.o

Please sort lists.

> SRCS := $(COBJS:.o=.c)
> OBJS := $(addprefix $(obj),$(COBJS))
> diff --git a/board/omap3/zoom2/zoom2_serial.c b/board/omap3/zoom2/zoom2_serial.c
> new file mode 100644
> index 0000000..c1c4f4a
> --- /dev/null
> +++ b/board/omap3/zoom2/zoom2_serial.c
...
> +int quad_init_dev(unsigned long base)
> +{
> + /* The Quad UART is on the debug board.
> + Check if the debug board is attached before using the UART */

Incorrect multiline comment style. Please fix globally.

> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index 397f5df..93a1bd2 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -14,9 +14,18 @@
> void NS16550_init (NS16550_t com_port, int baud_divisor)
> {
> com_port->ier = 0x00;
> -#ifdef CONFIG_OMAP
> +#if defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)
> com_port->mdr1 = 0x7; /* mode select reset TL16C750*/
> #endif
> +#if defined(CONFIG_OMAP3_ZOOM2)
> + /* On Zoom2 board Set pre-scalar to 1
> + * CLKSEL is GND => MCR[7] is 1 => preslr is 4
> + * So change the prescl to 1
> + */
> + com_port->lcr = 0xBF;
> + com_port->fcr |= 0x10;
> + com_port->mcr &= 0x7F;

Please don't add such strictly board-specific code to global driver
files.

> diff --git a/include/serial.h b/include/serial.h
> index e3d8b36..aca5221 100644
> --- a/include/serial.h
> +++ b/include/serial.h
> @@ -42,6 +42,13 @@ extern struct serial_device s3c24xx_serial1_device;
> extern struct serial_device s3c24xx_serial2_device;
> #endif
>
> +#if defined(CONFIG_OMAP3_ZOOM2)
> +extern struct serial_device zoom2_serial_device0;
> +extern struct serial_device zoom2_serial_device1;
> +extern struct serial_device zoom2_serial_device2;
> +extern struct serial_device zoom2_serial_device3;
> +#endif
> +

Please don't add such strictly board-specific code to global header
files.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Am besten betrachten Sie Fehlermeldungen als eine Art Psycho-Test,
mit dem herausgefunden werden soll, wie belastbar Sie sind."
- Dr. R. Wonneberger, Kompaktf?hrer LaTeX, Kap. 1.6: Fehlermeldungen