From patchwork Tue Oct 4 12:03:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 77260 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2194188qgf; Tue, 4 Oct 2016 05:39:00 -0700 (PDT) X-Received: by 10.28.20.82 with SMTP id 79mr13731449wmu.36.1475584739995; Tue, 04 Oct 2016 05:38:59 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id gg6si4240053wjd.136.2016.10.04.05.38.59; Tue, 04 Oct 2016 05:38:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8ECC3A766B; Tue, 4 Oct 2016 14:38:14 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m3I-3_grX5Fm; Tue, 4 Oct 2016 14:38:14 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5EC04A763F; Tue, 4 Oct 2016 14:37:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B5E0AA7613 for ; Tue, 4 Oct 2016 14:02:46 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u5NIWqhgWy2q for ; Tue, 4 Oct 2016 14:02:46 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by theia.denx.de (Postfix) with ESMTPS id 1151DA7609 for ; Tue, 4 Oct 2016 14:02:42 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id u94C1OWA029108; Tue, 4 Oct 2016 21:01:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com u94C1OWA029108 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1475582488; bh=/Rb/SX9LlsiuOMjAaxTRVzBdae3xujetMVYG+uQf7Z8=; h=From:To:Cc:Subject:Date:From; b=1DJ7LzJEue/UVQdAZstM5ph++ntR2tzU8wnmTaUv1WRD0yAb/+nIy1CvP3z/6Baxu MSNn0n0Gxt8Gf/stRsZcgI27BxFf8dlReJ/w6XPqW+U/AiDWn/OqNDLAdtWYk979wW TIawwwok9t9mUNlHol0IIGNrdMTUhWMkGcXKQHKEMu8gkmGHic/JqRJSYP6l/gyAeu ehVotSuQJJeMpOkJ7umSCBOt7AS5ryUjWlvESiXAw2EYnEm95bL4ZnafnfE4kzgo9B VQVruQmp5KUhNS+zPTm6F7SiXdkckqS4J9wl4OSumThBeularhVy42OEQxGAD3VCNG K2KLwIfxGnYsQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 4 Oct 2016 21:03:34 +0900 Message-Id: <1475582615-8532-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Tue, 04 Oct 2016 14:37:30 +0200 Cc: "Jon Medhurst \(Tixy\)" , Joe Hershberger , Stephen Warren , Lev Iserovich , Michal Simek , Hou Zhiqiang , Jeffy Chen , Scott Wood , Andreas Dannenberg , Purna Chandra Mandal , Daniel Allred Subject: [U-Boot] [PATCH] libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option") allows us to skip memory setup of DTB, but a problem for ARM is that spin_table_update_dt() and psci_update_dt() are skipped as well if CONFIG_ARCH_FIXUP_FDT is disabled. This commit allows us to skip only fdt_fixup_memory_banks() instead of the whole of arch_fixup_fdt(). It will be useful when we want to use a memory node from a kernel DTB as is, but need some fixups for Spin-Table/PSCI. Signed-off-by: Masahiro Yamada --- Kconfig | 5 ++--- arch/arm/lib/bootm-fdt.c | 2 -- arch/arm/lib/bootm.c | 2 -- arch/mips/lib/bootm.c | 2 -- common/fdt_support.c | 2 ++ common/image-fdt.c | 7 +++++-- include/fdt_support.h | 8 ++++++++ 7 files changed, 17 insertions(+), 11 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/Kconfig b/Kconfig index 1263d0b..b7cb142 100644 --- a/Kconfig +++ b/Kconfig @@ -324,9 +324,8 @@ config SYS_CLK_FREQ help TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture -config ARCH_FIXUP_FDT - bool "Enable arch_fixup_fdt() call" - depends on ARM || MIPS +config ARCH_FIXUP_FDT_MEMORY + bool "Enable arch_fixup_memory_banks() call" default y help Enable FDT memory map syncup before OS boot. This feature can be diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c index a517550..4481f9e 100644 --- a/arch/arm/lib/bootm-fdt.c +++ b/arch/arm/lib/bootm-fdt.c @@ -25,7 +25,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CONFIG_ARCH_FIXUP_FDT int arch_fixup_fdt(void *blob) { bd_t *bd = gd->bd; @@ -61,4 +60,3 @@ int arch_fixup_fdt(void *blob) return 0; } -#endif diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 53c3141..0e890ce 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -372,10 +372,8 @@ void boot_prep_vxworks(bootm_headers_t *images) if (images->ft_addr) { off = fdt_path_offset(images->ft_addr, "/memory"); if (off < 0) { -#ifdef CONFIG_ARCH_FIXUP_FDT if (arch_fixup_fdt(images->ft_addr)) puts("## WARNING: fixup memory failed!\n"); -#endif } } #endif diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 0c6a4ab..aa0475a 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -253,7 +253,6 @@ static int boot_reloc_fdt(bootm_headers_t *images) #endif } -#ifdef CONFIG_ARCH_FIXUP_FDT int arch_fixup_fdt(void *blob) { #if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT) @@ -265,7 +264,6 @@ int arch_fixup_fdt(void *blob) return 0; #endif } -#endif static int boot_setup_fdt(bootm_headers_t *images) { diff --git a/common/fdt_support.c b/common/fdt_support.c index 2020586..c87031f 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -381,6 +381,7 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create); } +#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY /* * fdt_pack_reg - pack address and size array into the "reg"-suitable stream */ @@ -459,6 +460,7 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks) } return 0; } +#endif int fdt_fixup_memory(void *blob, u64 start, u64 size) { diff --git a/common/image-fdt.c b/common/image-fdt.c index 3d23608..91970d4 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -458,6 +458,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) { @@ -474,12 +479,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, printf("ERROR: /chosen node create failed\n"); goto err; } -#ifdef CONFIG_ARCH_FIXUP_FDT if (arch_fixup_fdt(blob) < 0) { printf("ERROR: arch-specific fdt fixup failed\n"); goto err; } -#endif if (IMAGE_OF_BOARD_SETUP) { fdt_ret = ft_board_setup(blob, gd->bd); if (fdt_ret) { diff --git a/include/fdt_support.h b/include/fdt_support.h index 8f40231..7110061 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -93,7 +93,15 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size); * property will be left untouched. * @return 0 if ok, or -1 or -FDT_ERR_... on error */ +#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks); +#else +static inline int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], + int banks) +{ + return 0; +} +#endif void fdt_fixup_ethernet(void *fdt); int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,