Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4612FC433F5 for ; Wed, 16 Feb 2022 08:57:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C0DF283824; Wed, 16 Feb 2022 09:57:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1645001824; bh=wE8LmN9binP3cXfFESWllwe2BcANcn7ORLGJf4+n91k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pEHgKhQQnhoaSfzgA8Ux5MrYna0xJqffTdEfGGyG1WpRFoYidB+red8+uSm850JL1 FLcwMWdGXz7u4qFSgOgcidgJAagIREILwQ7P387mg/lpHOdA5wv0WY/X1hzXuZV9Xn SG+InP3/dPHT0qgL5aQLb9RuSx2/p3A2kjgFOZelAmiS8qb7Qps3oA5cUoPHMWEOFo PXdmcXjfl48+A//3UABFrIX2nfQ6vPkfJNjelPr/CoA/wT+byPjxSXSh0R5FkXtmxx Gn3/pOHQmwqSDjZ30FnUbuCe4SA0lzq8PjqkA96DRq8V9yB6A+yK8wW3Jo0cpjkuG6 /1pI5PX3iV/bw== Received: by phobos.denx.de (Postfix, from userid 109) id D7C89839EC; Wed, 16 Feb 2022 09:57:00 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:1::465:204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6661E834E4 for ; Wed, 16 Feb 2022 09:56:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4JzBfJ75n3z9sR6; Wed, 16 Feb 2022 09:56:56 +0100 (CET) Message-ID: <9da989fd-d491-227f-9948-c8997ce6a7d2@denx.de> Date: Wed, 16 Feb 2022 09:56:52 +0100 MIME-Version: 1.0 Subject: Re: [PATCH u-boot-mvebu 2/3] arm: mvebu: a37xx: Map CCI-400 and AP BootROM address space Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , =?UTF-8?Q?Marek_Beh=c3=ban?= Cc: u-boot@lists.denx.de References: <20220214232835.12924-1-pali@kernel.org> <20220214232835.12924-3-pali@kernel.org> From: Stefan Roese In-Reply-To: <20220214232835.12924-3-pali@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean On 2/15/22 00:28, Pali Rohár wrote: > In function build_mem_map() prepares also mapping for CCI-400 and > AP BootROM address space. > > A53 AP BootROM by default starts at address 0xfff00000 and is 16 kB long. > CCI-400 in new TF-A version starts at address 0xfe000000 and is 64 kB long. > > Physical addresses are read directly from mvebu registers, so if TF-A > remaps it in future then it would not cause any issue. > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > arch/arm/mach-mvebu/armada3700/cpu.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-mvebu/armada3700/cpu.c b/arch/arm/mach-mvebu/armada3700/cpu.c > index 9da0d08f947c..e01fea130022 100644 > --- a/arch/arm/mach-mvebu/armada3700/cpu.c > +++ b/arch/arm/mach-mvebu/armada3700/cpu.c > @@ -40,8 +40,10 @@ > #define MVEBU_CPU_DEC_WIN_REMAP(w) (MVEBU_CPU_DEC_WIN_CTRL(w) + 0xc) > #define MVEBU_CPU_DEC_WIN_GRANULARITY 16 > #define MVEBU_CPU_DEC_WINS 5 > +#define MVEBU_CPU_DEC_CCI_BASE (MVEBU_CPU_DEC_WIN_REG_BASE + 0xe0) > +#define MVEBU_CPU_DEC_ROM_BASE (MVEBU_CPU_DEC_WIN_REG_BASE + 0xf4) > > -#define MAX_MEM_MAP_REGIONS (MVEBU_CPU_DEC_WINS + 2) > +#define MAX_MEM_MAP_REGIONS (MVEBU_CPU_DEC_WINS + 4) > > #define A3700_PTE_BLOCK_NORMAL \ > (PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_INNER_SHARE) > @@ -104,8 +106,26 @@ static int get_cpu_dec_win(int win, u32 *tgt, u32 *base, u32 *size) > static void build_mem_map(void) > { > int win, region; > + u32 reg; > > region = 1; > + > + /* CCI-400 */ > + reg = readl(MVEBU_CPU_DEC_CCI_BASE); > + mvebu_mem_map[region].phys = reg << 20; > + mvebu_mem_map[region].virt = reg << 20; > + mvebu_mem_map[region].size = 0x10000; > + mvebu_mem_map[region].attrs = A3700_PTE_BLOCK_DEVICE; > + ++region; > + > + /* AP BootROM */ > + reg = readl(MVEBU_CPU_DEC_ROM_BASE); > + mvebu_mem_map[region].phys = reg << 20; > + mvebu_mem_map[region].virt = reg << 20; > + mvebu_mem_map[region].size = 0x4000; > + mvebu_mem_map[region].attrs = A3700_PTE_BLOCK_NORMAL; > + ++region; > + > for (win = 0; win < MVEBU_CPU_DEC_WINS; ++win) { > u32 base, tgt, size; > u64 attrs; Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de