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: 1182457 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="CiLzTeAv"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46z1T63PsLz9sPF for ; Thu, 24 Oct 2019 07:00:42 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2F633C21E7E; Wed, 23 Oct 2019 19:58:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7BB5CC21DA2; Wed, 23 Oct 2019 19:58:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7A901C21E2B; Wed, 23 Oct 2019 19:57:33 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id A76ACC21D74 for ; Wed, 23 Oct 2019 19:57:30 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id 205so13589015pfw.2 for ; Wed, 23 Oct 2019 12:57:30 -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=VsfIIdfrPOuIfu2ByeyyKjGNrbe7CIV+z6HiE57E+8745l99a0BMaKwm9BXxicRkZz J9UIA9Wp9oC9b0WNBQ9FlhArPo+r4lfa6XvPKBtRiIGfbdSn1BLV9qtuVH7k9Wb8Hu1+ UmkUYl8AvW3Apts8ZbWUapeJRjDTknwPcIUrfb+1xpqZF2JKHVTOfVzoFy94V4NprnHj 1zZgG4iHayopdh6zCsOzTw+aLupI6n62F0sFHa9qUq/QWBC9JpsEkpAULP9WaYcocr7T t5GoMgHEsbaeEXs/OePxEtPW8HZPrbt376Ox+gmUjIj6rh7Zga6ld+DgNszsxSgzW7pN QoFg== X-Gm-Message-State: APjAAAXAvZ9hgkw5N8eRoVxSqggtpIGpJxiQi18zD1RmW1LBiwu2qKpr BcDEOwZgQ+8WYHgozxAGomKhrQ== 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 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 Cc: u-boot@lists.denx.de, "Matwey V . Kornilov" , linux-amarula@amarulasolutions.com, linux-rockchip@lists.infradead.org Subject: [U-Boot] [PATCH v4 6/7] rockchip: Add Single boot image (with binman, pad_cat) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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) */