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: 10920865 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 752FB912 for ; Sun, 28 Apr 2019 09:10:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63AD928647 for ; Sun, 28 Apr 2019 09:10:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57D262880A; Sun, 28 Apr 2019 09:10:16 +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 D054928647 for ; Sun, 28 Apr 2019 09:10:15 +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=R3XoM3gn0FwoRyAWl5W30kQHcVyqcP1JEzWh0jbJBmU=; b=NGXmepXIDeTZ8y wyQPlQo9B6NeWZ43AnK1aulMcdqNNeB4oo1zThr9ijzgknUMPbaHSPB+X81+uLwd/4b8aN5U6EOBQ pU/cIabvYantHIU20k4Bo8y/4Y/q05+aKu58+OAJao3Bs7nMbNJBvYkDEIxu5NBXEDMCQyyl8BxW6 38kim5vlACQAdc8iEKWZuzxIBvP8F8Uyh+7aMGUr3Pgc4tv0g6+SXpBZ9Vq+S4TeFxVfLyYZOGqK8 elYtchK4Yryc2VuJjCwU1KBzNIPM9Ee4OPKh8sXvbgTFXGj+sE/eP5PfJ6/fGjOiCbXzlfZo1Axjl KV3FEx3BQ3OQRKqdJKiw==; 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 1hKfp6-0002QF-Bq; Sun, 28 Apr 2019 09:10:12 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hKfp3-00020r-GZ for linux-rockchip@lists.infradead.org; Sun, 28 Apr 2019 09:10:11 +0000 Received: by mail-pf1-x441.google.com with SMTP id w25so3830465pfi.9 for ; Sun, 28 Apr 2019 02:10:09 -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=atSux2CLVgvkAm/ZF1YbZ3Gw1E2OtZol0Foof5k36KQ=; b=Y54ynMdNqP620+jYdLekHXHNfPJTLp4IMsAQmksyATfYIkhztUg4YZZjGy/SRHxAVM 3OouvORqKBjJlwglBZwR2wySb65wZUx4LrHmqMN4eyCzu0nj/GlpP213oSQ7TIm7hMG1 gsM+KCRZbHzyncvnSImypGx6pHjqtk6Vh3e00= 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=atSux2CLVgvkAm/ZF1YbZ3Gw1E2OtZol0Foof5k36KQ=; b=fZFFhh1mX9l1B3mLXpG5j1KqfC4Js5lMJv2Yi/MRP8S1BYpsFaEt7RluvL8O3nF5/H jwUO87tiHy7Ytv7BcJ1UsnSnDXitYzaeQagZmtG3v+2gWWXN99+6Ax9N3ZLvtmNG0RT3 OZmKRxiO8B68nae1HSrqINMOzQeqpPKGoIvulazVj5I5xD6tvsgiEy4yB0R82+sflRJt hxFYttWnGDf+JjpmKwAFc1PHmANmVbp7W+REFXrI4T82gZG6nRzN4rgFEAnvZa5JaevO RZjLbbf7tV85bIzKQnKC7dAKPJ9OOEyfYhxRV6ZlhMwhJLF9KxKEmFFZ/ZfLeQ13Fs/T cCHQ== X-Gm-Message-State: APjAAAXhOXGWYpRgRhUkDaIr4jhO7NSx9uZ5viVhKWT2EHJkZms9xbrq O2MvyKTFKnWHW0boX9AideaqtA== X-Google-Smtp-Source: APXvYqzvsbx9AKxeZgs7QPbPPKorGhTgZnfezUtdeCOouaOjpRAzkHkKhKNy1Ev0Icom9c8JzyFhhw== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190428_021009_564763_ECFB4D46 X-CRM114-Status: GOOD ( 11.41 ) 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-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 \