diff mbox

[U-Boot,v5,03/11] serial: Add support to 4 ports in serial_s3c24x0

Message ID 1348253268-21812-4-git-send-email-jose.goncalves@inov.pt
State Changes Requested
Delegated to: Minkyu Kang
Headers show

Commit Message

José Miguel Gonçalves Sept. 21, 2012, 6:47 p.m. UTC
S3C2416 and S3C2450 have 4 UARTs insted of 3 found on older chips.
This patch adds support to the additional UART port and changes the
mapping between CONFIG_SERIAL? and S3C24X0_UART? in order they have
a direct correspondence.

Signed-off-by: José Miguel Gonçalves <jose.goncalves@inov.pt>
---
Changes for v2:
   - New patch

Changes for v3:
   - None

Changes for v4:
   - None

Changes for v5:
   - None
---
 drivers/serial/serial_s3c24x0.c |   25 ++++++++++++++++++-------
 include/configs/VCMA9.h         |    2 +-
 include/configs/smdk2410.h      |    2 +-
 3 files changed, 20 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/drivers/serial/serial_s3c24x0.c b/drivers/serial/serial_s3c24x0.c
index 12bcdd3..280cd2d 100644
--- a/drivers/serial/serial_s3c24x0.c
+++ b/drivers/serial/serial_s3c24x0.c
@@ -2,6 +2,9 @@ 
  * (C) Copyright 2002
  * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
  *
+ * (C) Copyright 2012 INOV - INESC Inovacao
+ * Jose Goncalves <jose.goncalves@inov.pt>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -24,17 +27,20 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SERIAL1
+#if defined(CONFIG_SERIAL0)
 #define UART_NR	S3C24X0_UART0
 
-#elif defined(CONFIG_SERIAL2)
+#elif defined(CONFIG_SERIAL1)
 #define UART_NR	S3C24X0_UART1
 
-#elif defined(CONFIG_SERIAL3)
+#elif defined(CONFIG_SERIAL2)
 #define UART_NR	S3C24X0_UART2
 
+#elif defined(CONFIG_SERIAL3)
+#define UART_NR	S3C24X0_UART3
+
 #else
-#error "Bad: you didn't configure serial ..."
+#error "You didn't configure serial."
 #endif
 
 #include <asm/io.h>
@@ -310,15 +316,20 @@  INIT_S3C_SERIAL_STRUCTURE(1, "s3ser1");
 DECLARE_S3C_SERIAL_FUNCTIONS(2);
 struct serial_device s3c24xx_serial2_device =
 INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2");
+DECLARE_S3C_SERIAL_FUNCTIONS(3);
+struct serial_device s3c24xx_serial3_device =
+INIT_S3C_SERIAL_STRUCTURE(3, "s3ser3");
 
 __weak struct serial_device *default_serial_console(void)
 {
-#if defined(CONFIG_SERIAL1)
+#if defined(CONFIG_SERIAL0)
 	return &s3c24xx_serial0_device;
-#elif defined(CONFIG_SERIAL2)
+#elif defined(CONFIG_SERIAL1)
 	return &s3c24xx_serial1_device;
-#elif defined(CONFIG_SERIAL3)
+#elif defined(CONFIG_SERIAL2)
 	return &s3c24xx_serial2_device;
+#elif defined(CONFIG_SERIAL3)
+	return &s3c24xx_serial3_device;
 #else
 #error "CONFIG_SERIAL? missing."
 #endif
diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index 6ad4a6b..82db58f 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -122,7 +122,7 @@ 
  * select serial console configuration
  */
 #define CONFIG_S3C24X0_SERIAL
-#define CONFIG_SERIAL1		1	/* we use SERIAL 1 on VCMA9 */
+#define CONFIG_SERIAL0		1	/* we use SERIAL 0 on VCMA9 */
 
 /* USB support (currently only works with D-cache off) */
 #define CONFIG_USB_OHCI
diff --git a/include/configs/smdk2410.h b/include/configs/smdk2410.h
index 8792c85..ea05f16 100644
--- a/include/configs/smdk2410.h
+++ b/include/configs/smdk2410.h
@@ -62,7 +62,7 @@ 
  * select serial console configuration
  */
 #define CONFIG_S3C24X0_SERIAL
-#define CONFIG_SERIAL1		1	/* we use SERIAL 1 on SMDK2410 */
+#define CONFIG_SERIAL0		1	/* we use SERIAL 0 on SMDK2410 */
 
 /************************************************************
  * USB support (currently only works with D-cache off)