From patchwork Fri Apr 26 13:34:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10919211 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 D473F1398 for ; Fri, 26 Apr 2019 13:35:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C128728BAD for ; Fri, 26 Apr 2019 13:35:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B551028C61; Fri, 26 Apr 2019 13:35:05 +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 20F2928BAD for ; Fri, 26 Apr 2019 13:35:05 +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=h0oAa3UHSYih9KD8rq6E20JBo91kiQV7/1ZSKX4zXxg=; b=YAGli6RJ8A/kAN AA3R5naAWxCK4ldG6kRfj1Z1ufQgpb2fVmvKg+y0ih0krE6+rPoyBNQ0uvMCVOP7D4lswctaAlVlY d4JaEAPdcIINiXAnYtULtj9hkfZpQxApCalQmNSsIzOdE5ig6GGR1PsVkInzbN9zFjbEnspzad+b+ ZNbRkqDAcbfbZONh9Fle/6XxJ3P6Z8NofKZNPldS9XbnZGDVM2S5W7ksU9+Uu1Uo5VSarRwd2TlNO 5Yk9s/af1A2qCAVYgqPbJ0aeo3mP9gwsisNOeH54pCGPE+QEO0Ke5crkaZ9O8b6isQarCMqKZrUmL wNYAG30zDo550SfrjTlg==; 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 1hK10J-0005aQ-6m; Fri, 26 Apr 2019 13:35:03 +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 1hK10G-0005MF-2r for linux-rockchip@lists.infradead.org; Fri, 26 Apr 2019 13:35:01 +0000 Received: by mail-pf1-x441.google.com with SMTP id s4so1742687pfh.7 for ; Fri, 26 Apr 2019 06:35:00 -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=M9AJcb/8Dmjs0igPOlr99VUFJEFDN2irpI4FE8JxLWY=; b=qOkD+ffIG9oXuQQPYOpCVcXGPxNKB/BOQXtR5JpcJntlPmjdoriz3iDtjqyrCQFif9 RLHKZiirs4pcznsiZBMHdXdy7FEmtpPkitMLR+FaDO0PA8K6rtVIXVRfOJnYwVDb+KZn GNRqS+A4k3Sa4jywUoNrOcdhzRJgUXKwVw8gM= 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=M9AJcb/8Dmjs0igPOlr99VUFJEFDN2irpI4FE8JxLWY=; b=VvQOyxXPKq86h0RE0JK8qqnfABLDeQqOHjJ2qPvm7tiNg8Y6D7rcyMDrLD679dBVvw DmZ3wZsxaR5TXt/ukuQlUWFDbPaGGwVi7G7HfGxsubhJcKLFGywwCK/lrid/TaygLh7l HsTS4q5gNzEBtLinSpW1TOp4TN5W53tmvYoedw3Vk6iUYId3BZVpg+IeJu6pvAaGAANC 9csGw1VuIjBXrTADi1aMD/m+LC0NOtge00S9VZZSIpCtwtM/N22psATzIBKheuYnqaJ4 Yz2SlwwEzmCmRk26NLAiarineT3WAokeI3B3T+zJkDGga7Ta5t44r9kJAUmPUuQnWvtJ s+Yg== X-Gm-Message-State: APjAAAVphjOt+BCwf78mjSu7TDiVvvbGoO0moWAYxlf6tQCs5xnQ/FlL qJW5F7mpno7QifdHCqy5pZiRkQ== X-Google-Smtp-Source: APXvYqxMH9oRB97+X+QeUshTBIrhukXOEFwnP7LL0xvs2BsYNOR4QF9Idyl1gxceyXxA12R/eZrslw== X-Received: by 2002:a63:2a8f:: with SMTP id q137mr43858721pgq.31.1556285699518; Fri, 26 Apr 2019 06:34:59 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id y19sm36946770pfn.164.2019.04.26.06.34.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 06:34:58 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar , Tom Rini , Manivannan Sadhasivam Subject: [PATCH 4/5] Makefile.spl: Create u-boot-spl-rockchip.bin for rk3399 Date: Fri, 26 Apr 2019 19:04:29 +0530 Message-Id: <20190426133430.17802-5-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_063500_121575_2AF10214 X-CRM114-Status: GOOD ( 11.80 ) 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 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 124efd65e4..73594dc61d 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -397,11 +397,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.bin 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 $@