Skip to contentSkip to conversation

serial: Massive rework of the serial subsystem

PATCH New Marek Vasut 15 participants 306 messages Sep 16, 2012 – Oct 9, 2012 Page 3 of 3

Subsystems (12)
lore
Share & tools
lore
#221 lore raw

PATCH v3 5/72 serial: pxa: Make use of default_serial_console in serial_pxa

In reply to Marek Vasut

Make use of the newly implemented weak default_serial_console in the serial_pxa driver. This removes all reimplementations of this function from board files.

---
 board/balloon3/balloon3.c                     |    5 -----
 board/palmld/palmld.c                         |    5 -----
 board/palmtc/palmtc.c                         |    5 -----
 board/toradex/colibri_pxa270/colibri_pxa270.c |    5 -----
 board/trizepsiv/conxs.c                       |    5 -----
 board/vpac270/vpac270.c                       |    5 -----
 board/zipitz2/zipitz2.c                       |    5 -----
 include/configs/balloon3.h                    |    1 +
 include/configs/colibri_pxa270.h              |    1 +
 include/configs/lubbock.h                     |    1 +
 include/configs/palmld.h                      |    1 +
 include/configs/palmtc.h                      |    1 +
 include/configs/pxa255_idp.h                  |    1 +
 include/configs/trizepsiv.h                   |    1 +
 include/configs/vpac270.h                     |    1 +
 include/configs/xaeniax.h                     |    2 +-
 include/configs/zipitz2.h                     |    1 +
 17 files changed, 10 insertions(+), 36 deletions(-)
board/balloon3/balloon3.c +0 -5
index f360323..c934988 100644
@@ -53,11 +53,6 @@ int board_init(void)
 	return 0;
 }
 
-struct serial_device *default_serial_console(void)
-{
-	return &serial_stuart_device;
-}
-
 int dram_init(void)
 {
 	pxa2xx_dram_init();
board/palmld/palmld.c +0 -5
index 2f1ad20..57b4f5f 100644
@@ -52,11 +52,6 @@ int board_init(void)
 	return 0;
 }
 
-struct serial_device *default_serial_console(void)
-{
-	return &serial_ffuart_device;
-}
-
 int dram_init(void)
 {
 	pxa2xx_dram_init();
board/palmtc/palmtc.c +0 -5
index 4adf152..b23eec8 100644
@@ -51,11 +51,6 @@ int board_init(void)
 	return 0;
 }
 
-struct serial_device *default_serial_console(void)
-{
-	return &serial_ffuart_device;
-}
-
 int dram_init(void)
 {
 	pxa2xx_dram_init();
board/toradex/colibri_pxa270/colibri_pxa270.c +0 -5
index d72e5d6..a6e13c8 100644
@@ -29,11 +29,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct serial_device *default_serial_console(void)
-{
-	return &serial_ffuart_device;
-}
-
 int board_init(void)
 {
 	/* We have RAM, disable cache */
board/trizepsiv/conxs.c +0 -5
index 1291195..8fc3c40 100644
@@ -135,11 +135,6 @@ int board_late_init(void)
 	return 0;
 }
 
-struct serial_device *default_serial_console (void)
-{
-	return &serial_ffuart_device;
-}
-
 int dram_init(void)
 {
 	pxa2xx_dram_init();
board/vpac270/vpac270.c +0 -5
index dfdab9b..2663534 100644
@@ -50,11 +50,6 @@ int board_init(void)
 	return 0;
 }
 
-struct serial_device *default_serial_console(void)
-{
-	return &serial_ffuart_device;
-}
-
 int dram_init(void)
 {
 #ifndef	CONFIG_ONENAND
board/zipitz2/zipitz2.c +0 -5
index 82dfa82..579841d 100644
@@ -62,11 +62,6 @@ int board_init (void)
 	return 0;
 }
 
-struct serial_device *default_serial_console (void)
-{
-	return &serial_stuart_device;
-}
-
 int dram_init(void)
 {
 	pxa2xx_dram_init();
include/configs/balloon3.h +1 -0
index 756f409..0f26a5b 100644
@@ -53,6 +53,7 @@
  */
 #define	CONFIG_PXA_SERIAL
 #define	CONFIG_STUART			1
+#define CONFIG_CONS_INDEX		2
 #define	CONFIG_BAUDRATE			115200
 
 /*
include/configs/colibri_pxa270.h +1 -0
index ae84344..bb8bea7 100644
@@ -55,6 +55,7 @@
  */
 #define	CONFIG_PXA_SERIAL
 #define	CONFIG_FFUART			1
+#define CONFIG_CONS_INDEX		3
 #define	CONFIG_BAUDRATE			115200
 
 /*
include/configs/lubbock.h +1 -0
index 0a1d1e0..ed64960 100644
@@ -64,6 +64,7 @@
  */
 #define CONFIG_PXA_SERIAL
 #define CONFIG_FFUART	       1       /* we use FFUART on LUBBOCK */
+#define CONFIG_CONS_INDEX	3
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
include/configs/palmld.h +1 -0
index 835121e..c5dd494 100644
@@ -54,6 +54,7 @@
  */
 #define	CONFIG_PXA_SERIAL
 #define	CONFIG_FFUART			1
+#define CONFIG_CONS_INDEX		3
 #define	CONFIG_BAUDRATE			9600
 
 /*
include/configs/palmtc.h +1 -0
index bc88354..6e8d8e9 100644
@@ -58,6 +58,7 @@
  */
 #define	CONFIG_PXA_SERIAL
 #define	CONFIG_FFUART			1
+#define CONFIG_CONS_INDEX		3
 #define	CONFIG_BAUDRATE			115200
 
 /*
include/configs/pxa255_idp.h +1 -0
index ce9e7d1..24c5363 100644
@@ -99,6 +99,7 @@
  */
 #define CONFIG_PXA_SERIAL
 #define CONFIG_FFUART	       1       /* we use FFUART on LUBBOCK */
+#define CONFIG_CONS_INDEX	3
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
include/configs/trizepsiv.h +1 -0
index 151059a..47c6a23 100644
@@ -68,6 +68,7 @@
 #define CONFIG_FFUART	       1       /* we use FFUART on Conxs */
 #define CONFIG_BTUART	       1       /* we use BTUART on Conxs */
 #define CONFIG_STUART	       1       /* we use STUART on Conxs */
+#define CONFIG_CONS_INDEX	3
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
include/configs/vpac270.h +1 -0
index 424a902..5e948f9 100644
@@ -75,6 +75,7 @@
  */
 #define	CONFIG_PXA_SERIAL
 #define	CONFIG_FFUART			1
+#define CONFIG_CONS_INDEX		3
 #define	CONFIG_BAUDRATE			115200
 
 /*
include/configs/xaeniax.h +1 -1
index e399e95..eee2547 100644
@@ -54,7 +54,7 @@
  */
 #define CONFIG_PXA_SERIAL
 #define CONFIG_BTUART	       1       /* we use BTUART on XAENIAX */
-
+#define CONFIG_CONS_INDEX	4
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
include/configs/zipitz2.h +1 -0
index 8b7e05b..bf6394a 100644
@@ -66,6 +66,7 @@
  */
 #define	CONFIG_PXA_SERIAL
 #define	CONFIG_STUART			1
+#define CONFIG_CONS_INDEX		2
 #define	CONFIG_BAUDRATE			115200
 
 /*
Signature · 1 line
1.7.10.4
#222 lore raw

PATCH v3 6/72 serial: pxa: Make local functions static

In reply to Marek Vasut

Make functions that are local-only static, so no hairy symbols stick out of the serial_pxa driver file.

---
 drivers/serial/serial_pxa.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/serial_pxa.c +3 -3
index ad2d77e..bd3b3cf 100644
@@ -87,7 +87,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #endif
 #endif
 
-uint32_t pxa_uart_get_baud_divider(void)
+static uint32_t pxa_uart_get_baud_divider(void)
 {
 	if (gd->baudrate == 1200)
 		return 768;
@@ -105,7 +105,7 @@ uint32_t pxa_uart_get_baud_divider(void)
 		return 0;
 }
 
-struct pxa_uart_regs *pxa_uart_index_to_regs(uint32_t uart_index)
+static struct pxa_uart_regs *pxa_uart_index_to_regs(uint32_t uart_index)
 {
 	switch (uart_index) {
 	case FFUART_INDEX: return (struct pxa_uart_regs *)FFUART_BASE;
@@ -117,7 +117,7 @@ struct pxa_uart_regs *pxa_uart_index_to_regs(uint32_t uart_index)
 	}
 }
 
-void pxa_uart_toggle_clock(uint32_t uart_index, int enable)
+static void pxa_uart_toggle_clock(uint32_t uart_index, int enable)
 {
 	uint32_t clk_reg, clk_offset, reg;
 
Signature · 1 line
1.7.10.4
#223 lore raw

PATCH v3 7/72 serial: mpc512x: Properly define CONFIG_SYS_PSC3 in config files

In reply to Marek Vasut

Some of the boards using the mpc512x serial driver didn't properly define which PSC console to use. This caused breakage when building with CONFIG_SERIAL_MULTI enabled. Fix this by defining the default PSC console.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 include/configs/aria.h       |    1 +
 include/configs/mecp5123.h   |    1 +
 include/configs/mpc5121ads.h |    1 +
 3 files changed, 3 insertions(+)
include/configs/aria.h +1 -0
index b21b495..0b31c50 100644
@@ -322,6 +322,7 @@
  * Serial console configuration
  */
 #define CONFIG_PSC_CONSOLE		3	/* console on PSC3 */
+#define CONFIG_SYS_PSC3
 #if CONFIG_PSC_CONSOLE != 3
 #error CONFIG_PSC_CONSOLE must be 3
 #endif
include/configs/mecp5123.h +1 -0
index b41bda9..cafc273 100644
@@ -222,6 +222,7 @@
  * Serial console configuration
  */
 #define CONFIG_PSC_CONSOLE	3	/* console is on PSC3 */
+#define CONFIG_SYS_PSC3
 #if CONFIG_PSC_CONSOLE != 3
 #error CONFIG_PSC_CONSOLE must be 3
 #endif
include/configs/mpc5121ads.h +1 -0
index 9d1327f..3f55d35 100644
@@ -290,6 +290,7 @@
  * Serial console configuration
  */
 #define CONFIG_PSC_CONSOLE	3	/* console is on PSC3 */
+#define CONFIG_SYS_PSC3
 #if CONFIG_PSC_CONSOLE != 3
 #error CONFIG_PSC_CONSOLE must be 3
 #endif
Signature · 1 line
1.7.10.4
#224 lore raw

PATCH v3 8/72 serial: Implement serial_initfunc() macro

In reply to Marek Vasut

This macro simplifies declaration of weak aliases for per-driver functions, which register these drivers with the serial subsystem. The idea here is to push serial_register() calls from serial.c into the drivers. To avoid pile of ifdef construct as it is now, create weak aliases to these functions, which in case the driver is not present alias onto an empty function, which is in turn optimized out altogether.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 common/serial.c |    8 ++++++++
 1 file changed, 8 insertions(+)
common/serial.c +8 -0
index 5740d4f..84dbe50 100644
@@ -32,6 +32,14 @@ DECLARE_GLOBAL_DATA_PTR;
 static struct serial_device *serial_devices;
 static struct serial_device *serial_current;
 
+static void serial_null(void)
+{
+}
+
+#define serial_initfunc(name)					\
+	void name(void)						\
+		__attribute__((weak, alias("serial_null")));
+
 void serial_register(struct serial_device *dev)
 {
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
Signature · 1 line
1.7.10.4
#225 lore raw

PATCH v3 9/72 serial: mpc8xx: Move serial registration from serial_initialize()

In reply to Marek Vasut

Move the registration of serial_smc and serial_scc ports from default serial_initialize() into CPU specific function called from serial_initialize(). This slims down the serial_initialize() call to a bare tracker of all possible serial port registration routines in U-Boot.

The exports of both serial_scc_device and serial_smc_device can not yet be removed as they are still used in default_serial_console() calls.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 arch/powerpc/cpu/mpc8xx/serial.c |   11 +++++++++++
 common/serial.c                  |   11 +++--------
 2 files changed, 14 insertions(+), 8 deletions(-)
arch/powerpc/cpu/mpc8xx/serial.c +11 -0
index dc9b323..00888e9 100644
@@ -681,6 +681,17 @@ __weak struct serial_device *default_serial_console(void)
 #endif
 }
 
+void mpc8xx_serial_initialize(void)
+{
+#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2)
+	serial_register(&serial_smc_device);
+#endif
+#if	defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) || \
+	defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
+	serial_register(&serial_scc_device);
+#endif
+}
+
 #ifdef CONFIG_MODEM_SUPPORT
 void disable_putc(void)
 {
common/serial.c +3 -8
index 84dbe50..0187dac 100644
@@ -40,6 +40,8 @@ static void serial_null(void)
 	void name(void)						\
 		__attribute__((weak, alias("serial_null")));
 
+serial_initfunc(mpc8xx_serial_initialize);
+
 void serial_register(struct serial_device *dev)
 {
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
@@ -57,14 +59,7 @@ void serial_register(struct serial_device *dev)
 
 void serial_initialize(void)
 {
-#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2)
-	serial_register(&serial_smc_device);
-#endif
-#if	defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) || \
-	defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
-	serial_register(&serial_scc_device);
-#endif
-
+	mpc8xx_serial_initialize();
 #if defined(CONFIG_SYS_NS16550_SERIAL)
 #if defined(CONFIG_SYS_NS16550_COM1)
 	serial_register(&eserial1_device);
Signature · 1 line
1.7.10.4
#226 lore raw

PATCH v3 10/72 serial: s3c24xx: Move serial registration from serial_initialize()

In reply to Marek Vasut

Move the registration of s3c24xx_serialN_device ports from default serial_initialize() into driver specific function called from serial_initialize(). This slims down the serial_initialize() call to a bare tracker of all possible serial port registration routines in U-Boot.

The newly implemented s3c24xx_serial_initialize() function, which is implemented inside of the serial_s3c24xx driver allows encapsulation of s3c24xx_serialN_device within the serial_s3c24xx driver itself.

Also, remove the exports of s3c24xx_serialN_device from include/serial.h as they are no longer needed. This is simply because the implementation of default_serial_console() is wrapped into the serial_s3c24xx driver and the default console is picked by CONFIG_SERIAL<N> macro in config file.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc C Nauman <[email protected]>
---
 common/serial.c                 |    7 ++-----
 drivers/serial/serial_s3c24x0.c |    7 +++++++
 include/serial.h                |    6 ------
 3 files changed, 9 insertions(+), 11 deletions(-)
common/serial.c +2 -5
index 0187dac..b210b05 100644
@@ -41,6 +41,7 @@ static void serial_null(void)
 		__attribute__((weak, alias("serial_null")));
 
 serial_initfunc(mpc8xx_serial_initialize);
+serial_initfunc(s3c24xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -83,11 +84,7 @@ void serial_initialize(void)
 #if defined(CONFIG_STUART)
 	serial_register(&serial_stuart_device);
 #endif
-#if defined(CONFIG_S3C2410)
-	serial_register(&s3c24xx_serial0_device);
-	serial_register(&s3c24xx_serial1_device);
-	serial_register(&s3c24xx_serial2_device);
-#endif
+	s3c24xx_serial_initialize();
 #if defined(CONFIG_S5P)
 	serial_register(&s5p_serial0_device);
 	serial_register(&s5p_serial1_device);
drivers/serial/serial_s3c24x0.c +7 -0
index fa6aac0..625c6b7 100644
@@ -323,4 +323,11 @@ __weak struct serial_device *default_serial_console(void)
 #error "CONFIG_SERIAL? missing."
 #endif
 }
+
+void s3c24xx_serial_initialize(void)
+{
+	serial_register(&s3c24xx_serial0_device);
+	serial_register(&s3c24xx_serial1_device);
+	serial_register(&s3c24xx_serial2_device);
+}
 #endif /* CONFIG_SERIAL_MULTI */
include/serial.h +0 -6
index 4d19259..1da4ac4 100644
@@ -57,12 +57,6 @@ 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;
-extern struct serial_device s3c24xx_serial2_device;
-#endif
-
 #if defined(CONFIG_S5P)
 extern struct serial_device s5p_serial0_device;
 extern struct serial_device s5p_serial1_device;
Signature · 1 line
1.7.10.4
#227 lore raw

PATCH v3 11/72 serial: pxa: Move serial registration from serial_initialize()

In reply to Marek Vasut

Move the registration of serial_XXuart ports from default serial_initialize() into driver specific function called from serial_initialize(). This slims down the serial_initialize() call to a bare tracker of all possible serial port registration routines in U-Boot.

The newly implemented pxa_serial_initialize() function, which is implemented inside of the serial_pxa driver allows encapsulation of serial_XXuart within the serial_pxa driver itself.

Also, remove the exports of serial_XXuart from include/serial.h as they are no longer needed. This is simply because the implementation of default_serial_console() is wrapped into the serial_pxa driver and the default console is picked by CONFIG_CONS_IDX macro in config file.

---
 common/serial.c             |   11 ++---------
 drivers/serial/serial_pxa.c |   13 +++++++++++++
 include/serial.h            |    4 ----
 3 files changed, 15 insertions(+), 13 deletions(-)
common/serial.c +2 -9
index b210b05..d457d23 100644
@@ -41,6 +41,7 @@ static void serial_null(void)
 		__attribute__((weak, alias("serial_null")));
 
 serial_initfunc(mpc8xx_serial_initialize);
+serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
@@ -75,15 +76,7 @@ void serial_initialize(void)
 	serial_register(&eserial4_device);
 #endif
 #endif /* CONFIG_SYS_NS16550_SERIAL */
-#if defined(CONFIG_FFUART)
-	serial_register(&serial_ffuart_device);
-#endif
-#if defined(CONFIG_BTUART)
-	serial_register(&serial_btuart_device);
-#endif
-#if defined(CONFIG_STUART)
-	serial_register(&serial_stuart_device);
-#endif
+	pxa_serial_initialize();
 	s3c24xx_serial_initialize();
 #if defined(CONFIG_S5P)
 	serial_register(&s5p_serial0_device);
drivers/serial/serial_pxa.c +13 -0
index bd3b3cf..46d7689 100644
@@ -314,4 +314,17 @@ __weak struct serial_device *default_serial_console(void)
 #error "Bad CONFIG_CONS_INDEX."
 #endif
 }
+
+void pxa_serial_initialize(void)
+{
+#if defined(CONFIG_FFUART)
+	serial_register(&serial_ffuart_device);
+#endif
+#if defined(CONFIG_BTUART)
+	serial_register(&serial_btuart_device);
+#endif
+#if defined(CONFIG_STUART)
+	serial_register(&serial_stuart_device);
+#endif
+}
 #endif
include/serial.h +0 -4
index 1da4ac4..8eff282 100644
@@ -71,10 +71,6 @@ extern struct serial_device zoom2_serial_device2;
 extern struct serial_device zoom2_serial_device3;
 #endif
 
-extern struct serial_device serial_ffuart_device;
-extern struct serial_device serial_btuart_device;
-extern struct serial_device serial_stuart_device;
-
 #if defined(CONFIG_SYS_BFIN_UART)
 extern void serial_register_bfin_uart(void);
 extern struct serial_device bfin_serial0_device;
Signature · 1 line
1.7.10.4
#228 lore raw

PATCH v3 12/72 serial: s5p: Move serial registration from serial_initialize()

In reply to Marek Vasut

Move the registration of s5p_serialN_device ports from default serial_initialize() into driver specific function called from serial_initialize(). This slims down the serial_initialize() call to a bare tracker of all possible serial port registration routines in U-Boot.

The newly implemented s5p_serial_initialize() function, which is implemented inside of the serial_s5p driver allows encapsulation of s5p_serialN_device within the serial_s5p driver itself.

Also, remove the exports of s5p_serialN_device from include/serial.h as they are no longer needed. This is simply because the implementation of default_serial_console() is wrapped into the serial_s5p driver and the default console is picked by CONFIG_SERIAL<N> macro in config file.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Minkyu Kang <[email protected]>
---
 common/serial.c             |    8 ++------
 drivers/serial/serial_s5p.c |    8 ++++++++
 include/serial.h            |    7 -------
 3 files changed, 10 insertions(+), 13 deletions(-)
common/serial.c +2 -6
index d457d23..c021c3f 100644
@@ -43,6 +43,7 @@ static void serial_null(void)
 serial_initfunc(mpc8xx_serial_initialize);
 serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
+serial_initfunc(s5p_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -78,12 +79,7 @@ void serial_initialize(void)
 #endif /* CONFIG_SYS_NS16550_SERIAL */
 	pxa_serial_initialize();
 	s3c24xx_serial_initialize();
-#if defined(CONFIG_S5P)
-	serial_register(&s5p_serial0_device);
-	serial_register(&s5p_serial1_device);
-	serial_register(&s5p_serial2_device);
-	serial_register(&s5p_serial3_device);
-#endif
+	s5p_serial_initialize();
 #if defined(CONFIG_MPC512X)
 #if defined(CONFIG_SYS_PSC1)
 	serial_register(&serial1_device);
drivers/serial/serial_s5p.c +8 -0
index 43cbc4f..3c41242 100644
@@ -221,3 +221,11 @@ __weak struct serial_device *default_serial_console(void)
 #error "CONFIG_SERIAL? missing."
 #endif
 }
+
+void s5p_serial_initialize(void)
+{
+	serial_register(&s5p_serial0_device);
+	serial_register(&s5p_serial1_device);
+	serial_register(&s5p_serial2_device);
+	serial_register(&s5p_serial3_device);
+}
include/serial.h +0 -7
index 8eff282..773eace 100644
@@ -57,13 +57,6 @@ extern struct serial_device uartlite_serial2_device;
 extern struct serial_device uartlite_serial3_device;
 #endif
 
-#if defined(CONFIG_S5P)
-extern struct serial_device s5p_serial0_device;
-extern struct serial_device s5p_serial1_device;
-extern struct serial_device s5p_serial2_device;
-extern struct serial_device s5p_serial3_device;
-#endif
-
 #if defined(CONFIG_OMAP3_ZOOM2)
 extern struct serial_device zoom2_serial_device0;
 extern struct serial_device zoom2_serial_device1;
Signature · 1 line
1.7.10.4
#229 lore raw

PATCH v3 13/72 serial: microblaze: Move serial registration from serial_initialize()

In reply to Marek Vasut

Move the registration of xuartlite_serialN_device ports from default serial_initialize() into driver specific function called from serial_initialize(). This slims down the serial_initialize() call to a bare tracker of all possible serial port registration routines in U-Boot.

The newly implemented xuartlite_serial_initialize() function, which is implemented inside of the serial_xuartlite driver allows encapsulation of xuartlite_serialN_device within the serial_xuartlite driver itself.

Also, remove the exports of xuartlite_serialN_device from include/serial.h as they are no longer needed. This is simply because the implementation of default_serial_console() is wrapped into the serial_xuartlite driver and the default console is picked by CONFIG_SERIAL<N> macro in config file.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Michal Simek <[email protected]>
---
 common/serial.c                   |   16 ++--------------
 drivers/serial/serial_xuartlite.c |   16 ++++++++++++++++
 include/serial.h                  |    7 -------
 3 files changed, 18 insertions(+), 21 deletions(-)
common/serial.c +2 -14
index c021c3f..e19a17f 100644
@@ -44,6 +44,7 @@ serial_initfunc(mpc8xx_serial_initialize);
 serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 serial_initfunc(s5p_serial_initialize);
+serial_initfunc(uartlite_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -97,20 +98,7 @@ 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 */
+	uartlite_serial_initialize();
 	serial_assign(default_serial_console()->name);
 }
 
drivers/serial/serial_xuartlite.c +16 -0
index b3bb066..164497e 100644
@@ -181,4 +181,20 @@ __weak struct serial_device *default_serial_console(void)
 
 	return NULL;
 }
+
+void uartlite_serial_initialize(void)
+{
+#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_SERIAL_MULTI */
include/serial.h +0 -7
index 773eace..51a044d 100644
@@ -50,13 +50,6 @@ 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_OMAP3_ZOOM2)
 extern struct serial_device zoom2_serial_device0;
 extern struct serial_device zoom2_serial_device1;
Signature · 1 line
1.7.10.4
#230 lore raw

PATCH v3 14/72 serial: mpc512x: Move serial registration from serial_initialize()

In reply to Marek Vasut

Move the registration of serialN_device ports from default serial_initialize() into driver specific function called from serial_initialize(). This slims down the serial_initialize() call to a bare tracker of all possible serial port registration routines in U-Boot.

The newly implemented mpc512x_serial_initialize() function, which is implemented inside of the mpc512x serial driver allows encapsulation of serialN_device within the mpc512x serial driver itself.

Also, remove the exports of serialN_device from include/serial.h as they are no longer needed. This is simply because the implementation of default_serial_console() is wrapped into the mpx512x serial driver and the default console is picked by CONFIG_SERIAL<N> macro in config file.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/mpc512x/serial.c |   16 ++++++++++++++++
 common/serial.c                   |   16 ++--------------
 include/serial.h                  |    7 -------
 3 files changed, 18 insertions(+), 21 deletions(-)
arch/powerpc/cpu/mpc512x/serial.c +16 -0
index f4f52ad..bc10c50 100644
@@ -365,6 +365,22 @@ __weak struct serial_device *default_serial_console(void)
 #endif
 }
 
+void mpc512x_serial_initialize(void)
+{
+#if defined(CONFIG_SYS_PSC1)
+	serial_register(&serial1_device);
+#endif
+#if defined(CONFIG_SYS_PSC3)
+	serial_register(&serial3_device);
+#endif
+#if defined(CONFIG_SYS_PSC4)
+	serial_register(&serial4_device);
+#endif
+#if defined(CONFIG_SYS_PSC6)
+	serial_register(&serial6_device);
+#endif
+}
+
 #else
 
 void serial_setbrg(void)
common/serial.c +2 -14
index e19a17f..08c6e2a 100644
@@ -44,6 +44,7 @@ serial_initfunc(mpc8xx_serial_initialize);
 serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 serial_initfunc(s5p_serial_initialize);
+serial_initfunc(mpc512x_serial_initialize);
 serial_initfunc(uartlite_serial_initialize);
 
 void serial_register(struct serial_device *dev)
@@ -81,20 +82,7 @@ void serial_initialize(void)
 	pxa_serial_initialize();
 	s3c24xx_serial_initialize();
 	s5p_serial_initialize();
-#if defined(CONFIG_MPC512X)
-#if defined(CONFIG_SYS_PSC1)
-	serial_register(&serial1_device);
-#endif
-#if defined(CONFIG_SYS_PSC3)
-	serial_register(&serial3_device);
-#endif
-#if defined(CONFIG_SYS_PSC4)
-	serial_register(&serial4_device);
-#endif
-#if defined(CONFIG_SYS_PSC6)
-	serial_register(&serial6_device);
-#endif
-#endif
+	mpc512x_serial_initialize();
 #if defined(CONFIG_SYS_BFIN_UART)
 	serial_register_bfin_uart();
 #endif
include/serial.h +0 -7
index 51a044d..71822c6 100644
@@ -43,13 +43,6 @@ extern struct serial_device eserial4_device;
 
 #endif
 
-#if defined(CONFIG_MPC512X)
-extern struct serial_device serial1_device;
-extern struct serial_device serial3_device;
-extern struct serial_device serial4_device;
-extern struct serial_device serial6_device;
-#endif
-
 #if defined(CONFIG_OMAP3_ZOOM2)
 extern struct serial_device zoom2_serial_device0;
 extern struct serial_device zoom2_serial_device1;
Signature · 1 line
1.7.10.4
#231 lore raw

PATCH v3 15/72 serial: ns16550: Move serial registration from serial_initialize()

In reply to Marek Vasut

Move the registration of eserialN_device ports from default serial_initialize() into driver specific function called from serial_initialize(). This slims down the serial_initialize() call to a bare tracker of all possible serial port registration routines in U-Boot.

The newly implemented ns16550_serial_initialize() function, which is implemented inside of the ns16550 serial driver allows encapsulation of eserialN_device within the ns16550 serial driver itself.

Also, remove the exports of eserialN_device from include/serial.h as they are no longer needed. This is simply because the implementation of default_serial_console() is wrapped into the ns16550 serial driver and the default console is picked by CONFIG_SERIAL<N> macro in config file.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Michal Simek <[email protected]>
---
 common/serial.c         |   16 ++--------------
 drivers/serial/serial.c |   16 ++++++++++++++++
 include/serial.h        |    8 ++------
 3 files changed, 20 insertions(+), 20 deletions(-)
common/serial.c +2 -14
index 08c6e2a..faad804 100644
@@ -41,6 +41,7 @@ static void serial_null(void)
 		__attribute__((weak, alias("serial_null")));
 
 serial_initfunc(mpc8xx_serial_initialize);
+serial_initfunc(ns16550_serial_initialize);
 serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 serial_initfunc(s5p_serial_initialize);
@@ -65,20 +66,7 @@ void serial_register(struct serial_device *dev)
 void serial_initialize(void)
 {
 	mpc8xx_serial_initialize();
-#if defined(CONFIG_SYS_NS16550_SERIAL)
-#if defined(CONFIG_SYS_NS16550_COM1)
-	serial_register(&eserial1_device);
-#endif
-#if defined(CONFIG_SYS_NS16550_COM2)
-	serial_register(&eserial2_device);
-#endif
-#if defined(CONFIG_SYS_NS16550_COM3)
-	serial_register(&eserial3_device);
-#endif
-#if defined(CONFIG_SYS_NS16550_COM4)
-	serial_register(&eserial4_device);
-#endif
-#endif /* CONFIG_SYS_NS16550_SERIAL */
+	ns16550_serial_initialize();
 	pxa_serial_initialize();
 	s3c24xx_serial_initialize();
 	s5p_serial_initialize();
drivers/serial/serial.c +16 -0
index 9d92dee..00ad97c 100644
@@ -340,4 +340,20 @@ __weak struct serial_device *default_serial_console(void)
 #endif
 }
 
+void ns16550_serial_initialize(void)
+{
+#if defined(CONFIG_SYS_NS16550_COM1)
+	serial_register(&eserial1_device);
+#endif
+#if defined(CONFIG_SYS_NS16550_COM2)
+	serial_register(&eserial2_device);
+#endif
+#if defined(CONFIG_SYS_NS16550_COM3)
+	serial_register(&eserial3_device);
+#endif
+#if defined(CONFIG_SYS_NS16550_COM4)
+	serial_register(&eserial4_device);
+#endif
+}
+
 #endif /* CONFIG_SERIAL_MULTI */
include/serial.h +2 -6
index 71822c6..b44fac2 100644
@@ -34,14 +34,10 @@ extern struct serial_device *default_serial_console(void);
 	defined(CONFIG_MICROBLAZE)
 extern struct serial_device serial0_device;
 extern struct serial_device serial1_device;
-#if defined(CONFIG_SYS_NS16550_SERIAL)
+#endif
+
 extern struct serial_device eserial1_device;
 extern struct serial_device eserial2_device;
-extern struct serial_device eserial3_device;
-extern struct serial_device eserial4_device;
-#endif /* CONFIG_SYS_NS16550_SERIAL */
-
-#endif
 
 #if defined(CONFIG_OMAP3_ZOOM2)
 extern struct serial_device zoom2_serial_device0;
Signature · 1 line
1.7.10.4
#232 lore raw

PATCH v3 16/72 serial: bfin: Remove the bfin_serialN_device exports from serial.h

In reply to Marek Vasut

Remove the exports from serial.h as they are only used in the blackfin serial driver. Furthermore, they are only used for registration, which is handled already inside that driver and default_serial_port() call, which is also handled in that driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 include/serial.h |    4 ----
 1 file changed, 4 deletions(-)
include/serial.h +0 -4
index b44fac2..00efe68 100644
@@ -48,10 +48,6 @@ extern struct serial_device zoom2_serial_device3;
 
 #if defined(CONFIG_SYS_BFIN_UART)
 extern void serial_register_bfin_uart(void);
-extern struct serial_device bfin_serial0_device;
-extern struct serial_device bfin_serial1_device;
-extern struct serial_device bfin_serial2_device;
-extern struct serial_device bfin_serial3_device;
 #endif
 
 extern void serial_register(struct serial_device *);
Signature · 1 line
1.7.10.4
#233 lore raw

PATCH v3 17/72 serial: bfin: Adjust serial_register_bfin_uart()

In reply to Marek Vasut

Rename the serial_register_bfin_uart() to bfin_initialize_serial() to be consistent with the rest of the naming. Next, remove it's prototype from serial.h and properly insert it into serial.c as the rest of the serial initialization functions.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 arch/blackfin/cpu/serial.c |    2 +-
 common/serial.c            |    5 ++---
 include/serial.h           |    4 ----
 3 files changed, 3 insertions(+), 8 deletions(-)
arch/blackfin/cpu/serial.c +1 -1
index 33677ba..64340ec 100644
@@ -272,7 +272,7 @@ __weak struct serial_device *default_serial_console(void)
 #endif
 }
 
-void serial_register_bfin_uart(void)
+void bfin_serial_initialize(void)
 {
 #ifdef UART0_DLL
 	serial_register(&bfin_serial0_device);
common/serial.c +2 -3
index faad804..0a43c1b 100644
@@ -45,6 +45,7 @@ serial_initfunc(ns16550_serial_initialize);
 serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 serial_initfunc(s5p_serial_initialize);
+serial_initfunc(bfin_serial_initialize);
 serial_initfunc(mpc512x_serial_initialize);
 serial_initfunc(uartlite_serial_initialize);
 
@@ -71,9 +72,7 @@ void serial_initialize(void)
 	s3c24xx_serial_initialize();
 	s5p_serial_initialize();
 	mpc512x_serial_initialize();
-#if defined(CONFIG_SYS_BFIN_UART)
-	serial_register_bfin_uart();
-#endif
+	bfin_serial_initialize();
 	uartlite_serial_initialize();
 	serial_assign(default_serial_console()->name);
 }
include/serial.h +0 -4
index 00efe68..5f9899e 100644
@@ -46,10 +46,6 @@ extern struct serial_device zoom2_serial_device2;
 extern struct serial_device zoom2_serial_device3;
 #endif
 
-#if defined(CONFIG_SYS_BFIN_UART)
-extern void serial_register_bfin_uart(void);
-#endif
-
 extern void serial_register(struct serial_device *);
 extern void serial_initialize(void);
 extern void serial_stdio_init(void);
Signature · 1 line
1.7.10.4
#234 lore raw

PATCH v3 18/72 serial: zoom2: Remove zoom2 serial prototypes from serial.h

In reply to Marek Vasut

Remove the prototypes for zoom2_serial_deviceN from serial.h . This can't be done right away, as they are referenced from the zoom2 config file. Therefore, adjust the code so the config file only specifies number of the port. Then, replace the simple return in default_serial_console() with a switch across possible values, which returns the zoom2_serial_deviceN . With such adjustment in place, the exported prototypes in serial.h can be safely removed.

---
 board/logicpd/zoom2/zoom2_serial.c |    7 ++++++-
 include/configs/omap3_zoom2.h      |    2 +-
 include/serial.h                   |    7 -------
 3 files changed, 7 insertions(+), 9 deletions(-)
board/logicpd/zoom2/zoom2_serial.c +6 -1
index 74f165f..9b7aea8 100644
@@ -135,5 +135,10 @@ QUAD_INIT (3)
 
 struct serial_device *default_serial_console(void)
 {
-	return ZOOM2_DEFAULT_SERIAL_DEVICE;
+	switch (ZOOM2_DEFAULT_SERIAL_DEVICE) {
+	case 0: return &zoom2_serial_device0;
+	case 1: return &zoom2_serial_device1;
+	case 2: return &zoom2_serial_device2;
+	case 3: return &zoom2_serial_device3;
+	}
 }
include/configs/omap3_zoom2.h +1 -1
index 4447dff..a7cc5fc 100644
@@ -81,7 +81,7 @@
  * 0 - 1 : first  USB with respect to the left edge of the debug board
  * 2 - 3 : second USB with respect to the left edge of the debug board
  */
-#define ZOOM2_DEFAULT_SERIAL_DEVICE	(&zoom2_serial_device0)
+#define ZOOM2_DEFAULT_SERIAL_DEVICE	0
 
 #define V_NS16550_CLK			(1843200)	/* 1.8432 Mhz */
 
include/serial.h +0 -7
index 5f9899e..01a86b4 100644
@@ -39,13 +39,6 @@ extern struct serial_device serial1_device;
 extern struct serial_device eserial1_device;
 extern struct serial_device eserial2_device;
 
-#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
-
 extern void serial_register(struct serial_device *);
 extern void serial_initialize(void);
 extern void serial_stdio_init(void);
Signature · 1 line
1.7.10.4
#235 lore raw

PATCH v3 19/72 serial: bfin: Flip the jtag serial console to CONFIG_SERIAL_MULTI

In reply to Marek Vasut

Rework the emulation of serial console via JTAG from simple ad-hoc implementation of serial port routines to CONFIG_SERIAL_MULTI and enable CONFIG_SERIAL_MULTI unconditionally for blackfin.

In order for the JTAG serial console to take precedence over all other serial ports available in system, implement override for default_serial_console call returning this JTAG serial console.

This brings in a bit of a growth of size, but eventually will allow us to unconditionally enable CONFIG_SERIAL_MULTI throughout the whole U-Boot and maintain only one serial subsystem.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 arch/blackfin/cpu/jtag-console.c  |   37 ++++++++++++++++++++++++++++++-------
 common/serial.c                   |    2 ++
 include/configs/bfin_adi_common.h |    2 +-
 3 files changed, 33 insertions(+), 8 deletions(-)
arch/blackfin/cpu/jtag-console.c +30 -7
index a77358a..7cddb85 100644
@@ -194,12 +194,35 @@ int drv_jtag_console_init(void)
 }
 
 #ifdef CONFIG_UART_CONSOLE_IS_JTAG
