From patchwork Sun Apr 28 09:09:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10920861 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 C68CF92A for ; Sun, 28 Apr 2019 09:10:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB25528748 for ; Sun, 28 Apr 2019 09:10:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F0AA287AA; Sun, 28 Apr 2019 09:10:06 +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 E831328748 for ; Sun, 28 Apr 2019 09:10: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=5ZWQbid0Z6x17r8ZGrCou8QkqiTFzfpVspHlMe5tQmo=; b=r7hvArRmnuEYtF QpkOiMAtYdZ1rJCj1qGfrW6So23LUz1TGyscVjatFuj9+m6U2ToLQXVGwyI76xdOuFNdR7dlQby/2 QLGBh9JibTul94gjQ/zOHPLuTbIdisIXRtcdcR3GUb+h6rRiotLIv7OzZLt3PMDD4gvX40lt0XaXQ 6YYOgk4Kyh45YnTyrTqXUml4IyRvZCEiWdbjGHmms32hxXUF2uvbemYIgktB9i2qPPZCmg7HZ8gfo nzQ6TwPVkRLifqvVVdlBq6WCt5nPi8+S9Lz5minbqPSbs8Jahs/SqzwM8NRr9xbPrG91JVqMGbgDp yULndGSaGbHLJKxgoUvQ==; 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 1hKfow-00016D-6Z; Sun, 28 Apr 2019 09:10:02 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hKfot-00013a-AP for linux-rockchip@lists.infradead.org; Sun, 28 Apr 2019 09:10:00 +0000 Received: by mail-pg1-x543.google.com with SMTP id f6so3700424pgs.8 for ; Sun, 28 Apr 2019 02:09:59 -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=Gmv72XAUwvL32XO90b4eb/ahZYMWppaAG+neC+SSpjE=; b=jUtUte4rlz/WZN8jisim3Zn01PqDp4IYfr+gAwnaFXIaVHW906ybuibH8JvqpgWeNz J+zajtMiT7vlaHVetFGhPjHAdXf+1h0zzrC5f2O6y4cBsmMviGAblENWnnuR7Gb8AzZI 2I4g1BbUO8RvxrYYs++aa7sRjbC312+Kf7XDs= 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=Gmv72XAUwvL32XO90b4eb/ahZYMWppaAG+neC+SSpjE=; b=JmdAHHxmv0nhJ5c9VOHvTm6joQtk8bbIcYucXFlP/8hm2VOsXzn3ZHZrqiHyo16Fb0 qal6tOtcpJNGGVRn+TTJQCpFJJbU3XUC0x1ZVMMNi7T72+NU7iSUqfvePsQT4ba1LrW0 1Bz5Ma4JEGifXbgdBsdTk2Kdd8Oe+ltsF2r6oQ7k1Pab6C17evjidPuNSX8vOwFNVMQI m7+v7jWzdRpuKlvEL8BAz6fJFJZX8KOXy5sKTEC26NAE+ej47iKAqNSU/K7vIQAo8qU4 nwXnQZoUKOW4wlrrfAQv+UjeWpRQHsMpt268Vlt4vDqcR5jzUnZOyYt5hhUS1Y2czwCM eJYA== X-Gm-Message-State: APjAAAX7ZKY7KwGUBN25vrsFf3lFiDaYHzqcclNJNuAjtuAMFmVmFug8 P5XREgq0SSzBkPaQF6Uairun3w== X-Google-Smtp-Source: APXvYqyTNEvLVdD2F0apo6zNhxfbt7MJmV8tr+KrTDjtjTsb4692ckzmQ1O7G/Ml/ThVtzlXSUELcg== X-Received: by 2002:a65:480c:: with SMTP id h12mr52210940pgs.266.1556442598841; Sun, 28 Apr 2019 02:09:58 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id k7sm3040338pfk.93.2019.04.28.02.09.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 02:09:58 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar , Tom Rini , Manivannan Sadhasivam Subject: [PATCH v2 7/9] Makefile.spl: Create u-boot-spl-rockchip.bin for rk3399 Date: Sun, 28 Apr 2019 14:39:11 +0530 Message-Id: <20190428090913.10568-8-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_020959_357692_B515A20E X-CRM114-Status: GOOD ( 11.90 ) 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 c4e5f83da7..ccbaaaa9a7 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -421,11 +421,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 $@