From patchwork Wed Jan 24 17:47:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 865413 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zRXgK4HC9z9sNr for ; Thu, 25 Jan 2018 04:47:25 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3C25BC22212; Wed, 24 Jan 2018 17:47:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3B47DC21E8E; Wed, 24 Jan 2018 17:47:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 52B5AC21E8E; Wed, 24 Jan 2018 17:47:18 +0000 (UTC) Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.47.9]) by lists.denx.de (Postfix) with ESMTPS id 93E24C21C93 for ; Wed, 24 Jan 2018 17:47:17 +0000 (UTC) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 9981E24E085A; Wed, 24 Jan 2018 09:47:15 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 7EE3175D; Wed, 24 Jan 2018 09:47:15 -0800 (PST) Received: from abrodkin-7480l.internal.synopsys.com (unknown [10.225.15.87]) by mailhost.synopsys.com (Postfix) with ESMTP id 123DA738; Wed, 24 Jan 2018 09:47:12 -0800 (PST) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Wed, 24 Jan 2018 20:47:09 +0300 Message-Id: <20180124174709.32714-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.14.3 Cc: Stefan Roese , Alexey Brodkin Subject: [U-Boot] [PATCH] fdt: Implement weak arch_fixup_fdt() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Only ARM and in some configs MIPS really implement arch_fixup_fdt(). Others just use the same boilerplate which is not good by itself, but what's worse if we try to build with disabled CONFIG_CMD_BOOTM and enabled CONFIG_OF_LIBFDT we'll hit an unknown symbol which was apparently implemented in arch/xxx/lib/bootm.c. Now with weak arch_fixup_fdt() right in image-fdt.c where it is used we get both items highlighted above fixed. Signed-off-by: Alexey Brodkin Cc: Daniel Schwierzeck Cc: Simon Glass Cc: York Sun Cc: Stefan Roese Reviewed-by: Tom Rini Reviewed-by: Daniel Schwierzeck --- arch/arc/lib/bootm.c | 5 ----- arch/microblaze/lib/bootm.c | 5 ----- arch/mips/lib/bootm.c | 6 ++---- arch/nds32/lib/bootm.c | 6 ------ arch/powerpc/lib/bootm.c | 5 ----- arch/sandbox/lib/bootm.c | 5 ----- arch/x86/lib/bootm.c | 5 ----- common/image-fdt.c | 5 +++++ 8 files changed, 7 insertions(+), 35 deletions(-) diff --git a/arch/arc/lib/bootm.c b/arch/arc/lib/bootm.c index 9eef7070cf43..4d4acff239d4 100644 --- a/arch/arc/lib/bootm.c +++ b/arch/arc/lib/bootm.c @@ -37,11 +37,6 @@ void arch_lmb_reserve(struct lmb *lmb) lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp)); } -int arch_fixup_fdt(void *blob) -{ - return 0; -} - static int cleanup_before_linux(void) { disable_interrupts(); diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c index 0a286e82c2be..f33ef087577d 100644 --- a/arch/microblaze/lib/bootm.c +++ b/arch/microblaze/lib/bootm.c @@ -17,11 +17,6 @@ DECLARE_GLOBAL_DATA_PTR; -int arch_fixup_fdt(void *blob) -{ - return 0; -} - int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images) { diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 5a9a2811ffb5..9dc47407684b 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -253,17 +253,15 @@ static int boot_reloc_fdt(bootm_headers_t *images) #endif } +#if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT) int arch_fixup_fdt(void *blob) { -#if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT) u64 mem_start = virt_to_phys((void *)gd->bd->bi_memstart); u64 mem_size = gd->ram_size; return fdt_fixup_memory_banks(blob, &mem_start, &mem_size, 1); -#else - return 0; -#endif } +#endif static int boot_setup_fdt(bootm_headers_t *images) { diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c index 42b15dfcbfc0..0d7f57851739 100644 --- a/arch/nds32/lib/bootm.c +++ b/arch/nds32/lib/bootm.c @@ -15,12 +15,6 @@ DECLARE_GLOBAL_DATA_PTR; -int arch_fixup_fdt(void *blob) -{ - return 0; -} - - #if defined(CONFIG_SETUP_MEMORY_TAGS) || \ defined(CONFIG_CMDLINE_TAG) || \ defined(CONFIG_INITRD_TAG) || \ diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c index b9ae24dc98b6..6ef644d85ba3 100644 --- a/arch/powerpc/lib/bootm.c +++ b/arch/powerpc/lib/bootm.c @@ -40,11 +40,6 @@ static void set_clocks_in_mhz (bd_t *kbd); #define CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE (768*1024*1024) #endif -int arch_fixup_fdt(void *blob) -{ - return 0; -} - static void boot_jump_linux(bootm_headers_t *images) { void (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6, diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c index 4cdd18fe14b2..0c9a7979d231 100644 --- a/arch/sandbox/lib/bootm.c +++ b/arch/sandbox/lib/bootm.c @@ -50,11 +50,6 @@ int bootz_setup(ulong image, ulong *start, ulong *end) return ret; } -int arch_fixup_fdt(void *blob) -{ - return 0; -} - int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) { diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index e548cdbed592..8e76ba35aea5 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -28,11 +28,6 @@ DECLARE_GLOBAL_DATA_PTR; #define COMMAND_LINE_OFFSET 0x9000 -int arch_fixup_fdt(void *blob) -{ - return 0; -} - __weak void board_quiesce_devices(void) { } diff --git a/common/image-fdt.c b/common/image-fdt.c index 1e946467e3c7..24e4c7c6c814 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -454,6 +454,11 @@ __weak int ft_verify_fdt(void *fdt) return 1; } +__weak int arch_fixup_fdt(void *blob) +{ + return 0; +} + int image_setup_libfdt(bootm_headers_t *images, void *blob, int of_size, struct lmb *lmb) {