From 06b51f77f5be60200a5f0037509c191b102e5e00 Mon Sep 17 00:00:00 2001 From: Jason Kacines Date: Tue, 11 Jul 2023 16:20:46 -0500 Subject: scripts: kconfig: Add config fragment support in board/../ Add support to config fragments (.config) located in the /board directory. This will allow only base defconfigs to live in /configs and all fragments to live in their respective device directory in /board/.. Signed-off-by: Jason Kacines --- scripts/kconfig/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 12e525ee31f..2d97aab8d21 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -99,7 +99,9 @@ endif %_config: %_defconfig @: -configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@) +configfiles=$(wildcard $(srctree)/kernel/configs/$@ \ + $(srctree)/arch/$(SRCARCH)/configs/$@ \ + $(shell find $(srctree)/board -name "$@")) %.config: $(obj)/conf $(if $(call configfiles),, $(error No configuration exists for this target on this architecture)) -- cgit v1.2.3 From 1fee487567f10d9fb128d577a8ac9755fa962737 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Tue, 22 Aug 2023 23:10:03 +0530 Subject: scripts/Makefile.lib: Collate all dtsi files for inclusion At the time of building a device-tree file, all the *u-boot.dtsi files are looked for, in a particular order, and the first file found is included. Then, the list of files specified in the CONFIG_DEVICE_TREE_INCLUDES symbol are included. Combine these files that are to be included into a variable, and then include all these files in one go. Signed-off-by: Sughosh Ganu Reviewed-by: Tom Rini Acked-by: Ilias Apalodimas --- scripts/Makefile.lib | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f5ab7af0f45..368b5a3e28a 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -179,10 +179,13 @@ ifdef DEVICE_TREE_DEBUG u_boot_dtsi_options_debug = $(warning $(u_boot_dtsi_options_raw)) endif -# We use the first match -u_boot_dtsi = $(strip $(u_boot_dtsi_options_debug) \ +# We use the first match to be included +dtsi_include_list = $(strip $(u_boot_dtsi_options_debug) \ $(notdir $(firstword $(u_boot_dtsi_options)))) +# The CONFIG_DEVICE_TREE_INCLUDES also need to be included +dtsi_include_list += $(CONFIG_DEVICE_TREE_INCLUDES) + # Modified for U-Boot dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ $(UBOOTINCLUDE) \ @@ -320,8 +323,8 @@ quiet_cmd_dtc = DTC $@ # Bring in any U-Boot-specific include at the end of the file # And finally any custom .dtsi fragments specified with CONFIG_DEVICE_TREE_INCLUDES cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ - (cat $<; $(if $(u_boot_dtsi),echo '$(pound)include "$(u_boot_dtsi)"')) > $(pre-tmp); \ - $(foreach f,$(subst $(quote),,$(CONFIG_DEVICE_TREE_INCLUDES)), \ + (cat $< > $(pre-tmp)); \ + $(foreach f,$(subst $(quote),,$(dtsi_include_list)), \ echo '$(pound)include "$(f)"' >> $(pre-tmp);) \ $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ $(DTC) -O dtb -o $@ -b 0 \ -- cgit v1.2.3 From a958988b62eb9ad33c0f41b4482cfbba4aa71564 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Tue, 22 Aug 2023 23:10:04 +0530 Subject: scripts/Makefile.lib: Add dtsi include files as deps for building DTB At the time of building the DTB, some dtsi files can be selected for inclusion. Have these dtsi files as dependencies for the DTB target. This also ensures generation or updating the dtsi files if need be. Signed-off-by: Sughosh Ganu Acked-by: Ilias Apalodimas Reviewed-by: Tom Rini --- scripts/Makefile.lib | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 368b5a3e28a..8c5e25c31c5 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -334,7 +334,9 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ ; \ sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) -$(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE +dtsi_include_list_deps = $(addprefix $(obj)/,$(subst $(quote),,$(dtsi_include_list))) + +$(obj)/%.dtb: $(src)/%.dts $(DTC) $(dtsi_include_list_deps) FORCE $(call if_changed_dep,dtc) pre-tmp = $(subst $(comma),_,$(dot-target).pre.tmp) -- cgit v1.2.3 From c7d4dfcd142d624ed43ac590c6ef5eca24233e30 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Tue, 22 Aug 2023 23:10:05 +0530 Subject: scripts/Makefile.lib: Embed capsule public key in platform's dtb The EFI capsule authentication logic in u-boot expects the public key in the form of an EFI Signature List(ESL) to be provided as part of the platform's dtb. Currently, the embedding of the ESL file into the dtb needs to be done manually. Add a target for generating a dtsi file which contains the signature node with the ESL file included as a property under the signature node. Include the dtsi file in the dtb. This brings the embedding of the ESL in the dtb into the U-Boot build flow. The path to the ESL file is specified through the CONFIG_EFI_CAPSULE_ESL_FILE symbol. Signed-off-by: Sughosh Ganu Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- scripts/Makefile.lib | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 8c5e25c31c5..8dc6ec82cd5 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -334,6 +334,21 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ ; \ sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) +quiet_cmd_capsule_esl_gen = CAPSULE_ESL_GEN $@ +cmd_capsule_esl_gen = \ + $(shell sed "s:ESL_BIN_FILE:$(capsule_esl_path):" $(capsule_esl_input_file) > $@) + +$(obj)/.capsule_esl.dtsi: FORCE + $(call cmd_capsule_esl_gen) + +capsule_esl_input_file=$(srctree)/lib/efi_loader/capsule_esl.dtsi.in +capsule_esl_dtsi = .capsule_esl.dtsi +capsule_esl_path=$(abspath $(srctree)/$(subst $(quote),,$(CONFIG_EFI_CAPSULE_ESL_FILE))) + +ifdef CONFIG_EFI_CAPSULE_AUTHENTICATE +dtsi_include_list += $(capsule_esl_dtsi) +endif + dtsi_include_list_deps = $(addprefix $(obj)/,$(subst $(quote),,$(dtsi_include_list))) $(obj)/%.dtb: $(src)/%.dts $(DTC) $(dtsi_include_list_deps) FORCE -- cgit v1.2.3 From ba5e3e1ed0afb3daa446d2168e5c8c9fe119cbaf Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 21 Aug 2023 21:16:48 -0600 Subject: event: Support a simple spy record The current event spy is always passed the event context and the event. The context is always NULL for a static spy. The event is not often used. Introduce a 'simple' spy which takes no arguments. This allows us to drop the adaptation code that many of these spy records use. Update the event script to find these in the image. Signed-off-by: Simon Glass --- scripts/event_dump.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/event_dump.py b/scripts/event_dump.py index 0117457526e..24dfe2bda91 100755 --- a/scripts/event_dump.py +++ b/scripts/event_dump.py @@ -19,8 +19,10 @@ from u_boot_pylib import tools # A typical symbol looks like this: # _u_boot_list_2_evspy_info_2_EVT_MISC_INIT_F_3_sandbox_misc_init_f -PREFIX = '_u_boot_list_2_evspy_info_2_' -RE_EVTYPE = re.compile('%s(.*)_3_.*' % PREFIX) +PREFIX_FULL = '_u_boot_list_2_evspy_info_2_' +PREFIX_SIMPLE = '_u_boot_list_2_evspy_info_simple_2_' +RE_EVTYPE_FULL = re.compile('%s(.*)_3_.*' % PREFIX_FULL) +RE_EVTYPE_SIMPLE = re.compile('%s(.*)_3_.*' % PREFIX_SIMPLE) def show_sym(fname, data, endian, evtype, sym): """Show information about an evspy entry @@ -88,12 +90,14 @@ def show_event_spy_list(fname, endian): fname (str): Filename of ELF file endian (str): Endianness to use ('little', 'big', 'auto') """ - syms = elf.GetSymbolFileOffset(fname, [PREFIX]) + syms = elf.GetSymbolFileOffset(fname, [PREFIX_FULL, PREFIX_SIMPLE]) data = tools.read_file(fname) print('%-20s %-30s %s' % ('Event type', 'Id', 'Source location')) print('%-20s %-30s %s' % ('-' * 20, '-' * 30, '-' * 30)) for name, sym in syms.items(): - m_evtype = RE_EVTYPE.search(name) + m_evtype = RE_EVTYPE_FULL.search(name) + if not m_evtype: + m_evtype = RE_EVTYPE_SIMPLE.search(name) evtype = m_evtype .group(1) show_sym(fname, data, endian, evtype, sym) -- cgit v1.2.3 From 48bf738e3622a94b96a57055ff0f6466f5830bd4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 31 Aug 2023 11:20:52 -0600 Subject: Allow Python packages to be dropped When building in a portage chroot, we do not have the environment needed to build pylibfdt. It is instead build as a separate package. Provide a build option to tell U-Boot to skip this part of the build. We still need it to use binman, etc. but don't need it to build its dependencies. Signed-off-by: Simon Glass Reviewed-by: Mike Frysinger [s/build bytes/builds bytes in tools.rst] Signed-off-by: Bin Meng --- scripts/dtc/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 58d879dd11f..faa72d95e28 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -19,4 +19,6 @@ HOSTCFLAGS_dtc-parser.tab.o := -I$(src) $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h # Added for U-Boot +ifeq ($(PYTHON_ENABLE),y) subdir-$(CONFIG_PYLIBFDT) += pylibfdt +endif -- cgit v1.2.3