From 98d1c55149e86db5ca309079730cea442b4d1473 Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Thu, 12 May 2016 12:45:42 +0200 Subject: [PATCH] TPL: TM2: serial: Support for s5p_serial on TM2 board Signed-off-by: Lukasz Majewski --- drivers/serial/Makefile | 4 ++++ drivers/serial/serial_s5p.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 06ee306..9473747 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -39,7 +39,11 @@ obj-$(CONFIG_EFI_APP) += serial_efi.o obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o obj-$(CONFIG_MCFUART) += mcfuart.o obj-$(CONFIG_SYS_NS16550) += ns16550.o +ifndef CONFIG_TPL_TM2 obj-$(CONFIG_S5P) += serial_s5p.o +else +obj-$(CONFIG_S5P_SERIAL) += serial_s5p.o +endif obj-$(CONFIG_MXC_UART) += serial_mxc.o obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o obj-$(CONFIG_MESON_SERIAL) += serial_meson.o diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index e3160cf..1ea8e6c 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -88,6 +88,7 @@ static void __maybe_unused s5p_serial_baud(struct s5p_uart *uart, uint uclk, #ifndef CONFIG_SPL_BUILD int s5p_serial_setbrg(struct udevice *dev, int baudrate) { +#ifndef CONFIG_TPL_TM2 struct s5p_serial_platdata *plat = dev->platdata; struct s5p_uart *const uart = plat->reg; u32 uclk; @@ -105,7 +106,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate) #endif s5p_serial_baud(uart, uclk, baudrate); - +#endif return 0; } @@ -176,6 +177,7 @@ static int s5p_serial_pending(struct udevice *dev, bool input) return (ufstat & TX_FIFO_COUNT_MASK) >> TX_FIFO_COUNT_SHIFT; } +#ifndef CONFIG_TPL_TM2 static int s5p_serial_ofdata_to_platdata(struct udevice *dev) { struct s5p_serial_platdata *plat = dev->platdata; @@ -190,7 +192,12 @@ static int s5p_serial_ofdata_to_platdata(struct udevice *dev) "id", dev->seq); return 0; } - +#else +static int s5p_serial_ofdata_to_platdata(struct udevice *dev) +{ + return 0; +} +#endif static const struct dm_serial_ops s5p_serial_ops = { .putc = s5p_serial_putc, .pending = s5p_serial_pending, -- 2.7.4