From patchwork Mon Jan 20 22:47:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 312760 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B2EDA2C00A8 for ; Tue, 21 Jan 2014 09:48:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 57CBB4B269; Mon, 20 Jan 2014 23:48: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 KoxgcOiOM4To; Mon, 20 Jan 2014 23:48:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F26F4B20E; Mon, 20 Jan 2014 23:48:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B7F84B20E for ; Mon, 20 Jan 2014 23:48:08 +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 uykO5ECSx8Dk for ; Mon, 20 Jan 2014 23:48:02 +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 mail-qe0-f51.google.com (mail-qe0-f51.google.com [209.85.128.51]) by theia.denx.de (Postfix) with ESMTPS id 8CB314B209 for ; Mon, 20 Jan 2014 23:47:54 +0100 (CET) Received: by mail-qe0-f51.google.com with SMTP id d4so836622qej.24 for ; Mon, 20 Jan 2014 14:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id; bh=ekpJWuC5EubPyWK04BcJWKfUiDo3dOWKd84FJ6LH7mI=; b=CnEakaKTIh5uXMrB+vjupmzit7Ael85NAAZIDIcL5Hj0LhU+wggIS11wlq9/RTPk7O 94rTGTN9TaFHLRsywA7NloI9tBZs0UKvo686lQE36tAkQyw3WwAcskJRWaKDa6ZVMbiq d4TPXjsGgPvredXSzyJBL1fUfXzpS/dfsqBn46tZdmsABI6l47vcyyPNbpcIAXJorpnS GZPWEmN9GEa2ZnkDORRGrJE1kjgVI9Ppa2aKFNTJzh9zdXzWRfztHHT4HhwHaGFct4lC kpQ0CSwiw4PnVezZw7PV/7pVwdLwUGTzZQ/krnV384efU0lE6x1sAkSOvwB2Xk7ef1Ut Absw== X-Received: by 10.224.75.138 with SMTP id y10mr32188893qaj.72.1390258072709; Mon, 20 Jan 2014 14:47:52 -0800 (PST) Received: from localhost.localdomain (cpe-174-106-216-211.ec.res.rr.com. [174.106.216.211]) by mx.google.com with ESMTPSA id o75sm1363679qgd.11.2014.01.20.14.47.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jan 2014 14:47:51 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Date: Mon, 20 Jan 2014 17:47:25 -0500 Message-Id: <1390258045-22112-1-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 Subject: [U-Boot] [PATCH] fdt_support.c: Correct linux, initrd-start/end setting X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion 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 The change to add 64bit initrd support broke 32bit initrd support as it always set 64bits worth of data into the properties, even on 32bit systems. The fix is to use addr_cell_len (which already says how much data is in 'tmp') to set the property, rather than always setting 8. Thanks to Stephen Warren for pointing out the fix here. Reported-by: Otavio Salvador Signed-off-by: Tom Rini --- common/fdt_support.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index b9dce99..f9f358e 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -204,7 +204,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) if ((path == NULL) || force) { write_cell((u8 *)&tmp, initrd_start, addr_cell_len); err = fdt_setprop(fdt, nodeoffset, - "linux,initrd-start", &tmp, sizeof(tmp)); + "linux,initrd-start", &tmp, addr_cell_len); if (err < 0) { printf("WARNING: " "could not set linux,initrd-start %s.\n", @@ -213,7 +213,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) } write_cell((u8 *)&tmp, initrd_end, addr_cell_len); err = fdt_setprop(fdt, nodeoffset, - "linux,initrd-end", &tmp, sizeof(tmp)); + "linux,initrd-end", &tmp, addr_cell_len); if (err < 0) { printf("WARNING: could not set linux,initrd-end %s.\n", fdt_strerror(err));