[U-Boot] [PATCH 00/72 V3] serial: Massive rework of the serial subsystem

Marek Vasut marex at denx.de
Sat Sep 29 23:51:53 CEST 2012


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

The idea of this patchset is:

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

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

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

Configuring for P1020RDB-PC_36BIT_SPIFLASH - Board: p1_p2_rdb_pc, Options: P1020RDB,36BIT,SPIFLASH
   text    data     bss     dec     hex filename
 392469   30628  267568  690665   a89e9 ./u-boot
 394550   30940  267600  693090   a9362 ./u-boot

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

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

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

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

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

Cc: Tom Rini <trini at ti.com>
Cc: Anatolij Gustschin <agust at denx.de>
Cc: Stefan Roese <sr at denx.de>
Cc: Mike Frysinger <vapier at gentoo.org>
Cc: Michal Simek <monstr at monstr.eu>
Cc: U-Boot DM <u-boot-dm at lists.denx.de>

-- 
1.7.10.4



More information about the U-Boot mailing list