From patchwork Thu Dec 5 10:11:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1204558 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GYarVOmo"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47TBPF0v7Tz9sPL for ; Thu, 5 Dec 2019 21:13:01 +1100 (AEDT) Received: by phobos.denx.de (Postfix, from userid 109) id 3E3FB81682; Thu, 5 Dec 2019 11:12:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F17A801A4; Thu, 5 Dec 2019 11:12:19 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: mail.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GYarVOmo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F40C8807F8; Thu, 5 Dec 2019 11:12:15 +0100 (CET) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 014AB801A4 for ; Thu, 5 Dec 2019 11:12:12 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pf1-f195.google.com with SMTP id n13so1406599pff.1 for ; Thu, 05 Dec 2019 02:12:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=RtQl2eJU8bSgcpPshJQyo65HLkKhcnZhQykGoTFC+nU=; b=GYarVOmoeWWMXjIqFazZnS9FtfcRgd5xK/3iPPgFwHd3cNShsZH3Pyfyum9SMqHUU2 jpzALmomMFvcaMZGi/AXX3D0kqhUo0hB9jEchrLm5NvcOd3Tbtw6sSuV2Ol3U4eBlkVX uRvQKkahkfxB7njwVRkHnaNEaLoy3CHSgzpqe7fORJptKKTqBKpjaXBuv2CqIWCXSFsI jhDrQY0mZtOmYtiGQmlooYFD845AyEbPQwHaQrcpK099Yhv5oFeYgWxmtjPb/i4Yk8SG ohFhPNh00Lmnn5CKM0t2DrjaIdJqVDHsAd4mA8TzGCh1VdDcQu46+7HjTyDg1MvYTLp8 d2qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=RtQl2eJU8bSgcpPshJQyo65HLkKhcnZhQykGoTFC+nU=; b=Xa06IKMeRUiZQ6GsbjQBdP8BuqMeTX8v/GWzxm4TyyxYScnb4G5ni1aDbS/37jdRIo sSgGb6dhLJr8znQpjtcXoA2iJgg0nMGFKErzduIzA7zTWjg+s5NG26X4Eds1aOeBHk/4 NiDTD6iowdZzpN2J9wmF1xxhNg8QPAxuSok19fk++Yqodc53jQtS5ilPHV9kS7+eATLY XgpOHopA5lJZiIbWYDhjvpDym6e0HBnwwr7Yi7to64RBmTy1JIxYVBsrRRtxF6HujS4O 6W0VKEYaD3gubGOGRhoy1lVpsk8IphUOTSnXY7T9ZQgWZnthpbsqPjRF36ZoAFaUsBJu ftKA== X-Gm-Message-State: APjAAAXYpXlCbmdLNtoIDBTGdfvkLjvvQcUrBrlgUmcFCUSL7NbQpmKb 0UhdnoKf1cm/L3+VLLD57hfaXdpD X-Google-Smtp-Source: APXvYqzUvngHkOMg1SBkAf1PZlj82ssqkR25LUChV0pG/03idA95coYI5b/yBJ8w1jkdpA0PpzkXIg== X-Received: by 2002:a63:ed56:: with SMTP id m22mr8393339pgk.261.1575540731023; Thu, 05 Dec 2019 02:12:11 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 9sm11880870pfx.177.2019.12.05.02.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 02:12:10 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Subject: [PATCH 1/4] rockchip: fit_spl_optee: get text and optee base from build Date: Thu, 5 Dec 2019 18:11:52 +0800 Message-Id: <20191205101155.29877-1-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 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" X-Virus-Scanned: clamav-milter 0.101.4 at mail.denx.de X-Virus-Status: Clean Instead of hardcode the base address, we can get them from the build output, eg. get the SYS_TEXT_BASE from .config and get optee base from DRAM_BASE. We can use this script for SoCs with DRAM base not from 0x60000000(rk3229 and many other 32bit Rockchip SoCs), eg. rk3288 DRAM base is 0. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/fit_spl_optee.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-rockchip/fit_spl_optee.sh b/arch/arm/mach-rockchip/fit_spl_optee.sh index 89ef04312c..4118472d9f 100755 --- a/arch/arm/mach-rockchip/fit_spl_optee.sh +++ b/arch/arm/mach-rockchip/fit_spl_optee.sh @@ -17,6 +17,12 @@ if [ ! -f $TEE ]; then fi dtname=$1 +text_base=`sed -n "/SYS_TEXT_BASE=/s/CONFIG_SYS_TEXT_BASE=//p" .config \ + |tr -d '\r'` +dram_base=`sed -n "/SYS_SDRAM_BASE=/s/CONFIG_SYS_SDRAM_BASE=//p" \ + include/autoconf.mk|tr -d '\r'` +tee_base=`echo "obase=16;$(($dram_base+0x8400000))"|bc` +tee_base='0x'$tee_base cat << __HEADER_EOF /* @@ -39,7 +45,7 @@ cat << __HEADER_EOF os = "U-Boot"; arch = "arm"; compression = "none"; - load = <0x61000000>; + load = <$text_base>; }; optee { description = "OP-TEE"; @@ -48,8 +54,8 @@ cat << __HEADER_EOF arch = "arm"; os = "tee"; compression = "none"; - load = <0x68400000>; - entry = <0x68400000>; + load = <$tee_base>; + entry = <$tee_base>; }; fdt { description = "$(basename $dtname .dtb)";