From patchwork Tue May 7 18:52:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 376 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 182CC3F085 for ; Tue, 7 May 2019 20:53:27 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id f8sf10425058pgp.9 for ; Tue, 07 May 2019 11:53:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1557255205; cv=pass; d=google.com; s=arc-20160816; b=siYiGq6qZ/qsqt9cDjlbLaLPxPyZT1imAZzxOKBat+mKYO/vH6DkxAxHYSjw/s/e4p YwhbG5vgetOKvnHniIrGe2hj2oqNeIB2Z9vwC/265tiTTRpPMzpB8Mus7J/n7vJnZR4H 4m3jsAAN1Apzv4MjD063GLi2epdMa2S/w/6I/+ArP6rydph5E4iuUUz1ZE/Vo3tP04hh 5CGujB06v+cGkHNnMQhFSD9SvXStCnfm7qj/rT4LdxPmx5w/573o4RYr+dS4xTX5tXiu H+GJRKc9tbeSHtd3SjbHGLAxgIZw5yM952AYseClOBu3sS9NguTadEn+KrrhN+Fkg5Xc L4FQ== 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=RGnu4JHnK5DAzvvjZ0LLUBEKbi3ycGwZCzA9lfUmWLk=; b=EsS2gR4tBM5fUryopBRkkKdjts4niRN2ZHMPGZj2b6ttBv9uPkbemb4xBHgXeOyFti xGvT3LsLIk3a8fRZhLblibUaa5GqGntca59LnGVT9mIClmETkhmonrvyXOkwzP2stTy0 A0VQUkrepp4tAP+hMm8Ngpq3Mq+8r9YAFP4XU8UkiYefo0mT9YxrLw7vty546HNLTx4I o2E/PikU2/UnY9WanfdEd5gTIF0Bp3HPodXuacBe/QXdm0Edf22I9d3n6fIjDKLyNE1N XgUX/2ojJbHkZZqavO5+ptQPmihe44m+j8Q/M72YPUCZghcEXFZZP6QQE6IqsDEzorQd aoeg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JtxEDEWP; 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=RGnu4JHnK5DAzvvjZ0LLUBEKbi3ycGwZCzA9lfUmWLk=; b=hNrQuWom4bj4J90cZp+S8s8HC3k9c1w0USDEIWCsU0MVXSl4dJV34JS05KLU5lz1gD 6XVYHZBBGXDO3a12geaqMGi/LFpW/Ek7Z/7K34agK/WxB3DvtykBCzbcm9NOUCUPm0qQ FERXxrlk0cn/zh/v5LAGknar3XMWzJZdR32TM= 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=RGnu4JHnK5DAzvvjZ0LLUBEKbi3ycGwZCzA9lfUmWLk=; b=FMRtAVNgKL+eq63SQAkT5bjb9LkeTws4/DRkPW7o/iRxcBT0oLOYJna9e48HwQiPzR 74XgJIG7eczHOBE3yLz35+iEzOwsCMqqrBzzxUs2qDEJNKqRSiVh0N0mfnJ/WnqCR9zR I4mItafr3oaMzgG++2YMpTmx+NmrWrCfoLK1vK2pdB6neVnlhcFTQSOgoH82Rv4pyzuN Xv6JlRqwo+Dnr1pdnSkBZioAD+y+nxeATeaF/OhXl4eMtiFjZ3xjE/pBknUSB+hAeNO/ nHuZeaoJl8CgzAEPNSPjKY0uYl3YudwvihJZ47RnILLZE7M4b+K3ij55+tvs1NGJo0er I6ZQ== X-Gm-Message-State: APjAAAWo2ehbGs9Mutat/P6j95ZP/wcyImC7LNHJj0j3zMet9D4Pi5y7 PQ6NpeUcs0/Xz/vB9ZK4X8Dk44DX X-Google-Smtp-Source: APXvYqw0dvC200V36lOEMsBkUFnF66DuNIID6KbOuVT25ggy/PofWfiU61PqLCv+e8KxrNFu1kjmEA== X-Received: by 2002:aa7:8b88:: with SMTP id r8mr42559803pfd.174.1557255205683; Tue, 07 May 2019 11:53:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:9ae3:: with SMTP id y3ls502851pfp.6.gmail; Tue, 07 May 2019 11:53:25 -0700 (PDT) X-Received: by 2002:a63:cf:: with SMTP id 198mr40001097pga.228.1557255205306; Tue, 07 May 2019 11:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557255205; cv=none; d=google.com; s=arc-20160816; b=cLFZ6rVYv5QOzBReCTCFeiB9GI1QC1VnvLSeNVrGvhV2k8cnJqpjjXiqf77m30ha3A /5kxogJO/StOr6FLVYXDtb0+UGgukOfM8pr73xA/Tm3JnXmKnTYB9WJozZ9XmoJCmGPb IlJcngI0Hd9hMbfQm1NLqxYw9ipX0A7rncWc64mFhE4lsHf1Pk3byP4wckzeoJHlRU4+ z+tj4fCJYHepCYyTzSDf6v0lWZzL53i/pRqPjq5oexlXjMWTDX4wYttQix4mR/WbZ2UT S6XZrU2mxMgTElwNWyULKqhKT4nHUlQjKlFeKEFSXQssrkK5uyaOtaILvMp1bIfFOIVW TQKQ== 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=a8TL1A8mko6vB61txBIgdGp5GFnZlWXk1NU1ryfITfM=; b=BDhW+kslIjFm69JNlo6yEPRwUWrcBhFHO4MeMYIs4nw0oalppygkPqo+lUlYbVR8WZ FP6w7r0d09RJUkJISNo+tI9lykRutcxxrojuTEEJ36JI2yAn8GmcV2RG6U9jmIXFCKyB i+G2nuFkxbVgCwhgPjsgeFGgYH0YyNQATX/mAybggqqBqAXtGsBImMjfM46WxLUYUbt6 1v3T+iBH4Klz12MykIDOSDwdBCm4Zo3vWA6Z+9J0gs3yt3wfFdXIEP0+/K8wVIX8PX1g adHNsaCweLD7G1Lox/1/h2ncnkODY9aD9B9Krbc+jDf3lwF5ssJIKH9u7VdsX9ZTVG7X A2XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JtxEDEWP; 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 f123sor16314546pfg.13.2019.05.07.11.53.25 for (Google Transport Security); Tue, 07 May 2019 11:53:25 -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:aa7:8384:: with SMTP id u4mr42134083pfm.214.1557255204939; Tue, 07 May 2019 11:53:24 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id l83sm14668086pfi.150.2019.05.07.11.53.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 11:53:23 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, u-boot@lists.denx.de, Jagan Teki Subject: [PATCH v3 5/6] board: puma: Get bl31.bin via BL31 and rk3399m0.bin via PMUM0 Date: Wed, 8 May 2019 00:22:14 +0530 Message-Id: <20190507185215.15441-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190507185215.15441-1-jagan@amarulasolutions.com> References: <20190507185215.15441-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=JtxEDEWP; 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 --- .../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 98a3824e2c..88a4593392 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