From patchwork Sat Jan 4 08:38:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11317583 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 83DC613A4 for ; Sat, 4 Jan 2020 08:38:44 +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 623DF222C4 for ; Sat, 4 Jan 2020 08:38:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tJzYhi8o"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="ANS5+bvk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 623DF222C4 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=asAusme2RUvxvJofw6+CiQUhZbri5hiFd3gVpGW7KrI=; b=tJzYhi8oJ+AH+S +7qPX10Hf/cGngwnoUoULoULmVFw8aWxySoq9aAO7QGDvkaRw8zkXR3BnxWQmTJRzklvMfpT7bngi 3L5RncfNTLpzM8rDRa6SM9CVv7oB40KP1fKlEs3bX8GY2j3BmBfoxiORB1zZfaUNS7oRwAAtVYHfU wiU4EVjXZn5cXT5FTFBODKKtag5cC1EqikvcQrdNlfOdD0feA1d0pzwlMHnEGEJSEyTWiyCiXRzVG VMJIS3MoYUesN/jOWp6s58dmA7A0sCEp7VT5UWZ+k12oKNMKsYVJwHQq1iLkFZRjOhMiePFE5KCHk sg4qbAMctBqimTz8feyQ==; 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 1inexG-0003Je-1v; Sat, 04 Jan 2020 08:38:42 +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 1inexD-0003Gl-7e for linux-rockchip@lists.infradead.org; Sat, 04 Jan 2020 08:38:40 +0000 Received: by mail-pg1-x542.google.com with SMTP id b9so24456107pgk.12 for ; Sat, 04 Jan 2020 00:38:38 -0800 (PST) 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=ehwuJZnRKKx5EZ4MhrVjA+CzbfF6qtPzoe+uGVxNIwE=; b=ANS5+bvk/K/TTlFzy4lYM3OpXfKAQPZwfqx2vlf4COOJUXdAGE/TYdvNlCqa38KGRJ dXqXRCAjFm+NcSrh1ThTG2/NrWxE+2YqyT94HYIbqJTplzRYc6n9ehBspcpPvlQowJSo 8vJgQTrHgz1DNV7vDpi68k3CpbQNBOSaAUAao= 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=ehwuJZnRKKx5EZ4MhrVjA+CzbfF6qtPzoe+uGVxNIwE=; b=BYtH1j7Y/ieNqvT3Qx6zbq9wEG+iKSxFE8iC4ZzfEOH51Huu8YdHVyzykoptjlKfVn zbt2tD2zOVGUsjQyOCnKH9fTvwgGME97pc8HHRfyrW4jKRj7b015fLth6packkHKrVNp csAu1URijFReFnUnHHGRcZoIyh0vx81dZb42mati7h0/BRU9SO4Nr8wPxS+KBaIjeJtm XsJ8sbw5WBywhC7p5GPEwAJlHnilW9Cim0pyu1sQJekIqlLPSq+urgfValYTl7Lq8hGe 4G5fRj9qgn2XaD+HARFtlUzF94zR7aHlPmNqDg7lQD7aUWMrdkBHT1CMq5396ziyQFKB 9a1Q== X-Gm-Message-State: APjAAAUpCsnbZMdpM3wpPwwzCSMPiVVzcKLbuRueoLLSRNSBuo4JCgge V1AddXfKq3CANDpsX2NGwqwm2anFgmI= X-Google-Smtp-Source: APXvYqwj+S4ETzhwogUdDVkSLbEcNa0HG6yhIJemSwhIEUCFULHXzXUwSY6XHRxH552MWrfblrruXg== X-Received: by 2002:a63:1a1c:: with SMTP id a28mr104679008pga.374.1578127118072; Sat, 04 Jan 2020 00:38:38 -0800 (PST) Received: from localhost.localdomain ([49.206.201.128]) by smtp.gmail.com with ESMTPSA id z4sm70201623pfn.42.2020.01.04.00.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2020 00:38:37 -0800 (PST) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Subject: [PATCH v6 5/6] rockchip: Add Single boot image (with binman, pad_cat) Date: Sat, 4 Jan 2020 14:08:05 +0530 Message-Id: <20200104083806.3930-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20200104083806.3930-1-jagan@amarulasolutions.com> References: <20200104083806.3930-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200104_003839_293754_BBC8F0DF X-CRM114-Status: GOOD ( 14.41 ) 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-rockchip@lists.infradead.org, u-boot@lists.denx.de, "Matwey V . Kornilov" , Jagan Teki , linux-amarula@amarulasolutions.com, Akash Gajjar 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 Reviewed-by: Simon Glass --- Makefile | 14 ++++++++++++-- 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 | 3 +++ 6 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi diff --git a/Makefile b/Makefile index d8a0f68883..cdd3eb4614 100644 --- a/Makefile +++ b/Makefile @@ -909,7 +909,7 @@ ALL-y += u-boot-with-dtb.bin endif ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) -ALL-y += idbloader.img +ALL-y += u-boot-rockchip.bin endif LDFLAGS_u-boot += $(LDFLAGS_FINAL) @@ -1395,7 +1395,17 @@ idbloader.img: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) endif -endif +ifeq ($(CONFIG_ARM64),) +u-boot-rockchip.bin: idbloader.img 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: idbloader.img 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 f9dab073ea..7bd99ba3bb 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1590,6 +1590,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..a2559e2db0 --- /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 = "idbloader.img"; + }; + + u-boot-img { + offset = ; + }; + }; +}; diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 68e1105a4b..b55e09a9ca 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -9,6 +9,9 @@ #define CONFIG_SYS_NS16550_MEM32 +/* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */ +#define CONFIG_SPL_PAD_TO 8355840 + #ifndef CONFIG_SPL_BUILD /* First try to boot from SD (index 0), then eMMC (index 1) */