public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH 0/22] Introduce driver model serial uclass
@ 2014-05-24 21:20 Simon Glass
  2014-05-24 21:21 ` [U-Boot] [RFC PATCH 01/22] stdio: Remove redundant code around stdio_register() calls Simon Glass
                   ` (21 more replies)
  0 siblings, 22 replies; 47+ messages in thread
From: Simon Glass @ 2014-05-24 21:20 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 includes quite a few patches to address the above, as well
as the serial uclass and an implementation for sandbox.

The early malloc() implementation uses a very simple region of memory which
it doles out as needed. This means that driver model can start up with very
little memory usage, and no overhead for malloc() itself except for space
wasted due to alignment. With a 32-bit machine and just a serial port set
as a pre-reloc device (plus the mandatory root device), the usage is 176
bytes.

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).

The series is based on the Tegra GPIO series v3. You can get this tree in
a rough unfinished form from u-boot-x86.git branch us-gpioe.

Note: This series is for comments only as there are some build errors for
certain boards.


Simon Glass (22):
  stdio: Remove redundant code around stdio_register() calls
  stdio: Pass device pointer to stdio methods
  dm: Make sure that the root device is probed
  dm: Provide a way to shut down driver model
  sandbox: Remove all drivers before exit
  dm: Tidy up four minor code nits
  dm: Allow drivers to be marked 'before relocation'
  dm: Use '*' to indicate a device is activated
  Remove form-feeds from dlmalloc.c
  Add a simple malloc() implementation for pre-relocation
  sandbox: config: Enable pre-relocation malloc()
  dm: Support driver model prior to relocation
  stdio: Provide functions to add/remove devices using stdio_dev
  console: Remove vprintf() optimisation for sandbox
  Add a flag indicating when the serial console is ready
  dm: Add a way to indicate a preferred device within a uclass
  dm: Expand and improve the device lifecycle docs
  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

 README                            |  16 +++
 arch/blackfin/cpu/jtag-console.c  |  10 +-
 arch/powerpc/cpu/mpc512x/serial.c |  10 +-
 arch/powerpc/cpu/mpc8xx/video.c   |   6 +-
 arch/sandbox/cpu/cpu.c            |   4 +
 arch/sandbox/dts/sandbox.dts      |  11 ++
 arch/x86/lib/video.c              |   8 +-
 board/bf527-ezkit/video.c         |  10 --
 board/bf548-ezkit/video.c         |  10 --
 board/cm-bf548/video.c            |  10 --
 board/mpl/common/kbd.c            |   6 +-
 board/mpl/common/kbd.h            |   6 +-
 board/mpl/pati/pati.c             |   8 +-
 board/netphone/phone_console.c    |  16 +--
 board/nokia/rx51/rx51.c           |   6 +-
 board/rbc823/kbd.c                |   8 +-
 common/board_f.c                  |  42 ++++++++
 common/board_r.c                  |  28 +++--
 common/cmd_log.c                  |  11 +-
 common/console.c                  |  24 ++---
 common/dlmalloc.c                 |  81 ++++++++++----
 common/lcd.c                      |  14 ++-
 common/stdio.c                    |  63 ++++++++---
 common/usb_kbd.c                  |   6 +-
 doc/driver-model/README.txt       | 220 +++++++++++++++++++++++++++++++++++---
 drivers/core/device.c             |  11 +-
 drivers/core/lists.c              |   6 +-
 drivers/core/root.c               |  22 +++-
 drivers/core/uclass.c             |  15 ++-
 drivers/input/cros_ec_keyb.c      |   6 +-
 drivers/input/i8042.c             |   4 +-
 drivers/input/keyboard.c          |   6 +-
 drivers/input/tegra-kbc.c         |   6 +-
 drivers/misc/cbmem_console.c      |   6 +-
 drivers/net/netconsole.c          |  10 +-
 drivers/serial/Makefile           |   4 +
 drivers/serial/sandbox.c          | 140 +++++++++++++++++++-----
 drivers/serial/serial-uclass.c    | 161 ++++++++++++++++++++++++++++
 drivers/serial/serial.c           |  55 ++++++++--
 drivers/serial/usbtty.c           |   8 +-
 drivers/video/cfb_console.c       |   8 +-
 include/asm-generic/global_data.h |   7 ++
 include/common.h                  |   5 +
 include/configs/ELPPC.h           |   4 +-
 include/configs/MHPC.h            |   4 +-
 include/configs/jadecpu.h         |   4 +-
 include/configs/nokia_rx51.h      |   5 +-
 include/configs/sandbox.h         |   7 ++
 include/dm/device-internal.h      |   6 +-
 include/dm/device.h               |  10 +-
 include/dm/lists.h                |  22 +++-
 include/dm/root.h                 |  18 +++-
 include/dm/uclass-id.h            |   1 +
 include/dm/uclass-internal.h      |   3 +-
 include/dm/uclass.h               |  21 +++-
 include/i8042.h                   |   6 +-
 include/serial.h                  |  90 ++++++++++++++++
 include/stdio_dev.h               |  17 +--
 include/video.h                   |   8 +-
 test/dm/cmd_dm.c                  |  11 +-
 test/dm/core.c                    |  49 +++++++--
 test/dm/test-driver.c             |  11 ++
 test/dm/test-fdt.c                |  34 +++++-
 test/dm/test-main.c               |   4 +-
 test/dm/test.dts                  |  12 +++
 65 files changed, 1186 insertions(+), 275 deletions(-)
 create mode 100644 drivers/serial/serial-uclass.c

