serial: Massive rework of the serial subsystem
Subsystems (12)
PATCH v3 5/72 serial: pxa: Make use of default_serial_console in serial_pxa
In reply to Marek VasutMake 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v3 6/72 serial: pxa: Make local functions static
In reply to Marek VasutMake 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
@@ -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
PATCH v3 7/72 serial: mpc512x: Properly define CONFIG_SYS_PSC3 in config files
In reply to Marek VasutSome 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 8/72 serial: Implement serial_initfunc() macro
In reply to Marek VasutThis 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.
--- common/serial.c | 8 ++++++++ 1 file changed, 8 insertions(+)
common/serial.c +8 -0
@@ -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
PATCH v3 9/72 serial: mpc8xx: Move serial registration from serial_initialize()
In reply to Marek VasutMove 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.
--- 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
@@ -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
@@ -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
PATCH v3 10/72 serial: s3c24xx: Move serial registration from serial_initialize()
In reply to Marek VasutMove 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 11/72 serial: pxa: Move serial registration from serial_initialize()
In reply to Marek VasutMove 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
@@ -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
@@ -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
@@ -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
PATCH v3 12/72 serial: s5p: Move serial registration from serial_initialize()
In reply to Marek VasutMove 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 13/72 serial: microblaze: Move serial registration from serial_initialize()
In reply to Marek VasutMove 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 14/72 serial: mpc512x: Move serial registration from serial_initialize()
In reply to Marek VasutMove 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 15/72 serial: ns16550: Move serial registration from serial_initialize()
In reply to Marek VasutMove 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 16/72 serial: bfin: Remove the bfin_serialN_device exports from serial.h
In reply to Marek VasutRemove 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.
--- include/serial.h | 4 ---- 1 file changed, 4 deletions(-)
include/serial.h +0 -4
@@ -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
PATCH v3 17/72 serial: bfin: Adjust serial_register_bfin_uart()
In reply to Marek VasutRename 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 18/72 serial: zoom2: Remove zoom2 serial prototypes from serial.h
In reply to Marek VasutRemove 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
@@ -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
@@ -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
@@ -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
PATCH v3 19/72 serial: bfin: Flip the jtag serial console to CONFIG_SERIAL_MULTI
In reply to Marek VasutRework 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.
--- 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
@@ -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
@@ -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
@@ -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
PATCH v3 20/72 serial: mips: Implement CONFIG_SERIAL_MULTI into au1x00 serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 21/72 serial: mips: Implement CONFIG_SERIAL_MULTI into asc serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 22/72 serial: mips: Implement CONFIG_SERIAL_MULTI into JZ serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 23/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc5xx serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
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.
--- 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
@@ -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
@@ -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
PATCH v3 24/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8220 serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 25/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8260 serial drivers
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
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.
--- 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
@@ -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
@@ -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
PATCH v3 26/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc85xx serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 27/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into iop480 serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 28/72 serial: sparc: Implement CONFIG_SERIAL_MULTI into leon2 serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 29/72 serial: sparc: Implement CONFIG_SERIAL_MULTI into leon3 serial driver
In reply to Marek VasutImplement 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.
--- 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
@@ -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
@@ -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
PATCH v3 30/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into marvell serial driver
In reply to Marek VasutImplement 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.
--- board/Marvell/common/serial.c | 80 ++++++++++++++++++++++++++++++++++------- common/serial.c | 2 ++ 2 files changed, 69 insertions(+), 13 deletions(-)
board/Marvell/common/serial.c +67 -13
@@ -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 (definedCONFIG_SYS_INIT_CHAN1 ) || (definedCONFIG_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
@@ -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
PATCH v3 31/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into amirix serial driver
In reply to Marek VasutImplement 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.
--- board/amirix/ap1000/serial.c | 66 ++++++++++++++++++++++++++++++++++++++---- common/serial.c | 2 ++ 2 files changed, 62 insertions(+), 6 deletions(-)
board/amirix/ap1000/serial.c +60 -6
@@ -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 gComPortstatic 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
@@ -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
PATCH v3 32/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver
In reply to Marek VasutImplement 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.
--- board/bmw/serial.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++----- common/serial.c | 2 ++ 2 files changed, 64 insertions(+), 6 deletions(-)
board/bmw/serial.c +62 -6
@@ -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
@@ -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
PATCH v3 33/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into cogent serial driver
In reply to Marek VasutImplement 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.
--- board/cogent/serial.c | 66 ++++++++++++++++++++++++++++++++++++++++++++----- common/serial.c | 2 ++ 2 files changed, 62 insertions(+), 6 deletions(-)
board/cogent/serial.c +60 -6
@@ -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
@@ -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
PATCH v3 34/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into cpci750 serial driver
In reply to Marek VasutImplement 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.
--- board/esd/cpci750/serial.c | 67 ++++++++++++++++++++++++++++++++++++++++---- common/serial.c | 2 ++ 2 files changed, 63 insertions(+), 6 deletions(-)
board/esd/cpci750/serial.c +61 -6
@@ -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
@@ -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
PATCH v3 35/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into evb64260 serial driver
In reply to Marek VasutImplement 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.
--- board/evb64260/serial.c | 85 ++++++++++++++++++++++++++++++++++++----------- common/serial.c | 2 ++ 2 files changed, 67 insertions(+), 20 deletions(-)
board/evb64260/serial.c +65 -20
@@ -30,6 +30,8 @@#include <common.h> #include <command.h> #include <galileo/memory.h> +#include <serial.h> +#include <linux/compiler.h> #if (definedCONFIG_SYS_INIT_CHAN1 ) || (definedCONFIG_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 (definedCONFIG_SYS_INIT_CHAN1 ) || (definedCONFIG_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
@@ -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
PATCH v3 36/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into ml2 serial driver
In reply to Marek VasutImplement 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.
--- board/ml2/serial.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++----- common/serial.c | 2 ++ 2 files changed, 62 insertions(+), 6 deletions(-)
board/ml2/serial.c +60 -6
@@ -24,6 +24,8 @@#include <asm/processor.h> #include <command.h> #include <configs/ML2.h> +#include <serial.h> +#include <linux/compiler.h> #if (definedCONFIG_SYS_INIT_CHAN1 ) || (definedCONFIG_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
@@ -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
PATCH v3 37/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into sconsole serial driver
In reply to Marek VasutImplement 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.
--- board/pcippc2/sconsole.c | 66 +++++++++++++++++++++++++++++++++++++++++----- common/serial.c | 2 ++ 2 files changed, 62 insertions(+), 6 deletions(-)
board/pcippc2/sconsole.c +60 -6
@@ -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
@@ -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
PATCH v3 38/72 serial: powerpc: Implement CONFIG_SERIAL_MULTI into p3mx serial driver
In reply to Marek VasutImplement 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.
--- board/prodrive/p3mx/serial.c | 68 ++++++++++++++++++++++++++++++++++++++---- common/serial.c | 2 ++ 2 files changed, 64 insertions(+), 6 deletions(-)
board/prodrive/p3mx/serial.c +62 -6
@@ -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
@@ -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
PATCH v3 39/72 serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/altera_jtag_uart.c | 71 +++++++++++++++++++++++++++++++++---- 2 files changed, 67 insertions(+), 6 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 40/72 serial: arm: Implement CONFIG_SERIAL_MULTI into altera serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 + drivers/serial/altera_uart.c | 83 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 73 insertions(+), 12 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 41/72 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/atmel_usart.c | 67 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 63 insertions(+), 6 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 42/72 serial: arm: Implement CONFIG_SERIAL_MULTI into lpc32xx serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/lpc32xx_hsuart.c | 71 ++++++++++++++++++++++++++------------- 2 files changed, 50 insertions(+), 23 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 43/72 serial: mcf: Implement CONFIG_SERIAL_MULTI into MCF serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/mcfuart.c | 65 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 44/72 serial: Implement CONFIG_SERIAL_MULTI into ns9750 serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 45/72 serial: oc: Implement CONFIG_SERIAL_MULTI into OpenCores serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/opencores_yanu.c | 67 +++++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 7 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 46/72 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c4510b serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 47/72 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c64xx serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/s3c64xx.c | 65 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 48/72 serial: sandbox: Implement CONFIG_SERIAL_MULTI into sandbox serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/sandbox.c | 67 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 6 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 49/72 serial: arm: Implement CONFIG_SERIAL_MULTI into clps7111 serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 50/72 serial: arm: Implement CONFIG_SERIAL_MULTI into imx serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/serial_imx.c | 68 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 7 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 51/72 serial: arm: Implement CONFIG_SERIAL_MULTI into ixp serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/serial_ixp.c | 68 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 7 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 52/72 serial: arm: Implement CONFIG_SERIAL_MULTI into ks8695 serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 53/72 serial: arm: Implement CONFIG_SERIAL_MULTI into lh7a40x serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 54/72 serial: arm: Implement CONFIG_SERIAL_MULTI into lpc2292 serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 55/72 serial: Implement CONFIG_SERIAL_MULTI into max3100 serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 56/72 serial: arm: Implement CONFIG_SERIAL_MULTI into mxc serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/serial_mxc.c | 68 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 7 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 57/72 serial: arm: Implement CONFIG_SERIAL_MULTI into netarm serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/serial_netarm.c | 65 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 58/72 serial: arm: Implement CONFIG_SERIAL_MULTI into pl01x serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/serial_pl01x.c | 69 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 64 insertions(+), 7 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 59/72 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c44b0 serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 60/72 serial: arm: Implement CONFIG_SERIAL_MULTI into sa1100 serial driver
In reply to Marek VasutImplement 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
@@ -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
PATCH v3 61/72 serial: sh: Implement CONFIG_SERIAL_MULTI into sh serial driver
In reply to Marek VasutImplement 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.
--- common/serial.c | 2 ++ drivers/serial/serial_sh.c | 65 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
@@ -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
PATCH v3 62/72 serial: mxs: spl: Remove empty serial_* functions from SPL code
In reply to Marek VasutRemove 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.
--- arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 4 ---- 1 file changed, 4 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_boot.c +0 -4
@@ -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
PATCH v3 63/72 serial: Use puts() and hang() instead of panic() in SPL
In reply to Marek VasutIf 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
@@ -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
PATCH v3 64/72 serial: ns16550: Call usbtty_poll only in non-SPL build
In reply to Marek VasutHaving 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
@@ -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
PATCH v3 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c
In reply to Marek VasutThis 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.
--- 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
@@ -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
Michal Simek
maintainerPATCH 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.cinstead of any more logical and fitting name. Thus, rename the driver source file toserial_ns16550.cand be done with it.Signed-off-by Marek Vasut <[email protected]>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.ccreate mode 100644drivers/serial/serial_ns16550.cdrivers/serial/Makefile +1
-1@@ -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.odrivers/serial/serial.c deleted +0
-359@@ -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@@ -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
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
PATCH v3 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c
In reply to Michal SimekDear 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
PATCH v3 65/72 serial: ns16550: Rename serial.c to serial_ns16550.c
In reply to Marek VasutQuoted 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.cinstead of any more logical and fitting name. Thus, rename the driver source file toserial_ns16550.cand be done with it.
Quoted 7 lines
Signed-off-by Marek Vasut <[email protected]>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>
Michal Simek
maintainerPATCH 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.cinstead of any more logical and fitting name. Thus, rename the driver source file toserial_ns16550.cand be done with it.Quoted 7 lines
Signed-off-by Marek Vasut <[email protected]>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
PATCH v3 66/72 serial: Move common/serial.c to drivers/serial/
In reply to Marek VasutMove 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
@@ -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
@@ -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
PATCH v3 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI
In reply to Marek VasutEnable 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
@@ -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
@@ -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
PATCH 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI
Quoted 6 lines · Marek Vasut
Enable
CONFIG_SERIAL_MULTIfor 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 containingCONFIG_SERIAL_MULTI, theCONFIG_SERIAL_MULTIis 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.
PATCH v3 67/72 serial: Unconditionally enable CONFIG_SERIAL_MULTI
Quoted 22 lines · Stephen Warren
Quoted 6 lines · Marek Vasut
Enable
CONFIG_SERIAL_MULTIfor 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 containingCONFIG_SERIAL_MULTI, theCONFIG_SERIAL_MULTIis 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 editarch/arm/cpu/arm720t/tegra20/spl.cfunctionpreloader_console_init()to callserial_initialize()right before it callsserial_init(), then everything works fine. Without this,drivers/serial/serial.cis never initialised (not even BSS cleared!) and so it's left set to some bogus value, and soget_current()doesn't replace it withdefault_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.cdoing too much; stuff that should come from the commonspl.cis cut/paste here? Or, is adding the call toserial_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>
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_MULTIfor 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 containingCONFIG_SERIAL_MULTI, theCONFIG_SERIAL_MULTIis 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 editarch/arm/cpu/arm720t/tegra20/spl.cfunctionpreloader_console_init()to callserial_initialize()right before it callsserial_init(), then everything works fine. Without this,drivers/serial/serial.cis never initialised (not even BSS cleared!) and so it's left set to some bogus value, and soget_current()doesn't replace it withdefault_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.cdoing too much; stuff that should come from the commonspl.cis cut/paste here? Or, is adding the call toserial_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()callsserial_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.
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_MULTIfor 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 containingCONFIG_SERIAL_MULTI, theCONFIG_SERIAL_MULTIis 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 editarch/arm/cpu/arm720t/tegra20/spl.cfunctionpreloader_console_init()to callserial_initialize()right before it callsserial_init(), then everything works fine. Without this,drivers/serial/serial.cis never initialised (not even BSS cleared!) and so it's left set to some bogus value, and soget_current()doesn't replace it withdefault_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.cdoing too much; stuff that should come from the commonspl.cis cut/paste here? Or, is adding the call toserial_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()callsserial_init()) or switched over to it.Hmm, well it's already calling
serial_init()just notserial_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-----
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_MULTIfor 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 containingCONFIG_SERIAL_MULTI, theCONFIG_SERIAL_MULTIis 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 editarch/arm/cpu/arm720t/tegra20/spl.cfunctionpreloader_console_init()to callserial_initialize()right before it callsserial_init(), then everything works fine. Without this,drivers/serial/serial.cis never initialised (not even BSS cleared!) and so it's left set to some bogus value, and soget_current()doesn't replace it withdefault_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.cdoing too much; stuff that should come from the commonspl.cis cut/paste here? Or, is adding the call toserial_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()callsserial_init()) or switched over to it.Hmm, well it's already calling
serial_init()just notserial_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 callrelocate_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?
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_MULTIfor 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 containingCONFIG_SERIAL_MULTI, theCONFIG_SERIAL_MULTIis 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 editarch/arm/cpu/arm720t/tegra20/spl.cfunctionpreloader_console_init()to callserial_initialize()right before it callsserial_init(), then everything works fine. Without this,drivers/serial/serial.cis never initialised (not even BSS cleared!) and so it's left set to some bogus value, and soget_current()doesn't replace it withdefault_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.cdoing too much; stuff that should come from the commonspl.cis cut/paste here? Or, is adding the call toserial_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()callsserial_init()) or switched over to it.Hmm, well it's already calling
serial_init()just notserial_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.cdoes:Quoted 8 lines
/*
* We callrelocate_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.
-----------------------------------------------------------------------------------
PATCH v3 68/72 serial: Remove CONFIG_SERIAL_MULTI from config files
In reply to Marek VasutRemove 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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v3 69/72 serial: Remove CONFIG_SERIAL_MULTI from serial drivers
In reply to Marek VasutRemove 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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -253,7 +253,6 @@ static int pl01x_tstc (int portnum)return !(readl (®s->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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v3 70/72 serial: Remove CONFIG_SERIAL_MULTI from remaining sources
In reply to Marek VasutRemove 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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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_MULTIstatic 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v3 71/72 serial: Compile drivers/serial/serial.c by default
In reply to Marek VasutCompile 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.
--- config.mk | 2 +- drivers/serial/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
config.mk +1 -1
@@ -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
@@ -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
PATCH v3 72/72 serial: Enhance the manual relocation
In reply to Marek VasutEnhance 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.
--- drivers/serial/serial.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/serial/serial.c +14 -6
@@ -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
v3 cover serial: Massive rework of the serial subsystem
In reply to Marek VasutQuoted 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 structserial_devicemuch closer to structstdio_devso later on, these structures can be overlayed and structserial_devicecan be easily passed to stdio subsystem directly.
3) Do minor cleanups on the PXA and MPC512X
Basically for PXA this means to removedefault_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 forCONFIG_SERIAL_MULTIinto 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 enableCONFIG_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 whenCONFIG_SERIAL_MULTIwas not selected. Also remove all occurances ofCONFIG_SERIAL_MULTIthroughout 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_beagleboard...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-splConfiguring for P1020RDB-PC_36BIT_SPIFLASH - Board:
p1_p2_rdb_pc, Options: P1020RDB,36BIT,SPIFLASH
text data bss dec hex filename392469 30628 267568 690665 a89e9 ./u-boot 394550 30940 267600 693090 a9362 ./u-bootConfiguring for
grsim_leon2board...text data bss dec hex filename 95658 3328 2640 101626 18cfa ./u-boot 97058 3384 2640 103082 192aa ./u-bootConfiguring for sandbox board...
text data bss dec hex filename 137394 6364 28488 172246 2a0d6 ./u-boot 138674 6456 28504 173634 2a642 ./u-bootV2: Rebase on top of current -next
V3: - Fix problem with new SPL framework (2 new patches)
- mvdrivers/serial/serial{,-ns16550}.cto make clear what that driver really is [ 0065/0072 ]
- Movecommon/serial.cdodrivers/serial, since it really has to link with libserial.o, not libcommon.o [ 0066/0072 ]Marek Vasut (72):
serial: Coding style cleanup of structserial_device
serial: Rename .init() and .uninit() inserial_device
serial: Properly spell out the structure member names of
serial_driver
serial: pxa: Implementdefault_serial_consoleinserial_pxa.c
serial: pxa: Make use ofdefault_serial_consoleinserial_pxa
serial: pxa: Make local functions static
serial: mpc512x: Properly defineCONFIG_SYS_PSC3in config files
serial: Implementserial_initfunc()macro
serial: mpc8xx: Move serial registration fromserial_initialize()
serial: s3c24xx: Move serial registration fromserial_initialize()
serial: pxa: Move serial registration fromserial_initialize()
serial: s5p: Move serial registration fromserial_initialize()
serial: microblaze: Move serial registration fromserial_initialize()
serial: mpc512x: Move serial registration fromserial_initialize()
serial: ns16550: Move serial registration fromserial_initialize()
serial: bfin: Remove thebfin_serialN_deviceexports fromserial.h
serial: bfin: Adjustserial_register_bfin_uart()
serial: zoom2: Remove zoom2 serial prototypes fromserial.h
serial: bfin: Flip the jtag serial console toCONFIG_SERIAL_MULTI
serial: mips: ImplementCONFIG_SERIAL_MULTIinto au1x00 serial driver
serial: mips: ImplementCONFIG_SERIAL_MULTIinto asc serial driver
serial: mips: ImplementCONFIG_SERIAL_MULTIinto JZ serial driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto mpc5xx serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto mpc8220 serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto mpc8260 serial
drivers
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto mpc85xx serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto iop480 serial
driver
serial: sparc: ImplementCONFIG_SERIAL_MULTIinto leon2 serial driver
serial: sparc: ImplementCONFIG_SERIAL_MULTIinto leon3 serial driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto marvell serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto amirix serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto bmw serial driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto cogent serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto cpci750 serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto evb64260 serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto ml2 serial driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto sconsole serial
driver
serial: powerpc: ImplementCONFIG_SERIAL_MULTIinto p3mx serial
driver
serial: arm: ImplementCONFIG_SERIAL_MULTIintoaltera_jtagserial
driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto altera serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto atmel serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto lpc32xx serial driver
serial: mcf: ImplementCONFIG_SERIAL_MULTIinto MCF serial driver
serial: ImplementCONFIG_SERIAL_MULTIinto ns9750 serial driver
serial: oc: ImplementCONFIG_SERIAL_MULTIinto OpenCores serial
driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto s3c4510b serial
driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto s3c64xx serial driver
serial: sandbox: ImplementCONFIG_SERIAL_MULTIinto sandbox serial
driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto clps7111 serial
driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto imx serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto ixp serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto ks8695 serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto lh7a40x serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto lpc2292 serial driver
serial: ImplementCONFIG_SERIAL_MULTIinto max3100 serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto mxc serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto netarm serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto pl01x serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto s3c44b0 serial driver
serial: arm: ImplementCONFIG_SERIAL_MULTIinto sa1100 serial driver
serial: sh: ImplementCONFIG_SERIAL_MULTIinto sh serial driver
serial: mxs: spl: Remove empty serial_* functions from SPL code
serial: Useputs()andhang()instead ofpanic()in SPL
serial: ns16550: Callusbtty_pollonly in non-SPL build
serial: ns16550: Renameserial.ctoserial_ns16550.c
serial: Movecommon/serial.ctodrivers/serial/
serial: Unconditionally enableCONFIG_SERIAL_MULTI
serial: RemoveCONFIG_SERIAL_MULTIfrom config files
serial: RemoveCONFIG_SERIAL_MULTIfrom serial drivers
serial: RemoveCONFIG_SERIAL_MULTIfrom remaining sources
serial: Compiledrivers/serial/serial.cby default
serial: Enhance the manual relocationarch/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>
v3 cover serial: Massive rework of the serial subsystem
In reply to Marek VasutDear 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
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