From patchwork Thu Jun 20 10:07:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 676 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AAF653F086 for ; Thu, 20 Jun 2019 12:08:15 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id g9sf1455392pgd.17 for ; Thu, 20 Jun 2019 03:08:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1561025294; cv=pass; d=google.com; s=arc-20160816; b=nTxfdVMWTSCxCqCVJ90FU2cQm68qffaoR/Z/Kc/OhkcerJoQ4ZB/hctOH/XxAEw87a tYhyqockk51IB45UztE81kqxtWcAoivN94ZK3NoQYzTa5fZzUQSwu8abTNq3Q+VLrbNK u+CC8GQ/gXIHVxf8M85NCcUbyzZgrml7nq7DUnmwpw6q39dFascTDyo+DCsI8V3IZTpY /f6w2/h8WneGUfUXiZWpEqxkOopfK1fUq4uGC4yicL3bzUIoFw4rmSSBQ+yM3cInRv6j IUNjo4Ey4zMy+295+fGuM/L7J7s4kijsNNIRHVENT8dBMRaJEDXGz9p++DDRiAP96+0J oHtQ== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=mR2al1b3q/qEEfL60MOOCz1aBs3pkDqBw5hr0/P/uGs=; b=qkYl0KsEpiuBoTh7JaZyFoJgMJQvg0rIISgdX2U2PIM1ALX5wiCDq5bhM0/h8CBu+8 B2A6yxIC06WfeEt3BQq7vOCS9rcq5GJ79bpFVYIrcMTXGjIVoAzUMXq+qnSo0AU1S4qG rFT1Zy6EFkPCNB18SYcAjVIDaev6aj0ROd/Nsy4th8bVG6ovAEExPXNQDn0edYZbFhEr SHCmOU+W/2kYwdzK17JAcW+77dvH3hC/QzcuYevl2K+CjCXOFQUdvlBAlWtaY8ZSC3uE JGpd8lARWoMEPae113JB23RV0Ch5QzTXjeiUWZcJKek40Ri788pO4VqI102YMRz8M645 KelA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DbHY1y1t; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=mR2al1b3q/qEEfL60MOOCz1aBs3pkDqBw5hr0/P/uGs=; b=cZT8FvP1I7ntsyVBK9JOhVtfx+s1OmyQfu7KYqTV4uWa18PGKMnesvRNg/MK8NnDq2 9gX7Deqoj6vG5BgkgA/fVGp7eu41MH0JDI5qrFN1RrZMnL8ZytHxRHF4Us6j4lD2peW5 zkNl/SLfAzlMHPlMJdgCEg3FF8qWzMI4Qym/0= 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: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=mR2al1b3q/qEEfL60MOOCz1aBs3pkDqBw5hr0/P/uGs=; b=SmxgzATjQkCDUPWJ4UDzlk4XhM6Nw1velzs443pFPaYgBwQEErX7zm6Vqi4hxxR6HN GYB1viWJPeezSIXwEij1C5cJTWQm9v3JyAc3dJS1tSYVu8vkkzRVkmha3cHzQ7f4nGCg xGqi59GiY5B+zUdCoe0Yc4EHt4FYUoxo4nywc07eLTSpv7POC2EZZj63ZrRsjubTWYyC uJJGKtCCYLx0B7Ma0Zg0nJqOHrRuZLbMfQ5f55E+Tflynt+pf+kW7PQ3jnQHL9WUmuJC 7Gic6Znd7k5MyL2Xj4cO/GYLE4DAjnVwiASdhuWVaVQNy7PSRcyUdtExDm1d6YnfIiRS pOiA== X-Gm-Message-State: APjAAAU4SoVDqCQnnIpQPGu0S1x79WHz5h5MK7rd1mE++g9ojeXAWN9t J1D8UNhGFQnMOlpVi6feOqxTp5QL X-Google-Smtp-Source: APXvYqzEGSpdFtmhMzZIMpFGyRnwoVs/FQOqdKPLoNbLNRCZsx38mNQxfiO2AsnyO9V3WRSSVsNhZw== X-Received: by 2002:a63:1c09:: with SMTP id c9mr2634412pgc.63.1561025294470; Thu, 20 Jun 2019 03:08:14 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:243:: with SMTP id 64ls1109357pgc.15.gmail; Thu, 20 Jun 2019 03:08:14 -0700 (PDT) X-Received: by 2002:a62:6844:: with SMTP id d65mr130707237pfc.175.1561025294039; Thu, 20 Jun 2019 03:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561025294; cv=none; d=google.com; s=arc-20160816; b=Lx81y2VzOQqpwiwf75qB387fLiIhs+R+KULKM9oDBW8E0UVhh9AuMMPtr91+P5yfb0 x2xBK7rb/PZobYPNmJk9xTlF4CXMzz4mbRRld3gDP27KDtr1GH8Ea6APCGM6hb50aFX3 e3ke94reLiUsTg9xX2s5+zr2jJoJ8xluF3EV9NGV67AW4tOjgy+lBjjtz2WBlJ9cse/D cvupGikBrDQ6gWQxw1hnBItOGlSYugsSfEQvQXTTwedI3Ik3r72Er24D+dD6ACQupNrA tz61MLBd+kT7pqqW7/aT2eYTjl28dc+hlchswpYgLYzqA6Jce6mXn16GMM7tbgA/m9x/ wkbA== 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=WyK+VrPSIT7CeTUpydw/eTXwdpjjMnF6cxvPbpeUd8I=; b=u8tCAOiQVpG/aLE9O0X83LwefU+XWoF02U4uG6M1kNiSkE4j1EIkAB1zB3WXRTK+Q2 pIYaMm4jpQbLIQmhtTVAY/bv438gZWB7mZc6UQMcCG7ak13W/CLnTiC65OA8VWTnrf24 PGVLOe4Xd2vOEJPFCq0PGNuzM9UOACC1syHoIvwNgdehIvjMgYhsz8QACRNy2lh5RFO7 ywF5fnGDGAetiC6TaZzoiJfld/6GcHKa+gRyZMFOgqyOgFtes4e9PmfrWOUMJjZ1eT9T NtlUtLF8BMdjbykMTku8phISJkzyyHO1lI0HggJv7QGwtrotJ3Z9/dojis/CxddCEVoX LcAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DbHY1y1t; 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 t6sor16556621plo.20.2019.06.20.03.08.14 for (Google Transport Security); Thu, 20 Jun 2019 03:08:14 -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:aa83:: with SMTP id d3mr99901332plr.74.1561025293687; Thu, 20 Jun 2019 03:08:13 -0700 (PDT) Received: from localhost.localdomain ([183.82.229.140]) by smtp.gmail.com with ESMTPSA id x129sm21731387pfb.29.2019.06.20.03.08.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2019 03:08:13 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , u-boot@lists.denx.de Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v4 5/6] board: puma: Get bl31.bin via BL31 and rk3399m0.bin via PMUM0 Date: Thu, 20 Jun 2019 15:37:39 +0530 Message-Id: <20190620100740.6560-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190620100740.6560-1-jagan@amarulasolutions.com> References: <20190620100740.6560-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DbHY1y1t; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , Right now puma rk3399 board need to copy bl31-rk3399.bin and rk3399m0.bin into u-boot source directory to make use of building u-boot.itb. So, add environment variable - BL31 for bl31.bin (instead of bl31-rk3399.bin to compatible with other platform BL31 env) - PMUM0 for rk3399m0.bin If the builds are not exporting BL31, PMUM0 env, the fit_spl_atf.sh will notify with warning about which document to refer for more information like this: WARNING: BL31 file bl31.bin NOT found, resulting binary is non-functional Please read Building section in doc/README.rockchip WARNING: PMUM0 file rk3399m0.bin NOT found, resulting binary is non-functional Please read Building section in doc/README.rockchip Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- .../puma_rk3399/fit_spl_atf.its | 58 ------------ .../puma_rk3399/fit_spl_atf.sh | 94 +++++++++++++++++++ configs/puma-rk3399_defconfig | 2 +- doc/README.rockchip | 8 +- 4 files changed, 99 insertions(+), 63 deletions(-) delete mode 100644 board/theobroma-systems/puma_rk3399/fit_spl_atf.its create mode 100755 board/theobroma-systems/puma_rk3399/fit_spl_atf.sh diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.its b/board/theobroma-systems/puma_rk3399/fit_spl_atf.its deleted file mode 100644 index 530f059f3d..0000000000 --- a/board/theobroma-systems/puma_rk3399/fit_spl_atf.its +++ /dev/null @@ -1,58 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ OR X11 */ -/* - * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH - * - * Minimal dts for a SPL FIT image payload. - */ - -/dts-v1/; - -/ { - description = "FIT image with U-Boot proper, ATF bl31, M0 Firmware, DTB"; - #address-cells = <1>; - - images { - uboot { - description = "U-Boot (64-bit)"; - data = /incbin/("../../../u-boot-nodtb.bin"); - type = "standalone"; - os = "U-Boot"; - arch = "arm64"; - compression = "none"; - load = <0x00200000>; - }; - atf { - description = "ARM Trusted Firmware"; - data = /incbin/("../../../bl31-rk3399.bin"); - type = "firmware"; - arch = "arm64"; - os = "arm-trusted-firmware"; - compression = "none"; - load = <0x1000>; - entry = <0x1000>; - }; - pmu { - description = "Cortex-M0 firmware"; - data = /incbin/("../../../rk3399m0.bin"); - type = "pmu-firmware"; - compression = "none"; - load = <0x180000>; - }; - fdt { - description = "RK3399-Q7 (Puma) flat device-tree"; - data = /incbin/("../../../u-boot.dtb"); - type = "flat_dt"; - compression = "none"; - }; - }; - - configurations { - default = "conf"; - conf { - description = "Theobroma Systems RK3399-Q7 (Puma) SoM"; - firmware = "atf"; - loadables = "uboot", "pmu"; - fdt = "fdt"; - }; - }; -}; diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh new file mode 100755 index 0000000000..420e7daf4c --- /dev/null +++ b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh @@ -0,0 +1,94 @@ +#!/bin/sh +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2019 Jagan Teki +# +# Based on the board/sunxi/mksunxi_fit_atf.sh +# +# Script to generate FIT image source for 64-bit puma boards with +# U-Boot proper, ATF, PMU firmware and devicetree. +# +# usage: $0 [ [&2 + echo "Please read Building section in doc/README.rockchip" >&2 + BL31=/dev/null +fi + +[ -z "$PMUM0" ] && PMUM0="rk3399m0.bin" + +if [ ! -f $PMUM0 ]; then + echo "WARNING: PMUM0 file $PMUM0 NOT found, resulting binary is non-functional" >&2 + echo "Please read Building section in doc/README.rockchip" >&2 + PMUM0=/dev/null +fi + +cat << __HEADER_EOF +/* SPDX-License-Identifier: GPL-2.0+ OR X11 */ +/* + * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH + * + * Minimal dts for a SPL FIT image payload. + */ + +/dts-v1/; + +/ { + description = "FIT image with U-Boot proper, ATF bl31, M0 Firmware, DTB"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + data = /incbin/("u-boot-nodtb.bin"); + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <0x4a000000>; + }; + atf { + description = "ARM Trusted Firmware"; + data = /incbin/("$BL31"); + type = "firmware"; + arch = "arm64"; + os = "arm-trusted-firmware"; + compression = "none"; + load = <0x1000>; + entry = <0x1000>; + }; + pmu { + description = "Cortex-M0 firmware"; + data = /incbin/("$PMUM0"); + type = "pmu-firmware"; + compression = "none"; + load = <0x180000>; + }; + fdt { + description = "RK3399-Q7 (Puma) flat device-tree"; + data = /incbin/("u-boot.dtb"); + type = "flat_dt"; + compression = "none"; + }; +__HEADER_EOF + +cat << __CONF_HEADER_EOF + }; + + configurations { + default = "conf"; + conf { + description = "Theobroma Systems RK3399-Q7 (Puma) SoM"; + firmware = "atf"; + loadables = "uboot", "pmu"; + fdt = "fdt"; + }; +__CONF_HEADER_EOF + +cat << __ITS_EOF + }; +}; +__ITS_EOF diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig index 03f0bfdb59..ebc78fb216 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -15,7 +15,7 @@ CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEBUG_UART=y -CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/puma_rk3399/fit_spl_atf.its" +CONFIG_SPL_FIT_GENERATOR="board/theobroma-systems/puma_rk3399/fit_spl_atf.sh" CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb" CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_CPUINFO is not set diff --git a/doc/README.rockchip b/doc/README.rockchip index 5680c075fa..0ee54cd00e 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -137,8 +137,8 @@ For example: => cd arm-trusted-firmware => make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31 - (copy bl31.bin into U-Boot root dir) - => cp build/rk3399/release/bl31/bl31.bin /path/to/u-boot/bl31-rk3399.bin + (export bl31.bin) + => export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.bin For rest of rk3399 boards. @@ -162,8 +162,8 @@ For example: (export cross compiler path for Cortex-M0 PMU) => make CROSS_COMPILE=arm-cortex_m0-eabi- - (copy rk3399m0.bin into U-Boot root dir) - => cp rk3399m0.bin /path/to/u-boot + (export rk3399m0.bin) + => export PMUM0=/path/to/rk3399-cortex-m0/rk3399m0.bin - Compile U-Boot