-- 
1.9.1.423.g4596e3a

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

end of thread, other threads:[~2014-06-21 16:14 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-24 21:20 [U-Boot] [RFC PATCH 0/22] Introduce driver model serial uclass Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 01/22] stdio: Remove redundant code around stdio_register() calls Simon Glass
2014-06-01 17:30   ` Marek Vasut
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 02/22] stdio: Pass device pointer to stdio methods Simon Glass
2014-06-01 17:32   ` Marek Vasut
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 03/22] dm: Make sure that the root device is probed Simon Glass
2014-06-01 17:33   ` Marek Vasut
2014-06-03  1:59     ` Simon Glass
2014-06-03 11:25       ` Marek Vasut
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 04/22] dm: Provide a way to shut down driver model Simon Glass
2014-06-01 17:34   ` Marek Vasut
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 05/22] sandbox: Remove all drivers before exit Simon Glass
2014-05-27 15:28   ` Jon Loeliger
2014-05-27 21:05     ` Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 06/22] dm: Tidy up four minor code nits Simon Glass
2014-06-01 17:34   ` Marek Vasut
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 07/22] dm: Allow drivers to be marked 'before relocation' Simon Glass
2014-05-27 15:36   ` Jon Loeliger
2014-05-27 21:09     ` Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 08/22] dm: Use '*' to indicate a device is activated Simon Glass
2014-05-27 14:25   ` Jon Loeliger
2014-05-30 14:37     ` Simon Glass
2014-06-01 17:35     ` Marek Vasut
2014-06-21 16:14   ` Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 09/22] Remove form-feeds from dlmalloc.c Simon Glass
2014-05-27 14:22   ` Jon Loeliger
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 10/22] Add a simple malloc() implementation for pre-relocation Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 11/22] sandbox: config: Enable pre-relocation malloc() Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 12/22] dm: Support driver model prior to relocation Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 13/22] stdio: Provide functions to add/remove devices using stdio_dev Simon Glass
2014-06-01 17:37   ` Marek Vasut
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 14/22] console: Remove vprintf() optimisation for sandbox Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 15/22] Add a flag indicating when the serial console is ready Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 16/22] dm: Add a way to indicate a preferred device within a uclass Simon Glass
2014-05-27 15:42   ` Jon Loeliger
2014-05-30 14:43     ` Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 17/22] dm: Expand and improve the device lifecycle docs Simon Glass
2014-05-27 15:24   ` Jon Loeliger
2014-05-30 15:11     ` Simon Glass
2014-05-27 17:37   ` Jon Loeliger
2014-05-30 15:12     ` Simon Glass
     [not found]       ` <CAJgR-Bjc8rM3ASTxa1bZBHTjAu2WvCagTVDa3nNv+fAD3242vw@mail.gmail.com>
2014-06-02 15:49         ` Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 18/22] dm: Add a uclass for serial devices Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 19/22] Set up stdio earlier when using driver model Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 20/22] sandbox: Convert serial driver to use " Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 21/22] sandbox: serial: Support a coloured console Simon Glass
2014-05-24 21:21 ` [U-Boot] [RFC PATCH 22/22] sandbox: dts: Add a serial console node Simon Glass

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