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: 10933615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 687E114DB for ; Tue, 7 May 2019 18:53:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5535E205D1 for ; Tue, 7 May 2019 18:53:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 494272891A; Tue, 7 May 2019 18:53:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 716802239C for ; Tue, 7 May 2019 18:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OyW5Vxy22f3cScV5lsEx62KLyELLw4YUx+u46UCalXc=; b=l7yk6WJMvst7RR l83cMRCOZLp6fvYMlsJMYaaJVCP94dzVxju3KqBVD5FNFGSZCCTaXrJ7pwSSfx8+u1+3ZGtP66Xsy siyDZOXm65KWSJsua6TV3t48+GLB0OtZQMP1IQgAEWJxiSodpp4tXUFvTV//Ba0d9NHi4mSBtr1CD V6pYdrVWyouOOMdz+vg3q2tv7spDCrJJ+eRBHMXt+IVeAnTfxEWnS1/Axl2v3ZN7+AKWQS3BaBQN4 pF2acvzJaK0n+RB9PRq1LH3HmKYx41VMd9nAGIOKnf4cP82FFailnQTOXETtLYr8HNccCQgEhjV5x oBLIQYrtD/5GDZeoarqA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hO5DV-0005zJ-3Y; Tue, 07 May 2019 18:53:29 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hO5DR-0005x6-M7 for linux-rockchip@lists.infradead.org; Tue, 07 May 2019 18:53:27 +0000 Received: by mail-pf1-x444.google.com with SMTP id z26so9117045pfg.6 for ; Tue, 07 May 2019 11:53:25 -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=a8TL1A8mko6vB61txBIgdGp5GFnZlWXk1NU1ryfITfM=; b=JtxEDEWPtlgLwT4Asd/HTk+jdTeTp0jBs8Iaj+2/75cJCFNwPH2od+/w3jE9YboLj3 vTQ+/laZ/FrPgWg5qJ/KJtnIKz0pB3h7bD/UrPDh4ugxnrmpSMSrLDaYiKMxDqVIli5s HzMyLtcJxuNQNDVnVOdY+YRLEhdMe0k1Lk4RA= 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=a8TL1A8mko6vB61txBIgdGp5GFnZlWXk1NU1ryfITfM=; b=fp7lg96417YFYu16KpI5Yr5Y4mUvwA+FM/Q17MZKGBvYxJ6yHEG8mUTfRD4qpJ8QtL NhH+OJdbTWucqD7u1CTjYH9D5iFPBq1aSm7qlGktiyRn6drQTX0pIlWXIflVochHl6DY dd+qVAHnnwTm8lTZ/jtDpyfBLF5EXB0LXsL/EgvS9x3vjaPuhiPbrl+Khs/Bj/8Snnsc iGn+8BEepMPfVmaRHJNUglBoUwcjS5TFbNDq2iLQjtDR5M94Xm/GnZuMVfU6r5zxSYHq MaccOtgP/ylpJ7ga5nDIJHtfAv2Kyyy6EleZeAVXCx7gg9TNtmNbIi5OcFftW/Lt1GE0 fcew== X-Gm-Message-State: APjAAAWxtVu0bgLQbZdbDG6HbLxEzbE0N6CwJ1PEsea5+S+WJeG+8QFn jAOm3BTGIVsLm8yWump9v0A4EA== X-Google-Smtp-Source: APXvYqwVr/idjLqOHpY4Qo4coT9GPLbsIVow9m1R3FnjhcSYPj7k1i2CMHWDvrjoYGCvQrV2GUlCKQ== 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190507_115325_725280_3284982E X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , u-boot@lists.denx.de Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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