All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 00/55] RFC: dm: rockchip: Add support for compiled-in platform data
@ 2016-06-13  5:32 Simon Glass
  2016-06-13  5:32 ` [U-Boot] [PATCH v2 01/55] sandbox: Don't print a warning for CONFIG_I2C_COMPAT Simon Glass
                   ` (54 more replies)
  0 siblings, 55 replies; 60+ messages in thread
From: Simon Glass @ 2016-06-13  5:32 UTC (permalink / raw)
  To: u-boot

Note: This v2 series has some minor updates and improvements, mostly as new
patches in the series.

This series provides a way to compile in the contents of a device tree as C
code into U-Boot, implementing an idea that Tom Rini came up with. It is
intended to deal with extremely tight environments where there is not enough
space for the ~3KB device tree code overhead. Examples include SPL where
there is only 16KB of available RAM yet a full MMC stack is required.

To provide a reasonable test environment, SPL support is added to sandbox,
through a new 'sandbox_spl' target. A new tool 'dtoc' converts device tree
data to C code (and structure definitions).

To check its effectiveness for a real application, the v2 series includes
support for enabling of-platdata for a rockchip board (firefly-rk3288). The
results are as follows:

                          Code       Data      u-boot-spl.bin size
of-platdata disabled      23159	     1624      28864
of-platdata enabled       19093      2616      21761

Overall the saving is 7103 bytes, about 7KB. Approximately 4KB of this comes
from removing the device tree data from SPL although this is offset by
the size of the of-platdata itself (around 1KB). On top of this effective
3KB reduction, another ~3KB reduction comes from dropping libfdt and a
further 1KB from dropping unused setup and driver-model code.

Clearly this approach does have value. Looked at with a favourable light it
provides the best of both worlds: configuration using standard device tree
bindings without the run-time overhead.

Looking under the hood shows a less rosy picture. Effectively we end up
with a new set of C structures which must be handled by the driver. This
series suggests a suitable approach for dealing with this (see of-plat.txt)
which is workable. However there are a number of serious caveats. See that
file for details.

If this feature makes it to mainline it should be used sparingly. Rockchip
is to some extent an unusual case: lots of features, no MMC stack available
to SPL from the internal ROM* and a very limited maximum SPL size. Most SoCs
will not benefit from this.

However, for an SoC with very small SRAM where only a few drivers are needed
in SPL (such as serial and MMC) then of-platdata could provide a useful
benefit, without a significant increase in complexity.

More work is needed before this feature is ready for use, but this series
contains enough to attract initial comments and testing. It is available at
u-boot-dm/dt-working.

* Note that the rockchip internal ROM does include an MMC stack but it only
permits loading of data in its own format, outside control of U-Boot.

Changes in v2:
- Add a comment to the effect that 64-bit machines are not supported
- Add support for rockchip
- Various minor enhancements to the v1 implementation

Simon Glass (55):
  sandbox: Don't print a warning for CONFIG_I2C_COMPAT
  README: Remove CONFIG_SYS_MALLOC_F_LEN comment
  spl: Drop include of i2c.h
  Makefile: Allow the SPL final link rule to be overridden
  sandbox: Allow chaining from SPL to U-Boot proper
  sandbox: Support building an SPL image
  sandbox: Correct header file order in cpu.c
  sandbox: Add some missing headers in cpu.c
  sandbox: Don't use PCI in SPL
  sandbox: Don't include the main loop in SPL
  sandbox: Add basic SPL implementation
  sandbox: Don't use IDE and iotrace in SPL
  sandbox: serial: Don't sync video in SPL
  sandbox: Add a new sandbox_spl board
  sandbox: Add a test device that uses of-platdata
  dm: spl: Don't set up device tree with of-platdata
  dm: Makefile: Build of-platdata before SPL
  dm: core: Don't use device tree with of-platdata
  dm: regmap: Add a dummy implementation for of-platdata
  dm: syscon: Add support for of-platdata
  dm: sandbox: Add a simple driver to test of-platdata
  dm: Add a header that provides access to the of-platdata structs
  dm: clk: Add support for of-platdata
  dm: serial: Add support for of-platdata
  dm: Don't include fdtdec functions when of-platdata is enabled
  dm: Add an option to enable the of-platdata feature
  dm: Add a README for of-platdata
  dm: Add a library to provide simple device-tree access
  dm: Add a tool to generate C code from a device tree
  dm: Makefile: Build of-platdata files when the feature is enabled
  dm: Add a more efficient libfdt library
  Only build the libfdt python module if 'swig' is available
  tiny-printf: Support assert()
  dm: spl: Bind in all devices in SPL with of-platdata
  dm: core: Rename DM_NAME_ALLOCED to DM_FLAG_NAME_ALLOCED
  dtoc: Ignore the u-boot,dm-pre-reloc property
  dm: Don't attach the device tree to SPL with of-platdata
  dm: core: Expand platdata for of-platdata devices
  dm: core: Move regmap allocation into a separate function
  dm: core: Add an implementation of regmap_init_mem_platdata()
  dm: serial: ns16550: Update to support of-platdata
  rockchip: serial: Add an of-platdata driver for rockchip
  rockchip: Update the sdram-channel property to support of-platdata
  rockchip: mmc: Move all DT decoding to ofdata_to_platdata()
  rockchip: mmc: Update the driver to support of-platdata
  rockchip: clk: Move all DT decoding to ofdata_to_platdata()
  rockchip: clk: Update the rk3288 driver to support of-platdata
  rockchip: pinctrl: Update the rk3288 driver to support of-platdata
  rockchip: Move the MMC setup check earlier
  rockchip: Don't use spl_boot_device() with of-platdata
  rockchip: syscon: Update to work with of-platdata
  rockchip: sdram: Move all DT decoding to ofdata_to_platdata()
  rockchip: sdram: Update the driver to support of-platdata
  rockchip: Use of-platdata for firefly-rk3288
  dm: Update the of-platdata README for the new features

 Makefile                                      |   5 +-
 README                                        |   3 -
 arch/arm/dts/rk3288-firefly.dts               |   3 +-
 arch/arm/include/asm/arch-rockchip/sdram.h    |  14 +-
 arch/arm/mach-rockchip/rk3288-board-spl.c     |  25 +-
 arch/arm/mach-rockchip/rk3288/sdram_rk3288.c  | 125 +++++++--
 arch/arm/mach-rockchip/rk3288/syscon_rk3288.c |  38 +++
 arch/sandbox/Kconfig                          |   7 +-
 arch/sandbox/config.mk                        |   5 +
 arch/sandbox/cpu/Makefile                     |   1 +
 arch/sandbox/cpu/cpu.c                        |   6 +-
 arch/sandbox/cpu/os.c                         |  51 ++++
 arch/sandbox/cpu/spl.c                        |  60 +++++
 arch/sandbox/cpu/start.c                      |   2 +
 arch/sandbox/cpu/u-boot-spl.lds               |  24 ++
 arch/sandbox/dts/sandbox.dts                  |  13 +
 arch/sandbox/include/asm/spl.h                |  23 ++
 arch/sandbox/lib/Makefile                     |   2 +
 board/sandbox/MAINTAINERS                     |   7 +
 common/spl/spl.c                              |   6 +-
 configs/firefly-rk3288_defconfig              |   3 +
 configs/sandbox_spl_defconfig                 | 177 +++++++++++++
 doc/driver-model/of-plat.txt                  | 311 ++++++++++++++++++++++
 drivers/clk/clk-uclass.c                      |  20 ++
 drivers/clk/clk_fixed_rate.c                  |   2 +
 drivers/clk/clk_rk3288.c                      |  38 ++-
 drivers/core/device-remove.c                  |   2 +-
 drivers/core/device.c                         |  45 +++-
 drivers/core/lists.c                          |   2 +-
 drivers/core/regmap.c                         |  57 +++-
 drivers/core/root.c                           |   4 +-
 drivers/core/syscon-uclass.c                  |  13 +
 drivers/misc/Makefile                         |   5 +
 drivers/misc/spltest_sandbox.c                |  28 ++
 drivers/mmc/rockchip_dw_mmc.c                 |  60 +++--
 drivers/pinctrl/rockchip/pinctrl_rk3288.c     |   8 +-
 drivers/serial/Kconfig                        |   9 +
 drivers/serial/Makefile                       |   3 +
 drivers/serial/ns16550.c                      |   4 +-
 drivers/serial/sandbox.c                      |   2 +
 drivers/serial/serial-uclass.c                |   8 +-
 drivers/serial/serial_rockchip.c              |  43 +++
 dts/Kconfig                                   |  21 ++
 include/clk.h                                 |   4 +
 include/configs/sandbox.h                     |   4 +
 include/configs/sandbox_spl.h                 |  20 ++
 include/dm/device.h                           |   6 +-
 include/dm/platdata.h                         |   5 +
 include/dt-structs.h                          |  19 ++
 include/os.h                                  |  25 ++
 include/regmap.h                              |  16 ++
 include/syscon.h                              |  11 +
 lib/Makefile                                  |   5 +-
 lib/libfdt/libfdt.swig                        |  81 ++++++
 lib/libfdt/setup.py                           |  38 +++
 lib/libfdt/test_libfdt.py                     |  14 +
 lib/tiny-printf.c                             |   9 +
 scripts/Makefile.host                         |   9 +-
 scripts/Makefile.spl                          |  47 +++-
 tools/Makefile                                |  14 +
 tools/dtoc/.gitignore                         |   1 +
 tools/dtoc/dtoc                               |   1 +
 tools/dtoc/dtoc.py                            | 368 ++++++++++++++++++++++++++
 tools/dtoc/fdt.py                             | 174 ++++++++++++
 tools/dtoc/fdt_fallback.py                    | 207 +++++++++++++++
 tools/dtoc/fdt_util.py                        |  71 +++++
 66 files changed, 2303 insertions(+), 131 deletions(-)
 create mode 100644 arch/sandbox/cpu/spl.c
 create mode 100644 arch/sandbox/cpu/u-boot-spl.lds
 create mode 100644 arch/sandbox/include/asm/spl.h
 create mode 100644 configs/sandbox_spl_defconfig
 create mode 100644 doc/driver-model/of-plat.txt
 create mode 100644 drivers/misc/spltest_sandbox.c
 create mode 100644 drivers/serial/serial_rockchip.c
 create mode 100644 include/configs/sandbox_spl.h
 create mode 100644 include/dt-structs.h
 create mode 100644 lib/libfdt/libfdt.swig
 create mode 100644 lib/libfdt/setup.py
 create mode 100644 lib/libfdt/test_libfdt.py
 create mode 100644 tools/dtoc/.gitignore
 create mode 120000 tools/dtoc/dtoc
 create mode 100755 tools/dtoc/dtoc.py
 create mode 100644 tools/dtoc/fdt.py
 create mode 100644 tools/dtoc/fdt_fallback.py
 create mode 100644 tools/dtoc/fdt_util.py

