Skip to contentSkip to conversation

serial: Massive rework of the serial subsystem

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

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

cover serial: Massive rework of the serial subsystem

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

The idea of this patchset is:

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

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

Configuring for omap3_beagle board...

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

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

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

Configuring for grsim_leon2 board...

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

Configuring for sandbox board...

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

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

 arch/arm/cpu/arm926ejs/mxs/spl_boot.c         |    4 -
 arch/arm/lib/board.c                          |    2 -
 arch/blackfin/cpu/jtag-console.c              |   37 +++-
 arch/blackfin/cpu/serial.c                    |    6 +-
 arch/blackfin/lib/board.c                     |    2 -
 arch/m68k/lib/board.c                         |    2 -
 arch/microblaze/lib/board.c                   |    2 -
 arch/mips/cpu/mips32/au1x00/au1x00_serial.c   |   42 ++++-
 arch/mips/cpu/mips32/incaip/asc_serial.c      |   35 +++-
 arch/mips/cpu/xburst/jz_serial.c              |   35 +++-
 arch/nds32/lib/board.c                        |    2 -
 arch/powerpc/cpu/mpc512x/serial.c             |   92 +++-------
 arch/powerpc/cpu/mpc5xx/serial.c              |   69 ++++---
 arch/powerpc/cpu/mpc5xxx/serial.c             |  181 ++++++-------------
 arch/powerpc/cpu/mpc8220/uart.c               |   35 +++-
 arch/powerpc/cpu/mpc8260/serial_scc.c         |   39 ++--
 arch/powerpc/cpu/mpc8260/serial_smc.c         |   39 ++--
 arch/powerpc/cpu/mpc85xx/serial_scc.c         |   39 ++--
 arch/powerpc/cpu/mpc8xx/serial.c              |   43 +++--
 arch/powerpc/cpu/ppc4xx/iop480_uart.c         |   36 +++-
 arch/powerpc/lib/board.c                      |    2 -
 arch/sandbox/lib/board.c                      |    2 -
 arch/sparc/cpu/leon2/serial.c                 |   51 ++++--
 arch/sparc/cpu/leon3/serial.c                 |   51 ++++--
 arch/x86/lib/board.c                          |    2 -
 board/Marvell/common/serial.c                 |   48 +++--
 board/amirix/ap1000/serial.c                  |   35 +++-
 board/balloon3/balloon3.c                     |    5 -
 board/bmw/serial.c                            |   36 +++-
 board/cogent/serial.c                         |   34 +++-
 board/esd/cpci750/serial.c                    |   36 +++-
 board/evb64260/serial.c                       |   54 ++++--
 board/logicpd/zoom2/zoom2_serial.c            |    7 +-
 board/logicpd/zoom2/zoom2_serial.h            |   16 +-
 board/ml2/serial.c                            |   35 +++-
 board/palmld/palmld.c                         |    5 -
 board/palmtc/palmtc.c                         |    5 -
 board/pcippc2/sconsole.c                      |   35 +++-
 board/pdm360ng/pdm360ng.c                     |    6 -
 board/prodrive/p3mx/serial.c                  |   36 +++-
 board/toradex/colibri_pxa270/colibri_pxa270.c |    5 -
 board/trizepsiv/conxs.c                       |    7 -
 board/vpac270/vpac270.c                       |    5 -
 board/zipitz2/zipitz2.c                       |    5 -
 common/Makefile                               |    2 +-
 common/cmd_nvedit.c                           |    2 -
 common/fdt_support.c                          |    4 -
 common/iomux.c                                |    2 -
 common/serial.c                               |  241 ++++++++++++++++---------
 common/stdio.c                                |    2 -
 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                       |  128 +++----------
 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_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             |   70 +++----
 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/tegra20-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 -
 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 -
 136 files changed, 1740 insertions(+), 1166 deletions(-)
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]>
Cc U-Boot DM <[email protected]>
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/71 serial: Coding style cleanup of struct serial_device

Do a simple cleanup of the struct serial_device and align it with current coding style. Checkpatch now reports no errors.

---
 include/serial.h |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
include/serial.h +11 -12
index cbdf8a9..8433ed7 100644
@@ -5,20 +5,19 @@
 
 struct serial_device {
 	/* enough bytes to match alignment of following func pointer */
-	char name[16];
-
-	int  (*init) (void);
-	int  (*uninit) (void);
-	void (*setbrg) (void);
-	int (*getc) (void);
-	int (*tstc) (void);
-	void (*putc) (const char c);
-	void (*puts) (const char *s);
+	char	name[16];
+
+	int	(*init)(void);
+	int	(*uninit)(void);
+	void	(*setbrg)(void);
+	int	(*getc)(void);
+	int	(*tstc)(void);
+	void	(*putc)(const char c);
+	void	(*puts)(const char *s);
 #if CONFIG_POST & CONFIG_SYS_POST_UART
-	void (*loop) (int);
+	void	(*loop)(int);
 #endif
-
-	struct serial_device *next;
+	struct serial_device	*next;
 };
 
 extern struct serial_device serial_smc_device;
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/71 serial: Rename .init() and .uninit() in serial_device

In reply to Marek Vasut

Rename .init() to .start() and .uninit() to .stop() in struct serial_device. This allows aligning struct serial_device with closer to struct stdio_dev. The real goal here is to allow these two structures to converge together and eventually make one to be a superset of the other.

---
 arch/blackfin/cpu/serial.c |    4 ++--
 common/serial.c            |   16 ++++++++--------
 include/serial.h           |    4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)
arch/blackfin/cpu/serial.c +2 -2
index 6603dc0..33677ba 100644
@@ -236,8 +236,8 @@ static void uart##n##_loop(int state) \
 \
 struct serial_device bfin_serial##n##_device = { \
 	.name   = "bfin_uart"#n, \
-	.init   = uart##n##_init, \
-	.uninit = uart##n##_uninit, \
+	.start  = uart##n##_init, \
+	.stop   = uart##n##_uninit, \
 	.setbrg = uart##n##_setbrg, \
 	.getc   = uart##n##_getc, \
 	.tstc   = uart##n##_tstc, \
common/serial.c +8 -8
index 75cc1bb..5740d4f 100644
@@ -35,7 +35,7 @@ static struct serial_device *serial_current;
 void serial_register(struct serial_device *dev)
 {
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
-	dev->init += gd->reloc_off;
+	dev->start += gd->reloc_off;
 	dev->setbrg += gd->reloc_off;
 	dev->getc += gd->reloc_off;
 	dev->tstc += gd->reloc_off;
@@ -136,8 +136,8 @@ void serial_stdio_init(void)
 		strcpy(dev.name, s->name);
 		dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;
 
-		dev.start = s->init;
-		dev.stop = s->uninit;
+		dev.start = s->start;
+		dev.stop = s->stop;
 		dev.putc = s->putc;
 		dev.puts = s->puts;
 		dev.getc = s->getc;
@@ -168,7 +168,7 @@ void serial_reinit_all(void)
 	struct serial_device *s;
 
 	for (s = serial_devices; s; s = s->next)
-		s->init();
+		s->start();
 }
 
 static struct serial_device *get_current(void)
@@ -188,7 +188,7 @@ static struct serial_device *get_current(void)
 
 int serial_init(void)
 {
-	return get_current()->init();
+	return get_current()->start();
 }
 
 void serial_setbrg(void)
@@ -288,9 +288,9 @@ int uart_post_test(int flags)
 		/* Disable loop back */
 		s->loop(0);
 
-		/* XXX: There is no serial_uninit() !? */
-		if (s->uninit)
-			s->uninit();
+		/* XXX: There is no serial_stop() !? */
+		if (s->stop)
+			s->stop();
 	}
 
  done:
include/serial.h +2 -2
index 8433ed7..eb1388c 100644
@@ -7,8 +7,8 @@ struct serial_device {
 	/* enough bytes to match alignment of following func pointer */
 	char	name[16];
 
-	int	(*init)(void);
-	int	(*uninit)(void);
+	int	(*start)(void);
+	int	(*stop)(void);
 	void	(*setbrg)(void);
 	int	(*getc)(void);
 	int	(*tstc)(void);
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/71 serial: Properly spell out the structure member names of serial_driver

In reply to Marek Vasut

Properly spell out the whole structure member names when an initialized varible is instantiated from the struct serial_driver. In case the structure definition for struct serial_driver undergoes reordering, there will be no impact on variables defined based on this structure.

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 C Nauman <[email protected]>
Cc Minkyu Kang <[email protected]>
Cc Michal Simek <[email protected]>
---
 arch/powerpc/cpu/mpc512x/serial.c  |   18 +++++++++---------
 arch/powerpc/cpu/mpc5xxx/serial.c  |   32 ++++++++++++++++----------------
 arch/powerpc/cpu/mpc8xx/serial.c   |   32 ++++++++++++++++----------------
 board/logicpd/zoom2/zoom2_serial.h |   16 ++++++++--------
 drivers/serial/serial.c            |   19 ++++++++++---------
 drivers/serial/serial_pxa.c        |   16 ++++++++--------
 drivers/serial/serial_s3c24x0.c    |   18 +++++++++---------
 drivers/serial/serial_s5p.c        |   19 ++++++++++---------
 drivers/serial/serial_xuartlite.c  |   19 ++++++++++---------
 9 files changed, 96 insertions(+), 93 deletions(-)
arch/powerpc/cpu/mpc512x/serial.c +9 -9
index 7c53346..f4f52ad 100644
@@ -319,15 +319,15 @@ int serial_getcts_dev(unsigned int idx)
 		serial_puts_dev(port, s); \
 	}
 
-#define INIT_PSC_SERIAL_STRUCTURE(port, name) { \
-	name, \
-	serial##port##_init, \
-	serial##port##_uninit, \
-	serial##port##_setbrg, \
-	serial##port##_getc, \
-	serial##port##_tstc, \
-	serial##port##_putc, \
-	serial##port##_puts, \
+#define INIT_PSC_SERIAL_STRUCTURE(port, __name) {	\
+	.name	= __name,				\
+	.start	= serial##port##_init,			\
+	.stop	= serial##port##_uninit,		\
+	.setbrg	= serial##port##_setbrg,		\
+	.getc	= serial##port##_getc,			\
+	.tstc	= serial##port##_tstc,			\
+	.putc	= serial##port##_putc,			\
+	.puts	= serial##port##_puts,			\
 }
 
 #if defined(CONFIG_SYS_PSC1)
arch/powerpc/cpu/mpc5xxx/serial.c +16 -16
index aa09f67..9bebff8 100644
@@ -338,14 +338,14 @@ int serial1_tstc(void)
 
 struct serial_device serial0_device =
 {
-	"serial0",
-	serial0_init,
-	NULL,
-	serial0_setbrg,
-	serial0_getc,
-	serial0_tstc,
-	serial0_putc,
-	serial0_puts,
+	.name	= "serial0",
+	.start	= serial0_init,
+	.stop	= NULL,
+	.setbrg	= serial0_setbrg,
+	.getc	= serial0_getc,
+	.tstc	= serial0_tstc,
+	.putc	= serial0_putc,
+	.puts	= serial0_puts,
 };
 
 __weak struct serial_device *default_serial_console(void)
@@ -355,14 +355,14 @@ __weak struct serial_device *default_serial_console(void)
 
 struct serial_device serial1_device =
 {
-	"serial1",
-	serial1_init,
-	NULL,
-	serial1_setbrg,
-	serial1_getc,
-	serial1_tstc,
-	serial1_putc,
-	serial1_puts,
+	.name	= "serial1",
+	.start	= serial1_init,
+	.stop	= NULL,
+	.setbrg	= serial1_setbrg,
+	.getc	= serial1_getc,
+	.tstc	= serial1_tstc,
+	.putc	= serial1_putc,
+	.puts	= serial1_puts,
 };
 #endif /* CONFIG_SERIAL_MULTI */
 
arch/powerpc/cpu/mpc8xx/serial.c +16 -16
index 9239b24..dc9b323 100644
@@ -390,14 +390,14 @@ smc_tstc(void)
 
 struct serial_device serial_smc_device =
 {
-	"serial_smc",
-	smc_init,
-	NULL,
-	smc_setbrg,
-	smc_getc,
-	smc_tstc,
-	smc_putc,
-	smc_puts,
+	.name	= "serial_smc",
+	.start	= smc_init,
+	.stop	= NULL,
+	.setbrg	= smc_setbrg,
+	.getc	= smc_getc,
+	.tstc	= smc_tstc,
+	.putc	= smc_putc,
+	.puts	= smc_puts,
 };
 
 #endif /* CONFIG_8xx_CONS_SMC1 || CONFIG_8xx_CONS_SMC2 */
@@ -660,14 +660,14 @@ scc_tstc(void)
 
 struct serial_device serial_scc_device =
 {
-	"serial_scc",
-	scc_init,
-	NULL,
-	scc_setbrg,
-	scc_getc,
-	scc_tstc,
-	scc_putc,
-	scc_puts,
+	.name	= "serial_scc",
+	.start	= scc_init,
+	.stop	= NULL,
+	.setbrg	= scc_setbrg,
+	.getc	= scc_getc,
+	.tstc	= scc_tstc,
+	.putc	= scc_putc,
+	.puts	= scc_puts,
 };
 
 #endif	/* CONFIG_8xx_CONS_SCCx */
board/logicpd/zoom2/zoom2_serial.h +8 -8
index 4e30587..61306be 100644
@@ -61,14 +61,14 @@ int quad_tstc_##n(void)				\
 }						\
 struct serial_device zoom2_serial_device##n =	\
 {						\
-	N(n),					\
-	quad_init_##n,				\
-	NULL,					\
-	quad_setbrg_##n,			\
-	quad_getc_##n,				\
-	quad_tstc_##n,				\
-	quad_putc_##n,				\
-	quad_puts_##n,				\
+	.name	= N(n),				\
+	.start	= quad_init_##n,		\
+	.stop	= NULL,				\
+	.setbrg	= quad_setbrg_##n,		\
+	.getc	= quad_getc_##n,		\
+	.tstc	= quad_tstc_##n,		\
+	.putc	= quad_putc_##n,		\
+	.puts	= quad_puts_##n,		\
 };
 
 #endif /* ZOOM2_SERIAL_H */
drivers/serial/serial.c +10 -9
index b10bab7..9d92dee 100644
@@ -106,15 +106,16 @@ static NS16550_t serial_ports[4] = {
 	serial_puts_dev(port, s);}
 
 /* Serial device descriptor */
-#define INIT_ESERIAL_STRUCTURE(port, name) {\
-	name,\
-	eserial##port##_init,\
-	NULL,\
-	eserial##port##_setbrg,\
-	eserial##port##_getc,\
-	eserial##port##_tstc,\
-	eserial##port##_putc,\
-	eserial##port##_puts, }
+#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 */
 
drivers/serial/serial_pxa.c +8 -8
index a9976d7..97e3f36 100644
@@ -269,14 +269,14 @@ void pxa_puts_dev(unsigned int uart_index, const char *s)
 #define	pxa_uart_desc(uart)						\
 	struct serial_device serial_##uart##_device =			\
 	{								\
-		"serial_"#uart,						\
-		uart##_init,						\
-		NULL,							\
-		uart##_setbrg,						\
-		uart##_getc,						\
-		uart##_tstc,						\
-		uart##_putc,						\
-		uart##_puts,						\
+		.name	= "serial_"#uart,				\
+		.start	= uart##_init,					\
+		.stop	= NULL,						\
+		.setbrg	= uart##_setbrg,				\
+		.getc	= uart##_getc,					\
+		.tstc	= uart##_tstc,					\
+		.putc	= uart##_putc,					\
+		.puts	= uart##_puts,					\
 	};
 
 #define	pxa_uart_multi(uart, UART)					\
drivers/serial/serial_s3c24x0.c +9 -9
index 12bcdd3..fa6aac0 100644
@@ -69,15 +69,15 @@ DECLARE_GLOBAL_DATA_PTR;
 		serial_puts_dev(port, s); \
 	}
 
-#define INIT_S3C_SERIAL_STRUCTURE(port, name) { \
-	name, \
-	s3serial##port##_init, \
-	NULL,\
-	s3serial##port##_setbrg, \
-	s3serial##port##_getc, \
-	s3serial##port##_tstc, \
-	s3serial##port##_putc, \
-	s3serial##port##_puts, \
+#define INIT_S3C_SERIAL_STRUCTURE(port, __name) {	\
+	.name	= __name,				\
+	.start	= s3serial##port##_init,		\
+	.stop	= NULL,					\
+	.setbrg	= s3serial##port##_setbrg,		\
+	.getc	= s3serial##port##_getc,		\
+	.tstc	= s3serial##port##_tstc,		\
+	.putc	= s3serial##port##_putc,		\
+	.puts	= s3serial##port##_puts,		\
 }
 
 #endif /* CONFIG_SERIAL_MULTI */
drivers/serial/serial_s5p.c +10 -9
index 6819bb0..43cbc4f 100644
@@ -183,15 +183,16 @@ int s5p_serial##port##_tstc(void) { return serial_tstc_dev(port); } \
 void s5p_serial##port##_putc(const char c) { serial_putc_dev(c, port); } \
 void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); }
 
-#define INIT_S5P_SERIAL_STRUCTURE(port, name) { \
-	name, \
-	s5p_serial##port##_init, \
-	NULL, \
-	s5p_serial##port##_setbrg, \
-	s5p_serial##port##_getc, \
-	s5p_serial##port##_tstc, \
-	s5p_serial##port##_putc, \
-	s5p_serial##port##_puts, }
+#define INIT_S5P_SERIAL_STRUCTURE(port, __name) {	\
+	.name	= __name,				\
+	.start	= s5p_serial##port##_init,		\
+	.stop	= NULL,					\
+	.setbrg	= s5p_serial##port##_setbrg,		\
+	.getc	= s5p_serial##port##_getc,		\
+	.tstc	= s5p_serial##port##_tstc,		\
+	.putc	= s5p_serial##port##_putc,		\
+	.puts	= s5p_serial##port##_puts,		\
+}
 
 DECLARE_S5P_SERIAL_FUNCTIONS(0);
 struct serial_device s5p_serial0_device =
