From patchwork Fri Apr 26 13:34:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10919213 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C23621398 for ; Fri, 26 Apr 2019 13:35:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFCFD28BAD for ; Fri, 26 Apr 2019 13:35:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3DE928C61; Fri, 26 Apr 2019 13:35:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3494F28BAD for ; Fri, 26 Apr 2019 13:35:10 +0000 (UTC) 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=6noIrBLYCy6qPbCXqpdsgrP1TpFoMkRQpj9QCcf9sQs=; b=HaZGD257Ov2Idr yGip2OrlS8+8gxivY4vf+tho7L+iNe5bKkpfcbS+HsvHYcT9GqqQRFijPKbb9eFus8n7Q9vJFv87b aescI+heqELSwFfYLOea0fmI6tJHenHOcqO0nndLOJ9jntI+UtzyWou81PqqCmsDlYMbCCCInR14Z TLL1p+lW1NY7y1QfnujRwqCymXY/QgUi3Iu83/T5vuNZLMpGTZrUKQs7X9gUXS4L1R3CgYNBtLTUD HH0EJDoXaAvI90QvmbYOfxRm9DMTjgjSTL6O81iNcT37OxV2OSMxu194QsirXch0DDn32lt0XFg6r 4TtK6Zl7jjFGVKaKL8Aw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hK10O-0006P1-8z; Fri, 26 Apr 2019 13:35:08 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hK10L-0005ow-BR for linux-rockchip@lists.infradead.org; Fri, 26 Apr 2019 13:35:06 +0000 Received: by mail-pl1-x643.google.com with SMTP id o5so1582791pls.12 for ; Fri, 26 Apr 2019 06:35:04 -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=/qOgLyzHZqhoMQdBz3HHUNbRncBtz7SI2uhERnn/Y2c=; b=AD4PoTO58PnLaBfuCPEn6gezj+Ie+6Zhs3AEUiJ91dc9JYX4xOfTFNuAb40d4Y3uNQ Vhc9m4HvqC4RSFJgUf1Ga64/1+FkO6zXtGLmUuIuxtNSzJWRxGx5r6sMUiNCtSD6m1vS CJHX6Qr2d78YbsZrPQirgy+rOMVSVcXLpRAvw= 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=/qOgLyzHZqhoMQdBz3HHUNbRncBtz7SI2uhERnn/Y2c=; b=k7x4BQGHm86wPdVWuTIX1gc/mi4VDNSDsLLwbATtBQOdF4pdH3In9eGT2MxSYJqDXv WYLKO2S8ZmAP6Tb1eSf1z4arEx4t/XQ103FeCeVbP8mNjpGQBlkK7BUGkBSh5KPk2jab 2Psu9jD6R4BQB/GQ4ZjbtZb2yjavDB1PkDCdoHah4F5VFf1xZT4GZFt0dAKCXJqFIQmA GT0Dfu88aR193snORBFfVycQKg4TSlwVMpzSOwv1DUI8LRsoV1Jxz+RkcZ/CtMC4njFj z4Sdd9WRNu/2kr9JPGqLNF6tqU3WqtmA12niVZXy/7Rb9DhCa9WzpXrhdrfQEtJI7TWf 8Llw== X-Gm-Message-State: APjAAAUHXR/aRk3LmHw1zP0hbKgEDmdLMCj/h0+FfJMaPJYboQQSjiyR wagrGTSstXfFrgjC+7dA+8rlLg== X-Google-Smtp-Source: APXvYqw297o/4HUNOACU1stM5yGaij559lQ/r8qoKkQdnFsh+oXrt7sIw/VLK+gQ0HIIGYZr3CYH1Q== X-Received: by 2002:a17:902:26b:: with SMTP id 98mr15887146plc.30.1556285704463; Fri, 26 Apr 2019 06:35:04 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id y19sm36946770pfn.164.2019.04.26.06.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 06:35:03 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar , Tom Rini , Manivannan Sadhasivam Subject: [PATCH 5/5] rockchip: rk3399: Create single image using BINMAN Date: Fri, 26 Apr 2019 19:04:30 +0530 Message-Id: <20190426133430.17802-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190426133430.17802-1-jagan@amarulasolutions.com> References: <20190426133430.17802-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190426_063505_458409_4997DA3D X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Kocialkowski , linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , u-boot@lists.denx.de Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP RK3399 platform has two stage boot loaders like SPL and U-Boot proper. For each stage we need to burn the image on to flash with respective offsets. This patch create a single image using binman, so that user can get rid of burning different stage boot images. without this patch: ------------------ ₹ sudo dd if=spl/u-boot-spl-rockchip.bin of=/dev/sdc seek=64 ₹ sudo dd if=u-boot.itb of=/dev/sdc seek=16384 with this patch: --------------- ₹ sudo dd if=u-boot-rockchip-with-spl.bin of=/dev/sdc seek=64 This would easily extend if other rockchip family SoC's would make use of single image creation. Signed-off-by: Jagan Teki --- Makefile | 13 +++++++++++++ arch/arm/dts/rk3399-u-boot.dtsi | 17 +++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 1 + doc/README.rockchip | 8 ++------ include/configs/rk3399_common.h | 2 ++ 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 92e04dd689..e7f68d63c7 100644 --- a/Makefile +++ b/Makefile @@ -851,6 +851,11 @@ ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) ALL-y += u-boot-sunxi-with-spl.bin endif +# Build a combined spl + u-boot image for rockchip +ifdef CONFIG_ROCKCHIP_RK3399 +ALL-$(CONFIG_ARCH_ROCKCHIP) += u-boot-rockchip-with-spl.bin +endif + # enable combined SPL/u-boot/dtb rules for tegra ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy) ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin @@ -1366,6 +1371,11 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE endif endif +ifeq ($(CONFIG_ROCKCHIP_RK3399),y) +u-boot-rockchip-with-spl.bin: spl/u-boot-spl-rockchip.bin u-boot.itb FORCE + @$(call if_changed,binman) +endif # CONFIG_ROCKCHIP_RK3399 + ifneq ($(CONFIG_TEGRA),) ifneq ($(CONFIG_BINMAN),) # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin @@ -1664,6 +1674,9 @@ spl/u-boot-spl: tools prepare \ spl/sunxi-spl.bin: spl/u-boot-spl @: +spl/u-boot-spl-rockchip.bin: spl/u-boot-spl + @: + spl/sunxi-spl-with-ecc.bin: spl/sunxi-spl.bin @: diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi index 0786c1193a..abd0b091ab 100644 --- a/arch/arm/dts/rk3399-u-boot.dtsi +++ b/arch/arm/dts/rk3399-u-boot.dtsi @@ -3,6 +3,23 @@ * Copyright (C) 2019 Jagan Teki */ +#include + +/ { + binman { + filename = "u-boot-rockchip-with-spl.bin"; + pad-byte = <0xff>; + + blob { + filename = "spl/u-boot-spl-rockchip.bin"; + }; + + u-boot-img { + offset = ; + }; + }; +}; + &sdmmc { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 286c870135..7ac0ee3c2d 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -130,6 +130,7 @@ endif config ROCKCHIP_RK3399 bool "Support Rockchip RK3399" select ARM64 + select BINMAN select SUPPORT_SPL select SPL select SPL_ATF diff --git a/doc/README.rockchip b/doc/README.rockchip index 73594dc61d..791e528262 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -398,13 +398,9 @@ Option 2: Package the image with SPL: => cd /path/to/u-boot - - Write prefixed SPL at 64th sector + - Write single spl + u-boot at 64th sector - => sudo dd if=spl/u-boot-spl-rockchip.bin of=/dev/sdc seek=64 - - - Write U-Boot proper at 16384 sector - - => sudo dd if=u-boot.itb of=/dev/sdc seek=16384 + => sudo dd if=u-boot-rockchip-with-spl.bin of=/dev/sdc seek=64 => sync Put this SD (or micro-SD) card into your board and reset it. You should see diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index b412012582..a658f03ade 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -38,6 +38,8 @@ #define CONFIG_SYS_SDRAM_BASE 0 #define SDRAM_MAX_SIZE 0xf8000000 +#define CONFIG_SPL_PAD_TO 8355840 + #ifndef CONFIG_SPL_BUILD #define ENV_MEM_LAYOUT_SETTINGS \