From patchwork Wed Feb 24 16:14:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 587513 X-Patchwork-Delegate: sjg@chromium.org 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 7BD73140321 for ; Thu, 25 Feb 2016 03:15:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=mePC/m9Q; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4B339A771F; Wed, 24 Feb 2016 17:15:33 +0100 (CET) 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 e2tQ7bMfID1T; Wed, 24 Feb 2016 17:15:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BBF0A7700; Wed, 24 Feb 2016 17:15:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F366A74A8 for ; Wed, 24 Feb 2016 17:15:08 +0100 (CET) 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 XS5ZdcIsURTx for ; Wed, 24 Feb 2016 17:15:08 +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-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by theia.denx.de (Postfix) with ESMTPS id 2F24EA7606 for ; Wed, 24 Feb 2016 17:15:03 +0100 (CET) Received: by mail-ob0-f169.google.com with SMTP id jq7so21699318obb.0 for ; Wed, 24 Feb 2016 08:15:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=yveHnIqclMH/c1kfpdLKB5D5AhSY8/nLtQ82hi1Um0E=; b=mePC/m9QQy9v5fvma8/rB8rn0es0/c6Gxlp7ODvNH72pH2shd/uztBGTB/t4gGzsyO kqP9N/jvK0C/KVoqaxkjdrwFuMIdH9wENfufxjOA+y/I/c94nbBfk31LWQRug0atmEf2 FDJNGXEbPEhgIkvzkYIVoEJK0rCZq5CbMai6xoa1nfzOT4TG6hYwY/OQ+NXvrblwPufQ p75dOys3WD0wU28ta+xVJ3t2daB6o1T2kYi7j9duKMspbh+K2fRrHEG8zt8ZzBvAzKVk AddNWWezXE2OL7tUP/+dEui1LvhmqhsS+oXW3VkgsibYGTmnzfDX/WlqxUuBYnRwH2Kw svgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=yveHnIqclMH/c1kfpdLKB5D5AhSY8/nLtQ82hi1Um0E=; b=jUvfst3/OkxrxZmgFWNzf493C49ZfthukTezFyOIDK3R3+8vAKXJLTu6dxsSfGu+/+ xGl2eJ0MoHmJT9N2b5moqhO5KlRTJ0fNpLet92v3MT0GH1MWam8UDIf2WczPW68V4Qyp ZrqVChqUAcmRrVBy6MV/BzlMMQxTSMrqPrYyW9IzAPf4AS49xoXuhMB2fU+1XAq8kiVM Q3yqfi5D5OZtr6bOh6r4qeX5cJJzrf9J8yt947ZEbHnYzq8AS/y8B5dU07m59opiSXE8 E0OyU4H9pnQ870GWtx07Bh3KrYlqg8If/or5VREJWMYtdSo0+EalMegLGpcLp07pFe5Q GXZQ== X-Gm-Message-State: AG10YOT5vV3oHkB5Sjga+xpU4UNewBInOrqdVtFipOmfhBy4y+8Ykaj5dLC8lQjzcXaRGpfx X-Received: by 10.60.54.170 with SMTP id k10mr13053349oep.63.1456330502495; Wed, 24 Feb 2016 08:15:02 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id wt9sm2303040obb.18.2016.02.24.08.15.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2016 08:15:01 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 50F2E220AC4; Wed, 24 Feb 2016 09:14:59 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Wed, 24 Feb 2016 09:14:42 -0700 Message-Id: <1456330497-15242-2-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1456330497-15242-1-git-send-email-sjg@chromium.org> References: <1456330497-15242-1-git-send-email-sjg@chromium.org> Cc: Joe Hershberger , Tom Rini Subject: [U-Boot] [PATCH v2 01/16] image: Correct the OS location code to work on sandbox 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" A recent change broke the 'bootm' command on sandbox. The root cause is using a pointer as an address. Conversion from pointer to address needs to use map_to_sysmem() so that sandbox can do the right thing. The problem was pre-existing but uncovered by a recent commit. Fix this. Also move fit_get_end() to the C file to avoid needing to include mapmem.h (and thus asm/io.h) everywhere. Fixes: 1fec3c5d (common/image.c: Make boot_get_ramdisk() perform a check for Android images) Signed-off-by: Simon Glass --- Changes in v2: None common/bootm.c | 2 +- common/image-fit.c | 5 +++++ include/image.h | 5 +---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index 99d574d..df27089 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -201,7 +201,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, images.ep += images.os.load; } - images.os.start = (ulong)os_hdr; + images.os.start = map_to_sysmem(os_hdr); return 0; } diff --git a/common/image-fit.c b/common/image-fit.c index c531ee7..d3fad30 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -851,6 +851,11 @@ static int fit_image_hash_get_ignore(const void *fit, int noffset, int *ignore) return 0; } +ulong fit_get_end(const void *fit) +{ + return map_to_sysmem((void *)(fit + fdt_totalsize(fit))); +} + /** * fit_set_timestamp - set node timestamp property * @fit: pointer to the FIT format image header diff --git a/include/image.h b/include/image.h index 299d6d2..518a4f5 100644 --- a/include/image.h +++ b/include/image.h @@ -818,10 +818,7 @@ static inline ulong fit_get_size(const void *fit) * returns: * end address of the FIT image (blob) in memory */ -static inline ulong fit_get_end(const void *fit) -{ - return (ulong)fit + fdt_totalsize(fit); -} +ulong fit_get_end(const void *fit); /** * fit_get_name - get FIT node name