-- 
2.8.0.rc3.226.g39d4020

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

end of thread, other threads:[~2016-06-26  3:00 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13  5:32 [U-Boot] [PATCH v2 00/55] RFC: dm: rockchip: Add support for compiled-in platform data Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 01/55] sandbox: Don't print a warning for CONFIG_I2C_COMPAT Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 02/55] README: Remove CONFIG_SYS_MALLOC_F_LEN comment Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 03/55] spl: Drop include of i2c.h Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 04/55] Makefile: Allow the SPL final link rule to be overridden Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 05/55] sandbox: Allow chaining from SPL to U-Boot proper Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 06/55] sandbox: Support building an SPL image Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 07/55] sandbox: Correct header file order in cpu.c Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 08/55] sandbox: Add some missing headers " Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 09/55] sandbox: Don't use PCI in SPL Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 10/55] sandbox: Don't include the main loop " Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 11/55] sandbox: Add basic SPL implementation Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 12/55] sandbox: Don't use IDE and iotrace in SPL Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 13/55] sandbox: serial: Don't sync video " Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 14/55] sandbox: Add a new sandbox_spl board Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 15/55] sandbox: Add a test device that uses of-platdata Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 16/55] dm: spl: Don't set up device tree with of-platdata Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 17/55] dm: Makefile: Build of-platdata before SPL Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 18/55] dm: core: Don't use device tree with of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 19/55] dm: regmap: Add a dummy implementation for of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 20/55] dm: syscon: Add support " Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 21/55] dm: sandbox: Add a simple driver to test of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 22/55] dm: Add a header that provides access to the of-platdata structs Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 23/55] dm: clk: Add support for of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 24/55] dm: serial: " Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 25/55] dm: Don't include fdtdec functions when of-platdata is enabled Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 26/55] dm: Add an option to enable the of-platdata feature Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 27/55] dm: Add a README for of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 28/55] dm: Add a library to provide simple device-tree access Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 29/55] dm: Add a tool to generate C code from a device tree Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 30/55] dm: Makefile: Build of-platdata files when the feature is enabled Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 31/55] dm: Add a more efficient libfdt library Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 32/55] Only build the libfdt python module if 'swig' is available Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 33/55] tiny-printf: Support assert() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 34/55] dm: spl: Bind in all devices in SPL with of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 35/55] dm: core: Rename DM_NAME_ALLOCED to DM_FLAG_NAME_ALLOCED Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 36/55] dtoc: Ignore the u-boot, dm-pre-reloc property Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 37/55] dm: Don't attach the device tree to SPL with of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 38/55] dm: core: Expand platdata for of-platdata devices Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 39/55] dm: core: Move regmap allocation into a separate function Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 40/55] dm: core: Add an implementation of regmap_init_mem_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 41/55] dm: serial: ns16550: Update to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 42/55] rockchip: serial: Add an of-platdata driver for rockchip Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 43/55] rockchip: Update the sdram-channel property to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 44/55] rockchip: mmc: Move all DT decoding to ofdata_to_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 45/55] rockchip: mmc: Update the driver to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 46/55] rockchip: clk: Move all DT decoding to ofdata_to_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 47/55] rockchip: clk: Update the rk3288 driver to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 48/55] rockchip: pinctrl: " Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 49/55] rockchip: Move the MMC setup check earlier Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 50/55] rockchip: Don't use spl_boot_device() with of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 51/55] rockchip: syscon: Update to work " Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 52/55] rockchip: sdram: Move all DT decoding to ofdata_to_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 53/55] rockchip: sdram: Update the driver to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 54/55] rockchip: Use of-platdata for firefly-rk3288 Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 55/55] dm: Update the of-platdata README for the new features Simon Glass
2016-06-23 20:04   ` Tom Rini
2016-06-23 20:36     ` Simon Glass
2016-06-23 22:55       ` Tom Rini
2016-06-26  3:00         ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.