drivers/serial/serial_xuartlite.c +10 -9
index 3a38f9e..2b869c1 100644
@@ -138,15 +138,16 @@ int serial_tstc(void)
 				{ uartlite_serial_puts(s, port); }
 
 /* Serial device descriptor */
-#define INIT_ESERIAL_STRUCTURE(port, name) {\
-	name,\
-	userial##port##_init,\
-	NULL,\
-	userial##port##_setbrg,\
-	userial##port##_getc,\
-	userial##port##_tstc,\
-	userial##port##_putc,\
-	userial##port##_puts, }
+#define INIT_ESERIAL_STRUCTURE(port, __name) {	\
+	.name	= __name,			\
+	.start	= userial##port##_init,		\
+	.stop	= NULL,				\
+	.setbrg	= userial##port##_setbrg,	\
+	.getc	= userial##port##_getc,		\
+	.tstc	= userial##port##_tstc,		\
+	.putc	= userial##port##_putc,		\
+	.puts	= userial##port##_puts,		\
+}
 
 DECLARE_ESERIAL_FUNCTIONS(0);
 struct serial_device uartlite_serial0_device =
Signature · 1 line
1.7.10.4
maintainer
#4 lore raw

PATCH 3/71 serial: Properly spell out the structure member names of serial_driver

Quoted 14 lines · Marek Vasut

Properly spell out the whole structure member names when an initialized varible is instantiated from the struct serial_driver. In case the structure definition for struct serial_driver undergoes reordering, there will be no impact on variables defined based on this structure.

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 C Nauman <[email protected]>
Cc Minkyu Kang <[email protected]>
Cc Michal Simek <[email protected]>
Quoted 11 lines
---
  arch/powerpc/cpu/mpc512x/serial.c  |   18 +++++++++---------
  arch/powerpc/cpu/mpc5xxx/serial.c  |   32 ++++++++++++++++----------------
  arch/powerpc/cpu/mpc8xx/serial.c   |   32 ++++++++++++++++----------------
  board/logicpd/zoom2/zoom2_serial.h |   16 ++++++++--------
  drivers/serial/serial.c            |   19 ++++++++++---------
  drivers/serial/serial_pxa.c        |   16 ++++++++--------
  drivers/serial/serial_s3c24x0.c    |   18 +++++++++---------
  drivers/serial/serial_s5p.c        |   19 ++++++++++---------
  drivers/serial/serial_xuartlite.c  |   19 ++++++++++---------
  9 files changed, 96 insertions(+), 93 deletions(-)

Uartlite part looks good to me.

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

PATCH 4/71 serial: pxa: Implement default_serial_console in serial_pxa.c

In reply to Marek Vasut

Implement weak default_serial_console() function in serial_pxa driver, which gets available in case CONFIG_SERIAL_MULTI is enabled. This will get helpful in subsequent patches, which will encapsulate PXA's struct serial_device instances in serial_pxa driver.

---
 drivers/serial/serial_pxa.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/serial/serial_pxa.c +16 -0
index 97e3f36..ad2d77e 100644
@@ -36,6 +36,7 @@
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/regs-uart.h>
 #include <asm/io.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -298,4 +299,19 @@ void pxa_puts_dev(unsigned int uart_index, const char *s)
 
 #ifndef	CONFIG_SERIAL_MULTI
 	pxa_uart(serial, UART)
+#else
+__weak struct serial_device *default_serial_console(void)
+{
+#if CONFIG_CONS_INDEX == 1
+	return &serial_hwuart_device;
+#elif CONFIG_CONS_INDEX == 2
+	return &serial_stuart_device;
+#elif CONFIG_CONS_INDEX == 3
+	return &serial_ffuart_device;
+#elif CONFIG_CONS_INDEX == 4
+	return &serial_btuart_device;
+#else
+#error "Bad CONFIG_CONS_INDEX."
+#endif
+}
 #endif
Signature · 1 line
1.7.10.4
#6 lore raw

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

In reply to Marek Vasut

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

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

PATCH 6/71 serial: pxa: Make local functions static

In reply to Marek Vasut

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

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

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

In reply to Marek Vasut

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

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

PATCH 8/71 serial: Implement serial_initfunc() macro

In reply to Marek Vasut

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

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

PATCH 8/71 serial: Implement serial_initfunc() macro

Quoted 7 lines · Marek Vasut

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

So, did you consider and throw out the idea of something like:
common/serial.c:
void serial_initalize(void) {
platform_serial_register(); serial_assign(default_serial_console()->name);
}

And then every serial driver, instead of having to add a new weak function to common/serial.c and a new function call just defines platform_serial_register.

Or do you run into platforms that want two different serial drivers AND you couldn't solve that with a combination of weak functions and board-specific platform_serial_register?

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/20120918/d614acba/attachment.pgp>
#11 lore raw

PATCH 8/71 serial: Implement serial_initfunc() macro

Dear Tom Rini,

Quoted 16 lines · Marek Vasut
Quoted 7 lines

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

So, did you consider and throw out the idea of something like:
common/serial.c:
void serial_initalize(void) {
platform_serial_register(); serial_assign(default_serial_console()->name);
}

Quoted 3 lines

And then every serial driver, instead of having to add a new weak function to common/serial.c and a new function call just defines platform_serial_register.

Yes

Quoted 3 lines

Or do you run into platforms that want two different serial drivers AND you couldn't solve that with a combination of weak functions and board-specific platform_serial_register?

The point is to allow compiling in any possible combination of serial drivers, thus the per-driver separate init call. I'd like to get rid of this once the DM is present, since there'll be a method of generating the driver list automagically, thus dissolving this all.

So this is pretty much temporary. Yet, you are right, there are a few boards (really minor amount, some PPC ancient goo) that do need two drivers in.

Best regards,
Marek Vasut

#12 lore raw

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

In reply to Marek Vasut

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

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

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

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

In reply to Marek Vasut

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

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

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

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

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

In reply to Marek Vasut

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

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

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

---
 common/serial.c             |   11 ++---------
 drivers/serial/serial_pxa.c |   13 +++++++++++++
 include/serial.h            |    4 ----
 3 files changed, 15 insertions(+), 13 deletions(-)
common/serial.c +2 -9
index b210b05..d457d23 100644
@@ -41,6 +41,7 @@ static void serial_null(void)
 		__attribute__((weak, alias("serial_null")));
 
 serial_initfunc(mpc8xx_serial_initialize);
+serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 
 void serial_register(struct serial_device *dev)
@@ -75,15 +76,7 @@ void serial_initialize(void)
 	serial_register(&eserial4_device);
 #endif
 #endif /* CONFIG_SYS_NS16550_SERIAL */
-#if defined(CONFIG_FFUART)
-	serial_register(&serial_ffuart_device);
-#endif
-#if defined(CONFIG_BTUART)
-	serial_register(&serial_btuart_device);
-#endif
-#if defined(CONFIG_STUART)
-	serial_register(&serial_stuart_device);
-#endif
+	pxa_serial_initialize();
 	s3c24xx_serial_initialize();
 #if defined(CONFIG_S5P)
 	serial_register(&s5p_serial0_device);
drivers/serial/serial_pxa.c +13 -0
index bd3b3cf..46d7689 100644
@@ -314,4 +314,17 @@ __weak struct serial_device *default_serial_console(void)
 #error "Bad CONFIG_CONS_INDEX."
 #endif
 }
+
+void pxa_serial_initialize(void)
+{
+#if defined(CONFIG_FFUART)
+	serial_register(&serial_ffuart_device);
+#endif
+#if defined(CONFIG_BTUART)
+	serial_register(&serial_btuart_device);
+#endif
+#if defined(CONFIG_STUART)
+	serial_register(&serial_stuart_device);
+#endif
+}
 #endif
include/serial.h +0 -4
index aec6506..c64bb04 100644
@@ -70,10 +70,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
#15 lore raw

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

In reply to Marek Vasut

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

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

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Minkyu Kang <[email protected]>
---
 common/serial.c             |    8 ++------
 drivers/serial/serial_s5p.c |    8 ++++++++
 include/serial.h            |    7 -------
 3 files changed, 10 insertions(+), 13 deletions(-)
common/serial.c +2 -6
index d457d23..c021c3f 100644
@@ -43,6 +43,7 @@ static void serial_null(void)
 serial_initfunc(mpc8xx_serial_initialize);
 serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
+serial_initfunc(s5p_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -78,12 +79,7 @@ void serial_initialize(void)
 #endif /* CONFIG_SYS_NS16550_SERIAL */
 	pxa_serial_initialize();
 	s3c24xx_serial_initialize();
-#if defined(CONFIG_S5P)
-	serial_register(&s5p_serial0_device);
-	serial_register(&s5p_serial1_device);
-	serial_register(&s5p_serial2_device);
-	serial_register(&s5p_serial3_device);
-#endif
+	s5p_serial_initialize();
 #if defined(CONFIG_MPC512X)
 #if defined(CONFIG_SYS_PSC1)
 	serial_register(&serial1_device);
drivers/serial/serial_s5p.c +8 -0
index 43cbc4f..3c41242 100644
@@ -221,3 +221,11 @@ __weak struct serial_device *default_serial_console(void)
 #error "CONFIG_SERIAL? missing."
 #endif
 }
+
+void s5p_serial_initialize(void)
+{
+	serial_register(&s5p_serial0_device);
+	serial_register(&s5p_serial1_device);
+	serial_register(&s5p_serial2_device);
+	serial_register(&s5p_serial3_device);
+}
include/serial.h +0 -7
index c64bb04..08a9287 100644
@@ -56,13 +56,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
#16 lore raw

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

Dear Marek,

Quoted 19 lines · Marek Vasut

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

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

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Minkyu Kang <[email protected]>
Quoted 7 lines
---
 common/serial.c             |    8 ++------
 drivers/serial/serial_s5p.c |    8 ++++++++
 include/serial.h            |    7 -------
 3 files changed, 10 insertions(+), 13 deletions(-)

Thanks.
Minkyu Kang.

Signature · 2 lines
from. prom.
www.promsoft.net
#17 lore raw

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

In reply to Marek Vasut

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

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

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Michal Simek <[email protected]>
---
 common/serial.c                   |   16 ++--------------
 drivers/serial/serial_xuartlite.c |   16 ++++++++++++++++
 include/serial.h                  |    7 -------
 3 files changed, 18 insertions(+), 21 deletions(-)
common/serial.c +2 -14
index c021c3f..e19a17f 100644
@@ -44,6 +44,7 @@ serial_initfunc(mpc8xx_serial_initialize);
 serial_initfunc(pxa_serial_initialize);
 serial_initfunc(s3c24xx_serial_initialize);
 serial_initfunc(s5p_serial_initialize);
+serial_initfunc(uartlite_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -97,20 +98,7 @@ void serial_initialize(void)
 #if defined(CONFIG_SYS_BFIN_UART)
 	serial_register_bfin_uart();
 #endif
-#if defined(CONFIG_XILINX_UARTLITE)
-# ifdef XILINX_UARTLITE_BASEADDR
-	serial_register(&uartlite_serial0_device);
-# endif /* XILINX_UARTLITE_BASEADDR */
-# ifdef XILINX_UARTLITE_BASEADDR1
-	serial_register(&uartlite_serial1_device);
-# endif /* XILINX_UARTLITE_BASEADDR1 */
-# ifdef XILINX_UARTLITE_BASEADDR2
-	serial_register(&uartlite_serial2_device);
-# endif /* XILINX_UARTLITE_BASEADDR2 */
-# ifdef XILINX_UARTLITE_BASEADDR3
-	serial_register(&uartlite_serial3_device);
-# endif /* XILINX_UARTLITE_BASEADDR3 */
-#endif /* CONFIG_XILINX_UARTLITE */
+	uartlite_serial_initialize();
 	serial_assign(default_serial_console()->name);
 }
 
drivers/serial/serial_xuartlite.c +16 -0
index 2b869c1..d90c42d 100644
@@ -177,4 +177,20 @@ __weak struct serial_device *default_serial_console(void)
 	return &uartlite_serial3_device;
 # endif /* XILINX_UARTLITE_BASEADDR3 */
 }
+
+void uartlite_serial_initialize(void)
+{
+#ifdef XILINX_UARTLITE_BASEADDR
+	serial_register(&uartlite_serial0_device);
+#endif /* XILINX_UARTLITE_BASEADDR */
+#ifdef XILINX_UARTLITE_BASEADDR1
+	serial_register(&uartlite_serial1_device);
+#endif /* XILINX_UARTLITE_BASEADDR1 */
+#ifdef XILINX_UARTLITE_BASEADDR2
+	serial_register(&uartlite_serial2_device);
+#endif /* XILINX_UARTLITE_BASEADDR2 */
+#ifdef XILINX_UARTLITE_BASEADDR3
+	serial_register(&uartlite_serial3_device);
+#endif /* XILINX_UARTLITE_BASEADDR3 */
+}
 #endif /* CONFIG_SERIAL_MULTI */
include/serial.h +0 -7
index 08a9287..73991a6 100644
@@ -49,13 +49,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
maintainer
#18 lore raw

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

Quoted 93 lines · Marek Vasut

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

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

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Michal Simek <[email protected]>
---
  common/serial.c                   |   16 ++--------------
  drivers/serial/serial_xuartlite.c |   16 ++++++++++++++++
  include/serial.h                  |    7 -------
  3 files changed, 18 insertions(+), 21 deletions(-)
common/serial.c +2 -14
index c021c3f..e19a17f 100644
@@ -44,6 +44,7 @@ serial_initfunc(mpc8xx_serial_initialize);
  serial_initfunc(pxa_serial_initialize);
  serial_initfunc(s3c24xx_serial_initialize);
  serial_initfunc(s5p_serial_initialize);
+serial_initfunc(uartlite_serial_initialize);
 
  void serial_register(struct serial_device *dev)
  {
@@ -97,20 +98,7 @@ void serial_initialize(void)
  #if defined(CONFIG_SYS_BFIN_UART)
  	serial_register_bfin_uart();
  #endif
-#if defined(CONFIG_XILINX_UARTLITE)
-# ifdef XILINX_UARTLITE_BASEADDR
-	serial_register(&uartlite_serial0_device);
-# endif /* XILINX_UARTLITE_BASEADDR */
-# ifdef XILINX_UARTLITE_BASEADDR1
-	serial_register(&uartlite_serial1_device);
-# endif /* XILINX_UARTLITE_BASEADDR1 */
-# ifdef XILINX_UARTLITE_BASEADDR2
-	serial_register(&uartlite_serial2_device);
-# endif /* XILINX_UARTLITE_BASEADDR2 */
-# ifdef XILINX_UARTLITE_BASEADDR3
-	serial_register(&uartlite_serial3_device);
-# endif /* XILINX_UARTLITE_BASEADDR3 */
-#endif /* CONFIG_XILINX_UARTLITE */
+	uartlite_serial_initialize();
  	serial_assign(default_serial_console()->name);
  }
 
drivers/serial/serial_xuartlite.c +16 -0
index 2b869c1..d90c42d 100644
@@ -177,4 +177,20 @@ __weak struct serial_device *default_serial_console(void)
  	return &uartlite_serial3_device;
  # endif /* XILINX_UARTLITE_BASEADDR3 */
  }
+
+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 -0
index 08a9287..73991a6 100644
@@ -49,13 +49,6 @@ extern struct serial_device serial4_device;
  extern struct serial_device serial6_device;
  #endif
 

include/serial.h extern struct serial_device serial4_device; · line 54

Quoted 10 lines
include/serial.h +0 -7
-#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;

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

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

In reply to Marek Vasut

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

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

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

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

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

In reply to Marek Vasut

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

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

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

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

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

In reply to Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 include/serial.h |    4 ----
 1 file changed, 4 deletions(-)
include/serial.h +0 -4
index 6a42904..b405792 100644
@@ -47,10 +47,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
#22 lore raw

PATCH 17/71 serial: bfin: Adjust serial_register_bfin_uart()

In reply to Marek Vasut

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

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

PATCH 18/71 serial: zoom2: Remove zoom2 serial prototypes from serial.h

In reply to Marek Vasut

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

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

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

In reply to Marek Vasut

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

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

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

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

PATCH 20/71 serial: mips: Implement CONFIG_SERIAL_MULTI into au1x00 serial driver

In reply to Marek Vasut

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

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

PATCH 21/71 serial: mips: Implement CONFIG_SERIAL_MULTI into asc serial driver

In reply to Marek Vasut

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

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

PATCH 22/71 serial: mips: Implement CONFIG_SERIAL_MULTI into JZ serial driver

In reply to Marek Vasut

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

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

PATCH 23/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc5xx serial driver

In reply to Marek Vasut

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

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

PATCH 24/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8220 serial driver

In reply to Marek Vasut

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

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

PATCH 25/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc8260 serial drivers

In reply to Marek Vasut

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

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

119 lines not on this page · raw message

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

PATCH 26/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into mpc85xx serial driver

In reply to Marek Vasut

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

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

PATCH 27/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into iop480 serial driver

In reply to Marek Vasut

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

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

PATCH 27/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into iop480 serial driver

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>

Thanks,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: office at denx.de

#34 lore raw

PATCH 28/71 serial: sparc: Implement CONFIG_SERIAL_MULTI into leon2 serial driver

In reply to Marek Vasut

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

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

PATCH 29/71 serial: sparc: Implement CONFIG_SERIAL_MULTI into leon3 serial driver

In reply to Marek Vasut

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

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

PATCH 30/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into marvell serial driver

In reply to Marek Vasut

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

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

PATCH 31/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into amirix serial driver

In reply to Marek Vasut

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

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

PATCH 31/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into amirix serial driver

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>

This looks like a standard NS16550 implementation. Why not use the common driver then? Also, this board doesn't seem actively maintained. I cc'ed Frank Smith as author of this board port.

Frank, is this board still in production? Or does it make sense to remove this board from mainline completely?

Thanks,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: office at denx.de

#39 lore raw

PATCH 31/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into amirix serial driver

Dear Stefan Roese,

Quoted 13 lines · Marek Vasut
Quoted 11 lines

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Quoted 6 lines

This looks like a standard NS16550 implementation. Why not use the common driver then? Also, this board doesn't seem actively maintained. I cc'ed Frank Smith as author of this board port.

