public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 0/16] Introduce driver model serial uclass
@ 2014-07-30  9:49 Simon Glass
  2014-07-30  9:49 ` [U-Boot] [PATCH v3 01/16] serial: Set up the 'priv' pointer when creating a serial device Simon Glass
                   ` (15 more replies)
  0 siblings, 16 replies; 42+ messages in thread
From: Simon Glass @ 2014-07-30  9:49 UTC (permalink / raw)
  To: u-boot

This series adds support for a serial uclass, enabling serial drivers to be
converted to use driver model.

Unfortunately this is quite a complicated process for a number of reasons:

- serial is used before relocation, but driver model does not support this
- stdio member functions are not passed a device pointer, but driver model
    requires this (so does serial, but it uses an ugly work-around)
- driver model requires malloc() but this is not available before
  relocation
- for sandbox, if something goes wrong with the console, we still need to
  get an error message out through the fallback console

So this series relies on quite a few patches to address the above, as well
as the serial uclass and an implementation for sandbox.

If you have limited time, please take a look at least at the uclass patch
which is 'dm: Add a uclass for serial devices' (see include/serial.h).

With v3, exynos boards all build and an attempt has been made to add Tegra
support via the ns16550 driver. This is so-far untested but is offered for
review.

To see the current state of driver model, look at u-boot-dm.git branch
'working'.

Changes in v3:
- Add new change to enhance lists_bind_fdt()
- Add new patch for tegra serial port details
- Add new patch to collect common baud rate code in ns16550
- Add new patch to enable driver model for seial on tegra
- Add new patch to move baud rate calculation to ns16550.c
- Add new patch to support driver model in ns16550
- Add new patch to use V_NS16550_CLK only in SPL builds
- Automatically bind the console even if not marked for pre-relocation
- Avoid reordering functions
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'
- Fix typo in commit message

Changes in v2:
- Add exynos serial support
- Remove RFC status
- Rename struct device to struct udevice
- Split out core driver model patches into a separate set

Simon Glass (16):
  serial: Set up the 'priv' pointer when creating a serial device
  dm: Adjust lists_bind_fdt() to return the bound device
  dm: Add a uclass for serial devices
  Set up stdio earlier when using driver model
  sandbox: Convert serial driver to use driver model
  sandbox: serial: Support a coloured console
  sandbox: dts: Add a serial console node
  dm: exynos: Mark exynos5 console as pre-reloc
  dm: exynos: Move serial to driver model
  dm: Make driver model available before board_init()
  dm: serial: Move baud rate calculation to ns16550.c
  dm: serial: Collect common baud rate code in ns16550
  dm: serial: Add driver model support for ns16550
  tegra: dts: Add serial port details
  RFC: dm: tegra: Enable driver model for serial
  dm: tegra: Use V_NS16550_CLK only in SPL builds

 arch/arm/dts/exynos5.dtsi                   |   1 +
 arch/arm/dts/tegra114-dalmore.dts           |   1 +
 arch/arm/dts/tegra114.dtsi                  |  40 +++++
 arch/arm/dts/tegra124-jetson-tk1.dts        |   1 +
 arch/arm/dts/tegra124-venice2.dts           |   1 +
 arch/arm/dts/tegra124.dtsi                  |  40 +++++
 arch/arm/dts/tegra20-colibri_t20_iris.dts   |   1 +
 arch/arm/dts/tegra20-harmony.dts            |   1 +
 arch/arm/dts/tegra20-medcom-wide.dts        |   1 +
 arch/arm/dts/tegra20-paz00.dts              |   1 +
 arch/arm/dts/tegra20-plutux.dts             |   1 +
 arch/arm/dts/tegra20-seaboard.dts           |   1 +
 arch/arm/dts/tegra20-tec.dts                |   1 +
 arch/arm/dts/tegra20-trimslice.dts          |   1 +
 arch/arm/dts/tegra20-ventana.dts            |   1 +
 arch/arm/dts/tegra20-whistler.dts           |   1 +
 arch/arm/dts/tegra20.dtsi                   |  15 +-
 arch/arm/dts/tegra30-beaver.dts             |   1 +
 arch/arm/dts/tegra30-cardhu.dts             |   1 +
 arch/arm/dts/tegra30-tamonten.dtsi          |   1 +
 arch/arm/dts/tegra30.dtsi                   |  40 +++++
 arch/sandbox/dts/sandbox.dts                |  10 ++
 common/board_r.c                            |  19 ++-
 common/stdio.c                              |  18 +-
 doc/device-tree-bindings/serial/ns16550.txt |  10 ++
 drivers/core/lists.c                        |  10 +-
 drivers/core/root.c                         |   2 +-
 drivers/serial/Makefile                     |   6 +-
 drivers/serial/ns16550.c                    | 224 +++++++++++++++++++++---
 drivers/serial/sandbox.c                    | 140 ++++++++++++---
 drivers/serial/serial-uclass.c              | 211 +++++++++++++++++++++++
 drivers/serial/serial.c                     |   1 +
 drivers/serial/serial_ns16550.c             |  23 +--
 drivers/serial/serial_s5p.c                 | 255 ++++++++--------------------
 include/configs/exynos-common.h             |   1 +
 include/configs/sandbox.h                   |   3 +
 include/configs/tegra-common.h              |   8 +-
 include/configs/tegra124-common.h           |   2 +
 include/configs/tegra20-common.h            |   2 +
 include/configs/tegra30-common.h            |   2 +
 include/dm/lists.h                          |   6 +-
 include/dm/uclass-id.h                      |   1 +
 include/ns16550.h                           |  37 ++++
 include/serial.h                            |  92 ++++++++++
 include/stdio_dev.h                         |  24 ++-
 45 files changed, 987 insertions(+), 272 deletions(-)
 create mode 100644 doc/device-tree-bindings/serial/ns16550.txt
 create mode 100644 drivers/serial/serial-uclass.c

