Commit f291ce1298f078175bbe3c2e600d03cae173403f

Authored by Philipp Tomsich
1 parent 7c819e7f22

spl: dm: Kconfig: split OF_CONTROL and OF_PLATDATA between SPL and TPL

For the RK3368, we want to use OF_PLATDATA in TPL, but full OF_CONTROL
in SPL: this requires the introduction of a new family of
configuration options to decouple SPL_OF_CONTROL and SPL_OF_PLATDATA
from TPL.

Consequently, Makefile.spl needs to be adjusted to test for these
configuration items through the $(SPL_TPL_) macro instead of
hard-coding the SPL variant.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

Showing 3 changed files with 33 additions and 3 deletions Side-by-side Diff

... ... @@ -1400,7 +1400,8 @@
1400 1400 spl/u-boot-spl.bin: spl/u-boot-spl
1401 1401 @:
1402 1402 spl/u-boot-spl: tools prepare \
1403   - $(if $(CONFIG_OF_SEPARATE)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb)
  1403 + $(if $(CONFIG_OF_SEPARATE)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \
  1404 + $(if $(CONFIG_OF_SEPARATE)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)
1404 1405 $(Q)$(MAKE) obj=spl -f $(srctree)/scripts/Makefile.spl all
1405 1406  
1406 1407 spl/sunxi-spl.bin: spl/u-boot-spl
... ... @@ -32,6 +32,14 @@
32 32 which is not enough to support device tree. Enable this option to
33 33 allow such boards to be supported by U-Boot SPL.
34 34  
  35 +config TPL_OF_CONTROL
  36 + bool "Enable run-time configuration via Device Tree in TPL"
  37 + depends on TPL && OF_CONTROL
  38 + help
  39 + Some boards use device tree in U-Boot but only have 4KB of SRAM
  40 + which is not enough to support device tree. Enable this option to
  41 + allow such boards to be supported by U-Boot TPL.
  42 +
35 43 config OF_LIVE
36 44 bool "Enable use of a live tree"
37 45 depends on OF_CONTROL
... ... @@ -118,6 +126,27 @@
118 126 config SPL_OF_PLATDATA
119 127 bool "Generate platform data for use in SPL"
120 128 depends on SPL_OF_CONTROL
  129 + help
  130 + For very constrained SPL environments the overhead of decoding
  131 + device tree nodes and converting their contents into platform data
  132 + is too large. This overhead includes libfdt code as well as the
  133 + device tree contents itself. The latter is fairly compact, but the
  134 + former can add 3KB or more to a Thumb 2 Image.
  135 +
  136 + This option enables generation of platform data from the device
  137 + tree as C code. This code creates devices using U_BOOT_DEVICE()
  138 + declarations. The benefit is that it allows driver code to access
  139 + the platform data directly in C structures, avoidin the libfdt
  140 + overhead.
  141 +
  142 + This option works by generating C structure declarations for each
  143 + compatible string, then adding platform data and U_BOOT_DEVICE
  144 + declarations for each node. See README.platdata for more
  145 + information.
  146 +
  147 +config TPL_OF_PLATDATA
  148 + bool "Generate platform data for use in TPL"
  149 + depends on TPL_OF_CONTROL
121 150 help
122 151 For very constrained SPL environments the overhead of decoding
123 152 device tree nodes and converting their contents into platform data
scripts/Makefile.spl
... ... @@ -98,7 +98,7 @@
98 98  
99 99 u-boot-spl-init := $(head-y)
100 100 u-boot-spl-main := $(libs-y)
101   -ifdef CONFIG_SPL_OF_PLATDATA
  101 +ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA
102 102 u-boot-spl-platdata := $(obj)/dts/dt-platdata.o
103 103 endif
104 104  
... ... @@ -202,7 +202,7 @@
202 202 quiet_cmd_copy = COPY $@
203 203 cmd_copy = cp $< $@
204 204  
205   -ifeq ($(CONFIG_SPL_OF_CONTROL)$(CONFIG_OF_SEPARATE)$(CONFIG_SPL_OF_PLATDATA),yy)
  205 +ifeq ($(CONFIG_$(SPL_TPL_)OF_CONTROL)$(CONFIG_OF_SEPARATE)$(CONFIG_$(SPL_TPL_)OF_PLATDATA),yy)
206 206 $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
207 207 $(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
208 208 $(obj)/$(SPL_BIN).dtb FORCE