+#include <serial.h>
 /* Since the JTAG is always available (at power on), allow it to fake a UART */
-void serial_set_baud(uint32_t baud) {}
-void serial_setbrg(void)            {}
-int serial_init(void)               { return 0; }
-void serial_putc(const char c)      __attribute__((alias("jtag_putc")));
-void serial_puts(const char *s)     __attribute__((alias("jtag_puts")));
-int serial_tstc(void)               __attribute__((alias("jtag_tstc")));
-int serial_getc(void)               __attribute__((alias("jtag_getc")));
+void jtag_serial_setbrg(void)
+{
+}
+
+int jtag_serial_init(void)
+{
+	return 0;
+}
+
+static struct serial_device serial_jtag_drv = {
+	.name	= "jtag",
+	.start	= jtag_serial_init,
+	.stop	= NULL,
+	.setbrg	= jtag_serial_setbrg,
+	.putc	= jtag_putc,
+	.puts	= jtag_puts,
+	.tstc	= jtag_tstc,
+	.getc	= jtag_getc,
+};
+
+void bfin_jtag_initialize(void)
+{
+	serial_register(&serial_jtag_drv);
+}
+
+struct serial_device *default_serial_console(void)
+{
+	return &serial_jtag_drv;
+}
 #endif
common/serial.c +2 -0
index 0a43c1b..25aeea0 100644
@@ -46,6 +46,7 @@ serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 serial_initfunc(s5p_serial_initialize);
 serial_initfunc(bfin_serial_initialize);
+serial_initfunc(bfin_jtag_initialize);
 serial_initfunc(mpc512x_serial_initialize);
 serial_initfunc(uartlite_serial_initialize);
 
@@ -73,6 +74,7 @@ void serial_initialize(void)
 	s5p_serial_initialize();
 	mpc512x_serial_initialize();
 	bfin_serial_initialize();
+	bfin_jtag_initialize();
 	uartlite_serial_initialize();
 	serial_assign(default_serial_console()->name);
 }
include/configs/bfin_adi_common.h +1 -1
index 3fbf5c6..7132f8f 100644
@@ -108,11 +108,11 @@
 #define CONFIG_LOADS_ECHO	1
 #define CONFIG_JTAG_CONSOLE
 #define CONFIG_SILENT_CONSOLE
+#define CONFIG_SERIAL_MULTI
 #ifndef CONFIG_BAUDRATE
 # define CONFIG_BAUDRATE	57600
 #endif
 #ifndef CONFIG_DEBUG_EARLY_SERIAL
-# define CONFIG_SERIAL_MULTI
 # define CONFIG_SYS_BFIN_UART
 #endif
 
Signature · 1 line
1.7.10.4
#236 lore raw

PATCH v3 20/72 serial: mips: Implement CONFIG_SERIAL_MULTI into au1x00 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into au1x00 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the au1x00 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Daniel Schwierzeck <[email protected]>
---
 arch/mips/cpu/mips32/au1x00/au1x00_serial.c |   74 +++++++++++++++++++++++----
 common/serial.c                             |    3 ++
 2 files changed, 67 insertions(+), 10 deletions(-)
arch/mips/cpu/mips32/au1x00/au1x00_serial.c +64 -10
index c25ba5a..9682775 100644
@@ -28,6 +28,8 @@
 #include <config.h>
 #include <common.h>
 #include <asm/au1x00.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 /******************************************************************************
 *
@@ -40,7 +42,7 @@
 * RETURNS: N/A
 */
 
-int serial_init (void)
+static int au1x00_serial_init(void)
 {
 	volatile u32 *uart_fifoctl = (volatile u32*)(UART0_ADDR+UART_FCR);
 	volatile u32 *uart_enable = (volatile u32*)(UART0_ADDR+UART_ENABLE);
@@ -63,7 +65,7 @@ int serial_init (void)
 }
 
 
-void serial_setbrg (void)
+static void au1x00_serial_setbrg(void)
 {
 	volatile u32 *uart_clk = (volatile u32*)(UART0_ADDR+UART_CLK);
 	volatile u32 *uart_lcr = (volatile u32*)(UART0_ADDR+UART_LCR);
@@ -87,12 +89,13 @@ void serial_setbrg (void)
 	*uart_lcr = UART_LCR_WLEN8;
 }
 
-void serial_putc (const char c)
+static void au1x00_serial_putc(const char c)
 {
 	volatile u32 *uart_lsr = (volatile u32*)(UART0_ADDR+UART_LSR);
 	volatile u32 *uart_tx = (volatile u32*)(UART0_ADDR+UART_TX);
 
-	if (c == '\n') serial_putc ('\r');
+	if (c == '\n')
+		au1x00_serial_putc('\r');
 
 	/* Wait for fifo to shift out some bytes */
 	while((*uart_lsr&UART_LSR_THRE)==0);
@@ -100,15 +103,13 @@ void serial_putc (const char c)
 	*uart_tx = (u32)c;
 }
 
-void serial_puts (const char *s)
+static void au1x00_serial_puts(const char *s)
 {
 	while (*s)
-	{
-		serial_putc (*s++);
-	}
+		serial_putc(*s++);
 }
 
-int serial_getc (void)
+static int au1x00_serial_getc(void)
 {
 	volatile u32 *uart_rx = (volatile u32*)(UART0_ADDR+UART_RX);
 	char c;
@@ -119,7 +120,7 @@ int serial_getc (void)
 	return c;
 }
 
-int serial_tstc (void)
+static int au1x00_serial_tstc(void)
 {
 	volatile u32 *uart_lsr = (volatile u32*)(UART0_ADDR+UART_LSR);
 
@@ -129,3 +130,56 @@ int serial_tstc (void)
 	}
 	return 0;
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device au1x00_serial_drv = {
+	.name	= "au1x00_serial",
+	.start	= au1x00_serial_init,
+	.stop	= NULL,
+	.setbrg	= au1x00_serial_setbrg,
+	.putc	= au1x00_serial_putc,
+	.puts	= au1x00_serial_puts,
+	.getc	= au1x00_serial_getc,
+	.tstc	= au1x00_serial_tstc,
+};
+
+void au1x00_serial_initialize(void)
+{
+	serial_register(&au1x00_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &au1x00_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return au1x00_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	au1x00_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	au1x00_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	au1x00_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return au1x00_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return au1x00_serial_tstc();
+}
+#endif
common/serial.c +3 -0
index 25aeea0..6ddc5fa 100644
@@ -49,6 +49,7 @@ serial_initfunc(bfin_serial_initialize);
 serial_initfunc(bfin_jtag_initialize);
 serial_initfunc(mpc512x_serial_initialize);
 serial_initfunc(uartlite_serial_initialize);
+serial_initfunc(au1x00_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -76,6 +77,8 @@ void serial_initialize(void)
 	bfin_serial_initialize();
 	bfin_jtag_initialize();
 	uartlite_serial_initialize();
+	au1x00_serial_initialize();
+
 	serial_assign(default_serial_console()->name);
 }
 
Signature · 1 line
1.7.10.4
#237 lore raw

PATCH v3 21/72 serial: mips: Implement CONFIG_SERIAL_MULTI into asc serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into asc serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the asc driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Daniel Schwierzeck <[email protected]>
---
 arch/mips/cpu/mips32/incaip/asc_serial.c |   67 +++++++++++++++++++++++++++---
 common/serial.c                          |    2 +
 2 files changed, 63 insertions(+), 6 deletions(-)
arch/mips/cpu/mips32/incaip/asc_serial.c +61 -6
index 7239804..b5f32e2 100644
@@ -5,6 +5,8 @@
 #include <config.h>
 #include <common.h>
 #include <asm/inca-ip.h>
+#include <serial.h>
+#include <linux/compiler.h>
 #include "asc_serial.h"
 
 
@@ -32,7 +34,7 @@ static volatile incaAsc_t *pAsc = (incaAsc_t *)INCA_IP_ASC;
 * RETURNS: N/A
 */
 
-int serial_init (void)
+static int asc_serial_init(void)
 {
     /* we have to set PMU.EN13 bit to enable an ASC device*/
     INCAASC_PMU_ENABLE(13);
@@ -82,7 +84,7 @@ int serial_init (void)
     return 0;
 }
 
-void serial_setbrg (void)
+static void asc_serial_setbrg(void)
 {
     ulong      uiReloadValue, fdv;
     ulong      f_ASC;
@@ -210,7 +212,7 @@ static int serial_setopt (void)
     return 0;
 }
 
-void serial_putc (const char c)
+static void asc_serial_putc(const char c)
 {
     uint txFl = 0;
 
@@ -234,7 +236,7 @@ void serial_putc (const char c)
     }
 }
 
-void serial_puts (const char *s)
+static void asc_serial_puts(const char *s)
 {
     while (*s)
     {
@@ -242,7 +244,7 @@ void serial_puts (const char *s)
     }
 }
 
-int serial_getc (void)
+static int asc_serial_getc(void)
 {
     ulong symbol_mask;
     char c;
@@ -257,7 +259,7 @@ int serial_getc (void)
     return c;
 }
 
-int serial_tstc (void)
+static int asc_serial_tstc(void)
 {
     int res = 1;
 
@@ -283,3 +285,56 @@ int serial_tstc (void)
 
     return res;
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device asc_serial_drv = {
+	.name	= "asc_serial",
+	.start	= asc_serial_init,
+	.stop	= NULL,
+	.setbrg	= asc_serial_setbrg,
+	.putc	= asc_serial_putc,
+	.puts	= asc_serial_puts,
+	.getc	= asc_serial_getc,
+	.tstc	= asc_serial_tstc,
+};
+
+void asc_serial_initialize(void)
+{
+	serial_register(&asc_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &asc_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return asc_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	asc_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	asc_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	asc_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return asc_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return asc_serial_tstc();
+}
+#endif
common/serial.c +2 -0
index 6ddc5fa..d6e83f8 100644
@@ -50,6 +50,7 @@ serial_initfunc(bfin_jtag_initialize);
 serial_initfunc(mpc512x_serial_initialize);
 serial_initfunc(uartlite_serial_initialize);
 serial_initfunc(au1x00_serial_initialize);
+serial_initfunc(asc_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -78,6 +79,7 @@ void serial_initialize(void)
 	bfin_jtag_initialize();
 	uartlite_serial_initialize();
 	au1x00_serial_initialize();
+	asc_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#238 lore raw

PATCH v3 22/72 serial: mips: Implement CONFIG_SERIAL_MULTI into JZ serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into JZ serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the JZ driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Daniel Schwierzeck <[email protected]>
---
 arch/mips/cpu/xburst/jz_serial.c |   67 ++++++++++++++++++++++++++++++++++----
 common/serial.c                  |    2 ++
 2 files changed, 63 insertions(+), 6 deletions(-)
arch/mips/cpu/xburst/jz_serial.c +61 -6
index e6c48e0..b1e1d27 100644
@@ -23,6 +23,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/jz4740.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 /*
  * serial_init - initialize a channel
@@ -35,7 +37,7 @@
  */
 struct jz4740_uart *uart = (struct jz4740_uart *)CONFIG_SYS_UART_BASE;
 
-int serial_init(void)
+static int jz_serial_init(void)
 {
 	/* Disable port interrupts while changing hardware */
 	writeb(0, &uart->dlhr_ier);
@@ -62,7 +64,7 @@ int serial_init(void)
 	return 0;
 }
 
-void serial_setbrg(void)
+static void jz_serial_setbrg(void)
 {
 	u32 baud_div, tmp;
 
@@ -79,7 +81,7 @@ void serial_setbrg(void)
 	writeb(tmp, &uart->lcr);
 }
 
-int serial_tstc(void)
+static int jz_serial_tstc(void)
 {
 	if (readb(&uart->lsr) & UART_LSR_DR)
 		return 1;
@@ -87,7 +89,7 @@ int serial_tstc(void)
 	return 0;
 }
 
-void serial_putc(const char c)
+static void jz_serial_putc(const char c)
 {
 	if (c == '\n')
 		serial_putc('\r');
@@ -99,7 +101,7 @@ void serial_putc(const char c)
 	writeb((u8)c, &uart->rbr_thr_dllr);
 }
 
-int serial_getc(void)
+static int jz_serial_getc(void)
 {
 	while (!serial_tstc())
 		;
@@ -107,8 +109,61 @@ int serial_getc(void)
 	return readb(&uart->rbr_thr_dllr);
 }
 
-void serial_puts(const char *s)
+static void jz_serial_puts(const char *s)
 {
 	while (*s)
 		serial_putc(*s++);
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device jz_serial_drv = {
+	.name	= "jz_serial",
+	.start	= jz_serial_init,
+	.stop	= NULL,
+	.setbrg	= jz_serial_setbrg,
+	.putc	= jz_serial_putc,
+	.puts	= jz_serial_puts,
+	.getc	= jz_serial_getc,
+	.tstc	= jz_serial_tstc,
+};
+
+void jz_serial_initialize(void)
+{
+	serial_register(&jz_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &jz_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return jz_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	jz_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	jz_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	jz_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return jz_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return jz_serial_tstc();
+}
+#endif
common/serial.c +2 -0
index d6e83f8..dd35a62 100644
@@ -51,6 +51,7 @@ serial_initfunc(mpc512x_serial_initialize);
 serial_initfunc(uartlite_serial_initialize);
 serial_initfunc(au1x00_serial_initialize);
 serial_initfunc(asc_serial_initialize);
+serial_initfunc(jz_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -80,6 +81,7 @@ void serial_initialize(void)
 	uartlite_serial_initialize();
 	au1x00_serial_initialize();
 	asc_serial_initialize();
+	jz_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#239 lore raw

PATCH v3 23/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc5xx serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into mpc5xx serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the mpc5xx driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/mpc5xx/serial.c |   95 +++++++++++++++++++++++++++++---------
 common/serial.c                  |    2 +
 2 files changed, 76 insertions(+), 21 deletions(-)
arch/powerpc/cpu/mpc5xx/serial.c +74 -21
index 88c6db8..dbaacfc 100644
@@ -33,20 +33,40 @@
 #include <watchdog.h>
 #include <command.h>
 #include <mpc5xx.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
- * Local function prototypes
+ * Local functions
  */
 
-static int ready_to_send(void);
+static int ready_to_send(void)
+{
+	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+	volatile short status;
+
+	do {
+#if defined(CONFIG_5xx_CONS_SCI1)
+		status = immr->im_qsmcm.qsmcm_sc1sr;
+#else
+		status = immr->im_qsmcm.qsmcm_sc2sr;
+#endif
+
+#if defined(CONFIG_WATCHDOG)
+		reset_5xx_watchdog (immr);
+#endif
+	} while ((status & SCI_TDRE) == 0);
+	return 1;
+
+}
 
 /*
  * Minimal global serial functions needed to use one of the SCI modules.
  */
 
-int serial_init (void)
+static int mpc5xx_serial_init(void)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 
@@ -63,7 +83,7 @@ int serial_init (void)
 	return 0;
 }
 
-void serial_putc(const char c)
+static void mpc5xx_serial_putc(const char c)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 
@@ -85,7 +105,7 @@ void serial_putc(const char c)
 	}
 }
 
-int serial_getc(void)
+static int mpc5xx_serial_getc(void)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	volatile short status;
@@ -113,7 +133,7 @@ int serial_getc(void)
 	return	tmp;
 }
 
-int serial_tstc()
+static int mpc5xx_serial_tstc()
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	short status;
@@ -127,7 +147,7 @@ int serial_tstc()
 	return (status & SCI_RDRF);
 }
 
-void serial_setbrg (void)
+static void mpc5xx_serial_setbrg(void)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	short scxbr;
@@ -141,7 +161,7 @@ void serial_setbrg (void)
 #endif
 }
 
-void serial_puts (const char *s)
+static void mpc5xx_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc(*s);
@@ -149,22 +169,55 @@ void serial_puts (const char *s)
 	}
 }
 
-int ready_to_send(void)
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device mpc5xx_serial_drv = {
+	.name	= "mpc5xx_serial",
+	.start	= mpc5xx_serial_init,
+	.stop	= NULL,
+	.setbrg	= mpc5xx_serial_setbrg,
+	.putc	= mpc5xx_serial_putc,
+	.puts	= mpc5xx_serial_puts,
+	.getc	= mpc5xx_serial_getc,
+	.tstc	= mpc5xx_serial_tstc,
+};
+
+void mpc5xx_serial_initialize(void)
 {
-	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
-	volatile short status;
+	serial_register(&mpc5xx_serial_drv);
+}
 
-	do {
-#if defined(CONFIG_5xx_CONS_SCI1)
-		status = immr->im_qsmcm.qsmcm_sc1sr;
+__weak struct serial_device *default_serial_console(void)
+{
+	return &mpc5xx_serial_drv;
+}
 #else
-		status = immr->im_qsmcm.qsmcm_sc2sr;
-#endif
+int serial_init(void)
+{
+	return mpc5xx_serial_init();
+}
 
-#if defined(CONFIG_WATCHDOG)
-		reset_5xx_watchdog (immr);
-#endif
-	} while ((status & SCI_TDRE) == 0);
-	return 1;
+void serial_setbrg(void)
+{
+	mpc5xx_serial_setbrg();
+}
 
+void serial_putc(const char c)
+{
+	mpc5xx_serial_putc(c);
 }
+
+void serial_puts(const char *s)
+{
+	mpc5xx_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return mpc5xx_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return mpc5xx_serial_tstc();
+}
+#endif
common/serial.c +2 -0
index dd35a62..69fa583 100644
@@ -52,6 +52,7 @@ serial_initfunc(uartlite_serial_initialize);
 serial_initfunc(au1x00_serial_initialize);
 serial_initfunc(asc_serial_initialize);
 serial_initfunc(jz_serial_initialize);
+serial_initfunc(mpc5xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -82,6 +83,7 @@ void serial_initialize(void)
 	au1x00_serial_initialize();
 	asc_serial_initialize();
 	jz_serial_initialize();
+	mpc5xx_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#240 lore raw

PATCH v2 23/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc5xx serial driver

Implement support for CONFIG_SERIAL_MULTI into mpc5xx serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the mpc5xx driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/mpc5xx/serial.c |   95 +++++++++++++++++++++++++++++---------
 common/serial.c                  |    2 +
 2 files changed, 76 insertions(+), 21 deletions(-)

V2: Fix compiler warning

arch/powerpc/cpu/mpc5xx/serial.c +74 -21
index 88c6db8..a4fd6bc 100644
@@ -33,20 +33,40 @@
 #include <watchdog.h>
 #include <command.h>
 #include <mpc5xx.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
- * Local function prototypes
+ * Local functions
  */
 
-static int ready_to_send(void);
+static int ready_to_send(void)
+{
+	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+	volatile short status;
+
+	do {
+#if defined(CONFIG_5xx_CONS_SCI1)
+		status = immr->im_qsmcm.qsmcm_sc1sr;
+#else
+		status = immr->im_qsmcm.qsmcm_sc2sr;
+#endif
+
+#if defined(CONFIG_WATCHDOG)
+		reset_5xx_watchdog (immr);
+#endif
+	} while ((status & SCI_TDRE) == 0);
+	return 1;
+
+}
 
 /*
  * Minimal global serial functions needed to use one of the SCI modules.
  */
 
-int serial_init (void)
+static int mpc5xx_serial_init(void)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 
@@ -63,7 +83,7 @@ int serial_init (void)
 	return 0;
 }
 
-void serial_putc(const char c)
+static void mpc5xx_serial_putc(const char c)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 
@@ -85,7 +105,7 @@ void serial_putc(const char c)
 	}
 }
 
-int serial_getc(void)
+static int mpc5xx_serial_getc(void)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	volatile short status;
@@ -113,7 +133,7 @@ int serial_getc(void)
 	return	tmp;
 }
 
-int serial_tstc()
+static int mpc5xx_serial_tstc(void)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	short status;
@@ -127,7 +147,7 @@ int serial_tstc()
 	return (status & SCI_RDRF);
 }
 
-void serial_setbrg (void)
+static void mpc5xx_serial_setbrg(void)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	short scxbr;
@@ -141,7 +161,7 @@ void serial_setbrg (void)
 #endif
 }
 
-void serial_puts (const char *s)
+static void mpc5xx_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc(*s);
@@ -149,22 +169,55 @@ void serial_puts (const char *s)
 	}
 }
 
-int ready_to_send(void)
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device mpc5xx_serial_drv = {
+	.name	= "mpc5xx_serial",
+	.start	= mpc5xx_serial_init,
+	.stop	= NULL,
+	.setbrg	= mpc5xx_serial_setbrg,
+	.putc	= mpc5xx_serial_putc,
+	.puts	= mpc5xx_serial_puts,
+	.getc	= mpc5xx_serial_getc,
+	.tstc	= mpc5xx_serial_tstc,
+};
+
+void mpc5xx_serial_initialize(void)
 {
-	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
-	volatile short status;
+	serial_register(&mpc5xx_serial_drv);
+}
 
-	do {
-#if defined(CONFIG_5xx_CONS_SCI1)
-		status = immr->im_qsmcm.qsmcm_sc1sr;
+__weak struct serial_device *default_serial_console(void)
+{
+	return &mpc5xx_serial_drv;
+}
 #else
-		status = immr->im_qsmcm.qsmcm_sc2sr;
-#endif
+int serial_init(void)
+{
+	return mpc5xx_serial_init();
+}
 
-#if defined(CONFIG_WATCHDOG)
-		reset_5xx_watchdog (immr);
-#endif
-	} while ((status & SCI_TDRE) == 0);
-	return 1;
+void serial_setbrg(void)
+{
+	mpc5xx_serial_setbrg();
+}
 
+void serial_putc(const char c)
+{
+	mpc5xx_serial_putc(c);
 }
+
+void serial_puts(const char *s)
+{
+	mpc5xx_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return mpc5xx_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return mpc5xx_serial_tstc();
+}
+#endif
common/serial.c +2 -0
index dd35a62..69fa583 100644
@@ -52,6 +52,7 @@ serial_initfunc(uartlite_serial_initialize);
 serial_initfunc(au1x00_serial_initialize);
 serial_initfunc(asc_serial_initialize);
 serial_initfunc(jz_serial_initialize);
