From patchwork Sun Apr 28 09:09:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 315 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6C6F03F05A for ; Sun, 28 Apr 2019 11:10:10 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id j18sf5315097pfi.20 for ; Sun, 28 Apr 2019 02:10:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556442609; cv=pass; d=google.com; s=arc-20160816; b=uhmArRJ3b7L+bJ63gVkQFtgPkA9Uc0fpeAt6qPA9BM7cVY+84XVzkNr/NdTdXbKq1c owLxz1pF6xIyBlaghNFnqNJO+jPsThnbTADtTcfsiUMisX2Ps2NclS7Je7lhLYZuY1ae HZfdhL85MXC3JjzTzWc6uzCHaNvfH2G71Mw4vLaximGUD9py419Fh58OHwm9JpG7KWrQ CH4caznCfK7hGlh4r+sF83hsKZLe/IllWGCKOeFa9D9dJeZ5AuhqjAA4N2HgfKCC3JFj LBsJjZjHwAWFLqVlEKBrQf/826DxAPCH3KiKicckMvKefrrbXxklMDFH2cbMGWFqNbsw SKjQ== 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=QObI9i3PiShodUWeVXttvMIyJrNe4EbUYBy4RejtNQc=; b=iLn4g6933fpbMbxrWTPwyzL5eQ3ljLSPH3oScm9zD9iZ6LYTt34LP0hIWAQxdeux8z /9PRE2KJz6pEoBc93rven3tRiMEKUpK+MNcIost8OYy10130ekdQNvPJ0tWX5Ks+2XJE Cn23zcaIghf8rov7l/9FZxIGgDIZR/qq+RXI3Db+zc8bQOHQgi/j+m382R50yP+AvgNJ wu4kdPI0nPBSzGqK8DN+TLMoihDBC14YnPTQ7qFgXe2L8NsMdne7DMuQGvZ+TEMJdrWu bEjc6gZ3KfmbBeqRIaUjQBJ2hx9u/UQ2g5Ab1J+wfGvPxOPNTHg/+nflwQ4sg7/ICiXX tfdw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y54ynMdN; 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=QObI9i3PiShodUWeVXttvMIyJrNe4EbUYBy4RejtNQc=; b=S1nueSCj6hOckdkwb6T+6RSiCnqhocbEN58mfyjcdkfTTM2aY+Skrk6jLwbt6lTwvq iZzdWUpFGQmNcFGU+o0/lDNr1zU4fn28+sAphha1Zcx3/XeaPL3Kv+r9xjQzvxQiiFsD i5bu9YJGa4ZAisvgMRDDiplAUPkLPju/V2tR4= 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=QObI9i3PiShodUWeVXttvMIyJrNe4EbUYBy4RejtNQc=; b=LUCwfm4KKTkhs3gnhM33fCRAwQTIQhWTFDsB3EyE5tuOhuXtO4MFhET9eqW1GNREFJ 62/PkMu4M2enJpSLn/7HFm0yBz2JBcPVZGxqvZIEsCDgY9h/t6EpDKZGGAwQ1893HRyV PvQge0phO3TvFpEBeIi2hENiRA2qY3Co/xfioiP5oy3n1vgfRylSm9K/AiL8isLEliL7 l88MwEBwFnKcKoIQHHjDzRWmJ6GulO+0825UMqQh/Uj/J7No9oqyDyVF3WqSnBtd/tpx i9bmh0laqwhCzrvejvwWWx+86bkhrwUImRNUiy75wVfGTSVSUQhiGlukG5gqi8Z2N3oY yqHg== X-Gm-Message-State: APjAAAUK1zZltD29UCW0/C0Y2I55Pocv59QoKs9G9JMcn4mF6zMiBzU6 Ktdu9wHFx5zlqo4Df17K5efG+x0+ X-Google-Smtp-Source: APXvYqyPpn/0cXZKb53JNvZVeHoo9CHJ9NK+DdzKYjJO5QXwzZOl5d7FXY7m/HWW00uOL4bLdGtkkQ== X-Received: by 2002:a63:6ac1:: with SMTP id f184mr54180385pgc.25.1556442609220; Sun, 28 Apr 2019 02:10:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:461d:: with SMTP id t29ls186536pfa.1.gmail; Sun, 28 Apr 2019 02:10:09 -0700 (PDT) X-Received: by 2002:a62:6490:: with SMTP id y138mr57648769pfb.230.1556442608865; Sun, 28 Apr 2019 02:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556442608; cv=none; d=google.com; s=arc-20160816; b=lAE+1bfnmyroFVYq//hPLkfiATcTaep03wYFz21/Bmis7Ih+iwkY5AY8H5eDBmgaNN 4APbow33jxcpS8P/2KRaV/42RDILbdFsd9f0k1ygNRYxledTSt03+TEjUAaCPQBUAmUV AUyWQQloxi8d5Gl/CfaJhy09rPzB6xNOPBK4MuZvhvs/+FtdvEkXZCiRwqKa3MonrMCF Zv2OtfX3dVYjQclmVQcf7ttcQvdMckQ5KtkI+dPrccaJ/2hQSNRJFN6EnY/hoVVhIUXm /oFwUMO9Wl4kMgzxmj8JyNApDSrhMskscezDf81FcxBn12pd7qvzkZ2FXAepd+am5wYn /NAQ== 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=atSux2CLVgvkAm/ZF1YbZ3Gw1E2OtZol0Foof5k36KQ=; b=PYh79vvjRLg3Kjh4aDpt69tkRfKRmEmyWKDMKABAzEPRhfq+z5ZVmLmPm+qftjpyS2 kRkGSMQXViSIQ6Dq3T7GHne9Xy4+VxQn05vqOmg+jgQSqIG1HLaMmn5fWRa74FXFd9GL sqiXBzuJfZNXEwK1gaU7InkfMhMtMRsiuXb8lJfFmq/bt05KnN+S8vrAhdgwODKnvK46 0fFozjn12ezUsRdQGNT+effB4y3wCcX5c/xx9De/wHJMY4T7XOqGpR+OuXGbyCsT7u7O N84JSwoIleCPibgPB83LDQR/ajg6ML+Xwba9gG26Pij6gJJY9rDa/Bjivyn02BYZVH6v KdcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y54ynMdN; 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 f9sor5576074pgd.81.2019.04.28.02.10.08 for (Google Transport Security); Sun, 28 Apr 2019 02:10:08 -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:a63:2b41:: with SMTP id r62mr53139332pgr.403.1556442608545; Sun, 28 Apr 2019 02:10:08 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id k7sm3040338pfk.93.2019.04.28.02.10.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 02:10:07 -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 v2 9/9] rockchip: rk3399: Create single image using BINMAN Date: Sun, 28 Apr 2019 14:39:13 +0530 Message-Id: <20190428090913.10568-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428090913.10568-1-jagan@amarulasolutions.com> References: <20190428090913.10568-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=Y54ynMdN; 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-ficus-u-boot.dtsi | 1 + arch/arm/dts/rk3399-rock960-u-boot.dtsi | 1 + arch/arm/dts/rk3399-u-boot.dtsi | 17 +++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 1 + doc/README.rockchip | 8 ++------ include/configs/rk3399_common.h | 2 ++ 7 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2471340c71..0fe7ac3cc0 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-ficus-u-boot.dtsi b/arch/arm/dts/rk3399-ficus-u-boot.dtsi index eab86bdb30..67b63a8352 100644 --- a/arch/arm/dts/rk3399-ficus-u-boot.dtsi +++ b/arch/arm/dts/rk3399-ficus-u-boot.dtsi @@ -3,4 +3,5 @@ * Copyright (C) 2019 Jagan Teki */ +#include "rk3399-u-boot.dtsi" #include "rk3399-sdram-ddr3-1600.dtsi" diff --git a/arch/arm/dts/rk3399-rock960-u-boot.dtsi b/arch/arm/dts/rk3399-rock960-u-boot.dtsi index 5256f6d3f2..7fb5072a9b 100644 --- a/arch/arm/dts/rk3399-rock960-u-boot.dtsi +++ b/arch/arm/dts/rk3399-rock960-u-boot.dtsi @@ -3,4 +3,5 @@ * Copyright (C) 2019 Jagan Teki */ +#include "rk3399-u-boot.dtsi" #include "rk3399-sdram-lpddr3-2GB-1600.dtsi" 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 ccbaaaa9a7..4ceb383bb7 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -422,13 +422,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 \