From mboxrd@z Thu Jan 1 00:00:00 1970 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 91B5F2080F9 for ; Tue, 14 Jan 2025 18:15:03 +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=1736878503; cv=none; b=KqDF6j/fX6B93WnrNDR0XZ8AOiUBC2Q7aJKSB3GPmca53orIMJ0ZTVlX7FDsW772n5K/VIbkh0R486xeCGbYLZKC4EQlGPhDzofrPYxiZjeqdP4NyrkCQ4oZGFjDQCJny7n/K3P+HiIXAsylLf0quOzlW5IjjoIz6hbKyO7CjMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736878503; c=relaxed/simple; bh=9z7vpLDaXFznKVDorXKsRAqXLF7LPbYFzaLVAthC+FU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MLQEbhNo9f9VBHSN7/yBP0DYgixonHXMXLxK2CUfgpp2Mfa1FooMPx0If8OItuqxJGULNDUZiyGBby3qL6fDMmp3/qs1WjUxkx4PYA69RGE2QYIBcSV3YixTq+FZ/QCLx53Cie8S3UN4ldKbCNwGfokj1nZtDVM5kML4lMKwirk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DeUhYzYZ; 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="DeUhYzYZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67F1EC4CEE7; Tue, 14 Jan 2025 18:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736878503; bh=9z7vpLDaXFznKVDorXKsRAqXLF7LPbYFzaLVAthC+FU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DeUhYzYZRaTPW4H/wu6xFV+JuDDz1vFJLCkcxCo0dKSdBPMEItM4BWk8LiylZbc5D gpbR8uU3HhfJSD8lD+JELCTbX8VQCyk5T5IXfNyc6fG7d80t8iM1ThvFdduYTHexSd wn5efYy0i3pN/5wJJeDyH9y9DjyJ7coxRxsVccfshzsrV7Hecew9pnl8ju0DLS0GUO jij25A3ShjduRr/zWJvkau9NcfVd8Cmok4dGqSLCqpb7uDjaqWfIXFVXC0ibMu5Ps0 zkVyAmEDKgKvi5VeKbvdJdNYlyBewfTaT9Mv/Da9j8Bz33oMePT+YeAC2Nk7mixSfZ QQ0E/V3rFShFw== From: Masahiro Yamada To: Michal Simek Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 3/4] microblaze: prevent linux.bin from containing a built-in DTB Date: Wed, 15 Jan 2025 03:13:53 +0900 Message-ID: <20250114181359.4192564-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250114181359.4192564-1-masahiroy@kernel.org> References: <20250114181359.4192564-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit MicroBlaze is the only architecture that specifies the built-in DTB directly via the command line (i.e., 'make simpleImage.*'). All other architectures supporting a builtin DTB use a CONFIG option to specify the DTB. Kbuild supports building multiple targets in a single command. Running 'make foo bar' should produce the same output as executing 'make foo' and 'make bar' separately. The oddity in MicroBlaze does not align with the Kbuild philosophy. For example: $ make all simpleImage.foo This creates both linux.bin (since 'all' depends on linux.bin) and simpleImage.foo. It generates linux.bin containing foo.dtb, while linux.bin generated by 'make all' contains no DTB. Michal Simek requires that linux.bin contain no built-in DTB. [1] Therefore, the linux.bin generated in the example above is considered invalid. This commit introduces a sanity check to avoid creating such an invalid linux.bin. Similarly, you cannot do 'make simpleImage.foo simpleImage.bar' since it is unclear which DTB (foo.dtb or bar.dtb) should be included. This command will fail without an explicit check. [1]: https://lore.kernel.org/all/d2bdfbfd-3721-407f-991e-566d48392add@amd.com/ Signed-off-by: Masahiro Yamada --- arch/microblaze/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 02e6be9c5b0d..670a1690aa73 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -66,6 +66,7 @@ PHONY += linux.bin linux.bin.gz linux.bin.ub linux.bin.ub linux.bin.gz: linux.bin linux.bin: vmlinux linux.bin linux.bin.gz linux.bin.ub: + $(if $(filter simpleImage.%, $(MAKECMDGOALS)),$(error You cannot build linux.bin and simpleImage.* at the same time)) $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ @echo 'Kernel: $(boot)/$@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')' -- 2.43.0