From patchwork Sat Apr 26 12:17:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 29151 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E955202E6 for ; Sat, 26 Apr 2014 12:18:07 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id vb8sf28542947obc.11 for ; Sat, 26 Apr 2014 05:18:07 -0700 (PDT) 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: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=/VWnJjiAAv9JqSBqpYo0SPm6g9kTxNG+7SELix+jUlY=; b=jfMb0n+2/+YenziKmWAneF8M3OTVf40FA8Nh6ibaYTQIsWe18h2cgw5V7D4A/Hx4gu SRz8eIMYClbL4gxFv/VQcDl4coIykiksiyqUqWjdEpV1gC9QiM0fpKE6C4F1lleE7vSp JnvEmJlwoEDu7RCYSZ6iA95ACixGnIkPLWYuewdv4GP8ycM+pdg9p/tU3VZD66jIdCio PrBQ40zff0slXZPdm/FpuU6hq+bQpPH6vaC8psp1s/qTjKjZ1J2iq7FZQHzQ1LsoKx0z 8xN6bcK/pcClkf01wQm0ywEbZCEGbIZYCCDWerXiMWkwvUh6niBuim3dDjzKBTOFv+/R ckOg== X-Gm-Message-State: ALoCoQkmrkb7hk5ZvufMMLkqFH7QDtTQH8lv5y9ai+7542IDV4K+sRf30uiH73uUx9j4Np52aLGc X-Received: by 10.182.241.9 with SMTP id we9mr7504461obc.22.1398514687172; Sat, 26 Apr 2014 05:18:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.210 with SMTP id o76ls1908948qga.66.gmail; Sat, 26 Apr 2014 05:18:07 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr12165214vcb.23.1398514687068; Sat, 26 Apr 2014 05:18:07 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id i19si2398820vco.163.2014.04.26.05.18.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Apr 2014 05:18:07 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so6106392veb.0 for ; Sat, 26 Apr 2014 05:18:07 -0700 (PDT) X-Received: by 10.221.4.66 with SMTP id ob2mr55782vcb.28.1398514686987; Sat, 26 Apr 2014 05:18:06 -0700 (PDT) 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.221.72 with SMTP id ib8csp164779vcb; Sat, 26 Apr 2014 05:18:06 -0700 (PDT) X-Received: by 10.14.214.198 with SMTP id c46mr17766770eep.29.1398514686138; Sat, 26 Apr 2014 05:18:06 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id r9si16477870eew.318.2014.04.26.05.18.05 for ; Sat, 26 Apr 2014 05:18:06 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B4395A74BB; Sat, 26 Apr 2014 14:17:52 +0200 (CEST) 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 QTbz1LWnVoep; Sat, 26 Apr 2014 14:17:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B8D17A73EA; Sat, 26 Apr 2014 14:17:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 509CD4BFD1 for ; Sat, 26 Apr 2014 14:17:30 +0200 (CEST) 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 foIZzjuSH36h for ; Sat, 26 Apr 2014 14:17:27 +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 inca-roads.misterjones.org (inca-roads.misterjones.org [213.251.177.50]) by theia.denx.de (Postfix) with ESMTPS id 368C94BF5A for ; Sat, 26 Apr 2014 14:17:21 +0200 (CEST) Received: from [2.125.202.75] (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 1We1Xl-0003DF-Bk; Sat, 26 Apr 2014 14:17:21 +0200 From: Marc Zyngier To: u-boot@lists.denx.de Date: Sat, 26 Apr 2014 13:17:10 +0100 Message-Id: <1398514631-23956-10-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1398514631-23956-1-git-send-email-marc.zyngier@arm.com> References: <1398514631-23956-1-git-send-email-marc.zyngier@arm.com> X-SA-Exim-Connect-IP: 2.125.202.75 X-SA-Exim-Rcpt-To: u-boot@lists.denx.de, albert.u.boot@aribaud.net, 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 Subject: [U-Boot] [PATCH v4 09/10] 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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 61aa14e..4cff6b0 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 a54a919..6f074de 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 (IMAGE_OF_BOARD_SETUP) ft_board_setup(blob, gd->bd); fdt_fixup_ethernet(blob); diff --git a/include/common.h b/include/common.h index 5fb0bb2..3f50437 100644 --- a/include/common.h +++ b/include/common.h @@ -326,14 +326,14 @@ int arch_early_init_r(void); 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);