From patchwork Sun Apr 28 09:09:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 311 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A80303F08F for ; Sun, 28 Apr 2019 11:09:51 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id j18sf5314798pfi.20 for ; Sun, 28 Apr 2019 02:09:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556442590; cv=pass; d=google.com; s=arc-20160816; b=i6h4xgtOlnI3eFLXlpbBxZ9Qz2Z4YpF1sJ7DuIeC67MmyBCNDOfszHWnuzwE6PIw6F 5G7rt6nUjlUI9Pp7yZag/Q+pcIYDJudfa9nUKa9ysR6nRKGJqPIfq+ipP7II5LbxhFPu n8HZc5O0yF2rGDOgTTfNolWHKZvVs2o/Yj/w1Uc4SP3ILCQcTZ6o8YKqL3+vZdx59A00 I/1t8xNey2bXrXlFl6C0WgWb5c5kpj6ppXvF9BZhpIpw/6ZKUKjCSXXfeSWZnqv8yz5a avu7HnnBq9cV6mZBMu9Dhd7JyuTuxPQeWZuFnu7lPdY66n+EEP7q1fcZHBo0232aZ8yl XReg== 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=W0cdO0MiAei2hbez/vdElQDObxM1TmrFY7c0zesfHlM=; b=TB0t5Bq7oAo3D+SxaqEOWKjBpkuNZpNTZmDUQcvsdn/uvDPi3g3N/luX7jMb49jvew v5+gM+AXZY4ZmzOwIp+E2yxhZawyjG0n0yGe3jxsrIcCxygtjW/qJGeCjWZoLzYpb7fa 6gcpnhU5XIEmAREvHeWZ+1DB1ToydcoGl3o7CACyq8DQHWVZCbTyTCMLLLXhu/2rt7gs +K/Ia8oAw7li4DighGfuXfhJdxJNDlIA0cTG3uiaiahoOcBRlaWgCSCpQy0hD97gGxMC 1WdAYlFeXQRVzgJA+/mmdj9FLnXSFsmRWj/SZe4eZAxVdsxNgqQSFuy9iVIsN4+2S1CZ sJdw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HMDKtnBu; 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=W0cdO0MiAei2hbez/vdElQDObxM1TmrFY7c0zesfHlM=; b=Ir/+trT47GjduOsPY1BRFQd3nHqjKbd4IAaHAQgdtFnbLiQUYg5Vj3ac+Nf1t3wi5J 67sBPwLWrvA4PT3l0J/cu2iUCIJ1Kdr2vtew69B66kL24mMCii/FN+SiDqAXqzJcG66i kGqFDu0kE40eNEoTr7rVpBrwbGtw/rQmJ4B28= 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=W0cdO0MiAei2hbez/vdElQDObxM1TmrFY7c0zesfHlM=; b=ZpelDK8ziikG/xuMV9VvgyuStHZ7lxTV7/1JyF8f/9Ppaj2pdZaZVrGctT4TTnihq1 XpWED6/LQCA55J1S6Rt1S+ynxKKFjjTEwik6rMUry6waoZUHgm+rFjyg7TGe3US71VB6 uuzaue5RVCX8WMClV/nl/Len+qrA1LMubMbBC7/cNLTOEKtc4HllT1f0Xxvpdxhkv6wj czghFejXEzN8WT7PPVnNqMDtBuMm9ptV3er+FDi3522RxxkNO6wFWYTFKdQcAnuZ4Ljn WVYCa28tBCzEwiYyGNQqTDOUYxXK90KuAqoqS35u0ix2bAd2FYVbnQkWhg61HqrOHy4m pCrg== X-Gm-Message-State: APjAAAUPQynKdVkyby6pR5e/qEPGyZOQ1PD+mKADpohQtzD9kcfa5afw cQd5HctpCT9yRKOag976b2okQknl X-Google-Smtp-Source: APXvYqyPqf4MQ+nGy9kJrGN+Dn9LTx7CiftR9Eed5pdCY1WbQ+IvjAqT0nmPPFDC8y02LQjq9oW0vA== X-Received: by 2002:a63:5012:: with SMTP id e18mr52256901pgb.383.1556442590468; Sun, 28 Apr 2019 02:09:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:144:: with SMTP id 62ls7138361plb.8.gmail; Sun, 28 Apr 2019 02:09:50 -0700 (PDT) X-Received: by 2002:a17:902:ab89:: with SMTP id f9mr14789133plr.151.1556442590151; Sun, 28 Apr 2019 02:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556442590; cv=none; d=google.com; s=arc-20160816; b=eGa+FUj3cth93N7ZVyiyItL/ZsLvGnpowAtu7ZSZ+GgMAJ0xuIzg2hoEXlwUhTUP5b XeiIcNQHagopoMsQuWdc2oD7M9x6JAz68ugHQyovKp1cqrTa1Qga+J0QF5yyyukWKn90 26gtwHD0ttxWiSjEOgL1RDu8y5tNQMrge+9m1AYgqrNDWSiDDO2P7RqC26SivdO0S9Kq hA5FCIo8TgrWL5PAD9p0NLz4CEr/8jH21Vpf178AEtLix4ZUVIzFRji9GxO7lSFGy7Ww G8/lMBdGRRNR95JiFF1a4aIZ43YOomWj59J9xTAlFAB50ruyxDlSM4wYnrzHremLLPcF i0Jw== 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=li9nH1roxv2V7T2EQJmhqDJtQbBwjK8kdiN9IGNeDmA=; b=jUUU0AMQXUrQP6Rp3ZO7YKpv15fOScZQSOBoH6YeVB6l1TReju8R5enYcAsS7qBd5y Lf8UstPEGR3hCfujxxYrIS74ZRlQcYokH2BFW/qCJRJipjdjB1iCBbxrzQO/C/AsvjWm Xcy+d8rnjcy6sDdf0LndHhWz90gc1EiI+3Ju5LFu67+1bWGRhbwo7KZhEXQ6U/41149w ZV66VsXqPWE1llNPfwknISm0r/7Zukm0hKFru+jJAP4QWwMJE2pwiJzqAZwVYxwy+Cx4 x8jvY7DuTZ7ithrm1oW2l+710VvpNvwHGNlDqkXrEFV9bQceLkWX0f6g2Ku8CJZ+0ADA BhTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HMDKtnBu; 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 3sor1212839pfa.24.2019.04.28.02.09.50 for (Google Transport Security); Sun, 28 Apr 2019 02:09:50 -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:a62:5542:: with SMTP id j63mr3253747pfb.34.1556442589829; Sun, 28 Apr 2019 02:09:49 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id k7sm3040338pfk.93.2019.04.28.02.09.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 02:09:48 -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 5/9] board: puma: Get bl31.bin via BL31 and rk3399m0.bin via PMUM0 Date: Sun, 28 Apr 2019 14:39:09 +0530 Message-Id: <20190428090913.10568-6-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 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HMDKtnBu; 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 --- .../{fit_spl_atf.its => fit_spl_atf.sh} | 46 ++++++++++++++++--- configs/puma-rk3399_defconfig | 2 +- doc/README.rockchip | 8 ++-- 3 files changed, 45 insertions(+), 11 deletions(-) rename board/theobroma-systems/puma_rk3399/{fit_spl_atf.its => fit_spl_atf.sh} (50%) mode change 100644 => 100755 diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.its b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh old mode 100644 new mode 100755 similarity index 50% rename from board/theobroma-systems/puma_rk3399/fit_spl_atf.its rename to board/theobroma-systems/puma_rk3399/fit_spl_atf.sh index 530f059f3d..517fad40a1 --- a/board/theobroma-systems/puma_rk3399/fit_spl_atf.its +++ b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh @@ -1,3 +1,31 @@ +#!/bin/sh +# +# 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 @@ -14,16 +42,15 @@ images { uboot { description = "U-Boot (64-bit)"; - data = /incbin/("../../../u-boot-nodtb.bin"); + data = /incbin/("u-boot-nodtb.bin"); type = "standalone"; - os = "U-Boot"; arch = "arm64"; compression = "none"; - load = <0x00200000>; + load = <0x4a000000>; }; atf { description = "ARM Trusted Firmware"; - data = /incbin/("../../../bl31-rk3399.bin"); + data = /incbin/("$BL31"); type = "firmware"; arch = "arm64"; os = "arm-trusted-firmware"; @@ -33,17 +60,20 @@ }; pmu { description = "Cortex-M0 firmware"; - data = /incbin/("../../../rk3399m0.bin"); + data = /incbin/("$PMUM0"); type = "pmu-firmware"; compression = "none"; load = <0x180000>; }; fdt { description = "RK3399-Q7 (Puma) flat device-tree"; - data = /incbin/("../../../u-boot.dtb"); + data = /incbin/("u-boot.dtb"); type = "flat_dt"; compression = "none"; }; +__HEADER_EOF + +cat << __CONF_HEADER_EOF }; configurations { @@ -54,5 +84,9 @@ 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 e5ea2fe0b3..98b2dd6f02 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -15,7 +15,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEBUG_UART=y CONFIG_NR_DRAM_BANKS=1 -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