Re: [U-Boot] [PATCH v6 0/17] Driver model implementation, tests, demo and GPIO

2013-11-21 Thread Simon Glass
Hi,

On Thu, Nov 7, 2013 at 9:31 AM, Simon Glass s...@chromium.org wrote:


 Note: If you are reviewing this code, but don't have a lot of time, please
 consider starting with the 'demo' driver (patch 'dm: Add a
 demonstration/example driver') since it clearly shows how devices and
 uclasses work. Much of this series consists of test code and plumbing, so
 is of less interest to driver authors.


I only have one small nit on this series (I will update this). Does that
mean everyone is happy for it to go in?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v6 0/17] Driver model implementation, tests, demo and GPIO

2013-11-07 Thread Simon Glass

Note: If you are reviewing this code, but don't have a lot of time, please
consider starting with the 'demo' driver (patch 'dm: Add a
demonstration/example driver') since it clearly shows how devices and
uclasses work. Much of this series consists of test code and plumbing, so
is of less interest to driver authors.

This patch adds a driver model implementation. It is taken from
the driver model code developed by:

   Marek Vasut ma...@denx.de
   Pavel Herrmann morpheus.i...@gmail.com
   Viktor Křivák viktor.kri...@gmail.com
   Tomas Hlavacek tmshl...@gmail.com

Please see doc/driver-model/README.txt for details of how to run this and
what to look for. So far the documentation in doc/driver-model has not
been updated.

You can find a test version of the code used here in branch dm6 at:

   http://git.denx.de/u-boot-x86.git

(Branch dm contains the original implementation)

Changes in v6:
- Add a test script for driver model
- Add dev_get_platdata to access devices's platdata
- Add dev_get_priv() to access device's private data
- Add new patch to fix sandbox link error
- Add ofdata_to_pdata method to convert device tree data to platdata
- Convert Makefiles to new Kconfig format
- Rename platform_data to platdata
- Revise and update README
- Use ofdata_to_platdata feature
- Use ofdata_to_platdata method to convert device tree data to platdata

Changes in v5:
- Adjust patch to completely remove old driver model documentation
- Change to new SPDX license headers
- Correct 80col line missed last time
- Fix style nit on for() loop

Changes in v4:
- Change 'dm dump' command to 'dm tree'
- Correct 'out.dtb' typo
- Move common/dm to drivers/core
- Remove duplicated .op line
- device_chld_unbind() continues on error

Changes in v3:
- Add a flag for tracking whether DM allocates/frees platform_data
- Add function/struct comments to tests
- Add new patch to build a device tree file for sandbox
- Add new patch to move driver model documentation
- Fix up demo command help
- Rename per_device_priv_size to per_device_auto_alloc_size, etc.
- Tidy up commenting of functions and structures
- Tidy up comments/documentation in GPIO module
- Update GPIO support to use new struct member names
- Update demo driver to use device tree
- Update sandbox GPIO header file comments
- Updated README.txt to cover changes since version 2

Changes in v2:
- Add GPIO uclass and tests
- Add U_BOOT_DEVICE to declare platform_data
- Add a single include/dm.h to bring in driver model code
- Add auto-probing feature for platform_data to avoid driver_bind() calls
- Add automatic allocation of device-specific priv data for uclasses
- Add automatic allocation of platform_data for FDT
- Add automatic allocation of priv data for devices
- Add device tree support in driver model
- Add dm_warn() to warn about impending doom
- Add integration tests for driver model
- Add new header file for lists
- Add new util file to hold utility functions
- Add sandbox GPIO driver
- Add script to run tests
- Add simple unit test functions
- Add test infrastructure for driver model
- Add tests for core code
- Allow a driver to bind to only one uclass
- Allow driver_bind() to support a NULL parent
- Put platform_data definitions in their own header file
- Remove relocation functions
- Remove unneeded arguments to uclass_bind(), uclass_unbind()
- Removed pointer return values in favour of integer
- Rename data structures to hopefully be clearer
- Rename struct device's 'bus' to 'parent'
- Standardise variable names (e.g. uclass instead of class)
- Update gpio command to use driver model
- Use driver_bind() in dm_init() instead of writing new code

Simon Glass (17):
  sandbox: Add timer_read_counter() to avoid link error
  sandbox: Make map_to_sysmem() use a constant pointer
  sandbox: Correct data sizes and printf() strings in fdtdec.c
  sandbox: config: Don't use 64-bit physical memory
  sandbox: Build a device tree file for sandbox
  Add cmd_process_error() to report and process errors
  dm: Add README for driver model
  dm: Add base driver model support
  sandbox: config: Enable driver model
  dm: Set up driver model after relocation
  dm: Add basic tests
  dm: Add a 'dm' command for testing
  dm: Add a demonstration/example driver
  dm: Add GPIO support and tests
  sandbox: Convert GPIOs to use driver model
  dm: Enable gpio command to support driver model
  dm: Remove old driver model documentation

 Makefile  |   4 +
 arch/sandbox/config.mk|   2 +
 arch/sandbox/include/asm/gpio.h   |  14 +-
 arch/sandbox/include/asm/io.h |   2 +-
 arch/sandbox/include/asm/types.h  |   4 +-
 board/sandbox/dts/sandbox.dts |  20 ++
 board/sandbox/sandbox/sandbox.c   |  13 +-
 common/Makefile   |   1 +
 common/board_r.c  |  33 +++
 common/cmd_demo.c | 102 +++
 common/cmd_gpio.c | 127 -
 common/command.c  |  10 +
 doc/driver-model/README.txt   |