Frank, is this board still in production? Or does it make sense to remove this board from mainline completely?

It's not the only one that reimplements NS16550. I didn't clean it up to avoid breakage.

Quoted 7 lines

Thanks,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: office at denx.de

Best regards,
Marek Vasut

#40 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

In reply to Marek Vasut

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

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

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>

Again, NS16550 driver here. This code shouldn't be necessary. Also this board looks quite unmaintained as well. Perhaps its time to remove it from mainline? Not sure whom to ask, since no maintainer is listed.

Thanks,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: office at denx.de

#42 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Stefan Roese,

Quoted 13 lines · Marek Vasut
Quoted 11 lines

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>
Quoted 3 lines

Again, NS16550 driver here. This code shouldn't be necessary. Also this board looks quite unmaintained as well. Perhaps its time to remove it from mainline? Not sure whom to ask, since no maintainer is listed.

Exactly :-(

Shall we not simply remove all boards that obviously miss maintainer?

Quoted 7 lines

Thanks,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: office at denx.de

Best regards,
Marek Vasut

#43 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Hi Marek,

Quoted 7 lines · Marek Vasut
Quoted 3 lines

Again, NS16550 driver here. This code shouldn't be necessary. Also this board looks quite unmaintained as well. Perhaps its time to remove it from mainline? Not sure whom to ask, since no maintainer is listed.

Exactly :-(

Shall we not simply remove all boards that obviously miss maintainer?

I'm all for it. I'm currently working on a patch to remove support for the IOP480 platforms completely (ppc40x derivate). Some other boards might be good candidates as well...

Thanks,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: office at denx.de

#44 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

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

Quoted 8 lines · Stefan Roese

Hi Marek,

Quoted 5 lines · Marek Vasut
Quoted 4 lines

Again, NS16550 driver here. This code shouldn't be necessary. Also this board looks quite unmaintained as well. Perhaps its time to remove it from mainline? Not sure whom to ask, since no maintainer is listed.

Quoted 8 lines
Quoted 4 lines

Exactly :-(

Shall we not simply remove all boards that obviously miss maintainer?

I'm all for it. I'm currently working on a patch to remove support
for the IOP480 platforms completely (ppc40x derivate). Some other boards might be good candidates as well...

Since Marek has poked me about this in a few other contexts as well, let me state my position for the moment. Whatever boards a custodian is the de facto maintainer for and they don't believe makes sense to continue carrying forward in mainline, they can and should submit patches to remove. Conversely, if the custodian says "I'm fine carrying these platforms", that's what they can and should do.

And I have a few other things to say too, so I'll save that for a bit later once I'm done drafting and considering.

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

iQIcBAEBAgAGBQJQWgRQAAoJENk4IS6UOR1WN18P/3avi6PLCEXClbrR5kMqs4aw Ci3rRozlVIyewGhEk9DmKJev0SQxVeV+LF9MrKtQDi78sW2Mh42xGC8l4zZmSxHe bOJsmKsrDl68b7kP0aFP9yhcdEZUEVJhXNGcAwAO1DlmlB6zPG6doCMg0T4RpoPp 33nrca7nJnQ9mv8bVmiQ5Qx/qz76TgQSpPZ8jCQIND0LBITdo5PZU9ic4gxt+eDL O/I+X7cwfs5N8nPD4lzVga2eivWKheByQtJHgz+T/Zh7bEk8oiwlVTwwD7IgoKam LF6F9zXjSHmc5m23ZClCLp1nDfsIqvqf67AUSCGxHkBpzEVBQLsdP/t17yo2/WNS D1YWER1Ps3/VpalQpnzy+eTy8RyY4dFFF+UK4HB+q7lSlw3Ykxmc1MTpxKq03dGZ 9F9irTVFRQ4+TpMa3tsjd3MzaGcgJbrOtKjLHf8ULRo2SPnB+S3FpgHEszDphMfz CxpNih0qruahBEx38ygMDiH+M1msoAyp27pPAFou5m7q73XTIevZmmm4+hCXeXE5 rnUSA00mihajv8FM3MGdG+9khEFN49lBY6FTyclmm4TAM1BpVeG2voN6Ma+yRwI4 FooBJP5nNMSc/tZQNCFiLQIla3SL9CAdJKAL+J/vO0En/Id1p1tpLS5lm95LkVZw v5XbIZ7XRLYde0VoN76i
=WkII
-----END PGP SIGNATURE-----

#45 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Tom Rini,

Quoted 14 lines · Stefan Roese
Quoted 13 lines

Hi Marek,

Quoted 9 lines · Marek Vasut
Quoted 4 lines

Again, NS16550 driver here. This code shouldn't be necessary. Also this board looks quite unmaintained as well. Perhaps its time to remove it from mainline? Not sure whom to ask, since no maintainer is listed.

Exactly :-(

Shall we not simply remove all boards that obviously miss maintainer?

Quoted 7 lines
Quoted 4 lines

I'm all for it. I'm currently working on a patch to remove support

for the IOP480 platforms completely (ppc40x derivate). Some other boards might be good candidates as well...

Since Marek has poked me about this in a few other contexts as well, let me state my position for the moment.

I did, yet I was much less polite ;-)

Quoted 1 line

Whatever boards a custodian

I can't parse this :-(

Quoted 7 lines

is the de facto maintainer for and they don't believe makes sense to continue carrying forward in mainline, they can and should submit patches to remove. Conversely, if the custodian says "I'm fine carrying these platforms", that's what they can and should do.

And I have a few other things to say too, so I'll save that for a bit later once I'm done drafting and considering.

Drafting what exactly please?

Best regards,
Marek Vasut

#46 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

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

Quoted 22 lines · Marek Vasut

Dear Tom Rini,

Quoted 20 lines · Stefan Roese
Quoted 18 lines

Hi Marek,

Quoted 9 lines · Marek Vasut
Quoted 4 lines

Again, NS16550 driver here. This code shouldn't be necessary. Also this board looks quite unmaintained as well. Perhaps its time to remove it from mainline? Not sure whom to ask, since no maintainer is listed.

Exactly :-(

Shall we not simply remove all boards that obviously miss maintainer?

I'm all for it. I'm currently working on a patch to remove support

for the IOP480 platforms completely (ppc40x derivate). Some other boards might be good candidates as well...

Quoted 8 lines
Quoted 2 lines

Since Marek has poked me about this in a few other contexts as well, let me state my position for the moment.

I did, yet I was much less polite ;-)

Quoted 1 line

Whatever boards a custodian

I can't parse this :-(

Well, we have custodians for various areas and board maintainers. Since not all boards have a maintainer listed, the custodian for the area is the de facto maintainer.

Quoted 10 lines
Quoted 8 lines

is the de facto maintainer for and they don't believe makes sense to continue carrying forward in mainline, they can and should submit patches to remove. Conversely, if the custodian says "I'm fine carrying these platforms", that's what they can and should do.

And I have a few other things to say too, so I'll save that for a bit later once I'm done drafting and considering.

Drafting what exactly please?

A more elaborate set of statements on my feelings about "old" boards and what needs to happen, in light of the facts that the code is messy, will require updating for DM and likelyhood of a small but devoted community around some of them.

- --
Tom

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

iQIcBAEBAgAGBQJQWkknAAoJENk4IS6UOR1WmJMP/jXzOePKSp2j7th+1ylY+IXw H1QG+vKRWkXWs90XQLqL0kIUVzZUS1Js1kZeypGmMCmUj+crbb4zTuz2QAN0yL6X 8vIf9oM9CQtoFtdtkrF9NYNHmM22Q1GeEnoOW8dbA+HTLCVSd334cN3qfyYfqoVM 8SZB7+9rqskdjln2gn375QlWK9BI72ammCSNaXMfVPyHNkbuL86Uo1ddhiNvAu3O tsQ4VFkI8lP6yd122fhWZ95OAM+zLqFD1najwF8LeF3yuxtB1Kh3ssDeOwoH5Ayf IRN17FYf+tvpfFifITdxq41/vtlfhARz6JjT4yAcaYkEhlzNbh4Frd8YxHGjOsSS hMf9SkPQiM87C4MA0IBcWkBOVnIOvUsqJJy6uz4tcaxqs5eVUUvdQVKVh2ccfDav 00EFt/x/mOVCkZGB62ku9Iw7fQegT9iGVqYOkmjYD6Ad1Yo/QhVdSbj07xZPZevJ TXEmRa97LtP4Oax4WcBHLkY5h/rDYJPJLfrHLQMEm2mPVadzBob3oSFZs9H3Qf4J BzkX9ZgD7YYQCVA73zwfAV5S9VstlT4i0mnYFkOvZSNXSHADptcjCCyvsQ8/Czni CkGYlr+67UMXM28zASXbfcmitoEbG7GZF/JQFZ/L9JsJrs2fKFqXfMEWnSBm+w4q urE5QPgZNQmYZn5ZjX26
=K+Oe
-----END PGP SIGNATURE-----

#47 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Tom Rini,

Quoted 28 lines · Marek Vasut
Quoted 27 lines

Dear Tom Rini,

Quoted 14 lines · Stefan Roese
Quoted 13 lines

Hi Marek,

Quoted 9 lines · Marek Vasut
Quoted 4 lines

Again, NS16550 driver here. This code shouldn't be necessary. Also this board looks quite unmaintained as well. Perhaps its time to remove it from mainline? Not sure whom to ask, since no maintainer is listed.

Exactly :-(

Shall we not simply remove all boards that obviously miss maintainer?

Quoted 8 lines
Quoted 5 lines

I'm all for it. I'm currently working on a patch to remove support

for the IOP480 platforms completely (ppc40x derivate). Some other boards might be good candidates as well...

Since Marek has poked me about this in a few other contexts as well, let me state my position for the moment.

I did, yet I was much less polite ;-)

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Whatever boards a custodian

I can't parse this :-(

Well, we have custodians for various areas and board maintainers. Since not all boards have a maintainer listed, the custodian for the area is the de facto maintainer.

Ok, now I understand.

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

is the de facto maintainer for and they don't believe makes sense to continue carrying forward in mainline, they can and should submit patches to remove. Conversely, if the custodian says "I'm fine carrying these platforms", that's what they can and should do.

And I have a few other things to say too, so I'll save that for a bit later once I'm done drafting and considering.

Quoted 6 lines
Quoted 1 line

Drafting what exactly please?

A more elaborate set of statements on my feelings about "old" boards and what needs to happen, in light of the facts that the code is messy, will require updating for DM and likelyhood of a small but devoted community around some of them.

I see ... eagerly waiting.

Best regards,
Marek Vasut

#48 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

In reply to Tom Rini

Hi Tom,

Quoted 4 lines · Tom Rini

A more elaborate set of statements on my feelings about "old" boards and what needs to happen, in light of the facts that the code is messy, will require updating for DM and likelyhood of a small but devoted community around some of them.

My gut feeling on this is to either move unmaintained / inactive boards to a separate board directory, or add a flag to boards.cfg (If we add a flag to boards.cfg then we can specify that MAKEALL should skip those boards)

Either way, we can then let them bit-rot (I know, bad words) but at least if someone comes along with an actual board, they have a place to start. This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation to start reinvigorating it.

Regards,

Graeme

#49 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Graeme Russ,

Quoted 10 lines

Hi Tom,

Quoted 4 lines · Tom Rini

A more elaborate set of statements on my feelings about "old" boards and what needs to happen, in light of the facts that the code is messy, will require updating for DM and likelyhood of a small but devoted community around some of them.

My gut feeling on this is to either move unmaintained / inactive boards to a separate board directory

And hoard crap? No, you can dig them from git history, the objects will still be there.

Quoted 5 lines

or add a flag to boards.cfg (If
we add a flag to boards.cfg then we can specify that MAKEALL should skip those boards)

Either way, we can then let them bit-rot

I disagree

Quoted 3 lines

(I know, bad words) but at
least if someone comes along with an actual board, they have a place to start.

They can retrieve it from git history and re-add it in such unlikely case.

Quoted 3 lines

This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation to start reinvigorating it.

It's still horribly broken, but that's partly because of x86 itself is a horribly broken CPU :-)

Quoted 3 lines

Regards,

Graeme

Best regards,
Marek Vasut

#50 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Quoted 33 lines · Marek Vasut

Dear Graeme Russ,

Quoted 4 lines

Hi Tom,

Quoted 1 line · Tom Rini

A more elaborate set of statements on my feelings about "old"

boards

Quoted 6 lines
Quoted 3 lines

and what needs to happen, in light of the facts that the code is messy, will require updating for DM and likelyhood of a small but devoted community around some of them.

My gut feeling on this is to either move unmaintained / inactive boards to a separate board directory

And hoard crap? No, you can dig them from git history, the objects will still be
there.

Quoted 5 lines

or add a flag to boards.cfg (If
we add a flag to boards.cfg then we can specify that MAKEALL should skip those boards)

Either way, we can then let them bit-rot

I disagree

Quoted 3 lines

(I know, bad words) but at
least if someone comes along with an actual board, they have a place to start.

They can retrieve it from git history and re-add it in such unlikely case.

Quoted 7 lines
Quoted 3 lines

This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation to start reinvigorating it.

It's still horribly broken, but that's partly because of x86 itself is a
horribly broken CPU :-)

Maybe have a GRAVEYARD file that lists hardware support and other notable features that have been removed, so it's easy for someone to tell whether digging through the git history might be fruitful.

-Scott

#51 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Scott Wood,

Quoted 40 lines · Marek Vasut
Quoted 39 lines

Dear Graeme Russ,

Quoted 4 lines

Hi Tom,

Quoted 1 line · Tom Rini

A more elaborate set of statements on my feelings about "old"

boards

Quoted 6 lines
Quoted 3 lines

and what needs to happen, in light of the facts that the code is messy, will require updating for DM and likelyhood of a small but devoted community around some of them.

My gut feeling on this is to either move unmaintained / inactive boards to a separate board directory

And hoard crap? No, you can dig them from git history, the objects will still be
there.

Quoted 5 lines

or add a flag to boards.cfg (If
we add a flag to boards.cfg then we can specify that MAKEALL should skip those boards)

Either way, we can then let them bit-rot

I disagree

Quoted 3 lines

(I know, bad words) but at
least if someone comes along with an actual board, they have a place to start.

They can retrieve it from git history and re-add it in such unlikely case.

Quoted 3 lines

This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation to start reinvigorating it.

Quoted 7 lines
Quoted 3 lines

It's still horribly broken, but that's partly because of x86 itself is a
horribly broken CPU :-)

Maybe have a GRAVEYARD file that lists hardware support and other notable features that have been removed, so it's easy for someone to tell whether digging through the git history might be fruitful.

Like doc/README.scrapyard ?

Quoted 1 line

-Scott

Best regards,
Marek Vasut

#52 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Quoted 50 lines · Marek Vasut

Dear Scott Wood,

Quoted 11 lines · Marek Vasut
Quoted 10 lines

Dear Graeme Russ,

Quoted 4 lines

Hi Tom,

Quoted 1 line · Tom Rini

A more elaborate set of statements on my feelings about "old"

boards

Quoted 1 line
Quoted 1 line

and what needs to happen, in light of the facts that the code

is

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

messy, will require updating for DM and likelyhood of a small

but

Quoted 11 lines
Quoted 11 lines
Quoted 4 lines
Quoted 1 line

devoted community around some of them.

My gut feeling on this is to either move unmaintained / inactive boards to a separate board directory

And hoard crap? No, you can dig them from git history, the objects will still be
there.

Quoted 2 lines

or add a flag to boards.cfg (If
we add a flag to boards.cfg then we can specify that MAKEALL

should

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

skip those boards)

Either way, we can then let them bit-rot

I disagree

Quoted 2 lines

(I know, bad words) but at
least if someone comes along with an actual board, they have a

place

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

to start.

They can retrieve it from git history and re-add it in such

unlikely

Quoted 4 lines
Quoted 4 lines

case.

Quoted 2 lines

This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation

to

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

start reinvigorating it.

It's still horribly broken, but that's partly because of x86

itself

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

is a
horribly broken CPU :-)

Maybe have a GRAVEYARD file that lists hardware support and other notable features that have been removed, so it's easy for someone to tell whether digging through the git history might be fruitful.

Like doc/README.scrapyard ?

Heh. Yes, except maybe more prominent so people would know it exists. :-)

That file does seem a bit board-centric; drivers and other things can die off too.

-Scott

#53 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Scott Wood,

[...]

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Maybe have a GRAVEYARD file that lists hardware support and other notable features that have been removed, so it's easy for someone to tell whether digging through the git history might be fruitful.

Like doc/README.scrapyard ?

Heh. Yes, except maybe more prominent so people would know it exists.

I'd say we need marketing, advertising and ... maybe something else ;-)

G***le ads for README.scrapyard maybe ? :-)

Quoted 4 lines

:-)

That file does seem a bit board-centric; drivers and other things can die off too.

Yes, indeed ... reformating it might help.

Quoted 1 line

-Scott

Best regards,
Marek Vasut

#54 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

In reply to Scott Wood

Hi Scott,

Quoted 5 lines · Scott Wood

On 09/19/2012 05:57:56 PM, Marek Vasut wrote:

Maybe have a GRAVEYARD file that lists hardware support and other notable features that have been removed, so it's easy for someone to tell whether digging through the git history might be fruitful.

In the immortal words of Monty Python - "We already got one!"

Regards,

Graeme

#55 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Graeme Russ,

Quoted 10 lines

Hi Scott,

Quoted 5 lines · Scott Wood

On 09/19/2012 05:57:56 PM, Marek Vasut wrote:

Maybe have a GRAVEYARD file that lists hardware support and other notable features that have been removed, so it's easy for someone to tell whether digging through the git history might be fruitful.

In the immortal words of Monty Python - "We already got one!"

So say we all %^)
--BSG

Quoted 3 lines

Regards,

Graeme

Best regards,
Marek Vasut

#56 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

In reply to Marek Vasut

Hi Marek,

Quoted 7 lines · Marek Vasut

Dear Graeme Russ,

Quoted 3 lines

This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation to start reinvigorating it.

It's still horribly broken, but that's partly because of x86 itself is a

