[U-Boot] [PATCH v2 0/29] Add additional core driver model features

Simon Glass sjg at chromium.org
Wed Jul 9 05:37:50 CEST 2014


This series includes a number of base driver model enhancements, mostly
targeted at pre-relocation and to enable buses to be easily implemented.

With the device tree, child nodes for buses can now be scanned to create
child devices, and bus-related information about each child can be
stored. Children can be numbered as a core driver model feature in U-Boot
(e.g. SPI bus 0 chip select 3).

Driver model now supports operation prior to relocation, assuming a
suitable malloc() implementation is available.

Several changes are added to permit driver model to be available early
after relocation, since we are unable to access any device until driver
model is ready.

This series is available at u-boot-dm.git branch 'working'.

Changes in v2:
- Remove change to board/rbc823/kbd.c, since it has been deleted
- Reformat commit message slightly
- Remove changes to deleted board/netphone/phone_console.c board/rbc823/kbd.c
- Rename struct device to struct udevice
- Update test output in doc/driver-model/README.txt
- Minor reword to comment for dm_init_and_scan()
- Return -ENODEV instead of -1 on error
- Improve wording in commit message
- Improve wording in commit message
- Expand series to include all driver-model-required changes

Simon Glass (29):
  dm: gpio: Don't use the driver model uclass for SPL
  dm: Use an explicit expect value in core tests
  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: Allow drivers to be marked 'before relocation'
  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: Move uclass error checking/probing into a function
  fdt: Add a function to get the alias sequence of a node
  dm: Move device display into its own function
  dm: Avoid activating devices in 'dm uclass' command
  dm: Introduce device sequence numbering
  dm: Display the sequence number for each device
  dm: Allow a device to be found by its FDT offset
  dm: Avoid accessing uclasses before they are ready
  fdt: Add a function to get the node offset of an alias
  dm: Tidy up some header file comments
  dm: Provide a function to scan child FDT nodes
  dm: Add functions to access a device's children
  dm: Introduce per-child data for devices
  dm: Add child_pre_probe() and child_post_remove() methods
  dm: Improve errors and warnings in lists_bind_fdt()
  dm: Add dm_scan_other() to locate board-specific devices
  dm: Give the demo uclass a name

 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/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/nokia/rx51/rx51.c           |   6 +-
 common/board_f.c                  |  16 +++
 common/board_r.c                  |  25 +---
 common/cmd_log.c                  |  11 +-
 common/console.c                  |  24 ++--
 common/lcd.c                      |  14 ++-
 common/stdio.c                    |  66 ++++++++---
 common/usb_kbd.c                  |   6 +-
 doc/driver-model/README.txt       | 216 +++++++++++++++++++++++++++++++---
 drivers/core/device.c             | 169 +++++++++++++++++++++++++-
 drivers/core/lists.c              |  22 +++-
 drivers/core/root.c               |  79 ++++++++++---
 drivers/core/uclass.c             | 135 ++++++++++++++++++++-
 drivers/demo/demo-uclass.c        |   1 +
 drivers/gpio/Makefile             |   2 +
 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/serial.c           |  55 ++++++++-
 drivers/serial/usbtty.c           |   8 +-
 drivers/video/cfb_console.c       |   8 +-
 include/asm-generic/global_data.h |   4 +-
 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/dm/device-internal.h      |   6 +-
 include/dm/device.h               | 120 ++++++++++++++++++-
 include/dm/lists.h                |   2 +-
 include/dm/platdata.h             |  10 +-
 include/dm/root.h                 |  61 +++++++++-
 include/dm/test.h                 |  22 ++++
 include/dm/uclass-id.h            |   3 +-
 include/dm/uclass-internal.h      |  23 ++++
 include/dm/uclass.h               |  49 +++++++-
 include/fdtdec.h                  |  29 +++++
 include/i8042.h                   |   6 +-
 include/stdio_dev.h               |  17 ++-
 include/video.h                   |   8 +-
 lib/fdtdec.c                      |  61 ++++++++++
 test/dm/Makefile                  |   1 +
 test/dm/bus.c                     | 242 ++++++++++++++++++++++++++++++++++++++
 test/dm/cmd_dm.c                  |  35 ++++--
 test/dm/core.c                    |  64 ++++++++--
 test/dm/test-driver.c             |  11 ++
 test/dm/test-fdt.c                | 164 ++++++++++++++++++++++----
 test/dm/test-main.c               |   4 +-
 test/dm/test.dts                  |  43 ++++++-
 63 files changed, 1714 insertions(+), 282 deletions(-)
 create mode 100644 test/dm/bus.c

-- 
2.0.0.526.g5318336



More information about the U-Boot mailing list