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: 1014 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 61EF03F08F for ; Sat, 4 Jan 2020 09:38:40 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id a4sf30731738pgq.23 for ; Sat, 04 Jan 2020 00:38:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1578127119; cv=pass; d=google.com; s=arc-20160816; b=xaPm8LUN0jFkWSuBWWNskRAFWaG6IHC3qNm7uFWAm9pbuetbc8YppE4kuLI4WNeb1M 6tZw1Dtg4yS+UE12+IogCp4wJEQvo4G0e0R9nx+sCOxF3zGdiXkbMFjverWN6QJMsvzZ mKJIFatPB7eukGy+GowAbse+ZDthTWRZjXWmyYva8lfZfSRKVwoWypSpnWZIeL3iE/+b syDrcHLSZ/1jvN0T1BuVCmk3Ib7mVzysf7djFMv0GqgkRkY5QeUY5oPtl0nP08JVvYGZ YdbFIU+qLJFi0QGmDeeZCPfVaQ17NJJR9LuSf/hKJVQjTaozpl8AOIVuvzzkRteXeOnO HjGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gNBK8/ZsXFBAvhfDvnnyhtI2rZf4e+m+eETv98xCp9Q=; b=yvSE+QQSVf2EMGfbWxw43KkeTfLSbaGC9YnW95sgwjlE3c0Ajf1pCH3LL3DfKPy7OJ OzmhJpJtABc/aTLthQEN6xywIgsGg9sYRehO8mmLuCLLLRqGkRcpqy/WL8eqoRWHVL60 dYpeyj8eQ4uVUJTK1sV9OTcy86IeWyb7cljKyT10I/LqA2lnfUZdBKyHNYuqKGKUAOto g4cqfJfNavDEGYMgrj5snpre4iHQlIbcS77qOI3BKETrYGW6pw8beWBd9E2T9Nu2bDJh FRuNbjIr5S2kILYupkBN8BzscAXQkHymlqK5AY36SL73+TN99ks5JvRds1d1RfJpbEBL +GRw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ANS5+bvk; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=gNBK8/ZsXFBAvhfDvnnyhtI2rZf4e+m+eETv98xCp9Q=; b=hbPrIVko3eb13NrTLq+LWsrH3C3j39DA+oA/1kJKwvWDnIAuNatNGLjv3deiUYJRQc IuH34zB0P5LsKGMS/dwjWNySrb9B8rxe16MC3k6ZSnNMjvHv/ZKQABL59Gg7REdzwv+3 0dhJIZbK17erhUBPq1mnKcgVJ1bo1siKf10bw= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=gNBK8/ZsXFBAvhfDvnnyhtI2rZf4e+m+eETv98xCp9Q=; b=FwVkgujvdE5rEBb06EWeRhnbZM+YeYtV5tRAdQBj7xRqR7oLjgOs+ju0cSQeAAjSay INlNme1DRKhpKi4/FTZdGi1Cf2ZaN4zBhPIQA3BImi+BcoQD0AA0Qus/xZfTFCbvwjko BF68fLm9FJD2+huYfF7uwd3QBpqFkmsCu5JQzBTj4mTyC67j5g7gK9ZkIPGkBXXe6FxS lEKTKi3WhmmN4/eJN1ZxyrShD/V6t1WKmeeCOk+O/ADGfUOwR3R2Wjx/Vm5u8OmHM/FF Ph3UQqPf4YeOwPHFGDvlGohMT94rj2SY8nKuFerFFCBE1Qeirqfwv3OfL6POx3RvEUxV YkDA== X-Gm-Message-State: APjAAAUqMulaXU8ykiQoLUj9M2xwyoEfq745Qfft8Xr8mXyqlJ2FbGaW YJANvas3V+n8gbL/sOVuQwTVwS3R X-Google-Smtp-Source: APXvYqyxla7Q2q1qH4ddWQKjvojZZ1OA61dQuyp8pd4agNaHnOBfbESk0s3UCHo7wXHPcard5fMx5A== X-Received: by 2002:a17:902:b40a:: with SMTP id x10mr77989129plr.64.1578127119068; Sat, 04 Jan 2020 00:38:39 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:cf4a:: with SMTP id b10ls13545171pgj.0.gmail; Sat, 04 Jan 2020 00:38:38 -0800 (PST) X-Received: by 2002:a65:6898:: with SMTP id e24mr104242353pgt.59.1578127118478; Sat, 04 Jan 2020 00:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578127118; cv=none; d=google.com; s=arc-20160816; b=H0wMj/o98zAd9p/oDqsaLMhqe1+akt/JDgk1hcZyN+57PJ3JuBm8hYAnzFEorKJTGU 2tnEqkgRY1li+H+91mTaNygC28kDHwDu0tpJZpyt6GldsbqLD1WJbhJ4XymIZKcuZQVb BCMNV7r9EHZPRF06r1rJV3sNRihiJE1PoJoYqk0FmQ9K1buVW4Am6acZ/8TjfJHuWoLt 0I/hfrvqpc396R2oAcIdSLo72j3zE3sRb7Y0x5cueYCFL5NsER3yZCsNXLvABbK/4vEy h40uynK3BTuWriPUZQPT3bx3JMdSeiBXHlaOCAQC8XHOVLAzsz7Y4zo8sYWXYwinGh6x KZ9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ehwuJZnRKKx5EZ4MhrVjA+CzbfF6qtPzoe+uGVxNIwE=; b=ZhbEyr5FGH53kNWyIzLc4dF48fGjvylTpgMYDZc6gexV+dQxtp1a62bMu945VRze3/ BL7y7NeupVZWvOOZezf/U/Z8zl+qkAyZ0AXeW56O1kkosGAzKWd3rFJNrngiryDCieRn xViB1yHFbLy1cKRnczvHHGUN/idw6/dYa2d9pnsInAo9/niH6XDw8AKCWcI03EDYy2la rqPv6LSNfkShBFYg3EQqwKEHJcZOa58S/uwyg4jibqucJnV6P8KiHajBdI5TXthbtKQm K1Ej0NLDl/QJVZ5JDhEFSuXylIWClZ1PDSte/2n3LcJf9q1cTDg6ievAJWkCi7K8P9Si 05qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ANS5+bvk; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h62sor62695584pge.19.2020.01.04.00.38.38 for (Google Transport Security); Sat, 04 Jan 2020 00:38:38 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; 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 Cc: Akash Gajjar , u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , "Matwey V . Kornilov" 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 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ANS5+bvk; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 | 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) */