Only because every other bugger here keeps breaking it because they don't test the impact of their code, forcing me to go back and keep fixing it :P

Quoted 1 line

horribly broken CPU :-)

At least it's cache handling isn't as crap as ARM :P

Regards,

Graeme

#57 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

Dear Graeme Russ,

Quoted 9 lines

Hi Marek,

Quoted 6 lines · Marek Vasut

Dear Graeme Russ,

Quoted 3 lines

This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation to start reinvigorating it.

Quoted 5 lines
Quoted 1 line

It's still horribly broken, but that's partly because of x86 itself is a

Only because every other bugger here keeps breaking it because they don't test the impact of their code, forcing me to go back and keep fixing it :P

Your work is so appreciated, you're our savior :-b

Quoted 3 lines
Quoted 1 line

horribly broken CPU :-)

At least it's cache handling isn't as crap as ARM :P

Yep, you're right, we're still missing instructions to flush various insane patterns in cache :-b

Quoted 3 lines

Regards,

Graeme

Best regards,
Marek Vasut

#58 lore raw

PATCH 32/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into bmw serial driver

In reply to Graeme Russ

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

Quoted 14 lines · Graeme Russ

Hi Tom,

Quoted 4 lines · Tom Rini

A more elaborate set of statements on my feelings about "old" boards and what needs to happen, in light of the facts that the code is messy, will require updating for DM and likelyhood of a small but devoted community around some of them.

My gut feeling on this is to either move unmaintained / inactive boards to a separate board directory, or add a flag to boards.cfg (If we add a flag to boards.cfg then we can specify that MAKEALL should skip those boards)

Quoted 5 lines

Either way, we can then let them bit-rot (I know, bad words) but at least if someone comes along with an actual board, they have a place to start. This is what happened to me with the x86 arch - the existing code was horribly broken, but at least I had a solid foundation to start reinvigorating it.

... and lots of strong opinions follow. Which is why I wanted a separate thread (so more folks see it) and we start from what I hope is a reasoned approach we can all mostly agree on :)

- --
Tom

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

iQIcBAEBAgAGBQJQWlI/AAoJENk4IS6UOR1WQ2EP/2a2WljteyyB44HvtLJsOsNI sLOri7YBtE8opmJ7aia4/2lBm6EEyDUGMVlQcSS8jE3EOUfrVEh8R2mLNpEjygDz WUZLi4o3FEJozd9OgNBuOTkYswsZe1c93lP0NQ/zc4M0jLJHj0JN1ZK7HeAVD0Mo oJHLSocFuBuY0hpXa26jdFBRcMtKXDQ4YvGexU16Vs8O54bryvDvDhxZxnKy38lP icVdc9AsAh8pHN8g/RFt++cIaSY64munCKCc1ld1Wx0Fsqpygb27Ikmt5/NqIPyY 1RnqZ0tTXqbsjnpr5lokE3HFXdmriEfiCE8lfc1iAW91SY3YDCQjGrSfE1B1PbsA L8PthUJLs8dLuhk4ZNlRkBCgIU+9RRX/TMuJOrihukI3Wg9Ui/PUBwJVChmNmwFc cZHTbilRP09tk4I2rY1OMQbNjMQWjLw25rjXcKEAIQ+UEQ/MoakDKX/JOEcq4blK AtG0L2na+nb4JmgCraWH/0EoOFuQOLaYLyT6Bm2c4ElzAZ7jxbfSDlc6AB4FHuAL xxw2nTrm3ij0x2r694hx1BNCQ8KRKSHwTBBTcNDrnjmH1rfKT7v78qiXBfb8w3WA aMrIfiQBnFwAe2RRaK075Muwze5tPnzKsgPimVEqb3FFCLefOzdFy23lTVTua2g7 7mdQb4WkcWTdS42FXYRi
=E2+c
-----END PGP SIGNATURE-----

#59 lore raw

PATCH 33/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into cogent serial driver

In reply to Marek Vasut

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

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

PATCH 34/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into cpci750 serial driver

In reply to Marek Vasut

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

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

PATCH 35/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into evb64260 serial driver

In reply to Marek Vasut

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

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

PATCH 36/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into ml2 serial driver

In reply to Marek Vasut

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

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

PATCH 36/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into ml2 serial driver

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Stefan Roese <[email protected]>

Again NS16550 compatible. This file should not be needed. Could be moved to common driver, but needs testing. Board seems unmaintained, so remove it?

Thanks,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: office at denx.de

#64 lore raw

PATCH 37/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into sconsole serial driver

In reply to Marek Vasut

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

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

PATCH 38/71 serial: powerpc: Implement CONFIG_SERIAL_MULTI into p3mx serial driver

In reply to Marek Vasut

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

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

PATCH 39/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial driver

In reply to Marek Vasut

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

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

96 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#67 lore raw

PATCH 39/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial driver

Quoted 6 lines · Marek Vasut

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

Quoted 8 lines
Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Thomas Chou <[email protected]>
---
  common/serial.c                   |    2 ++
  drivers/serial/altera_jtag_uart.c |   71 +++++++++++++++++++++++++++++++++----
  2 files changed, 67 insertions(+), 6 deletions(-)

Dear Marek,

Please include the following headers.

drivers/serial/altera_jtag_uart.c +2 -0
@@ -25,6 +25,8 @@
  #include <watchdog.h>
  #include <asm/io.h>
  #include <nios2-io.h>
+#include <linux/compiler.h>
+#include <serial.h>
 
  DECLARE_GLOBAL_DATA_PTR;
 

And the .name string is too long. >16

static struct serial_device altera_jtag_serial_drv = {
	.name	= "altera_jtag_serial",

Otherwise,

Best regards,
Thomas Chou

Quoted 125 lines
common/serial.c +2 -0
index 2d6ba05..24879ec 100644
@@ -69,6 +69,7 @@ serial_initfunc(evb64260_serial_initialize);
  serial_initfunc(ml2_serial_initialize);
  serial_initfunc(sconsole_serial_initialize);
  serial_initfunc(p3mx_serial_initialize);
+serial_initfunc(altera_jtag_serial_initialize);
 
