From patchwork Mon May 26 18:52:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Rae X-Patchwork-Id: 30934 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 45DA320A25 for ; Mon, 26 May 2014 18:52:54 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id f51sf20257793qge.0 for ; Mon, 26 May 2014 11:52:54 -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:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=piZ/KwuQGBhas98TFEeXltY13IFvaNp7UBg4T3k8z84=; b=enRaH+Ik/Dwo7ouyemp+OJYaSbvme7KMKTQxmeEHQodTngS9hLISTGPSESAfYkQo5V eG0smUhMNdvUUTKFNChkSohqBhtatXolgjfBiOEKii5ioYtHnlImm4vA+Y2V7IChzWaU EqpF1uQHHM+BTmY7RP1iZamhOdKpdqLb9ie4ddBzTwZRSSTBPh7i6cZB5A52XBVnWYnj 6BXMujNlbllxTWyzE0qYSzVM7ks6+UINz6ayY2l16hTkpv7NxQL2AmdSl52lM7Ir55ss rTDhVcDOQVTtqN/o7FDj19fW/rXiLPM1DOgcPy91iXHX2QgWE7rC9EgGOWEGxjmoZ8Wq FqqQ== X-Gm-Message-State: ALoCoQneRWtkvR9ejt0xn2Wsnzb8wkYSwYnZcXOlKWAGqeC0vuRggo5z6urlmPy3blE6ckvCbGen X-Received: by 10.236.39.175 with SMTP id d35mr9449066yhb.12.1401130374086; Mon, 26 May 2014 11:52:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.145 with SMTP id 17ls2837268qgn.21.gmail; Mon, 26 May 2014 11:52:53 -0700 (PDT) X-Received: by 10.58.247.66 with SMTP id yc2mr23305783vec.13.1401130373919; Mon, 26 May 2014 11:52:53 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id qg3si6735210veb.84.2014.05.26.11.52.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 May 2014 11:52:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id oz11so9669744veb.30 for ; Mon, 26 May 2014 11:52:53 -0700 (PDT) X-Received: by 10.58.135.136 with SMTP id ps8mr22468832veb.18.1401130373842; Mon, 26 May 2014 11:52:53 -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 ib8csp63555vcb; Mon, 26 May 2014 11:52:53 -0700 (PDT) X-Received: by 10.180.89.241 with SMTP id br17mr30878128wib.0.1401130371841; Mon, 26 May 2014 11:52:51 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id yq5si6718147wjc.37.2014.05.26.11.52.51 for ; Mon, 26 May 2014 11:52:51 -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 BE25D4B632; Mon, 26 May 2014 20:52:47 +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 aJunWLZVKokz; Mon, 26 May 2014 20:52:47 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 409524B62E; Mon, 26 May 2014 20:52:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E09574B653 for ; Mon, 26 May 2014 20:52:37 +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 IovqQu0vPEv0 for ; Mon, 26 May 2014 20:52:34 +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-gw1-out.broadcom.com (mail-gw1-out.broadcom.com [216.31.210.62]) by theia.denx.de (Postfix) with ESMTP id 1E6C04B625 for ; Mon, 26 May 2014 20:52:31 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.98,914,1392192000"; d="scan'208";a="31630881" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw1-out.broadcom.com with ESMTP; 26 May 2014 11:57:49 -0700 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 26 May 2014 11:52:29 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.174.1; Mon, 26 May 2014 11:52:30 -0700 Received: from mail.broadcom.com (lbrmn-vmlnx03.ric.broadcom.com [10.136.4.105]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 7598A9F9F7; Mon, 26 May 2014 11:52:29 -0700 (PDT) From: Steve Rae To: Date: Mon, 26 May 2014 11:52:22 -0700 Message-ID: <1401130344-15450-2-git-send-email-srae@broadcom.com> X-Mailer: git-send-email 1.8.5 In-Reply-To: <1401130344-15450-1-git-send-email-srae@broadcom.com> References: <1401130344-15450-1-git-send-email-srae@broadcom.com> MIME-Version: 1.0 Cc: Tom Rini , Steve Rae , Przemyslaw Marczak , Rob Herring Subject: [U-Boot] [PATCH 1/3] disk: part_efi: resolve endianness issues 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: , 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: srae@broadcom.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) 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 Tested on little endian ARMv7 and ARMv8 configurations Signed-off-by: Steve Rae --- disk/part_efi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/disk/part_efi.c b/disk/part_efi.c index c74b7b9..8c89740 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -279,7 +279,7 @@ int write_gpt_table(block_dev_desc_t *dev_desc, gpt_h->header_crc32 = cpu_to_le32(calc_crc32); if (dev_desc->block_write(dev_desc->dev, - le32_to_cpu(gpt_h->last_usable_lba + 1), + le32_to_cpu(gpt_h->last_usable_lba) + 1, pte_blk_cnt, gpt_e) != pte_blk_cnt) goto err; @@ -300,6 +300,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e, { u32 offset = (u32)le32_to_cpu(gpt_h->first_usable_lba); ulong start; + u32 last_usable_lba = (u32)le32_to_cpu(gpt_h->last_usable_lba); int i, k; size_t efiname_len, dosname_len; #ifdef CONFIG_PARTITION_UUIDS @@ -321,7 +322,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e, gpt_e[i].starting_lba = cpu_to_le64(offset); offset += partitions[i].size; } - if (offset >= gpt_h->last_usable_lba) { + if (offset >= last_usable_lba) { printf("Partitions layout exceds disk size\n"); return -1; }