From patchwork Thu Apr 25 17:54:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10917571 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 7D1DE92A for ; Thu, 25 Apr 2019 17:54:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E9EB212DA for ; Thu, 25 Apr 2019 17:54:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62B38284F0; Thu, 25 Apr 2019 17:54:56 +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 07B2B212DA for ; Thu, 25 Apr 2019 17:54:54 +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: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:In-Reply-To:References: List-Owner; bh=JEkLfXI9WeTtjiapc6zpxWN3WVQaunHRnCq3TXB7WoM=; b=DOX9StHzWHvkZB K42Ba2iajokBgrcoHvVHB8tovzUHHRe6iU3D+0seXCYRAPbdeFXsJmKfSRM7R8XkdUdPufhaqDp6m GI0aPx4NPbhnrCPc0c1MkBBx+iFux3KQpnPmm3ecjfVj6zs2Nt3gTP1YohOBF7eGIHHGE2T0/kNJx rkcZhFWwh/Oqe0cAZotjM2w71NzboUncJ03GgjDjSO5N/xY9VvF6EpyiZ+d6bWjwvydTNY/vGkdzp Q2uI9+LHAhE8onMB7K4BF3LPQEaXVNRnTBJMC0CVfMjVAuBLLx7QjuWhHPGQNd0BzcW8rLIkg7dch 1Z3bihXcATVoeGQy1wZA==; 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 1hJiaB-00086u-Mo; Thu, 25 Apr 2019 17:54:51 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJia7-00085q-QN for linux-rockchip@lists.infradead.org; Thu, 25 Apr 2019 17:54:50 +0000 Received: by mail-pl1-x644.google.com with SMTP id y6so173541plt.1 for ; Thu, 25 Apr 2019 10:54:47 -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:mime-version :content-transfer-encoding; bh=1H5qBY7EPQyD+jMMJENeJWmUtOQK9YBmywdTyFjYOkc=; b=G3zSZUzOC/R37+3FZv7f4/UIoXif8+KB+hVS2848qZt+O5oeN9lSzOx/d+6DUwH0I4 1wGjnijcQdBbtv9DEoZP8hzzybYlDf1xYXTx4ujA3PrCHmRftBENHCM5KtwS3dboAsj8 LzF/wrrQ+ZpxgNZ50N++OA86fDLYb8snFp+4I= 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:mime-version :content-transfer-encoding; bh=1H5qBY7EPQyD+jMMJENeJWmUtOQK9YBmywdTyFjYOkc=; b=DByUGjp10x6YNLYbUGTotHRCoPNxH6T8IhMLXtTFTPaD4N4OcqPXER89pR5MAw4Scq xy+Uo2mFXS0uK6X1ZmMyDD/4QlQYJFT3ZAbrYDoAnE9NUYK3kJaCBAMzplPovhMf/6Wo ZIwzHCOBeAOYJecm0VB5z1y61jWmQ3NLkQsqP+Q5yWtHc3SslrSdaiWVu1q/VLT5JKWK DgxUmM1R41cEH5f3Mzu6LqSunHWgNekz6H+1ofyesa/IVo8ZMd1JomGQcVqTdeCHScDj +Q9ED6ykWeYFwH6gt2zjyLTE7GpkOlUdWgJDndxrPKiuDwmjxbxJQQ5x003hmM6WbHqz 27tA== X-Gm-Message-State: APjAAAXiXSPLJFxX1tU5quSHhnZAxAZbR2Wa72b5sWoa6Kmiyk34Sl+c yVxRjFfsLamDm2H7WOz2KuesxQ== X-Google-Smtp-Source: APXvYqztjWiKbmZiNQ3/ETkb/Xo4Xt640fuHmDLyB08obefIwFjRVS9Du0lVCs4jzmzdUav5VMDNDA== X-Received: by 2002:a17:902:b614:: with SMTP id b20mr5063527pls.200.1556214886726; Thu, 25 Apr 2019 10:54:46 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id 18sm35679832pfp.18.2019.04.25.10.54.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 10:54:46 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar Subject: [PATCH] Makefile.spl: Create u-boot-spl-rockchip.bin for rk3399 Date: Thu, 25 Apr 2019 23:24:31 +0530 Message-Id: <20190425175431.15370-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190425_105448_300567_C9302752 X-CRM114-Status: GOOD ( 10.64 ) 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: 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 Rockchip platform would require an explicit call to mkimage for creating bootable images which indeed specific to SoC family along with boot devices. Example of creating bootable image for rk3399 family with SD boot device as ₹ mkimage -n rk3399 -T rksd -d ./spl/u-boot-spl-dtb.bin u-boot-spl-rockchip.bin This patch would do the same think via Makefile.spl for rk3399. This would be an initial version and it can easily expand further to support other families of SoC's with variety of boot stages like TPL, SPL. Signed-off-by: Jagan Teki --- arch/arm/mach-rockchip/Kconfig | 8 ++++++++ doc/README.rockchip | 3 +-- scripts/Makefile.spl | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index dbe7f11d39..286c870135 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -222,6 +222,14 @@ config ROCKCHIP_SPL_RESERVE_IRAM config ROCKCHIP_BROM_HELPER bool +config SPL_ROCKCHIP_IMG_NAME + string "SPL Rockchip image name" + default "rk3399" if ROCKCHIP_RK3399 + help + To create SPL image for rockchip targets the image name would + depends on the SoC family that would pass as an argument as + '-n rk3399' to mkimage for creating Rockchip SPL boot image. + config SPL_ROCKCHIP_EARLYRETURN_TO_BROM bool "SPL requires early-return (for RK3188-style BROM) to BROM" depends on SPL && ENABLE_ARM_SOC_BOOT0_HOOK diff --git a/doc/README.rockchip b/doc/README.rockchip index e8f6a2dfba..6341f47b21 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -399,11 +399,10 @@ Option 2: Package the image with SPL: - Prefix rk3399 header to SPL image => cd /path/to/u-boot - => ./tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl-dtb.bin out - Write prefixed SPL at 64th sector - => sudo dd if=out of=/dev/sdc seek=64 + => sudo dd if=spl/u-boot-spl-rockchip.dtb of=/dev/sdc seek=64 - Write U-Boot proper at 16384 sector diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 54b160d72b..49c0641aa2 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -235,6 +235,10 @@ ALL-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin ALL-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin +ifdef CONFIG_ROCKCHIP_RK3399 +ALL-$(CONFIG_ARCH_ROCKCHIP) += $(obj)/u-boot-spl-rockchip.bin +endif + all: $(ALL-y) quiet_cmd_cat = CAT $@ @@ -369,6 +373,23 @@ MKIMAGEFLAGS_u-boot-spl-mtk.bin = -T mtk_image \ $(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE $(call if_changed,mkimage) +# Rockchip specific SPL build +ifeq ($(CONFIG_ROCKCHIP_RK3399),y) + +ifeq ($(CONFIG_SPI_FLASH_SUPPORT),y) +ROCKCHIP_IMG_TYPE := rkspi +else +ROCKCHIP_IMG_TYPE := rksd +endif + +MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SPL_ROCKCHIP_IMG_NAME) \ + -T $(ROCKCHIP_IMG_TYPE) -d $(MKIMAGEOUTPUT) + +$(obj)/u-boot-spl-rockchip.bin: $(obj)/u-boot-spl.bin FORCE + $(call if_changed,mkimage) + +endif # CONFIG_ROCKCHIP_RK3399 + # Rule to link u-boot-spl # May be overridden by arch/$(ARCH)/config.mk quiet_cmd_u-boot-spl ?= LD $@