  void serial_register(struct serial_device *dev)
  {
@@ -116,6 +117,7 @@ void serial_initialize(void)
  	ml2_serial_initialize();
  	sconsole_serial_initialize();
  	p3mx_serial_initialize();
+	altera_jtag_serial_initialize();
 
  	serial_assign(default_serial_console()->name);
  }
drivers/serial/altera_jtag_uart.c +65 -6
index 2980e4d..d3b6c1c 100644
@@ -33,10 +33,16 @@ DECLARE_GLOBAL_DATA_PTR;
   *-----------------------------------------------------------------*/
  static nios_jtag_t *jtag = (nios_jtag_t *)CONFIG_SYS_NIOS_CONSOLE;
 
-void serial_setbrg( void ){ return; }
-int serial_init( void ) { return(0);}
+static void altera_jtag_serial_setbrg(void)
+{
+}
+
+static int altera_jtag_serial_init(void)
+{
+	return 0;
+}
 
-void serial_putc (char c)
+static void altera_jtag_serial_putc(char c)
  {
  	while (1) {
  		unsigned st = readl(&jtag->control);
@@ -51,18 +57,18 @@ void serial_putc (char c)
  	writel ((unsigned char)c, &jtag->data);
  }
 
-void serial_puts (const char *s)
+static void altera_jtag_serial_puts(const char *s)
  {
  	while (*s != 0)
  		serial_putc (*s++);
  }
 
-int serial_tstc (void)
+static int altera_jtag_serial_tstc(void)
  {
  	return ( readl (&jtag->control) & NIOS_JTAG_RRDY);
  }
 
-int serial_getc (void)
+static int altera_jtag_serial_getc(void)
  {
  	int c;
  	unsigned val;
@@ -76,3 +82,56 @@ int serial_getc (void)
  	c = val & 0x0ff;
  	return (c);
  }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device altera_jtag_serial_drv = {
+	.name	= "altera_jtag_serial",
+	.start	= altera_jtag_serial_init,
+	.stop	= NULL,
+	.setbrg	= altera_jtag_serial_setbrg,
+	.putc	= altera_jtag_serial_putc,
+	.puts	= altera_jtag_serial_puts,
+	.getc	= altera_jtag_serial_getc,
+	.tstc	= altera_jtag_serial_tstc,
+};
+
+void altera_jtag_serial_initialize(void)
+{
+	serial_register(&altera_jtag_serial_drv);
+}
+
+__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
#68 lore raw

PATCH 39/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial driver

Dear Thomas Chou,

Quoted 25 lines · Marek Vasut
Quoted 10 lines

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Thomas Chou <[email protected]>
Quoted 6 lines

---

  common/serial.c                   |    2 ++
  drivers/serial/altera_jtag_uart.c |   71

+++++++++++++++++++++++++++++++++---- 2 files changed, 67 insertions(+), 6 deletions(-)

Dear Marek,

Please include the following headers.

drivers/serial/altera_jtag_uart.c line 29

Quoted 5 lines
drivers/serial/altera_jtag_uart.c +2 -0
@@ -25,6 +25,8 @@
  #include <watchdog.h>
  #include <asm/io.h>
  #include <nios2-io.h>
+#include <linux/compiler.h>
+#include <serial.h>

Are you seeing any issues without them?

Quoted 12 lines
drivers/serial/altera_jtag_uart.c +0 -0
  DECLARE_GLOBAL_DATA_PTR;
 

And the .name string is too long. >16

static struct serial_device altera_jtag_serial_drv = {
	.name	= "altera_jtag_serial",

Otherwise,

Best regards,
Thomas Chou

[...]

#69 lore raw

PATCH 39/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial driver

Quoted 14 lines · Marek Vasut

drivers/serial/altera_jtag_uart.c line 29

Quoted 10 lines

Please include the following headers.

drivers/serial/altera_jtag_uart.c +2 -0
@@ -25,6 +25,8 @@
   #include <watchdog.h>
   #include <asm/io.h>
   #include <nios2-io.h>
+#include <linux/compiler.h>
+#include <serial.h>

Are you seeing any issues without them?

Dear Marek,

The serial.h defines the struct serial_device. And the linux/compiler.h defines the __weak attribute. Without them, it won't compile.

I have pulled your latest dm-serial-1 branch, compiled and tested altera_uart and altera_jtag_uart on nios2 board. They work without problem.

There is only minor size change.

Before..
Configuring for nios2-generic board...
text data bss dec hex filename
134782 3206 23173 161161 27589 /home/thomas/tmp/u-boot/u-boot

After..
Configuring for nios2-generic board...
text data bss dec hex filename
135450 3254 23181 161885 2785d /home/thomas/tmp/u-boot/u-boot

Thank you very much.

Best regards
Thomas Chou

#70 lore raw

PATCH 39/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera_jtag serial driver

Dear Thomas Chou,

Quoted 32 lines · Marek Vasut
Quoted 6 lines
Quoted 6 lines

Please include the following headers.

drivers/serial/altera_jtag_uart.c +0 -0
@@ -25,6 +25,8 @@
 
Quoted 8 lines

drivers/serial/altera_jtag_uart.c line 29

Quoted 6 lines
drivers/serial/altera_jtag_uart.c +2 -0
   #include <watchdog.h>
   #include <asm/io.h>
   #include <nios2-io.h>
 
+#include <linux/compiler.h>
+#include <serial.h>

Are you seeing any issues without them?

Dear Marek,

The serial.h defines the struct serial_device. And the linux/compiler.h defines the __weak attribute. Without them, it won't compile.

I have pulled your latest dm-serial-1 branch, compiled and tested altera_uart and altera_jtag_uart on nios2 board. They work without problem.

There is only minor size change.

Before..
Configuring for nios2-generic board...
text data bss dec hex filename
134782 3206 23173 161161 27589 /home/thomas/tmp/u-boot/u-boot

Quoted 6 lines

After..
Configuring for nios2-generic board...
text data bss dec hex filename
135450 3254 23181 161885 2785d /home/thomas/tmp/u-boot/u-boot

Thank you very much.

Perfect! Thank YOU!

Quoted 2 lines

Best regards
Thomas Chou

Best regards,
Marek Vasut

#71 lore raw

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

In reply to Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Thomas Chou <[email protected]>
---
 common/serial.c                   |    2 +
 drivers/serial/altera_jtag_uart.c |   73 ++++++++++++++++++++++++++++++++++---
 2 files changed, 69 insertions(+), 6 deletions(-)

V2: Add includes (serial.h and linux/compiler.h)
Fix name too long error

common/serial.c +2 -0
index 2d6ba05..24879ec 100644
@@ -69,6 +69,7 @@ serial_initfunc(evb64260_serial_initialize);
 serial_initfunc(ml2_serial_initialize);
 serial_initfunc(sconsole_serial_initialize);
 serial_initfunc(p3mx_serial_initialize);
+serial_initfunc(altera_jtag_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -116,6 +117,7 @@ void serial_initialize(void)
 	ml2_serial_initialize();
 	sconsole_serial_initialize();
 	p3mx_serial_initialize();
+	altera_jtag_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/altera_jtag_uart.c +67 -6

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#72 lore raw

PATCH 40/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera serial driver

In reply to Marek Vasut

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

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

126 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#73 lore raw

PATCH 40/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera serial driver

Quoted 6 lines · Marek Vasut

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

Quoted 8 lines
Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott McNutt <[email protected]>
---
  common/serial.c              |    2 +
  drivers/serial/altera_uart.c |   83 ++++++++++++++++++++++++++++++++++++------
  2 files changed, 73 insertions(+), 12 deletions(-)

Dear Marek,

Please include the following headers.

drivers/serial/altera_uart.c +2 -0
@@ -26,6 +26,8 @@
  #include <watchdog.h>
  #include <asm/io.h>
  #include <nios2-io.h>
+#include <linux/compiler.h>
+#include <serial.h>
 
  DECLARE_GLOBAL_DATA_PTR;
 

Otherwise,

Best regards,
Thomas Chou

Quoted 155 lines
common/serial.c +2 -0
index 24879ec..e6566da 100644
@@ -70,6 +70,7 @@ serial_initfunc(ml2_serial_initialize);
  serial_initfunc(sconsole_serial_initialize);
  serial_initfunc(p3mx_serial_initialize);
  serial_initfunc(altera_jtag_serial_initialize);
+serial_initfunc(altera_serial_initialize);
 
  void serial_register(struct serial_device *dev)
  {
@@ -118,6 +119,7 @@ void serial_initialize(void)
  	sconsole_serial_initialize();
  	p3mx_serial_initialize();
  	altera_jtag_serial_initialize();
+	altera_serial_initialize();
 
  	serial_assign(default_serial_console()->name);
  }
drivers/serial/altera_uart.c +71 -12
index 045f119..18b820b 100644
@@ -37,27 +37,33 @@ static nios_uart_t *uart = (nios_uart_t *) CONFIG_SYS_NIOS_CONSOLE;
 
  #if defined(CONFIG_SYS_NIOS_FIXEDBAUD)
 
-/* Everything's already setup for fixed-baud PTF
+/*
+ * Everything's already setup for fixed-baud PTF
   * assignment
   */
-void serial_setbrg (void){ return; }
-int serial_init (void) { return (0);}
+static void altera_serial_setbrg(void)
+{
+}
+
+static int altera_serial_init(void)
+{
+	return 0;
+}
 
  #else
 
-void serial_setbrg (void)
+static void altera_serial_setbrg(void)
  {
  	unsigned div;
 
  	div = (CONFIG_SYS_CLK_FREQ/gd->baudrate)-1;
  	writel (div, &uart->divisor);
-	return;
  }
 
-int serial_init (void)
+static int altera_serial_init(void)
  {
-	serial_setbrg ();
-	return (0);
+	serial_setbrg();
+	return 0;
  }
 
  #endif /* CONFIG_SYS_NIOS_FIXEDBAUD */
@@ -65,7 +71,7 @@ int serial_init (void)
  /*-----------------------------------------------------------------------
   * UART CONSOLE
   *---------------------------------------------------------------------*/
-void serial_putc (char c)
+static void altera_serial_putc(char c)
  {
  	if (c == '\n')
  		serial_putc ('\r');
@@ -74,21 +80,74 @@ void serial_putc (char c)
  	writel ((unsigned char)c, &uart->txdata);
  }
 
-void serial_puts (const char *s)
+static void altera_serial_puts(const char *s)
  {
  	while (*s != 0) {
  		serial_putc (*s++);
  	}
  }
 
-int serial_tstc (void)
+static int altera_serial_tstc(void)
  {
  	return (readl (&uart->status) & NIOS_UART_RRDY);
  }
 
-int serial_getc (void)
+static int altera_serial_getc(void)
  {
  	while (serial_tstc () == 0)
  		WATCHDOG_RESET ();
  	return (readl (&uart->rxdata) & 0x00ff );
  }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device altera_serial_drv = {
+	.name	= "altera_serial",
+	.start	= altera_serial_init,
+	.stop	= NULL,
+	.setbrg	= altera_serial_setbrg,
+	.putc	= altera_serial_putc,
+	.puts	= altera_serial_puts,
+	.getc	= altera_serial_getc,
+	.tstc	= altera_serial_tstc,
+};
+
+void altera_serial_initialize(void)
+{
+	serial_register(&altera_serial_drv);
+}
+
+__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
#74 lore raw

PATCH 40/71 serial: arm: Implement CONFIG_SERIAL_MULTI into altera serial driver

Dear Thomas Chou,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott McNutt <[email protected]>

---

Quoted 8 lines
Quoted 4 lines
  common/serial.c              |    2 +
  drivers/serial/altera_uart.c |   83

++++++++++++++++++++++++++++++++++++------ 2 files changed, 73 insertions(+), 12 deletions(-)

Dear Marek,

Please include the following headers.

[...]
Fixed both, V2 out

Best regards,
Marek Vasut

#75 lore raw

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

In reply to Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott McNutt <[email protected]>
---
 common/serial.c              |    2 +
 drivers/serial/altera_uart.c |   85 ++++++++++++++++++++++++++++++++++++------
 2 files changed, 75 insertions(+), 12 deletions(-)

V2: Add includes (serial.h and linux/compiler.h)

common/serial.c +2 -0
index 24879ec..e6566da 100644
@@ -70,6 +70,7 @@ serial_initfunc(ml2_serial_initialize);
 serial_initfunc(sconsole_serial_initialize);
 serial_initfunc(p3mx_serial_initialize);
 serial_initfunc(altera_jtag_serial_initialize);
+serial_initfunc(altera_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -118,6 +119,7 @@ void serial_initialize(void)
 	sconsole_serial_initialize();
 	p3mx_serial_initialize();
 	altera_jtag_serial_initialize();
+	altera_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/altera_uart.c +73 -12

134 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#76 lore raw

PATCH 41/71 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver

In reply to Marek Vasut

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

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

109 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#77 lore raw

PATCH 41/71 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver

Dear Marek Vasut,

I have to admit that when reading this patch I got attention of your UDM-serial.txt for the first time. However when reading this patch some questions come to my mind.

Quoted 49 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Xu, Hong <[email protected]>
---
 common/serial.c              |    2 ++
 drivers/serial/atmel_usart.c |   67 ++++++++++++++++++++++++++++++++++++++----
 2 files changed, 63 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index e6566da..b880303 100644
@@ -71,6 +71,7 @@ serial_initfunc(sconsole_serial_initialize);
 serial_initfunc(p3mx_serial_initialize);
 serial_initfunc(altera_jtag_serial_initialize);
 serial_initfunc(altera_serial_initialize);
+serial_initfunc(atmel_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -120,6 +121,7 @@ void serial_initialize(void)
 	p3mx_serial_initialize();
 	altera_jtag_serial_initialize();
 	altera_serial_initialize();
+	atmel_serial_initialize();
 
 	serial_assign(default_serial_console()->name);
 }
drivers/serial/atmel_usart.c +2 -0
index 943ef70..d49d5d4 100644
@@ -20,6 +20,8 @@
  */
 #include <common.h>
 #include <watchdog.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 #include <asm/io.h>
 #include <asm/arch/clk.h>

drivers/serial/atmel_usart.c line 36

Quoted 7 lines
drivers/serial/atmel_usart.c +1 -1
@@ -29,7 +31,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void serial_setbrg(void)
+static void atmel_serial_setbrg(void)
 {
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;

shouldn't this USART_BASE be carried by the driver struct in some way? I wonder how one should implement multiple interfaces later on with this atmel_serial_xx(void) interface.

Quoted 20 lines
drivers/serial/atmel_usart.c +2 -2
 	unsigned long divisor;
@@ -45,7 +47,7 @@ void serial_setbrg(void)
 	writel(USART3_BF(CD, divisor), &usart->brgr);
 }
 
-int serial_init(void)
+static int atmel_serial_init(void)
 {
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 
@@ -73,7 +75,7 @@ int serial_init(void)
 	return 0;
 }
 
-void serial_putc(char c)
+static void atmel_serial_putc(char c)
 {
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 

drivers/serial/atmel_usart.c void serial_putc(char c) · line 93

Quoted 9 lines
drivers/serial/atmel_usart.c +1 -1
@@ -84,13 +86,13 @@ void serial_putc(char c)
 	writel(c, &usart->thr);
 }
 
-void serial_puts(const char *s)
+static void atmel_serial_puts(const char *s)
 {
 	while (*s)
 		serial_putc(*s++);
 }

I have seen this one in a lot of drivers ... shouldn't we build a generic one?

Quoted 10 lines
drivers/serial/atmel_usart.c +1 -1
-int serial_getc(void)
+static int atmel_serial_getc(void)
 {
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 
@@ -99,8 +101,61 @@ int serial_getc(void)
 	return readl(&usart->rhr);
 }
 

drivers/serial/atmel_usart.c int serial_getc(void) · line 112

Quoted 10 lines
drivers/serial/atmel_usart.c +5 -1
-int serial_tstc(void)
+static int atmel_serial_tstc(void)
 {
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 	return (readl(&usart->csr) & USART3_BIT(RXRDY)) != 0;
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device atmel_serial_drv = {
+	.name	= "atmel_serial",

even though here is just one instance shouldn't the name reflect the multiplicity of this driver (e.g. 'atmel_serial0')?

drivers/serial/atmel_usart.c int serial_getc(void) · line 119

Quoted 7 lines
drivers/serial/atmel_usart.c +7 -0
+	.start	= atmel_serial_init,
+	.stop	= NULL,
+	.setbrg	= atmel_serial_setbrg,
+	.putc	= atmel_serial_putc,
+	.puts	= atmel_serial_puts,
+	.getc	= atmel_serial_getc,
+	.tstc	= atmel_serial_tstc,

As I understand this struct we need a start/stop/setbgr/... for each instance we build.
Shouldn't we carry some void* private in this struct instead (I have none seen in '[PATCH 01/71] serial: Coding style cleanup of struct serial_device') to be able to reuse the interface with multiple instances of the same driver class?
I think this is my main objection to this structure. I wonder how existing SERIAL_MULTI implementations handle the need of private driver information bound to an instance.

Best regards

Andreas Bie?mann

#78 lore raw

PATCH 41/71 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver

Dear Andreas Bie?mann,

Quoted 5 lines

Dear Marek Vasut,

I have to admit that when reading this patch I got attention of your UDM-serial.txt for the first time. However when reading this patch some questions come to my mind.

[...]

Quoted 10 lines

drivers/serial/atmel_usart.c line 36

Quoted 6 lines
drivers/serial/atmel_usart.c +1 -1
-void serial_setbrg(void)
+static void atmel_serial_setbrg(void)
 
 {
 
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;

shouldn't this USART_BASE be carried by the driver struct in some way? I wonder how one should implement multiple interfaces later on with this atmel_serial_xx(void) interface.

We can't rework the whole stdio/serial subsystem right away. All such calls (serial_setbrg, serial_putc etc) will be augmented by one more parameter to push such information through at runtime. This will be done in subsequent patch, stage 1 in only a preparation stage.

Quoted 39 lines
Quoted 39 lines
drivers/serial/atmel_usart.c +1 -1
 	unsigned long divisor;
@@ -45,7 +47,7 @@ void serial_setbrg(void)
 
 	writel(USART3_BF(CD, divisor), &usart->brgr);
 
 }
 
-int serial_init(void)
+static int atmel_serial_init(void)
 

{

drivers/serial/atmel_usart.c +1 -1
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
@@ -73,7 +75,7 @@ int serial_init(void)
 
 	return 0;
 
 }
 
-void serial_putc(char c)
+static void atmel_serial_putc(char c)
 

{

drivers/serial/atmel_usart.c +1 -1
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
@@ -84,13 +86,13 @@ void serial_putc(char c)
 
 	writel(c, &usart->thr);
 
 }
 
-void serial_puts(const char *s)
+static void atmel_serial_puts(const char *s)
 
 {
 
Quoted 8 lines
Quoted 5 lines
drivers/serial/atmel_usart.c +0 -0
 	while (*s)
 
 		serial_putc(*s++);
 

}

I have seen this one in a lot of drivers ... shouldn't we build a generic one?

Indeed, but only in stage 2 or somewhere later ... I have that in mind, but the serial subsystem needs a bit of a patching for that.

Quoted 23 lines
Quoted 23 lines
drivers/serial/atmel_usart.c +2 -2
-int serial_getc(void)
+static int atmel_serial_getc(void)
 
 {
 
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
@@ -99,8 +101,61 @@ int serial_getc(void)
 
 	return readl(&usart->rhr);
 
 }
 
-int serial_tstc(void)
+static int atmel_serial_tstc(void)
 
 {
 
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 	return (readl(&usart->csr) & USART3_BIT(RXRDY)) != 0;
 
 }
Quoted 7 lines

drivers/serial/atmel_usart.c int serial_getc(void) · line 112

Quoted 4 lines
drivers/serial/atmel_usart.c +4 -0
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device atmel_serial_drv = {
+	.name	= "atmel_serial",

even though here is just one instance shouldn't the name reflect the multiplicity of this driver (e.g. 'atmel_serial0')?

This is the name of the driver, not the name of the instance of the driver. I'd like to add .id field later on.

Quoted 10 lines

drivers/serial/atmel_usart.c int serial_getc(void) · line 119

Quoted 7 lines
drivers/serial/atmel_usart.c +7 -0
+	.start	= atmel_serial_init,
+	.stop	= NULL,
+	.setbrg	= atmel_serial_setbrg,
+	.putc	= atmel_serial_putc,
+	.puts	= atmel_serial_puts,
+	.getc	= atmel_serial_getc,
+	.tstc	= atmel_serial_tstc,

As I understand this struct we need a start/stop/setbgr/... for each instance we build.

No, this isn't instance. This are driver ops combined with it's name. I can not split it yet.

Quoted 4 lines

Shouldn't we carry some void* private in this struct instead (I have none seen in '[PATCH 01/71] serial: Coding style cleanup of struct serial_device') to be able to reuse the interface with multiple instances of the same driver class?

Yes, but not now, not yet. I'm trying to keep this changes incremental as much as possible.

Quoted 3 lines

I think this is my main objection to this structure. I wonder how existing SERIAL_MULTI implementations handle the need of private driver information bound to an instance.

They have multiple drivers so far and a default_serial_console call. That is indeed stupid, but fixing this is not part of this patchset, but a subsequent one. This one is only a preparation, trying not to break anything and unify the drivers under the serial_multi api, so the further stages can easily continue reworking it.

Quoted 3 lines

Best regards

Andreas Bie?mann

#79 lore raw

PATCH 41/71 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver

Dear Marek Vasut,

Quoted 20 lines · Marek Vasut

Dear Andreas Bie?mann,

Quoted 5 lines

Dear Marek Vasut,

I have to admit that when reading this patch I got attention of your UDM-serial.txt for the first time. However when reading this patch some questions come to my mind.

[...]

Quoted 10 lines

drivers/serial/atmel_usart.c line 36

Quoted 6 lines
drivers/serial/atmel_usart.c +1 -1
-void serial_setbrg(void)
+static void atmel_serial_setbrg(void)
 
 {
 
 	atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;

shouldn't this USART_BASE be carried by the driver struct in some way? I wonder how one should implement multiple interfaces later on with this atmel_serial_xx(void) interface.

Quoted 4 lines

We can't rework the whole stdio/serial subsystem right away. All such calls (serial_setbrg, serial_putc etc) will be augmented by one more parameter to push such information through at runtime. This will be done in subsequent patch, stage 1 in only a preparation stage.

Ok.

<snip>

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
drivers/serial/atmel_usart.c +1 -1
-void serial_puts(const char *s)
+static void atmel_serial_puts(const char *s)
 
 {
 
 	while (*s)
 
 		serial_putc(*s++);
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

}

I have seen this one in a lot of drivers ... shouldn't we build a generic one?

Indeed, but only in stage 2 or somewhere later ... I have that in mind, but the serial subsystem needs a bit of a patching for that.

Ok.

<snip>

Quoted 10 lines
Quoted 7 lines

drivers/serial/atmel_usart.c int serial_getc(void) · line 112

Quoted 4 lines
drivers/serial/atmel_usart.c +4 -0
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device atmel_serial_drv = {
+	.name	= "atmel_serial",

even though here is just one instance shouldn't the name reflect the multiplicity of this driver (e.g. 'atmel_serial0')?

This is the name of the driver, not the name of the instance of the driver. I'd like to add .id field later on.

Ah, ok. Sounds good.

Quoted 26 lines
Quoted 10 lines

drivers/serial/atmel_usart.c int serial_getc(void) · line 119

Quoted 7 lines
drivers/serial/atmel_usart.c +7 -0
+	.start	= atmel_serial_init,
+	.stop	= NULL,
+	.setbrg	= atmel_serial_setbrg,
+	.putc	= atmel_serial_putc,
+	.puts	= atmel_serial_puts,
+	.getc	= atmel_serial_getc,
+	.tstc	= atmel_serial_tstc,

As I understand this struct we need a start/stop/setbgr/... for each instance we build.

No, this isn't instance. This are driver ops combined with it's name. I can not split it yet.

Quoted 4 lines

Shouldn't we carry some void* private in this struct instead (I have none seen in '[PATCH 01/71] serial: Coding style cleanup of struct serial_device') to be able to reuse the interface with multiple instances of the same driver class?

Yes, but not now, not yet. I'm trying to keep this changes incremental as much as possible.

Quoted 3 lines

I think this is my main objection to this structure. I wonder how existing SERIAL_MULTI implementations handle the need of private driver information bound to an instance.

Quoted 5 lines

They have multiple drivers so far and a default_serial_console call. That is indeed stupid, but fixing this is not part of this patchset, but a subsequent one. This one is only a preparation, trying not to break anything and unify the drivers under the serial_multi api, so the further stages can easily continue reworking it.

Understood, I'm fine with it. I will run a test on avr32/some at91 board these days and send my ACK then.

Best regards

Andreas Bie?mann

#80 lore raw

PATCH 41/71 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver

Dear Andreas Bie?mann,

[...]

Quoted 8 lines
Quoted 5 lines

They have multiple drivers so far and a default_serial_console call. That is indeed stupid, but fixing this is not part of this patchset, but a subsequent one. This one is only a preparation, trying not to break anything and unify the drivers under the serial_multi api, so the further stages can easily continue reworking it.

Understood, I'm fine with it. I will run a test on avr32/some at91 board these days and send my ACK then.

Thank you!

Please note, I have the subsequent stages planned and some already being worked on, but please let's wait with them until this gets into -next.

Quoted 3 lines

Best regards

Andreas Bie?mann

Best regards,
Marek Vasut

#81 lore raw

PATCH 41/71 serial: arm: Implement CONFIG_SERIAL_MULTI into atmel serial driver

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Xu, Hong <[email protected]>

---

whole series runtime tested on avr32 and at91sam9260ek, therefore

Best regards

Andreas Bie?mann

#82 lore raw

PATCH 42/71 serial: arm: Implement CONFIG_SERIAL_MULTI into lpc32xx serial driver

In reply to Marek Vasut

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

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

130 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#83 lore raw

PATCH 42/71 serial: arm: Implement CONFIG_SERIAL_MULTI into lpc32xx serial driver

Quoted 10 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Vladimir Zapolskiy <[email protected]>

Thanks,
Vladimir

Quoted 164 lines
---
  common/serial.c                 |    2 ++
  drivers/serial/lpc32xx_hsuart.c |   71 ++++++++++++++++++++++++++-------------
  2 files changed, 50 insertions(+), 23 deletions(-)
common/serial.c +2 -0
index b880303..8bc26d8 100644
@@ -72,6 +72,7 @@ serial_initfunc(p3mx_serial_initialize);
  serial_initfunc(altera_jtag_serial_initialize);
  serial_initfunc(altera_serial_initialize);
  serial_initfunc(atmel_serial_initialize);
+serial_initfunc(lpc32xx_serial_initialize);
 
  void serial_register(struct serial_device *dev)
  {
@@ -122,6 +123,7 @@ void serial_initialize(void)
  	altera_jtag_serial_initialize();
  	altera_serial_initialize();
  	atmel_serial_initialize();
+	lpc32xx_serial_initialize();
 
  	serial_assign(default_serial_console()->name);
  }
drivers/serial/lpc32xx_hsuart.c +48 -23
index 8ce3382..536fd46 100644
@@ -22,12 +22,14 @@
  #include<asm/arch/clk.h>
  #include<asm/arch/uart.h>
  #include<asm/io.h>
+#include<serial.h>
+#include<linux/compiler.h>
 
  DECLARE_GLOBAL_DATA_PTR;
 
  static struct hsuart_regs *hsuart = (struct hsuart_regs *)HS_UART_BASE;
 
-static void lpc32xx_hsuart_set_baudrate(void)
+static void lpc32xx_serial_setbrg(void)
  {
  	u32 div;
 
@@ -39,7 +41,7 @@ static void lpc32xx_hsuart_set_baudrate(void)
  	writel(div,&hsuart->rate);
  }
 
-static int lpc32xx_hsuart_getc(void)
+static int lpc32xx_serial_getc(void)
  {
  	while (!(readl(&hsuart->level)&  HSUART_LEVEL_RX))
  		/* NOP */;
@@ -47,7 +49,7 @@ static int lpc32xx_hsuart_getc(void)
  	return readl(&hsuart->rx)&  HSUART_RX_DATA;
  }
 
-static void lpc32xx_hsuart_putc(const char c)
+static void lpc32xx_serial_putc(const char c)
  {
  	writel(c,&hsuart->tx);
 
@@ -56,7 +58,7 @@ static void lpc32xx_hsuart_putc(const char c)
  		/* NOP */;
  }
 
-static int lpc32xx_hsuart_tstc(void)
+static int lpc32xx_serial_tstc(void)
  {
  	if (readl(&hsuart->level)&  HSUART_LEVEL_RX)
  		return 1;
@@ -64,49 +66,72 @@ static int lpc32xx_hsuart_tstc(void)
  	return 0;
  }
 
-static void lpc32xx_hsuart_init(void)
+static int lpc32xx_serial_init(void)
  {
-	lpc32xx_hsuart_set_baudrate();
+	lpc32xx_serial_setbrg();
 
  	/* Disable hardware RTS and CTS flow control, set up RX and TX FIFO */
  	writel(HSUART_CTRL_TMO_16 | HSUART_CTRL_HSU_OFFSET(20) |
  	       HSUART_CTRL_HSU_RX_TRIG_32 | HSUART_CTRL_HSU_TX_TRIG_0,
  	&hsuart->ctrl);
+	return 0;
  }
 
-void serial_setbrg(void)
+static void lpc32xx_serial_puts(const char *s)
  {
-	return lpc32xx_hsuart_set_baudrate();
+	while (*s)
+		serial_putc(*s++);
  }
 
-void serial_putc(const char c)
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device lpc32xx_serial_drv = {
+	.name	= "lpc32xx_serial",
+	.start	= lpc32xx_serial_init,
+	.stop	= NULL,
+	.setbrg	= lpc32xx_serial_setbrg,
+	.putc	= lpc32xx_serial_putc,
+	.puts	= lpc32xx_serial_puts,
+	.getc	= lpc32xx_serial_getc,
+	.tstc	= lpc32xx_serial_tstc,
+};
+
+void lpc32xx_serial_initialize(void)
  {
-	lpc32xx_hsuart_putc(c);
+	serial_register(&lpc32xx_serial_drv);
+}
 
-	/* If \n, also do \r */
-	if (c == '\n')
-		lpc32xx_hsuart_putc('\r');
+__weak struct serial_device *default_serial_console(void)
+{
+	return&lpc32xx_serial_drv;
+}
+#else
+int serial_init(void)
+{
+	return lpc32xx_serial_init();
  }
 
-int serial_getc(void)
+void serial_setbrg(void)
  {
-	return lpc32xx_hsuart_getc();
+	lpc32xx_serial_setbrg();
  }
 
-void serial_puts(const char *s)
+void serial_putc(const char c)
  {
-	while (*s)
-		serial_putc(*s++);
+	lpc32xx_serial_putc(c);
  }
 
-int serial_tstc(void)
+void serial_puts(const char *s)
  {
-	return lpc32xx_hsuart_tstc();
+	lpc32xx_serial_puts(s);
  }
 
-int serial_init(void)
+int serial_getc(void)
  {
-	lpc32xx_hsuart_init();
+	return lpc32xx_serial_getc();
+}
 
-	return 0;
+int serial_tstc(void)
+{
+	return lpc32xx_serial_tstc();
  }
+#endif
#84 lore raw

PATCH 43/71 serial: mcf: Implement CONFIG_SERIAL_MULTI into MCF serial driver

In reply to Marek Vasut

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

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

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#85 lore raw

PATCH 44/71 serial: Implement CONFIG_SERIAL_MULTI into ns9750 serial driver

In reply to Marek Vasut

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

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

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#86 lore raw

PATCH 45/71 serial: oc: Implement CONFIG_SERIAL_MULTI into OpenCores serial driver

In reply to Marek Vasut

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

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

112 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#87 lore raw

PATCH 46/71 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c4510b serial driver

In reply to Marek Vasut

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

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

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#88 lore raw

PATCH 47/71 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c64xx serial driver

In reply to Marek Vasut

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

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

102 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#89 lore raw

PATCH 47/71 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c64xx serial driver

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc John Rigby <[email protected]>
Cc Minkyu Kang <[email protected]>
Quoted 5 lines
---
 common/serial.c          |    2 ++
 drivers/serial/s3c64xx.c |   65 +++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 61 insertions(+), 6 deletions(-)

Thanks.
--
from. prom.
www.promsoft.net

#90 lore raw

PATCH 48/71 serial: sandbox: Implement CONFIG_SERIAL_MULTI into sandbox serial driver

In reply to Marek Vasut

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

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

96 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#91 lore raw

PATCH 49/71 serial: arm: Implement CONFIG_SERIAL_MULTI into clps7111 serial driver

In reply to Marek Vasut

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

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

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#92 lore raw

PATCH 50/71 serial: arm: Implement CONFIG_SERIAL_MULTI into imx serial driver

In reply to Marek Vasut

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

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

112 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#93 lore raw

PATCH 50/71 serial: arm: Implement CONFIG_SERIAL_MULTI into imx serial driver

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>

---

Hi Marek,

I have later realized that you pushed this series for u-boot-dm and not u-boot. Anyway, is there some reason to prohibit to merge them directly into mainline ? I do not see any special "DM" code here.

Regards,
Stefano

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-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#94 lore raw

PATCH 50/71 serial: arm: Implement CONFIG_SERIAL_MULTI into imx serial driver

Dear Stefano Babic,

Quoted 13 lines · Marek Vasut
Quoted 11 lines

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>

---

Quoted 4 lines

Hi Marek,

I have later realized that you pushed this series for u-boot-dm and not u-boot.

This is for U-Boot, I only CCed the 0000 cover letter for DM to give'em heads up ;-)

Quoted 2 lines

Anyway, is there some reason to prohibit to merge them directly into mainline ? I do not see any special "DM" code here.

Nope, this stage 1 is really only support patchset for later stages which will converge this whole subsystem towards easy deployment of DM.

Quoted 2 lines

Regards,
Stefano

Best regards,
Marek Vasut

#95 lore raw

PATCH 51/71 serial: arm: Implement CONFIG_SERIAL_MULTI into ixp serial driver

In reply to Marek Vasut

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

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

112 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#96 lore raw

PATCH 52/71 serial: arm: Implement CONFIG_SERIAL_MULTI into ks8695 serial driver

In reply to Marek Vasut

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

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

124 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#97 lore raw

PATCH 53/71 serial: arm: Implement CONFIG_SERIAL_MULTI into lh7a40x serial driver

In reply to Marek Vasut

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

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

104 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#98 lore raw

PATCH 54/71 serial: arm: Implement CONFIG_SERIAL_MULTI into lpc2292 serial driver

In reply to Marek Vasut

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

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

101 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#99 lore raw

PATCH 55/71 serial: Implement CONFIG_SERIAL_MULTI into max3100 serial driver

In reply to Marek Vasut

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

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

123 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#100 lore raw

PATCH 56/71 serial: arm: Implement CONFIG_SERIAL_MULTI into mxc serial driver

In reply to Marek Vasut

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

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

113 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#101 lore raw

PATCH 57/71 serial: arm: Implement CONFIG_SERIAL_MULTI into netarm serial driver

In reply to Marek Vasut

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

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

103 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#102 lore raw

PATCH 58/71 serial: arm: Implement CONFIG_SERIAL_MULTI into pl01x serial driver

In reply to Marek Vasut

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

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

116 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#103 lore raw

PATCH 59/71 serial: arm: Implement CONFIG_SERIAL_MULTI into s3c44b0 serial driver

In reply to Marek Vasut

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

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

110 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#104 lore raw

PATCH 60/71 serial: arm: Implement CONFIG_SERIAL_MULTI into sa1100 serial driver

In reply to Marek Vasut

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

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

109 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#105 lore raw

PATCH 61/71 serial: sh: Implement CONFIG_SERIAL_MULTI into sh serial driver

In reply to Marek Vasut

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

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

103 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#106 lore raw

PATCH 61/71 serial: sh: Implement CONFIG_SERIAL_MULTI into sh serial driver

Quoted 11 lines · Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Phil Edworthy <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Quoted 137 lines
---
 common/serial.c            |    2 ++
 drivers/serial/serial_sh.c |   65 ++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 6 deletions(-)
common/serial.c +2 -0
index 3dae01b..631af65 100644
@@ -91,6 +91,7 @@ serial_initfunc(netarm_serial_initialize);
 serial_initfunc(pl01x_serial_initialize);
 serial_initfunc(s3c44b0_serial_initialize);
 serial_initfunc(sa1100_serial_initialize);
+serial_initfunc(sh_serial_initialize);
 
 void serial_register(struct serial_device *dev)
 {
@@ -160,6 +161,7 @@ void serial_initialize(void)
        pl01x_serial_initialize();
        s3c44b0_serial_initialize();
        sa1100_serial_initialize();
+       sh_serial_initialize();
 
        serial_assign(default_serial_console()->name);
 }
drivers/serial/serial_sh.c +59 -7
index 13919c6..8c30397 100644
@@ -55,13 +55,13 @@ static struct uart_port sh_sci = {
        .type           = SCIF_BASE_PORT,
 };
 
-void serial_setbrg(void)
+static void sh_serial_setbrg(void)
 {
        DECLARE_GLOBAL_DATA_PTR;
        sci_out(&sh_sci, SCBRR, SCBRR_VALUE(gd->baudrate, CONFIG_SYS_CLK_FREQ));
 }
 
-int serial_init(void)
+static int sh_serial_init(void)
 {
        sci_out(&sh_sci, SCSCR , SCSCR_INIT(&sh_sci));
        sci_out(&sh_sci, SCSCR , SCSCR_INIT(&sh_sci));
@@ -127,21 +127,21 @@ void serial_raw_putc(const char c)
        sci_out(&sh_sci, SCxSR, sci_in(&sh_sci, SCxSR) & ~SCxSR_TEND(&sh_sci));
 }
 
-void serial_putc(const char c)
+static void sh_serial_putc(const char c)
 {
        if (c == '\n')
                serial_raw_putc('\r');
        serial_raw_putc(c);
 }
 
-void serial_puts(const char *s)
+static void sh_serial_puts(const char *s)
 {
        char c;
        while ((c = *s++) != 0)
                serial_putc(c);
 }
 
-int serial_tstc(void)
+static int sh_serial_tstc(void)
 {
        return serial_rx_fifo_level() ? 1 : 0;
 }
@@ -167,7 +167,7 @@ int serial_getc_check(void)
        return status & (SCIF_DR | SCxSR_RDxF(&sh_sci));
 }
 
-int serial_getc(void)
+static int sh_serial_getc(void)
 {
        unsigned short status;
        char ch;
@@ -187,3 +187,56 @@ int serial_getc(void)
                handle_error();
        return ch;
 }
+
+#ifdef CONFIG_SERIAL_MULTI
+static struct serial_device sh_serial_drv = {
+       .name   = "sh_serial",
+       .start  = sh_serial_init,
+       .stop   = NULL,
+       .setbrg = sh_serial_setbrg,
+       .putc   = sh_serial_putc,
+       .puts   = sh_serial_puts,
+       .getc   = sh_serial_getc,
+       .tstc   = sh_serial_tstc,
+};
+
+void sh_serial_initialize(void)
+{
+       serial_register(&sh_serial_drv);
+}
+
+__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
--
Quoted 2 lines

1.7.10.4

Best regards,
Nobuhiro

Signature · 3 lines
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
#107 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

In reply to Marek Vasut

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

---
 common/serial.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
common/serial.c +12 -0
index 631af65..cef4ba8 100644
@@ -27,6 +27,16 @@
 #include <post.h>
 #include <linux/compiler.h>
 
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}
+#else
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static struct serial_device *serial_devices;
@@ -344,3 +354,5 @@ int uart_post_test(int flags)
 	return ret;
 }
 #endif
+
+#endif
Signature · 1 line
1.7.10.4
#108 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Quoted 17 lines · Marek Vasut

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

---
 common/serial.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
common/serial.c +0 -0
index 631af65..cef4ba8 100644
@@ -27,6 +27,16 @@
 #include <post.h>

common/serial.c line 37

Quoted 10 lines
common/serial.c +8 -0
 #include <linux/compiler.h>
 
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

This isn't quite right. We need to allow for:
- No output SPL, strings collected (so #defined to do{} while (0))
- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT + CONFIG_SPL_LIBCOMMON_SUPPORT)
- puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts serial_puts/putc).

I'm not asking you to do that, but you will have to adapt to it once Jose is done with it. What that means, off the top of my head, is we can just drop this patch as in the first and last case serial.o will be garbage-collected (or not built) and in the middle case, this will be fully used.

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/20120918/0a459e50/attachment.pgp>
#109 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Tom Rini,

Quoted 22 lines · Marek Vasut
Quoted 21 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

---

 common/serial.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
common/serial.c +0 -0
index 631af65..cef4ba8 100644
@@ -27,6 +27,16 @@
 
 #include <post.h>
 #include <linux/compiler.h>
 
Quoted 11 lines

common/serial.c line 37

Quoted 8 lines
common/serial.c +8 -0
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

This isn't quite right. We need to allow for:
- No output SPL, strings collected (so #defined to do{} while (0))

Which is not type-checked and will drag in bugs.

Quoted 10 lines

- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT + CONFIG_SPL_LIBCOMMON_SUPPORT)
- puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts serial_puts/putc).

I'm not asking you to do that, but you will have to adapt to it once Jose is done with it. What that means, off the top of my head, is we can just drop this patch as in the first and last case serial.o will be garbage-collected (or not built) and in the middle case, this will be fully used.

I can't drop this patch as it will break all of SPL when CONFIG_SERIAL_MULTI is unconditionally enabled.

Best regards,
Marek Vasut

#110 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Quoted 37 lines · Marek Vasut

Dear Tom Rini,

Quoted 19 lines · Marek Vasut
Quoted 18 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

---

 common/serial.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
common/serial.c +0 -0
index 631af65..cef4ba8 100644
@@ -27,6 +27,16 @@
 
Quoted 5 lines

common/serial.c

Quoted 5 lines
common/serial.c +2 -0
 #include <post.h>
 #include <linux/compiler.h>
 
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) &&  

!defined(CONFIG_SPL_SERIAL_SUPPORT)

Quoted 9 lines

common/serial.c line 37

Quoted 6 lines
common/serial.c +6 -0
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

This isn't quite right. We need to allow for:
- No output SPL, strings collected (so #defined to do{} while (0))

Quoted 1 line

Which is not type-checked and will drag in bugs.

Not all that likely, since most code will either be built with printf enabled some of the time, or not contain printf (i.e. it's not quite the same situation as debug prints which may be rarely enabled).

An inline function would be fine, but has to be done at the same place that normal printf is declared -- whereas a macro could be done after the fact. Unless you use a macro to redirect it to an inline function of a different name...

I do not understand why you want to put these stubs in a C file instead of a header file, though -- you're preventing code from being optimized away, which is important in some SPLs.

-Scott

#111 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Scott Wood,

Quoted 46 lines · Marek Vasut
Quoted 39 lines

Dear Tom Rini,

Quoted 19 lines · Marek Vasut
Quoted 18 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

---

 common/serial.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
common/serial.c +0 -0
index 631af65..cef4ba8 100644
@@ -27,6 +27,16 @@
 
Quoted 5 lines

common/serial.c

Quoted 5 lines
common/serial.c +2 -0
 #include <post.h>
 #include <linux/compiler.h>
 
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) &&

!defined(CONFIG_SPL_SERIAL_SUPPORT)

Quoted 9 lines

common/serial.c line 37

Quoted 6 lines
common/serial.c +6 -0
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

This isn't quite right. We need to allow for:
- No output SPL, strings collected (so #defined to do{} while (0))

Quoted 1 line

Which is not type-checked and will drag in bugs.

Not all that likely, since most code will either be built with printf enabled some of the time, or not contain printf (i.e. it's not quite the same situation as debug prints which may be rarely enabled).

Quoted 8 lines

An inline function would be fine, but has to be done at the same place that normal printf is declared -- whereas a macro could be done after the fact. Unless you use a macro to redirect it to an inline function of a different name...

I do not understand why you want to put these stubs in a C file instead of a header file, though -- you're preventing code from being optimized away, which is important in some SPLs.

I'd say the GCC must optimize it out anyway.

And if not, what solution do you suggest, move these into include/serial.h and compile serial.c in conditionally?

Quoted 1 line

-Scott

Best regards,
Marek Vasut

#112 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Quoted 58 lines · Marek Vasut

Dear Scott Wood,

Quoted 30 lines · Marek Vasut
Quoted 29 lines

Dear Tom Rini,

Quoted 19 lines · Marek Vasut
Quoted 18 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

---

 common/serial.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
common/serial.c +0 -0
index 631af65..cef4ba8 100644
@@ -27,6 +27,16 @@
 
Quoted 5 lines

common/serial.c

Quoted 5 lines
common/serial.c +2 -0
 #include <post.h>
 #include <linux/compiler.h>
 
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) &&

!defined(CONFIG_SPL_SERIAL_SUPPORT)

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

common/serial.c line 37

Quoted 6 lines
common/serial.c +6 -0
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

This isn't quite right. We need to allow for:
- No output SPL, strings collected (so #defined to do{} while

(0))

Quoted 4 lines
Quoted 2 lines

Which is not type-checked and will drag in bugs.

Not all that likely, since most code will either be built with

printf

Quoted 4 lines

enabled some of the time, or not contain printf (i.e. it's not quite the same situation as debug prints which may be rarely enabled).

An inline function would be fine, but has to be done at the same

place

Quoted 1 line

that normal printf is declared -- whereas a macro could be done

after

Quoted 1 line

the fact. Unless you use a macro to redirect it to an inline

function

Quoted 2 lines

of a different name...

Quoted 7 lines
Quoted 1 line

I do not understand why you want to put these stubs in a C file

instead

Quoted 1 line

of a header file, though -- you're preventing code from being

optimized

Quoted 1 line

away, which is important in some SPLs.

I'd say the GCC must optimize it out anyway.

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

-Scott

#113 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Scott Wood,

Quoted 78 lines · Marek Vasut
Quoted 77 lines

Dear Scott Wood,

Quoted 30 lines · Marek Vasut
Quoted 29 lines

Dear Tom Rini,

Quoted 19 lines · Marek Vasut
Quoted 18 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

---

 common/serial.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
common/serial.c +0 -0
index 631af65..cef4ba8 100644
@@ -27,6 +27,16 @@
 
Quoted 5 lines

common/serial.c

Quoted 5 lines
common/serial.c +2 -0
 #include <post.h>
 #include <linux/compiler.h>
 
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) &&

!defined(CONFIG_SPL_SERIAL_SUPPORT)

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

common/serial.c line 37

Quoted 6 lines
common/serial.c +6 -0
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

This isn't quite right. We need to allow for:
- No output SPL, strings collected (so #defined to do{} while

(0))

Quoted 3 lines
Quoted 1 line

Which is not type-checked and will drag in bugs.

Not all that likely, since most code will either be built with

printf

Quoted 4 lines

enabled some of the time, or not contain printf (i.e. it's not quite the same situation as debug prints which may be rarely enabled).

An inline function would be fine, but has to be done at the same

place

Quoted 1 line

that normal printf is declared -- whereas a macro could be done

after

Quoted 1 line

the fact. Unless you use a macro to redirect it to an inline

function

Quoted 3 lines

of a different name...

I do not understand why you want to put these stubs in a C file

instead

Quoted 1 line

of a header file, though -- you're preventing code from being

optimized

Quoted 1 line

away, which is important in some SPLs.

Quoted 7 lines
Quoted 1 line

I'd say the GCC must optimize it out anyway.

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

So the safest bet really is macro in serial.h ?

Quoted 1 line

-Scott

#114 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

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

Quoted 1 line · Marek Vasut

Dear Scott Wood,

[snip]

Quoted 11 lines
Quoted 5 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

- --
Tom

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

iQIcBAEBAgAGBQJQWL/mAAoJENk4IS6UOR1WwXQQAJXFmoGOjTxtuq1PMDYIEUSg mGwZUgjTDy3wrzVl8xkzuSeRYtqL/vFbThHDVoAiWXcQ2/4Mrcunl3v3UW+QV2ye KwESGqd05CIUEDxFqihOIKCR2KZHpUkt45Uf6SPOXfB4A0O7N9CuvyxPl2ZFHGxx ePFwopmX9gL7xO3u1cjAtxtmiCS22ulztW3ROU3+NTsVKA3k4AXW617tjpsPmQzJ L9N2LX49Z+UGDxh7YW/M4wcD50GlZFyIUY1COyhxeAQXmCXRMeDJdqxU1f3+SG1G fnWsBPoVdIJEv8XBr+ABNd4DYDZCWsTA7uklvkt2NDh64Lp+Nge5dD92fZJfrKoc NUWLhXN1U9ko9xbflxlBK94zkmtJfLfvtboK58frjv/H7MlSIuUzbgH4ixq/5ZOM g5pKFQ2YynrZ0yrjqH8I/v50GsziT+LpAiQnE62Yt2EQMkNCIC1zDz9ikg3MhL63 sxiZPi0mpcbvao6f6l0JIllMkvEWBnM4fGQCWMGGOkjbCqvkSnBNt4BhgAK2ZXuC kcLkdeOhszdWZxhfK+V0d5U+XQdIJoHdYyVC+6hAEd5iO4++gXgx+8feQV+ZQvSS 8iCdnobNp6XfM6agNOpkJto0+ROqEIyDSUzBAOb3+474fSWBjhhY7ievGxZiKikx mhsHRYG6ziEdOt4bkQ5H
=m9GH
-----END PGP SIGNATURE-----

#115 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Tom Rini,

Quoted 15 lines · Marek Vasut
Quoted 1 line

Dear Scott Wood,

[snip]

Quoted 10 lines
Quoted 5 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

Quoted 5 lines
Quoted 1 line

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

Yea ... the GCC bug, what a crap :-(

Best regards,
Marek Vasut

#116 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

In reply to Tom Rini

Dear Tom Rini,

Quoted 15 lines · Marek Vasut
Quoted 1 line

Dear Scott Wood,

[snip]

Quoted 10 lines
Quoted 5 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

Quoted 5 lines
Quoted 1 line

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

Damn, not much gain on m28evk (with C functionss/with macros), using gcc 4.7.1:

Configuring for m28evk board...
text data bss dec hex filename
418994 7780 288632 715406 aea8e ./u-boot
11773 788 12 12573 311d ./spl/u-boot-spl

Configuring for m28evk board...
text data bss dec hex filename
418998 7780 288628 715406 aea8e ./u-boot
11765 788 12 12565 3115 ./spl/u-boot-spl

Best regards,
Marek Vasut

#117 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

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

Quoted 26 lines · Marek Vasut

Dear Tom Rini,

Quoted 15 lines · Marek Vasut
Quoted 1 line

Dear Scott Wood,

[snip]

Quoted 10 lines
Quoted 5 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

Quoted 5 lines
Quoted 1 line

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

Damn, not much gain on m28evk (with C functionss/with macros), using gcc 4.7.1:

Quoted 7 lines

Configuring for m28evk board... text data bss dec hex
filename 418994 7780 288632 715406 aea8e ./u-boot 11773 788
12 12573 311d ./spl/u-boot-spl

Configuring for m28evk board... text data bss dec hex
filename 418998 7780 288628 715406 aea8e ./u-boot 11765 788
12 12565 3115 ./spl/u-boot-spl

Right, didn't have many strings. But do you see what I mean now about not needing this patch as it stands currently?

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

iQIcBAEBAgAGBQJQWMojAAoJENk4IS6UOR1Ws/EP/jx1vvg3N2gIlSVRfl6em3ul VwBi/tLW+mAlF3V/+Ge3h//U9gAef6uDbRlLUngxAvVuHQZZb7gqtf6T9Zw7DDu/ BFLSocaLi99rnEdwEZe4lApJnBP3pZEcLnHiKVvFN+lGSA7G6vEzJemawnxhFdKh B9MgtxgKEe3EUxdKj8rXaXvPUIO+NpQ/BcI2FLQrJfr8nH0mK6m1yNFEe3VYc64y 3dUTxr1ILS6O2uLvf1ErUdSi7YZOnkAwpyw+mTLF6weCJNisrDCrChjZibeBEtVN ZdH5ZkKckXegy3N6HM/tDuLGaO5spvxM797gS1tzqesPrMWy+ng9npFwqk6zxM8Y rtG6G0ddtAk0u6UCEDvoQiYPciNY4F+YhuhesVXZVUe7l09XbZdiDLHXlqR34hVo 9H1qPCfi7DmvRR/mArG4URc9TkbsjsQkZp1s1/3jDFlM6xenM+2SdTy3ncrsMwmx Ri92BjdOE+VQSdgqexV660yjNB3qYn2AC7/dtgNhaZA7/+p7XSip3NnjTmTr7buL xoo8sse/sr8viGDCyyWf8Bv/sOvc5pqR0SYu3187BkgkMlAv3Se/lwNT/r+lPqFd K0w69mMqN+WNEQYHkisE2bKGsuKCWOLt/KTFvDNXQJZsxa4uE2lbNSTXzStsGcAw rh+d7dV2ylpGxRccUYDb
=dyAB
-----END PGP SIGNATURE-----

#118 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Tom Rini,

Quoted 31 lines · Marek Vasut
Quoted 30 lines

Dear Tom Rini,

Quoted 15 lines · Marek Vasut
Quoted 1 line

Dear Scott Wood,

[snip]

Quoted 10 lines
Quoted 5 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

Quoted 5 lines
Quoted 1 line

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

Damn, not much gain on m28evk (with C functionss/with macros), using gcc 4.7.1:

Configuring for m28evk board... text data bss dec hex
filename 418994 7780 288632 715406 aea8e ./u-boot 11773 788
12 12573 311d ./spl/u-boot-spl

Quoted 6 lines
Quoted 3 lines

Configuring for m28evk board... text data bss dec hex
filename 418998 7780 288628 715406 aea8e ./u-boot 11765 788
12 12565 3115 ./spl/u-boot-spl

Right, didn't have many strings. But do you see what I mean now about not needing this patch as it stands currently?

No, I don't. If I remove this patch, the build breaks either because serial_* is defined twice or not defined at all.

Best regards,
Marek Vasut

#119 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

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

Quoted 38 lines · Marek Vasut

Dear Tom Rini,

Quoted 36 lines · Marek Vasut
Quoted 34 lines

Dear Tom Rini,

Quoted 16 lines · Marek Vasut
Quoted 1 line

Dear Scott Wood,

[snip]

Quoted 11 lines
Quoted 6 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

Quoted 5 lines
Quoted 1 line

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

Damn, not much gain on m28evk (with C functionss/with macros), using gcc 4.7.1:

Configuring for m28evk board... text data bss dec
hex filename 418994 7780 288632 715406 aea8e ./u-boot
11773 788 12 12573 311d ./spl/u-boot-spl

Configuring for m28evk board... text data bss dec
hex filename 418998 7780 288628 715406 aea8e ./u-boot
11765 788 12 12565 3115 ./spl/u-boot-spl

Quoted 5 lines
Quoted 2 lines

Right, didn't have many strings. But do you see what I mean now about not needing this patch as it stands currently?

No, I don't. If I remove this patch, the build breaks either because serial_* is defined twice or not defined at all.

m28evk currently, needlessly, defines serial_puts/putc. I locally patched master to drop them from arch/arm/cpu/arm926ejs/mxs/spl_boot.c and the references in common/libcommon.o are correctly garbage-collected. They are in fact unused functions today as they're garbage collected without patching, see spl/u-boot-spl.map after building. So again I say, if common/serial.o is NOT being discard in your series on m28evk there is a bug in your series to fix or a change to better understand and document (and then see if we can change since as Scott notes, this needs to work for 4kb boards and that is tight).

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

iQIcBAEBAgAGBQJQWN59AAoJENk4IS6UOR1WtG0P/iYMxTtr0X/F6RRhZ9sLlSNt pj6o+MTd9eO4e64+0A/jyXDuFd9NBvYdsjBKz8iyQFOrUYAyCdKdl+MZ+E3sD57O gHKVXcfnMS2jnXTvKMabn4Ddjl8FVjLz+YGXFcwqBpcN5KjuyRKJnl4jntrj8QgK 1d9aqYwnQcMbP36ApPS1WRGotAlydhmL9Bw++ebk+j28iBs1KZWiFK1RUCYc1b5T bverqK4EQTMxOh8KJNvGs5J61bO1BUA3fWHv2kzKo4XEr+XjRkoFVXDb1Tjf1Xlw ZDaaky+zyq7D4zwZUFJxseDN7dBTuAYNoYj5UhYvkbTO04s60vKzhyuLMDWxyHrx ABrmisfWB44K6sjQKZUTBvO6gajA8fe9kTg/uaMaG+9h9xyM0oNBfDmDd7/CK6PE Mi7q9TJ7cOh1DgHrzSrLaO8n5cam4B3XecLH5Rj1uOA5HHCnKExIxWTdeEg4w63b VQVdgQ7g/2x8TINdjz9oo1B79n+yHlmIHzc64ZNnBAJhVDKM9h9h6FarAvfwLM1B Ns/vUCrM17vsaduNcvD0ZGDZSk4MOc8dfPLqfLe9rzFH4VAEmTV8qEaFjnbeORiD jknV1mLAYD1A/eu1AHdwE58OgPgCTKyYxLA4bE/Yldxy1L+E5DUx+nmOnrCNWPPm dqdGjBg7P4HHZo2mw6oZ
=QI/g
-----END PGP SIGNATURE-----

#120 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Tom Rini,

Quoted 45 lines · Marek Vasut
Quoted 38 lines

Dear Tom Rini,

Quoted 36 lines · Marek Vasut
Quoted 34 lines

Dear Tom Rini,

Quoted 16 lines · Marek Vasut
Quoted 1 line

Dear Scott Wood,

[snip]

Quoted 11 lines
Quoted 6 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

Quoted 5 lines
Quoted 1 line

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

Damn, not much gain on m28evk (with C functionss/with macros), using gcc 4.7.1:

Configuring for m28evk board... text data bss dec
hex filename 418994 7780 288632 715406 aea8e ./u-boot
11773 788 12 12573 311d ./spl/u-boot-spl

Configuring for m28evk board... text data bss dec
hex filename 418998 7780 288628 715406 aea8e ./u-boot
11765 788 12 12565 3115 ./spl/u-boot-spl

Quoted 5 lines
Quoted 2 lines

Right, didn't have many strings. But do you see what I mean now about not needing this patch as it stands currently?

No, I don't. If I remove this patch, the build breaks either because serial_* is defined twice or not defined at all.

Quoted 6 lines

m28evk currently, needlessly, defines serial_puts/putc. I locally patched master to drop them from arch/arm/cpu/arm926ejs/mxs/spl_boot.c and the references in common/libcommon.o are correctly garbage-collected. They are in fact unused functions today as they're garbage collected without patching, see spl/u-boot-spl.map after building.

I'd love to, this is what I get with my patchset when I remove the #ifdef from serial.c:

$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- ./MAKEALL m28evk
Configuring for m28evk board...
make[1]: *** [/home/marex/U-Boot/u-boot-marex/spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl.bin] Error 2
arm-linux-gnueabi-size: './u-boot': No such file
common/libcommon.o: In function `get_current':
/home/marex/U-Boot/u-boot-marex/common/serial.c:229: undefined reference to 
`default_serial_console'
make[1]: *** [/home/marex/U-Boot/u-boot-marex/spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl.bin] Error 2
make: *** Waiting for unfinished jobs....

So someone still has to implement default_serial_console() call. Is that fine ?

Quoted 3 lines

So again I say, if common/serial.o is NOT being discard in your series on m28evk there is a bug in your series to fix or a change to better understand and document

Ok, I spent hours documenting this series. What else is there to document?

Besides, my team is starting to collect dead weight and we're running behind the schedule a lot ... I'm fucked, I'm desperate and I really don't know what to do anymore. Pardon if I'm a bit unpleasant to deal with recently.

Quoted 2 lines

(and then see if we can change since
as Scott notes, this needs to work for 4kb boards and that is tight).

What exactly are the 4k boards?

One more question -- if I have two __weak functions and one non-weak, the non- weak wins and noone complains, right?

Best regards,
Marek Vasut

#121 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Quoted 7 lines · Marek Vasut

Dear Tom Rini,

Quoted 2 lines

(and then see if we can change since
as Scott notes, this needs to work for 4kb boards and that is

tight).

What exactly are the 4k boards?

Anything that uses fsl_elbc_nand is 4K. I think most (all?) of the ppc 4xx boards are 4K. fsl_ifc_nand is 8K, though the linker script needs some rework to fully take advantage of that.

At least some of the i.MX boards have constraints but I don't know exactly what they are.

Maybe some others.

-Scott

#122 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Quoted 8 lines · Scott Wood
Quoted 5 lines
Quoted 2 lines

(and then see if we can change since
as Scott notes, this needs to work for 4kb boards and that is

tight).

What exactly are the 4k boards?

Anything that uses fsl_elbc_nand is 4K. I think most (all?) of the ppc 4xx boards are 4K.

Yes. All ppc4xx boards with "old" nand_spl support are 4KiB. And they don't use serial at all right now.

Thanks,
Stefan

#123 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Quoted 5 lines · Stefan Roese
Quoted 4 lines · Scott Wood
Quoted 4 lines
Quoted 2 lines

(and then see if we can change since
as Scott notes, this needs to work for 4kb boards and that is

tight).

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

What exactly are the 4k boards?

Anything that uses fsl_elbc_nand is 4K. I think most (all?) of the

ppc

Quoted 1 line

4xx boards are 4K.

Yes. All ppc4xx boards with "old" nand_spl support are 4KiB. And they don't use serial at all right now.

The FSL 4K boards use serial (but not printf) with CONFIG_NS16550_MIN_FUNCTIONS.

-Scott

#124 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

In reply to Tom Rini

Dear Tom Rini,

Quoted 45 lines · Marek Vasut
Quoted 38 lines

Dear Tom Rini,

Quoted 36 lines · Marek Vasut
Quoted 34 lines

Dear Tom Rini,

Quoted 16 lines · Marek Vasut
Quoted 1 line

Dear Scott Wood,

[snip]

Quoted 11 lines
Quoted 6 lines

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

But if you point them to stubs, that's OK. The compiler will GC these useless stubs anyway. But wait, we're getting to LTO here, right?

Quoted 5 lines
Quoted 1 line

So the safest bet really is macro in serial.h ?

Due to the gcc bug I've mentioned before, yes. Dummy functions will, I bet, keep the string constants around. do {} while(0) will drop them out entirely.

Damn, not much gain on m28evk (with C functionss/with macros), using gcc 4.7.1:

Configuring for m28evk board... text data bss dec
hex filename 418994 7780 288632 715406 aea8e ./u-boot
11773 788 12 12573 311d ./spl/u-boot-spl

Configuring for m28evk board... text data bss dec
hex filename 418998 7780 288628 715406 aea8e ./u-boot
11765 788 12 12565 3115 ./spl/u-boot-spl

Quoted 5 lines
Quoted 2 lines

Right, didn't have many strings. But do you see what I mean now about not needing this patch as it stands currently?

No, I don't. If I remove this patch, the build breaks either because serial_* is defined twice or not defined at all.

Quoted 9 lines

m28evk currently, needlessly, defines serial_puts/putc. I locally patched master to drop them from arch/arm/cpu/arm926ejs/mxs/spl_boot.c and the references in common/libcommon.o are correctly garbage-collected. They are in fact unused functions today as they're garbage collected without patching, see spl/u-boot-spl.map after building. So again I say, if common/serial.o is NOT being discard in your series on m28evk there is a bug in your series to fix or a change to better understand and document (and then see if we can change since as Scott notes, this needs to work for 4kb boards and that is tight).

Ok, so we cleared this up on jabber, latest ToT works correctly, discard this patch.

Best regards,
Marek Vasut

#125 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

In reply to Marek Vasut
Quoted 11 lines · Marek Vasut

Dear Scott Wood,

Quoted 8 lines · Marek Vasut
Quoted 1 line

I'd say the GCC must optimize it out anyway.

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

Quoted 5 lines

But if you point them to stubs, that's OK. The compiler will GC these useless
stubs anyway. But wait, we're getting to LTO here, right?

So the safest bet really is macro in serial.h ?

For printf/puts, we want something header-based. For the serial functions it depends on whether we have call sites that do not get GCed.

-Scott

#126 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Scott Wood,

Quoted 12 lines · Marek Vasut
Quoted 11 lines

Dear Scott Wood,

Quoted 8 lines · Marek Vasut
Quoted 1 line

I'd say the GCC must optimize it out anyway.

I think I got some wires crossed and was thinking about printf/puts. We want those to be optimized away at compile time (not pointed to a stub at link time) on an SPL that has no output support, but once that's done the low level serial functions shouldn't be referenced anymore, right?

Quoted 8 lines
Quoted 5 lines

But if you point them to stubs, that's OK. The compiler will GC these useless
stubs anyway. But wait, we're getting to LTO here, right?

So the safest bet really is macro in serial.h ?

For printf/puts, we want something header-based. For the serial functions it depends on whether we have call sites that do not get GCed.

I'm not removing printf() puts() etc. .. only the serial_ goo ... and see my other email, not much gain :(

Quoted 1 line

-Scott

Best regards,
Marek Vasut

#127 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

In reply to Marek Vasut

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

Quoted 30 lines · Marek Vasut

Dear Tom Rini,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

<[email protected]> Cc: Tom Rini <[email protected]> ---

common/serial.c | 12 ++++++++++++ 1 file changed, 12
insertions(+)

common/serial.c index renamed from common/serial.c +0 -0

631af65..cef4ba8 100644 --- a/common/serial.c +++
b/common/serial.c @@ -27,6 +27,16 @@

#include <post.h> #include <linux/compiler.h>

Quoted 10 lines
Quoted 7 lines
common/serial.c index renamed from common/serial.c +2 -0
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) && 

!defined(CONFIG_SPL_SERIAL_SUPPORT) +int serial_init(void) { return 0; } +void serial_setbrg(void) {} +int serial_getc(void) { return 0; } +int serial_tstc(void) { return 0; } +void serial_putc(const char c) {} +void serial_puts(const char *s) {}

This isn't quite right. We need to allow for: - No output SPL, strings collected (so #defined to do{} while (0))

Quoted 1 line

Which is not type-checked and will drag in bugs.

Scott has addressed this.

Quoted 4 lines
Quoted 4 lines

- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT + CONFIG_SPL_LIBCOMMON_SUPPORT) - puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts serial_puts/putc).

Quoted 8 lines
Quoted 5 lines

I'm not asking you to do that, but you will have to adapt to it once Jose is done with it. What that means, off the top of my head, is we can just drop this patch as in the first and last case serial.o will be garbage-collected (or not built) and in the middle case, this will be fully used.

I can't drop this patch as it will break all of SPL when CONFIG_SERIAL_MULTI is unconditionally enabled.

Why is it breaking _all_ of SPL? Have you run-tested this anywhere, especially with SPL? In most cases it should be used and real functions provided or garbage collected away.

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

iQIcBAEBAgAGBQJQWLUQAAoJENk4IS6UOR1WxoAP/3Lto025hWPgi7obJR1nrl63 r84gfCPkVsjqWHmYJl+vFOlyTuEiXaW9K5PWNxRA7xXbm5GbBe90fZBdYVxCSh+f 7KuSJ5jBEItmma9eeva7Af8FRtoC487yM9MpAOUKQ2pKsOiPR7lbiGQamHvWUssA 1BQfALQSlWgdlsk93EHXwxRoQD97ojAfCWPybObpd0C3oYUHVPhOYHS9NtLiRr8e L58e7XhPksxNEyx29qrbmSwFGE8a4zSeu9SHjCfVk9Z2j2cD0zXpgqbwTe8/U259 31KUoRoLpqbSfOl4jcmZ54lyWZNbh1p45cyZAtOy4JJE99YkE951p342wC7sseQM AtGqWQidKvHszpiSFkhu2pbTHQbTZfnYA4cvKL4x5S6zXKLEk/Ybfn9RTXQpdnaQ 6yUeYLjHl3bXeVb/JhtD5oouzyCfQmDyVnS4CUTAD4rVBS1CNpjpLa/mDoAcZNJr zFLtkBW/72toOV7Xy2YsLtiWvw3bL6gKeKueegX5vHRBIx9csHWB3SZc7qMCZyIW xk3CIhJEru/RsWMAqynCX5lfRSuw2+Zflnq5YJnqeVRY2mdasXewLsvhW2iRRn7n C/Wf43wU782RK/8KbBYlokiDjV5egipxccW3lOIAr1HtvSQNfQgUDrum4opx+Jrw nbA1JTydUvu0YSzId43A
=Lc/6
-----END PGP SIGNATURE-----

#128 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Tom Rini,

Quoted 45 lines · Marek Vasut
Quoted 30 lines

Dear Tom Rini,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

<[email protected]> Cc: Tom Rini <[email protected]> ---

common/serial.c | 12 ++++++++++++ 1 file changed, 12
insertions(+)

common/serial.c index renamed from common/serial.c +0 -0

631af65..cef4ba8 100644 --- a/common/serial.c +++
b/common/serial.c @@ -27,6 +27,16 @@

#include <post.h> #include <linux/compiler.h>

Quoted 10 lines
Quoted 7 lines
common/serial.c index renamed from common/serial.c +2 -0
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) &&

!defined(CONFIG_SPL_SERIAL_SUPPORT) +int serial_init(void) { return 0; } +void serial_setbrg(void) {} +int serial_getc(void) { return 0; } +int serial_tstc(void) { return 0; } +void serial_putc(const char c) {} +void serial_puts(const char *s) {}

This isn't quite right. We need to allow for: - No output SPL, strings collected (so #defined to do{} while (0))

Quoted 1 line

Which is not type-checked and will drag in bugs.

Scott has addressed this.

Quoted 10 lines
Quoted 9 lines

- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT + CONFIG_SPL_LIBCOMMON_SUPPORT) - puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts serial_puts/putc).

I'm not asking you to do that, but you will have to adapt to it once Jose is done with it. What that means, off the top of my head, is we can just drop this patch as in the first and last case serial.o will be garbage-collected (or not built) and in the middle case, this will be fully used.

Quoted 6 lines
Quoted 2 lines

I can't drop this patch as it will break all of SPL when CONFIG_SERIAL_MULTI is unconditionally enabled.

Why is it breaking _all_ of SPL? Have you run-tested this anywhere, especially with SPL? In most cases it should be used and real functions provided or garbage collected away.

Yes, try compiling m28evk without this patch for example, it's going to break it. Because CONFIG_SPL_SERIAL_SUPPORT is disabled, yet it uses code that contains references to puts() etc.

Best regards,
Marek Vasut

#129 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

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

Quoted 50 lines · Marek Vasut

Dear Tom Rini,

Quoted 48 lines · Marek Vasut
Quoted 30 lines

Dear Tom Rini,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

<[email protected]> Cc: Tom Rini <[email protected]> ---

common/serial.c | 12 ++++++++++++ 1 file changed, 12
insertions(+)

common/serial.c index renamed from common/serial.c +0 -0

631af65..cef4ba8 100644 --- a/common/serial.c +++ b/common/serial.c @@ -27,6 +27,16 @@

#include <post.h> #include <linux/compiler.h>

Quoted 10 lines
Quoted 7 lines
common/serial.c index renamed from common/serial.c +2 -0
+/* Implement prototypes for SPL without serial support */ 
+#if defined(CONFIG_SPL_BUILD) && 

!defined(CONFIG_SPL_SERIAL_SUPPORT) +int serial_init(void) { return 0; } +void serial_setbrg(void) {} +int serial_getc(void) { return 0; } +int serial_tstc(void) { return 0; } +void serial_putc(const char c) {} +void serial_puts(const char *s) {}

This isn't quite right. We need to allow for: - No output SPL, strings collected (so #defined to do{} while (0))

Quoted 1 line

Which is not type-checked and will drag in bugs.

Scott has addressed this.

Quoted 12 lines
Quoted 9 lines

- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT + CONFIG_SPL_LIBCOMMON_SUPPORT) - puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts serial_puts/putc).