-- 
2.0.0.526.g5318336

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2014-08-05 16:05 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30  9:49 [U-Boot] [PATCH v3 0/16] Introduce driver model serial uclass Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 01/16] serial: Set up the 'priv' pointer when creating a serial device Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 02/16] dm: Adjust lists_bind_fdt() to return the bound device Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 03/16] dm: Add a uclass for serial devices Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 04/16] Set up stdio earlier when using driver model Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 05/16] sandbox: Convert serial driver to use " Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 06/16] sandbox: serial: Support a coloured console Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 07/16] sandbox: dts: Add a serial console node Simon Glass
2014-07-31 20:20   ` Stephen Warren
2014-07-31 22:13     ` Simon Glass
2014-07-31 23:09       ` Stephen Warren
2014-08-01 15:46         ` Jon Loeliger
2014-08-01 16:53           ` Tom Rini
2014-08-01 21:37             ` Simon Glass
2014-08-01 21:40         ` Simon Glass
2014-08-01 21:52           ` Stephen Warren
2014-07-30  9:49 ` [U-Boot] [PATCH v3 08/16] dm: exynos: Mark exynos5 console as pre-reloc Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 09/16] dm: exynos: Move serial to driver model Simon Glass
2014-07-30 15:38   ` Tom Rini
2014-07-30 15:43     ` Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 10/16] dm: Make driver model available before board_init() Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 11/16] dm: serial: Move baud rate calculation to ns16550.c Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 12/16] dm: serial: Collect common baud rate code in ns16550 Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 13/16] dm: serial: Add driver model support for ns16550 Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 14/16] tegra: dts: Add serial port details Simon Glass
2014-07-31 20:16   ` Stephen Warren
2014-07-31 22:10     ` Simon Glass
2014-07-31 23:06       ` Stephen Warren
2014-08-01 21:32         ` Simon Glass
2014-08-01 21:50           ` Stephen Warren
2014-08-04 10:43             ` Simon Glass
2014-08-04 17:47               ` Stephen Warren
2014-08-04 18:11                 ` Tom Rini
2014-08-04 18:47                   ` Jeroen Hofstee
2014-08-04 20:14                 ` Simon Glass
2014-08-05 16:05                   ` Stephen Warren
2014-07-30  9:49 ` [U-Boot] [PATCH v3 15/16] RFC: dm: tegra: Enable driver model for serial Simon Glass
2014-07-31 20:18   ` Stephen Warren
2014-07-31 22:11     ` Simon Glass
2014-07-30  9:49 ` [U-Boot] [PATCH v3 16/16] dm: tegra: Use V_NS16550_CLK only in SPL builds Simon Glass
2014-07-31 20:22   ` Stephen Warren
2014-07-31 22:14     ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox