From patchwork Fri Aug 31 18:03:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 181020 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 6E7F12C038B for ; Sat, 1 Sep 2012 04:09:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6C8BC280B7; Fri, 31 Aug 2012 20:07:49 +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 EA6WSbvdTm-s; Fri, 31 Aug 2012 20:07:49 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5CC5D280BE; Fri, 31 Aug 2012 20:05:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 75C77280D7 for ; Fri, 31 Aug 2012 20:04:43 +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 qleNtP9XRMlr for ; Fri, 31 Aug 2012 20:04:41 +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 mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 91E37280A8 for ; Fri, 31 Aug 2012 20:04:09 +0200 (CEST) Received: by mail-pb0-f44.google.com with SMTP id rr4so5184723pbb.3 for ; Fri, 31 Aug 2012 11:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=OmUnbQLJaajbhGzZi/iik76Tv69jPYkwlkS/4Gda6ZM=; b=WUUwqxrwbIPz22h+0rVZKgGNXRdEo+oxPMmU/LzT3LYuUILRRzpwsK4HbvMspR7fuE jWQMGsBohrvSQ5IVhin5YmCuBPLhbynfpTqSBY0GKZ7GUPKxhLH8Rpcoo6LhDGdNn5FU fcvBR9ORk74ii9L7MGORlXzQb+ZPuL+38fe3qFbl5eQHj333m4TG2279HAqn0ursx8Wp 17Qh2qZzjD+peaGsiqEpU8/LIQQB+2am+v2WCU4p9wkWKgDMZONFCEIUhnTjUG5mRREu bfV52N6ekJcnLq7gPxA9hSYe/HYGo6pRgtmHqsIzJjJ20JfJeRw/mjj8TKTGjQ3pj4ZY XQNQ== Received: by 10.66.78.195 with SMTP id d3mr16580967pax.17.1346436249475; Fri, 31 Aug 2012 11:04:09 -0700 (PDT) Received: from localhost.localdomain (ip68-230-54-74.ph.ph.cox.net. [68.230.54.74]) by mx.google.com with ESMTPS id sr4sm3887134pbc.24.2012.08.31.11.04.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 31 Aug 2012 11:04:08 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Fri, 31 Aug 2012 11:03:05 -0700 Message-Id: <1346436196-27742-19-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346436196-27742-1-git-send-email-trini@ti.com> References: <1346436196-27742-1-git-send-email-trini@ti.com> Cc: Sudhakar Rajashekhara , Stefan Roese , Christian Riesch Subject: [U-Boot] [PATCH v6 18/29] SPL: Use image_get_xxx() functions to access header values 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 From: Stefan Roese Signed-off-by: Stefan Roese Signed-off-by: Tom Rini --- Changes in v5: - Add Stefan's patch to use image_get_xxx() functions common/spl/spl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 70c374a..3b4fcba 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -75,13 +75,13 @@ void spl_parse_image_header(const struct image_header *header) { u32 header_size = sizeof(struct image_header); - if (__be32_to_cpu(header->ih_magic) == IH_MAGIC) { - spl_image.size = __be32_to_cpu(header->ih_size) + header_size; - spl_image.entry_point = __be32_to_cpu(header->ih_load); + if (image_get_magic(header) == IH_MAGIC) { + spl_image.size = image_get_data_size(header) + header_size; + spl_image.entry_point = image_get_load(header); /* Load including the header */ spl_image.load_addr = spl_image.entry_point - header_size; - spl_image.os = header->ih_os; - spl_image.name = (const char *)&header->ih_name; + spl_image.os = image_get_os(header); + spl_image.name = image_get_name(header); debug("spl: payload image: %s load addr: 0x%x size: %d\n", spl_image.name, spl_image.load_addr, spl_image.size); } else {