+serial_initfunc(mpc5xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -82,6 +83,7 @@ void serial_initialize(void)
 	au1x00_serial_initialize();
 	asc_serial_initialize();
 	jz_serial_initialize();
+	mpc5xx_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#241 lore raw

PATCH v3 24/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8220 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into mpc8220 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the mpc8220 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/mpc8220/uart.c |   67 +++++++++++++++++++++++++++++++++++----
 common/serial.c                 |    2 ++
 2 files changed, 63 insertions(+), 6 deletions(-)
arch/powerpc/cpu/mpc8220/uart.c +61 -6
index 0c4b536..545c81a 100644
@@ -29,13 +29,15 @@
 
 #include <common.h>
 #include <mpc8220.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 #define PSC_BASE   MMAP_PSC1
 
 #if defined(CONFIG_PSC_CONSOLE)
-int serial_init (void)
+static int mpc8220_serial_init(void)
 {
 	volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
 	u32 counter;
@@ -69,7 +71,7 @@ int serial_init (void)
 	return (0);
 }
 
-void serial_putc (const char c)
+static void mpc8220_serial_putc(const char c)
 {
 	volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
 
@@ -82,14 +84,14 @@ void serial_putc (const char c)
 	psc->xmitbuf[0] = c;
 }
 
-void serial_puts (const char *s)
+static void mpc8220_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
-int serial_getc (void)
+static int mpc8220_serial_getc(void)
 {
 	volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
 
@@ -98,14 +100,14 @@ int serial_getc (void)
 	return psc->xmitbuf[2];
 }
 
-int serial_tstc (void)
+static int mpc8220_serial_tstc(void)
 {
 	volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
 
 	return (psc->sr_csr & PSC_SR_RXRDY);
 }
 
-void serial_setbrg (void)
+static void mpc8220_serial_setbrg(void)
 {
 	volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
 	u32 counter;
@@ -123,4 +125,57 @@ void serial_setbrg (void)
 
 	psc->cr = PSC_CR_RX_ENABLE | PSC_CR_TX_ENABLE;
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device mpc8220_serial_drv = {
+	.name	= "mpc8220_serial",
+	.start	= mpc8220_serial_init,
+	.stop	= NULL,
+	.setbrg	= mpc8220_serial_setbrg,
+	.putc	= mpc8220_serial_putc,
+	.puts	= mpc8220_serial_puts,
+	.getc	= mpc8220_serial_getc,
+	.tstc	= mpc8220_serial_tstc,
+};
+
+void mpc8220_serial_initialize(void)
+{
+	serial_register(&mpc8220_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &mpc8220_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return mpc8220_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	mpc8220_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	mpc8220_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	mpc8220_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return mpc8220_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return mpc8220_serial_tstc();
+}
+#endif
 #endif /* CONFIG_PSC_CONSOLE */
common/serial.c +2 -0
index 69fa583..db06f97 100644
@@ -53,6 +53,7 @@ serial_initfunc(au1x00_serial_initialize);
 serial_initfunc(asc_serial_initialize);
 serial_initfunc(jz_serial_initialize);
 serial_initfunc(mpc5xx_serial_initialize);
+serial_initfunc(mpc8220_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -84,6 +85,7 @@ void serial_initialize(void)
 	asc_serial_initialize();
 	jz_serial_initialize();
 	mpc5xx_serial_initialize();
+	mpc8220_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#242 lore raw

PATCH v3 25/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8260 serial drivers

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into both SCC and SMC mpc8260 serial drivers. These drivers were so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the mpc8260 drivers. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/mpc8260/serial_scc.c |   71 ++++++++++++++++++++++++++++-----
 arch/powerpc/cpu/mpc8260/serial_smc.c |   71 ++++++++++++++++++++++++++++-----
 common/serial.c                       |    4 ++
 3 files changed, 124 insertions(+), 22 deletions(-)
arch/powerpc/cpu/mpc8260/serial_scc.c +60 -11
index 4ab6a28..cfbcd79 100644
@@ -31,6 +31,8 @@
 #include <common.h>
 #include <mpc8260.h>
 #include <asm/cpm_8260.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -82,7 +84,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #endif
 
-int serial_init (void)
+static int mpc8260_scc_serial_init(void)
 {
 	volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
 	volatile scc_t *sp;
@@ -180,8 +182,7 @@ int serial_init (void)
 	return (0);
 }
 
-void
-serial_setbrg (void)
+static void mpc8260_scc_serial_setbrg(void)
 {
 #if defined(CONFIG_CONS_USE_EXTC)
 	m8260_cpm_extcbrg(SCC_INDEX, gd->baudrate,
@@ -191,8 +192,7 @@ serial_setbrg (void)
 #endif
 }
 
-void
-serial_putc(const char c)
+static void mpc8260_scc_serial_putc(const char c)
 {
 	volatile scc_uart_t	*up;
 	volatile cbd_t		*tbdf;
@@ -217,16 +217,14 @@ serial_putc(const char c)
 	tbdf->cbd_sc |= BD_SC_READY;
 }
 
-void
-serial_puts (const char *s)
+static void mpc8260_scc_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
-int
-serial_getc(void)
+static int mpc8260_scc_serial_getc(void)
 {
 	volatile cbd_t		*rbdf;
 	volatile scc_uart_t	*up;
@@ -250,8 +248,7 @@ serial_getc(void)
 	return (c);
 }
 
-int
-serial_tstc()
+static int mpc8260_scc_serial_tstc(void)
 {
 	volatile cbd_t		*rbdf;
 	volatile scc_uart_t	*up;
@@ -264,6 +261,58 @@ serial_tstc()
 	return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device mpc8260_scc_serial_drv = {
+	.name	= "mpc8260_scc_serial",
+	.start	= mpc8260_scc_serial_init,
+	.stop	= NULL,
+	.setbrg	= mpc8260_scc_serial_setbrg,
+	.putc	= mpc8260_scc_serial_putc,
+	.puts	= mpc8260_scc_serial_puts,
+	.getc	= mpc8260_scc_serial_getc,
+	.tstc	= mpc8260_scc_serial_tstc,
+};
+
+void mpc8260_scc_serial_initialize(void)
+{
+	serial_register(&mpc8260_scc_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &mpc8260_scc_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return mpc8260_scc_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	mpc8260_scc_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	mpc8260_scc_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	mpc8260_scc_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return mpc8260_scc_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return mpc8260_scc_serial_tstc();
+}
+#endif
 #endif	/* CONFIG_CONS_ON_SCC */
 
 #if defined(CONFIG_KGDB_ON_SCC)
arch/powerpc/cpu/mpc8260/serial_smc.c +60 -11

119 lines not on this page · raw message

common/serial.c +4 -0
index db06f97..5c8cbdd 100644
@@ -54,6 +54,8 @@ serial_initfunc(asc_serial_initialize);
 serial_initfunc(jz_serial_initialize);
 serial_initfunc(mpc5xx_serial_initialize);
 serial_initfunc(mpc8220_serial_initialize);
+serial_initfunc(mpc8260_scc_serial_initialize);
+serial_initfunc(mpc8260_smc_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -86,6 +88,8 @@ void serial_initialize(void)
 	jz_serial_initialize();
 	mpc5xx_serial_initialize();
 	mpc8220_serial_initialize();
+	mpc8260_scc_serial_initialize();
+	mpc8260_smc_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#243 lore raw

PATCH v2 25/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8260 serial drivers

Implement support for CONFIG_SERIAL_MULTI into both SCC and SMC mpc8260 serial drivers. These drivers were so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the mpc8260 drivers. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/mpc8260/serial_scc.c |   71 ++++++++++++++++++++++++++++-----
 arch/powerpc/cpu/mpc8260/serial_smc.c |   71 ++++++++++++++++++++++++++++-----
 common/serial.c                       |    4 ++
 3 files changed, 124 insertions(+), 22 deletions(-)

V2: Fix driver name too long problem

arch/powerpc/cpu/mpc8260/serial_scc.c +60 -11
index 4ab6a28..7bfd420 100644
@@ -31,6 +31,8 @@
 #include <common.h>
 #include <mpc8260.h>
 #include <asm/cpm_8260.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -82,7 +84,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #endif
 
-int serial_init (void)
+static int mpc8260_scc_serial_init(void)
 {
 	volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
 	volatile scc_t *sp;
@@ -180,8 +182,7 @@ int serial_init (void)
 	return (0);
 }
 
-void
-serial_setbrg (void)
+static void mpc8260_scc_serial_setbrg(void)
 {
 #if defined(CONFIG_CONS_USE_EXTC)
 	m8260_cpm_extcbrg(SCC_INDEX, gd->baudrate,
@@ -191,8 +192,7 @@ serial_setbrg (void)
 #endif
 }
 
-void
-serial_putc(const char c)
+static void mpc8260_scc_serial_putc(const char c)
 {
 	volatile scc_uart_t	*up;
 	volatile cbd_t		*tbdf;
@@ -217,16 +217,14 @@ serial_putc(const char c)
 	tbdf->cbd_sc |= BD_SC_READY;
 }
 
-void
-serial_puts (const char *s)
+static void mpc8260_scc_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
-int
-serial_getc(void)
+static int mpc8260_scc_serial_getc(void)
 {
 	volatile cbd_t		*rbdf;
 	volatile scc_uart_t	*up;
@@ -250,8 +248,7 @@ serial_getc(void)
 	return (c);
 }
 
-int
-serial_tstc()
+static int mpc8260_scc_serial_tstc(void)
 {
 	volatile cbd_t		*rbdf;
 	volatile scc_uart_t	*up;
@@ -264,6 +261,58 @@ serial_tstc()
 	return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device mpc8260_scc_serial_drv = {
+	.name	= "mpc8260_scc_uart",
+	.start	= mpc8260_scc_serial_init,
+	.stop	= NULL,
+	.setbrg	= mpc8260_scc_serial_setbrg,
+	.putc	= mpc8260_scc_serial_putc,
+	.puts	= mpc8260_scc_serial_puts,
+	.getc	= mpc8260_scc_serial_getc,
+	.tstc	= mpc8260_scc_serial_tstc,
+};
+
+void mpc8260_scc_serial_initialize(void)
+{
+	serial_register(&mpc8260_scc_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &mpc8260_scc_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return mpc8260_scc_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	mpc8260_scc_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	mpc8260_scc_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	mpc8260_scc_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return mpc8260_scc_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return mpc8260_scc_serial_tstc();
+}
+#endif
 #endif	/* CONFIG_CONS_ON_SCC */
 
 #if defined(CONFIG_KGDB_ON_SCC)
arch/powerpc/cpu/mpc8260/serial_smc.c +60 -11

119 lines not on this page · raw message

common/serial.c +4 -0
index db06f97..5c8cbdd 100644
@@ -54,6 +54,8 @@ serial_initfunc(asc_serial_initialize);
 serial_initfunc(jz_serial_initialize);
 serial_initfunc(mpc5xx_serial_initialize);
 serial_initfunc(mpc8220_serial_initialize);
+serial_initfunc(mpc8260_scc_serial_initialize);
+serial_initfunc(mpc8260_smc_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -86,6 +88,8 @@ void serial_initialize(void)
 	jz_serial_initialize();
 	mpc5xx_serial_initialize();
 	mpc8220_serial_initialize();
+	mpc8260_scc_serial_initialize();
+	mpc8260_smc_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#244 lore raw

PATCH v3 26/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc85xx serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into mpc85xx serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the mpc85xx driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/mpc85xx/serial_scc.c |   71 ++++++++++++++++++++++++++++-----
 common/serial.c                       |    2 +
 2 files changed, 62 insertions(+), 11 deletions(-)
arch/powerpc/cpu/mpc85xx/serial_scc.c +60 -11
index 2dab212..d192642 100644
@@ -34,6 +34,8 @@
 
 #include <common.h>
 #include <asm/cpm_85xx.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -85,7 +87,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #endif
 
-int serial_init (void)
+static int mpc85xx_serial_init(void)
 {
 	volatile ccsr_cpm_t *cpm = (ccsr_cpm_t *)CONFIG_SYS_MPC85xx_CPM_ADDR;
 	volatile ccsr_cpm_scc_t *sp;
@@ -184,8 +186,7 @@ int serial_init (void)
 	return (0);
 }
 
-void
-serial_setbrg (void)
+static void mpc85xx_serial_setbrg(void)
 {
 #if defined(CONFIG_CONS_USE_EXTC)
 	m8560_cpm_extcbrg(SCC_INDEX, gd->baudrate,
@@ -195,8 +196,7 @@ serial_setbrg (void)
 #endif
 }
 
-void
-serial_putc(const char c)
+static void mpc85xx_serial_putc(const char c)
 {
 	volatile scc_uart_t	*up;
 	volatile cbd_t		*tbdf;
@@ -220,16 +220,14 @@ serial_putc(const char c)
 	tbdf->cbd_sc |= BD_SC_READY;
 }
 
-void
-serial_puts (const char *s)
+static void mpc85xx_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
-int
-serial_getc(void)
+static int mpc85xx_serial_getc(void)
 {
 	volatile cbd_t		*rbdf;
 	volatile scc_uart_t	*up;
@@ -252,8 +250,7 @@ serial_getc(void)
 	return (c);
 }
 
-int
-serial_tstc()
+static int mpc85xx_serial_tstc(void)
 {
 	volatile cbd_t		*rbdf;
 	volatile scc_uart_t	*up;
@@ -265,4 +262,56 @@ serial_tstc()
 	return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device mpc85xx_serial_drv = {
+	.name	= "mpc85xx_serial",
+	.start	= mpc85xx_serial_init,
+	.stop	= NULL,
+	.setbrg	= mpc85xx_serial_setbrg,
+	.putc	= mpc85xx_serial_putc,
+	.puts	= mpc85xx_serial_puts,
+	.getc	= mpc85xx_serial_getc,
+	.tstc	= mpc85xx_serial_tstc,
+};
+
+void mpc85xx_serial_initialize(void)
+{
+	serial_register(&mpc85xx_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &mpc85xx_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return mpc85xx_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	mpc85xx_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	mpc85xx_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	mpc85xx_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return mpc85xx_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return mpc85xx_serial_tstc();
+}
+#endif
 #endif	/* CONFIG_CONS_ON_SCC */
common/serial.c +2 -0
index 5c8cbdd..aeae51d 100644
@@ -56,6 +56,7 @@ serial_initfunc(mpc5xx_serial_initialize);
 serial_initfunc(mpc8220_serial_initialize);
 serial_initfunc(mpc8260_scc_serial_initialize);
 serial_initfunc(mpc8260_smc_serial_initialize);
+serial_initfunc(mpc85xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -90,6 +91,7 @@ void serial_initialize(void)
 	mpc8220_serial_initialize();
 	mpc8260_scc_serial_initialize();
 	mpc8260_smc_serial_initialize();
+	mpc85xx_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#245 lore raw

PATCH v3 27/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into iop480 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into iop480 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the iop480 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/powerpc/cpu/ppc4xx/iop480_uart.c |   65 ++++++++++++++++++++++++++++++---
 common/serial.c                       |    2 +
 2 files changed, 61 insertions(+), 6 deletions(-)
arch/powerpc/cpu/ppc4xx/iop480_uart.c +59 -6
index 027ca30..fb25e15 100644
@@ -29,6 +29,7 @@
 
 #ifdef CONFIG_SERIAL_MULTI
 #include <serial.h>
+#include <linux/compiler.h>
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -132,7 +133,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * as serial console interface.
  */
 
-int serial_init (void)
+static int iop480_serial_init(void)
 {
 	unsigned short br_reg;
 
@@ -153,7 +154,7 @@ int serial_init (void)
 	return (0);
 }
 
-void serial_setbrg (void)
+static void iop480_serial_setbrg(void)
 {
 	unsigned short br_reg;
 
@@ -165,7 +166,7 @@ void serial_setbrg (void)
 	      ((br_reg & 0xff00) >> 8)); /* ... */
 }
 
-void serial_putc (const char c)
+static void iop480_serial_putc(const char c)
 {
 	if (c == '\n')
 		serial_putc ('\r');
@@ -182,14 +183,14 @@ void serial_putc (const char c)
 	}
 }
 
-void serial_puts (const char *s)
+static void iop480_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
-int serial_getc ()
+static int iop480_serial_getc(void)
 {
 	unsigned char status = 0;
 
@@ -212,7 +213,7 @@ int serial_getc ()
 	return (0x000000ff & (int) in_8((u8 *)asyncRxBufferport1));
 }
 
-int serial_tstc ()
+static int iop480_serial_tstc(void)
 {
 	unsigned char status;
 
@@ -233,4 +234,56 @@ int serial_tstc ()
 	return 0;
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device iop480_serial_drv = {
+	.name	= "iop480_serial",
+	.start	= iop480_serial_init,
+	.stop	= NULL,
+	.setbrg	= iop480_serial_setbrg,
+	.putc	= iop480_serial_putc,
+	.puts	= iop480_serial_puts,
+	.getc	= iop480_serial_getc,
+	.tstc	= iop480_serial_tstc,
+};
+
+void iop480_serial_initialize(void)
+{
+	serial_register(&iop480_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &iop480_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return iop480_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	iop480_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	iop480_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	iop480_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return iop480_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return iop480_serial_tstc();
+}
+#endif
 #endif	/* CONFIG_IOP480 */
common/serial.c +2 -0
index aeae51d..398ad30 100644
@@ -57,6 +57,7 @@ serial_initfunc(mpc8220_serial_initialize);
 serial_initfunc(mpc8260_scc_serial_initialize);
 serial_initfunc(mpc8260_smc_serial_initialize);
 serial_initfunc(mpc85xx_serial_initialize);
+serial_initfunc(iop480_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -92,6 +93,7 @@ void serial_initialize(void)
 	mpc8260_scc_serial_initialize();
 	mpc8260_smc_serial_initialize();
 	mpc85xx_serial_initialize();
+	iop480_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#246 lore raw

PATCH v3 28/72 serial: sparc: Implement CONFIG_SERIAL_MULTI into leon2 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into leon2 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the leon2 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Peter Tyser <[email protected]>
---
 arch/sparc/cpu/leon2/serial.c |   83 ++++++++++++++++++++++++++++++++++-------
 common/serial.c               |    2 +
 2 files changed, 71 insertions(+), 14 deletions(-)
arch/sparc/cpu/leon2/serial.c +69 -14
index 4f41b8e..61d059b 100644
@@ -26,6 +26,8 @@
 #include <common.h>
 #include <asm/processor.h>
 #include <asm/leon.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -39,7 +41,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)&(var))
 #endif
 
-int serial_init(void)
+static int leon2_serial_init(void)
 {
 	LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
 	LEON2_Uart_regs *regs;
@@ -72,15 +74,7 @@ int serial_init(void)
 	return 0;
 }
 
-void serial_putc(const char c)
-{
-	if (c == '\n')
-		serial_putc_raw('\r');
-
-	serial_putc_raw(c);
-}
-
-void serial_putc_raw(const char c)
+static void leon2_serial_putc_raw(const char c)
 {
 	LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
 	LEON2_Uart_regs *regs;
@@ -103,14 +97,22 @@ void serial_putc_raw(const char c)
 #endif
 }
 
-void serial_puts(const char *s)
+static void leon2_serial_putc(const char c)
+{
+	if (c == '\n')
+		leon2_serial_putc_raw('\r');
+
+	leon2_serial_putc_raw(c);
+}
+
+static void leon2_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc(*s++);
 	}
 }
 
-int serial_getc(void)
+static int leon2_serial_getc(void)
 {
 	LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
 	LEON2_Uart_regs *regs;
@@ -128,7 +130,7 @@ int serial_getc(void)
 	return READ_WORD(regs->UART_Channel);
 }
 
-int serial_tstc(void)
+static int leon2_serial_tstc(void)
 {
 	LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
 	LEON2_Uart_regs *regs;
@@ -143,7 +145,7 @@ int serial_tstc(void)
 }
 
 /* set baud rate for uart */
-void serial_setbrg(void)
+static void leon2_serial_setbrg(void)
 {
 	/* update baud rate settings, read it from gd->baudrate */
 	unsigned int scaler;
@@ -163,3 +165,56 @@ void serial_setbrg(void)
 		regs->UART_Scaler = scaler;
 	}
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device leon2_serial_drv = {
+	.name	= "leon2_serial",
+	.start	= leon2_serial_init,
+	.stop	= NULL,
+	.setbrg	= leon2_serial_setbrg,
+	.putc	= leon2_serial_putc,
+	.puts	= leon2_serial_puts,
+	.getc	= leon2_serial_getc,
+	.tstc	= leon2_serial_tstc,
+};
+
+void leon2_serial_initialize(void)
+{
+	serial_register(&leon2_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &leon2_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return leon2_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	leon2_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	leon2_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	leon2_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return leon2_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return leon2_serial_tstc();
+}
+#endif
common/serial.c +2 -0
index 398ad30..8848126 100644
@@ -58,6 +58,7 @@ serial_initfunc(mpc8260_scc_serial_initialize);
 serial_initfunc(mpc8260_smc_serial_initialize);
 serial_initfunc(mpc85xx_serial_initialize);
 serial_initfunc(iop480_serial_initialize);
+serial_initfunc(leon2_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -94,6 +95,7 @@ void serial_initialize(void)
 	mpc8260_smc_serial_initialize();
 	mpc85xx_serial_initialize();
 	iop480_serial_initialize();
+	leon2_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#247 lore raw

PATCH v3 29/72 serial: sparc: Implement CONFIG_SERIAL_MULTI into leon3 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into leon3 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the leon3 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Peter Tyser <[email protected]>
---
 arch/sparc/cpu/leon3/serial.c |   83 ++++++++++++++++++++++++++++++++++-------
 common/serial.c               |    2 +
 2 files changed, 71 insertions(+), 14 deletions(-)
arch/sparc/cpu/leon3/serial.c +69 -14
index 4b2fcb8..a110244 100644
@@ -27,6 +27,8 @@
 #include <asm/processor.h>
 #include <asm/leon.h>
 #include <ambapp.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,7 +44,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 ambapp_dev_apbuart *leon3_apbuart = NULL;
 
-int serial_init(void)
+static int leon3_serial_init(void)
 {
 	ambapp_apbdev apbdev;
 	unsigned int tmp;
@@ -72,15 +74,7 @@ int serial_init(void)
 	return -1;		/* didn't find hardware */
 }
 
-void serial_putc(const char c)
-{
-	if (c == '\n')
-		serial_putc_raw('\r');
-
-	serial_putc_raw(c);
-}
-
-void serial_putc_raw(const char c)
+static void leon3_serial_putc_raw(const char c)
 {
 	if (!leon3_apbuart)
 		return;
@@ -97,14 +91,22 @@ void serial_putc_raw(const char c)
 #endif
 }
 
-void serial_puts(const char *s)
+static void leon3_serial_putc(const char c)
+{
+	if (c == '\n')
+		leon3_serial_putc_raw('\r');
+
+	leon3_serial_putc_raw(c);
+}
+
+static void leon3_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc(*s++);
 	}
 }
 
-int serial_getc(void)
+static int leon3_serial_getc(void)
 {
 	if (!leon3_apbuart)
 		return 0;
@@ -116,7 +118,7 @@ int serial_getc(void)
 	return READ_WORD(leon3_apbuart->data);
 }
 
-int serial_tstc(void)
+static int leon3_serial_tstc(void)
 {
 	if (leon3_apbuart)
 		return (READ_WORD(leon3_apbuart->status) &
@@ -125,7 +127,7 @@ int serial_tstc(void)
 }
 
 /* set baud rate for uart */
-void serial_setbrg(void)
+static void leon3_serial_setbrg(void)
 {
 	/* update baud rate settings, read it from gd->baudrate */
 	unsigned int scaler;
@@ -137,3 +139,56 @@ void serial_setbrg(void)
 	}
 	return;
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device leon3_serial_drv = {
+	.name	= "leon3_serial",
+	.start	= leon3_serial_init,
+	.stop	= NULL,
+	.setbrg	= leon3_serial_setbrg,
+	.putc	= leon3_serial_putc,
+	.puts	= leon3_serial_puts,
+	.getc	= leon3_serial_getc,
+	.tstc	= leon3_serial_tstc,
+};
+
+void leon3_serial_initialize(void)
+{
+	serial_register(&leon3_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &leon3_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return leon3_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	leon3_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	leon3_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	leon3_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return leon3_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return leon3_serial_tstc();
+}
+#endif
common/serial.c +2 -0
index 8848126..4907009 100644
@@ -59,6 +59,7 @@ serial_initfunc(mpc8260_smc_serial_initialize);
 serial_initfunc(mpc85xx_serial_initialize);
 serial_initfunc(iop480_serial_initialize);
 serial_initfunc(leon2_serial_initialize);
+serial_initfunc(leon3_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -96,6 +97,7 @@ void serial_initialize(void)
 	mpc85xx_serial_initialize();
 	iop480_serial_initialize();
 	leon2_serial_initialize();
+	leon3_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#248 lore raw

PATCH v3 30/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into marvell serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into marvell serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the marvell driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/Marvell/common/serial.c |   80 ++++++++++++++++++++++++++++++++++-------
 common/serial.c               |    2 ++
 2 files changed, 69 insertions(+), 13 deletions(-)
board/Marvell/common/serial.c +67 -13
index 3e7f406..a5231eb 100644
@@ -32,6 +32,9 @@
 
 #include <common.h>
 #include <command.h>
+#include <serial.h>
+#include <linux/compiler.h>
+
 #include "../include/memory.h"
 #include "serial.h"
 
@@ -48,9 +51,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_MPSC
-
-
-int serial_init (void)
+static int marvell_serial_init(void)
 {
 #if (defined CONFIG_SYS_INIT_CHAN1) || (defined CONFIG_SYS_INIT_CHAN2)
 	int clock_divisor = 230400 / gd->baudrate;
@@ -68,7 +69,7 @@ int serial_init (void)
 	return (0);
 }
 
-void serial_putc (const char c)
+static void marvell_serial_putc(const char c)
 {
 	if (c == '\n')
 		mpsc_putchar ('\r');
@@ -76,24 +77,24 @@ void serial_putc (const char c)
 	mpsc_putchar (c);
 }
 
-int serial_getc (void)
+static int marvell_serial_getc(void)
 {
 	return mpsc_getchar ();
 }
 
-int serial_tstc (void)
+static int marvell_serial_tstc(void)
 {
 	return mpsc_test_char ();
 }
 
-void serial_setbrg (void)
+static void marvell_serial_setbrg(void)
 {
 	galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
 }
 
 #else  /* ! CONFIG_MPSC */
 
-int serial_init (void)
+static int marvell_serial_init(void)
 {
 	int clock_divisor = 230400 / gd->baudrate;
 
@@ -106,7 +107,7 @@ int serial_init (void)
 	return (0);
 }
 
-void serial_putc (const char c)
+static void marvell_serial_putc(const char c)
 {
 	if (c == '\n')
 		NS16550_putc (COM_PORTS[CONFIG_SYS_DUART_CHAN], '\r');
@@ -114,17 +115,17 @@ void serial_putc (const char c)
 	NS16550_putc (COM_PORTS[CONFIG_SYS_DUART_CHAN], c);
 }
 
-int serial_getc (void)
+static int marvell_serial_getc(void)
 {
 	return NS16550_getc (COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-int serial_tstc (void)
+static int marvell_serial_tstc(void)
 {
 	return NS16550_tstc (COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-void serial_setbrg (void)
+static void marvell_serial_setbrg(void)
 {
 	int clock_divisor = 230400 / gd->baudrate;
 
@@ -138,13 +139,66 @@ void serial_setbrg (void)
 
 #endif /* CONFIG_MPSC */
 
-void serial_puts (const char *s)
+static void marvell_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device marvell_serial_drv = {
+	.name	= "marvell_serial",
+	.start	= marvell_serial_init,
+	.stop	= NULL,
+	.setbrg	= marvell_serial_setbrg,
+	.putc	= marvell_serial_putc,
+	.puts	= marvell_serial_puts,
+	.getc	= marvell_serial_getc,
+	.tstc	= marvell_serial_tstc,
+};
+
+void marvell_serial_initialize(void)
+{
+	serial_register(&marvell_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &marvell_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return marvell_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	marvell_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	marvell_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	marvell_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return marvell_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return marvell_serial_tstc();
+}
+#endif
+
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
common/serial.c +2 -0
index 4907009..0288b49 100644
@@ -60,6 +60,7 @@ serial_initfunc(mpc85xx_serial_initialize);
 serial_initfunc(iop480_serial_initialize);
 serial_initfunc(leon2_serial_initialize);
 serial_initfunc(leon3_serial_initialize);
+serial_initfunc(marvell_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -98,6 +99,7 @@ void serial_initialize(void)
 	iop480_serial_initialize();
 	leon2_serial_initialize();
 	leon3_serial_initialize();
+	marvell_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#249 lore raw

PATCH v3 31/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into amirix serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into amirix serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the amirix driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/amirix/ap1000/serial.c |   66 ++++++++++++++++++++++++++++++++++++++----
 common/serial.c              |    2 ++
 2 files changed, 62 insertions(+), 6 deletions(-)
board/amirix/ap1000/serial.c +60 -6
index 87003be..2c2e9f9 100644
@@ -24,6 +24,8 @@
 #include <asm/processor.h>
 #include <command.h>
 #include <config.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 #include <ns16550.h>
 
@@ -36,7 +38,7 @@ const NS16550_t COM_PORTS[] =
 #define CONFIG_SYS_DUART_CHAN gComPort
 static int gComPort = 0;
 
-int serial_init (void)
+static int amirix_serial_init(void)
 {
 	int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
 
@@ -46,7 +48,7 @@ int serial_init (void)
 	return 0;
 }
 
-void serial_putc (const char c)
+static void amirix_serial_putc(const char c)
 {
 	if (c == '\n') {
 		NS16550_putc (COM_PORTS[CONFIG_SYS_DUART_CHAN], '\r');
@@ -55,17 +57,17 @@ void serial_putc (const char c)
 	NS16550_putc (COM_PORTS[CONFIG_SYS_DUART_CHAN], c);
 }
 
-int serial_getc (void)
+static int amirix_serial_getc(void)
 {
 	return NS16550_getc (COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-int serial_tstc (void)
+static int amirix_serial_tstc(void)
 {
 	return NS16550_tstc (COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-void serial_setbrg (void)
+static void amirix_serial_setbrg(void)
 {
 	int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
 
@@ -77,13 +79,65 @@ void serial_setbrg (void)
 #endif
 }
 
-void serial_puts (const char *s)
+static void amirix_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device amirix_serial_drv = {
+	.name	= "amirix_serial",
+	.start	= amirix_serial_init,
+	.stop	= NULL,
+	.setbrg	= amirix_serial_setbrg,
+	.putc	= amirix_serial_putc,
+	.puts	= amirix_serial_puts,
+	.getc	= amirix_serial_getc,
+	.tstc	= amirix_serial_tstc,
+};
+
+void amirix_serial_initialize(void)
+{
+	serial_register(&amirix_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &amirix_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return amirix_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	amirix_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	amirix_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	amirix_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return amirix_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return amirix_serial_tstc();
+}
+#endif
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
common/serial.c +2 -0
index 0288b49..6a09139 100644
@@ -61,6 +61,7 @@ serial_initfunc(iop480_serial_initialize);
 serial_initfunc(leon2_serial_initialize);
 serial_initfunc(leon3_serial_initialize);
 serial_initfunc(marvell_serial_initialize);
+serial_initfunc(amirix_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -100,6 +101,7 @@ void serial_initialize(void)
 	leon2_serial_initialize();
 	leon3_serial_initialize();
 	marvell_serial_initialize();
+	amirix_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#250 lore raw

PATCH v3 32/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into bmw serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the bmw driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/bmw/serial.c |   68 +++++++++++++++++++++++++++++++++++++++++++++++-----
 common/serial.c    |    2 ++
 2 files changed, 64 insertions(+), 6 deletions(-)
board/bmw/serial.c +62 -6
index 0c97f12..569131f 100644
@@ -22,6 +22,9 @@
  */
 
 #include <common.h>
+#include <serial.h>
+#include <linux/compiler.h>
+
 #include "ns16550.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -38,7 +41,7 @@ static struct NS16550 *console =
 
 extern ulong get_bus_freq (ulong);
 
-int serial_init (void)
+static int bmw_serial_init(void)
 {
 	int clock_divisor = gd->bus_clk / 16 / gd->baudrate;
 
@@ -47,7 +50,7 @@ int serial_init (void)
 	return (0);
 }
 
-void serial_putc (const char c)
+static void bmw_serial_putc(const char c)
 {
 	if (c == '\n') {
 		serial_putc ('\r');
@@ -55,7 +58,7 @@ void serial_putc (const char c)
 	NS16550_putc (console, c);
 }
 
-void serial_puts (const char *s)
+static void bmw_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
@@ -63,19 +66,72 @@ void serial_puts (const char *s)
 }
 
 
-int serial_getc (void)
+static int bmw_serial_getc(void)
 {
 	return NS16550_getc (console);
 }
 
-int serial_tstc (void)
+static int bmw_serial_tstc(void)
 {
 	return NS16550_tstc (console);
 }
 
-void serial_setbrg (void)
+static void bmw_serial_setbrg(void)
 {
 	int clock_divisor = get_bus_freq (0) / 16 / gd->baudrate;
 
 	NS16550_reinit (console, clock_divisor);
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device bmw_serial_drv = {
+	.name	= "bmw_serial",
+	.start	= bmw_serial_init,
+	.stop	= NULL,
+	.setbrg	= bmw_serial_setbrg,
+	.putc	= bmw_serial_putc,
+	.puts	= bmw_serial_puts,
+	.getc	= bmw_serial_getc,
+	.tstc	= bmw_serial_tstc,
+};
+
+void bmw_serial_initialize(void)
+{
+	serial_register(&bmw_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &bmw_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return bmw_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	bmw_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	bmw_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	bmw_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return bmw_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return bmw_serial_tstc();
+}
+#endif
common/serial.c +2 -0
index 6a09139..19d3a6f 100644
@@ -62,6 +62,7 @@ serial_initfunc(leon2_serial_initialize);
 serial_initfunc(leon3_serial_initialize);
 serial_initfunc(marvell_serial_initialize);
 serial_initfunc(amirix_serial_initialize);
+serial_initfunc(bmw_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -102,6 +103,7 @@ void serial_initialize(void)
 	leon3_serial_initialize();
 	marvell_serial_initialize();
 	amirix_serial_initialize();
+	bmw_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#251 lore raw

PATCH v3 33/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into cogent serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into cogent serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the cogent driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/cogent/serial.c |   66 ++++++++++++++++++++++++++++++++++++++++++++-----
 common/serial.c       |    2 ++
 2 files changed, 62 insertions(+), 6 deletions(-)
board/cogent/serial.c +60 -6
index d9c27be..18a9dbf 100644
@@ -5,6 +5,8 @@
 
 #include <common.h>
 #include <board/cogent/serial.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -25,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #error CONFIG_CONS_INDEX must be configured for Cogent motherboard serial
 #endif
 
-int serial_init (void)
+static int cogent_serial_init(void)
 {
 	cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
@@ -38,7 +40,7 @@ int serial_init (void)
 	return (0);
 }
 
-void serial_setbrg (void)
+static void cogent_serial_setbrg(void)
 {
 	cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 	unsigned int divisor;
@@ -54,7 +56,7 @@ void serial_setbrg (void)
 	cma_mb_reg_write (&mbsp->ser_lcr, lcr);	/* unset DLAB */
 }
 
-void serial_putc (const char c)
+static void cogent_serial_putc(const char c)
 {
 	cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
@@ -66,13 +68,13 @@ void serial_putc (const char c)
 	cma_mb_reg_write (&mbsp->ser_thr, c);
 }
 
-void serial_puts (const char *s)
+static void cogent_serial_puts(const char *s)
 {
 	while (*s != '\0')
 		serial_putc (*s++);
 }
 
-int serial_getc (void)
+static int cogent_serial_getc(void)
 {
 	cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
@@ -81,13 +83,65 @@ int serial_getc (void)
 	return ((int) cma_mb_reg_read (&mbsp->ser_rhr) & 0x7f);
 }
 
-int serial_tstc (void)
+static int cogent_serial_tstc(void)
 {
 	cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
 	return ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_DR) != 0);
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device cogent_serial_drv = {
+	.name	= "cogent_serial",
+	.start	= cogent_serial_init,
+	.stop	= NULL,
+	.setbrg	= cogent_serial_setbrg,
+	.putc	= cogent_serial_putc,
+	.puts	= cogent_serial_puts,
+	.getc	= cogent_serial_getc,
+	.tstc	= cogent_serial_tstc,
+};
+
+void cogent_serial_initialize(void)
+{
+	serial_register(&cogent_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &cogent_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return cogent_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	cogent_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	cogent_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	cogent_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return cogent_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return cogent_serial_tstc();
+}
+#endif
 #endif /* CONS_NONE */
 
 #if defined(CONFIG_CMD_KGDB) && \
common/serial.c +2 -0
index 19d3a6f..a51ce99 100644
@@ -63,6 +63,7 @@ serial_initfunc(leon3_serial_initialize);
 serial_initfunc(marvell_serial_initialize);
 serial_initfunc(amirix_serial_initialize);
 serial_initfunc(bmw_serial_initialize);
+serial_initfunc(cogent_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -104,6 +105,7 @@ void serial_initialize(void)
 	marvell_serial_initialize();
 	amirix_serial_initialize();
 	bmw_serial_initialize();
+	cogent_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#252 lore raw

PATCH v3 34/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into cpci750 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into cpci750 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the cpci750 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/esd/cpci750/serial.c |   67 ++++++++++++++++++++++++++++++++++++++++----
 common/serial.c            |    2 ++
 2 files changed, 63 insertions(+), 6 deletions(-)
board/esd/cpci750/serial.c +61 -6
index e1af37e..9ff7c27 100644
@@ -35,6 +35,9 @@
 
 #include <common.h>
 #include <command.h>
+#include <serial.h>
+#include <linux/compiler.h>
+
 #include "../../Marvell/include/memory.h"
 #include "serial.h"
 
@@ -42,14 +45,14 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int serial_init (void)
+static int cpci750_serial_init(void)
 {
 	mpsc_init (gd->baudrate);
 
 	return (0);
 }
 
-void serial_putc (const char c)
+static void cpci750_serial_putc(const char c)
 {
 	if (c == '\n')
 		mpsc_putchar ('\r');
@@ -57,29 +60,81 @@ void serial_putc (const char c)
 	mpsc_putchar (c);
 }
 
-int serial_getc (void)
+static int cpci750_serial_getc(void)
 {
 	return mpsc_getchar ();
 }
 
-int serial_tstc (void)
+static int cpci750_serial_tstc(void)
 {
 	return mpsc_test_char ();
 }
 
-void serial_setbrg (void)
+static void cpci750_serial_setbrg(void)
 {
 	galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
 }
 
 
-void serial_puts (const char *s)
+static void cpci750_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device cpci750_serial_drv = {
+	.name	= "cpci750_serial",
+	.start	= cpci750_serial_init,
+	.stop	= NULL,
+	.setbrg	= cpci750_serial_setbrg,
+	.putc	= cpci750_serial_putc,
+	.puts	= cpci750_serial_puts,
+	.getc	= cpci750_serial_getc,
+	.tstc	= cpci750_serial_tstc,
+};
+
+void cpci750_serial_initialize(void)
+{
+	serial_register(&cpci750_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &cpci750_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return cpci750_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	cpci750_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	cpci750_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	cpci750_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return cpci750_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return cpci750_serial_tstc();
+}
+#endif
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
common/serial.c +2 -0
index a51ce99..c77d3ba 100644
@@ -64,6 +64,7 @@ serial_initfunc(marvell_serial_initialize);
 serial_initfunc(amirix_serial_initialize);
 serial_initfunc(bmw_serial_initialize);
 serial_initfunc(cogent_serial_initialize);
+serial_initfunc(cpci750_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -106,6 +107,7 @@ void serial_initialize(void)
 	amirix_serial_initialize();
 	bmw_serial_initialize();
 	cogent_serial_initialize();
+	cpci750_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#253 lore raw

PATCH v3 35/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into evb64260 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into evb64260 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the evb64260 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/evb64260/serial.c |   85 ++++++++++++++++++++++++++++++++++++-----------
 common/serial.c         |    2 ++
 2 files changed, 67 insertions(+), 20 deletions(-)
board/evb64260/serial.c +65 -20
index 9d71115..cf46a4d 100644
@@ -30,6 +30,8 @@
 #include <common.h>
 #include <command.h>
 #include <galileo/memory.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 #if (defined CONFIG_SYS_INIT_CHAN1) || (defined CONFIG_SYS_INIT_CHAN2)
 #include <ns16550.h>
@@ -48,7 +50,7 @@ const NS16550_t COM_PORTS[] = { (NS16550_t) CONFIG_SYS_NS16550_COM1,
 
 #ifdef CONFIG_MPSC
 
-int serial_init (void)
+static int evb64260_serial_init(void)
 {
 #if (defined CONFIG_SYS_INIT_CHAN1) || (defined CONFIG_SYS_INIT_CHAN2)
 	int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
@@ -66,8 +68,7 @@ int serial_init (void)
 	return (0);
 }
 
-void
-serial_putc(const char c)
+static void evb64260_serial_putc(const char c)
 {
 	if (c == '\n')
 		mpsc_putchar('\r');
@@ -75,27 +76,24 @@ serial_putc(const char c)
 	mpsc_putchar(c);
 }
 
-int
-serial_getc(void)
+static int evb64260_serial_getc(void)
 {
 	return mpsc_getchar();
 }
 
-int
-serial_tstc(void)
+static int evb64260_serial_tstc(void)
 {
 	return mpsc_test_char();
 }
 
-void
-serial_setbrg (void)
+static void evb64260_serial_setbrg(void)
 {
 	galbrg_set_baudrate(CONFIG_MPSC_PORT, gd->baudrate);
 }
 
 #else /* ! CONFIG_MPSC */
 
-int serial_init (void)
+static int evb64260_serial_init(void)
 {
 	int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
 
@@ -109,8 +107,7 @@ int serial_init (void)
 	return (0);
 }
 
-void
-serial_putc(const char c)
+static void evb64260_serial_putc(const char c)
 {
 	if (c == '\n')
 		NS16550_putc(COM_PORTS[CONFIG_SYS_DUART_CHAN], '\r');
@@ -118,20 +115,17 @@ serial_putc(const char c)
 	NS16550_putc(COM_PORTS[CONFIG_SYS_DUART_CHAN], c);
 }
 
-int
-serial_getc(void)
+static int evb64260_serial_getc(void)
 {
 	return NS16550_getc(COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-int
-serial_tstc(void)
+static int evb64260_serial_tstc(void)
 {
 	return NS16550_tstc(COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-void
-serial_setbrg (void)
+static void evb64260_serial_setbrg(void)
 {
 	int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
 
@@ -145,14 +139,65 @@ serial_setbrg (void)
 
 #endif /* CONFIG_MPSC */
 
-void
-serial_puts (const char *s)
+static void evb64260_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device evb64260_serial_drv = {
+	.name	= "evb64260_serial",
+	.start	= evb64260_serial_init,
+	.stop	= NULL,
+	.setbrg	= evb64260_serial_setbrg,
+	.putc	= evb64260_serial_putc,
+	.puts	= evb64260_serial_puts,
+	.getc	= evb64260_serial_getc,
+	.tstc	= evb64260_serial_tstc,
+};
+
+void evb64260_serial_initialize(void)
+{
+	serial_register(&evb64260_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &evb64260_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return evb64260_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	evb64260_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	evb64260_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	evb64260_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return evb64260_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return evb64260_serial_tstc();
+}
+#endif
 #if defined(CONFIG_CMD_KGDB)
 void
 kgdb_serial_init(void)
common/serial.c +2 -0
index c77d3ba..2acf4c1 100644
@@ -65,6 +65,7 @@ serial_initfunc(amirix_serial_initialize);
 serial_initfunc(bmw_serial_initialize);
 serial_initfunc(cogent_serial_initialize);
 serial_initfunc(cpci750_serial_initialize);
+serial_initfunc(evb64260_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -108,6 +109,7 @@ void serial_initialize(void)
 	bmw_serial_initialize();
 	cogent_serial_initialize();
 	cpci750_serial_initialize();
+	evb64260_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#254 lore raw

PATCH v3 36/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into ml2 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into ml2 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the ml2 driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/ml2/serial.c |   66 +++++++++++++++++++++++++++++++++++++++++++++++-----
 common/serial.c    |    2 ++
 2 files changed, 62 insertions(+), 6 deletions(-)
board/ml2/serial.c +60 -6
index d9113ab..0ed1150 100644
@@ -24,6 +24,8 @@
 #include <asm/processor.h>
 #include <command.h>
 #include <configs/ML2.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 #if (defined CONFIG_SYS_INIT_CHAN1) || (defined CONFIG_SYS_INIT_CHAN2)
 #include <ns16550.h>
@@ -37,7 +39,7 @@ const NS16550_t COM_PORTS[] = { (NS16550_t) CONFIG_SYS_NS16550_COM1,
 };
 #endif
 
-int serial_init (void)
+static int ml2_serial_init(void)
 {
 	int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
 
@@ -51,7 +53,7 @@ int serial_init (void)
 
 }
 
-void serial_putc (const char c)
+static void ml2_serial_putc(const char c)
 {
 	if (c == '\n')
 		NS16550_putc (COM_PORTS[CONFIG_SYS_DUART_CHAN], '\r');
@@ -59,17 +61,17 @@ void serial_putc (const char c)
 	NS16550_putc (COM_PORTS[CONFIG_SYS_DUART_CHAN], c);
 }
 
-int serial_getc (void)
+static int ml2_serial_getc(void)
 {
 	return NS16550_getc (COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-int serial_tstc (void)
+static int ml2_serial_tstc(void)
 {
 	return NS16550_tstc (COM_PORTS[CONFIG_SYS_DUART_CHAN]);
 }
 
-void serial_setbrg (void)
+static void ml2_serial_setbrg(void)
 {
 	int clock_divisor = CONFIG_SYS_NS16550_CLK / 16 / gd->baudrate;
 
@@ -81,13 +83,65 @@ void serial_setbrg (void)
 #endif
 }
 
-void serial_puts (const char *s)
+static void ml2_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device ml2_serial_drv = {
+	.name	= "ml2_serial",
+	.start	= ml2_serial_init,
+	.stop	= NULL,
+	.setbrg	= ml2_serial_setbrg,
+	.putc	= ml2_serial_putc,
+	.puts	= ml2_serial_puts,
+	.getc	= ml2_serial_getc,
+	.tstc	= ml2_serial_tstc,
+};
+
+void ml2_serial_initialize(void)
+{
+	serial_register(&ml2_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &ml2_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return ml2_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	ml2_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	ml2_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	ml2_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return ml2_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return ml2_serial_tstc();
+}
+#endif
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
common/serial.c +2 -0
index 2acf4c1..393e296 100644
@@ -66,6 +66,7 @@ serial_initfunc(bmw_serial_initialize);
 serial_initfunc(cogent_serial_initialize);
 serial_initfunc(cpci750_serial_initialize);
 serial_initfunc(evb64260_serial_initialize);
+serial_initfunc(ml2_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -110,6 +111,7 @@ void serial_initialize(void)
 	cogent_serial_initialize();
 	cpci750_serial_initialize();
 	evb64260_serial_initialize();
+	ml2_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#255 lore raw

PATCH v3 37/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into sconsole serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into sconsole serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the sconsole driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/pcippc2/sconsole.c |   66 +++++++++++++++++++++++++++++++++++++++++-----
 common/serial.c          |    2 ++
 2 files changed, 62 insertions(+), 6 deletions(-)
board/pcippc2/sconsole.c +60 -6
index 6ef38f4..0a31963 100644
@@ -23,6 +23,8 @@
 
 #include <config.h>
 #include <common.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 #include "sconsole.h"
 
@@ -34,7 +36,7 @@ int	(*sconsole_getc) (void) = 0;
 int	(*sconsole_tstc) (void) = 0;
 void	(*sconsole_setbrg) (void) = 0;
 
-int serial_init (void)
+static int sconsole_serial_init(void)
 {
 	sconsole_buffer_t *sb = SCONSOLE_BUFFER;
 
@@ -46,7 +48,7 @@ int serial_init (void)
 	return (0);
 }
 
-void serial_putc (char c)
+static void sconsole_serial_putc(char c)
 {
 	if (sconsole_putc) {
 		(*sconsole_putc) (c);
@@ -65,7 +67,7 @@ void serial_putc (char c)
 	}
 }
 
-void serial_puts (const char *s)
+static void sconsole_serial_puts(const char *s)
 {
 	if (sconsole_puts) {
 		(*sconsole_puts) (s);
@@ -84,7 +86,7 @@ void serial_puts (const char *s)
 	}
 }
 
-int serial_getc (void)
+static int sconsole_serial_getc(void)
 {
 	if (sconsole_getc) {
 		return (*sconsole_getc) ();
@@ -93,7 +95,7 @@ int serial_getc (void)
 	}
 }
 
-int serial_tstc (void)
+static int sconsole_serial_tstc(void)
 {
 	if (sconsole_tstc) {
 		return (*sconsole_tstc) ();
@@ -102,7 +104,7 @@ int serial_tstc (void)
 	}
 }
 
-void serial_setbrg (void)
+static void sconsole_serial_setbrg(void)
 {
 	if (sconsole_setbrg) {
 		(*sconsole_setbrg) ();
@@ -113,6 +115,58 @@ void serial_setbrg (void)
 	}
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device sconsole_serial_drv = {
+	.name	= "sconsole_serial",
+	.start	= sconsole_serial_init,
+	.stop	= NULL,
+	.setbrg	= sconsole_serial_setbrg,
+	.putc	= sconsole_serial_putc,
+	.puts	= sconsole_serial_puts,
+	.getc	= sconsole_serial_getc,
+	.tstc	= sconsole_serial_tstc,
+};
+
+void sconsole_serial_initialize(void)
+{
+	serial_register(&sconsole_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &sconsole_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return sconsole_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	sconsole_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	sconsole_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	sconsole_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return sconsole_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return sconsole_serial_tstc();
+}
+#endif
 int sconsole_get_baudrate (void)
 {
 	sconsole_buffer_t *sb = SCONSOLE_BUFFER;
common/serial.c +2 -0
index 393e296..d9cd3bf 100644
@@ -67,6 +67,7 @@ serial_initfunc(cogent_serial_initialize);
 serial_initfunc(cpci750_serial_initialize);
 serial_initfunc(evb64260_serial_initialize);
 serial_initfunc(ml2_serial_initialize);
+serial_initfunc(sconsole_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -112,6 +113,7 @@ void serial_initialize(void)
 	cpci750_serial_initialize();
 	evb64260_serial_initialize();
 	ml2_serial_initialize();
+	sconsole_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#256 lore raw

PATCH v3 38/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into p3mx serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into p3mx serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the p3mx driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 board/prodrive/p3mx/serial.c |   68 ++++++++++++++++++++++++++++++++++++++----
 common/serial.c              |    2 ++
 2 files changed, 64 insertions(+), 6 deletions(-)
board/prodrive/p3mx/serial.c +62 -6
index e1af37e..d3591b4 100644
@@ -35,6 +35,9 @@
 
 #include <common.h>
 #include <command.h>
+#include <serial.h>
+#include <linux/compiler.h>
+
 #include "../../Marvell/include/memory.h"
 #include "serial.h"
 
@@ -42,14 +45,14 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int serial_init (void)
+static int p3mx_serial_init(void)
 {
 	mpsc_init (gd->baudrate);
 
 	return (0);
 }
 
-void serial_putc (const char c)
+static void p3mx_serial_putc(const char c)
 {
 	if (c == '\n')
 		mpsc_putchar ('\r');
@@ -57,29 +60,82 @@ void serial_putc (const char c)
 	mpsc_putchar (c);
 }
 
-int serial_getc (void)
+static int p3mx_serial_getc(void)
 {
 	return mpsc_getchar ();
 }
 
-int serial_tstc (void)
+static int p3mx_serial_tstc(void)
 {
 	return mpsc_test_char ();
 }
 
-void serial_setbrg (void)
+static void p3mx_serial_setbrg(void)
 {
 	galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
 }
 
 
-void serial_puts (const char *s)
+static void p3mx_serial_puts(const char *s)
 {
 	while (*s) {
 		serial_putc (*s++);
 	}
 }
 
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device p3mx_serial_drv = {
+	.name	= "p3mx_serial",
+	.start	= p3mx_serial_init,
+	.stop	= NULL,
+	.setbrg	= p3mx_serial_setbrg,
+	.putc	= p3mx_serial_putc,
+	.puts	= p3mx_serial_puts,
+	.getc	= p3mx_serial_getc,
+	.tstc	= p3mx_serial_tstc,
+};
+
+void p3mx_serial_initialize(void)
+{
+	serial_register(&p3mx_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+	return &p3mx_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return p3mx_serial_init();
+}
+
+void serial_setbrg(void)
+{
+	p3mx_serial_setbrg();
+}
+
+void serial_putc(const char c)
+{
+	p3mx_serial_putc(c);
+}
+
+void serial_puts(const char *s)
+{
+	p3mx_serial_puts(s);
+}
+
+int serial_getc(void)
+{
+	return p3mx_serial_getc();
+}
+
+int serial_tstc(void)
+{
+	return p3mx_serial_tstc();
+}
+#endif
+
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
common/serial.c +2 -0
index d9cd3bf..2d6ba05 100644
@@ -68,6 +68,7 @@ serial_initfunc(cpci750_serial_initialize);
 serial_initfunc(evb64260_serial_initialize);
 serial_initfunc(ml2_serial_initialize);
 serial_initfunc(sconsole_serial_initialize);
+serial_initfunc(p3mx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -114,6 +115,7 @@ void serial_initialize(void)
 	evb64260_serial_initialize();
 	ml2_serial_initialize();
 	sconsole_serial_initialize();
+	p3mx_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
Signature · 1 line
1.7.10.4
#257 lore raw

PATCH v3 39/72 serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into altera_jtag serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the altera_jtag driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Thomas Chou <[email protected]>
---
 common/serial.c                   |    2 ++
 drivers/serial/altera_jtag_uart.c |   71 +++++++++++++++++++++++++++++++++----
 2 files changed, 67 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index 2d6ba05..24879ec 100644
@@ -69,6 +69,7 @@ serial_initfunc(evb64260_serial_initialize);
 serial_initfunc(ml2_serial_initialize);
 serial_initfunc(sconsole_serial_initialize);
 serial_initfunc(p3mx_serial_initialize);
+serial_initfunc(altera_jtag_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -116,6 +117,7 @@ void serial_initialize(void)
 	ml2_serial_initialize();
 	sconsole_serial_initialize();
 	p3mx_serial_initialize();
+	altera_jtag_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/altera_jtag_uart.c +65 -6

96 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#258 lore raw

PATCH v3 40/72 serial: arm: Implement CONFIG_SERIAL_MULTI into altera serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into altera serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the altera driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott McNutt <[email protected]>
---
 common/serial.c              |    2 +
 drivers/serial/altera_uart.c |   83 ++++++++++++++++++++++++++++++++++++------
 2 files changed, 73 insertions(+), 12 deletions(-)
common/serial.c +2 -0
index 24879ec..e6566da 100644
@@ -70,6 +70,7 @@ serial_initfunc(ml2_serial_initialize);
 serial_initfunc(sconsole_serial_initialize);
 serial_initfunc(p3mx_serial_initialize);
 serial_initfunc(altera_jtag_serial_initialize);
+serial_initfunc(altera_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -118,6 +119,7 @@ void serial_initialize(void)
 	sconsole_serial_initialize();
 	p3mx_serial_initialize();
 	altera_jtag_serial_initialize();
+	altera_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/altera_uart.c +71 -12

126 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#259 lore raw

PATCH v3 41/72 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into atmel serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the atmel driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Xu, Hong <[email protected]>
---
 common/serial.c              |    2 ++
 drivers/serial/atmel_usart.c |   67 ++++++++++++++++++++++++++++++++++++++----
 2 files changed, 63 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index e6566da..b880303 100644
@@ -71,6 +71,7 @@ serial_initfunc(sconsole_serial_initialize);
 serial_initfunc(p3mx_serial_initialize);
 serial_initfunc(altera_jtag_serial_initialize);
 serial_initfunc(altera_serial_initialize);
+serial_initfunc(atmel_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -120,6 +121,7 @@ void serial_initialize(void)
 	p3mx_serial_initialize();
 	altera_jtag_serial_initialize();
 	altera_serial_initialize();
+	atmel_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/atmel_usart.c +61 -6

109 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#260 lore raw

PATCH v3 42/72 serial: arm: Implement CONFIG_SERIAL_MULTI into lpc32xx serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into lpc32xx serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the lpc32xx driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Vladimir Zapolskiy <[email protected]>
---
 common/serial.c                 |    2 ++
 drivers/serial/lpc32xx_hsuart.c |   71 ++++++++++++++++++++++++++-------------
 2 files changed, 50 insertions(+), 23 deletions(-)
common/serial.c +2 -0
index b880303..8bc26d8 100644
@@ -72,6 +72,7 @@ serial_initfunc(p3mx_serial_initialize);
 serial_initfunc(altera_jtag_serial_initialize);
 serial_initfunc(altera_serial_initialize);
 serial_initfunc(atmel_serial_initialize);
+serial_initfunc(lpc32xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -122,6 +123,7 @@ void serial_initialize(void)
 	altera_jtag_serial_initialize();
 	altera_serial_initialize();
 	atmel_serial_initialize();
+	lpc32xx_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/lpc32xx_hsuart.c +48 -23

130 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#261 lore raw

PATCH v3 43/72 serial: mcf: Implement CONFIG_SERIAL_MULTI into MCF serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into MCF serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the MCF driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc TsiChung Liew <[email protected]>
---
 common/serial.c          |    2 ++
 drivers/serial/mcfuart.c |   65 +++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index 8bc26d8..fa16dce 100644
@@ -73,6 +73,7 @@ serial_initfunc(altera_jtag_serial_initialize);
 serial_initfunc(altera_serial_initialize);
 serial_initfunc(atmel_serial_initialize);
 serial_initfunc(lpc32xx_serial_initialize);
+serial_initfunc(mcf_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -124,6 +125,7 @@ void serial_initialize(void)
 	altera_serial_initialize();
 	atmel_serial_initialize();
 	lpc32xx_serial_initialize();
+	mcf_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/mcfuart.c +59 -6

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#262 lore raw

PATCH v3 44/72 serial: Implement CONFIG_SERIAL_MULTI into ns9750 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into ns9750 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the ns9750 driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                |    2 ++
 drivers/serial/ns9750_serial.c |   65 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index fa16dce..c6a275d 100644
@@ -74,6 +74,7 @@ serial_initfunc(altera_serial_initialize);
 serial_initfunc(atmel_serial_initialize);
 serial_initfunc(lpc32xx_serial_initialize);
 serial_initfunc(mcf_serial_initialize);
+serial_initfunc(ns9750_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -126,6 +127,7 @@ void serial_initialize(void)
 	atmel_serial_initialize();
 	lpc32xx_serial_initialize();
 	mcf_serial_initialize();
+	ns9750_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/ns9750_serial.c +59 -6

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#263 lore raw

PATCH v3 45/72 serial: oc: Implement CONFIG_SERIAL_MULTI into OpenCores serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into OpenCores serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the OpenCores driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott McNutt <[email protected]>
---
 common/serial.c                 |    2 ++
 drivers/serial/opencores_yanu.c |   67 +++++++++++++++++++++++++++++++++++----
 2 files changed, 62 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index c6a275d..f217093 100644
@@ -75,6 +75,7 @@ serial_initfunc(atmel_serial_initialize);
 serial_initfunc(lpc32xx_serial_initialize);
 serial_initfunc(mcf_serial_initialize);
 serial_initfunc(ns9750_serial_initialize);
+serial_initfunc(oc_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -128,6 +129,7 @@ void serial_initialize(void)
 	lpc32xx_serial_initialize();
 	mcf_serial_initialize();
 	ns9750_serial_initialize();
+	oc_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/opencores_yanu.c +60 -7

112 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#264 lore raw

PATCH v3 46/72 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c4510b serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into s3c4510b serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the s3c4510b driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                |    2 ++
 drivers/serial/s3c4510b_uart.c |   65 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index f217093..d0a20e9 100644
@@ -76,6 +76,7 @@ serial_initfunc(lpc32xx_serial_initialize);
 serial_initfunc(mcf_serial_initialize);
 serial_initfunc(ns9750_serial_initialize);
 serial_initfunc(oc_serial_initialize);
+serial_initfunc(s3c4510b_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -130,6 +131,7 @@ void serial_initialize(void)
 	mcf_serial_initialize();
 	ns9750_serial_initialize();
 	oc_serial_initialize();
+	s3c4510b_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/s3c4510b_uart.c +59 -6

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#265 lore raw

PATCH v3 47/72 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c64xx serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into s3c64xx serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the s3c64xx driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc John Rigby <[email protected]>
Cc Minkyu Kang <[email protected]>
---
 common/serial.c          |    2 ++
 drivers/serial/s3c64xx.c |   65 +++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index d0a20e9..93d6a08 100644
@@ -77,6 +77,7 @@ serial_initfunc(mcf_serial_initialize);
 serial_initfunc(ns9750_serial_initialize);
 serial_initfunc(oc_serial_initialize);
 serial_initfunc(s3c4510b_serial_initialize);
+serial_initfunc(s3c64xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -132,6 +133,7 @@ void serial_initialize(void)
 	ns9750_serial_initialize();
 	oc_serial_initialize();
 	s3c4510b_serial_initialize();
+	s3c64xx_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/s3c64xx.c +59 -6

102 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#266 lore raw

PATCH v3 48/72 serial: sandbox: Implement CONFIG_SERIAL_MULTI into sandbox serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into sandbox serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the sandbox driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 common/serial.c          |    2 ++
 drivers/serial/sandbox.c |   67 +++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 63 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index 93d6a08..a7a3234 100644
@@ -78,6 +78,7 @@ serial_initfunc(ns9750_serial_initialize);
 serial_initfunc(oc_serial_initialize);
 serial_initfunc(s3c4510b_serial_initialize);
 serial_initfunc(s3c64xx_serial_initialize);
+serial_initfunc(sandbox_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -134,6 +135,7 @@ void serial_initialize(void)
 	oc_serial_initialize();
 	s3c4510b_serial_initialize();
 	s3c64xx_serial_initialize();
+	sandbox_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/sandbox.c +61 -6

96 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#267 lore raw

PATCH v3 49/72 serial: arm: Implement CONFIG_SERIAL_MULTI into clps7111 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into clps7111 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the clps7111 driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                  |    2 ++
 drivers/serial/serial_clps7111.c |   66 ++++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index a7a3234..4471262 100644
@@ -79,6 +79,7 @@ serial_initfunc(oc_serial_initialize);
 serial_initfunc(s3c4510b_serial_initialize);
 serial_initfunc(s3c64xx_serial_initialize);
 serial_initfunc(sandbox_serial_initialize);
+serial_initfunc(clps7111_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -136,6 +137,7 @@ void serial_initialize(void)
 	s3c4510b_serial_initialize();
 	s3c64xx_serial_initialize();
 	sandbox_serial_initialize();
+	clps7111_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_clps7111.c +59 -7

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#268 lore raw

PATCH v3 50/72 serial: arm: Implement CONFIG_SERIAL_MULTI into imx serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into imx serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the imx driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/serial.c             |    2 ++
 drivers/serial/serial_imx.c |   68 ++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 63 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index 4471262..cb8eacf 100644
@@ -80,6 +80,7 @@ serial_initfunc(s3c4510b_serial_initialize);
 serial_initfunc(s3c64xx_serial_initialize);
 serial_initfunc(sandbox_serial_initialize);
 serial_initfunc(clps7111_serial_initialize);
+serial_initfunc(imx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -138,6 +139,7 @@ void serial_initialize(void)
 	s3c64xx_serial_initialize();
 	sandbox_serial_initialize();
 	clps7111_serial_initialize();
+	imx_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_imx.c +61 -7

112 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#269 lore raw

PATCH v3 51/72 serial: arm: Implement CONFIG_SERIAL_MULTI into ixp serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into ixp serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the ixp driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Michael Schwingen <[email protected]>
---
 common/serial.c             |    2 ++
 drivers/serial/serial_ixp.c |   68 ++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 63 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index cb8eacf..3d8fa7f 100644
@@ -81,6 +81,7 @@ serial_initfunc(s3c64xx_serial_initialize);
 serial_initfunc(sandbox_serial_initialize);
 serial_initfunc(clps7111_serial_initialize);
 serial_initfunc(imx_serial_initialize);
+serial_initfunc(ixp_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -140,6 +141,7 @@ void serial_initialize(void)
 	sandbox_serial_initialize();
 	clps7111_serial_initialize();
 	imx_serial_initialize();
+	ixp_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_ixp.c +61 -7

112 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#270 lore raw

PATCH v3 52/72 serial: arm: Implement CONFIG_SERIAL_MULTI into ks8695 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into ks8695 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the ks8695 driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                |    2 ++
 drivers/serial/serial_ks8695.c |   73 +++++++++++++++++++++++++++++++++++-----
 2 files changed, 66 insertions(+), 9 deletions(-)
common/serial.c +2 -0
index 3d8fa7f..21c8ac3 100644
@@ -82,6 +82,7 @@ serial_initfunc(sandbox_serial_initialize);
 serial_initfunc(clps7111_serial_initialize);
 serial_initfunc(imx_serial_initialize);
 serial_initfunc(ixp_serial_initialize);
+serial_initfunc(ks8695_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -142,6 +143,7 @@ void serial_initialize(void)
 	clps7111_serial_initialize();
 	imx_serial_initialize();
 	ixp_serial_initialize();
+	ks8695_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_ks8695.c +64 -9

124 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#271 lore raw

PATCH v3 53/72 serial: arm: Implement CONFIG_SERIAL_MULTI into lh7a40x serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into lh7a40x serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the lh7a40x driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                 |    2 ++
 drivers/serial/serial_lh7a40x.c |   66 ++++++++++++++++++++++++++++++++++-----
 2 files changed, 61 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index 21c8ac3..59a8650 100644
@@ -83,6 +83,7 @@ serial_initfunc(clps7111_serial_initialize);
 serial_initfunc(imx_serial_initialize);
 serial_initfunc(ixp_serial_initialize);
 serial_initfunc(ks8695_serial_initialize);
+serial_initfunc(lh7a40x_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -144,6 +145,7 @@ void serial_initialize(void)
 	imx_serial_initialize();
 	ixp_serial_initialize();
 	ks8695_serial_initialize();
+	lh7a40x_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_lh7a40x.c +59 -7

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#272 lore raw

PATCH v3 54/72 serial: arm: Implement CONFIG_SERIAL_MULTI into lpc2292 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into lpc2292 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the lpc2292 driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                 |    2 ++
 drivers/serial/serial_lpc2292.c |   66 ++++++++++++++++++++++++++++++++++-----
 2 files changed, 61 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index 59a8650..23c8d22 100644
@@ -84,6 +84,7 @@ serial_initfunc(imx_serial_initialize);
 serial_initfunc(ixp_serial_initialize);
 serial_initfunc(ks8695_serial_initialize);
 serial_initfunc(lh7a40x_serial_initialize);
+serial_initfunc(lpc2292_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -146,6 +147,7 @@ void serial_initialize(void)
 	ixp_serial_initialize();
 	ks8695_serial_initialize();
 	lh7a40x_serial_initialize();
+	lpc2292_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_lpc2292.c +59 -7

101 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#273 lore raw

PATCH v3 55/72 serial: Implement CONFIG_SERIAL_MULTI into max3100 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into max3100 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the max3100 driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                 |    2 ++
 drivers/serial/serial_max3100.c |   72 +++++++++++++++++++++++++++++++--------
 2 files changed, 60 insertions(+), 14 deletions(-)
common/serial.c +2 -0
index 23c8d22..f007d13 100644
@@ -85,6 +85,7 @@ serial_initfunc(ixp_serial_initialize);
 serial_initfunc(ks8695_serial_initialize);
 serial_initfunc(lh7a40x_serial_initialize);
 serial_initfunc(lpc2292_serial_initialize);
+serial_initfunc(max3100_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -148,6 +149,7 @@ void serial_initialize(void)
 	ks8695_serial_initialize();
 	lh7a40x_serial_initialize();
 	lpc2292_serial_initialize();
+	max3100_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_max3100.c +58 -14

123 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#274 lore raw

PATCH v3 56/72 serial: arm: Implement CONFIG_SERIAL_MULTI into mxc serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into mxc serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the mxc driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/serial.c             |    2 ++
 drivers/serial/serial_mxc.c |   68 ++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 63 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index f007d13..566a3cc 100644
@@ -86,6 +86,7 @@ serial_initfunc(ks8695_serial_initialize);
 serial_initfunc(lh7a40x_serial_initialize);
 serial_initfunc(lpc2292_serial_initialize);
 serial_initfunc(max3100_serial_initialize);
+serial_initfunc(mxc_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -150,6 +151,7 @@ void serial_initialize(void)
 	lh7a40x_serial_initialize();
 	lpc2292_serial_initialize();
 	max3100_serial_initialize();
+	mxc_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_mxc.c +61 -7

113 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#275 lore raw

PATCH v3 57/72 serial: arm: Implement CONFIG_SERIAL_MULTI into netarm serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into netarm serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the netarm driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/serial.c                |    2 ++
 drivers/serial/serial_netarm.c |   65 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index 566a3cc..c033cf0 100644
@@ -87,6 +87,7 @@ serial_initfunc(lh7a40x_serial_initialize);
 serial_initfunc(lpc2292_serial_initialize);
 serial_initfunc(max3100_serial_initialize);
 serial_initfunc(mxc_serial_initialize);
+serial_initfunc(netarm_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -152,6 +153,7 @@ void serial_initialize(void)
 	lpc2292_serial_initialize();
 	max3100_serial_initialize();
 	mxc_serial_initialize();
+	netarm_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_netarm.c +59 -6

103 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#276 lore raw

PATCH v3 58/72 serial: arm: Implement CONFIG_SERIAL_MULTI into pl01x serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into pl01x serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the pl01x driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Mathieu J. Poirier <[email protected]>
Cc Linus Walleij <[email protected]>
Cc John Rigby <[email protected]>
Cc Rabin Vincent <[email protected]>
---
 common/serial.c               |    2 ++
 drivers/serial/serial_pl01x.c |   69 ++++++++++++++++++++++++++++++++++++-----
 2 files changed, 64 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index c033cf0..48e6044 100644
@@ -88,6 +88,7 @@ serial_initfunc(lpc2292_serial_initialize);
 serial_initfunc(max3100_serial_initialize);
 serial_initfunc(mxc_serial_initialize);
 serial_initfunc(netarm_serial_initialize);
+serial_initfunc(pl01x_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -154,6 +155,7 @@ void serial_initialize(void)
 	max3100_serial_initialize();
 	mxc_serial_initialize();
 	netarm_serial_initialize();
+	pl01x_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_pl01x.c +62 -7

116 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#277 lore raw

PATCH v3 59/72 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c44b0 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into s3c44b0 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the s3c44b0 driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                 |    2 ++
 drivers/serial/serial_s3c44b0.c |   68 ++++++++++++++++++++++++++++++++++-----
 2 files changed, 62 insertions(+), 8 deletions(-)
common/serial.c +2 -0
index 48e6044..1953aaf 100644
@@ -89,6 +89,7 @@ serial_initfunc(max3100_serial_initialize);
 serial_initfunc(mxc_serial_initialize);
 serial_initfunc(netarm_serial_initialize);
 serial_initfunc(pl01x_serial_initialize);
+serial_initfunc(s3c44b0_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -156,6 +157,7 @@ void serial_initialize(void)
 	mxc_serial_initialize();
 	netarm_serial_initialize();
 	pl01x_serial_initialize();
+	s3c44b0_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_s3c44b0.c +60 -8

110 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#278 lore raw

PATCH v3 60/72 serial: arm: Implement CONFIG_SERIAL_MULTI into sa1100 serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into sa1100 serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the sa1100 driver. Also, add a weak implementation of default_serial_console() returning this driver.

---
 common/serial.c                |    2 ++
 drivers/serial/serial_sa1100.c |   68 +++++++++++++++++++++++++++++++++++-----
 2 files changed, 63 insertions(+), 7 deletions(-)
common/serial.c +2 -0
index 1953aaf..3dae01b 100644
@@ -90,6 +90,7 @@ serial_initfunc(mxc_serial_initialize);
 serial_initfunc(netarm_serial_initialize);
 serial_initfunc(pl01x_serial_initialize);
 serial_initfunc(s3c44b0_serial_initialize);
+serial_initfunc(sa1100_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -158,6 +159,7 @@ void serial_initialize(void)
 	netarm_serial_initialize();
 	pl01x_serial_initialize();
 	s3c44b0_serial_initialize();
+	sa1100_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_sa1100.c +61 -7

109 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#279 lore raw

PATCH v3 61/72 serial: sh: Implement CONFIG_SERIAL_MULTI into sh serial driver

In reply to Marek Vasut

Implement support for CONFIG_SERIAL_MULTI into sh serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the sh driver. Also, add a weak implementation of default_serial_console() returning this driver.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Phil Edworthy <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
---
 common/serial.c            |    2 ++
 drivers/serial/serial_sh.c |   65 ++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index 3dae01b..631af65 100644
@@ -91,6 +91,7 @@ serial_initfunc(netarm_serial_initialize);
 serial_initfunc(pl01x_serial_initialize);
 serial_initfunc(s3c44b0_serial_initialize);
 serial_initfunc(sa1100_serial_initialize);
+serial_initfunc(sh_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -160,6 +161,7 @@ void serial_initialize(void)
 	pl01x_serial_initialize();
 	s3c44b0_serial_initialize();
 	sa1100_serial_initialize();
+	sh_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_sh.c +59 -6

103 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#280 lore raw

PATCH v3 62/72 serial: mxs: spl: Remove empty serial_* functions from SPL code

In reply to Marek Vasut

Remove the empty bodies from serial_* functions from MXS SPL code. These empty implementations are now in common/serial.c instead so declaring them also in the SPL code would cause a colision once serial multi is enabled unconditionally.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/arm926ejs/mxs/spl_boot.c |    4 ----
 1 file changed, 4 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_boot.c +0 -4
index ad66c57..8ea7c36 100644
@@ -124,10 +124,6 @@ inline void board_init_r(gd_t *id, ulong dest_addr)
 		;
 }
 
-#ifndef CONFIG_SPL_SERIAL_SUPPORT
-void serial_putc(const char c) {}
-void serial_puts(const char *s) {}
-#endif
 void hang(void) __attribute__ ((noreturn));
 void hang(void)
 {
Signature · 1 line
1.7.10.4
#281 lore raw

PATCH v3 63/72 serial: Use puts() and hang() instead of panic() in SPL

In reply to Marek Vasut

If case the get_current() call fails before relocation, the U-Boot must try to print an error message, fail and either reset or halt. Such error is critical enough to halt the system, as it means the system is in very bad state.

This is now also used in SPL, since CONFIG_SERIAL_MULTI is enabled unconditionally. To avoid compiling whole vsprintf.c into SPL, use puts() to print error message and hang() to stop the system in case of SPL build.

---
 common/serial.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
common/serial.c +8 -2
index 631af65..91c7269 100644
@@ -220,8 +220,14 @@ static struct serial_device *get_current(void)
 		dev = default_serial_console();
 
 		/* We must have a console device */
-		if (!dev)
-			panic("Cannot find console");
+		if (!dev) {
+#ifdef CONFIG_SPL_BUILD
+			puts("Cannot find console\n");
+			hang();
+#else
+			panic("Cannot find console\n");
+#endif
+		}
 	} else
 		dev = serial_current;
 	return dev;
Signature · 1 line
1.7.10.4
#282 lore raw

PATCH v3 64/72 serial: ns16550: Call usbtty_poll only in non-SPL build

In reply to Marek Vasut

Having both USBTTY and CONFIG_SERIAL_MULTI enabled in SPL, the usbtty.c file is protected in Makefile to not be compiled into the SPL. Yet, the ns16550 serial driver does not contain such protection. Add it to avoid missing symbol error.

---
 drivers/serial/ns16550.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/serial/ns16550.c +1 -1
index facadd2..9027781 100644
@@ -101,7 +101,7 @@ void NS16550_putc(NS16550_t com_port, char c)
 char NS16550_getc(NS16550_t com_port)
 {
 	while ((serial_in(&com_port->lsr) & UART_LSR_DR) == 0) {
-#ifdef CONFIG_USB_TTY
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_USB_TTY)
 		extern void usbtty_poll(void);
 		usbtty_poll();
 #endif
Signature · 1 line
1.7.10.4
#283 lore raw

PATCH v3 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c

In reply to Marek Vasut

This serial driver had wrong name of the source file for some time now. The name of the driver was serial.c instead of any more logical and fitting name. Thus, rename the driver source file to serial_ns16550.c and be done with it.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Michal Simek <[email protected]>
---
 drivers/serial/Makefile         |    2 +-
 drivers/serial/serial.c         |  359 ---------------------------------------
 drivers/serial/serial_ns16550.c |  359 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 360 insertions(+), 360 deletions(-)
 delete mode 100644 drivers/serial/serial.c
 create mode 100644 drivers/serial/serial_ns16550.c
drivers/serial/Makefile +1 -1
index 65d0f23..d93e81b 100644
@@ -37,7 +37,7 @@ COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_S5P) += serial_s5p.o
-COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
+COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o
 COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
 COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
drivers/serial/serial.c deleted +0 -359

359 lines not on this page · raw message

drivers/serial/serial_ns16550.c new file +359 -0

359 lines not on this page · raw message

Signature · 1 line
1.7.10.4
maintainer
#284 lore raw

PATCH 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c

Quoted 478 lines · Marek Vasut

This serial driver had wrong name of the source file for some time now. The name of the driver was serial.c instead of any more logical and fitting name. Thus, rename the driver source file to serial_ns16550.c and be done with it.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Michal Simek <[email protected]>
---
  drivers/serial/Makefile         |    2 +-
  drivers/serial/serial.c         |  359 ---------------------------------------
  drivers/serial/serial_ns16550.c |  359 +++++++++++++++++++++++++++++++++++++++
  3 files changed, 360 insertions(+), 360 deletions(-)

delete mode 100644 drivers/serial/serial.c create mode 100644 drivers/serial/serial_ns16550.c

drivers/serial/Makefile +1 -1
index 65d0f23..d93e81b 100644
@@ -37,7 +37,7 @@ COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
  COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
  COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
  COBJS-$(CONFIG_S5P) += serial_s5p.o
-COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
+COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o
  COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
  COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
  COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
drivers/serial/serial.c deleted +0 -359
deleted file mode 100644
index 00ad97c..0000000
@@ -1,359 +0,0 @@
-/*
- * (C) Copyright 2000
- * Rob Taylor, Flying Pig Systems. robt at flyingpig.com.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <linux/compiler.h>
-
-#include <ns16550.h>
-#ifdef CONFIG_NS87308
-#include <ns87308.h>
-#endif
-
-#if defined (CONFIG_SERIAL_MULTI)
-#include <serial.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#if !defined(CONFIG_CONS_INDEX)
-#if defined (CONFIG_SERIAL_MULTI)
-/*   with CONFIG_SERIAL_MULTI we might have no console
- *  on these devices
- */
-#else
-#error	"No console index specified."
-#endif /* CONFIG_SERIAL_MULTI */
-#elif (CONFIG_CONS_INDEX < 1) || (CONFIG_CONS_INDEX > 4)
-#error	"Invalid console index value."
-#endif
-
-#if CONFIG_CONS_INDEX == 1 && !defined(CONFIG_SYS_NS16550_COM1)
-#error	"Console port 1 defined but not configured."
-#elif CONFIG_CONS_INDEX == 2 && !defined(CONFIG_SYS_NS16550_COM2)
-#error	"Console port 2 defined but not configured."
-#elif CONFIG_CONS_INDEX == 3 && !defined(CONFIG_SYS_NS16550_COM3)
-#error	"Console port 3 defined but not configured."
-#elif CONFIG_CONS_INDEX == 4 && !defined(CONFIG_SYS_NS16550_COM4)
-#error	"Console port 4 defined but not configured."
-#endif
-
-/* Note: The port number specified in the functions is 1 based.
- *	 the array is 0 based.
- */
-static NS16550_t serial_ports[4] = {
-#ifdef CONFIG_SYS_NS16550_COM1
-	(NS16550_t)CONFIG_SYS_NS16550_COM1,
-#else
-	NULL,
-#endif
-#ifdef CONFIG_SYS_NS16550_COM2
-	(NS16550_t)CONFIG_SYS_NS16550_COM2,
-#else
-	NULL,
-#endif
-#ifdef CONFIG_SYS_NS16550_COM3
-	(NS16550_t)CONFIG_SYS_NS16550_COM3,
-#else
-	NULL,
-#endif
-#ifdef CONFIG_SYS_NS16550_COM4
-	(NS16550_t)CONFIG_SYS_NS16550_COM4
-#else
-	NULL
-#endif
-};
-
-#define PORT	serial_ports[port-1]
-
-#if defined(CONFIG_SERIAL_MULTI)
-
-/* Multi serial device functions */
-#define DECLARE_ESERIAL_FUNCTIONS(port) \
-    int  eserial##port##_init (void) {\
-	int clock_divisor; \
-	clock_divisor = calc_divisor(serial_ports[port-1]); \
-	NS16550_init(serial_ports[port-1], clock_divisor); \
-	return(0);}\
-    void eserial##port##_setbrg (void) {\
-	serial_setbrg_dev(port);}\
-    int  eserial##port##_getc (void) {\
-	return serial_getc_dev(port);}\
-    int  eserial##port##_tstc (void) {\
-	return serial_tstc_dev(port);}\
-    void eserial##port##_putc (const char c) {\
-	serial_putc_dev(port, c);}\
-    void eserial##port##_puts (const char *s) {\
-	serial_puts_dev(port, s);}
-
-/* Serial device descriptor */
-#define INIT_ESERIAL_STRUCTURE(port, __name) {	\
-	.name	= __name,			\
-	.start	= eserial##port##_init,		\
-	.stop	= NULL,				\
-	.setbrg	= eserial##port##_setbrg,	\
-	.getc	= eserial##port##_getc,		\
-	.tstc	= eserial##port##_tstc,		\
-	.putc	= eserial##port##_putc,		\
-	.puts	= eserial##port##_puts,		\
-}
-
-#endif /* CONFIG_SERIAL_MULTI */
-
-static int calc_divisor (NS16550_t port)
-{
-#ifdef CONFIG_OMAP1510
-	/* If can't cleanly clock 115200 set div to 1 */
-	if ((CONFIG_SYS_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) {
-		port->osc_12m_sel = OSC_12M_SEL;	/* enable 6.5 * divisor */
-		return (1);				/* return 1 for base divisor */
-	}
-	port->osc_12m_sel = 0;			/* clear if previsouly set */
-#endif
-#ifdef CONFIG_OMAP1610
-	/* If can't cleanly clock 115200 set div to 1 */
-	if ((CONFIG_SYS_NS16550_CLK == 48000000) && (gd->baudrate == 115200)) {
-		return (26);		/* return 26 for base divisor */
-	}
-#endif
-
-#ifdef CONFIG_APTIX
-#define MODE_X_DIV 13
-#else
-#define MODE_X_DIV 16
-#endif
-
-	/* Compute divisor value. Normally, we should simply return:
-	 *   CONFIG_SYS_NS16550_CLK) / MODE_X_DIV / gd->baudrate
-	 * but we need to round that value by adding 0.5.
-	 * Rounding is especially important at high baud rates.
-	 */
-	return (CONFIG_SYS_NS16550_CLK + (gd->baudrate * (MODE_X_DIV / 2))) /
-		(MODE_X_DIV * gd->baudrate);
-}
-
-#if !defined(CONFIG_SERIAL_MULTI)
-int serial_init (void)
-{
-	int clock_divisor;
-
-#ifdef CONFIG_NS87308
-	initialise_ns87308();
-#endif
-
-#ifdef CONFIG_SYS_NS16550_COM1
-	clock_divisor = calc_divisor(serial_ports[0]);
-	NS16550_init(serial_ports[0], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_NS16550_COM2
-	clock_divisor = calc_divisor(serial_ports[1]);
-	NS16550_init(serial_ports[1], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_NS16550_COM3
-	clock_divisor = calc_divisor(serial_ports[2]);
-	NS16550_init(serial_ports[2], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_NS16550_COM4
-	clock_divisor = calc_divisor(serial_ports[3]);
-	NS16550_init(serial_ports[3], clock_divisor);
-#endif
-
-	return (0);
-}
-#endif
-
-void
-_serial_putc(const char c,const int port)
-{
-	if (c == '\n')
-		NS16550_putc(PORT, '\r');
-
-	NS16550_putc(PORT, c);
-}
-
-void
-_serial_putc_raw(const char c,const int port)
-{
-	NS16550_putc(PORT, c);
-}
-
-void
-_serial_puts (const char *s,const int port)
-{
-	while (*s) {
-		_serial_putc (*s++,port);
-	}
-}
-
-
-int
-_serial_getc(const int port)
-{
-	return NS16550_getc(PORT);
-}
-
-int
-_serial_tstc(const int port)
-{
-	return NS16550_tstc(PORT);
-}
-
-void
-_serial_setbrg (const int port)
-{
-	int clock_divisor;
-
-	clock_divisor = calc_divisor(PORT);
-	NS16550_reinit(PORT, clock_divisor);
-}
-
-#if defined(CONFIG_SERIAL_MULTI)
-static inline void
-serial_putc_dev(unsigned int dev_index,const char c)
-{
-	_serial_putc(c,dev_index);
-}
-#else
-void
-serial_putc(const char c)
-{
-	_serial_putc(c,CONFIG_CONS_INDEX);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-static inline void
-serial_putc_raw_dev(unsigned int dev_index,const char c)
-{
-	_serial_putc_raw(c,dev_index);
-}
-#else
-void
-serial_putc_raw(const char c)
-{
-	_serial_putc_raw(c,CONFIG_CONS_INDEX);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-static inline void
-serial_puts_dev(unsigned int dev_index,const char *s)
-{
-	_serial_puts(s,dev_index);
-}
-#else
-void
-serial_puts(const char *s)
-{
-	_serial_puts(s,CONFIG_CONS_INDEX);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-static inline int
-serial_getc_dev(unsigned int dev_index)
-{
-	return _serial_getc(dev_index);
-}
-#else
-int
-serial_getc(void)
-{
-	return _serial_getc(CONFIG_CONS_INDEX);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-static inline int
-serial_tstc_dev(unsigned int dev_index)
-{
-	return _serial_tstc(dev_index);
-}
-#else
-int
-serial_tstc(void)
-{
-	return _serial_tstc(CONFIG_CONS_INDEX);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-static inline void
-serial_setbrg_dev(unsigned int dev_index)
-{
-	_serial_setbrg(dev_index);
-}
-#else
-void
-serial_setbrg(void)
-{
-	_serial_setbrg(CONFIG_CONS_INDEX);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-
-DECLARE_ESERIAL_FUNCTIONS(1);
-struct serial_device eserial1_device =
-	INIT_ESERIAL_STRUCTURE(1, "eserial0");
-DECLARE_ESERIAL_FUNCTIONS(2);
-struct serial_device eserial2_device =
-	INIT_ESERIAL_STRUCTURE(2, "eserial1");
-DECLARE_ESERIAL_FUNCTIONS(3);
-struct serial_device eserial3_device =
-	INIT_ESERIAL_STRUCTURE(3, "eserial2");
-DECLARE_ESERIAL_FUNCTIONS(4);
-struct serial_device eserial4_device =
-	INIT_ESERIAL_STRUCTURE(4, "eserial3");
-
-__weak struct serial_device *default_serial_console(void)
-{
-#if CONFIG_CONS_INDEX == 1
-	return &eserial1_device;
-#elif CONFIG_CONS_INDEX == 2
-	return &eserial2_device;
-#elif CONFIG_CONS_INDEX == 3
-	return &eserial3_device;
-#elif CONFIG_CONS_INDEX == 4
-	return &eserial4_device;
-#else
-#error "Bad CONFIG_CONS_INDEX."
-#endif
-}
-
-void ns16550_serial_initialize(void)
-{
-#if defined(CONFIG_SYS_NS16550_COM1)
-	serial_register(&eserial1_device);
-#endif
-#if defined(CONFIG_SYS_NS16550_COM2)
-	serial_register(&eserial2_device);
-#endif
-#if defined(CONFIG_SYS_NS16550_COM3)
-	serial_register(&eserial3_device);
-#endif
-#if defined(CONFIG_SYS_NS16550_COM4)
-	serial_register(&eserial4_device);
-#endif
-}
-
-#endif /* CONFIG_SERIAL_MULTI */
drivers/serial/serial_ns16550.c new file +74 -0
new file mode 100644
index 0000000..00ad97c
@@ -0,0 +1,359 @@
+/*
+ * (C) Copyright 2000
+ * Rob Taylor, Flying Pig Systems. robt at flyingpig.com.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <linux/compiler.h>
+
+#include <ns16550.h>
+#ifdef CONFIG_NS87308
+#include <ns87308.h>
+#endif
+
+#if defined (CONFIG_SERIAL_MULTI)
+#include <serial.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#if !defined(CONFIG_CONS_INDEX)
+#if defined (CONFIG_SERIAL_MULTI)
+/*   with CONFIG_SERIAL_MULTI we might have no console
+ *  on these devices
+ */
+#else
+#error	"No console index specified."
+#endif /* CONFIG_SERIAL_MULTI */
+#elif (CONFIG_CONS_INDEX < 1) || (CONFIG_CONS_INDEX > 4)
+#error	"Invalid console index value."
+#endif
+
+#if CONFIG_CONS_INDEX == 1 && !defined(CONFIG_SYS_NS16550_COM1)
+#error	"Console port 1 defined but not configured."
+#elif CONFIG_CONS_INDEX == 2 && !defined(CONFIG_SYS_NS16550_COM2)
+#error	"Console port 2 defined but not configured."
+#elif CONFIG_CONS_INDEX == 3 && !defined(CONFIG_SYS_NS16550_COM3)
+#error	"Console port 3 defined but not configured."
+#elif CONFIG_CONS_INDEX == 4 && !defined(CONFIG_SYS_NS16550_COM4)
+#error	"Console port 4 defined but not configured."
+#endif
+
+/* Note: The port number specified in the functions is 1 based.
+ *	 the array is 0 based.
+ */
+static NS16550_t serial_ports[4] = {
+#ifdef CONFIG_SYS_NS16550_COM1
+	(NS16550_t)CONFIG_SYS_NS16550_COM1,
+#else
+	NULL,
+#endif
+#ifdef CONFIG_SYS_NS16550_COM2
+	(NS16550_t)CONFIG_SYS_NS16550_COM2,
+#else
+	NULL,
+#endif
+#ifdef CONFIG_SYS_NS16550_COM3

drivers/serial/serial_ns16550.c line 84

Quoted 10 lines
drivers/serial/serial_ns16550.c new file +10 -0
+	(NS16550_t)CONFIG_SYS_NS16550_COM3,
+#else
+	NULL,
+#endif
+#ifdef CONFIG_SYS_NS16550_COM4
+	(NS16550_t)CONFIG_SYS_NS16550_COM4
+#else
+	NULL
+#endif
+};

Would it be better just use this structure?

#ifdef CONFIG_SYS_NS16550_COM1
        [0] = (NS16550_t)CONFIG_SYS_NS16550_COM1,

#endif

Quoted 91 lines
drivers/serial/serial_ns16550.c new file +91 -0
+
+#define PORT	serial_ports[port-1]
+
+#if defined(CONFIG_SERIAL_MULTI)
+
+/* Multi serial device functions */
+#define DECLARE_ESERIAL_FUNCTIONS(port) \
+    int  eserial##port##_init (void) {\
+	int clock_divisor; \
+	clock_divisor = calc_divisor(serial_ports[port-1]); \
+	NS16550_init(serial_ports[port-1], clock_divisor); \
+	return(0);}\
+    void eserial##port##_setbrg (void) {\
+	serial_setbrg_dev(port);}\
+    int  eserial##port##_getc (void) {\
+	return serial_getc_dev(port);}\
+    int  eserial##port##_tstc (void) {\
+	return serial_tstc_dev(port);}\
+    void eserial##port##_putc (const char c) {\
+	serial_putc_dev(port, c);}\
+    void eserial##port##_puts (const char *s) {\
+	serial_puts_dev(port, s);}
+
+/* Serial device descriptor */
+#define INIT_ESERIAL_STRUCTURE(port, __name) {	\
+	.name	= __name,			\
+	.start	= eserial##port##_init,		\
+	.stop	= NULL,				\
+	.setbrg	= eserial##port##_setbrg,	\
+	.getc	= eserial##port##_getc,		\
+	.tstc	= eserial##port##_tstc,		\
+	.putc	= eserial##port##_putc,		\
+	.puts	= eserial##port##_puts,		\
+}
+
+#endif /* CONFIG_SERIAL_MULTI */
+
+static int calc_divisor (NS16550_t port)
+{
+#ifdef CONFIG_OMAP1510
+	/* If can't cleanly clock 115200 set div to 1 */
+	if ((CONFIG_SYS_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) {
+		port->osc_12m_sel = OSC_12M_SEL;	/* enable 6.5 * divisor */
+		return (1);				/* return 1 for base divisor */
+	}
+	port->osc_12m_sel = 0;			/* clear if previsouly set */
+#endif
+#ifdef CONFIG_OMAP1610
+	/* If can't cleanly clock 115200 set div to 1 */
+	if ((CONFIG_SYS_NS16550_CLK == 48000000) && (gd->baudrate == 115200)) {
+		return (26);		/* return 26 for base divisor */
+	}
+#endif
+
+#ifdef CONFIG_APTIX
+#define MODE_X_DIV 13
+#else
+#define MODE_X_DIV 16
+#endif
+
+	/* Compute divisor value. Normally, we should simply return:
+	 *   CONFIG_SYS_NS16550_CLK) / MODE_X_DIV / gd->baudrate
+	 * but we need to round that value by adding 0.5.
+	 * Rounding is especially important at high baud rates.
+	 */
+	return (CONFIG_SYS_NS16550_CLK + (gd->baudrate * (MODE_X_DIV / 2))) /
+		(MODE_X_DIV * gd->baudrate);
+}
+
+#if !defined(CONFIG_SERIAL_MULTI)
+int serial_init (void)
+{
+	int clock_divisor;
+
+#ifdef CONFIG_NS87308
+	initialise_ns87308();
+#endif
+
+#ifdef CONFIG_SYS_NS16550_COM1
+	clock_divisor = calc_divisor(serial_ports[0]);
+	NS16550_init(serial_ports[0], clock_divisor);
+#endif
+#ifdef CONFIG_SYS_NS16550_COM2
+	clock_divisor = calc_divisor(serial_ports[1]);
+	NS16550_init(serial_ports[1], clock_divisor);
+#endif
+#ifdef CONFIG_SYS_NS16550_COM3
+	clock_divisor = calc_divisor(serial_ports[2]);
+	NS16550_init(serial_ports[2], clock_divisor);
+#endif
+#ifdef CONFIG_SYS_NS16550_COM4

drivers/serial/serial_ns16550.c line 185

Quoted 10 lines
drivers/serial/serial_ns16550.c new file +10 -0
+	clock_divisor = calc_divisor(serial_ports[3]);
+	NS16550_init(serial_ports[3], clock_divisor);
+#endif
+
+	return (0);
+}
+#endif
+
+void
+_serial_putc(const char c,const int port)

You are using two coding styles in this file.
One has function return value on one line and then function name and the second function return value on one line with function name. Will be good to unify it to look the same in the whole file.

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
#285 lore raw

PATCH v3 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c

Dear Michal Simek,

[...]

Quoted 1 line

You are using two coding styles in this file.

Won't surprise me if there were even more.

Quoted 3 lines

One has function return value on one line and then function name and the second function return value on one line with function name. Will be good to unify it to look the same in the whole file.

Yes, but definitelly not as a part of unintrusive conversion patch. This file has so much legacy and look so crappy it needs proper fixing. Patch is welcome %^)

Quoted 2 lines

Thanks,
Michal

Best regards,
Marek Vasut

#286 lore raw

PATCH v3 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c

In reply to Michal Simek

Dear Michal Simek,

[...]

Quoted 6 lines

Would it be better just use this structure?

#ifdef CONFIG_SYS_NS16550_COM1
        [0] = (NS16550_t)CONFIG_SYS_NS16550_COM1,

#endif

[...]

Quoted 5 lines

You are using two coding styles in this file.
One has function return value on one line and then function name and the second function return value on one line with function name. Will be good to unify it to look the same in the whole file.

Yes, wholeheartedly agree! But (!) I don't want to clean up this file in this patchset.

Quoted 2 lines

Thanks,
Michal

Best regards,
Marek Vasut

#287 lore raw

PATCH v3 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c

In reply to Marek Vasut
Quoted 5 lines · Marek Vasut

This serial driver had wrong name of the source file for some time now. The name of the driver was serial.c instead of any more logical and fitting name. Thus, rename the driver source file to serial_ns16550.c and be done with it.

Quoted 7 lines
Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Michal Simek <[email protected]>

After checking with Marek on IRC, this is a pure rename and he just forgot -M -C when posting the series. So while Michal's comments about better formatting, etc, are true, it's beyond the scope of this "just do a rename" patch.

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/20121001/12e82034/attachment.pgp>
maintainer
#288 lore raw

PATCH 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c

Quoted 15 lines · Tom Rini
Quoted 5 lines · Marek Vasut

This serial driver had wrong name of the source file for some time now. The name of the driver was serial.c instead of any more logical and fitting name. Thus, rename the driver source file to serial_ns16550.c and be done with it.

Quoted 7 lines
Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Michal Simek <[email protected]>
Quoted 4 lines

After checking with Marek on IRC, this is a pure rename and he just forgot -M -C when posting the series. So while Michal's comments about better formatting, etc, are true, it's beyond the scope of this "just do a rename" patch.

No problem with that.

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
#289 lore raw

PATCH v3 66/72 serial: Move common/serial.c to drivers/serial/

In reply to Marek Vasut

Move the common/serial.c into driver/serial/, since this file provides serial multiplexing functions and it is imperative to be linked with libserial.o instead of libcommon.o.

---
 common/Makefile         |    1 -
 common/serial.c         |  352 -----------------------------------------------
 drivers/serial/Makefile |    4 +
 drivers/serial/serial.c |  352 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 356 insertions(+), 353 deletions(-)
 delete mode 100644 common/serial.c
 create mode 100644 drivers/serial/serial.c
common/Makefile +0 -1
index b56df1d..6afe131 100644
@@ -32,7 +32,6 @@ COBJS-y += command.o
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += s_record.o
-COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
 COBJS-y += xyzModem.o
 COBJS-y += cmd_disk.o
 
common/serial.c deleted +0 -352

352 lines not on this page · raw message

drivers/serial/Makefile +4 -0
index d93e81b..1491d43 100644
@@ -25,6 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libserial.o
 
+ifndef CONFIG_SPL_BUILD
+COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
+endif
+
 COBJS-$(CONFIG_ALTERA_UART) += altera_uart.o
 COBJS-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
 COBJS-$(CONFIG_ARM_DCC) += arm_dcc.o
drivers/serial/serial.c new file +352 -0

352 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#290 lore raw

PATCH v3 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI

In reply to Marek Vasut

Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes both SPL builds and non-SPL builds, everything. To avoid poluting this patch with removal of ifdef-endif constructions containing CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added into CPPFLAGS in config.mk . This will be again removed in following patch.

---
 config.mk               |    2 +-
 drivers/serial/Makefile |    2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
config.mk +1 -1
index c3822a2..88c72f1 100644
@@ -193,7 +193,7 @@ OBJCFLAGS += --gap-fill=0xff
 gccincdir := $(shell $(CC) -print-file-name=include)
 
 CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)		\
-	-D__KERNEL__
+	-D__KERNEL__ -DCONFIG_SERIAL_MULTI
 
 # Enable garbage collection of un-used sections for SPL
 ifeq ($(CONFIG_SPL_BUILD),y)
drivers/serial/Makefile +0 -2
index 1491d43..9b54c12 100644
@@ -25,9 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libserial.o
 
-ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
-endif
 
 COBJS-$(CONFIG_ALTERA_UART) += altera_uart.o
 COBJS-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
Signature · 1 line
1.7.10.4
#291 lore raw

PATCH 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI

Quoted 6 lines · Marek Vasut

Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes both SPL builds and non-SPL builds, everything. To avoid poluting this patch with removal of ifdef-endif constructions containing CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added into CPPFLAGS in config.mk . This will be again removed in following patch.

Marek,

This patch (at least, the version of it checked into u-boot/next) breaks U-Boot on Tegra.

I believe the reason is because nothing ever calls serial_initialize() in the SPL on Tegra. If I edit arch/arm/cpu/arm720t/tegra20/spl.c function preloader_console_init() to call serial_initialize() right before it calls serial_init(), then everything works fine. Without this, drivers/serial/serial.c is never initialised (not even BSS cleared!) and so it's left set to some bogus value, and so get_current() doesn't replace it with default_serial_console(), so an invalid pointer is accessed, causing a hang or crash.

I'm not sure quite what the correct solution is here. Is Tegra's custom spl.c doing too much; stuff that should come from the common spl.c is cut/paste here? Or, is adding the call to serial_initialize() the correct fix? Or, is the root-cause of the problem that BSS (serial_current) isn't being cleared to 0?

Thanks for any pointers.

#292 lore raw

PATCH v3 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI

Quoted 22 lines · Stephen Warren
Quoted 6 lines · Marek Vasut

Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes both SPL builds and non-SPL builds, everything. To avoid poluting this patch with removal of ifdef-endif constructions containing CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added into CPPFLAGS in config.mk . This will be again removed in following patch.

Marek,

This patch (at least, the version of it checked into u-boot/next) breaks U-Boot on Tegra.

I believe the reason is because nothing ever calls serial_initialize() in the SPL on Tegra. If I edit arch/arm/cpu/arm720t/tegra20/spl.c function preloader_console_init() to call serial_initialize() right before it calls serial_init(), then everything works fine. Without this, drivers/serial/serial.c is never initialised (not even BSS cleared!) and so it's left set to some bogus value, and so get_current() doesn't replace it with default_serial_console(), so an invalid pointer is accessed, causing a hang or crash.

Quoted 5 lines

I'm not sure quite what the correct solution is here. Is Tegra's custom spl.c doing too much; stuff that should come from the common spl.c is cut/paste here? Or, is adding the call to serial_initialize() the correct fix? Or, is the root-cause of the problem that BSS (serial_current) isn't being cleared to 0?

Tegra SPL needs to either be updated ala common/spl/ (preloader_console_init() calls serial_init()) or switched over to it.

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/20121009/2432dbde/attachment.pgp>
#293 lore raw

PATCH 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI

Quoted 30 lines · Tom Rini
Quoted 23 lines · Stephen Warren
Quoted 6 lines · Marek Vasut

Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes both SPL builds and non-SPL builds, everything. To avoid poluting this patch with removal of ifdef-endif constructions containing CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added into CPPFLAGS in config.mk . This will be again removed in following patch.

Marek,

This patch (at least, the version of it checked into u-boot/next) breaks U-Boot on Tegra.

I believe the reason is because nothing ever calls serial_initialize() in the SPL on Tegra. If I edit arch/arm/cpu/arm720t/tegra20/spl.c function preloader_console_init() to call serial_initialize() right before it calls serial_init(), then everything works fine. Without this, drivers/serial/serial.c is never initialised (not even BSS cleared!) and so it's left set to some bogus value, and so get_current() doesn't replace it with default_serial_console(), so an invalid pointer is accessed, causing a hang or crash.

Quoted 5 lines

I'm not sure quite what the correct solution is here. Is Tegra's custom spl.c doing too much; stuff that should come from the common spl.c is cut/paste here? Or, is adding the call to serial_initialize() the correct fix? Or, is the root-cause of the problem that BSS (serial_current) isn't being cleared to 0?

Quoted 3 lines

Tegra SPL needs to either be updated ala common/spl/ (preloader_console_init() calls serial_init()) or switched over to it.

Hmm, well it's already calling serial_init() just not serial_initialize(). Perhaps the issue is the following code missing from Tegra's SPL:

	/* Clear the BSS. */
	memset(__bss_start, 0, __bss_end__ - __bss_start);

Anyway, I'll let Allen take a look at it, since he's most familiar with Tegra SPL.

#294 lore raw

PATCH v3 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 41 lines · Stephen Warren
Quoted 32 lines · Tom Rini
Quoted 24 lines · Stephen Warren
Quoted 6 lines · Marek Vasut

Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes both SPL builds and non-SPL builds, everything. To avoid poluting this patch with removal of ifdef-endif constructions containing CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added into CPPFLAGS in config.mk . This will be again removed in following patch.

Marek,

This patch (at least, the version of it checked into u-boot/next) breaks U-Boot on Tegra.

I believe the reason is because nothing ever calls serial_initialize() in the SPL on Tegra. If I edit arch/arm/cpu/arm720t/tegra20/spl.c function preloader_console_init() to call serial_initialize() right before it calls serial_init(), then everything works fine. Without this, drivers/serial/serial.c is never initialised (not even BSS cleared!) and so it's left set to some bogus value, and so get_current() doesn't replace it with default_serial_console(), so an invalid pointer is accessed, causing a hang or crash.

Quoted 6 lines

I'm not sure quite what the correct solution is here. Is Tegra's custom spl.c doing too much; stuff that should come from the common spl.c is cut/paste here? Or, is adding the call to serial_initialize() the correct fix? Or, is the root-cause of the problem that BSS (serial_current) isn't being cleared to 0?

Quoted 3 lines

Tegra SPL needs to either be updated ala common/spl/ (preloader_console_init() calls serial_init()) or switched over to it.

Hmm, well it's already calling serial_init() just not serial_initialize(). Perhaps the issue is the following code missing from Tegra's SPL:

Quoted 5 lines

/* Clear the BSS. */ memset(__bss_start, 0, __bss_end__ - __bss_start);

Anyway, I'll let Allen take a look at it, since he's most familiar with Tegra SPL.

Yes, if SPL wasn't previously clearing the BSS, this would be a problem now.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQdKGaAAoJENk4IS6UOR1W3WcP/2d60PT9cL2Y0OauFG9/7gAD PnrwKgTGWVD5wSb4bKNxb9abFSFhoeqn9BKxAYvAQ0TPXXaMgvYdHGOe9D422K1z V76I3At84AYqXQq/3xeVTHzqK4on1H751e4einvbcd5IelkwMoKdA94Kufq1OdeD MR5kXp1oyE11Ty9b/OZsDQlqczY8SG5x556+sO8FFa4yoQc82LF3x8ymL0R51wlB D38/uqbvBPCYuE6H+GAawIW7L+SJjXhMaykTyUnNbb+tfvZYMt1IGFNMq2SsL75j Kq7WuXGLb1UBB+ebFdlzPtuEtybtBjyhbqTBBu3ikKB7SLWG5ligGVbP5WVRFNuc p3po82Wn4erzoX9y1e+LA/9Idhm8ttXZpbwFVqNc9DveJvTfItRV6A2jJWnhRfCp SJqh10QCvlMOKdibB4j4f4aFAiR0Og2jOSlFHPfIidPXme/ZqqM5nhmN3WFW8acU LvEimmz5XSeJ0Uosg39JtgoXPCJwKLG9px9wby5NjxbvavE7S4wHNs1h3tHo7B8e D+csKIvoGJLiPKSr80xesv23JogHJab+37uj8Aazc/4R3GDgBeTChPvGuxsQBoeP ZvlaD03SuyGbQ6kQJrCa9/VZS/HR2y0lFqEk0MTvwRh0mZCCR/N/nTSI/dss9rEG uuYMDXwlIjZ0cY/ggIrv
=PNet
-----END PGP SIGNATURE-----

#295 lore raw

PATCH 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI

Quoted 42 lines · Tom Rini
Quoted 40 lines · Stephen Warren
Quoted 32 lines · Tom Rini
Quoted 24 lines · Stephen Warren
Quoted 6 lines · Marek Vasut

Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes both SPL builds and non-SPL builds, everything. To avoid poluting this patch with removal of ifdef-endif constructions containing CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added into CPPFLAGS in config.mk . This will be again removed in following patch.

Marek,

This patch (at least, the version of it checked into u-boot/next) breaks U-Boot on Tegra.

I believe the reason is because nothing ever calls serial_initialize() in the SPL on Tegra. If I edit arch/arm/cpu/arm720t/tegra20/spl.c function preloader_console_init() to call serial_initialize() right before it calls serial_init(), then everything works fine. Without this, drivers/serial/serial.c is never initialised (not even BSS cleared!) and so it's left set to some bogus value, and so get_current() doesn't replace it with default_serial_console(), so an invalid pointer is accessed, causing a hang or crash.

Quoted 6 lines

I'm not sure quite what the correct solution is here. Is Tegra's custom spl.c doing too much; stuff that should come from the common spl.c is cut/paste here? Or, is adding the call to serial_initialize() the correct fix? Or, is the root-cause of the problem that BSS (serial_current) isn't being cleared to 0?

Quoted 3 lines

Tegra SPL needs to either be updated ala common/spl/ (preloader_console_init() calls serial_init()) or switched over to it.

Hmm, well it's already calling serial_init() just not serial_initialize(). Perhaps the issue is the following code missing from Tegra's SPL:

Quoted 8 lines
Quoted 5 lines

/* Clear the BSS. */ memset(__bss_start, 0, __bss_end__ - __bss_start);

Anyway, I'll let Allen take a look at it, since he's most familiar with Tegra SPL.

Yes, if SPL wasn't previously clearing the BSS, this would be a problem now.

It was at least at some point in time; Tegra's spl.c does:

Quoted 8 lines

/*
* We call relocate_code() with relocation target same as the
* CONFIG_SYS_SPL_TEXT_BASE. This will result in relocation getting
* skipped. Instead, only .bss initialization will happen. That's
* all we need
*/
debug(">>board_init_f()\n"); relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);

Perhaps that call doesn't clear BSS any more?

#296 lore raw

PATCH 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI

Quoted 63 lines · Stephen Warren
Quoted 42 lines · Tom Rini
Quoted 40 lines · Stephen Warren
Quoted 32 lines · Tom Rini
Quoted 24 lines · Stephen Warren
Quoted 6 lines · Marek Vasut

Enable CONFIG_SERIAL_MULTI for all builds of U-Boot. That includes both SPL builds and non-SPL builds, everything. To avoid poluting this patch with removal of ifdef-endif constructions containing CONFIG_SERIAL_MULTI, the CONFIG_SERIAL_MULTI is temporarily added into CPPFLAGS in config.mk . This will be again removed in following patch.

Marek,

This patch (at least, the version of it checked into u-boot/next) breaks U-Boot on Tegra.

I believe the reason is because nothing ever calls serial_initialize() in the SPL on Tegra. If I edit arch/arm/cpu/arm720t/tegra20/spl.c function preloader_console_init() to call serial_initialize() right before it calls serial_init(), then everything works fine. Without this, drivers/serial/serial.c is never initialised (not even BSS cleared!) and so it's left set to some bogus value, and so get_current() doesn't replace it with default_serial_console(), so an invalid pointer is accessed, causing a hang or crash.

Quoted 6 lines

I'm not sure quite what the correct solution is here. Is Tegra's custom spl.c doing too much; stuff that should come from the common spl.c is cut/paste here? Or, is adding the call to serial_initialize() the correct fix? Or, is the root-cause of the problem that BSS (serial_current) isn't being cleared to 0?

Quoted 3 lines

Tegra SPL needs to either be updated ala common/spl/ (preloader_console_init() calls serial_init()) or switched over to it.

Hmm, well it's already calling serial_init() just not serial_initialize(). Perhaps the issue is the following code missing from Tegra's SPL:

Quoted 8 lines
Quoted 5 lines

/* Clear the BSS. */ memset(__bss_start, 0, __bss_end__ - __bss_start);

Anyway, I'll let Allen take a look at it, since he's most familiar with Tegra SPL.

Yes, if SPL wasn't previously clearing the BSS, this would be a problem now.

It was at least at some point in time; Tegra's spl.c does:

Quoted 8 lines

/*
* We call relocate_code() with relocation target same as the
* CONFIG_SYS_SPL_TEXT_BASE. This will result in relocation getting
* skipped. Instead, only .bss initialization will happen. That's
* all we need
*/
debug(">>board_init_f()\n"); relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);

Quoted 1 line

Perhaps that call doesn't clear BSS any more?

The clear_bss() in arm720t/start.S is surrounded by "#ifndef CONFIG_SPL_BUILD". It was probably removed long ago, I just never noticed because nothing in SPL was using any globals.

Moving to common spl.c definately seems like the right thing to do to avoid this type of thing. I'll work on it, but it probably won't be until next week, is that ok?

-Allen

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

#297 lore raw

PATCH v3 68/72 serial: Remove CONFIG_SERIAL_MULTI from config files

In reply to Marek Vasut

Remove any notion of CONFIG_SERIAL_MULTI from board config files. Since CONFIG_SERIAL_MULTI is now enabled by default, it is useless to specify this config option in the board config files. Therefore remove it.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 include/configs/DU440.h             |    1 -
 include/configs/KAREF.h             |    1 -
 include/configs/METROBOX.h          |    1 -
 include/configs/MPC8569MDS.h        |    1 -
 include/configs/P1010RDB.h          |    1 -
 include/configs/P1_P2_RDB.h         |    1 -
 include/configs/P2020COME.h         |    1 -
 include/configs/PMC440.h            |    1 -
 include/configs/TB5200.h            |    1 -
 include/configs/amcc-common.h       |    1 -
 include/configs/bfin_adi_common.h   |    1 -
 include/configs/coreboot.h          |    1 -
 include/configs/eNET.h              |    1 -
 include/configs/harmony.h           |    1 -
 include/configs/jadecpu.h           |    1 -
 include/configs/korat.h             |    1 -
 include/configs/lwmon.h             |    1 -
 include/configs/lwmon5.h            |    1 -
 include/configs/mcc200.h            |    5 -----
 include/configs/medcom.h            |    1 -
 include/configs/omap3_zoom2.h       |    1 -
 include/configs/origen.h            |    1 -
 include/configs/paz00.h             |    1 -
 include/configs/pcs440ep.h          |    1 -
 include/configs/pdm360ng.h          |    3 ---
 include/configs/plutux.h            |    1 -
 include/configs/quad100hd.h         |    1 -
 include/configs/s5p_goni.h          |    1 -
 include/configs/s5pc210_universal.h |    1 -
 include/configs/sc3.h               |    1 -
 include/configs/seaboard.h          |    1 -
 include/configs/smdk5250.h          |    1 -
 include/configs/smdkc100.h          |    1 -
 include/configs/smdkv310.h          |    1 -
 include/configs/tec.h               |    1 -
 include/configs/tegra-common-post.h |    5 -----
 include/configs/trats.h             |    1 -
 include/configs/trimslice.h         |    1 -
 include/configs/trizepsiv.h         |    1 -
 include/configs/ventana.h           |    1 -
 include/configs/whistler.h          |    1 -
 include/configs/zeus.h              |    1 -
 42 files changed, 52 deletions(-)
include/configs/DU440.h +0 -1
index 8bd7940..bbe2713 100644
@@ -93,7 +93,6 @@
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
 #undef CONFIG_SYS_EXT_SERIAL_CLOCK
 #define CONFIG_BAUDRATE		115200
-#define CONFIG_SERIAL_MULTI     1
 
 #define CONFIG_SYS_BAUDRATE_TABLE						\
 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
include/configs/KAREF.h +0 -1
index 3daf480..546e28b 100644
@@ -96,7 +96,6 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	1
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
-#define CONFIG_SERIAL_MULTI   1
 #define CONFIG_BAUDRATE	      9600
 
 #define CONFIG_SYS_BAUDRATE_TABLE  \
include/configs/METROBOX.h +0 -1
index 34376bc..286f869 100644
@@ -158,7 +158,6 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	1
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
-#define CONFIG_SERIAL_MULTI   1
 #define CONFIG_BAUDRATE	      9600
 
 #define CONFIG_SYS_BAUDRATE_TABLE  \
include/configs/MPC8569MDS.h +0 -1
index d973364..acd3276 100644
@@ -274,7 +274,6 @@ extern unsigned long get_clock_freq(void);
 
 /* Serial Port */
 #define CONFIG_CONS_INDEX		1
-#define CONFIG_SERIAL_MULTI		1
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE    1
include/configs/P1010RDB.h +0 -1
index 67dba9f..540f32d 100644
@@ -453,7 +453,6 @@ extern unsigned long get_sdram_size(void);
 #define CONFIG_NS16550_MIN_FUNCTIONS
 #endif
 
-#define CONFIG_SERIAL_MULTI		/* Enable both serial ports */
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV	/* determine from environment */
 
 #define CONFIG_SYS_BAUDRATE_TABLE	\
include/configs/P1_P2_RDB.h +0 -1
index ab88166..9db0e87 100644
@@ -343,7 +343,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_NS16550_MIN_FUNCTIONS
 #endif
 
-#define CONFIG_SERIAL_MULTI	1 /* Enable both serial ports */
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV	/* determine from environment */
 
 #define CONFIG_SYS_BAUDRATE_TABLE	\
include/configs/P2020COME.h +0 -1
index d323fb5..c75f86c 100644
@@ -201,7 +201,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_NS16550_REG_SIZE	1
 #define CONFIG_SYS_NS16550_CLK		get_bus_freq(0)
 
-#define CONFIG_SERIAL_MULTI	1 /* Enable both serial ports */
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV	/* determine from environment */
 
 #define CONFIG_SYS_BAUDRATE_TABLE   \
include/configs/PMC440.h +0 -1
index b820954..3837b8f 100644
@@ -102,7 +102,6 @@
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
 #undef CONFIG_SYS_EXT_SERIAL_CLOCK
 #define CONFIG_BAUDRATE		115200
-#define CONFIG_SERIAL_MULTI     1
 
 #define CONFIG_SYS_BAUDRATE_TABLE						\
 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
include/configs/TB5200.h +0 -1
index feaadf3..a624c83 100644
@@ -56,7 +56,6 @@
  * Serial console configuration
  */
 #define CONFIG_PSC_CONSOLE	1	/* default console is on PSC1 */
-#define CONFIG_SERIAL_MULTI	1	/* support multiple consoles */
 #define CONFIG_PSC_CONSOLE2	6	/* second console is on PSC6 */
 #define CONFIG_BAUDRATE		115200	/* ... at 115200 bps */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200, 230400 }
include/configs/amcc-common.h +0 -1
index 056a22a..c9db47a 100644
@@ -31,7 +31,6 @@
 /*
  * UART
  */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	1
include/configs/bfin_adi_common.h +0 -1
index 7132f8f..b635c7d 100644
@@ -108,7 +108,6 @@
 #define CONFIG_LOADS_ECHO	1
 #define CONFIG_JTAG_CONSOLE
 #define CONFIG_SILENT_CONSOLE
-#define CONFIG_SERIAL_MULTI
 #ifndef CONFIG_BAUDRATE
 # define CONFIG_BAUDRATE	57600
 #endif
include/configs/coreboot.h +0 -1
index 2c65d74..0e89242 100644
@@ -54,7 +54,6 @@
 /*-----------------------------------------------------------------------
  * Serial Configuration
  */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_CONS_INDEX		1
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
include/configs/eNET.h +0 -1
index d5c9cad..4b1c219 100644
@@ -55,7 +55,6 @@
 /*-----------------------------------------------------------------------
  * Serial Configuration
  */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_CONS_INDEX			1
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
include/configs/harmony.h +0 -1
index e407ff4..d582ae1 100644
@@ -37,7 +37,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"NVIDIA Harmony"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTD
 
 /* UARTD: keyboard satellite board UART, default */
include/configs/jadecpu.h +0 -1
index 7b9d36d..daf37bf 100644
@@ -68,7 +68,6 @@
 /*
  * Serial
  */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE		(-4)
include/configs/korat.h +0 -1
index 46335b4..b919aec 100644
@@ -102,7 +102,6 @@
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
 #define CONFIG_SYS_EXT_SERIAL_CLOCK	11059200	/* ext. 11.059MHz clk	*/
 #define CONFIG_BAUDRATE		115200
-#define CONFIG_SERIAL_MULTI	1
 
 #define CONFIG_SYS_BAUDRATE_TABLE						\
 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
include/configs/lwmon.h +0 -1
index 1d89176..ab86053 100644
@@ -60,7 +60,6 @@
 #define CONFIG_LCD_INFO		1	/* ... and some board info	*/
 #define	CONFIG_SPLASH_SCREEN		/* ... with splashscreen support*/
 
-#define CONFIG_SERIAL_MULTI	1
 #define CONFIG_8xx_CONS_SMC2	1	/* Console is on SMC2		*/
 #define CONFIG_8xx_CONS_SCC2	1	/* Console is on SCC2		*/
 
include/configs/lwmon5.h +0 -1
index 497eec4..2d33ebc 100644
@@ -121,7 +121,6 @@
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
 #undef CONFIG_SYS_EXT_SERIAL_CLOCK		/* no external clock provided	*/
 #define CONFIG_BAUDRATE		115200
-#define CONFIG_SERIAL_MULTI
 
 #define CONFIG_SYS_BAUDRATE_TABLE						\
 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
include/configs/mcc200.h +0 -5
index 1867eb6..053e5bc 100644
@@ -76,17 +76,12 @@
  */
 #if !defined(CONFIG_PRS200)
 /* MCC200 configuration: */
-#define CONFIG_SERIAL_MULTI	1
 #define CONFIG_PSC_CONSOLE	1	/* PSC1 may be COM */
 #define CONFIG_PSC_CONSOLE2	2	/* PSC2 is PSoC */
 #else
 /* PRS200 configuration: */
 #define CONFIG_PSC_CONSOLE	1	/* console is on PSC1		*/
 #endif
-#if defined(CONFIG_QUART_CONSOLE) && defined(CONFIG_PSC_CONSOLE) && \
-	!defined(CONFIG_SERIAL_MULTI)
-#error "Select only one console device!"
-#endif
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200, 230400 }
 
include/configs/medcom.h +0 -1
index 678b36b..45c4fd2 100644
@@ -38,7 +38,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"Avionic Design Medcom"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTD	/* UARTD: debug UART */
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTD_BASE
 
include/configs/omap3_zoom2.h +0 -1
index a7cc5fc..d681424 100644
@@ -76,7 +76,6 @@
  * NS16550 Configuration
  * Zoom2 uses the TL16CP754C on the debug board
  */
-#define CONFIG_SERIAL_MULTI		1
 /*
  * 0 - 1 : first  USB with respect to the left edge of the debug board
  * 2 - 3 : second USB with respect to the left edge of the debug board
include/configs/origen.h +0 -1
index 1ab9834..ff2b24d 100644
@@ -63,7 +63,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (1 << 20))
 
 /* select serial console configuration */
-#define CONFIG_SERIAL_MULTI		1
 #define CONFIG_SERIAL2			1	/* use SERIAL 2 */
 #define CONFIG_BAUDRATE			115200
 #define EXYNOS4_DEFAULT_UART_OFFSET	0x020000
include/configs/paz00.h +0 -1
index 24cda48..5603de9 100644
@@ -30,7 +30,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"Compal Paz00"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTA
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTA_BASE
 
include/configs/pcs440ep.h +0 -1
index 26627bb..351ff5a 100644
@@ -88,7 +88,6 @@
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
 #undef CONFIG_SYS_EXT_SERIAL_CLOCK		/* no external clk used		*/
 #define CONFIG_BAUDRATE		115200
-#define CONFIG_SERIAL_MULTI     1
 
 #define CONFIG_SYS_BAUDRATE_TABLE  \
     {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
include/configs/pdm360ng.h +0 -3
index 8afc3c0..671e9eb 100644
@@ -298,7 +298,6 @@
 /*
  * Used PSC UART devices
  */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_SYS_PSC1
 #define CONFIG_SYS_PSC4
 #define CONFIG_SYS_PSC6
@@ -434,10 +433,8 @@
 #define CONFIG_KGDB_SER_INDEX	2	/* which serial port to use */
 #endif
 
-#ifdef CONFIG_SERIAL_MULTI
 /* POST support */
 #define CONFIG_POST             (CONFIG_SYS_POST_COPROC)
-#endif
 
 /*
  * Environment Configuration
include/configs/plutux.h +0 -1
index 65b42ed..deee237 100644
@@ -38,7 +38,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"Avionic Design Plutux"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTD	/* UARTD: debug UART */
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTD_BASE
 
include/configs/quad100hd.h +0 -1
index 5d0c385..5f1bb58 100644
@@ -113,7 +113,6 @@
 #undef	CONFIG_SYS_EXT_SERIAL_CLOCK			/* external serial clock */
 #define CONFIG_SYS_BASE_BAUD		691200
 #define CONFIG_BAUDRATE		115200
-#define CONFIG_SERIAL_MULTI
 
 /* The following table includes the supported baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	\
include/configs/s5p_goni.h +0 -1
index 36f1a57..7e0b302 100644
@@ -59,7 +59,6 @@
  * select serial console configuration
  */
 #define CONFIG_SERIAL2			1	/* use SERIAL2 */
-#define CONFIG_SERIAL_MULTI		1
 #define CONFIG_BAUDRATE			115200
 
 /* MMC */
include/configs/s5pc210_universal.h +0 -1
index 7727624..5fc6136 100644
@@ -61,7 +61,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (1 << 20))
 
 /* select serial console configuration */
-#define CONFIG_SERIAL_MULTI	1
 #define CONFIG_SERIAL2		1	/* use SERIAL 2 */
 #define CONFIG_BAUDRATE		115200
 
include/configs/sc3.h +0 -1
index 2d6e51d..fb74608 100644
@@ -83,7 +83,6 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	1
 #define CONFIG_SYS_NS16550_CLK		get_serial_clock()
-#define CONFIG_SERIAL_MULTI
 
 /*
  * define CONFIG_SYS_CLK_FREQ to your base crystal clock in Hz
include/configs/seaboard.h +0 -1
index de19e38..0727a4c 100644
@@ -45,7 +45,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"NVIDIA Seaboard"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTD
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTD_BASE
 
include/configs/smdk5250.h +0 -1
index 47369aa..c0f8622 100644
@@ -68,7 +68,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (1 << 20))
 
 /* select serial console configuration */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_SERIAL3			/* use SERIAL 3 */
 #define CONFIG_BAUDRATE			115200
 #define EXYNOS5_DEFAULT_UART_OFFSET	0x010000
include/configs/smdkc100.h +0 -1
index 22de344..fb640db 100644
@@ -64,7 +64,6 @@
  * select serial console configuration
  */
 #define CONFIG_SERIAL0			1	/* use SERIAL 0 on SMDKC100 */
-#define CONFIG_SERIAL_MULTI		1
 
 /* PWM */
 #define CONFIG_PWM			1
include/configs/smdkv310.h +0 -1
index 602337f..b796b46 100644
@@ -62,7 +62,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (1 << 20))
 
 /* select serial console configuration */
-#define CONFIG_SERIAL_MULTI		1
 #define CONFIG_SERIAL1			1	/* use SERIAL 1 */
 #define CONFIG_BAUDRATE			115200
 #define EXYNOS4_DEFAULT_UART_OFFSET	0x010000
include/configs/tec.h +0 -1
index d5da3c7..140d2e6 100644
@@ -39,7 +39,6 @@
 #define CONFIG_SYS_BOARD_ODMDATA	0x2b0d8011
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTD	/* UARTD: debug UART */
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTD_BASE
 
include/configs/tegra-common-post.h +0 -5
index 168b64b..a01b2a7 100644
@@ -154,11 +154,6 @@
 #undef CONFIG_OF_CONTROL
 #endif
 
-/* remove SERIAL_MULTI */
-#ifdef CONFIG_SERIAL_MULTI
-#undef CONFIG_SERIAL_MULTI
-#endif
-
 /* remove I2C support */
 #ifdef CONFIG_TEGRA_I2C
 #undef CONFIG_TEGRA_I2C
include/configs/trats.h +0 -1
index b3b5a3d..d7808aa 100644
@@ -69,7 +69,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (1 << 20))
 
 /* select serial console configuration */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_SERIAL2			/* use SERIAL 2 */
 #define CONFIG_BAUDRATE			115200
 
include/configs/trimslice.h +0 -1
index a46890c..eeb0dbe 100644
@@ -37,7 +37,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"Compulab Trimslice"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTA
 #define CONFIG_TEGRA_UARTA_GPU
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTA_BASE
include/configs/trizepsiv.h +0 -1
index 47c6a23..bc69c1e 100644
@@ -64,7 +64,6 @@
  * select serial console configuration
  */
 #define CONFIG_PXA_SERIAL
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_FFUART	       1       /* we use FFUART on Conxs */
 #define CONFIG_BTUART	       1       /* we use BTUART on Conxs */
 #define CONFIG_STUART	       1       /* we use STUART on Conxs */
include/configs/ventana.h +0 -1
index 7d3a54f..b751d58 100644
@@ -37,7 +37,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"NVIDIA Ventana"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTD
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTD_BASE
 
include/configs/whistler.h +0 -1
index 6c565ba..1c7803b 100644
@@ -37,7 +37,6 @@
 #define CONFIG_TEGRA_BOARD_STRING	"NVIDIA Whistler"
 
 /* Board-specific serial config */
-#define CONFIG_SERIAL_MULTI
 #define CONFIG_TEGRA_ENABLE_UARTA
 #define CONFIG_TEGRA_UARTA_UAA_UAB
 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTA_BASE
include/configs/zeus.h +0 -1
index 2556e3b..b0c3bd5 100644
@@ -130,7 +130,6 @@
 #undef	CONFIG_SYS_EXT_SERIAL_CLOCK			/* external serial clock */
 #define CONFIG_SYS_BASE_BAUD	691200
 #define CONFIG_BAUDRATE		115200
-#define CONFIG_SERIAL_MULTI
 
 #define CONFIG_SYS_BAUDRATE_TABLE  \
     {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
Signature · 1 line
1.7.10.4
#298 lore raw

PATCH v3 69/72 serial: Remove CONFIG_SERIAL_MULTI from serial drivers

In reply to Marek Vasut

Remove the support for not-CONFIG_SERIAL_MULTI part from serial port drivers and some board files. Since CONFIG_SERIAL_MULTI is now enabled by default, that part is a dead code. Remove it.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/mips/cpu/mips32/au1x00/au1x00_serial.c |   32 ------
 arch/mips/cpu/mips32/incaip/asc_serial.c    |   32 ------
 arch/mips/cpu/xburst/jz_serial.c            |   32 ------
 arch/powerpc/cpu/mpc512x/serial.c           |   64 +-----------
 arch/powerpc/cpu/mpc5xx/serial.c            |   32 ------
 arch/powerpc/cpu/mpc5xxx/serial.c           |  149 +++++++--------------------
 arch/powerpc/cpu/mpc8220/uart.c             |   32 ------
 arch/powerpc/cpu/mpc8260/serial_scc.c       |   32 ------
 arch/powerpc/cpu/mpc8260/serial_smc.c       |   32 ------
 arch/powerpc/cpu/mpc85xx/serial_scc.c       |   32 ------
 arch/powerpc/cpu/ppc4xx/iop480_uart.c       |   35 -------
 arch/sparc/cpu/leon2/serial.c               |   32 ------
 arch/sparc/cpu/leon3/serial.c               |   32 ------
 board/Marvell/common/serial.c               |   32 ------
 board/amirix/ap1000/serial.c                |   31 ------
 board/bmw/serial.c                          |   32 ------
 board/cogent/serial.c                       |   32 ------
 board/esd/cpci750/serial.c                  |   31 ------
 board/evb64260/serial.c                     |   31 ------
 board/ml2/serial.c                          |   31 ------
 board/pcippc2/sconsole.c                    |   31 ------
 board/pdm360ng/pdm360ng.c                   |    6 --
 board/prodrive/p3mx/serial.c                |   32 ------
 board/trizepsiv/conxs.c                     |    2 -
 drivers/serial/altera_jtag_uart.c           |   32 ------
 drivers/serial/altera_uart.c                |   32 ------
 drivers/serial/atmel_usart.c                |   32 ------
 drivers/serial/lpc32xx_hsuart.c             |   32 ------
 drivers/serial/mcfuart.c                    |   32 ------
 drivers/serial/ns9750_serial.c              |   32 ------
 drivers/serial/opencores_yanu.c             |   32 ------
 drivers/serial/s3c4510b_uart.c              |   32 ------
 drivers/serial/s3c64xx.c                    |   32 ------
 drivers/serial/sandbox.c                    |   32 ------
 drivers/serial/serial_clps7111.c            |   32 ------
 drivers/serial/serial_imx.c                 |   32 ------
 drivers/serial/serial_ixp.c                 |   32 ------
 drivers/serial/serial_ks8695.c              |   32 ------
 drivers/serial/serial_lh7a40x.c             |   32 ------
 drivers/serial/serial_lpc2292.c             |   32 ------
 drivers/serial/serial_max3100.c             |   32 ------
 drivers/serial/serial_mxc.c                 |   36 -------
 drivers/serial/serial_netarm.c              |   32 ------
 drivers/serial/serial_ns16550.c             |   95 -----------------
 drivers/serial/serial_pl01x.c               |   32 ------
 drivers/serial/serial_pxa.c                 |   18 ----
 drivers/serial/serial_s3c24x0.c             |   53 ----------
 drivers/serial/serial_s3c44b0.c             |   32 ------
 drivers/serial/serial_sa1100.c              |   32 ------
 drivers/serial/serial_sh.c                  |   32 ------
 drivers/serial/serial_xuartlite.c           |   34 ------
 51 files changed, 39 insertions(+), 1760 deletions(-)
arch/mips/cpu/mips32/au1x00/au1x00_serial.c +0 -32
index 9682775..0beac98 100644
@@ -131,7 +131,6 @@ static int au1x00_serial_tstc(void)
 	return 0;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device au1x00_serial_drv = {
 	.name	= "au1x00_serial",
 	.start	= au1x00_serial_init,
@@ -152,34 +151,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &au1x00_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return au1x00_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	au1x00_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	au1x00_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	au1x00_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return au1x00_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return au1x00_serial_tstc();
-}
-#endif
arch/mips/cpu/mips32/incaip/asc_serial.c +0 -32
index b5f32e2..08949f4 100644
@@ -286,7 +286,6 @@ static int asc_serial_tstc(void)
     return res;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device asc_serial_drv = {
 	.name	= "asc_serial",
 	.start	= asc_serial_init,
@@ -307,34 +306,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &asc_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return asc_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	asc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	asc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	asc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return asc_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return asc_serial_tstc();
-}
-#endif
arch/mips/cpu/xburst/jz_serial.c +0 -32
index b1e1d27..3199007 100644
@@ -115,7 +115,6 @@ static void jz_serial_puts(const char *s)
 		serial_putc(*s++);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device jz_serial_drv = {
 	.name	= "jz_serial",
 	.start	= jz_serial_init,
@@ -136,34 +135,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &jz_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return jz_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	jz_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	jz_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	jz_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return jz_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return jz_serial_tstc();
-}
-#endif
arch/powerpc/cpu/mpc512x/serial.c +3 -61

107 lines not on this page · raw message

arch/powerpc/cpu/mpc5xx/serial.c +0 -32
index dbaacfc..af802f9 100644
@@ -169,7 +169,6 @@ static void mpc5xx_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device mpc5xx_serial_drv = {
 	.name	= "mpc5xx_serial",
 	.start	= mpc5xx_serial_init,
@@ -190,34 +189,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &mpc5xx_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return mpc5xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	mpc5xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	mpc5xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	mpc5xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return mpc5xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return mpc5xx_serial_tstc();
-}
-#endif
arch/powerpc/cpu/mpc5xxx/serial.c +36 -113

295 lines not on this page · raw message

arch/powerpc/cpu/mpc8220/uart.c +0 -32
index 545c81a..25d4472 100644
@@ -126,7 +126,6 @@ static void mpc8220_serial_setbrg(void)
 	psc->cr = PSC_CR_RX_ENABLE | PSC_CR_TX_ENABLE;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device mpc8220_serial_drv = {
 	.name	= "mpc8220_serial",
 	.start	= mpc8220_serial_init,
@@ -147,35 +146,4 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &mpc8220_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return mpc8220_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	mpc8220_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	mpc8220_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	mpc8220_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return mpc8220_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return mpc8220_serial_tstc();
-}
-#endif
 #endif /* CONFIG_PSC_CONSOLE */
arch/powerpc/cpu/mpc8260/serial_scc.c +0 -32
index cfbcd79..954db14 100644
@@ -261,7 +261,6 @@ static int mpc8260_scc_serial_tstc(void)
 	return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device mpc8260_scc_serial_drv = {
 	.name	= "mpc8260_scc_serial",
 	.start	= mpc8260_scc_serial_init,
@@ -282,37 +281,6 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &mpc8260_scc_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return mpc8260_scc_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	mpc8260_scc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	mpc8260_scc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	mpc8260_scc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return mpc8260_scc_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return mpc8260_scc_serial_tstc();
-}
-#endif
 #endif	/* CONFIG_CONS_ON_SCC */
 
 #if defined(CONFIG_KGDB_ON_SCC)
arch/powerpc/cpu/mpc8260/serial_smc.c +0 -32
index 012fc98..48f5896 100644
@@ -264,7 +264,6 @@ static int mpc8260_smc_serial_tstc(void)
 	return !(rtx->rxbd.cbd_sc & BD_SC_EMPTY);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device mpc8260_smc_serial_drv = {
 	.name	= "mpc8260_smc_serial",
 	.start	= mpc8260_smc_serial_init,
@@ -285,37 +284,6 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &mpc8260_smc_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return mpc8260_smc_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	mpc8260_smc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	mpc8260_smc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	mpc8260_smc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return mpc8260_smc_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return mpc8260_smc_serial_tstc();
-}
-#endif
 #endif	/* CONFIG_CONS_ON_SMC */
 
 #if defined(CONFIG_KGDB_ON_SMC)
arch/powerpc/cpu/mpc85xx/serial_scc.c +0 -32
index d192642..fe9af55 100644
@@ -262,7 +262,6 @@ static int mpc85xx_serial_tstc(void)
 	return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device mpc85xx_serial_drv = {
 	.name	= "mpc85xx_serial",
 	.start	= mpc85xx_serial_init,
@@ -283,35 +282,4 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &mpc85xx_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return mpc85xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	mpc85xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	mpc85xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	mpc85xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return mpc85xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return mpc85xx_serial_tstc();
-}
-#endif
 #endif	/* CONFIG_CONS_ON_SCC */
arch/powerpc/cpu/ppc4xx/iop480_uart.c +0 -35
index fb25e15..9473984 100644
@@ -26,11 +26,8 @@
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <watchdog.h>
-
-#ifdef CONFIG_SERIAL_MULTI
 #include <serial.h>
 #include <linux/compiler.h>
-#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -234,7 +231,6 @@ static int iop480_serial_tstc(void)
 	return 0;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device iop480_serial_drv = {
 	.name	= "iop480_serial",
 	.start	= iop480_serial_init,
@@ -255,35 +251,4 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &iop480_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return iop480_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	iop480_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	iop480_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	iop480_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return iop480_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return iop480_serial_tstc();
-}
-#endif
 #endif	/* CONFIG_IOP480 */
arch/sparc/cpu/leon2/serial.c +0 -32
index 61d059b..16fffb6 100644
@@ -166,7 +166,6 @@ static void leon2_serial_setbrg(void)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device leon2_serial_drv = {
 	.name	= "leon2_serial",
 	.start	= leon2_serial_init,
@@ -187,34 +186,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &leon2_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return leon2_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	leon2_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	leon2_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	leon2_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return leon2_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return leon2_serial_tstc();
-}
-#endif
arch/sparc/cpu/leon3/serial.c +0 -32
index a110244..c4f3ee8 100644
@@ -140,7 +140,6 @@ static void leon3_serial_setbrg(void)
 	return;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device leon3_serial_drv = {
 	.name	= "leon3_serial",
 	.start	= leon3_serial_init,
@@ -161,34 +160,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &leon3_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return leon3_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	leon3_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	leon3_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	leon3_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return leon3_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return leon3_serial_tstc();
-}
-#endif
board/Marvell/common/serial.c +0 -32
index a5231eb..1327c62 100644
@@ -146,7 +146,6 @@ static void marvell_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device marvell_serial_drv = {
 	.name	= "marvell_serial",
 	.start	= marvell_serial_init,
@@ -167,37 +166,6 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &marvell_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return marvell_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	marvell_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	marvell_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	marvell_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return marvell_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return marvell_serial_tstc();
-}
-#endif
 
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
board/amirix/ap1000/serial.c +0 -31
index 2c2e9f9..a77d332 100644
@@ -86,7 +86,6 @@ static void amirix_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device amirix_serial_drv = {
 	.name	= "amirix_serial",
 	.start	= amirix_serial_init,
@@ -107,37 +106,7 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &amirix_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return amirix_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	amirix_serial_setbrg();
-}
 
-void serial_putc(const char c)
-{
-	amirix_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	amirix_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return amirix_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return amirix_serial_tstc();
-}
-#endif
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
board/bmw/serial.c +0 -32
index 569131f..08f449c 100644
@@ -83,7 +83,6 @@ static void bmw_serial_setbrg(void)
 	NS16550_reinit (console, clock_divisor);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device bmw_serial_drv = {
 	.name	= "bmw_serial",
 	.start	= bmw_serial_init,
@@ -104,34 +103,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &bmw_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return bmw_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	bmw_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	bmw_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	bmw_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return bmw_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return bmw_serial_tstc();
-}
-#endif
board/cogent/serial.c +0 -32
index 18a9dbf..cd4a976 100644
@@ -90,7 +90,6 @@ static int cogent_serial_tstc(void)
 	return ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_DR) != 0);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device cogent_serial_drv = {
 	.name	= "cogent_serial",
 	.start	= cogent_serial_init,
@@ -111,37 +110,6 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &cogent_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return cogent_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	cogent_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	cogent_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	cogent_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return cogent_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return cogent_serial_tstc();
-}
-#endif
 #endif /* CONS_NONE */
 
 #if defined(CONFIG_CMD_KGDB) && \
board/esd/cpci750/serial.c +0 -31
index 9ff7c27..25f8950 100644
@@ -83,7 +83,6 @@ static void cpci750_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device cpci750_serial_drv = {
 	.name	= "cpci750_serial",
 	.start	= cpci750_serial_init,
@@ -104,37 +103,7 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &cpci750_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return cpci750_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	cpci750_serial_setbrg();
-}
 
-void serial_putc(const char c)
-{
-	cpci750_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	cpci750_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return cpci750_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return cpci750_serial_tstc();
-}
-#endif
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
board/evb64260/serial.c +0 -31
index cf46a4d..9fd4298 100644
@@ -146,7 +146,6 @@ static void evb64260_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device evb64260_serial_drv = {
 	.name	= "evb64260_serial",
 	.start	= evb64260_serial_init,
@@ -167,37 +166,7 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &evb64260_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return evb64260_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	evb64260_serial_setbrg();
-}
 
-void serial_putc(const char c)
-{
-	evb64260_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	evb64260_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return evb64260_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return evb64260_serial_tstc();
-}
-#endif
 #if defined(CONFIG_CMD_KGDB)
 void
 kgdb_serial_init(void)
board/ml2/serial.c +0 -31
index 0ed1150..787ff46 100644
@@ -90,7 +90,6 @@ static void ml2_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device ml2_serial_drv = {
 	.name	= "ml2_serial",
 	.start	= ml2_serial_init,
@@ -111,37 +110,7 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &ml2_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return ml2_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	ml2_serial_setbrg();
-}
 
-void serial_putc(const char c)
-{
-	ml2_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	ml2_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return ml2_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return ml2_serial_tstc();
-}
-#endif
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
 {
board/pcippc2/sconsole.c +0 -31
index 0a31963..aa3c908 100644
@@ -115,7 +115,6 @@ static void sconsole_serial_setbrg(void)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device sconsole_serial_drv = {
 	.name	= "sconsole_serial",
 	.start	= sconsole_serial_init,
@@ -136,37 +135,7 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &sconsole_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return sconsole_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	sconsole_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	sconsole_serial_putc(c);
-}
 
-void serial_puts(const char *s)
-{
-	sconsole_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return sconsole_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return sconsole_serial_tstc();
-}
-#endif
 int sconsole_get_baudrate (void)
 {
 	sconsole_buffer_t *sb = SCONSOLE_BUFFER;
board/pdm360ng/pdm360ng.c +0 -6
index 2082ad4..a2a1323 100644
@@ -172,9 +172,7 @@ phys_size_t initdram (int board_type)
 	return msize;
 }
 
-#if defined(CONFIG_SERIAL_MULTI)
 static int set_lcd_brightness(char *);
-#endif
 
 int misc_init_r(void)
 {
@@ -237,9 +235,7 @@ int misc_init_r(void)
 #endif
 
 #ifdef CONFIG_FSL_DIU_FB
-#if defined(CONFIG_SERIAL_MULTI)
 	set_lcd_brightness(0);
-#endif
 	/* Switch LCD-Backlight and LVDS-Interface on */
 	setbits_be32(&im->gpio.gpdir, 0x01040000);
 	clrsetbits_be32(&im->gpio.gpdat, 0x01000000, 0x00040000);
@@ -608,7 +604,6 @@ void ft_board_setup(void *blob, bd_t *bd)
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
-#if defined(CONFIG_SERIAL_MULTI)
 /*
  * If argument is NULL, set the LCD brightness to the
  * value from "brightness" environment variable. Set
@@ -685,4 +680,3 @@ U_BOOT_CMD(lcdbr, 2, 1, cmd_lcd_brightness,
 	"set LCD brightness",
 	"<brightness> - set LCD backlight level to <brightness>.\n"
 );
-#endif /* CONFIG_SERIAL_MULTI */
board/prodrive/p3mx/serial.c +0 -32
index d3591b4..2f4d294 100644
@@ -83,7 +83,6 @@ static void p3mx_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device p3mx_serial_drv = {
 	.name	= "p3mx_serial",
 	.start	= p3mx_serial_init,
@@ -104,37 +103,6 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &p3mx_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return p3mx_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	p3mx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	p3mx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	p3mx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return p3mx_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return p3mx_serial_tstc();
-}
-#endif
 
 #if defined(CONFIG_CMD_KGDB)
 void kgdb_serial_init (void)
board/trizepsiv/conxs.c +0 -2
index 8fc3c40..871e052 100644
@@ -120,7 +120,6 @@ int board_init (void)
 
 int board_late_init(void)
 {
-#if defined(CONFIG_SERIAL_MULTI)
 	char *console=getenv("boot_console");
 
 	if ((console == NULL) || (strcmp(console,"serial_btuart") &&
@@ -131,7 +130,6 @@ int board_late_init(void)
 	setenv("stdout",console);
 	setenv("stdin", console);
 	setenv("stderr",console);
-#endif
 	return 0;
 }
 
drivers/serial/altera_jtag_uart.c +0 -32
index d3b6c1c..ec8ca29 100644
@@ -83,7 +83,6 @@ static int altera_jtag_serial_getc(void)
 	return (c);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device altera_jtag_serial_drv = {
 	.name	= "altera_jtag_serial",
 	.start	= altera_jtag_serial_init,
@@ -104,34 +103,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &altera_jtag_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return altera_jtag_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	altera_jtag_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	altera_jtag_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	altera_jtag_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return altera_jtag_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return altera_jtag_serial_tstc();
-}
-#endif
drivers/serial/altera_uart.c +0 -32
index 18b820b..700abd6 100644
@@ -99,7 +99,6 @@ static int altera_serial_getc(void)
 	return (readl (&uart->rxdata) & 0x00ff );
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device altera_serial_drv = {
 	.name	= "altera_serial",
 	.start	= altera_serial_init,
@@ -120,34 +119,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &altera_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return altera_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	altera_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	altera_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	altera_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return altera_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return altera_serial_tstc();
-}
-#endif
drivers/serial/atmel_usart.c +0 -32
index d49d5d4..1303031 100644
@@ -107,7 +107,6 @@ static int atmel_serial_tstc(void)
 	return (readl(&usart->csr) & USART3_BIT(RXRDY)) != 0;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device atmel_serial_drv = {
 	.name	= "atmel_serial",
 	.start	= atmel_serial_init,
@@ -128,34 +127,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &atmel_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return atmel_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	atmel_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	atmel_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	atmel_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return atmel_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return atmel_serial_tstc();
-}
-#endif
drivers/serial/lpc32xx_hsuart.c +0 -32
index 536fd46..02429b5 100644
@@ -83,7 +83,6 @@ static void lpc32xx_serial_puts(const char *s)
 		serial_putc(*s++);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device lpc32xx_serial_drv = {
 	.name	= "lpc32xx_serial",
 	.start	= lpc32xx_serial_init,
@@ -104,34 +103,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &lpc32xx_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return lpc32xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	lpc32xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	lpc32xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	lpc32xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return lpc32xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return lpc32xx_serial_tstc();
-}
-#endif
drivers/serial/mcfuart.c +0 -32
index 7e0b765..00a7114 100644
@@ -130,7 +130,6 @@ static void mcf_serial_setbrg(void)
 	uart->ucr = UART_UCR_RX_ENABLED | UART_UCR_TX_ENABLED;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device mcf_serial_drv = {
 	.name	= "mcf_serial",
 	.start	= mcf_serial_init,
@@ -151,34 +150,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &mcf_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return mcf_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	mcf_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	mcf_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	mcf_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return mcf_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return mcf_serial_tstc();
-}
-#endif
drivers/serial/ns9750_serial.c +0 -32
index 829f6d5..cb545c4 100644
@@ -209,7 +209,6 @@ static unsigned int calcRxCharGapRegister( void )
 	return NS9750_SER_RX_CHAR_TIMER_TRUN;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device ns9750_serial_drv = {
 	.name	= "ns9750_serial",
 	.start	= ns9750_serial_init,
@@ -230,34 +229,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &ns9750_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return ns9750_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	ns9750_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	ns9750_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	ns9750_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return ns9750_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return ns9750_serial_tstc();
-}
-#endif
drivers/serial/opencores_yanu.c +0 -32
index a0dd301..49bccf3 100644
@@ -189,7 +189,6 @@ statoc int oc_serial_getc(void)
 	return(readl(&uart->data) & YANU_DATA_CHAR_MASK);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device oc_serial_drv = {
 	.name	= "oc_serial",
 	.start	= oc_serial_init,
@@ -210,34 +209,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &oc_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return oc_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	oc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	oc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	oc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return oc_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return oc_serial_tstc();
-}
-#endif
drivers/serial/s3c4510b_uart.c +0 -32
index 4f7f98e..423d26e 100644
@@ -211,7 +211,6 @@ static void s3c4510b_serial_puts(const char *s)
 
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device s3c4510b_serial_drv = {
 	.name	= "s3c4510b_serial",
 	.start	= s3c4510b_serial_init,
@@ -232,34 +231,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &s3c4510b_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return s3c4510b_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	s3c4510b_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	s3c4510b_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	s3c4510b_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return s3c4510b_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return s3c4510b_serial_tstc();
-}
-#endif
drivers/serial/s3c64xx.c +0 -32
index 823425b..9ab8a28 100644
@@ -172,7 +172,6 @@ static void s3c64xx_serial_puts(const char *s)
 		serial_putc(*s++);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device s3c64xx_serial_drv = {
 	.name	= "s3c64xx_serial",
 	.start	= s3c64xx_serial_init,
@@ -193,34 +192,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &s3c64xx_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return s3c64xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	s3c64xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	s3c64xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	s3c64xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return s3c64xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return s3c64xx_serial_tstc();
-}
-#endif
drivers/serial/sandbox.c +0 -32
index d60fbba..cb19401 100644
@@ -64,7 +64,6 @@ static int sandbox_serial_tstc(void)
 	return 0;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device sandbox_serial_drv = {
 	.name	= "sandbox_serial",
 	.start	= sandbox_serial_init,
@@ -85,34 +84,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &sandbox_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return sandbox_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	sandbox_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	sandbox_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	sandbox_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return sandbox_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return sandbox_serial_tstc();
-}
-#endif
drivers/serial/serial_clps7111.c +0 -32
index e1bed90..65473e8 100644
@@ -119,7 +119,6 @@ static void clps7111_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device clps7111_serial_drv = {
 	.name	= "clps7111_serial",
 	.start	= clps7111_serial_init,
@@ -140,34 +139,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &clps7111_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return clps7111_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	clps7111_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	clps7111_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	clps7111_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return clps7111_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return clps7111_serial_tstc();
-}
-#endif
drivers/serial/serial_imx.c +0 -32
index d37ec29..6c075b5 100644
@@ -221,7 +221,6 @@ static void imx_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device imx_serial_drv = {
 	.name	= "imx_serial",
 	.start	= imx_serial_init,
@@ -242,34 +241,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &imx_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return imx_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	imx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	imx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	imx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return imx_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return imx_serial_tstc();
-}
-#endif
drivers/serial/serial_ixp.c +0 -32
index 6e3f7f0..c8b3658 100644
@@ -128,7 +128,6 @@ static void ixp_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device ixp_serial_drv = {
 	.name	= "ixp_serial",
 	.start	= ixp_serial_init,
@@ -149,34 +148,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &ixp_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return ixp_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	ixp_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	ixp_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	ixp_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return ixp_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return ixp_serial_tstc();
-}
-#endif
drivers/serial/serial_ks8695.c +0 -32
index b3af388..60e8007 100644
@@ -118,7 +118,6 @@ static int ks8695_serial_getc(void)
 	return (uartp->RX);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device ks8695_serial_drv = {
 	.name	= "ks8695_serial",
 	.start	= ks8695_serial_init,
@@ -139,34 +138,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &ks8695_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return ks8695_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	ks8695_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	ks8695_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	ks8695_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return ks8695_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return ks8695_serial_tstc();
-}
-#endif
drivers/serial/serial_lh7a40x.c +0 -32
index 6b73606..6c96285 100644
@@ -182,7 +182,6 @@ static void lh7a40x_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device lh7a40x_serial_drv = {
 	.name	= "lh7a40x_serial",
 	.start	= lh7a40x_serial_init,
@@ -203,34 +202,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &lh7a40x_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return lh7a40x_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	lh7a40x_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	lh7a40x_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	lh7a40x_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return lh7a40x_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return lh7a40x_serial_tstc();
-}
-#endif
drivers/serial/serial_lpc2292.c +0 -32
index 2601ee7..fcab202 100644
@@ -102,7 +102,6 @@ static int lpc2292_serial_tstc(void)
 	return (GET8(U0LSR) & 1);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device lpc2292_serial_drv = {
 	.name	= "lpc2292_serial",
 	.start	= lpc2292_serial_init,
@@ -123,34 +122,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &lpc2292_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return lpc2292_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	lpc2292_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	lpc2292_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	lpc2292_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return lpc2292_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return lpc2292_serial_tstc();
-}
-#endif
drivers/serial/serial_max3100.c +0 -32
index b21fba0..3533cfc 100644
@@ -288,7 +288,6 @@ static void max3100_serial_setbrg(void)
 {
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device max3100_serial_drv = {
 	.name	= "max3100_serial",
 	.start	= max3100_serial_init,
@@ -309,34 +308,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &max3100_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return max3100_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	max3100_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	max3100_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	max3100_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return max3100_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return max3100_serial_tstc();
-}
-#endif
drivers/serial/serial_mxc.c +0 -36
index 0899e9b..b0612f5 100644
@@ -32,10 +32,6 @@
 
 #define UART_PHYS	CONFIG_MXC_UART_BASE
 
-#ifdef CONFIG_SERIAL_MULTI
-#warning "MXC driver does not support MULTI serials."
-#endif
-
 /* Register definitions */
 #define URXD  0x0  /* Receiver Register */
 #define UTXD  0x40 /* Transmitter Register */
@@ -226,7 +222,6 @@ static int mxc_serial_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device mxc_serial_drv = {
 	.name	= "mxc_serial",
 	.start	= mxc_serial_init,
@@ -247,34 +242,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &mxc_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return mxc_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	mxc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	mxc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	mxc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return mxc_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return mxc_serial_tstc();
-}
-#endif
drivers/serial/serial_netarm.c +0 -32
index ff6612d..d30adc3 100644
@@ -189,7 +189,6 @@ static void netarm_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device netarm_serial_drv = {
 	.name	= "netarm_serial",
 	.start	= netarm_serial_init,
@@ -210,34 +209,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &netarm_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return netarm_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	netarm_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	netarm_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	netarm_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return netarm_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return netarm_serial_tstc();
-}
-#endif
drivers/serial/serial_ns16550.c +0 -95

168 lines not on this page · raw message

drivers/serial/serial_pl01x.c +0 -32
index beb0c98..7db7b65 100644
@@ -253,7 +253,6 @@ static int pl01x_tstc (int portnum)
 	return !(readl(&regs->fr) & UART_PL01x_FR_RXFE);
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device pl01x_serial_drv = {
 	.name	= "pl01x_serial",
 	.start	= pl01x_serial_init,
@@ -274,34 +273,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &pl01x_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return pl01x_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	pl01x_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	pl01x_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	pl01x_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return pl01x_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return pl01x_serial_tstc();
-}
-#endif
drivers/serial/serial_pxa.c +0 -18
index 46d7689..ad39100 100644
@@ -73,20 +73,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define	HWUART_INDEX	0xff
 #endif
 
-#ifndef CONFIG_SERIAL_MULTI
-#if defined(CONFIG_FFUART)
-#define UART_INDEX	FFUART_INDEX
-#elif defined(CONFIG_BTUART)
-#define UART_INDEX	BTUART_INDEX
-#elif defined(CONFIG_STUART)
-#define UART_INDEX	STUART_INDEX
-#elif defined(CONFIG_HWUART)
-#define UART_INDEX	HWUART_INDEX
-#else
-#error "Please select CONFIG_(FF|BT|ST|HW)UART in board config file."
-#endif
-#endif
-
 static uint32_t pxa_uart_get_baud_divider(void)
 {
 	if (gd->baudrate == 1200)
@@ -297,9 +283,6 @@ void pxa_puts_dev(unsigned int uart_index, const char *s)
 	pxa_uart_multi(btuart, BTUART)
 #endif
 
-#ifndef	CONFIG_SERIAL_MULTI
-	pxa_uart(serial, UART)
-#else
 __weak struct serial_device *default_serial_console(void)
 {
 #if CONFIG_CONS_INDEX == 1
@@ -327,4 +310,3 @@ void pxa_serial_initialize(void)
 	serial_register(&serial_stuart_device);
 #endif
 }
-#endif
drivers/serial/serial_s3c24x0.c +0 -53

125 lines not on this page · raw message

drivers/serial/serial_s3c44b0.c +0 -32
index 8beba1a..a4428e0 100644
@@ -216,7 +216,6 @@ static void s3c44b0_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device s3c44b0_serial_drv = {
 	.name	= "s3c44b0_serial",
 	.start	= s3c44b0_serial_init,
@@ -237,34 +236,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &s3c44b0_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return s3c44b0_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	s3c44b0_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	s3c44b0_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	s3c44b0_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return s3c44b0_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return s3c44b0_serial_tstc();
-}
-#endif
drivers/serial/serial_sa1100.c +0 -32
index 86e682d..c6b34db 100644
@@ -160,7 +160,6 @@ static void sa1100_serial_puts(const char *s)
 	}
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device sa1100_serial_drv = {
 	.name	= "sa1100_serial",
 	.start	= sa1100_serial_init,
@@ -181,34 +180,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &sa1100_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return sa1100_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	sa1100_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	sa1100_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	sa1100_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return sa1100_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return sa1100_serial_tstc();
-}
-#endif
drivers/serial/serial_sh.c +0 -32
index 8c30397..640861a 100644
@@ -188,7 +188,6 @@ static int sh_serial_getc(void)
 	return ch;
 }
 
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device sh_serial_drv = {
 	.name	= "sh_serial",
 	.start	= sh_serial_init,
@@ -209,34 +208,3 @@ __weak struct serial_device *default_serial_console(void)
 {
 	return &sh_serial_drv;
 }
-#else
-int serial_init(void)
-{
-	return sh_serial_init();
-}
-
-void serial_setbrg(void)
-{
-	sh_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-	sh_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-	sh_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-	return sh_serial_getc();
-}
-
-int serial_tstc(void)
-{
-	return sh_serial_tstc();
-}
-#endif
drivers/serial/serial_xuartlite.c +0 -34
index 164497e..9cc0b7f 100644
@@ -96,39 +96,6 @@ static int uartlite_serial_init(const int port)
 	return -1;
 }
 
-#if !defined(CONFIG_SERIAL_MULTI)
-int serial_init(void)
-{
-	return uartlite_serial_init(0);
-}
-
-void serial_setbrg(void)
-{
-	/* FIXME: what's this for? */
-}
-
-void serial_putc(const char c)
-{
-	uartlite_serial_putc(c, 0);
-}
-
-void serial_puts(const char *s)
-{
-	uartlite_serial_puts(s, 0);
-}
-
-int serial_getc(void)
-{
-	return uartlite_serial_getc(0);
-}
-
-int serial_tstc(void)
-{
-	return uartlite_serial_tstc(0);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
 /* Multi serial device functions */
 #define DECLARE_ESERIAL_FUNCTIONS(port) \
 	int userial##port##_init(void) \
@@ -197,4 +164,3 @@ void uartlite_serial_initialize(void)
 	serial_register(&uartlite_serial3_device);
 #endif /* XILINX_UARTLITE_BASEADDR3 */
 }
-#endif /* CONFIG_SERIAL_MULTI */
Signature · 1 line
1.7.10.4
#299 lore raw

PATCH v3 70/72 serial: Remove CONFIG_SERIAL_MULTI from remaining sources

In reply to Marek Vasut

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI is now enabled by default.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/arm/lib/board.c             |    2 --
 arch/blackfin/lib/board.c        |    2 --
 arch/m68k/lib/board.c            |    2 --
 arch/microblaze/lib/board.c      |    2 --
 arch/nds32/lib/board.c           |    2 --
 arch/powerpc/lib/board.c         |    2 --
 arch/sandbox/lib/board.c         |    2 --
 arch/x86/lib/board.c             |    2 --
 common/cmd_nvedit.c              |    2 --
 common/fdt_support.c             |    4 ----
 common/iomux.c                   |    2 --
 common/stdio.c                   |    2 --
 include/common.h                 |   12 ------------
 include/serial.h                 |    2 +-
 post/board/pdm360ng/coproc_com.c |    3 ---
 15 files changed, 1 insertion(+), 42 deletions(-)
arch/arm/lib/board.c +0 -2
index 109a1ac..0b47ab3 100644
@@ -492,9 +492,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #ifdef CONFIG_CLOCKS
 	set_cpu_clk_info(); /* Setup clock information */
 #endif
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/blackfin/lib/board.c +0 -2
index c380d27..0b31f37 100644
@@ -284,9 +284,7 @@ void board_init_f(ulong bootflag)
 	init_baudrate();
 	serial_early_puts("Serial init\n");
 	serial_init();
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 	serial_early_puts("Console init flash\n");
 	console_init_f();
 	serial_early_puts("End of early debugging\n");
arch/m68k/lib/board.c +0 -2
index 2add630..67c9a13 100644
@@ -401,9 +401,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 	gd->flags |= GD_FLG_RELOC;	/* tell others: relocation done */
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/microblaze/lib/board.c +0 -2
index 674b573..efd63cd 100644
@@ -108,9 +108,7 @@ void board_init_f(ulong not_used)
 	 */
 	mem_malloc_init (CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN);
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
 		WATCHDOG_RESET ();
arch/nds32/lib/board.c +0 -2
index 17d3ee0..89900fe 100644
@@ -324,9 +324,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 		(ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
 #endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/powerpc/lib/board.c +0 -2
index 07feaf5..b860141 100644
@@ -672,9 +672,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
 #endif
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/sandbox/lib/board.c +0 -2
index c173bf9..83858c1 100644
@@ -220,9 +220,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	gd->flags |= GD_FLG_RELOC;	/* tell others: relocation done */
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 #ifdef CONFIG_POST
 	post_output_backlog();
arch/x86/lib/board.c +0 -2
index 90cf7fc..e5caf13 100644
@@ -150,9 +150,7 @@ init_fnc_t *init_sequence_r[] = {
 	timer_init,
 	display_banner,
 	display_dram_config,
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize_r,
-#endif
 #ifndef CONFIG_SYS_NO_FLASH
 	flash_init_r,
 #endif
common/cmd_nvedit.c +0 -2
index 3474bc6..1d67f20 100644
@@ -237,10 +237,8 @@ int env_check_apply(const char *name, const char *oldval,
 		if (console_assign(console, newval) < 0)
 			return 1;
 
-#ifdef CONFIG_SERIAL_MULTI
 		if (serial_assign(newval) < 0)
 			return 1;
-#endif
 #endif /* CONFIG_CONSOLE_MUX */
 	}
 
common/fdt_support.c +0 -4
index 593f16c..1b208af 100644
@@ -94,7 +94,6 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
 
 #ifdef CONFIG_OF_STDOUT_VIA_ALIAS
 
-#ifdef CONFIG_SERIAL_MULTI
 static void fdt_fill_multisername(char *sername, size_t maxlen)
 {
 	const char *outname = stdio_devices[stdout]->name;
@@ -106,9 +105,6 @@ static void fdt_fill_multisername(char *sername, size_t maxlen)
 	if (strcmp(outname + 1, "serial") > 0)
 		strncpy(sername, outname + 1, maxlen);
 }
-#else
-static inline void fdt_fill_multisername(char *sername, size_t maxlen) {}
-#endif /* CONFIG_SERIAL_MULTI */
 
 static int fdt_fixup_stdout(void *fdt, int chosenoff)
 {
common/iomux.c +0 -2
index 91d98e9..dbc2312 100644
@@ -135,7 +135,6 @@ int iomux_doenv(const int console, const char *arg)
 		 */
 		if (console_assign(console, start[j]) < 0)
 			continue;
-#ifdef CONFIG_SERIAL_MULTI
 		/*
 		 * This was taken from common/cmd_nvedit.c.
 		 * This will never work because serial_assign() returns
@@ -146,7 +145,6 @@ int iomux_doenv(const int console, const char *arg)
 		 */
 		if (serial_assign(start[j]) < 0)
 			continue;
-#endif
 		cons_set[cs_idx++] = dev;
 	}
 	free(console_args);
common/stdio.c +0 -2
index 1bf9ba0..605ff3f 100644
@@ -227,9 +227,7 @@ int stdio_init (void)
 	drv_logbuff_init ();
 #endif
 	drv_system_init ();
-#ifdef CONFIG_SERIAL_MULTI
 	serial_stdio_init ();
-#endif
 #ifdef CONFIG_USB_TTY
 	drv_usbtty_init ();
 #endif
include/common.h +0 -12
index 55025c0..b52a8a4 100644
@@ -194,18 +194,6 @@ typedef void (interrupt_handler_t)(void *);
 # endif
 #endif
 
-#ifndef CONFIG_SERIAL_MULTI
-
-#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2) \
- || defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) \
- || defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
-
-#define CONFIG_SERIAL_MULTI	1
-
-#endif
-
-#endif /* CONFIG_SERIAL_MULTI */
-
 /*
  * General Purpose Utilities
  */
include/serial.h +1 -1
index 01a86b4..a8d23f5 100644
@@ -63,7 +63,7 @@ extern int usbtty_tstc(void);
 
 #endif /* CONFIG_USB_TTY */
 
-#if defined(CONFIG_MPC512X) &&  defined(CONFIG_SERIAL_MULTI)
+#if defined(CONFIG_MPC512X)
 extern struct stdio_dev *open_port(int num, int baudrate);
 extern int close_port(int num);
 extern int write_port(struct stdio_dev *port, char *buf);
post/board/pdm360ng/coproc_com.c +0 -3
index 0755352..b7e02b5 100644
@@ -28,8 +28,6 @@
 #include <post.h>
 #include <serial.h>
 
-#if defined(CONFIG_SERIAL_MULTI)
-
 /*
  * Actually the termination sequence of the coprocessor
  * commands is "\r\n" (CR LF), but here we use a side effect of
@@ -94,4 +92,3 @@ int coprocessor_post_test(int flags)
 
 	return 0;
 }
-#endif	/* CONFIG_SERIAL_MULTI */
Signature · 1 line
1.7.10.4
#300 lore raw

PATCH v2 70/72 serial: Remove CONFIG_SERIAL_MULTI from remaining sources

Remove the parts depending either on disabled CONFIG_SERIAL_MULTI or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI is now enabled by default.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 arch/arm/lib/board.c             |    2 --
 arch/blackfin/lib/board.c        |    2 --
 arch/m68k/lib/board.c            |    2 --
 arch/microblaze/lib/board.c      |    2 --
 arch/nds32/lib/board.c           |    2 --
 arch/powerpc/lib/board.c         |    2 --
 arch/sandbox/lib/board.c         |    2 --
 arch/x86/lib/board.c             |    2 --
 common/cmd_nvedit.c              |    2 --
 common/fdt_support.c             |    6 ++----
 common/iomux.c                   |    2 --
 common/stdio.c                   |    2 --
 include/common.h                 |   12 ------------
 include/serial.h                 |    2 +-
 post/board/pdm360ng/coproc_com.c |    3 ---
 15 files changed, 3 insertions(+), 42 deletions(-)

V2: Fix compiler warning about unused fdt_fill_multisername

arch/arm/lib/board.c +0 -2
index 109a1ac..0b47ab3 100644
@@ -492,9 +492,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #ifdef CONFIG_CLOCKS
 	set_cpu_clk_info(); /* Setup clock information */
 #endif
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/blackfin/lib/board.c +0 -2
index c380d27..0b31f37 100644
@@ -284,9 +284,7 @@ void board_init_f(ulong bootflag)
 	init_baudrate();
 	serial_early_puts("Serial init\n");
 	serial_init();
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 	serial_early_puts("Console init flash\n");
 	console_init_f();
 	serial_early_puts("End of early debugging\n");
arch/m68k/lib/board.c +0 -2
index 2add630..67c9a13 100644
@@ -401,9 +401,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 	gd->flags |= GD_FLG_RELOC;	/* tell others: relocation done */
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/microblaze/lib/board.c +0 -2
index 674b573..efd63cd 100644
@@ -108,9 +108,7 @@ void board_init_f(ulong not_used)
 	 */
 	mem_malloc_init (CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN);
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
 		WATCHDOG_RESET ();
arch/nds32/lib/board.c +0 -2
index 17d3ee0..89900fe 100644
@@ -324,9 +324,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 		(ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
 #endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/powerpc/lib/board.c +0 -2
index 07feaf5..b860141 100644
@@ -672,9 +672,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
 #endif
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 	debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
arch/sandbox/lib/board.c +0 -2
index c173bf9..83858c1 100644
@@ -220,9 +220,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	gd->flags |= GD_FLG_RELOC;	/* tell others: relocation done */
 
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
-#endif
 
 #ifdef CONFIG_POST
 	post_output_backlog();
arch/x86/lib/board.c +0 -2
index 90cf7fc..e5caf13 100644
@@ -150,9 +150,7 @@ init_fnc_t *init_sequence_r[] = {
 	timer_init,
 	display_banner,
 	display_dram_config,
-#ifdef CONFIG_SERIAL_MULTI
 	serial_initialize_r,
-#endif
 #ifndef CONFIG_SYS_NO_FLASH
 	flash_init_r,
 #endif
common/cmd_nvedit.c +0 -2
index 3474bc6..1d67f20 100644
@@ -237,10 +237,8 @@ int env_check_apply(const char *name, const char *oldval,
 		if (console_assign(console, newval) < 0)
 			return 1;
 
-#ifdef CONFIG_SERIAL_MULTI
 		if (serial_assign(newval) < 0)
 			return 1;
-#endif
 #endif /* CONFIG_CONSOLE_MUX */
 	}
 
common/fdt_support.c +2 -4
index 593f16c..963ea90 100644
@@ -94,7 +94,7 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
 
 #ifdef CONFIG_OF_STDOUT_VIA_ALIAS
 
-#ifdef CONFIG_SERIAL_MULTI
+#ifdef CONFIG_CONS_INDEX
 static void fdt_fill_multisername(char *sername, size_t maxlen)
 {
 	const char *outname = stdio_devices[stdout]->name;
@@ -106,9 +106,7 @@ static void fdt_fill_multisername(char *sername, size_t maxlen)
 	if (strcmp(outname + 1, "serial") > 0)
 		strncpy(sername, outname + 1, maxlen);
 }
-#else
-static inline void fdt_fill_multisername(char *sername, size_t maxlen) {}
-#endif /* CONFIG_SERIAL_MULTI */
+#endif
 
 static int fdt_fixup_stdout(void *fdt, int chosenoff)
 {
common/iomux.c +0 -2
index 91d98e9..dbc2312 100644
@@ -135,7 +135,6 @@ int iomux_doenv(const int console, const char *arg)
 		 */
 		if (console_assign(console, start[j]) < 0)
 			continue;
-#ifdef CONFIG_SERIAL_MULTI
 		/*
 		 * This was taken from common/cmd_nvedit.c.
 		 * This will never work because serial_assign() returns
@@ -146,7 +145,6 @@ int iomux_doenv(const int console, const char *arg)
 		 */
 		if (serial_assign(start[j]) < 0)
 			continue;
-#endif
 		cons_set[cs_idx++] = dev;
 	}
 	free(console_args);
common/stdio.c +0 -2
index 1bf9ba0..605ff3f 100644
@@ -227,9 +227,7 @@ int stdio_init (void)
 	drv_logbuff_init ();
 #endif
 	drv_system_init ();
-#ifdef CONFIG_SERIAL_MULTI
 	serial_stdio_init ();
-#endif
 #ifdef CONFIG_USB_TTY
 	drv_usbtty_init ();
 #endif
include/common.h +0 -12
index 55025c0..b52a8a4 100644
@@ -194,18 +194,6 @@ typedef void (interrupt_handler_t)(void *);
 # endif
 #endif
 
-#ifndef CONFIG_SERIAL_MULTI
-
-#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2) \
- || defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) \
- || defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
-
-#define CONFIG_SERIAL_MULTI	1
-
-#endif
-
-#endif /* CONFIG_SERIAL_MULTI */
-
 /*
  * General Purpose Utilities
  */
include/serial.h +1 -1
index 01a86b4..a8d23f5 100644
@@ -63,7 +63,7 @@ extern int usbtty_tstc(void);
 
 #endif /* CONFIG_USB_TTY */
 
-#if defined(CONFIG_MPC512X) &&  defined(CONFIG_SERIAL_MULTI)
+#if defined(CONFIG_MPC512X)
 extern struct stdio_dev *open_port(int num, int baudrate);
 extern int close_port(int num);
 extern int write_port(struct stdio_dev *port, char *buf);
post/board/pdm360ng/coproc_com.c +0 -3
index 0755352..b7e02b5 100644
@@ -28,8 +28,6 @@
 #include <post.h>
 #include <serial.h>
 
-#if defined(CONFIG_SERIAL_MULTI)
-
 /*
  * Actually the termination sequence of the coprocessor
  * commands is "\r\n" (CR LF), but here we use a side effect of
@@ -94,4 +92,3 @@ int coprocessor_post_test(int flags)
 
 	return 0;
 }
-#endif	/* CONFIG_SERIAL_MULTI */
Signature · 1 line
1.7.10.4
#301 lore raw

PATCH v3 71/72 serial: Compile drivers/serial/serial.c by default

In reply to Marek Vasut

Compile drivers/serial/serial.c by default both into SPL and into non-SPL builds, since CONFIG_SERIAL_MULTI is now the default state. Also having common/serial.c in by default now, it's pointless to keep -DCONFIG_SERIAL_MULTI in CPPFLAGS any longer, so remove it as well.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 config.mk               |    2 +-
 drivers/serial/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
config.mk +1 -1
index 88c72f1..c3822a2 100644
@@ -193,7 +193,7 @@ OBJCFLAGS += --gap-fill=0xff
 gccincdir := $(shell $(CC) -print-file-name=include)
 
 CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)		\
-	-D__KERNEL__ -DCONFIG_SERIAL_MULTI
+	-D__KERNEL__
 
 # Enable garbage collection of un-used sections for SPL
 ifeq ($(CONFIG_SPL_BUILD),y)
drivers/serial/Makefile +1 -1
index 9b54c12..0eaf227 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libserial.o
 
-COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
+COBJS-y += serial.o
 
 COBJS-$(CONFIG_ALTERA_UART) += altera_uart.o
 COBJS-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
Signature · 1 line
1.7.10.4
#302 lore raw

PATCH v3 72/72 serial: Enhance the manual relocation

In reply to Marek Vasut

Enhance the manual relocation of drivers operations structure by checking if the entries are NULL and increment them only if they are not. This allows for setting any entry to NULL and it will survive the manual relocation.

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
---
 drivers/serial/serial.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/serial/serial.c +14 -6
index 91c7269..9550cbd 100644
@@ -96,12 +96,20 @@ serial_initfunc(sh_serial_initialize);
 void serial_register(struct serial_device *dev)
 {
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
-	dev->start += gd->reloc_off;
-	dev->setbrg += gd->reloc_off;
-	dev->getc += gd->reloc_off;
-	dev->tstc += gd->reloc_off;
-	dev->putc += gd->reloc_off;
-	dev->puts += gd->reloc_off;
+	if (dev->start)
+		dev->start += gd->reloc_off;
+	if (dev->stop)
+		dev->stop += gd->reloc_off;
+	if (dev->setbrg)
+		dev->setbrg += gd->reloc_off;
+	if (dev->getc)
+		dev->getc += gd->reloc_off;
+	if (dev->tstc)
+		dev->tstc += gd->reloc_off;
+	if (dev->putc)
+		dev->putc += gd->reloc_off;
+	if (dev->puts)
+		dev->puts += gd->reloc_off;
 #endif
 
 	dev->next = serial_devices;
Signature · 1 line
1.7.10.4
#303 lore raw

v3 cover serial: Massive rework of the serial subsystem

In reply to Marek Vasut
Quoted 287 lines · Marek Vasut

This patchset is a STAGE 1 of preparation of the stdio and serial subsys for the driver model.

The idea of this patchset is:

1) Clean up the struct serial_device
Do a coding style cleanup.
2) Replace .init and .uninit with .start and .stop
This is to bring struct serial_device much closer to struct stdio_dev so later on, these structures can be overlayed and struct serial_device can be easily passed to stdio subsystem directly.
3) Do minor cleanups on the PXA and MPC512X
Basically for PXA this means to remove default_serial_console() call from every single PXA board and move it into PXA serial driver. For MPC512X, that means properly defining PSC console number.
4) Add support for CONFIG_SERIAL_MULTI into every single driver Implement support for both non-multi and multi operation into every single serial driver in the U-Boot source tree. This is a vast majority of this patchset.
5) Unconditionally enable CONFIG_SERIAL_MULTI
Enable the multi operation throughout the whole U-Boot tree, both for SPL and non-SPL builds. There was also some breakage due to this, so this patchset also addresses that with minor fixes.
6) Remove unused code used for the non-multi operation
Remove code that was used when CONFIG_SERIAL_MULTI was not selected. Also remove all occurances of CONFIG_SERIAL_MULTI throughout the source tree. Some parts of the code must have been adjusted to cope with this since they were initially only written for non-multi operation. These were minor adjustments mostly in macros though.

This changeset obviously does mean size growth of U-Boot, therefore some statistics (stock U-Boot first, patchset last):

Configuring for omap3_beagle board...

   text    data     bss     dec     hex filename
 325687    8456  266888  601031   92bc7 ./u-boot
 326912    8648  266944  602504   93188 ./u-boot
  43082    1812  198020  242914   3b4e2 ./spl/u-boot-spl
  45794    1860  198020  245674   3bfaa ./spl/u-boot-spl

Configuring for P1020RDB-PC_36BIT_SPIFLASH - Board: p1_p2_rdb_pc, Options: P1020RDB,36BIT,SPIFLASH
text data bss dec hex filename

 392469   30628  267568  690665   a89e9 ./u-boot
 394550   30940  267600  693090   a9362 ./u-boot

Configuring for grsim_leon2 board...

   text    data     bss     dec     hex filename
  95658    3328    2640  101626   18cfa ./u-boot
  97058    3384    2640  103082   192aa ./u-boot

Configuring for sandbox board...

   text    data     bss     dec     hex filename
 137394    6364   28488  172246   2a0d6 ./u-boot
 138674    6456   28504  173634   2a642 ./u-boot

V2: Rebase on top of current -next
V3: - Fix problem with new SPL framework (2 new patches)
- mv drivers/serial/serial{,-ns16550}.c to make clear what that driver really is [ 0065/0072 ]
- Move common/serial.c do drivers/serial, since it really has to link with libserial.o, not libcommon.o [ 0066/0072 ]

Marek Vasut (72):
serial: Coding style cleanup of struct serial_device
serial: Rename .init() and .uninit() in serial_device
serial: Properly spell out the structure member names of
serial_driver
serial: pxa: Implement default_serial_console in serial_pxa.c
serial: pxa: Make use of default_serial_console in serial_pxa
serial: pxa: Make local functions static
serial: mpc512x: Properly define CONFIG_SYS_PSC3 in config files
serial: Implement serial_initfunc() macro
serial: mpc8xx: Move serial registration from serial_initialize()
serial: s3c24xx: Move serial registration from serial_initialize()
serial: pxa: Move serial registration from serial_initialize()
serial: s5p: Move serial registration from serial_initialize()
serial: microblaze: Move serial registration from serial_initialize()
serial: mpc512x: Move serial registration from serial_initialize()
serial: ns16550: Move serial registration from serial_initialize()
serial: bfin: Remove the bfin_serialN_device exports from serial.h
serial: bfin: Adjust serial_register_bfin_uart()
serial: zoom2: Remove zoom2 serial prototypes from serial.h
serial: bfin: Flip the jtag serial console to CONFIG_SERIAL_MULTI
serial: mips: Implement CONFIG_SERIAL_MULTI into au1x00 serial driver
serial: mips: Implement CONFIG_SERIAL_MULTI into asc serial driver
serial: mips: Implement CONFIG_SERIAL_MULTI into JZ serial driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc5xx serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8220 serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8260 serial
drivers
serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc85xx serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into iop480 serial
driver
serial: sparc: Implement CONFIG_SERIAL_MULTI into leon2 serial driver
serial: sparc: Implement CONFIG_SERIAL_MULTI into leon3 serial driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into marvell serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into amirix serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into cogent serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into cpci750 serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into evb64260 serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into ml2 serial driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into sconsole serial
driver
serial: powerpc: Implement CONFIG_SERIAL_MULTI into p3mx serial
driver
serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial
driver
serial: arm: Implement CONFIG_SERIAL_MULTI into altera serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into lpc32xx serial driver
serial: mcf: Implement CONFIG_SERIAL_MULTI into MCF serial driver
serial: Implement CONFIG_SERIAL_MULTI into ns9750 serial driver
serial: oc: Implement CONFIG_SERIAL_MULTI into OpenCores serial
driver
serial: arm: Implement CONFIG_SERIAL_MULTI into s3c4510b serial
driver
serial: arm: Implement CONFIG_SERIAL_MULTI into s3c64xx serial driver
serial: sandbox: Implement CONFIG_SERIAL_MULTI into sandbox serial
driver
serial: arm: Implement CONFIG_SERIAL_MULTI into clps7111 serial
driver
serial: arm: Implement CONFIG_SERIAL_MULTI into imx serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into ixp serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into ks8695 serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into lh7a40x serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into lpc2292 serial driver
serial: Implement CONFIG_SERIAL_MULTI into max3100 serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into mxc serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into netarm serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into pl01x serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into s3c44b0 serial driver
serial: arm: Implement CONFIG_SERIAL_MULTI into sa1100 serial driver
serial: sh: Implement CONFIG_SERIAL_MULTI into sh serial driver
serial: mxs: spl: Remove empty serial_* functions from SPL code
serial: Use puts() and hang() instead of panic() in SPL
serial: ns16550: Call usbtty_poll only in non-SPL build
serial: ns16550: Rename serial.c to serial_ns16550.c
serial: Move common/serial.c to drivers/serial/
serial: Unconditionally enable CONFIG_SERIAL_MULTI
serial: Remove CONFIG_SERIAL_MULTI from config files
serial: Remove CONFIG_SERIAL_MULTI from serial drivers
serial: Remove CONFIG_SERIAL_MULTI from remaining sources
serial: Compile drivers/serial/serial.c by default
serial: Enhance the manual relocation

 arch/arm/cpu/arm926ejs/mxs/spl_boot.c         |    4 -
 arch/arm/lib/board.c                          |    2 -
 arch/blackfin/cpu/jtag-console.c              |   37 +-
 arch/blackfin/cpu/serial.c                    |    6 +-
 arch/blackfin/lib/board.c                     |    2 -
 arch/m68k/lib/board.c                         |    2 -
 arch/microblaze/lib/board.c                   |    2 -
 arch/mips/cpu/mips32/au1x00/au1x00_serial.c   |   42 +-
 arch/mips/cpu/mips32/incaip/asc_serial.c      |   35 +-
 arch/mips/cpu/xburst/jz_serial.c              |   35 +-
 arch/nds32/lib/board.c                        |    2 -
 arch/powerpc/cpu/mpc512x/serial.c             |   92 ++---
 arch/powerpc/cpu/mpc5xx/serial.c              |   69 ++--
 arch/powerpc/cpu/mpc5xxx/serial.c             |  181 +++-----
 arch/powerpc/cpu/mpc8220/uart.c               |   35 +-
 arch/powerpc/cpu/mpc8260/serial_scc.c         |   39 +-
 arch/powerpc/cpu/mpc8260/serial_smc.c         |   39 +-
 arch/powerpc/cpu/mpc85xx/serial_scc.c         |   39 +-
 arch/powerpc/cpu/mpc8xx/serial.c              |   43 +-
 arch/powerpc/cpu/ppc4xx/iop480_uart.c         |   36 +-
 arch/powerpc/lib/board.c                      |    2 -
 arch/sandbox/lib/board.c                      |    2 -
 arch/sparc/cpu/leon2/serial.c                 |   51 ++-
 arch/sparc/cpu/leon3/serial.c                 |   51 ++-
 arch/x86/lib/board.c                          |    2 -
 board/Marvell/common/serial.c                 |   48 ++-
 board/amirix/ap1000/serial.c                  |   35 +-
 board/balloon3/balloon3.c                     |    5 -
 board/bmw/serial.c                            |   36 +-
 board/cogent/serial.c                         |   34 +-
 board/esd/cpci750/serial.c                    |   36 +-
 board/evb64260/serial.c                       |   54 ++-
 board/logicpd/zoom2/zoom2_serial.c            |    7 +-
 board/logicpd/zoom2/zoom2_serial.h            |   16 +-
 board/ml2/serial.c                            |   35 +-
 board/palmld/palmld.c                         |    5 -
 board/palmtc/palmtc.c                         |    5 -
 board/pcippc2/sconsole.c                      |   35 +-
 board/pdm360ng/pdm360ng.c                     |    6 -
 board/prodrive/p3mx/serial.c                  |   36 +-
 board/toradex/colibri_pxa270/colibri_pxa270.c |    5 -
 board/trizepsiv/conxs.c                       |    7 -
 board/vpac270/vpac270.c                       |    5 -
 board/zipitz2/zipitz2.c                       |    5 -
 common/Makefile                               |    1 -
 common/cmd_nvedit.c                           |    2 -
 common/fdt_support.c                          |    4 -
 common/iomux.c                                |    2 -
 common/serial.c                               |  305 --------------
 common/stdio.c                                |    2 -
 drivers/serial/Makefile                       |    4 +-
 drivers/serial/altera_jtag_uart.c             |   39 +-
 drivers/serial/altera_uart.c                  |   51 ++-
 drivers/serial/atmel_usart.c                  |   35 +-
 drivers/serial/lpc32xx_hsuart.c               |   57 ++-
 drivers/serial/mcfuart.c                      |   33 +-
 drivers/serial/ns16550.c                      |    2 +-
 drivers/serial/ns9750_serial.c                |   33 +-
 drivers/serial/opencores_yanu.c               |   35 +-
 drivers/serial/s3c4510b_uart.c                |   33 +-
 drivers/serial/s3c64xx.c                      |   33 +-
 drivers/serial/sandbox.c                      |   35 +-
 drivers/serial/serial.c                       |  550 +++++++++++++------------
 drivers/serial/serial_clps7111.c              |   34 +-
 drivers/serial/serial_imx.c                   |   36 +-
 drivers/serial/serial_ixp.c                   |   36 +-
 drivers/serial/serial_ks8695.c                |   41 +-
 drivers/serial/serial_lh7a40x.c               |   34 +-
 drivers/serial/serial_lpc2292.c               |   34 +-
 drivers/serial/serial_max3100.c               |   42 +-
 drivers/serial/serial_mxc.c                   |   40 +-
 drivers/serial/serial_netarm.c                |   33 +-
 drivers/serial/serial_ns16550.c               |  264 ++++++++++++
 drivers/serial/serial_pl01x.c                 |   37 +-
 drivers/serial/serial_pxa.c                   |   65 +--
 drivers/serial/serial_s3c24x0.c               |   78 +---
 drivers/serial/serial_s3c44b0.c               |   36 +-
 drivers/serial/serial_s5p.c                   |   27 +-
 drivers/serial/serial_sa1100.c                |   36 +-
 drivers/serial/serial_sh.c                    |   33 +-
 drivers/serial/serial_xuartlite.c             |   69 ++--
 include/common.h                              |   12 -
 include/configs/DU440.h                       |    1 -
 include/configs/KAREF.h                       |    1 -
 include/configs/METROBOX.h                    |    1 -
 include/configs/MPC8569MDS.h                  |    1 -
 include/configs/P1010RDB.h                    |    1 -
 include/configs/P1_P2_RDB.h                   |    1 -
 include/configs/P2020COME.h                   |    1 -
 include/configs/PMC440.h                      |    1 -
 include/configs/TB5200.h                      |    1 -
 include/configs/amcc-common.h                 |    1 -
 include/configs/aria.h                        |    1 +
 include/configs/balloon3.h                    |    1 +
 include/configs/bfin_adi_common.h             |    1 -
 include/configs/colibri_pxa270.h              |    1 +
 include/configs/coreboot.h                    |    1 -
 include/configs/eNET.h                        |    1 -
 include/configs/harmony.h                     |    1 -
 include/configs/jadecpu.h                     |    1 -
 include/configs/korat.h                       |    1 -
 include/configs/lubbock.h                     |    1 +
 include/configs/lwmon.h                       |    1 -
 include/configs/lwmon5.h                      |    1 -
 include/configs/mcc200.h                      |    5 -
 include/configs/mecp5123.h                    |    1 +
 include/configs/medcom.h                      |    1 -
 include/configs/mpc5121ads.h                  |    1 +
 include/configs/omap3_zoom2.h                 |    3 +-
 include/configs/origen.h                      |    1 -
 include/configs/palmld.h                      |    1 +
 include/configs/palmtc.h                      |    1 +
 include/configs/paz00.h                       |    1 -
 include/configs/pcs440ep.h                    |    1 -
 include/configs/pdm360ng.h                    |    3 -
 include/configs/plutux.h                      |    1 -
 include/configs/pxa255_idp.h                  |    1 +
 include/configs/quad100hd.h                   |    1 -
 include/configs/s5p_goni.h                    |    1 -
 include/configs/s5pc210_universal.h           |    1 -
 include/configs/sc3.h                         |    1 -
 include/configs/seaboard.h                    |    1 -
 include/configs/smdk5250.h                    |    1 -
 include/configs/smdkc100.h                    |    1 -
 include/configs/smdkv310.h                    |    1 -
 include/configs/tec.h                         |    1 -
 include/configs/tegra-common-post.h           |    5 -
 include/configs/trats.h                       |    1 -
 include/configs/trimslice.h                   |    1 -
 include/configs/trizepsiv.h                   |    2 +-
 include/configs/ventana.h                     |    1 -
 include/configs/vpac270.h                     |    1 +
 include/configs/whistler.h                    |    1 -
Quoted 8 lines
 include/configs/xaeniax.h                     |    2 +-
 include/configs/zeus.h                        |    1 -
 include/configs/zipitz2.h                     |    1 +
 include/serial.h                              |   79 +---
 post/board/pdm360ng/coproc_com.c              |    3 -
 138 files changed, 2111 insertions(+), 1547 deletions(-)
 delete mode 100644 common/serial.c
 create mode 100644 drivers/serial/serial_ns16550.c

This has been applied, with the various follow-up patches that fixed warnings used, to u-boot/next, 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/20121002/981ebf98/attachment.pgp>
#304 lore raw

v3 cover serial: Massive rework of the serial subsystem

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 2 lines · In message <[email protected]> you wrote:

This patchset is a STAGE 1 of preparation of the stdio and serial subsys for the driver model.

Formal complaint:

There is no change log.

Actually none of the patches has any marker that it is a resubmit of earlier versions. The "V3" in the cover letter is totally useless as this is NOT recorded in patchwork.

Also, I think we disussed before NOT to cross-post between u-boot and u-boot-dm, didn't we?

Normally, I would reject such a series for educational reasons. You are lucky that I don't have time to do any reviews recently.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
"Life, loathe it or ignore it, you can't like it."
- Marvin the paranoid android
#305 lore raw

v3 cover serial: Massive rework of the serial subsystem

Dear Wolfgang Denk,

Quoted 6 lines

Dear Marek Vasut,

Quoted 2 lines · In message <[email protected]> you wrote:

This patchset is a STAGE 1 of preparation of the stdio and serial subsys for the driver model.

Quoted 7 lines

Formal complaint:

There is no change log.

Actually none of the patches has any marker that it is a resubmit of earlier versions. The "V3" in the cover letter is totally useless as this is NOT recorded in patchwork.

Yep, we made a formal agreement with Albert yesterday about learning patman ... so I did. Thus this one shall be the last troublesome patchset.

Quoted 2 lines

Also, I think we disussed before NOT to cross-post between u-boot and u-boot-dm, didn't we?

I cross-posted only the cover letter to give others notification.

Quoted 6 lines

Normally, I would reject such a series for educational reasons. You are lucky that I don't have time to do any reviews recently.

Best regards,

Wolfgang Denk

Best regards,
Marek Vasut