From patchwork Wed Sep 4 23:47:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791508 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F1B61865E8; Wed, 4 Sep 2024 23:48:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493695; cv=none; b=Bp2H+aKTV3dPMJhwSFx34DTAqQcZK8lbAgP2MaoHkruwehCZmAGK5DvoOqzCqBO6V3ztgGLBRctx0+doNTqXWTweZFe7/psvbUYDZT1XMFo3PNjXEAFkgKwFlMso7hhTsoEql6R/ZObzYJkkykTPwvaanxA+cg8v8Ue88AEID3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493695; c=relaxed/simple; bh=7exJ6iWjWavlMXuLRQ9WRoHQOnMw1lBsb8ceOLpZsRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jbXnr5+0hGJO7Z0LmMb/5S42WbqUNUw4/wgDPHkejiSQSzX34Im0vFA29h7taXZnbRx/gxdqpfwq3ln4USpxF1vAF53olGtYOPq1FQtWZ49DA78htoCqpM2p+JDh4WXDz+akWa7dKY/WXqwe5DUHKQi+AyyJ/lHXkz7UZtoRH/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WOVd3pae; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WOVd3pae" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9724DC4CEC3; Wed, 4 Sep 2024 23:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493694; bh=7exJ6iWjWavlMXuLRQ9WRoHQOnMw1lBsb8ceOLpZsRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WOVd3paeevBj5YOl3wu7mYGb5u2Z69iUi5zvqRoh0g1/hFWOllNhmz7IQCl6hqgtc wTEXpGsqQf0tg7qrTHiVk/knj1jQgLAlBC7M71kllOWhWgfrJtnUbU7F8g09nggEO8 TGyQiuR1bH4PZ56i8ukJ/qfmZliI/Yt48ScivKtZC1bYq1lcPoyPSX1EtSZ+EwOiye SO+Q1c6/cy9HCONzbRd9N7pjUoRlnc+xkawIVzCMc1RSNx53zw7vKZxygaR+r6ymYO 3YkMkB8ZYVCqMkVVGUw2Lhufu7UbgcruHVPfwOhnWicSH8+TpFbt+SMRLs5mmvnWyz QIkjEiswGQNww== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 01/15] kbuild: add intermediate targets for Flex/Bison in scripts/Makefile.host Date: Thu, 5 Sep 2024 08:47:37 +0900 Message-ID: <20240904234803.698424-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Flex and Bison are used only for host programs. Move their intermediate target processing from scripts/Makefile.build to scripts/Makefile.host. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 35 ++++++++++++++++------------------- scripts/Makefile.host | 5 +++++ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a5ac8ed1936f..4b6942653093 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -41,20 +41,6 @@ include $(srctree)/scripts/Makefile.compiler include $(kbuild-file) include $(srctree)/scripts/Makefile.lib -# Do not include hostprogs rules unless needed. -# $(sort ...) is used here to remove duplicated words and excessive spaces. -hostprogs := $(sort $(hostprogs)) -ifneq ($(hostprogs),) -include $(srctree)/scripts/Makefile.host -endif - -# Do not include userprogs rules unless needed. -# $(sort ...) is used here to remove duplicated words and excessive spaces. -userprogs := $(sort $(userprogs)) -ifneq ($(userprogs),) -include $(srctree)/scripts/Makefile.userprogs -endif - ifndef obj $(warning kbuild: Makefile.build is included improperly) endif @@ -452,13 +438,24 @@ intermediate_targets = $(foreach sfx, $(2), \ # %.asn1.o <- %.asn1.[ch] <- %.asn1 # %.dtb.o <- %.dtb.S <- %.dtb <- %.dts # %.dtbo.o <- %.dtbo.S <- %.dtbo <- %.dtso -# %.lex.o <- %.lex.c <- %.l -# %.tab.o <- %.tab.[ch] <- %.y targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \ $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \ - $(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) \ - $(call intermediate_targets, .lex.o, .lex.c) \ - $(call intermediate_targets, .tab.o, .tab.c .tab.h) + $(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) + +# Include additional build rules when necessary +# --------------------------------------------------------------------------- + +# $(sort ...) is used here to remove duplicated words and excessive spaces. +hostprogs := $(sort $(hostprogs)) +ifneq ($(hostprogs),) +include $(srctree)/scripts/Makefile.host +endif + +# $(sort ...) is used here to remove duplicated words and excessive spaces. +userprogs := $(sort $(userprogs)) +ifneq ($(userprogs),) +include $(srctree)/scripts/Makefile.userprogs +endif # Build # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.host b/scripts/Makefile.host index e85be7721a48..e01c13a588dd 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -160,3 +160,8 @@ $(host-rust): $(obj)/%: $(src)/%.rs FORCE targets += $(host-csingle) $(host-cmulti) $(host-cobjs) \ $(host-cxxmulti) $(host-cxxobjs) $(host-rust) + +# %.lex.o <- %.lex.c <- %.l +# %.tab.o <- %.tab.[ch] <- %.y +targets += $(call intermediate_targets, .lex.o, .lex.c) \ + $(call intermediate_targets, .tab.o, .tab.c .tab.h) From patchwork Wed Sep 4 23:47:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791509 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0775018891F; Wed, 4 Sep 2024 23:48:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493698; cv=none; b=X6wLuq8DxyzDAY2wxZ5ZbqYssZND1P67A+/1PhTyvRuZDN4GPrCSJTf1riOyJlYodnhv0d9W6+XPG3PeY8CkqSC1KNTgFGc/675RLAo5vEF+FTP+6jlVEri6Dsg3VT9fcq6/ZQtz57aK6kOjnnmQb0oBJAoZ9Iev4JtkGqp1hss= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493698; c=relaxed/simple; bh=psn2cg3kyw66zSxZb5tD/YEWBmfy/XReWDQ1aOqEAdM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A2k6+O2G1zaxfPoVqYIHt6bowTN47kkcnGSBR5Bnm/ifLbhY2sH4Ty0E0+1iBSqN3PrX/DAUcmMDVhrYUxjkvLRFYh8zavskzI/xqPENJ7kiZf2pZ38XFLJRznQSVooqsBlLypz4YZjmCAtRdE+md6XVfdtAWCKGuwGdl1X8MRk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iCDqdtEb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iCDqdtEb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E2E2C4CEC8; Wed, 4 Sep 2024 23:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493697; bh=psn2cg3kyw66zSxZb5tD/YEWBmfy/XReWDQ1aOqEAdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iCDqdtEb/NRkunhEP8DfaaSic38AIyn8tNJ2rLGAKtUyPyXxqKtGYCgxwgpKxaiLS HIbtbeyaKVWTHHR0C/Jku8elOT85u3lG57cZVIW23PluRNVRjG7sSjOCNxb6eA9H/E QNu1ebIEh/3Y6kyQLG22BvnXnyvX+euseFrhJFKs4ofAOsVbfrlZKTeM4HHrvGu3Om 3k1NHmeefVxzVwcmok8JUFSRutb9vLQCdpUL/Ruriq6H9KNLdEUS8/WEKlBx81mojx DRVROamh1TBiv44Tp/PYfRYappZ56LNg0Vi7DD9f5LoUU8RC5gxVUz4N0Lt/EBvCK7 AwGYysqRHHZ+A== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 02/15] kbuild: split device tree build rules into scripts/Makefile.dtbs Date: Thu, 5 Sep 2024 08:47:38 +0900 Message-ID: <20240904234803.698424-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 scripts/Makefile.lib is included not only from scripts/Makefile.build but also from scripts/Makefile.{modfinal,package,vmlinux,vmlinux_o}, where DT build rules are not required. Split the DT build rules out to scripts/Makefile.dtbs, and include it only when necessary. Signed-off-by: Masahiro Yamada Reviewed-by: Rob Herring (Arm) --- drivers/of/fdt.c | 2 +- drivers/of/unittest.c | 4 +- scripts/Makefile.build | 25 +++----- scripts/Makefile.dtbs | 142 +++++++++++++++++++++++++++++++++++++++++ scripts/Makefile.lib | 115 --------------------------------- 5 files changed, 153 insertions(+), 135 deletions(-) create mode 100644 scripts/Makefile.dtbs diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 68103ad230ee..4d528c10df3a 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -34,7 +34,7 @@ /* * __dtb_empty_root_begin[] and __dtb_empty_root_end[] magically created by - * cmd_dt_S_dtb in scripts/Makefile.lib + * cmd_wrap_S_dtb in scripts/Makefile.dtbs */ extern uint8_t __dtb_empty_root_begin[]; extern uint8_t __dtb_empty_root_end[]; diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index c830f346df45..fd8cb931b1cc 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1861,7 +1861,7 @@ static int __init unittest_data_add(void) struct device_node *unittest_data_node = NULL, *np; /* * __dtbo_testcases_begin[] and __dtbo_testcases_end[] are magically - * created by cmd_dt_S_dtbo in scripts/Makefile.lib + * created by cmd_wrap_S_dtbo in scripts/Makefile.dtbs */ extern uint8_t __dtbo_testcases_begin[]; extern uint8_t __dtbo_testcases_end[]; @@ -3525,7 +3525,7 @@ static void __init of_unittest_lifecycle(void) /* * __dtbo_##overlay_name##_begin[] and __dtbo_##overlay_name##_end[] are - * created by cmd_dt_S_dtbo in scripts/Makefile.lib + * created by cmd_wrap_S_dtbo in scripts/Makefile.dtbs */ #define OVERLAY_INFO_EXTERN(overlay_name) \ diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 4b6942653093..6385e7aa5dbb 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -57,7 +57,6 @@ endif # subdir-builtin and subdir-modorder may contain duplications. Use $(sort ...) subdir-builtin := $(sort $(filter %/built-in.a, $(real-obj-y))) subdir-modorder := $(sort $(filter %/modules.order, $(obj-m))) -subdir-dtbslist := $(sort $(filter %/dtbs-list, $(dtb-y))) targets-for-builtin := $(extra-y) @@ -349,7 +348,7 @@ $(obj)/%.o: $(obj)/%.S FORCE targets += $(filter-out $(subdir-builtin), $(real-obj-y)) targets += $(filter-out $(subdir-modorder), $(real-obj-m)) -targets += $(real-dtb-y) $(lib-y) $(always-y) +targets += $(lib-y) $(always-y) # Linker scripts preprocessor (.lds.S -> .lds) # --------------------------------------------------------------------------- @@ -375,7 +374,6 @@ $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler # To build objects in subdirs, we need to descend into the directories $(subdir-builtin): $(obj)/%/built-in.a: $(obj)/% ; $(subdir-modorder): $(obj)/%/modules.order: $(obj)/% ; -$(subdir-dtbslist): $(obj)/%/dtbs-list: $(obj)/% ; # # Rule to compile a set of .o files into one .a file (without symbol table) @@ -391,12 +389,8 @@ quiet_cmd_ar_builtin = AR $@ $(obj)/built-in.a: $(real-obj-y) FORCE $(call if_changed,ar_builtin) -# -# Rule to create modules.order and dtbs-list -# -# This is a list of build artifacts (module or dtb) from the current Makefile -# and its sub-directories. The timestamp should be updated when any of the -# member files. +# This is a list of build artifacts from the current Makefile and its +# sub-directories. The timestamp should be updated when any of the member files. cmd_gen_order = { $(foreach m, $(real-prereqs), \ $(if $(filter %/$(notdir $@), $m), cat $m, echo $m);) :; } \ @@ -405,9 +399,6 @@ cmd_gen_order = { $(foreach m, $(real-prereqs), \ $(obj)/modules.order: $(obj-m) FORCE $(call if_changed,gen_order) -$(obj)/dtbs-list: $(dtb-y) FORCE - $(call if_changed,gen_order) - # # Rule to compile a set of .o files into one .a file (with symbol table) # @@ -436,11 +427,7 @@ intermediate_targets = $(foreach sfx, $(2), \ $(patsubst %$(strip $(1)),%$(sfx), \ $(filter %$(strip $(1)), $(targets)))) # %.asn1.o <- %.asn1.[ch] <- %.asn1 -# %.dtb.o <- %.dtb.S <- %.dtb <- %.dts -# %.dtbo.o <- %.dtbo.S <- %.dtbo <- %.dtso -targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \ - $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \ - $(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) +targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) # Include additional build rules when necessary # --------------------------------------------------------------------------- @@ -457,6 +444,10 @@ ifneq ($(userprogs),) include $(srctree)/scripts/Makefile.userprogs endif +ifneq ($(need-dtbslist)$(dtb-y)$(dtb-)$(filter %.dtb.o %.dtbo.o,$(targets)),) +include $(srctree)/scripts/Makefile.dtbs +endif + # Build # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs new file mode 100644 index 000000000000..46009d5f1486 --- /dev/null +++ b/scripts/Makefile.dtbs @@ -0,0 +1,142 @@ +# SPDX-License-Identifier: GPL-2.0-only + +# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built +dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-) + +# Composite DTB (i.e. DTB constructed by overlay) +multi-dtb-y := $(call multi-search, $(dtb-y), .dtb, -dtbs) +# Primitive DTB compiled from *.dts +real-dtb-y := $(call real-search, $(dtb-y), .dtb, -dtbs) +# Base DTB that overlay is applied onto +base-dtb-y := $(filter %.dtb, $(call real-search, $(multi-dtb-y), .dtb, -dtbs)) + +dtb-y := $(addprefix $(obj)/, $(dtb-y)) +multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y)) +real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y)) + +always-y += $(dtb-y) +targets += $(real-dtb-y) + +# dtbs-list +# --------------------------------------------------------------------------- + +ifdef need-dtbslist +subdir-dtbslist := $(addsuffix /dtbs-list, $(subdir-ym)) +dtb-y += $(subdir-dtbslist) +always-y += $(obj)/dtbs-list +endif + +$(subdir-dtbslist): $(obj)/%/dtbs-list: $(obj)/% ; + +$(obj)/dtbs-list: $(dtb-y) FORCE + $(call if_changed,gen_order) + +# Assembly file to wrap dtb(o) +# --------------------------------------------------------------------------- + +# Generate an assembly file to wrap the output of the device tree compiler +quiet_cmd_wrap_S_dtb = WRAP $@ + cmd_wrap_S_dtb = { \ + symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \ + echo '\#include '; \ + echo '.section .dtb.init.rodata,"a"'; \ + echo '.balign STRUCT_ALIGNMENT'; \ + echo ".global $${symbase}_begin"; \ + echo "$${symbase}_begin:"; \ + echo '.incbin "$<" '; \ + echo ".global $${symbase}_end"; \ + echo "$${symbase}_end:"; \ + echo '.balign STRUCT_ALIGNMENT'; \ + } > $@ + +$(obj)/%.dtb.S: $(obj)/%.dtb FORCE + $(call if_changed,wrap_S_dtb) + +$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE + $(call if_changed,wrap_S_dtb) + +# Schema check +# --------------------------------------------------------------------------- + +ifneq ($(CHECK_DTBS),) +DT_CHECKER ?= dt-validate +DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m) +DT_BINDING_DIR := Documentation/devicetree/bindings +DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json +dtb-check-enabled = $(if $(filter %.dtb, $@),y) +endif + +quiet_dtb_check_tag = $(if $(dtb-check-enabled),[C], ) +cmd_dtb_check = $(if $(dtb-check-enabled),; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true) + +# Overlay +# --------------------------------------------------------------------------- + +# NOTE: +# Do not replace $(filter %.dtb %.dtbo, $^) with $(real-prereqs). When a single +# DTB is turned into a multi-blob DTB, $^ will contain header file dependencies +# recorded in the .*.cmd file. +quiet_cmd_fdtoverlay = OVL $(quiet_dtb_check_tag) $@ + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(filter %.dtb %.dtbo, $^) $(cmd_dtb_check) + +$(multi-dtb-y): $(DT_TMP_SCHEMA) FORCE + $(call if_changed,fdtoverlay) +$(call multi_depend, $(multi-dtb-y), .dtb, -dtbs) + +# DTC +# --------------------------------------------------------------------------- + +DTC ?= $(objtree)/scripts/dtc/dtc +DTC_FLAGS += -Wno-unique_unit_address + +# Disable noisy checks by default +ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) +DTC_FLAGS += -Wno-unit_address_vs_reg \ + -Wno-avoid_unnecessary_addr_size \ + -Wno-alias_paths \ + -Wno-graph_child_address \ + -Wno-simple_bus_reg +else +DTC_FLAGS += -Wunique_unit_address_if_enabled +endif + +ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),) +DTC_FLAGS += -Wnode_name_chars_strict \ + -Wproperty_name_chars_strict \ + -Wunique_unit_address +endif + +DTC_FLAGS += $(DTC_FLAGS_$(target-stem)) + +# Set -@ if the target is a base DTB that overlay is applied onto +DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@) + +DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes + +dtc_cpp_flags = -Wp,-MMD,$(depfile).pre.tmp -nostdinc -I $(DTC_INCLUDE) -undef -D__DTS__ + +dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) + +quiet_cmd_dtc = DTC $(quiet_dtb_check_tag) $@ + cmd_dtc = \ + $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ + $(DTC) -o $@ -b 0 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) \ + $(DTC_FLAGS) -d $(depfile).dtc.tmp $(dtc-tmp) ; \ + cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) \ + $(cmd_dtb_check) + +$(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE + $(call if_changed_dep,dtc) + +$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE + $(call if_changed_dep,dtc) + +# targets +# --------------------------------------------------------------------------- + +targets += $(always-y) + +# %.dtb.o <- %.dtb.S <- %.dtb <- %.dts +# %.dtbo.o <- %.dtbo.S <- %.dtbo <- %.dtso +targets += $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \ + $(call intermediate_targets, .dtbo.o, .dtbo.S .dtbo) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 207325eaf1d1..4fea9e9bec3c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -45,11 +45,6 @@ else obj-y := $(filter-out %/, $(obj-y)) endif -ifdef need-dtbslist -dtb-y += $(addsuffix /dtbs-list, $(subdir-ym)) -always-y += dtbs-list -endif - # Expand $(foo-objs) $(foo-y) etc. by replacing their individuals suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s)))) # List composite targets that are constructed by combining other targets @@ -80,19 +75,6 @@ always-y += $(hostprogs-always-y) $(hostprogs-always-m) userprogs += $(userprogs-always-y) $(userprogs-always-m) always-y += $(userprogs-always-y) $(userprogs-always-m) -# DTB -# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built -dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-) - -# Composite DTB (i.e. DTB constructed by overlay) -multi-dtb-y := $(call multi-search, $(dtb-y), .dtb, -dtbs) -# Primitive DTB compiled from *.dts -real-dtb-y := $(call real-search, $(dtb-y), .dtb, -dtbs) -# Base DTB that overlay is applied onto -base-dtb-y := $(filter %.dtb, $(call real-search, $(multi-dtb-y), .dtb, -dtbs)) - -always-y += $(dtb-y) - # Add subdir path ifneq ($(obj),.) @@ -104,9 +86,6 @@ lib-y := $(addprefix $(obj)/,$(lib-y)) real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m)) -dtb-y := $(addprefix $(obj)/, $(dtb-y)) -multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y)) -real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) endif @@ -255,12 +234,6 @@ cpp_flags = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) -DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes - -dtc_cpp_flags = -Wp,-MMD,$(depfile).pre.tmp -nostdinc \ - $(addprefix -I,$(DTC_INCLUDE)) \ - -undef -D__DTS__ - ifdef CONFIG_OBJTOOL objtool := $(objtree)/tools/objtool/objtool @@ -350,94 +323,6 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ quiet_cmd_gzip = GZIP $@ cmd_gzip = cat $(real-prereqs) | $(KGZIP) -n -f -9 > $@ -# DTC -# --------------------------------------------------------------------------- -DTC ?= $(objtree)/scripts/dtc/dtc -DTC_FLAGS += \ - -Wno-unique_unit_address - -# Disable noisy checks by default -ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) -DTC_FLAGS += -Wno-unit_address_vs_reg \ - -Wno-avoid_unnecessary_addr_size \ - -Wno-alias_paths \ - -Wno-graph_child_address \ - -Wno-simple_bus_reg -else -DTC_FLAGS += \ - -Wunique_unit_address_if_enabled -endif - -ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),) -DTC_FLAGS += -Wnode_name_chars_strict \ - -Wproperty_name_chars_strict \ - -Wunique_unit_address -endif - -DTC_FLAGS += $(DTC_FLAGS_$(target-stem)) - -# Set -@ if the target is a base DTB that overlay is applied onto -DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@) - -# Generate an assembly file to wrap the output of the device tree compiler -quiet_cmd_wrap_S_dtb = WRAP $@ - cmd_wrap_S_dtb = { \ - symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \ - echo '\#include '; \ - echo '.section .dtb.init.rodata,"a"'; \ - echo '.balign STRUCT_ALIGNMENT'; \ - echo ".global $${symbase}_begin"; \ - echo "$${symbase}_begin:"; \ - echo '.incbin "$<" '; \ - echo ".global $${symbase}_end"; \ - echo "$${symbase}_end:"; \ - echo '.balign STRUCT_ALIGNMENT'; \ - } > $@ - -$(obj)/%.dtb.S: $(obj)/%.dtb FORCE - $(call if_changed,wrap_S_dtb) - -$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE - $(call if_changed,wrap_S_dtb) - -quiet_dtb_check_tag = $(if $(dtb-check-enabled),[C], ) -cmd_dtb_check = $(if $(dtb-check-enabled),; $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ || true) - -quiet_cmd_dtc = DTC $(quiet_dtb_check_tag) $@ -cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ - $(DTC) -o $@ -b 0 \ - $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ - -d $(depfile).dtc.tmp $(dtc-tmp) ; \ - cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) \ - $(cmd_dtb_check) - -# NOTE: -# Do not replace $(filter %.dtb %.dtbo, $^) with $(real-prereqs). When a single -# DTB is turned into a multi-blob DTB, $^ will contain header file dependencies -# recorded in the .*.cmd file. -quiet_cmd_fdtoverlay = OVL $(quiet_dtb_check_tag) $@ - cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(filter %.dtb %.dtbo, $^) $(cmd_dtb_check) - -$(multi-dtb-y): FORCE - $(call if_changed,fdtoverlay) -$(call multi_depend, $(multi-dtb-y), .dtb, -dtbs) - -ifneq ($(CHECK_DTBS),) -DT_CHECKER ?= dt-validate -DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m) -DT_BINDING_DIR := Documentation/devicetree/bindings -DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.json -dtb-check-enabled = $(if $(filter %.dtb, $@),y) -endif - -$(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE - $(call if_changed_dep,dtc) - -$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE - $(call if_changed_dep,dtc) - -dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) - # Bzip2 # --------------------------------------------------------------------------- From patchwork Wed Sep 4 23:47:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791510 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06EE4188A11; Wed, 4 Sep 2024 23:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493701; cv=none; b=nGeSgM0zoza816RfkEY6iDedynMHGyUEKC95aFaosv/m/cR4o9suKprN3PBp3WZcOWvtucTL/G3OIR6FEvw5e5e3lLm138tcPTyVO5x7nrUtDdb7XVl1mvHUBVjf088anfNCwdb7EMI64SoviOGjoJdUcw6+X42sFLCpOMszYJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493701; c=relaxed/simple; bh=i8mV+tLCUsiRlMheHxr5JXcHpK1KBT9MA15Lx4XtwsA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ItoimNL2P8XRqhvovHqHng09MDG4YkssJxGivdgNCYcBaqm5GkvOXzPr05EnEs7IddMKKyMA7MG9KUKLTjn/BJXAvnbc7ykiqzUfD3kGJnRFjsA5zLEm3gGrnxgt31Oc1nZNV1huQ7AsAiQfpKUpXeBAYe5RTvUgxZnHEM6IdgY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p01iU+/D; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p01iU+/D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66AE1C4CECA; Wed, 4 Sep 2024 23:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493700; bh=i8mV+tLCUsiRlMheHxr5JXcHpK1KBT9MA15Lx4XtwsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p01iU+/DYZkCBKD+GyQL6lhOUiwSAj3Q1p6CnM5OK22KlkOrax1RJmnOt6LB+Apcp bBsoAvnElMn/98XgiSLlemsa6C5HW/rv7FKWbV6kl3CK0ePwXVTZbjoL/ze9Fw35XS ZEREPhLP5y69C6m0zSQK869zMAs82s9olIqLjlw/pJOMh0mG/dVnu2rGBGfLFYt3UN tI68kjCfCFD7m+fooNeuc9s8i0JX+k92EzrAa6o2Xd3XrtR0rJmnaR2F8AwHwjQfny HMsXX52wEpzDPlUyGWF3q+UPziBedRSvRDFKfyH8H63HLv61KQxdKOEhJkAhmGjAWC HCCTVgsTH+96w== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 03/15] kbuild: move non-boot builtin DTBs to .init.rodata section Date: Thu, 5 Sep 2024 08:47:39 +0900 Message-ID: <20240904234803.698424-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some architectures support embedding boot DTB(s) in vmlinux. These architectures, except MIPS and MicroBlaze, expect a single DTB in the .dtb.init.rodata section. MIPS embeds multiple DTBs in vmlinux. MicroBlaze embeds a DTB in its own __fdt_blob section instead of the .dtb.init.rodata section. For example, RISC-V previously allowed embedding multiple DTBs, but only the first DTB in the .dtb.init.rodata section was used. Commit 2672031b20f6 ("riscv: dts: Move BUILTIN_DTB_SOURCE to common Kconfig") ensured only one boot DTB is embedded. Meanwhile, commit 7b937cc243e5 ("of: Create of_root if no dtb provided by firmware") introduced another DTB into the .dtb.init.rodata section. The symbol dump (sorted by address) for ARCH=riscv nommu_k210_defconfig is now as follows: 00000000801290e0 D __dtb_start 00000000801290e0 D __dtb_k210_generic_begin 000000008012b571 D __dtb_k210_generic_end 000000008012b580 D __dtb_empty_root_begin 000000008012b5c8 D __dtb_empty_root_end 000000008012b5e0 D __dtb_end The .dtb.init.rodata section contains the following two DTB files: arch/riscv/boot/dts/canaan/k210_generic.dtb drivers/of/empty_root.dtb This is not an immediate problem because the boot code chooses the first DTB, k210_generic.dtb. The second one, empty_root.dtb is ignored. However, relying on the link order (i.e., the order in Makefiles) is fragile. Only the boot DTB should be placed in the .dtb.init.rodata because the arch boot code generally does not know the DT name, thus it uses the __dtb_start symbol to find it. empty_root.dtb is looked up by name, so it can be moved to the generic .init.rodata section. When CONFIG_OF_UNITTEST is enabled, more unittest DTBOs are embedded in the .dtb.init.rodata section. These are also looked up by name, so can be moved to the .init.rodata section. I added the __initdata annotation to the overlay_info data array because modpost knows the .init.rodata section is discarded, and would otherwise warn about it. The implementation is kind of cheesy; the section is .dtb.init.rodata under the arch/ directory, and .init.rodata section otherwise. This will be refactored later. Signed-off-by: Masahiro Yamada Reviewed-by: Rob Herring (Arm) --- drivers/of/unittest.c | 2 +- scripts/Makefile.dtbs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index fd8cb931b1cc..f5d18ae01c90 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -3585,7 +3585,7 @@ OVERLAY_INFO_EXTERN(overlay_bad_symbol); OVERLAY_INFO_EXTERN(overlay_bad_unresolved); /* entries found by name */ -static struct overlay_info overlays[] = { +static __initdata struct overlay_info overlays[] = { OVERLAY_INFO(overlay_base, -9999, 0), OVERLAY_INFO(overlay, 0, 0), OVERLAY_INFO(overlay_0, 0, 0), diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs index 46009d5f1486..55998b878e54 100644 --- a/scripts/Makefile.dtbs +++ b/scripts/Makefile.dtbs @@ -34,12 +34,14 @@ $(obj)/dtbs-list: $(dtb-y) FORCE # Assembly file to wrap dtb(o) # --------------------------------------------------------------------------- +builtin-dtb-section = $(if $(filter arch/%, $(obj)),.dtb.init.rodata,.init.rodata) + # Generate an assembly file to wrap the output of the device tree compiler quiet_cmd_wrap_S_dtb = WRAP $@ cmd_wrap_S_dtb = { \ symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \ echo '\#include '; \ - echo '.section .dtb.init.rodata,"a"'; \ + echo '.section $(builtin-dtb-section),"a"'; \ echo '.balign STRUCT_ALIGNMENT'; \ echo ".global $${symbase}_begin"; \ echo "$${symbase}_begin:"; \ From patchwork Wed Sep 4 23:47:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791511 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 975A818950B; Wed, 4 Sep 2024 23:48:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493703; cv=none; b=sYDiIueje9DN/QXnug+dSLlSN71uvUXEybXDhh2oMDJXUQC3CJj1Qd1RTRY7DGDt+0kWi31EIs2RqorR9KpCs1eJr09fzzgUOiaW3ZDGw8fYB+dwwzA6Kv+DWPEVY8cqy9edEmcjgf0CNkS+1Wt0z6NQnxbZSGtYpKKDGWKDgiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493703; c=relaxed/simple; bh=nsKwaA1C+DPeHbXqGcBjvOLIHgXiFg4rrFKZpG8IZuo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d7isZF91I4KmIEWWeIDByY9L8GIzV1cw8a42MYC2JyIZMjbSoJfSV4cYOQO3KheVMjSZP4uZgiBYtoa1wm3GAHUCXY/ojJ/UlBrUQ2jspbN77Lo/QOA9SIKY1CoyXK2rrFvVB652AFaWSI9nZ/Nyv8W9YDFwduW0vJEvo4crUXE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X36dfIG0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X36dfIG0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C6CDC4CEC2; Wed, 4 Sep 2024 23:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493703; bh=nsKwaA1C+DPeHbXqGcBjvOLIHgXiFg4rrFKZpG8IZuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X36dfIG0wtcgWQzkkeDHpAyyy7pGPLtXcd3jbuFGMOXbrfAVNzUobsJqzX/p+sC0Q AbUbU4aws5JbrmphPMcCQ7MYHbG4F4boFFsW+/e/i+qXTMSUjRU4T5aczjlIxJ5Pw4 t34G6/LKKvTJvVADNXak2AQF8cQK4NlwOLTxdGz+AhrhppnCiWJ4jsI7ZxQQNvw7fD gAsnyHevuSc63Bwbr0Q/VSIwdAKzcjAeU6dX84uJhzAfhzlTAXAzhg/p7+CklJ0Utp R+UYNm9msmK+XOypnjCuSyfhyqmTPDq2PfN6hPFsL9cn097TWpteabOhfpjZyRNBaf B8Fg46ryR3CeQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 04/15] kbuild: add generic support for built-in boot DTBs Date: Thu, 5 Sep 2024 08:47:40 +0900 Message-ID: <20240904234803.698424-5-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some architectures embed boot DTBs in vmlinux. A potential issue for these architectures is a race condition during parallel builds because Kbuild descends into arch/*/boot/dts/ twice. One build thread is initiated by the 'dtbs' target, which is a prerequisite of the 'all' target in the top-level Makefile: ifdef CONFIG_OF_EARLY_FLATTREE all: dtbs endif For architectures that support the embedded boot dtb, arch/*/boot/dts/ is visited also during the ordinary directory traversal in order to build obj-y objects that wrap DTBs. Since these build threads are unaware of each other, they can run simultaneously during parallel builds. This commit introduces a generic build rule to scripts/Makefile.vmlinux to support embedded boot DTBs in a race-free way. Architectures that want to use this rule need to select CONFIG_GENERIC_BUILTIN_DTB. After the migration, Makefiles under arch/*/boot/dts/ will be visited only once to build only *.dtb files. This change also aims to unify the CONFIG options used for embedded DTBs support. Currently, different architectures use different CONFIG options for the same purposes. The CONFIG options are unified as follows: - CONFIG_GENERIC_BUILTIN_DTB This enables the generic rule for embedded boot DTBs. This will be renamed to CONFIG_BUILTIN_DTB after all architectures migrate to the generic rule. - CONFIG_BUILTIN_DTB_NAME This specifies the path to the embedded DTB. (relative to arch/*/boot/dts/) - CONFIG_BUILTIN_DTB_ALL If this is enabled, all DTB files compiled under arch/*/boot/dts/ are embedded into vmlinux. Only used by MIPS. Signed-off-by: Masahiro Yamada --- Makefile | 7 ++++++- drivers/of/Kconfig | 6 ++++++ scripts/Makefile.vmlinux | 44 ++++++++++++++++++++++++++++++++++++++++ scripts/link-vmlinux.sh | 4 ++++ 4 files changed, 60 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 145112bf281a..1c765c12ab9e 100644 --- a/Makefile +++ b/Makefile @@ -1417,6 +1417,10 @@ ifdef CONFIG_OF_EARLY_FLATTREE all: dtbs endif +ifdef CONFIG_GENERIC_BUILTIN_DTB +vmlinux: dtbs +endif + endif PHONY += scripts_dtc @@ -1483,7 +1487,8 @@ endif # CONFIG_MODULES CLEAN_FILES += vmlinux.symvers modules-only.symvers \ modules.builtin modules.builtin.modinfo modules.nsdeps \ compile_commands.json rust/test \ - rust-project.json .vmlinux.objs .vmlinux.export.c + rust-project.json .vmlinux.objs .vmlinux.export.c \ + .builtin-dtbs-list .builtin-dtb.S # Directories & files removed with 'make mrproper' MRPROPER_FILES += include/config include/generated \ diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index dd726c7056bf..5142e7d7fef8 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -2,6 +2,12 @@ config DTC bool +config GENERIC_BUILTIN_DTB + bool + +config BUILTIN_DTB_ALL + bool + menuconfig OF bool "Device Tree and Open Firmware support" help diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index 5ceecbed31eb..4626b472da49 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -17,6 +17,50 @@ quiet_cmd_cc_o_c = CC $@ %.o: %.c FORCE $(call if_changed_dep,cc_o_c) +quiet_cmd_as_o_S = AS $@ + cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< + +%.o: %.S FORCE + $(call if_changed_dep,as_o_S) + +# Built-in dtb +# --------------------------------------------------------------------------- + +quiet_cmd_wrap_dtbs = WRAP $@ + cmd_wrap_dtbs = { \ + echo '\#include '; \ + echo '.section .dtb.init.rodata,"a"'; \ + while read dtb; do \ + symbase=__dtb_$$(basename -s .dtb "$${dtb}" | tr - _); \ + echo '.balign STRUCT_ALIGNMENT'; \ + echo ".global $${symbase}_begin"; \ + echo "$${symbase}_begin:"; \ + echo '.incbin "'$$dtb'" '; \ + echo ".global $${symbase}_end"; \ + echo "$${symbase}_end:"; \ + done < $<; \ + } > $@ + +.builtin-dtbs.S: .builtin-dtbs-list FORCE + $(call if_changed,wrap_dtbs) + +quiet_cmd_gen_dtbs_list = GEN $@ + cmd_gen_dtbs_list = \ + $(if $(CONFIG_BUILTIN_DTB_NAME), echo "arch/$(SRCARCH)/boot/dts/$(CONFIG_BUILTIN_DTB_NAME).dtb",:) > $@ + +.builtin-dtbs-list: arch/$(SRCARCH)/boot/dts/dtbs-list FORCE + $(call if_changed,$(if $(CONFIG_BUILTIN_DTB_ALL),copy,gen_dtbs_list)) + +targets += .builtin-dtbs-list + +ifdef CONFIG_GENERIC_BUILTIN_DTB +targets += .builtin-dtbs.S .builtin-dtbs.o +vmlinux: .builtin-dtbs.o +endif + +# vmlinux +# --------------------------------------------------------------------------- + ifdef CONFIG_MODULES targets += .vmlinux.export.o vmlinux: .vmlinux.export.o diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index c27b4e969f20..bd196944e350 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -68,6 +68,10 @@ vmlinux_link() libs="${KBUILD_VMLINUX_LIBS}" fi + if is_enabled CONFIG_GENERIC_BUILTIN_DTB; then + objs="${objs} .builtin-dtbs.o" + fi + if is_enabled CONFIG_MODULES; then objs="${objs} .vmlinux.export.o" fi From patchwork Wed Sep 4 23:47:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791512 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AD7718A956; Wed, 4 Sep 2024 23:48:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493706; cv=none; b=BaSm+PYprF+jYrgf5YoTurczOgNNqH2yCfefhImtMoYevfwR2EWjwBqm+AdQcQmq9fKmOCHo8aBd0SpzBN4mA4D2fc4b6EYOC5ALkHtREVhE8XVSzAa73r3kGZwq/unKdSSEXRjc3+1SRzr2TJs5s2CUaOgcprr1rLzTuhfPVIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493706; c=relaxed/simple; bh=DmABIXiqMlKjw8vipv0+VS4xuXqSDmbddSZqsqM36bM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qe0HoE0IGB+h9h+9qKreOW3yaptqJz+YB7gj3Nnz+IgW0lEMyQnoeBmAMzaalU3HTZ6Q1fB9umaSUz1Nx162bTq2QxBtrTHU8/0F/fiqDfj4M4Fl4VpzWTT8xUqZL+SbphqBfcCLEOrMKeRoEtsmWGB3gJ2wNN1g0VNfr4QMIWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BqTwTwVU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BqTwTwVU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CAF6C4CEC3; Wed, 4 Sep 2024 23:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493706; bh=DmABIXiqMlKjw8vipv0+VS4xuXqSDmbddSZqsqM36bM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BqTwTwVUZAur7/lg6dVvjAba6rF+NIKCS18IWBXb15+i1RLEpZJqVGotXHZD/Kph2 rfGFjbDa7oCFYwXWzp+WsRUXfNd7/a/eaMn8FHX3+Uo608D+NiB0yHuhG25DV0sjzt zj1TswqP2EkTIfZHwtC0OAJIokeP6d7dvhs5tenp+SawsbA7SdVrwh2aQAtp0XETDT AYYVARz8k1MQ3tDHM+Grlq3oBrmS5NVWn5t5VIApa0e9eOcGLpDzhjRpWcyo0KQ7e4 oRZHiEYui/jbhI/h0WPFvxZ4/0OMF9D7BJF1drBmVjszV65kgm284tO+Zzh80HV5KF vmwblpvwGdtaA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 05/15] MIPS: migrate to generic rule for built-in DTBs Date: Thu, 5 Sep 2024 08:47:41 +0900 Message-ID: <20240904234803.698424-6-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB and BUILTIN_DTB_ALL when built-in DTB support is enabled. DTBs compiled under arch/mips/boot/dts/ will be wrapped and compiled in scripts/Makefile.vmlinux. Signed-off-by: Masahiro Yamada --- arch/mips/Kconfig | 2 ++ arch/mips/Makefile | 3 --- arch/mips/boot/dts/Makefile | 2 -- arch/mips/boot/dts/brcm/Makefile | 2 -- arch/mips/boot/dts/cavium-octeon/Makefile | 2 -- arch/mips/boot/dts/ingenic/Makefile | 2 -- arch/mips/boot/dts/lantiq/Makefile | 2 -- arch/mips/boot/dts/loongson/Makefile | 2 -- arch/mips/boot/dts/mscc/Makefile | 3 --- arch/mips/boot/dts/mti/Makefile | 2 -- arch/mips/boot/dts/pic32/Makefile | 2 -- arch/mips/boot/dts/ralink/Makefile | 2 -- 12 files changed, 2 insertions(+), 24 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 60077e576935..7bfe3fd011f4 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -28,10 +28,12 @@ config MIPS select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_LD_ORPHAN_WARN select BUILDTIME_TABLE_SORT + select BUILTIN_DTB_ALL if BUILTIN_DTB select CLONE_BACKWARDS select CPU_NO_EFFICIENT_FFS if (TARGET_ISA_REV < 1) select CPU_PM if CPU_IDLE || SUSPEND select GENERIC_ATOMIC64 if !64BIT + select GENERIC_BUILTIN_DTB if BUILTIN_DTB select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE select GENERIC_GETTIMEOFDAY diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 5785a3d5ccfb..be8cb44a89fd 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -423,9 +423,6 @@ endif CLEAN_FILES += vmlinux.32 vmlinux.64 -# device-trees -core-y += arch/mips/boot/dts/ - archprepare: ifdef CONFIG_MIPS32_N32 @$(kecho) ' Checking missing-syscalls for N32' diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile index e2476b12bb0c..ff468439a8c4 100644 --- a/arch/mips/boot/dts/Makefile +++ b/arch/mips/boot/dts/Makefile @@ -16,5 +16,3 @@ subdir-$(CONFIG_ATH79) += qca subdir-$(CONFIG_RALINK) += ralink subdir-$(CONFIG_MACH_REALTEK_RTL) += realtek subdir-$(CONFIG_FIT_IMAGE_FDT_XILFPGA) += xilfpga - -obj-$(CONFIG_BUILTIN_DTB) := $(addsuffix /, $(subdir-y)) diff --git a/arch/mips/boot/dts/brcm/Makefile b/arch/mips/boot/dts/brcm/Makefile index d85f446cc0ce..1798209697c6 100644 --- a/arch/mips/boot/dts/brcm/Makefile +++ b/arch/mips/boot/dts/brcm/Makefile @@ -33,5 +33,3 @@ dtb-$(CONFIG_DT_NONE) += \ bcm97420c.dtb \ bcm97425svmb.dtb \ bcm97435svmb.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/cavium-octeon/Makefile b/arch/mips/boot/dts/cavium-octeon/Makefile index 17aef35f311b..48085bca666c 100644 --- a/arch/mips/boot/dts/cavium-octeon/Makefile +++ b/arch/mips/boot/dts/cavium-octeon/Makefile @@ -1,4 +1,2 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/ingenic/Makefile b/arch/mips/boot/dts/ingenic/Makefile index 54aa0c4e6091..6e674f1a3aa3 100644 --- a/arch/mips/boot/dts/ingenic/Makefile +++ b/arch/mips/boot/dts/ingenic/Makefile @@ -5,5 +5,3 @@ dtb-$(CONFIG_JZ4770_GCW0) += gcw0.dtb dtb-$(CONFIG_JZ4780_CI20) += ci20.dtb dtb-$(CONFIG_X1000_CU1000_NEO) += cu1000-neo.dtb dtb-$(CONFIG_X1830_CU1830_NEO) += cu1830-neo.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/lantiq/Makefile b/arch/mips/boot/dts/lantiq/Makefile index ae6e3e21ebeb..d8531b4653c0 100644 --- a/arch/mips/boot/dts/lantiq/Makefile +++ b/arch/mips/boot/dts/lantiq/Makefile @@ -1,4 +1,2 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_DT_EASY50712) += danube_easy50712.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/loongson/Makefile b/arch/mips/boot/dts/loongson/Makefile index 5c6433e441ee..5e3ab984d70f 100644 --- a/arch/mips/boot/dts/loongson/Makefile +++ b/arch/mips/boot/dts/loongson/Makefile @@ -5,5 +5,3 @@ dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_4core_rs780e.dtb dtb-$(CONFIG_MACH_LOONGSON64) += loongson64c_8core_rs780e.dtb dtb-$(CONFIG_MACH_LOONGSON64) += loongson64g_4core_ls7a.dtb dtb-$(CONFIG_MACH_LOONGSON64) += loongson64v_4core_virtio.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/mscc/Makefile b/arch/mips/boot/dts/mscc/Makefile index eeb6b7aae83b..566dbec3c7fb 100644 --- a/arch/mips/boot/dts/mscc/Makefile +++ b/arch/mips/boot/dts/mscc/Makefile @@ -8,6 +8,3 @@ dtb-$(CONFIG_SOC_VCOREIII) += \ ocelot_pcb123.dtb \ serval_pcb105.dtb \ serval_pcb106.dtb - - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/mti/Makefile b/arch/mips/boot/dts/mti/Makefile index b5f7426998b1..c1c7b27296dd 100644 --- a/arch/mips/boot/dts/mti/Makefile +++ b/arch/mips/boot/dts/mti/Makefile @@ -1,5 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_MIPS_MALTA) += malta.dtb dtb-$(CONFIG_LEGACY_BOARD_SEAD3) += sead3.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/pic32/Makefile b/arch/mips/boot/dts/pic32/Makefile index fb57f36324db..4069cda2370c 100644 --- a/arch/mips/boot/dts/pic32/Makefile +++ b/arch/mips/boot/dts/pic32/Makefile @@ -3,5 +3,3 @@ dtb-$(CONFIG_DTB_PIC32_MZDA_SK) += pic32mzda_sk.dtb dtb-$(CONFIG_DTB_PIC32_NONE) += \ pic32mzda_sk.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) diff --git a/arch/mips/boot/dts/ralink/Makefile b/arch/mips/boot/dts/ralink/Makefile index d27d7e8c700f..dc002152d843 100644 --- a/arch/mips/boot/dts/ralink/Makefile +++ b/arch/mips/boot/dts/ralink/Makefile @@ -10,5 +10,3 @@ dtb-$(CONFIG_SOC_MT7621) += \ mt7621-gnubee-gb-pc1.dtb \ mt7621-gnubee-gb-pc2.dtb \ mt7621-tplink-hc220-g5-v1.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) From patchwork Wed Sep 4 23:47:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791513 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E58DF18C342; Wed, 4 Sep 2024 23:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493709; cv=none; b=oDYDQCOBSdR0f4vCe8hqwdeJ4qdqB9DVpkB4zeDBZfplf7NY/o/PKMnTremk1OEgFFIH+AMDWIc+pN8xYUddIUjNkpZyEWCWQ1SI+8BaPYUw3Sf8K5egy9XgPFFVxrKkKLYkZNWN23zJHN4+x+vZ9pSOQRwD3yzvolcVzJO1htk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493709; c=relaxed/simple; bh=noGT1ZHWVvDifWSIT0Eu3Rma90rEgb9C4Og/0AUftIw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GX/s+YwW9vO3VUoMcxuQlPkjlKFmYK0/wpEFHuNsdSs9zwxSF/jUqzlLwHZvvCTh9vFz1ula5fhwyh0XVctHO3GFYT91my5oOgDhnBmMCg6O49Y49giK+F+0l6kSKJS9YA+rvlaBhKg4ILYyoVycHlFgG4oSLHgnZnswvIBJbKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=j4lhfs4t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j4lhfs4t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA160C4CEC8; Wed, 4 Sep 2024 23:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493708; bh=noGT1ZHWVvDifWSIT0Eu3Rma90rEgb9C4Og/0AUftIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4lhfs4t+UdLx9riX5cE4Q8MyzmjqxpJFDc864wC5f5TcmLpFzAEv6WHpE+kCfpAX WU87cUrvtiPAIhPMsh3V5scl3LoUzjqi/q2+WqFKk5XNPpr79Ka4bhrbFxjCVz2qOE DsBQ/C+NU2n0mkpTuStdf3otDGdANW4zGeGVAlLIchZ1PajkhqrhV7omoSuUt7NXik wDkKHAin1YxoeSnae66K/834K+DwuU1IhhUmnTMmMcUIu0Z6cI8XrqsHqgxtdPLaF/ vHn4Ww3U8GMhKc6u13LeaqzoMLGzbbfqN9NFGThT3ewhi91UJxrepqLnE8PTKdyPCA LVnZ3mOt2UktQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 06/15] riscv: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:42 +0900 Message-ID: <20240904234803.698424-7-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB when built-in DTB support is enabled. To keep consistency across architectures, this commit also renames CONFIG_BUILTIN_DTB_SOURCE to CONFIG_BUILTIN_DTB_NAME. Signed-off-by: Masahiro Yamada Acked-by: Conor Dooley --- arch/riscv/Kbuild | 1 - arch/riscv/Kconfig | 3 ++- arch/riscv/boot/dts/Makefile | 2 -- arch/riscv/configs/nommu_k210_defconfig | 2 +- arch/riscv/configs/nommu_k210_sdcard_defconfig | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/riscv/Kbuild b/arch/riscv/Kbuild index 2c585f7a0b6e..126fb738fc44 100644 --- a/arch/riscv/Kbuild +++ b/arch/riscv/Kbuild @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only obj-y += kernel/ mm/ net/ -obj-$(CONFIG_BUILTIN_DTB) += boot/dts/ obj-$(CONFIG_CRYPTO) += crypto/ obj-y += errata/ obj-$(CONFIG_KVM) += kvm/ diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 0f3cd7c3a436..019c64ef0826 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -1110,13 +1110,14 @@ config RISCV_ISA_FALLBACK config BUILTIN_DTB bool "Built-in device tree" depends on OF && NONPORTABLE + select GENERIC_BUILTIN_DTB help Build a device tree into the Linux image. This option should be selected if no bootloader is being used. If unsure, say N. -config BUILTIN_DTB_SOURCE +config BUILTIN_DTB_NAME string "Built-in device tree source" depends on BUILTIN_DTB help diff --git a/arch/riscv/boot/dts/Makefile b/arch/riscv/boot/dts/Makefile index fdae05bbf556..b09678f9badc 100644 --- a/arch/riscv/boot/dts/Makefile +++ b/arch/riscv/boot/dts/Makefile @@ -7,5 +7,3 @@ subdir-y += sifive subdir-y += sophgo subdir-y += starfive subdir-y += thead - -obj-$(CONFIG_BUILTIN_DTB) := $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE)) diff --git a/arch/riscv/configs/nommu_k210_defconfig b/arch/riscv/configs/nommu_k210_defconfig index af9601da4643..41a025f927ba 100644 --- a/arch/riscv/configs/nommu_k210_defconfig +++ b/arch/riscv/configs/nommu_k210_defconfig @@ -35,7 +35,7 @@ CONFIG_NR_CPUS=2 CONFIG_CMDLINE="earlycon console=ttySIF0" CONFIG_CMDLINE_FORCE=y CONFIG_BUILTIN_DTB=y -CONFIG_BUILTIN_DTB_SOURCE="canaan/k210_generic" +CONFIG_BUILTIN_DTB_NAME="canaan/k210_generic" # CONFIG_SECCOMP is not set # CONFIG_STACKPROTECTOR is not set # CONFIG_GCC_PLUGINS is not set diff --git a/arch/riscv/configs/nommu_k210_sdcard_defconfig b/arch/riscv/configs/nommu_k210_sdcard_defconfig index dd460c649152..ab4b22f1c91a 100644 --- a/arch/riscv/configs/nommu_k210_sdcard_defconfig +++ b/arch/riscv/configs/nommu_k210_sdcard_defconfig @@ -27,7 +27,7 @@ CONFIG_NR_CPUS=2 CONFIG_CMDLINE="earlycon console=ttySIF0 root=/dev/mmcblk0p1 rootwait ro" CONFIG_CMDLINE_FORCE=y CONFIG_BUILTIN_DTB=y -CONFIG_BUILTIN_DTB_SOURCE="canaan/k210_generic" +CONFIG_BUILTIN_DTB_NAME="canaan/k210_generic" # CONFIG_SECCOMP is not set # CONFIG_STACKPROTECTOR is not set # CONFIG_GCC_PLUGINS is not set From patchwork Wed Sep 4 23:47:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791514 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76EE918E02B; Wed, 4 Sep 2024 23:48:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493711; cv=none; b=ikANXRlxIEVtdhCHgpoIA7GQax3lyspj/0NbowaYs6gkbZrX73AewGpwxyVhN2JwCE+YHln3MdSRetVK94pkJxMxa+n78DrS5nozrkrWkvkH4SczwAfFi4Yjv846+Cc7gifzL5QojlHoBtfNe871WOauayj1BXZ3tjJUnSDku8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493711; c=relaxed/simple; bh=0Cc2oNyNXJMYffrGUjSrxejvm3spX+Pr6+GYatSbayY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aqu4upfYgPPRNF5WYo6b52kFzHVlDaEr5JhU2ARYJD05sXkRZJLwx7gSXvgPa1nALRg2HzfxPnCMyhtGevutz4HpiJZY1lZZT6BOlFso18qXLsJZmfkh15QFQNwFOehym0OZdO6qFzz1ROO/U+95gWkKlo7vhqoGuI2XW8RQt4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s0LzAvyd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="s0LzAvyd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12166C4CEC3; Wed, 4 Sep 2024 23:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493711; bh=0Cc2oNyNXJMYffrGUjSrxejvm3spX+Pr6+GYatSbayY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0LzAvydGQzpSJjmNzSDLP3BIZFDXFf9RBmKd+rrW+Ri/pE8v2Je/CXoWRDgK5CIA ZVX8UlTMpaUFjWSFfuvj6anH2/qJI7UyLMLLTYBkSJWRzaikGVRTej9BX0I2EVdefa YTcU7Q6jqYEn1dwZDaSZWzXWDR1Q1UFxRJHalXeIRPycMCnHcf02dkj1egeg0oqXB0 xHI2gBGVyJHqV04UUrWEhQxA3f7eKY64W8jSoWx8XlOWLlxwV/p3UQjSxIVdrkUtDz GZ+f3AW6gFl/jUur3f28fo8NZecBIG2JGJcWbuBQqM1Nn9UOP8UwUwuCMlURYKwcb1 XDA/Tmpxapf5Q== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 07/15] LoongArch: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:43 +0900 Message-ID: <20240904234803.698424-8-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB when built-in DTB support is enabled. Signed-off-by: Masahiro Yamada --- arch/loongarch/Kbuild | 1 - arch/loongarch/Kconfig | 1 + arch/loongarch/boot/dts/Makefile | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/loongarch/Kbuild b/arch/loongarch/Kbuild index bfa21465d83a..beb8499dd8ed 100644 --- a/arch/loongarch/Kbuild +++ b/arch/loongarch/Kbuild @@ -4,7 +4,6 @@ obj-y += net/ obj-y += vdso/ obj-$(CONFIG_KVM) += kvm/ -obj-$(CONFIG_BUILTIN_DTB) += boot/dts/ # for cleaning subdir- += boot diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 70f169210b52..e1d3e5fb6fd2 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -388,6 +388,7 @@ endchoice config BUILTIN_DTB bool "Enable built-in dtb in kernel" depends on OF + select GENERIC_BUILTIN_DTB help Some existing systems do not provide a canonical device tree to the kernel at boot time. Let's provide a device tree table in the diff --git a/arch/loongarch/boot/dts/Makefile b/arch/loongarch/boot/dts/Makefile index 747d0c3f6389..15d5e14fe418 100644 --- a/arch/loongarch/boot/dts/Makefile +++ b/arch/loongarch/boot/dts/Makefile @@ -1,5 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only dtb-y = loongson-2k0500-ref.dtb loongson-2k1000-ref.dtb loongson-2k2000-ref.dtb - -obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_NAME)) From patchwork Wed Sep 4 23:47:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791515 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3D7018E02B; Wed, 4 Sep 2024 23:48:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493714; cv=none; b=UMGxvOd46w77Rec6SvS4DX/oZPRcYGZtDzy/T4wS+btlUDf64pnzCLs1WqXi2/v00kkasR/QJCKORkSgwsldJiXyjCyFpHuPv7U5HW7/26LaK0SROu94abnuogmdpZQfwRt8e3qDuQP37f0eizNqEBED+pzx/vedt0KODcMWFbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493714; c=relaxed/simple; bh=ShH7X/nJUOJT346TPtT8MDMv6QalWDIylxJwzZgk3lc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U7INiiCh+G+hJ27zrlySuUqHxE80SJK6oVN/vWzjBkOWfPYQ63gyHkA/oI0Fl0/VsJkLU8IUfOvswHczFHQc32YgKz3EawrreNL4fD8BxCqjozeeW0s2TPZN5gRyMqMXshl8BaXkaC1yMT6Jexn3fMQuOHsLDj4tt/wWkBvyPXY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RYTs406l; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RYTs406l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D540BC4CECA; Wed, 4 Sep 2024 23:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493714; bh=ShH7X/nJUOJT346TPtT8MDMv6QalWDIylxJwzZgk3lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYTs406lL9RVGMTvwddw7pj2H9g2O9zYNJjASRMvJlNrHHQzUvSYQ5dL4NUkrnATX s0iznwK98cW8R9Ll+TbIVOcGRYFmVX6BtoM5XjrgLjMxQc3qKLY8Jf92EhAFav4hC+ MS7ZRw7cWLg9FotPvnbdYjuaJ7uTDwxIhcVmcaCyfZ2GI7HLaLDv7fDj/zkNDqEdcx ihG9tR/V1isusbNSsNSXoCr5RWd1a+3x1M3TXEAl9ZOqCj53KbWz5oZnNVp1NeG0af 3e+xowAe808Kn6LHg4/bPMhiliZTlJG/0V1wErXUCqqlCNEWEroYvnQaRnDgO6JGPf nkKS33OG/4rqA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 08/15] ARC: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:44 +0900 Message-ID: <20240904234803.698424-9-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB to use the generic rule to support built-in DTB. To keep consistency across architectures, this commit also renames CONFIG_ARC_BUILTIN_DTB_NAME to CONFIG_BUILTIN_DTB_NAME. Signed-off-by: Masahiro Yamada --- arch/arc/Kconfig | 7 ++++--- arch/arc/Makefile | 3 --- arch/arc/boot/dts/Makefile | 9 +-------- arch/arc/configs/axs101_defconfig | 2 +- arch/arc/configs/axs103_defconfig | 2 +- arch/arc/configs/axs103_smp_defconfig | 2 +- arch/arc/configs/haps_hs_defconfig | 2 +- arch/arc/configs/haps_hs_smp_defconfig | 2 +- arch/arc/configs/hsdk_defconfig | 2 +- arch/arc/configs/nsim_700_defconfig | 2 +- arch/arc/configs/nsimosci_defconfig | 2 +- arch/arc/configs/nsimosci_hs_defconfig | 2 +- arch/arc/configs/nsimosci_hs_smp_defconfig | 2 +- arch/arc/configs/tb10x_defconfig | 2 +- arch/arc/configs/vdk_hs38_defconfig | 2 +- arch/arc/configs/vdk_hs38_smp_defconfig | 2 +- 16 files changed, 18 insertions(+), 27 deletions(-) diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index d01e69a29b69..11fe4f497571 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -16,6 +16,7 @@ config ARC select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC select ARCH_32BIT_OFF_T select BUILDTIME_TABLE_SORT + select GENERIC_BUILTIN_DTB select CLONE_BACKWARDS select COMMON_CLK select DMA_DIRECT_REMAP @@ -549,11 +550,11 @@ config ARC_DBG_JUMP_LABEL part of static keys (jump labels) related code. endif -config ARC_BUILTIN_DTB_NAME +config BUILTIN_DTB_NAME string "Built in DTB" + default "nsim_700" help - Set the name of the DTB to embed in the vmlinux binary - Leaving it blank selects the "nsim_700" dtb. + Set the name of the DTB to embed in the vmlinux binary. endmenu # "ARC Architecture Configuration" diff --git a/arch/arc/Makefile b/arch/arc/Makefile index 2390dd042e36..deb830bdeaa0 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -82,9 +82,6 @@ KBUILD_CFLAGS += $(cflags-y) KBUILD_AFLAGS += $(KBUILD_CFLAGS) KBUILD_LDFLAGS += $(ldflags-y) -# w/o this dtb won't embed into kernel binary -core-y += arch/arc/boot/dts/ - core-y += arch/arc/plat-sim/ core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/ core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/ diff --git a/arch/arc/boot/dts/Makefile b/arch/arc/boot/dts/Makefile index 48704dfdf75c..ee5664f0640d 100644 --- a/arch/arc/boot/dts/Makefile +++ b/arch/arc/boot/dts/Makefile @@ -1,13 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -# Built-in dtb -builtindtb-y := nsim_700 -ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),) - builtindtb-y := $(CONFIG_ARC_BUILTIN_DTB_NAME) -endif - -obj-y += $(builtindtb-y).dtb.o -dtb-y := $(builtindtb-y).dtb +dtb-y := $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME)) # for CONFIG_OF_ALL_DTBS test dtb- := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts)) diff --git a/arch/arc/configs/axs101_defconfig b/arch/arc/configs/axs101_defconfig index 89720d6d7e0d..628d55057cde 100644 --- a/arch/arc/configs/axs101_defconfig +++ b/arch/arc/configs/axs101_defconfig @@ -23,7 +23,7 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_ARC_PLAT_AXS10X=y CONFIG_AXS101=y CONFIG_ARC_CACHE_LINE_SHIFT=5 -CONFIG_ARC_BUILTIN_DTB_NAME="axs101" +CONFIG_BUILTIN_DTB_NAME="axs101" CONFIG_PREEMPT=y # CONFIG_COMPACTION is not set CONFIG_NET=y diff --git a/arch/arc/configs/axs103_defconfig b/arch/arc/configs/axs103_defconfig index 73ec01ed0492..7e4d4cbf1fb7 100644 --- a/arch/arc/configs/axs103_defconfig +++ b/arch/arc/configs/axs103_defconfig @@ -22,7 +22,7 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_ARC_PLAT_AXS10X=y CONFIG_AXS103=y CONFIG_ISA_ARCV2=y -CONFIG_ARC_BUILTIN_DTB_NAME="axs103" +CONFIG_BUILTIN_DTB_NAME="axs103" CONFIG_PREEMPT=y # CONFIG_COMPACTION is not set CONFIG_NET=y diff --git a/arch/arc/configs/axs103_smp_defconfig b/arch/arc/configs/axs103_smp_defconfig index 4da0f626fa9d..764cbc781a7d 100644 --- a/arch/arc/configs/axs103_smp_defconfig +++ b/arch/arc/configs/axs103_smp_defconfig @@ -22,7 +22,7 @@ CONFIG_ARC_PLAT_AXS10X=y CONFIG_AXS103=y CONFIG_ISA_ARCV2=y CONFIG_SMP=y -CONFIG_ARC_BUILTIN_DTB_NAME="axs103_idu" +CONFIG_BUILTIN_DTB_NAME="axs103_idu" CONFIG_PREEMPT=y # CONFIG_COMPACTION is not set CONFIG_NET=y diff --git a/arch/arc/configs/haps_hs_defconfig b/arch/arc/configs/haps_hs_defconfig index 8c3ed5d6e6c3..3a1577112078 100644 --- a/arch/arc/configs/haps_hs_defconfig +++ b/arch/arc/configs/haps_hs_defconfig @@ -14,7 +14,7 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_EXPERT=y CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set -CONFIG_ARC_BUILTIN_DTB_NAME="haps_hs" +CONFIG_BUILTIN_DTB_NAME="haps_hs" CONFIG_MODULES=y # CONFIG_BLK_DEV_BSG is not set # CONFIG_COMPACTION is not set diff --git a/arch/arc/configs/haps_hs_smp_defconfig b/arch/arc/configs/haps_hs_smp_defconfig index 6fc98c1b9b36..a3cf940b1f5b 100644 --- a/arch/arc/configs/haps_hs_smp_defconfig +++ b/arch/arc/configs/haps_hs_smp_defconfig @@ -16,7 +16,7 @@ CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_COMPAT_BRK is not set CONFIG_SMP=y -CONFIG_ARC_BUILTIN_DTB_NAME="haps_hs_idu" +CONFIG_BUILTIN_DTB_NAME="haps_hs_idu" CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_BLK_DEV_BSG is not set diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig index 9e79154b5535..1558e8e87767 100644 --- a/arch/arc/configs/hsdk_defconfig +++ b/arch/arc/configs/hsdk_defconfig @@ -20,7 +20,7 @@ CONFIG_ISA_ARCV2=y CONFIG_SMP=y CONFIG_LINUX_LINK_BASE=0x90000000 CONFIG_LINUX_RAM_BASE=0x80000000 -CONFIG_ARC_BUILTIN_DTB_NAME="hsdk" +CONFIG_BUILTIN_DTB_NAME="hsdk" CONFIG_PREEMPT=y # CONFIG_COMPACTION is not set CONFIG_NET=y diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig index 51092c39e360..f8b3235d9a65 100644 --- a/arch/arc/configs/nsim_700_defconfig +++ b/arch/arc/configs/nsim_700_defconfig @@ -17,7 +17,7 @@ CONFIG_PERF_EVENTS=y # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set CONFIG_ISA_ARCOMPACT=y -CONFIG_ARC_BUILTIN_DTB_NAME="nsim_700" +CONFIG_BUILTIN_DTB_NAME="nsim_700" CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_BLK_DEV_BSG is not set diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig index 70c17bca4939..ee45dc0877fb 100644 --- a/arch/arc/configs/nsimosci_defconfig +++ b/arch/arc/configs/nsimosci_defconfig @@ -19,7 +19,7 @@ CONFIG_ISA_ARCOMPACT=y CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_BLK_DEV_BSG is not set -CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci" +CONFIG_BUILTIN_DTB_NAME="nsimosci" # CONFIG_COMPACTION is not set CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/arc/configs/nsimosci_hs_defconfig b/arch/arc/configs/nsimosci_hs_defconfig index 59a3b6642fe7..e0a309970c20 100644 --- a/arch/arc/configs/nsimosci_hs_defconfig +++ b/arch/arc/configs/nsimosci_hs_defconfig @@ -19,7 +19,7 @@ CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_BLK_DEV_BSG is not set CONFIG_ISA_ARCV2=y -CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs" +CONFIG_BUILTIN_DTB_NAME="nsimosci_hs" # CONFIG_COMPACTION is not set CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig index 1419fc946a08..88325b8b49cf 100644 --- a/arch/arc/configs/nsimosci_hs_smp_defconfig +++ b/arch/arc/configs/nsimosci_hs_smp_defconfig @@ -16,7 +16,7 @@ CONFIG_MODULES=y CONFIG_ISA_ARCV2=y CONFIG_SMP=y # CONFIG_ARC_TIMERS_64BIT is not set -CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs_idu" +CONFIG_BUILTIN_DTB_NAME="nsimosci_hs_idu" CONFIG_PREEMPT=y # CONFIG_COMPACTION is not set CONFIG_NET=y diff --git a/arch/arc/configs/tb10x_defconfig b/arch/arc/configs/tb10x_defconfig index 1a68e4beebca..41a90e836e39 100644 --- a/arch/arc/configs/tb10x_defconfig +++ b/arch/arc/configs/tb10x_defconfig @@ -26,7 +26,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_ARC_PLAT_TB10X=y CONFIG_ARC_CACHE_LINE_SHIFT=5 CONFIG_HZ=250 -CONFIG_ARC_BUILTIN_DTB_NAME="abilis_tb100_dvk" +CONFIG_BUILTIN_DTB_NAME="abilis_tb100_dvk" CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_COMPACTION is not set CONFIG_NET=y diff --git a/arch/arc/configs/vdk_hs38_defconfig b/arch/arc/configs/vdk_hs38_defconfig index 50c343913825..03d9ac20baa9 100644 --- a/arch/arc/configs/vdk_hs38_defconfig +++ b/arch/arc/configs/vdk_hs38_defconfig @@ -13,7 +13,7 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_ARC_PLAT_AXS10X=y CONFIG_AXS103=y CONFIG_ISA_ARCV2=y -CONFIG_ARC_BUILTIN_DTB_NAME="vdk_hs38" +CONFIG_BUILTIN_DTB_NAME="vdk_hs38" CONFIG_PREEMPT=y CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/arc/configs/vdk_hs38_smp_defconfig b/arch/arc/configs/vdk_hs38_smp_defconfig index 6d9e1d9f71d2..c09488992f13 100644 --- a/arch/arc/configs/vdk_hs38_smp_defconfig +++ b/arch/arc/configs/vdk_hs38_smp_defconfig @@ -15,7 +15,7 @@ CONFIG_AXS103=y CONFIG_ISA_ARCV2=y CONFIG_SMP=y # CONFIG_ARC_TIMERS_64BIT is not set -CONFIG_ARC_BUILTIN_DTB_NAME="vdk_hs38_smp" +CONFIG_BUILTIN_DTB_NAME="vdk_hs38_smp" CONFIG_PREEMPT=y CONFIG_NET=y CONFIG_PACKET=y From patchwork Wed Sep 4 23:47:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791516 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5783E1917F9; Wed, 4 Sep 2024 23:48:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493717; cv=none; b=H4mHx1O+sCrkscBypUJxB458a0gzjpzQnVP9zsPw4Wvmftw4a0gCjZ8csCaiHuJ6wPclZ3lB3muI0Q69oKeSQ8foPOgkJlMEWl9d7xqyx+CTL4FYQpVliup0fjpTgGryhdY/+fzUGlSxgbp3is1m4vRGsndW0RqMuFC+Q+ma64w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493717; c=relaxed/simple; bh=dk04zi59AciF5LL6akuqjWabef8tuzvQHnluBCG6Dq0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Huvl8eXOtiO3Z8BiNhExZZ27Q78POJpMoO+Yrk+r8yeQz1f9ZXWzSsJaJeuDUI8ya49HJMYrWxsTE0EOzCZ+j6dfXwz3HN9xpYYjzjjkQljxYL0RxFrtVAr3DB6XvYCc1flPCxAKiwuErvVlid+dP5Ru7yl6BnqKnHZqDPXOqjQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WXanL2S1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WXanL2S1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C44EFC4CEC9; Wed, 4 Sep 2024 23:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493716; bh=dk04zi59AciF5LL6akuqjWabef8tuzvQHnluBCG6Dq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WXanL2S1ncP9VL15QlXjB215wU1hNbN2vKvw3EYtXVZFbUBVEeZHly5axKhoCCqTu oUB3D/bJEjWxqQ0rm18DKkHgVADRiZpRKAIM69av4S7HT4mCZ354pk2zPEJqwsO+YP MgKw4KPnBKLnddm7a+GxJPtumoGmTve3flq+PEAZJVXniDdiVRWK2FyTQjzXpjuqsO lEX2H/XdvkhCwK23r7h8Gboj4cEE+GUUI7BnsmLxjion7OPZSlveblpMAT6nvodfQw K6LAnw/GRi2YAPwiQw08MxjH/D+2oPQP+xVF0oE2dBysiOLMmSPZdcUd6Jn56F4G+o 5L8kSbjfqxaEA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 09/15] openrisc: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:45 +0900 Message-ID: <20240904234803.698424-10-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB to use the generic rule to support built-in DTB. To keep consistency across architectures, this commit also renames CONFIG_OPENRISC_BUILTIN_DTB_NAME to CONFIG_BUILTIN_DTB_NAME. Signed-off-by: Masahiro Yamada --- arch/openrisc/Kbuild | 1 - arch/openrisc/Kconfig | 3 ++- arch/openrisc/boot/dts/Makefile | 2 +- arch/openrisc/configs/or1klitex_defconfig | 2 +- arch/openrisc/configs/or1ksim_defconfig | 2 +- arch/openrisc/configs/simple_smp_defconfig | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/openrisc/Kbuild b/arch/openrisc/Kbuild index b0b0f2b03f87..70bdb24ff204 100644 --- a/arch/openrisc/Kbuild +++ b/arch/openrisc/Kbuild @@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 obj-y += lib/ kernel/ mm/ -obj-y += boot/dts/ # for cleaning subdir- += boot diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 69c0258700b2..11ffcf33652c 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -10,6 +10,7 @@ config OPENRISC select ARCH_HAS_DMA_SET_UNCACHED select ARCH_HAS_DMA_CLEAR_UNCACHED select ARCH_HAS_SYNC_DMA_FOR_DEVICE + select GENERIC_BUILTIN_DTB select COMMON_CLK select OF select OF_EARLY_FLATTREE @@ -89,7 +90,7 @@ config DCACHE_WRITETHROUGH If unsure say N here -config OPENRISC_BUILTIN_DTB +config BUILTIN_DTB_NAME string "Builtin DTB" default "" diff --git a/arch/openrisc/boot/dts/Makefile b/arch/openrisc/boot/dts/Makefile index 13db5a2aab52..3a66e0ef3985 100644 --- a/arch/openrisc/boot/dts/Makefile +++ b/arch/openrisc/boot/dts/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y += $(addsuffix .dtb.o, $(CONFIG_OPENRISC_BUILTIN_DTB)) +dtb-y += $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME)) #DTC_FLAGS ?= -p 1024 diff --git a/arch/openrisc/configs/or1klitex_defconfig b/arch/openrisc/configs/or1klitex_defconfig index 466f31a091be..3e849d25838a 100644 --- a/arch/openrisc/configs/or1klitex_defconfig +++ b/arch/openrisc/configs/or1klitex_defconfig @@ -7,7 +7,7 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SGETMASK_SYSCALL=y CONFIG_EXPERT=y -CONFIG_OPENRISC_BUILTIN_DTB="or1klitex" +CONFIG_BUILTIN_DTB_NAME="or1klitex" CONFIG_HZ_100=y CONFIG_OPENRISC_HAVE_SHADOW_GPRS=y CONFIG_NET=y diff --git a/arch/openrisc/configs/or1ksim_defconfig b/arch/openrisc/configs/or1ksim_defconfig index 0116e465238f..59fe33cefba2 100644 --- a/arch/openrisc/configs/or1ksim_defconfig +++ b/arch/openrisc/configs/or1ksim_defconfig @@ -14,7 +14,7 @@ CONFIG_SLUB=y CONFIG_SLUB_TINY=y CONFIG_MODULES=y # CONFIG_BLOCK is not set -CONFIG_OPENRISC_BUILTIN_DTB="or1ksim" +CONFIG_BUILTIN_DTB_NAME="or1ksim" CONFIG_HZ_100=y CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/openrisc/configs/simple_smp_defconfig b/arch/openrisc/configs/simple_smp_defconfig index b990cb6c9309..6008e824d31c 100644 --- a/arch/openrisc/configs/simple_smp_defconfig +++ b/arch/openrisc/configs/simple_smp_defconfig @@ -20,7 +20,7 @@ CONFIG_SLUB=y CONFIG_SLUB_TINY=y CONFIG_MODULES=y # CONFIG_BLOCK is not set -CONFIG_OPENRISC_BUILTIN_DTB="simple_smp" +CONFIG_BUILTIN_DTB_NAME="simple_smp" CONFIG_SMP=y CONFIG_HZ_100=y CONFIG_OPENRISC_HAVE_SHADOW_GPRS=y From patchwork Wed Sep 4 23:47:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791517 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5912B1925B3; Wed, 4 Sep 2024 23:48:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493720; cv=none; b=J0SzsBh/S9tM2PEBm4IgWpdImeUjvh8x+iXKRh9xnsK7NOCrKBVhF1WYAIoshQiY2mI8hg7dyx0gstQKq2xey76siEQmQiq60hik7Sxk1uQcD4tMJIRFN6HxyJGb7BS+sH4o9s8ui7nwoFXe+OtBdNU9c6LXIGJS2ZittshP5Lc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493720; c=relaxed/simple; bh=Hx8xawNp6pSOR9yjQH6NLrBLbl8X/A3JIv5Jk19JmG8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TK0puNQxUq+esvgtnlcC1AfN4hbJMYXMS8I7wyM5x09/JJnzem9Gk2FHt5nRAqKOYcjXPS+uoUlV+SvAUYTpUU1bD5NCwjvPeVjSA+gmSlU0LFoGazGGWQ0M0aWNhV7HVn7DF0C0BBeHFLPYWUgIXxFUncyMzRPiDcbJM4US9+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bhjADhw3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bhjADhw3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71F7DC4CEC3; Wed, 4 Sep 2024 23:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493719; bh=Hx8xawNp6pSOR9yjQH6NLrBLbl8X/A3JIv5Jk19JmG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bhjADhw3VFUuXUNrhgvaImjM65DClBDuU7++FngZwmnnBwfzzLtzQLZ9HdIkkfFB+ F7uTpm0Oo7qRXJCNGr5wMCZ1wwaB1/2P7v/RSgdP1GD9DKVuLi+OJRrc2TvfJMiS+G dctbjGIh2kV+BJgqZTa2Hh1/saZNPzv/9X//xp7ANnEymaIThWdtqY0gsmbRjLlNpZ /bRG/F4cMobP20RzhAYovofjxSuuCbIh50W/mi8KxeT1Mn/zj7E5iAd7wnzTYf5diH 4UIYVly2da5V/SeZsFWT5gI8Y7mrt4fnrXLFF9bK+qOB25LM4sbjc58enAkkdFmy2V MWWgneAT1nyjA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 10/15] xtensa: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:46 +0900 Message-ID: <20240904234803.698424-11-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB to use the generic rule to support built-in DTB. To keep consistency across architectures, this commit also renames CONFIG_BUILTIN_DTB_SOURCE to CONFIG_BUILTIN_DTB_NAME. Signed-off-by: Masahiro Yamada --- arch/xtensa/Kbuild | 2 +- arch/xtensa/Kconfig | 3 ++- arch/xtensa/boot/dts/Makefile | 2 +- arch/xtensa/configs/audio_kc705_defconfig | 2 +- arch/xtensa/configs/cadence_csp_defconfig | 2 +- arch/xtensa/configs/generic_kc705_defconfig | 2 +- arch/xtensa/configs/nommu_kc705_defconfig | 2 +- arch/xtensa/configs/smp_lx200_defconfig | 2 +- arch/xtensa/configs/virt_defconfig | 2 +- arch/xtensa/configs/xip_kc705_defconfig | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/xtensa/Kbuild b/arch/xtensa/Kbuild index fd12f61745ba..015baeb765b9 100644 --- a/arch/xtensa/Kbuild +++ b/arch/xtensa/Kbuild @@ -1,2 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-y += kernel/ mm/ platforms/ boot/dts/ +obj-y += kernel/ mm/ platforms/ diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index f200a4ec044e..5fd1d248e147 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -19,6 +19,7 @@ config XTENSA select ARCH_USE_QUEUED_SPINLOCKS select ARCH_WANT_IPC_PARSE_VERSION select BUILDTIME_TABLE_SORT + select GENERIC_BUILTIN_DTB select CLONE_BACKWARDS select COMMON_CLK select DMA_NONCOHERENT_MMAP if MMU @@ -461,7 +462,7 @@ config USE_OF help Include support for flattened device tree machine descriptions. -config BUILTIN_DTB_SOURCE +config BUILTIN_DTB_NAME string "DTB to build into the kernel image" depends on OF diff --git a/arch/xtensa/boot/dts/Makefile b/arch/xtensa/boot/dts/Makefile index d6408c16d74e..7271294ce523 100644 --- a/arch/xtensa/boot/dts/Makefile +++ b/arch/xtensa/boot/dts/Makefile @@ -7,7 +7,7 @@ # # -obj-$(CONFIG_OF) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE)) +dtb-$(CONFIG_OF) += $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME)) # for CONFIG_OF_ALL_DTBS test dtb- := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts)) diff --git a/arch/xtensa/configs/audio_kc705_defconfig b/arch/xtensa/configs/audio_kc705_defconfig index 436b7cac9694..f2af1a32c9c7 100644 --- a/arch/xtensa/configs/audio_kc705_defconfig +++ b/arch/xtensa/configs/audio_kc705_defconfig @@ -30,7 +30,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0" CONFIG_USE_OF=y -CONFIG_BUILTIN_DTB_SOURCE="kc705" +CONFIG_BUILTIN_DTB_NAME="kc705" # CONFIG_COMPACTION is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_PM=y diff --git a/arch/xtensa/configs/cadence_csp_defconfig b/arch/xtensa/configs/cadence_csp_defconfig index 91c4c4cae8a7..5a272a278740 100644 --- a/arch/xtensa/configs/cadence_csp_defconfig +++ b/arch/xtensa/configs/cadence_csp_defconfig @@ -35,7 +35,7 @@ CONFIG_HIGHMEM=y # CONFIG_PCI is not set CONFIG_XTENSA_PLATFORM_XTFPGA=y CONFIG_USE_OF=y -CONFIG_BUILTIN_DTB_SOURCE="csp" +CONFIG_BUILTIN_DTB_NAME="csp" # CONFIG_COMPACTION is not set CONFIG_XTFPGA_LCD=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set diff --git a/arch/xtensa/configs/generic_kc705_defconfig b/arch/xtensa/configs/generic_kc705_defconfig index e376238bc5ca..4427907becca 100644 --- a/arch/xtensa/configs/generic_kc705_defconfig +++ b/arch/xtensa/configs/generic_kc705_defconfig @@ -29,7 +29,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0" CONFIG_USE_OF=y -CONFIG_BUILTIN_DTB_SOURCE="kc705" +CONFIG_BUILTIN_DTB_NAME="kc705" # CONFIG_COMPACTION is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_NET=y diff --git a/arch/xtensa/configs/nommu_kc705_defconfig b/arch/xtensa/configs/nommu_kc705_defconfig index c2ab4306ee20..5828228522ba 100644 --- a/arch/xtensa/configs/nommu_kc705_defconfig +++ b/arch/xtensa/configs/nommu_kc705_defconfig @@ -36,7 +36,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0x9d050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=256M@0x60000000" CONFIG_USE_OF=y -CONFIG_BUILTIN_DTB_SOURCE="kc705_nommu" +CONFIG_BUILTIN_DTB_NAME="kc705_nommu" CONFIG_BINFMT_FLAT=y CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/xtensa/configs/smp_lx200_defconfig b/arch/xtensa/configs/smp_lx200_defconfig index 63b56ce79f83..326966ca7831 100644 --- a/arch/xtensa/configs/smp_lx200_defconfig +++ b/arch/xtensa/configs/smp_lx200_defconfig @@ -33,7 +33,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=96M@0" CONFIG_USE_OF=y -CONFIG_BUILTIN_DTB_SOURCE="lx200mx" +CONFIG_BUILTIN_DTB_NAME="lx200mx" # CONFIG_COMPACTION is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_NET=y diff --git a/arch/xtensa/configs/virt_defconfig b/arch/xtensa/configs/virt_defconfig index 98acb7191cb7..e37048985b47 100644 --- a/arch/xtensa/configs/virt_defconfig +++ b/arch/xtensa/configs/virt_defconfig @@ -24,7 +24,7 @@ CONFIG_HIGHMEM=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x80000000@0" CONFIG_USE_OF=y -CONFIG_BUILTIN_DTB_SOURCE="virt" +CONFIG_BUILTIN_DTB_NAME="virt" # CONFIG_PARSE_BOOTPARAM is not set CONFIG_JUMP_LABEL=y CONFIG_MODULES=y diff --git a/arch/xtensa/configs/xip_kc705_defconfig b/arch/xtensa/configs/xip_kc705_defconfig index 165652c45b85..ee47438f9b51 100644 --- a/arch/xtensa/configs/xip_kc705_defconfig +++ b/arch/xtensa/configs/xip_kc705_defconfig @@ -29,7 +29,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0" CONFIG_USE_OF=y -CONFIG_BUILTIN_DTB_SOURCE="kc705" +CONFIG_BUILTIN_DTB_NAME="kc705" # CONFIG_PARSE_BOOTPARAM is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_COMPACTION is not set From patchwork Wed Sep 4 23:47:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791518 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E5B3188588; Wed, 4 Sep 2024 23:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493722; cv=none; b=JI+UHnF93jhmUC1bxlA77kYo8ftB4u0YYV7+4vh5L8PJkNd7jO9VJ4YG398CvWbsG7FqwHIi+2VSkZ4kVs/1aPpwT1xe1QT8ulP282lpch2B83b2LAsXOH1cQTwmgbLmm3UQBIa9he2jd3mCm/iYQfQyCjmqZpgb+EF5Gbd0pqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493722; c=relaxed/simple; bh=ceXpRnavdorzGFbVYUr8aA6c+sVnRF84hopfhHaV0dc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hkgnnXwLPlRh6WYriI+z0Wc6K1Rc/ZZVZMGEfDO3Ls9HPFDZy5mlTlLOevzPlB9M6QZgZesp93oND1PKpuPSaZMS8GlrywogQmT2S4VPONPjkb/afp6shsyGDTUJnJqgm1uIavDDT+bznqDcg4+X+Ua5v5rPh5o8Ho1hxQMyOEs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=j9kBmrJR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j9kBmrJR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5596CC4CEC9; Wed, 4 Sep 2024 23:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493722; bh=ceXpRnavdorzGFbVYUr8aA6c+sVnRF84hopfhHaV0dc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j9kBmrJRmdISyfx3jQ19J1DpNiq+n9PVgL8tnqgAE5eHB9qEcAWVNIA24BtpLn6zo J2qft+UQ5z9suplkazNanVvrDKX0uNYEMsy858T8dIJvCWBoTmKznVjpL2STXcfd3N sT5cHyO4nW8tgbXbotQGpJJnUiBxfXLw53xIS3O6tAqP92Hezz9nQtcrHye6fNyrrT C9Bd206zR9cXvGP/W4t5i16oi2V+YUku6N3eMDk9xF/34dmZTvIldslwrhvs6aCnZo wAo6MrOzvaP5v+ZAqNa3E4eR/CRQfeAnZ6f7/XL/mxk1Ler62qkXD8NWxMWRLWI0Pr /DDmAhuLfGJhQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 11/15] nios2: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:47 +0900 Message-ID: <20240904234803.698424-12-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB when built-in DTB support is enabled. To keep consistency across architectures, this commit also renames CONFIG_NIOS2_DTB_SOURCE_BOOL to CONFIG_BUILTIN_DTB, and CONFIG_NIOS2_DTB_SOURCE to CONFIG_BUILTIN_DTB_NAME. Signed-off-by: Masahiro Yamada --- arch/nios2/Kbuild | 2 +- arch/nios2/boot/dts/Makefile | 4 ++-- arch/nios2/kernel/prom.c | 2 +- arch/nios2/platform/Kconfig.platform | 11 ++++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/nios2/Kbuild b/arch/nios2/Kbuild index fc2952edd2de..fa64c5954b20 100644 --- a/arch/nios2/Kbuild +++ b/arch/nios2/Kbuild @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-y += kernel/ mm/ platform/ boot/dts/ +obj-y += kernel/ mm/ platform/ # for cleaning subdir- += boot diff --git a/arch/nios2/boot/dts/Makefile b/arch/nios2/boot/dts/Makefile index 1a2e8996bec7..1b8f41c4154f 100644 --- a/arch/nios2/boot/dts/Makefile +++ b/arch/nios2/boot/dts/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y := $(patsubst %.dts,%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE)) +dtb-y := $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME)) -dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts)) +dtb-$(CONFIG_OF_ALL_DTBS) += $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts)) diff --git a/arch/nios2/kernel/prom.c b/arch/nios2/kernel/prom.c index 9a8393e6b4a8..f703056885c9 100644 --- a/arch/nios2/kernel/prom.c +++ b/arch/nios2/kernel/prom.c @@ -32,7 +32,7 @@ void __init early_init_devtree(void *params) } #endif -#ifdef CONFIG_NIOS2_DTB_SOURCE_BOOL +#ifdef CONFIG_BUILTIN_DTB if (be32_to_cpu((__be32) *dtb) == OF_DT_HEADER) params = (void *)__dtb_start; #endif diff --git a/arch/nios2/platform/Kconfig.platform b/arch/nios2/platform/Kconfig.platform index e849daff6fd1..c75cadd92388 100644 --- a/arch/nios2/platform/Kconfig.platform +++ b/arch/nios2/platform/Kconfig.platform @@ -35,19 +35,20 @@ config NIOS2_DTB_PHYS_ADDR help Physical address of a dtb blob. -config NIOS2_DTB_SOURCE_BOOL +config BUILTIN_DTB bool "Compile and link device tree into kernel image" depends on !COMPILE_TEST + select GENERIC_BUILTIN_DTB help This allows you to specify a dts (device tree source) file which will be compiled and linked into the kernel image. -config NIOS2_DTB_SOURCE - string "Device tree source file" - depends on NIOS2_DTB_SOURCE_BOOL +config BUILTIN_DTB_NAME + string "Built-in device tree name" + depends on BUILTIN_DTB default "" help - Absolute path to the device tree source (dts) file describing your + Relative path to the device tree without suffix describing your system. comment "Nios II instructions" From patchwork Wed Sep 4 23:47:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791519 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D82C19306B; Wed, 4 Sep 2024 23:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493725; cv=none; b=aZyY5hvXoOL6itREOV0qa9bKITd/FfOEFTFVhTiQvuUgcAzj2cBmz5js0SfBdSRmu0Vf/FKjHlf2v2sKnssrHNAbEyHp+GJF/6VEfBmpeotkJmce2W0AIkleEyzEh/2EZjtU77UFGBgY9xbIPQzPnzY9rXOZ6kVo12UzfgErpj8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493725; c=relaxed/simple; bh=GAvIRyYGY88KXHCNgA5plk+Rvj05BOMm2Zv8xtvLfvs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i17nudppEOGPT+aaw71QlNRWoyRPU6lbIJLpr7yCI1E1hzNKxVb/hoEDgxZrG3ZVaiZDy4NQcHpiXwG6UypHjtwE+ixAx+yI0vY2kfO+SHffurWhTysXdlZF8akR7qc6NeeOgfpK+vD0IizvLt3tlvvlWi0Zq0XYvVN4apV1/+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mcGeVz6L; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mcGeVz6L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D49E5C4CECC; Wed, 4 Sep 2024 23:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493725; bh=GAvIRyYGY88KXHCNgA5plk+Rvj05BOMm2Zv8xtvLfvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mcGeVz6LO53QnNj0mJxAwWueTLOBilwQI/IQ+a0pK86HA9dHli8CwkmxS6DJQvGHY lNpNRaYKpne2uc7raDjurFFtQLbo/PMF4RZWdFrQdfBzJhFtNzQyJNyXEgv/mPfeOD 0vnD3Ljumu8eOm6GR1XIC0m8YnGrTbHXYljdH3BHWou5PEkMWmUYngzcIOmHE+4ieB aY1B/f2C2ZEgzYWlw6rqcLsYy2EGAOFge130Yi6Xghc5H9lh2qEkr7OCxe8B1N9KWV 7hgQKlTw8JERdZ1zmpHTUxs12YPDH4JcI5XHxmhetbHI5jO6oF7pF3kh+lpZ+P76F6 dgSL/Ftd270IA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 12/15] sh: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:48 +0900 Message-ID: <20240904234803.698424-13-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB when built-in DTB support is enabled. To keep consistency across architectures, this commit also renames CONFIG_USE_BUILTIN_DTB to CONFIG_BUILTIN_DTB, and CONFIG_BUILTIN_DTB_SOURCE to CONFIG_BUILTIN_DTB_NAME. Signed-off-by: Masahiro Yamada --- arch/sh/Kbuild | 1 - arch/sh/Kconfig | 7 ++++--- arch/sh/boot/dts/Makefile | 2 +- arch/sh/kernel/setup.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/sh/Kbuild b/arch/sh/Kbuild index 056efec72c2a..0da6c6d6821a 100644 --- a/arch/sh/Kbuild +++ b/arch/sh/Kbuild @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only obj-y += kernel/ mm/ boards/ obj-$(CONFIG_SH_FPU_EMU) += math-emu/ -obj-$(CONFIG_USE_BUILTIN_DTB) += boot/dts/ obj-$(CONFIG_HD6446X_SERIES) += cchips/hd6446x/ diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 1aa3c4a0c5b2..3b772378773f 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -644,10 +644,11 @@ endmenu menu "Boot options" -config USE_BUILTIN_DTB +config BUILTIN_DTB bool "Use builtin DTB" default n depends on SH_DEVICE_TREE + select GENERIC_BUILTIN_DTB help Link a device tree blob for particular hardware into the kernel, suppressing use of the DTB pointer provided by the bootloader. @@ -655,10 +656,10 @@ config USE_BUILTIN_DTB not capable of providing a DTB to the kernel, or for experimental hardware without stable device tree bindings. -config BUILTIN_DTB_SOURCE +config BUILTIN_DTB_NAME string "Source file for builtin DTB" default "" - depends on USE_BUILTIN_DTB + depends on BUILTIN_DTB help Base name (without suffix, relative to arch/sh/boot/dts) for the a DTS file that will be used to produce the DTB linked into the diff --git a/arch/sh/boot/dts/Makefile b/arch/sh/boot/dts/Makefile index 4a6dec9714a9..d109978a5eb9 100644 --- a/arch/sh/boot/dts/Makefile +++ b/arch/sh/boot/dts/Makefile @@ -1,2 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_USE_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE)) +obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_NAME)) diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 620e5cf8ae1e..aaca94a88dad 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -249,7 +249,7 @@ void __ref sh_fdt_init(phys_addr_t dt_phys) /* Avoid calling an __init function on secondary cpus. */ if (done) return; -#ifdef CONFIG_USE_BUILTIN_DTB +#ifdef CONFIG_BUILTIN_DTB dt_virt = __dtb_start; #else dt_virt = phys_to_virt(dt_phys); @@ -323,7 +323,7 @@ void __init setup_arch(char **cmdline_p) sh_early_platform_driver_probe("earlyprintk", 1, 1); #ifdef CONFIG_OF_EARLY_FLATTREE -#ifdef CONFIG_USE_BUILTIN_DTB +#ifdef CONFIG_BUILTIN_DTB unflatten_and_copy_device_tree(); #else unflatten_device_tree(); From patchwork Wed Sep 4 23:47:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791520 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F20019340A; Wed, 4 Sep 2024 23:48:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493728; cv=none; b=dzwUDeXJBJtsbaw2Wm4yKyELZnjtDyXfeAMgGSTPSIUcRBtbvVNE0kN8Z22kvBt1rVkVqujkIA+CVdbJBKK1L7kT4CbxZt62fsLj2icira+IE2Cxge1UJgyZe1p8Fi0S5+RZxaB6S1GCYf0nurI+QQOujw+4x9rD087caQ7yDmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493728; c=relaxed/simple; bh=BjDiByoacyrF5p/NP/LwM66TJexL9bSHpr0RjtKerQA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F9f5NrfWujbXgALyk9MQB/7lSPjoa2e0ir+XUyg6CKpSIMKrkdQFT4oRm+/xw1grNd0GQxVRAixGFHiF6wkeRgfewOxaIwwbpiOlvwxc/KB55uy6pBE/cKWKekiz8tex3kelNZoOrONu2HTz/txXi10dimDAC2OYveg2pe8dwsc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mWq1UtCZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mWq1UtCZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9CB2C4CEC3; Wed, 4 Sep 2024 23:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493728; bh=BjDiByoacyrF5p/NP/LwM66TJexL9bSHpr0RjtKerQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mWq1UtCZUw8JgXhQSsX3lD0ZvDdyVatWqs8HLRvFbDFUmBZFsVuI5jI25LsH8EBCH vnBLAQe8ThpGx/wOMzWTxbBqL4zuxk3DjWFIbF3JBIcleODYaz2mU0bb0gzkgN82CM iRc5KMuslu9XJxciOQRtVAWAUQvFI6MCmJe1jV5TfBktvuxHzYICv7w7ZfUjFCuDeX eRH0plFPCNrqF3PmMyMEU6m5EW/lqQv4UeYS48di2VpA5b4nbTy/Aiv7oTffpT9Q3b Oq8fTPRXrwd9zUKhsPo+OQaKBaGi5D2ZLOrL50wR/WobCoC01s48Lm14Xp3/LueDww fZxv69Z0WqAjQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 13/15] microblaze: migrate to the generic rule for built-in DTB Date: Thu, 5 Sep 2024 08:47:49 +0900 Message-ID: <20240904234803.698424-14-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Select GENERIC_BUILTIN_DTB to use the generic rule to support built-in DTB. MicroBlaze is the only architecture that embeds the boot DTB into its own section, __fdt_blob, and hard-codes the section size to 64kB. All other architectures that support embedded DTBs use the .dtb.init.rodata handled by include/asm-generic/vmlinux.lds.h. For safety, arch/microblaze/boot/dts/system.dtb is still placed in the __fdt_blob section, but removing the MicroBlaze-specific section should be considered. Signed-off-by: Masahiro Yamada --- arch/microblaze/Kbuild | 1 - arch/microblaze/Kconfig | 5 +++++ arch/microblaze/boot/dts/Makefile | 5 ----- arch/microblaze/boot/dts/linked_dtb.S | 2 -- arch/microblaze/kernel/vmlinux.lds.S | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 arch/microblaze/boot/dts/linked_dtb.S diff --git a/arch/microblaze/Kbuild b/arch/microblaze/Kbuild index 077a0b8e9615..70510389eb92 100644 --- a/arch/microblaze/Kbuild +++ b/arch/microblaze/Kbuild @@ -2,7 +2,6 @@ obj-y += kernel/ obj-y += mm/ obj-$(CONFIG_PCI) += pci/ -obj-y += boot/dts/ # for cleaning subdir- += boot diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index f18ec02ddeb2..4ed8ca89f0c9 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -10,6 +10,7 @@ config MICROBLAZE select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_WANT_IPC_PARSE_VERSION select BUILDTIME_TABLE_SORT + select GENERIC_BUILTIN_DTB select TIMER_OF select CLONE_BACKWARDS3 select COMMON_CLK @@ -47,6 +48,10 @@ config MICROBLAZE select TRACE_IRQFLAGS_SUPPORT select GENERIC_IRQ_MULTI_HANDLER +config BUILTIN_DTB_NAME + string + default "system" + # Endianness selection choice prompt "Endianness selection" diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile index b84e2cbb20ee..87c1d25ff096 100644 --- a/arch/microblaze/boot/dts/Makefile +++ b/arch/microblaze/boot/dts/Makefile @@ -4,11 +4,6 @@ dtb-y := system.dtb ifneq ($(DTB),) -obj-y += linked_dtb.o - -# Ensure system.dtb exists -$(obj)/linked_dtb.o: $(obj)/system.dtb - # Generate system.dtb from $(DTB).dtb ifneq ($(DTB),system) $(obj)/system.dtb: $(obj)/$(DTB).dtb diff --git a/arch/microblaze/boot/dts/linked_dtb.S b/arch/microblaze/boot/dts/linked_dtb.S deleted file mode 100644 index 23345af3721f..000000000000 --- a/arch/microblaze/boot/dts/linked_dtb.S +++ /dev/null @@ -1,2 +0,0 @@ -.section __fdt_blob,"a" -.incbin "arch/microblaze/boot/dts/system.dtb" diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index ae50d3d04a7d..e86f9ca8e979 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -47,7 +47,7 @@ SECTIONS { . = ALIGN (8) ; __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) { _fdt_start = . ; /* place for fdt blob */ - *(__fdt_blob) ; /* Any link-placed DTB */ + *(.dtb.init.rodata) ; /* Any link-placed DTB */ . = _fdt_start + 0x10000; /* Pad up to 64kbyte */ _fdt_end = . ; } From patchwork Wed Sep 4 23:47:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791521 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58F9119340A; Wed, 4 Sep 2024 23:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493731; cv=none; b=dgk8SIB09QQRrHSTJdeX60Jm7ahgWtAgfFWvoXZrFmdgqXE7mXqT4ReyUO25va5na7q94ojyp7FgBv/5EVA3V6Ek2rPRcHmb1DR1jzh0bdyLNyYKgHdX0LTy0rTePDu2QJKBTsZxSsiJ2iZG2UcUdaDK0G/cg8jpPsnPejRu+tQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493731; c=relaxed/simple; bh=x/Z3v/XK8I1GQANjHhGyOrIDt9xA5TgiJymmIsAjDIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KOmWe1qr3RtiIIkPssPWmS/7g73/en2PWSBj8CeB1wdH3Utp3z9khGLSp96XZMBx1d6VyUHMalJWpvX12AXEx4jrW6GJLmMmk8eSp8BexBeCZ83K5U45jRbX3Jv6CjWofRxoeioQ8pSHmqTIISeHruLEketjH+e3Rh1xC4rPFEU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ut0wdZva; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ut0wdZva" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 995DCC4CEC2; Wed, 4 Sep 2024 23:48:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493730; bh=x/Z3v/XK8I1GQANjHhGyOrIDt9xA5TgiJymmIsAjDIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ut0wdZvaJ5RnzqF8X1miesh8kLVoi7K3jVSurqYm2TVdvsx8tDFw/RM8/7O8OzTgU PRwadz+gHFXUGCetAKgR4ILvVeDua8hhV9gwnG1qDGpkMNq7ujfN8W91Ntb+fkXF79 ncidnVMVZ8GXjZoURXitQ53eTXWn89MdvYuWkJeoiRnd/IB3IjG26GAxfc2PI44jQI tc9zKtxHjFMd/se+jORyMsG4HlFEDdVqJiyUUWPEUDpqJEARbP7eFMuUHjlAnKFdGF 8FZoMpEvyWTX0KyzfI7Dwxxi+sdd3P2aF9qpmpiz2qm5zKNioy7u7zKOPbAJUynlgT GLKV8rfrLwF3g== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 14/15] kbuild: rename CONFIG_GENERIC_BUILTIN_DTB to CONFIG_BUILTIN_DTB Date: Thu, 5 Sep 2024 08:47:50 +0900 Message-ID: <20240904234803.698424-15-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that all architectures have migrated to the generic built-in DTB support, the GENERIC_ prefix is no longer necessary. Signed-off-by: Masahiro Yamada --- Makefile | 2 +- arch/arc/Kconfig | 2 +- arch/loongarch/Kconfig | 1 - arch/microblaze/Kconfig | 2 +- arch/mips/Kconfig | 1 - arch/nios2/platform/Kconfig.platform | 1 - arch/openrisc/Kconfig | 2 +- arch/riscv/Kconfig | 1 - arch/sh/Kconfig | 1 - arch/xtensa/Kconfig | 2 +- drivers/of/Kconfig | 2 +- scripts/Makefile.vmlinux | 2 +- scripts/link-vmlinux.sh | 2 +- 13 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 1c765c12ab9e..a83edbdbc79c 100644 --- a/Makefile +++ b/Makefile @@ -1417,7 +1417,7 @@ ifdef CONFIG_OF_EARLY_FLATTREE all: dtbs endif -ifdef CONFIG_GENERIC_BUILTIN_DTB +ifdef CONFIG_BUILTIN_DTB vmlinux: dtbs endif diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 11fe4f497571..05fed3cd8b29 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -16,7 +16,7 @@ config ARC select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC select ARCH_32BIT_OFF_T select BUILDTIME_TABLE_SORT - select GENERIC_BUILTIN_DTB + select BUILTIN_DTB select CLONE_BACKWARDS select COMMON_CLK select DMA_DIRECT_REMAP diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index e1d3e5fb6fd2..70f169210b52 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -388,7 +388,6 @@ endchoice config BUILTIN_DTB bool "Enable built-in dtb in kernel" depends on OF - select GENERIC_BUILTIN_DTB help Some existing systems do not provide a canonical device tree to the kernel at boot time. Let's provide a device tree table in the diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 4ed8ca89f0c9..e1a3b5f4d97e 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -10,7 +10,7 @@ config MICROBLAZE select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_WANT_IPC_PARSE_VERSION select BUILDTIME_TABLE_SORT - select GENERIC_BUILTIN_DTB + select BUILTIN_DTB select TIMER_OF select CLONE_BACKWARDS3 select COMMON_CLK diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 7bfe3fd011f4..fda96e4f2187 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -33,7 +33,6 @@ config MIPS select CPU_NO_EFFICIENT_FFS if (TARGET_ISA_REV < 1) select CPU_PM if CPU_IDLE || SUSPEND select GENERIC_ATOMIC64 if !64BIT - select GENERIC_BUILTIN_DTB if BUILTIN_DTB select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE select GENERIC_GETTIMEOFDAY diff --git a/arch/nios2/platform/Kconfig.platform b/arch/nios2/platform/Kconfig.platform index c75cadd92388..5f0cf551b5ca 100644 --- a/arch/nios2/platform/Kconfig.platform +++ b/arch/nios2/platform/Kconfig.platform @@ -38,7 +38,6 @@ config NIOS2_DTB_PHYS_ADDR config BUILTIN_DTB bool "Compile and link device tree into kernel image" depends on !COMPILE_TEST - select GENERIC_BUILTIN_DTB help This allows you to specify a dts (device tree source) file which will be compiled and linked into the kernel image. diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 11ffcf33652c..f55e66be4112 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -10,7 +10,7 @@ config OPENRISC select ARCH_HAS_DMA_SET_UNCACHED select ARCH_HAS_DMA_CLEAR_UNCACHED select ARCH_HAS_SYNC_DMA_FOR_DEVICE - select GENERIC_BUILTIN_DTB + select BUILTIN_DTB select COMMON_CLK select OF select OF_EARLY_FLATTREE diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 019c64ef0826..a63b66b32636 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -1110,7 +1110,6 @@ config RISCV_ISA_FALLBACK config BUILTIN_DTB bool "Built-in device tree" depends on OF && NONPORTABLE - select GENERIC_BUILTIN_DTB help Build a device tree into the Linux image. This option should be selected if no bootloader is being used. diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 3b772378773f..b09019cd87d4 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -648,7 +648,6 @@ config BUILTIN_DTB bool "Use builtin DTB" default n depends on SH_DEVICE_TREE - select GENERIC_BUILTIN_DTB help Link a device tree blob for particular hardware into the kernel, suppressing use of the DTB pointer provided by the bootloader. diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 5fd1d248e147..cccfacb5848d 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -19,7 +19,7 @@ config XTENSA select ARCH_USE_QUEUED_SPINLOCKS select ARCH_WANT_IPC_PARSE_VERSION select BUILDTIME_TABLE_SORT - select GENERIC_BUILTIN_DTB + select BUILTIN_DTB select CLONE_BACKWARDS select COMMON_CLK select DMA_NONCOHERENT_MMAP if MMU diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index 5142e7d7fef8..53a227ca3a3c 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -2,7 +2,7 @@ config DTC bool -config GENERIC_BUILTIN_DTB +config BUILTIN_DTB bool config BUILTIN_DTB_ALL diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index 4626b472da49..677fc5a4e8c1 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -53,7 +53,7 @@ quiet_cmd_gen_dtbs_list = GEN $@ targets += .builtin-dtbs-list -ifdef CONFIG_GENERIC_BUILTIN_DTB +ifdef CONFIG_BUILTIN_DTB targets += .builtin-dtbs.S .builtin-dtbs.o vmlinux: .builtin-dtbs.o endif diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index bd196944e350..c58dc9d86e2d 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -68,7 +68,7 @@ vmlinux_link() libs="${KBUILD_VMLINUX_LIBS}" fi - if is_enabled CONFIG_GENERIC_BUILTIN_DTB; then + if is_enabled CONFIG_BUILTIN_DTB; then objs="${objs} .builtin-dtbs.o" fi From patchwork Wed Sep 4 23:47:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13791522 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A4A419412F; Wed, 4 Sep 2024 23:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493733; cv=none; b=BUSuvf+SoElVCgSytSS1oJG5xzQ3/si9cn2as/v2fzxbimaWLJ+i8eSDR9Wu0JIvtI37gjawnL0btBOJua/kLUwJBCt9QneGKsgDr3MA+G8Z7yFFrVtdcyEMtsrFxQAo0seG8Hv3d+Gq3G6wsSPa+CN3qJH8Uie0wcrNzj3EoJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725493733; c=relaxed/simple; bh=X36d1ZLy2VkgrLWOHRLYke7ZNl3jahnWeNpcJovYays=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RYKx7QnvLlF1In9bPMG9+6y6/mLAe3HOUHHAcrzjpC8owURFnUsb2PQkNKaAO0UAADK5wqA183HYiuEkTrEv3Asd0Pf3q7phifhChFMzlYAUPt3pp7Da69wPNTQWP2pGRZOd6V/RgvkHmi1KJaOyirF/y+DK9JZK4ABdj0VMoSs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y2gZoLH9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y2gZoLH9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FF2BC4CECA; Wed, 4 Sep 2024 23:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725493733; bh=X36d1ZLy2VkgrLWOHRLYke7ZNl3jahnWeNpcJovYays=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2gZoLH9QReVU2beUb37eQb86PpeBHhfuYh04yM6PcStHc5a1MJwX5bzTQip8QgIN ThrZWo14eLlz72zPRNBf3CdFCnWWPvsoj7JrcDEd8MKK+uxKs1Gw7qXJMOWhXSwltr 9kEyPolldAhCurBcGOMorBnW0BLlhb2kEEAjjoDuSIJJ5ZfEIbYts6DnDX6nw31jA1 oezNgGSlDQtJdZCd0txWWcWX5wKt0e1/2xwyTczUJV2NA0hKXcts35xX4SFK6oi0iw fONr6eZWZE7gL3WL+5tAWFKpZbcHjqNPH+JzGOWALncjhVORNz+4mxqqXlDqVoKZHU mnHKIm6R+pFZA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, Dinh Nguyen , Masahiro Yamada Subject: [PATCH 15/15] kbuild: use .init.rodata section unconditionally for cmd_wrap_S_dtb Date: Thu, 5 Sep 2024 08:47:51 +0900 Message-ID: <20240904234803.698424-16-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org> References: <20240904234803.698424-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Boot DTBs are now wrapped and compiled in scripts/Makefile.vmlinux. The cmd_wrap_S_dtb rule in scripts/Makefile.dtbs is now only used for generic purposes, so the .init.rodata section should be used unconditionally. Signed-off-by: Masahiro Yamada --- scripts/Makefile.dtbs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs index 55998b878e54..436bfea85bb9 100644 --- a/scripts/Makefile.dtbs +++ b/scripts/Makefile.dtbs @@ -34,14 +34,12 @@ $(obj)/dtbs-list: $(dtb-y) FORCE # Assembly file to wrap dtb(o) # --------------------------------------------------------------------------- -builtin-dtb-section = $(if $(filter arch/%, $(obj)),.dtb.init.rodata,.init.rodata) - # Generate an assembly file to wrap the output of the device tree compiler quiet_cmd_wrap_S_dtb = WRAP $@ cmd_wrap_S_dtb = { \ symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \ echo '\#include '; \ - echo '.section $(builtin-dtb-section),"a"'; \ + echo '.section .init.rodata,"a"'; \ echo '.balign STRUCT_ALIGNMENT'; \ echo ".global $${symbase}_begin"; \ echo "$${symbase}_begin:"; \