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: 260 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5425E3F089 for ; Thu, 25 Apr 2019 19:54:52 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id r13sf212163pga.13 for ; Thu, 25 Apr 2019 10:54:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556214890; cv=pass; d=google.com; s=arc-20160816; b=JfXnMb4W3GWXEWL4Mx9BMi1mHPQM6cdE0O8/Z65PogFo3oMIbg3hTcJcNcqeur0NJ0 zg2Wr8fIkQ962v/sucJubNih+yP6Btsg4wo9qLYRhEO2WnVymKa1Z8KscCCqSRCYlX9B EyQjOHSM9alrzdMi/1bhVwc3RJAAIX/kw1sfzAlaV/6SP66EDm0CP9Z8uaEvwCcjmZAS jHKci9x1firhKEHlRMBp+Tm81v1j7fgt5ShnLCVbbp9C6cgoPaNi3/4ecRfL4FWMwnBS 9FC9olkMTyc/dmxe8JlNnneCgfAmZObVbZBqtRaUa2j/G+pGU/iDMfb8wnL5L3XNm0b4 Fv3A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=SGQA99lsv333nEFCPfsRPSGNAwK4pqYDXa9LSYJ32GE=; b=wZgmR7C4wg2u7u0/MFG3Zp32QTeuwzPugbDd6KKMYjb5kfLyX2sj0AFrn7tpLW5Rae bUqQNOQIlzi45GM9dmDskEdBj9RtPmXYIxQjAd/cXDjoGzPyAEXiVAJ/QVRgParXsnAx n3rrlWiQexCrM8UgDIsP5dQQ8EwxdrYeaJKxjerO3oVGS6d/gS3uOVtmehWN/rkNWoXG 1zu8g3IdyJObreXokLbi+t4MxeSnQIHqc8SLQ68ToNnLHu8dylARcRhkN7gaB7lGtKl2 RpRLdUTu+GRJnbZ2aNrfP01UJY2EbNK+w83qWoC7QB4aNE87m7synPZfiEj+/BAiakgC ZqGQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=G3zSZUzO; 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: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=SGQA99lsv333nEFCPfsRPSGNAwK4pqYDXa9LSYJ32GE=; b=A81+mhGxKKBjnT/5bRz0B3lyYPlpNOKJh++n+hTf5FbUIjyIS2r5sEmd86GRBvKhGF fbGhG2wAV4WwnzkrLSgVjzjZDto5Q1cGfqj6flSuW7+hQYl9BdkumH9/ZIISzQMB8Q0Y UmEI3p4xcIQf0n3CNL8aD29w9MyTWBFirl0Nw= 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: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=SGQA99lsv333nEFCPfsRPSGNAwK4pqYDXa9LSYJ32GE=; b=g+VmMTmsFhQCt7WzyYG7qgZexKD9unHPFMbtbeQ4LXLKEUlIDN4CV+45qcd2duNBtT +ANU/6ngno5oOeZ2kTCHGb5PC60ILUJCb5slobJmAitAN2eLsYV/kiWJ1Aa5+pta+nng NiyxbIhj3NFzZ7o6xjLSzzWEmKIRd6x4BA/F0o9KGAsamDA5hGcv1O4uewMgQ6cFrRUz FHEvWx1HM+K4DEC5PV9diYSAkLHqGxfOaZASEEfv18fQ7vu4UhNJBWd8BzR/vD3SqZfo c1QXF/YvWudC/tjXR+SP2JKKLFoYcM31OfPqFNDNtaWR8OKL9pgExavqn1cRzpt7LLdS 7tBg== X-Gm-Message-State: APjAAAURQQNgWeAUPFBSb80vI3Ua6hyQ84O3tve7MPMepmcW0faU9JUK whEGqKXBiq1uMWjEGxO224BlGWkF X-Google-Smtp-Source: APXvYqxajioD66N/j+gedYm/hQATfz/vn3Msm1dTcCKxvyrtEvm5bIBnWY8dJh/yXur1RezV9uidzg== X-Received: by 2002:a65:5148:: with SMTP id g8mr3550113pgq.168.1556214889322; Thu, 25 Apr 2019 10:54:49 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:b60a:: with SMTP id j10ls6994594pff.6.gmail; Thu, 25 Apr 2019 10:54:49 -0700 (PDT) X-Received: by 2002:a62:e411:: with SMTP id r17mr41725804pfh.127.1556214888946; Thu, 25 Apr 2019 10:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556214888; cv=none; d=google.com; s=arc-20160816; b=CrvdiLTYJ+MmvPdyD7aUBuW32ND7Dzd2Z3rhds4qbORYG6Q4X/WX8Ulf1sDllXbV5K 5Mq5PmniJ+Trkn91cTZ714AB9B0XlrBzCPYVdai7qu8A8nLzhs4EmQjaarL7aMrbKKOa PP2PS+215Gum4V/R8ZMY4dwP6c8lNnndtKUDW0SSEMtPrId3NplTpzxJC81IjsHKLQLe Ayk8hqlycFLVXH8BWHzp3EPsM09UehabEYiNBqrSsF3C179dl/T84N/0Eara29ApMfGM AjysLTJEyQPggKSiNDvqc8O4rmUlkhEoxkUi4jwJ5OO9FMBwGRnYAKAXEw66XUFWJhTs XHAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=1H5qBY7EPQyD+jMMJENeJWmUtOQK9YBmywdTyFjYOkc=; b=XkyHrsM4yPI49Q/QSdJettMs0BZr95zykodrdWOJtpLDrFeW7/DD2yzTCAw2BjJUVV 85x9VQz4Y1ssptGFdaBT2NEbjGNdMJXFOaIIHHWQ9SfyM/E+Ne7o/2y8v/EBuvBarZEH GtmoJ7ozQmUwM4nuVHJjiq+eUSE3I6qHKEvAji1NCuu7KtoV5ieQh66xE4eS31EiXiSJ bCbCJiVthn9gt3xixw99nXWDytwzRqIEmweta8sJVoZaU1B9FsRQTfRcjoJyNI6zNz3o 6rv1/ivESQKI0+ovcouhgYCy+5VH0sQcI47G90rWurwCbOxx8I/L9qkhzA0olw649xKz Ln6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=G3zSZUzO; 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 f33sor10321772plf.50.2019.04.25.10.54.47 for (Google Transport Security); Thu, 25 Apr 2019 10:54:47 -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: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 Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, u-boot@lists.denx.de, Jagan Teki 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 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=G3zSZUzO; 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 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 $@