File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,26 @@ config OF_SPL_REMOVE_PROPS
314
314
can be discarded. This option defines the list of properties to
315
315
discard.
316
316
317
+ config OF_DTB_PROPS_REMOVE
318
+ bool "Enable removal of device tree properties"
319
+ depends on OF_CONTROL
320
+ help
321
+ Some boards have restricted amount of storage for U-Boot image.
322
+ If the generated binary doesn't fit into available image storage,
323
+ the built-in device tree could probably be cut down by removing
324
+ some not required device tree properties to reduce the image size.
325
+ Enable this option and define the properties to be removed in the
326
+ CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
327
+ pass the built-in DTB directly to the kernel!
328
+
329
+ config OF_REMOVE_PROPS
330
+ string "List of device tree properties to drop"
331
+ depends on OF_DTB_PROPS_REMOVE
332
+ default "interrupt-parent interrupts" if PINCTRL
333
+ help
334
+ Some properties are not used by U-Boot and can be discarded.
335
+ This option defines the list of properties to discard.
336
+
317
337
config SPL_OF_PLATDATA
318
338
bool "Generate platform data for use in SPL"
319
339
depends on SPL_OF_CONTROL
Original file line number Diff line number Diff line change 19
19
$(obj ) /dt-spl.dtb : $(DTB ) $(objtree ) /tools/fdtgrep FORCE
20
20
$(call if_changed,fdtgrep)
21
21
22
+ ifeq ($(CONFIG_OF_DTB_PROPS_REMOVE ) ,y)
23
+ $(obj ) /dt.dtb : $(DTB ) $(objtree ) /tools/fdtgrep FORCE
24
+ $(call if_changed,fdt_rm_props)
25
+ else
22
26
$(obj ) /dt.dtb : $(DTB ) FORCE
23
27
$(call if_changed,shipped)
28
+ endif
24
29
25
30
targets += dt.dtb dt-spl.dtb
26
31
Original file line number Diff line number Diff line change @@ -544,3 +544,11 @@ quiet_cmd_fdtgrep = FDTGREP $@
544
544
$(objtree)/tools/fdtgrep -r -O dtb - -o $@ \
545
545
-P u-boot,dm-pre-reloc -P u-boot,dm-spl -P u-boot,dm-tpl \
546
546
$(addprefix -P ,$(subst $\",,$(CONFIG_OF_SPL_REMOVE_PROPS)))
547
+
548
+ # fdt_rm_props
549
+ # ---------------------------------------------------------------------------
550
+ # Pass the original device tree file through fdtgrep. This removes various
551
+ # unused properties. The output is typically a smaller device tree file.
552
+ quiet_cmd_fdt_rm_props = FDTGREP $@
553
+ cmd_fdt_rm_props = cat $< | $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \
554
+ $(addprefix -P ,$(subst $\",,$(CONFIG_OF_REMOVE_PROPS)))
You can’t perform that action at this time.
0 commit comments