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: 313 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AF4433F05A for ; Sun, 28 Apr 2019 11:10:00 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id h14sf5303452pgn.23 for ; Sun, 28 Apr 2019 02:10:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556442599; cv=pass; d=google.com; s=arc-20160816; b=SyNlK2poKMvLL/GDYh+L1MOB+HDIQSLg8ypYRduLpVfqLwUue3L8dXlr3PPsxoj7Ig 4WMAWZAAsUcZfi+BXWOJZq/D3oj6uFhjDYHJOgoI9ump6HYZwlk/RymkdRnW4mLsl0WZ mEyXnPCP1px7AgaksRMg5ZN8rQtJU9N/J3u8FZSE0Qdpvg+B3fBuz5sUjuQV/CrlcZ7F gIQvDurVqCeutniqLoMZUet/QhqHBe+VAkBkMsVh8m8Mud/IjoguhP3Z/j0OxLQZQ7ta BNxF1CK27DCqPmougH4B8WlFbEXUQn3zz2satyFDGpgWrb8PO0LvbqEA3h7zYMZc1ONq rcGw== 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=UBw8TgxKbxinlpWPp4R+7GsKt83le9qfkXNwYjPmMFQ=; b=eoTMcH+m6beSOXeA4dlVa9Zl6N1tO23WSl/AEH2vyZDirexg4ky8fUUOk5Fz7kTQgI pcLeUY23pLuyCImQE5We1FUrcvUWcPNQC1AAKYVvH+7UMfybIfTRt65a5MH3b+UsBKqd Lpu42MUUk/U9Q5n661UKTSY9UDNtH/+9YrvTvuwrDxhEgh2ZNc6X+kYUZa505rxdWEj7 Nl22xPzW1ISHtC3OOcznlxvBsInk79c1ZVTgDx+H9lCSJPiG9NG8Cjj+qYsUiriQRrUi 212nBB/FDjSPjdjcM++E1BkfQhwIf++hLEEoft6OjVHmQZ62xiRpc/4VsCSX2geL+wpE 7WPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jUtUte4r; 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=UBw8TgxKbxinlpWPp4R+7GsKt83le9qfkXNwYjPmMFQ=; b=JQnzUBPbFW5wtggVucrP9+VtVG+fg9g14T1PSqc0aV0ETWxXQZlTtui+IJrUQSarK8 EkJWTvZrXNTFbWaspeoVs2gGAvIipX86m4qGNYFFMrEl0SmZAbQmeAZZl3cHOGGZn7zs B1OB25bc2QdTSVMonEL4ql9mBGlNzuq/CAP6Y= 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=UBw8TgxKbxinlpWPp4R+7GsKt83le9qfkXNwYjPmMFQ=; b=BKDJ8Bu/9eQav4EzPl8xcTYoWTI9Bfo2gQ5hOUnx1r1uOMOdZO7RjApOXXcXyKdcvv ++xw/Z7QfrUyuIRoiopCRsIVUAb4cgHelHur/OJh/9MCPFL2z+Mb2Gg5xF+fzXYb1IsS 6EkJRZP5eUS92gkZY4h3xPT2FyrweFXFI07hSBrZ6rOsxF65X8lM+w0Eowg7o9Q9q37D eN9ykFtvEpfoKZTbAnPisCemcLNPvceLQ+E2R5vCl5gqPfyMZGasZCfFllXoGMzUogD+ 82UT9EsQPwIb9kfXDgX/2RQ7BZIfur8/MIybcbTNp9fKOocXUyHUOfHuzvbNPGkqp72R MPjw== X-Gm-Message-State: APjAAAVgBL492RimE8Iu3MzZPTVdjAw6wpZ/VJ+ywT96U/V+ilUZHS30 rZm8amNx0L0LPw+LoibqgrKi7vtb X-Google-Smtp-Source: APXvYqxulR8d7K4mpighXIj6bu/vgTiotZXpyrPQ+CPVtDOhx7miZHrWIwayQh5xH85dJ7+CsgKvZQ== X-Received: by 2002:a17:902:968c:: with SMTP id n12mr10352987plp.105.1556442599503; Sun, 28 Apr 2019 02:09:59 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:8a82:: with SMTP id a2ls115415pfc.13.gmail; Sun, 28 Apr 2019 02:09:59 -0700 (PDT) X-Received: by 2002:a62:5542:: with SMTP id j63mr3254204pfb.34.1556442599127; Sun, 28 Apr 2019 02:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556442599; cv=none; d=google.com; s=arc-20160816; b=upEnOxnThds4hG8EUe/T61/ObZJSua269jvVs1ZRvSfuXP09DJzBzN6UlKb3EHWI/t 8gp3t2PGeEkl4P3VQK5J6vUvEGpIrDXZ2OZXwjTglhOmrNuYlKupBlJ2KGzqtQnz3+IT i7PXjJVUGG20jsYLf4ZyEyxOzl2watmZWG/zNYLaxTxe6oiw8muu/dXlFnomHbuUARvM zD0GyZWKspA2iQr+LUFF8waggrwsgJ3s+5LOp3wL7EibyTwBa9CcKMXwHkjBOWwTlSTV pvc5282Ce2ysctOutId20NO/VgLIs41HH0Fo4PMbEH9RmngTp94pKu2TH2DxAjhG/f4w 4HdQ== 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=Gmv72XAUwvL32XO90b4eb/ahZYMWppaAG+neC+SSpjE=; b=qy7ebs5udA4RsRXBVQh9Wfj0hSAHLC9Ma+3QkxpsP1V1aeAUFrNGKnGHnFrN1SNXBG JfGRROeqnGzcT7TS2k3+6r2vPfQSU8NYySEQS3V1qyKpjeFm8N9xSJ5uqhUmRt9FZ1cN /tX99aKmeaa8t4nQyvdQ/69GrL5AGTKTm8WD0omnZEVdl2xWQw9c+8X6waufcs0i/tlS yWGqOg87IWqHOTBQuPnlTyYd+dtmNONrq5xykPhdhK9+FORjfPOycPbdEgndCESqUl8W WN5wSYPtWAbZX/gH7zHMSpGIuxhEgmu13EBeNcRp9I8k3rkMchx67ES2xokXXSzdJhnq sRSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jUtUte4r; 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 c9sor1663015pge.13.2019.04.28.02.09.59 for (Google Transport Security); Sun, 28 Apr 2019 02:09: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: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 Cc: Paul Kocialkowski , linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, u-boot@lists.denx.de, Jagan Teki 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 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=jUtUte4r; 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 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 $@