Commit f0eb1f61b02ebd5c86c1db4399f7d78518377910

Authored by Marek Vasut
Committed by Tom Rini
1 parent 2a333aeb8f

serial: mpc8xx: Move serial registration from serial_initialize()

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.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>

Showing 2 changed files with 14 additions and 8 deletions Side-by-side Diff

arch/powerpc/cpu/mpc8xx/serial.c
... ... @@ -681,6 +681,17 @@
681 681 #endif
682 682 }
683 683  
  684 +void mpc8xx_serial_initialize(void)
  685 +{
  686 +#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2)
  687 + serial_register(&serial_smc_device);
  688 +#endif
  689 +#if defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) || \
  690 + defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
  691 + serial_register(&serial_scc_device);
  692 +#endif
  693 +}
  694 +
684 695 #ifdef CONFIG_MODEM_SUPPORT
685 696 void disable_putc(void)
686 697 {
... ... @@ -40,6 +40,8 @@
40 40 void name(void) \
41 41 __attribute__((weak, alias("serial_null")));
42 42  
  43 +serial_initfunc(mpc8xx_serial_initialize);
  44 +
43 45 void serial_register(struct serial_device *dev)
44 46 {
45 47 #ifdef CONFIG_NEEDS_MANUAL_RELOC
... ... @@ -57,14 +59,7 @@
57 59  
58 60 void serial_initialize(void)
59 61 {
60   -#if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2)
61   - serial_register(&serial_smc_device);
62   -#endif
63   -#if defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) || \
64   - defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
65   - serial_register(&serial_scc_device);
66   -#endif
67   -
  62 + mpc8xx_serial_initialize();
68 63 #if defined(CONFIG_SYS_NS16550_SERIAL)
69 64 #if defined(CONFIG_SYS_NS16550_COM1)
70 65 serial_register(&eserial1_device);