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 603F2C433F5 for ; Wed, 16 Feb 2022 08:55:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 281F0834E4; Wed, 16 Feb 2022 09:55:25 +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=1645001725; bh=5Dq9rKevNKiBOvfRZnq88lUU13eD9ahgigHoSVTARlw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Cnppl0QqHXUWZWw7OEEdOio98jH261SijkBUpUB7z5/EQjFlL8wAdE/i1a+FXNUJD WZfi/nNL7qoNOi6HM4ctZznNK+c5yXFKPO3Rc0ZK10hWkoePVjhsE3eEM+oNoPbIsX S2Vd538MAksf3AYXSlDKHzNBJWTOo9vYZIrli4CGIuNSicmcxZnURlxXsyOm0TidWa sdDTlD74N4GyHT1t9+gXIYTjolWbVlAs8gdiHBK/nNo/8yo6sr6OLQLbL353uWFTrh pVXFfpJ0fgAD8XXI2CpOLl/BJcuyY1qwzcl6fFfEbDw5vJjXO0WcGme9Erm/b1zCwb IAkl+Wa38mAVA== Received: by phobos.denx.de (Postfix, from userid 109) id 6913483824; Wed, 16 Feb 2022 09:55:23 +0100 (CET) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (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 48E0380F68 for ; Wed, 16 Feb 2022 09:55:20 +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 smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3: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-107.mailbox.org (Postfix) with ESMTPS id 4JzBcR64z6z9sTk; Wed, 16 Feb 2022 09:55:19 +0100 (CET) Message-ID: Date: Wed, 16 Feb 2022 09:55:15 +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> <20220215131125.27598730@dellmb> <20220215130447.vxokuwtaiwqumgfw@pali> From: Stefan Roese In-Reply-To: <20220215130447.vxokuwtaiwqumgfw@pali> 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 14:04, Pali Rohár wrote: > On Tuesday 15 February 2022 13:11:25 Marek Behún wrote: >> On Tue, 15 Feb 2022 00:28:34 +0100 >> Pali Rohár wrote: >> >>> In function build_mem_map() prepares also mapping for CCI-400 and >> * prepare >>> AP BootROM address space. >>> >>> A53 AP BootROM by default starts at address 0xfff00000 and is 16 kB long. >> >> RVBAR_EL3 register has value 0xffff0000. The BootROM is 16 KiB long but >> the window is 1 MiB long, so the content repeats every 4 KiB. >> >>> 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. >> >> As we talked about in private conversation, I still don't think we >> should do this unless it is needed. >> >> CCI may be needed to be mapped if ever there is some driver that needs >> to interact with it. >> >> BootROM is never needed by the U-Boot code. >> >> I really don't think that we should map these in production U-Boot >> binaries for everyone, when the intention is "for debugging >> purposes only". In the last 4 years there were 2 people (me, and you >> :)) who were interested in BootROM. In the next 10 years there will be >> maybe 2 more. So I really don't think the windows should be mapped for >> everyone. > > I looked at this stuff because other people asked me about possibility > to dump BootROM. So it is not "only me". > > Anyway, the main issue with all this stuff is that there is no public > documentation for it and things which are missing in U-Boot would be > missing forever (because there are only few people with access to > documentation; which is even more incomplete, inconsistent and > incorrect). So adding this stuff may help other people from community > who would like to study this platform or code. > > Note that, by default U-Boot has already enabled 'md', 'mw', 'pci' and > so other commands which are intended for debug purposes only, so I do > not see reason why _in this version_ cannot be mapped also BootROM code. > > In _production version_ where is no debug capability and no access to > any memory (just ability to boot) is is probably not needed, but none of > A3720 board is building this kind of version (by default). And in case > BootROM is mapped also in these versions, is there any issue with it? > BootROM is read-only, same in all A3720 SoCs, so by this definition it > is public and everybody can inspect it... > > Stefan, what do you think about it? Frankly, my first thought was similar to what Marek expressed. Do we really need this? But I also see your point and from the "security" point of view, I don't see that the system get's more insecure by enabling access to these areas. And at least I myself have been happy to have all kind of debugging possibilities enabled in U-Boot per default. So to sum it up, I'm currently in favor to accepting these changes right now. Thanks, Stefan