From patchwork Sun Aug 30 17:31:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sjoerd Simons X-Patchwork-Id: 52872 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id E50DF2127E for ; Sun, 30 Aug 2015 17:32:06 +0000 (UTC) Received: by labip2 with SMTP id ip2sf33200146lab.1 for ; Sun, 30 Aug 2015 10:32:05 -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:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=zoCuSfuXljELhBHbMIVn8ve3UNPGFrjhtwE5VKTsNlI=; b=a3byVr/N/WWuyjXWcDLCEa/OW5hvB+qAywvrsf3F/b2dWxn3JIvSrOkspW9KAnhk7y ya2EtV1CHSHA1cXKzz5SojDnpmSZlaAgTja/7/MjP1bR59PFFgrUruY2YghAuBWPannk BO6knWuhImrYtrQ3Ef8CPLCVB8k0CQl2kcyYux+B8PmHN8vvmzjuSAE5ZY2XAkGaNsaO BpNinRQZO7/NlqoRjOfOT3Vm3rGSK1yZ/xypvu7DuBWBpDb2sIGpKTXWWb0tgBngdTBC sPu2TlJQscBK6qd3g79h3pEb6AotvkL8ldXpCerNr+Qyx4ag7j4bIwDt5IoNVd4E7e9y o2og== X-Gm-Message-State: ALoCoQldR58pwK24Z212mZg8jYffHJbYLNVegEQO40MSsNEBMINUfp+G58HccDhfb8K5z1fxNjwJ X-Received: by 10.112.99.37 with SMTP id en5mr5264223lbb.7.1440955925942; Sun, 30 Aug 2015 10:32:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.136 with SMTP id w8ls374003lal.16.gmail; Sun, 30 Aug 2015 10:32:05 -0700 (PDT) X-Received: by 10.152.5.135 with SMTP id s7mr8463069las.75.1440955925806; Sun, 30 Aug 2015 10:32:05 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id i4si11281310laf.44.2015.08.30.10.32.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 10:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbbsx3 with SMTP id sx3so49995519lbb.0 for ; Sun, 30 Aug 2015 10:32:05 -0700 (PDT) X-Received: by 10.152.22.133 with SMTP id d5mr8553542laf.112.1440955925672; Sun, 30 Aug 2015 10:32:05 -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.112.151.194 with SMTP id us2csp1167837lbb; Sun, 30 Aug 2015 10:32:05 -0700 (PDT) X-Received: by 10.194.248.234 with SMTP id yp10mr24605625wjc.24.1440955924982; Sun, 30 Aug 2015 10:32:04 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id w2si16882183wiz.83.2015.08.30.10.32.04; Sun, 30 Aug 2015 10:32:04 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46F104B705; Sun, 30 Aug 2015 19:31:58 +0200 (CEST) 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 3oZ1-888koKr; Sun, 30 Aug 2015 19:31:58 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F3194B6D5; Sun, 30 Aug 2015 19:31:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC32C4B67F for ; Sun, 30 Aug 2015 19:31:21 +0200 (CEST) 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 Kh77RM5qLIbH for ; Sun, 30 Aug 2015 19:31:21 +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 bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by theia.denx.de (Postfix) with ESMTPS id 9B0794B68A for ; Sun, 30 Aug 2015 19:31:21 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sjoerd) with ESMTPSA id 22DD95188058 Received: by dusk.luon.net (Postfix, from userid 1000) id EA233281B4; Sun, 30 Aug 2015 19:31:14 +0200 (CEST) From: Sjoerd Simons To: u-boot@lists.denx.de, Simon Glass Date: Sun, 30 Aug 2015 19:31:13 +0200 Message-Id: <1440955874-25809-8-git-send-email-sjoerd.simons@collabora.co.uk> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1440955874-25809-1-git-send-email-sjoerd.simons@collabora.co.uk> References: <1440955874-25809-1-git-send-email-sjoerd.simons@collabora.co.uk> Cc: Tom Rini Subject: [U-Boot] [PATCH v2 7/8] rockchip: Drop first 32kb of zeros from the rkSD image type X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sjoerd.simons@collabora.co.uk X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mailfrom=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 Instead of creating a rockchip SPL SD card image with 32KB of zeros which can be written to the start of an SD card, create the images with only the useful data that should be written to an offset of 32KB on the SD card. The first 32 kilobytes aren't needed for bootup and only serve as convenient way of accidentally obliterating your partition table. Signed-off-by: Sjoerd Simons Acked-by: Simon Glass --- Changes in v2: None doc/README.rockchip | 2 +- tools/rksd.c | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/doc/README.rockchip b/doc/README.rockchip index ce8ce77..347fc05 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -90,7 +90,7 @@ Booting from an SD card To write an image that boots from an SD card (assumed to be /dev/sdc): ./firefly-rk3288/tools/mkimage -T rksd -d firefly-rk3288/spl/u-boot-spl-dtb.bin out - sudo dd if=out of=/dev/sdc + sudo dd if=out of=/dev/sdc seek=64 sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=256 This puts the Rockchip header and SPL image first and then places the U-Boot diff --git a/tools/rksd.c b/tools/rksd.c index 2efcd68..a8dbe98 100644 --- a/tools/rksd.c +++ b/tools/rksd.c @@ -14,9 +14,7 @@ #include "rkcommon.h" enum { - RKSD_HEADER0_START = 64 * RK_BLK_SIZE, - RKSD_SPL_HDR_START = RKSD_HEADER0_START + - RK_CODE1_OFFSET * RK_BLK_SIZE, + RKSD_SPL_HDR_START = RK_CODE1_OFFSET * RK_BLK_SIZE, RKSD_SPL_START = RKSD_SPL_HDR_START + 4, RKSD_HEADER_LEN = RKSD_SPL_START, }; @@ -44,11 +42,8 @@ static void rksd_set_header(void *buf, struct stat *sbuf, int ifd, unsigned int size; int ret; - /* Zero the whole header. The first 32KB is empty */ - memset(buf, '\0', RKSD_HEADER0_START); - size = params->file_size - RKSD_SPL_HDR_START; - ret = rkcommon_set_header(buf + RKSD_HEADER0_START, size); + ret = rkcommon_set_header(buf, size); if (ret) { /* TODO(sjg@chromium.org): This method should return an error */ printf("Warning: SPL image is too large (size %#x) and will not boot\n",