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: 1092206 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="HMDKtnBu"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44sMXD5sPpz9s7T for ; Sun, 28 Apr 2019 19:13:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 77C96C21DF3; Sun, 28 Apr 2019 09:10:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 622A5C21E77; Sun, 28 Apr 2019 09:09:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3C8E2C21E9F; Sun, 28 Apr 2019 09:09:56 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by lists.denx.de (Postfix) with ESMTPS id 4054CC21E44 for ; Sun, 28 Apr 2019 09:09:51 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id k19so3719913pgh.0 for ; Sun, 28 Apr 2019 02:09:51 -0700 (PDT) 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; bh=li9nH1roxv2V7T2EQJmhqDJtQbBwjK8kdiN9IGNeDmA=; b=HMDKtnBuyPZ2W4R2e7C2nZuzxozVxukiYZTGBSNxsKEQF24c/+1vzJZN3j7lPhTKHR abPuWLEvMt1UwZFtR0IyN5ZEZd2MTI5I0d/5wfijc1GwT2YxeV6i8aix1B8hypXrGZdM P3jPx1D/MYQwCeGH2sFdIkLi8HBK1xsmU3hL0= 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; bh=li9nH1roxv2V7T2EQJmhqDJtQbBwjK8kdiN9IGNeDmA=; b=jQwJGgPw8V1XKL+X5DH/Eyn5HR/LbLiQMVn7bz0GQjG+0VOcl11TCsfyxtHc59vOxs VPDQjC0sXzJZb5LUKx5sAnP91fvsZIXKvCDN7GC36itt7uKNlLcTPxDdM/50/MP/ok+n qSA/rFR9B4dVWAqt0/B7OTPR1r+diNOdJ/ORxlEYuyA0GoCiHntmlOBiq7NUwI5QpzZw gk7OYdp66TrR+TImIDnBT5+008E+p0KHf4xozINfsN/OxvxOA6TMxLWcliqQdFAL8igY WT+5yS1T99KdW4inA1gBzLpwXYfH0vr3UHso1JEmjruVO+8L1iB+ymLwb/a+bAqmTGPa yJbg== X-Gm-Message-State: APjAAAV9ZXP4oD1oZnzYUu4VcKyh8ngsDLGCTs41BaIqoEx5CUE+1C6H sMEf6FPL+mBgMomddOI1nZpirifXnME= X-Google-Smtp-Source: APXvYqySz9T2qrUNB8bPEV7japR/JlCrUPV2OiQr/BUzEjxh2WHv+NBatq4yQig7kLWg6MeVYqmYDQ== 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 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 Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 5/9] board: puma: Get bl31.bin via BL31 and rk3399m0.bin via PMUM0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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