I'm not asking you to do that, but you will have to adapt to it once Jose is done with it. What that means, off the top of my head, is we can just drop this patch as in the first and last case serial.o will be garbage-collected (or not built) and in the middle case, this will be fully used.

I can't drop this patch as it will break all of SPL when CONFIG_SERIAL_MULTI is unconditionally enabled.

Quoted 7 lines
Quoted 3 lines

Why is it breaking _all_ of SPL? Have you run-tested this anywhere, especially with SPL? In most cases it should be used and real functions provided or garbage collected away.

Yes, try compiling m28evk without this patch for example, it's going to break it. Because CONFIG_SPL_SERIAL_SUPPORT is disabled, yet it uses code that contains references to puts() etc.

Progress! Now, why isn't this file being garbage collected? m28evk is fitting into the first category I said (no output) but now it's not discarding things that it should be discarding.

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

iQIcBAEBAgAGBQJQWLifAAoJENk4IS6UOR1WyiIP/1h3r1OBQ8sxHCq6nuWT7cvQ 6taDBU6780uOY+YsbNgjlImp7lSM30HYxXou2j2kykPcRjUPMzLoYDRZio+8d8RW ETQcMld8I/OMz52HT6lnjIaqVBOpK42vlRW86LNcxIFOasYlK4qxO3kjKmshu5aC ct7b5xcHFaqfxLp2EjkUOgmoyPXhNTdsnDVdOTaXG7qGKAffDFCeUHTsBB3kc/S6 w5HwDNTBWZYVMWuTXKXLXh+3h4x+VL1LCxCsnu8R88cEkj7b9DkqGUsUrCDPFqc/ YAqiUqacTa0V9h9XeE/OdZUo7uS04FibPHzvho91LcnBdjOJ7jPLY7k/IJ7guhqp aRC9UrB/AAPkpLExo32Ksx+7wAJThsfWY6DL5oI76E4FYZP2WaqygBM/WDCbcOK7 6HIGItjGwFpXBCDbawKob395Kt5gK2J43qXR2E7CR4p3ic8liMqsWu5J+TCUVF6b jxjLZ22Bw5zolUkhUE5u+M+O/rxCjYG0HNTssC1ymYR/jU36p1m6oGqxVN8Voi0R 1ARQB2yY3uuQOqR1URZMzuA94d1Qffnhg3LwSm3cJRH825WNDkxEXq/hvK/4hLbH DXb79+zRqv7f80jPUEk60sKFI3YzJMvRBaaxjXqOkMFywaNMQjbsnXCmvztoqRqG A1gmJGTWixOQbrN56DjF
=wRYN
-----END PGP SIGNATURE-----

