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: 267 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4E9583F033 for ; Fri, 26 Apr 2019 15:35:06 +0200 (CEST) Received: by mail-pl1-f197.google.com with SMTP id b7sf2009142plb.17 for ; Fri, 26 Apr 2019 06:35:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556285705; cv=pass; d=google.com; s=arc-20160816; b=POx+eem3anOuWudfXZy2QQnJukXRTJBejDK6akZndmRYnBOtSO0Mlwe/Ws1p8bJiIc pEYiFwk+25sMUKY3Vhz4zVQTL5vRPSjuNRHOYJh68YODuQe5H6BRvpsmEla6639b2d3/ NjPHripLvhfJb5l5R9CQCl4pwIe6FLKd3bwwB7xzYCk3BkrmUJpBj1JQdcfGrs5gbGYp 01WSxjOFEj3AH6/3pTYWHICOAxlYR3aUAzDR400hdID1c6Ivz5FU0/aUgHe7qK5vEhQA VcD7t0ICY8C9OfszhgekYXZ0nV5jHgc3GJxP9ngyYJB3KemWX9WMtFPh7LyroJnI3wOo Q8FA== 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=7FOWY0yAYrEAbqOlRkS4jJ2qXtwtiOJ+/xNjplx8/oQ=; b=0xat18Y8bapuTP0YvmwIxlTLQUx8SrgZ6KH1vu0x3oLnauCXgU/4ucdDdJWhZ+uBlf hTFKR3PNDiE+I1XkE0QrNJmzL2B0h0P6xwz7Y3OD6qGvIzdwqlSmTqhLvb/W/2uDaMSE cMB7H9MI7q4zdYpyNJGLuuYHHYm0fo8nkSRpBwljS3OhT5EGxp2lMzqu37DH1oUf7PQM z2R/oo10ScLwiU2+BJRQbhd6a9VgbMNKo9yWM9a2uryXnOdeDanp0dx8f6ss5Hm++yXJ i9O7VsAC8Gb9mukH3x70zUJqkhfQbrv9sxLsQogTdBxDiWmpxYkyuBao/9oic4lfHFIz 4uyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AD4PoTO5; 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=7FOWY0yAYrEAbqOlRkS4jJ2qXtwtiOJ+/xNjplx8/oQ=; b=JCuTclZD0wadNqT5/sOp8bLyBXbQvbrpKh0R3kfDgT6354oSE3vWOC9WPGY2amKMFF +/Zs67RKXbdqVKCz2VR9YPfb5muecgrINJtRvIw7C24DlcEo0QGCB0Vp3sHengn7Dut9 8eEKMHBVptgDvWa3ImXq9eb0qd6YluvR5c8yQ= 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=7FOWY0yAYrEAbqOlRkS4jJ2qXtwtiOJ+/xNjplx8/oQ=; b=V7kTUWqQv3k+5jd/+vuGxtGa0XpXw65VNd1w3TAxisJIRgayQA/UV9X3n0CCGOLjnd 8qb0KRutluzqss2gkXq7BLXa0KB5tW35Zk0qlJN9MIrfIl8CVuwmeGM7cqlGE5XURtCx NUvCSagyhTg2Jrt7SVr8r+qKkVZimZ8Q83Y18AfwBxnNdNrKw6oa5yRhmZmV2YKGzZp1 n6qsYhnoPbTQb0QzPeCRKYkcOfqNIU88Kw4839IobSF4VLYATKL/JVPslHYgH4d6eiBm CR4T+fWuq+nn4s83uI/rUhHa9zEMPe969ddETMdkochUZu5+FPM9+eDBT6pR/pfXkJXF 6emQ== X-Gm-Message-State: APjAAAW2W2bayTdhPpbxSvaXMZSJE3iF/slS0rDSdTS1ClkaXcr99a7U zjBsGO5hHHnODBjMurssQCxyN466 X-Google-Smtp-Source: APXvYqwkM3eGUHy8F7riVt63cxGAsQIXLvcBzpg7W1S1T47T5ShiJjEiHu6FIvZn1CwXlUez2nMTkg== X-Received: by 2002:a63:5466:: with SMTP id e38mr44375279pgm.340.1556285705115; Fri, 26 Apr 2019 06:35:05 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:450d:: with SMTP id n13ls6399520pgq.5.gmail; Fri, 26 Apr 2019 06:35:04 -0700 (PDT) X-Received: by 2002:a63:f513:: with SMTP id w19mr4062879pgh.261.1556285704755; Fri, 26 Apr 2019 06:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556285704; cv=none; d=google.com; s=arc-20160816; b=HO/mZ6sOAqjsFP7CvmNH9LctQsh7eVvgTZH2yRGbAFXKJXZzPon5hhV6Dl6QBpDBvJ 6Ke9uKlhUDNHYQSiYHj1i/FwvpsNLMR1eyl8By4jVq1g5muCJS6m/uQ7krx5wdAKVJq9 Q7REJ9mjBmd5Py5OZP7hOZpr4ygstYD7ZaM22G+swie4eEtqQaXq1HSiCxGP9TrON+Gn XtDJIcM7cI10X8NQY4STKjy4OoVHI9BUON3XWEC36VwVYN33nhrLDGdDW0jtU6lFsmdO 07DdNvXWoCM4GTYyePWnzcK708AH3F8xS6JISXLQ59BJwOYbZ1Ab2J/q4irEeJwR2mRu sRgg== 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=/qOgLyzHZqhoMQdBz3HHUNbRncBtz7SI2uhERnn/Y2c=; b=txabsrkgsJaDb/N8hvu9D4mglzcIYWJhNovhvSKFuUA/JpI7eLFmtOVjo9xpqGhmGL nvBaG50P0G6eqiKua4F2S0Nc4AVkUVPfasFdXoKX1fr8Cxnpv3pAOqN6SqKuw8UDpe0w s44pcGD3V9sizn6PfH7v9VTHR1DV5rIwvPgiHnu2IjKSITuBEWdb36L1MB9110KhHPJK QQOebM+57K++eDDC2RTPyi20zselwAta8LUZd+rOCviaYW4fQFF4m7b0d1m5LLsVkV+j TdkVmz1Cqn/CLeoIt8ae15gZXmDd7uRCYTCbMka4JLLx2cjI8tHSP2G3UEheyF4XkIhh fj6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AD4PoTO5; 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 f23sor83645plr.4.2019.04.26.06.35.04 for (Google Transport Security); Fri, 26 Apr 2019 06:35:04 -0700 (PDT) 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: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 Cc: Paul Kocialkowski , linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, u-boot@lists.denx.de, Jagan Teki 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 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=AD4PoTO5; 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: , 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 \