From patchwork Sat Feb 15 13:36:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 24673 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 295BB20967 for ; Sat, 15 Feb 2014 14:12:23 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j5sf25512463qaq.6 for ; Sat, 15 Feb 2014 06:12:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=ub4z5E+NlyEABGVT96TVqSNCrXzipe1zKJsVfh1c2WQ=; b=iutQiYW7SDPqM3bEb7e+C5Zx2FFyh+x4Ysf3Y+Qhq89UbqF5ASOMQwHI9dONCh+8wY x2GUyl501D3DKSQXsi6vdW0OqcRkj2AAtrTfmfAKHofuCSMN19LMafSp6gYSA6oGH9An z6VUryWqpB28JYCpOybWLYlpX9HIFCl3D1sJlF+9i8429rM1PeQw5OOWtbaGt0yglRy3 6/QxFpnBiWaCLRFfNnu7RqbTEZzApspGMGpjYFwJ1DXr1xN6qxK8rQZExKCKQYBQZJ/m +h4OHREB5bQuGC3NcxoxzsucZo+c7jAmndoiflw18Wd8HHkDFh8QPerKYZG/8NnboZFK 9p6w== X-Gm-Message-State: ALoCoQlSMHZoTKwJEONlGheH6jY6U3KANMsIQYCowdMK4Uv5Cm9VzZLDpIsC9boa0P3mcRWk21QW X-Received: by 10.224.55.19 with SMTP id s19mr5827150qag.0.1392473542354; Sat, 15 Feb 2014 06:12:22 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.138 with SMTP id c10ls358487qga.63.gmail; Sat, 15 Feb 2014 06:12:22 -0800 (PST) X-Received: by 10.221.39.138 with SMTP id tm10mr9604464vcb.7.1392473542285; Sat, 15 Feb 2014 06:12:22 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id h13si2921638vct.143.2014.02.15.06.12.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Feb 2014 06:12:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id cz12so10407013veb.26 for ; Sat, 15 Feb 2014 06:12:22 -0800 (PST) X-Received: by 10.52.65.171 with SMTP id y11mr37254vds.52.1392473542188; Sat, 15 Feb 2014 06:12:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp19922vcz; Sat, 15 Feb 2014 06:12:20 -0800 (PST) X-Received: by 10.15.90.203 with SMTP id q51mr15741767eez.6.1392473539630; Sat, 15 Feb 2014 06:12:19 -0800 (PST) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id v48si18566838eeo.209.2014.02.15.06.12.19 for ; Sat, 15 Feb 2014 06:12:19 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B880B4B705; Sat, 15 Feb 2014 15:12:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 p0m7BgWDHFf3; Sat, 15 Feb 2014 15:12:10 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C09E04B73A; Sat, 15 Feb 2014 15:11:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 811974B704 for ; Sat, 15 Feb 2014 15:11:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 SFu7sID8WQ6E for ; Sat, 15 Feb 2014 15:11:19 +0100 (CET) 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 inca-roads.misterjones.org (inca-roads.misterjones.org [213.251.177.50]) by theia.denx.de (Postfix) with ESMTPS id 6F5874B6F3 for ; Sat, 15 Feb 2014 15:11:19 +0100 (CET) Received: from [176.250.132.24] (helo=why.wild-wind.fr.eu.org) by cheepnis.misterjones.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1WEfQL-00038M-BF; Sat, 15 Feb 2014 14:36:53 +0100 From: Marc Zyngier To: u-boot@lists.denx.de, linux-sunxi@googlegroups.com Date: Sat, 15 Feb 2014 13:36:33 +0000 Message-Id: <1392471397-2158-10-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1392471397-2158-1-git-send-email-marc.zyngier@arm.com> References: <1392471397-2158-1-git-send-email-marc.zyngier@arm.com> X-SA-Exim-Connect-IP: 176.250.132.24 X-SA-Exim-Rcpt-To: u-boot@lists.denx.de, linux-sunxi@googlegroups.com, maxime.ripard@free-electrons.com, ijc@hellion.org.uk, andre@andrep.de, henrik@henriknordstrom.net, maz@misterjones.org, mahaijuns@gmail.com X-SA-Exim-Mail-From: marc.zyngier@arm.com X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Cc: Andre Przywara , Ian Campbell , maz@misterjones.org Subject: [U-Boot] [PATCH v3 09/13] ARM: convert arch_fixup_memory_node to a generic FDT fixup function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Ma Haijun Some architecture needs extra device tree setup. Instead of adding yet another hook, convert arch_fixup_memory_node to be a generic FDT fixup function. [maz: collapsed 3 patches into one, rewrote commit message] Signed-off-by: Ma Haijun Signed-off-by: Marc Zyngier --- arch/arm/lib/bootm-fdt.c | 2 +- arch/arm/lib/bootm.c | 2 +- common/image-fdt.c | 7 +++++-- include/common.h | 6 +++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c index e40691d..8394e15 100644 --- a/arch/arm/lib/bootm-fdt.c +++ b/arch/arm/lib/bootm-fdt.c @@ -20,7 +20,7 @@ DECLARE_GLOBAL_DATA_PTR; -int arch_fixup_memory_node(void *blob) +int arch_fixup_fdt(void *blob) { bd_t *bd = gd->bd; int bank; diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index ecc25f9..866280a 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -357,7 +357,7 @@ void boot_prep_vxworks(bootm_headers_t *images) if (images->ft_addr) { off = fdt_path_offset(images->ft_addr, "/memory"); if (off < 0) { - if (arch_fixup_memory_node(images->ft_addr)) + if (arch_fixup_fdt(images->ft_addr)) puts("## WARNING: fixup memory failed!\n"); } } diff --git a/common/image-fdt.c b/common/image-fdt.c index 6f9ce7d..398e576 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -445,7 +445,7 @@ __weak int ft_verify_fdt(void *fdt) return 1; } -__weak int arch_fixup_memory_node(void *blob) +__weak int arch_fixup_fdt(void *blob) { return 0; } @@ -462,7 +462,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, puts(" - must RESET the board to recover.\n"); return -1; } - arch_fixup_memory_node(blob); + if (arch_fixup_fdt(blob) < 0) { + puts("ERROR: arch specific fdt fixup failed"); + return -1; + } if (IMAAGE_OF_BOARD_SETUP) ft_board_setup(blob, gd->bd); fdt_fixup_ethernet(blob); diff --git a/include/common.h b/include/common.h index 7b4a6e9..0b5252e 100644 --- a/include/common.h +++ b/include/common.h @@ -317,14 +317,14 @@ int update_flash_size(int flash_size); void board_show_dram(ulong size); /** - * arch_fixup_memory_node() - Write arch-specific memory information to fdt + * arch_fixup_fdt() - Write arch-specific information to fdt * - * Defined in arch/$(ARCH)/lib/bootm.c + * Defined in arch/$(ARCH)/lib/bootm-fdt.c * * @blob: FDT blob to write to * @return 0 if ok, or -ve FDT_ERR_... on failure */ -int arch_fixup_memory_node(void *blob); +int arch_fixup_fdt(void *blob); /* common/flash.c */ void flash_perror (int);