#130 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

Dear Tom Rini,

Quoted 55 lines · Marek Vasut
Quoted 54 lines

Dear Tom Rini,

Quoted 51 lines · Marek Vasut
Quoted 30 lines

Dear Tom Rini,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

<[email protected]> Cc: Tom Rini <[email protected]> ---

common/serial.c | 12 ++++++++++++ 1 file changed, 12
insertions(+)

common/serial.c index renamed from common/serial.c +0 -0

631af65..cef4ba8 100644 --- a/common/serial.c +++ b/common/serial.c @@ -27,6 +27,16 @@

#include <post.h> #include <linux/compiler.h>

Quoted 10 lines
Quoted 7 lines
common/serial.c index renamed from common/serial.c +2 -0
+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) &&

!defined(CONFIG_SPL_SERIAL_SUPPORT) +int serial_init(void) { return 0; } +void serial_setbrg(void) {} +int serial_getc(void) { return 0; } +int serial_tstc(void) { return 0; } +void serial_putc(const char c) {} +void serial_puts(const char *s) {}

This isn't quite right. We need to allow for: - No output SPL, strings collected (so #defined to do{} while (0))

Quoted 1 line

Which is not type-checked and will drag in bugs.

Scott has addressed this.

Quoted 4 lines
Quoted 4 lines

- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT + CONFIG_SPL_LIBCOMMON_SUPPORT) - puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts serial_puts/putc).

Quoted 8 lines
Quoted 5 lines

I'm not asking you to do that, but you will have to adapt to it once Jose is done with it. What that means, off the top of my head, is we can just drop this patch as in the first and last case serial.o will be garbage-collected (or not built) and in the middle case, this will be fully used.

I can't drop this patch as it will break all of SPL when CONFIG_SERIAL_MULTI is unconditionally enabled.

Why is it breaking _all_ of SPL? Have you run-tested this anywhere, especially with SPL? In most cases it should be used and real functions provided or garbage collected away.

Quoted 5 lines
Quoted 3 lines

Yes, try compiling m28evk without this patch for example, it's going to break it. Because CONFIG_SPL_SERIAL_SUPPORT is disabled, yet it uses code that contains references to puts() etc.

Progress! Now, why isn't this file being garbage collected?

What file?

Quoted 3 lines

m28evk
is fitting into the first category I said (no output) but now it's not discarding things that it should be discarding.

What is not discarding things and what things should be discarded? I believe if you're missing symbols, the compiler will error-out. Always.

Best regards,
Marek Vasut

#131 lore raw

PATCH 62/71 serial: spl: Implement empty functions for SPL

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

Quoted 63 lines · Marek Vasut

Dear Tom Rini,

Quoted 61 lines · Marek Vasut
Quoted 60 lines

Dear Tom Rini,

Quoted 57 lines · Marek Vasut
Quoted 34 lines

Dear Tom Rini,

Quoted 19 lines
Quoted 17 lines · Marek Vasut

Implement empty serial_* functions for SPL without serial support enabled. This is imperative to haave once serial multi is enabled unconditionally.

Vasut <[email protected]> Cc: Tom Rini <[email protected]> ---

common/serial.c | 12 ++++++++++++ 1 file changed, 12
insertions(+)

common/serial.c index renamed from common/serial.c +0 -0

631af65..cef4ba8 100644 --- a/common/serial.c +++ b/common/serial.c @@ -27,6 +27,16 @@

#include <post.h> #include <linux/compiler.h>

Quoted 12 lines
Quoted 8 lines

+/* Implement prototypes for SPL without serial support */ +#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT) +int serial_init(void) { return 0; } +void serial_setbrg(void) {} +int serial_getc(void) { return 0; } +int serial_tstc(void) { return 0; } +void serial_putc(const char c) {} +void serial_puts(const char *s) {}

This isn't quite right. We need to allow for: - No output SPL, strings collected (so #defined to do{} while (0))

Quoted 1 line

Which is not type-checked and will drag in bugs.

Scott has addressed this.

Quoted 12 lines
Quoted 11 lines

- puts + printf SPL (CONFIG_SPL_SERIAL_SUPPORT + CONFIG_SPL_LIBCOMMON_SUPPORT) - puts only SPL (CONFIG_SPL_SERIAL_SUPPORT + #define puts serial_puts/putc).

I'm not asking you to do that, but you will have to adapt to it once Jose is done with it. What that means, off the top of my head, is we can just drop this patch as in the first and last case serial.o will be garbage-collected (or not built) and in the middle case, this will be fully used.

Quoted 2 lines

I can't drop this patch as it will break all of SPL when CONFIG_SERIAL_MULTI is unconditionally enabled.

Why is it breaking _all_ of SPL? Have you run-tested this anywhere, especially with SPL? In most cases it should be used and real functions provided or garbage collected away.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Yes, try compiling m28evk without this patch for example, it's going to break it. Because CONFIG_SPL_SERIAL_SUPPORT is disabled, yet it uses code that contains references to puts() etc.

Progress! Now, why isn't this file being garbage collected?

What file?

common/serial.o since as you point out, m28evk doesn't define any way to do output.

Quoted 6 lines
Quoted 2 lines

m28evk is fitting into the first category I said (no output) but now it's not discarding things that it should be discarding.

What is not discarding things and what things should be discarded? I believe if you're missing symbols, the compiler will error-out. Always.

Nope. This is fine:
gc_this_function(void) {
never_define_this_at_link();
return;
}

And nothing calling gc_this_function means that it's fine that never_define_this_at_link isn't seen by the linker.

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

iQIcBAEBAgAGBQJQWL7QAAoJENk4IS6UOR1W+KgP/jjDmO3c+WfYqEjuEjLMjSAW qTLZOLdsmsU7HoFa+/fWNgmvvmcJlTgqzo0z5izku2d0xx8TO3R6rpZa9weHXhr1 yuKs+CzP/6A1Kntd8VC0SRUU+Rb4onPPoY0kw0QDL01zug5DBEu+saI08CJRrtki DLzayRPNoTcppffp1r2nstyAJJWvuYcFO4A3wzR3h5U1lQNHK7Yt8KRtmCFQW1d1 Y98ikHi75PDcSZDjj60OHVhNtaDDcLUu2NWAXrf4gI13WLPxcNXHRTq1uufY38Pv fNd5wqrC7qDq7I6uomwuy+b6aDYYPqsrh9T/h/tjWO235mA+7Dnkl2qvHrYOOcV6 1zBef8M+vuawVWYZnsJO4k1Cg2Ci9Gl4sPqJVYaSnhhXjQawZbztQpT1P4tN1DEG 8r7mpt6bWGG1nnEgiNWvFZvv798sj2Lh/T0yxAsnX9CgnlxZ7lh+uqirMmUJeUKB aWiuDJIMqQORXcJIO1tDwtL+2EA5CxofLa11Y0tpT0r2G0cOsQQQfJTQ6K9p4KhB gkOhRmlPQs12WV+9r6LWuUqDRuIbMjOUHfNOf9eZfKTvptMMRhwT1zCVBdMVwbwO 3e/WpNTDjRLpqj08bs6OHOVO7GvXXtZJGHJJGlJ3a49pHMnqNUjBGSajDYJyHL0O /75PPDTIXSrUJw1anFC8
=yREs
-----END PGP SIGNATURE-----

#132 lore raw

PATCH 63/71 serial: mxs: spl: Remove empty serial_* functions from SPL code

In reply to Marek Vasut

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

Cc Marek Vasut <[email protected]>
Cc Tom Rini <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/arm926ejs/mxs/spl_boot.c |    4 ----
 1 file changed, 4 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_boot.c +0 -4
index ddafddb..51b8625 100644
@@ -122,10 +122,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
#133 lore raw

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

In reply to Marek Vasut

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

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

PATCH 65/71 serial: Use puts() and hang() instead of panic() in SPL

In reply to Marek Vasut

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

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

---
 common/serial.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
common/serial.c +8 -2
index cef4ba8..8e0d8a1 100644
@@ -230,8 +230,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
#135 lore raw

PATCH 66/71 serial: Unconditionally enable CONFIG_SERIAL_MULTI

In reply to Marek Vasut

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

---
 common/Makefile |    2 +-
 config.mk       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/Makefile +1 -1
index 57da76f..8b1ee5d 100644
@@ -32,7 +32,6 @@ COBJS-y += command.o
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += s_record.o
-COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
 COBJS-y += xyzModem.o
 
 # core command
@@ -195,6 +194,7 @@ COBJS-y += dlmalloc.o
 COBJS-y += image.o
 COBJS-y += memsize.o
 COBJS-y += stdio.o
+COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
 
 
 COBJS	:= $(sort $(COBJS-y))
config.mk +1 -1
index c3822a2..88c72f1 100644
@@ -193,7 +193,7 @@ OBJCFLAGS += --gap-fill=0xff
 gccincdir := $(shell $(CC) -print-file-name=include)
 
 CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)		\
-	-D__KERNEL__
+	-D__KERNEL__ -DCONFIG_SERIAL_MULTI
 
 # Enable garbage collection of un-used sections for SPL
 ifeq ($(CONFIG_SPL_BUILD),y)
Signature · 1 line
1.7.10.4
#136 lore raw

PATCH 67/71 serial: Remove CONFIG_SERIAL_MULTI from config files

In reply to Marek Vasut

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

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