From patchwork Wed Oct 23 19:56:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11207429 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A267139A for ; Wed, 23 Oct 2019 19:57:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBF752086D for ; Wed, 23 Oct 2019 19:57:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TXj6sFEZ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="CiLzTeAv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBF752086D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9dUI0JHtRox/zm5hjqJQvDjKrFRbi3v3LBOn9f14QFc=; b=TXj6sFEZVbpA2i eQqt9kmlhaI9hcMC+PTK+67i8RsmgBxGv9pZdzvNnn4UfUhNrzyrEEF7IVgKvCvhDNpV6JNtlNjA0 8qcXMXkuqxMSB1Bp+fsFEFn4lV9rsoGFhuJV3fof3crNGYFn1XJAib2216BGiFDDYGLLBS8QGqI09 uSXl0O6tsWSkMDjtGqJL1RidmOS0MCSsKO2aKAG7yrAC8Pw8unTrK4Wi5Yz+8jzoopaAVZvZOthU4 Iek20ZXdNTuZm6q1CLV0QgVN3vIYgDNis8k83y81j0FspjL/Y67ugxMHUN4Fczd0Viu5U+iMMkT8A qAd7DIMJEDCjPOT7uqoA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNMlA-0005GI-IC; Wed, 23 Oct 2019 19:57:32 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNMl7-0005EY-UO for linux-rockchip@lists.infradead.org; Wed, 23 Oct 2019 19:57:31 +0000 Received: by mail-pg1-x542.google.com with SMTP id t3so12744994pga.8 for ; Wed, 23 Oct 2019 12:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xYatTQidUvcBY8oQodNSYrAF9VaBOnitFhHzBSyX2+E=; b=CiLzTeAvuCtN4rraHHAB7tkS6+AiRnCc1XWIPhkSON2OC2XnrqIie56fqr/cUyMn6l aYlBBvwUO+Ijh+kXyD4udZvV1na9pBGwicKp+UApDrHzwcEDduyhWCUg23PO0ySDIonl J9ao56etReO7afDLH55vCoP/gci4z1SV2siyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xYatTQidUvcBY8oQodNSYrAF9VaBOnitFhHzBSyX2+E=; b=tcDTFWTgYSJmLRARKgSBNT0k58ST0s0ZXykdKR53L6EuJZLAVya6bGfkHU5bcFztqJ SlMUV7MyFIplXnuarkzMMSbigSyKSrFrWlFzNTlAvZgJOaRWIaqSXJZLCQJNsnLgz2Gr zP+1x4E1/CMlcM92UM6N/4cWbAPynFtDTn4aREDai7ghyhBhmYF/wRA6+LeL+WzO6NV8 b93FSYM/mm5EIo33nlQCIve/os5vBh0h1GmJINpgNmrcg93lRYPw7xcqbAR0P6eEyvze DtqpxgF+HwW11VLTyWGKSjz7EdZnQFTxV+OABG7/SxwjGW1jo2nO4v2LXS+IZv2dMa0C WwKA== X-Gm-Message-State: APjAAAWiTO++A7q2ft0Orb3Mh+vifrKRfSgSdxjwm3Eru/x0+ubZGT6s U06Muo5jL6ZCa0FnAMRbMWgq4A== X-Google-Smtp-Source: APXvYqxzWXSNOjTHIDkWfeIqPzQft3ota+0ByA0PhARgHlkAdD8AYx950MdxUjjC4+Qh+oWQryTNZg== X-Received: by 2002:a63:540c:: with SMTP id i12mr9273758pgb.322.1571860648304; Wed, 23 Oct 2019 12:57:28 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.31]) by smtp.gmail.com with ESMTPSA id o185sm31499280pfg.136.2019.10.23.12.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 12:57:27 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Subject: [PATCH v4 6/7] rockchip: Add Single boot image (with binman, pad_cat) Date: Thu, 24 Oct 2019 01:26:51 +0530 Message-Id: <20191023195652.7158-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20191023195652.7158-1-jagan@amarulasolutions.com> References: <20191023195652.7158-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191023_125730_011973_908A63A8 X-CRM114-Status: GOOD ( 14.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, "Matwey V . Kornilov" , linux-amarula@amarulasolutions.com, Jagan Teki , linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org All rockchip platforms support TPL or SPL-based bootloader in mainline with U-Boot proper as final stage. For each stage we need to burn the image on to flash with respective offsets. This patch creates a single boot image component using - binman, for arm32 rockchip platforms - pad_cat, for arm64 rockchip platforms. This would help users to get rid of burning different boot stage images. The new image called 'u-boot-rockchip.bin' which can burn into flash like: ₹ sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64 This would support all rockchip platforms, except rk3128 since it doesn't support for SPL yet. Cc: Kever Yang Cc: Matwey V. Kornilov Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Makefile | 18 ++++++++++++++---- arch/arm/Kconfig | 1 + arch/arm/dts/rk3036-u-boot.dtsi | 2 ++ arch/arm/dts/rk3288-u-boot.dtsi | 2 ++ arch/arm/dts/rockchip-u-boot.dtsi | 21 +++++++++++++++++++++ include/configs/rockchip-common.h | 2 ++ 6 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi diff --git a/Makefile b/Makefile index a4278170d4..6c70106c6e 100644 --- a/Makefile +++ b/Makefile @@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin endif ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) -ALL-y += u-boot-spl-rockchip.bin +ALL-y += u-boot-rockchip.bin endif LDFLAGS_u-boot += $(LDFLAGS_FINAL) @@ -1347,15 +1347,25 @@ ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy) MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE) tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE $(call if_changed,mkimage) -u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE +spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE $(call if_changed,cat) else MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE) -u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE +spl/u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) endif -endif +ifeq ($(CONFIG_ARM64),) +u-boot-rockchip.bin: spl/u-boot-spl-rockchip.bin u-boot.img FORCE + $(call if_changed,binman) +else +OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \ + --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff +u-boot-rockchip.bin: spl/u-boot-spl-rockchip.bin u-boot.itb FORCE + $(call if_changed,pad_cat) +endif # CONFIG_ARM64 + +endif # CONFIG_ARCH_ROCKCHIP ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy) MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1df2aba3c2..8107414626 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1594,6 +1594,7 @@ config ARCH_STM32MP config ARCH_ROCKCHIP bool "Support Rockchip SoCs" select BLK + select BINMAN if !ARM64 select DM select DM_GPIO select DM_I2C diff --git a/arch/arm/dts/rk3036-u-boot.dtsi b/arch/arm/dts/rk3036-u-boot.dtsi index 1e7d079315..41ac054b81 100644 --- a/arch/arm/dts/rk3036-u-boot.dtsi +++ b/arch/arm/dts/rk3036-u-boot.dtsi @@ -2,3 +2,5 @@ /* * Copyright (C) 2019 Jagan Teki */ + +#include "rockchip-u-boot.dtsi" diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi index 3f00a3b6d3..6d31735362 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -3,6 +3,8 @@ * Copyright (C) 2019 Rockchip Electronics Co., Ltd */ +#include "rockchip-u-boot.dtsi" + / { chosen { u-boot,spl-boot-order = \ diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi new file mode 100644 index 0000000000..bc0b1412a2 --- /dev/null +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Jagan Teki + */ + +#include + +/ { + binman { + filename = "u-boot-rockchip.bin"; + pad-byte = <0xff>; + + blob { + filename = "spl/u-boot-spl-rockchip.bin"; + }; + + u-boot-img { + offset = ; + }; + }; +}; diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 68e1105a4b..d7f5ca9fa4 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -9,6 +9,8 @@ #define CONFIG_SYS_NS16550_MEM32 +#define CONFIG_SPL_PAD_TO 8355840 + #ifndef CONFIG_SPL_BUILD /* First try to boot from SD (index 0), then eMMC (index 1) */