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: 266 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 714FA3F033 for ; Fri, 26 Apr 2019 15:35:01 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id g11sf281975plt.23 for ; Fri, 26 Apr 2019 06:35:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556285700; cv=pass; d=google.com; s=arc-20160816; b=ZNjYuxgLV5ts3F1xCRqKF1mbiQcySJhWP3thX31C1oFfSCo4f2QfwsZuGhWh532A2t YTEY7NxYrmuecYv4RFvLkKxFNO7VYfu2ZYOaiYue2PpIT4cnfjhK1zHa4AbdTTL9eILG LlXSGmrti6TvMbB3lud/TJZrQFSfE7HzLwhNbK9WvtzpDFtPRzdxVpmc8XK2PRBZTLJS txXW6MEjlePDqTM2DuXGiKQw+QlqlSuQe19AfKa1XlKaS5MjtZugjidPjSoIDEZgRt7G ZlH8Cs3GfuVSFbpYoqpAi+y6UHzgaVHfMwKiCjUAhccV+GryC9ZospRiqKZhSvocGlIL KTIg== 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=DVM+knRr7hO8f4vXUcHi61b/xUkRmru4VAA+YWrw9LU=; b=htFu1XG6vrU5TaxOzSCXKmNjJ6X5P6kMTwl7bLM/0DiIFDp/YI7096V89kUgkRGLFh 7bcLB8Rus31zrq7PeNZ4ya6IJHnuJNK4Jp7s6ZAwxGX3pQbqLAfvdHsN0JMRMsx5X27i qsJEEz+bbfYkG0UOPve/ruQGoFgAI9oKrX6m5MQFZIa1C5lB4eMAxsAIknYuo871fY0l UkeL7K9fbIcLlvkYGg6CM02pGzYTdoQEcFdVO49yp50ctz568Phy2BcTpQEefklWkkiO CJdJ2gMGZFjprg9R62xRgmucWiMSPMG30Uu6+TnBHO3kbGDtsUdxwRuDpO3g8HN73wJd yMqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qOkD+ffI; 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=DVM+knRr7hO8f4vXUcHi61b/xUkRmru4VAA+YWrw9LU=; b=O8DjiYhN1SMWPyyg7Q6isiqJiiloNUP9NS6Pqf5zcgANvDI+3cnV6WhMF+DztKPRET Qb1LhNB1FwbC9ujqRN+qrEX0bC5Va7imarblLWH9B7Q62n/CEylZ5ny+kAU+NgTYHnPw tu3DMJKdDwoFOE0VEUBVL27Upt+2v1Bu0HAR4= 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=DVM+knRr7hO8f4vXUcHi61b/xUkRmru4VAA+YWrw9LU=; b=Cp36sjDOv53ZYCoAAPGaEWLLmE0Yvx8mqZhpZQ0ECM0bZV+j8yyNfMHM0IhD5gKZb9 tcIQ3j64MIIPbKiOa8tp+YeXn5RF6QGSa5Na6KGTfTvikBGc/eKIqUYU/n4q4S6gQmGe oFfHgmcbA3W8DhELc2GxGoqFwa7Ra9sFe8ikKXe4WAimobkTn9Bnjs5Mw9maug987oN/ 0ELoD4jm08nMV/EPFOLsOjG9r3ODe5Ggp5q3iFiIg83IR9ClqvUxsl8RIwisdytVPHxH 9LfLMVJc4YwOHQHcg38APmPfcjmiGK+/WY4ul6p1jeUoLI5scT+7QTHtILhfVdLnSnfF tH9g== X-Gm-Message-State: APjAAAU7k8Bcin+ohpPgzZF28918EKM30EgH4ypj9mq7ZJSojJWyM2Dq hCCkOQOs+O92ak1NHAH19yGwzpiq X-Google-Smtp-Source: APXvYqyiXMEoLQviDBf6KIMdmva3VGyu+Fb9GZ+DOsW8PWU7wORu0W8y2RHJ5fTcti0Kla5/5ReVBQ== X-Received: by 2002:a17:902:e101:: with SMTP id cc1mr46385412plb.129.1556285700218; Fri, 26 Apr 2019 06:35:00 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:bb8c:: with SMTP id m12ls7073999pls.16.gmail; Fri, 26 Apr 2019 06:35:00 -0700 (PDT) X-Received: by 2002:a17:902:b592:: with SMTP id a18mr15012214pls.252.1556285699853; Fri, 26 Apr 2019 06:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556285699; cv=none; d=google.com; s=arc-20160816; b=taXwz4DDGJhr96dGRCq2pb3uzSvldihC5b0xb0T2Y5Ka9Y1nOj61L8qbMf5OcDYdK8 J+1diUdQodBlHWuBjWPjY5tTDya0QNMwDcfLQZ1njVijm0K+IiTSnbLf1M4EfAA1DE3o V7Uk+S2MFohbkQf0e5ErA1s5KQcekYrpYFx49+YaVI7IYjvDfV7xwtvF3cdfxa/4F3pB wEc2kVEw8cJcaSVZBbCoDoAQ4iI9QtK86h1LHc8HkLIvbu5oTbdWCikFXP+3jNdEFruw tKhWnin7pOoWRBeRWyH7zZNesMQVyoeaWGVeED7SqdVdjXELrG/zHEGGy4eQ8N1T12IB kh9w== 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=M9AJcb/8Dmjs0igPOlr99VUFJEFDN2irpI4FE8JxLWY=; b=BuAElcB2K3X/wNv0EIkVXMOgxjm7bOnj/hNQxlHKNO38OyHqylhrzD9F2ch9fRnuV+ R1hdsCEn/4gPaAL8UQFio8y0/41G+wnSo+hfCTSdXClErjPlyCjul5n0P5ePv3dNBRdC aBS6LC4JJdGuWxdj7HqU1W01iADu3iUHa8xLm2vwLEaynQUTmRjQfxfK4wPJrBd8QLxB K+GSpqqtS9oLoXLOT3Z9Fp8VpB3zIGty7tpGo/N8FukaNdjboyPjfB2TXhNiqWylOpCj t2DayrjubJS+qjPNV7LWfAppf/xb4bb35LCQnIBqwN5xSiY8nUr7zQed2g/g0h6OCpSw MCug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qOkD+ffI; 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 x18sor28619871pfa.69.2019.04.26.06.34.59 for (Google Transport Security); Fri, 26 Apr 2019 06:34:59 -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: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 Cc: Paul Kocialkowski , linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, u-boot@lists.denx.de, Jagan Teki 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 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=qOkD+ffI; 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: , 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 $@