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 98BF6C32772 for ; Tue, 23 Aug 2022 09:30:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ED3F48418A; Tue, 23 Aug 2022 11:30:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=walle.cc header.i=@walle.cc header.b="tP4TDMuU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3DC758418A; Tue, 23 Aug 2022 11:30:26 +0200 (CEST) Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) (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 F1F8E845ED for ; Tue, 23 Aug 2022 11:30:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 24EFF8DC5; Tue, 23 Aug 2022 11:30:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1661247023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TAqmjLD+Q3YpsP5PEmVOaAfqNvD2aGfVMEf210j0+uk=; b=tP4TDMuUmSMUjl41qy7QoqYfReNIHQ4AMstwb7XZ8Eh1d8hSsxnpWtcWqLrUH7NKZaFyye TfHOBrYP1MZkcfdgV3ikWD/f7b8k70P7aZhhIbqsUkwNCP8NAm5xlUW0/DxwzszrWquM98 4E1BcHyff/Wxn8sjZ++jTkclFnd0H7/SkUgGmTv+aIwxlD4h6P7zz8htJonmFURgr4H4Uf rSrHE9QPPvfZSLNtxzjhzDga1QmQ4Yqn+hTf6U3gncNMTT73iDFYEQl2la8wS2ZDFK69F+ 8YJ9C+UPnBFOMarTpW9juZ+cjHbhC7ofh31TZYmTS2nz5hERigyfEiAJcmf5Fw== From: Michael Walle To: peng.fan@oss.nxp.com Cc: u-boot@lists.denx.de, Michael Walle Subject: [PATCH v3 1/5] armv8: layerscape: spl: mark OCRAM as non-secure Date: Tue, 23 Aug 2022 11:30:14 +0200 Message-Id: <20220823093018.3157715-2-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220823093018.3157715-1-michael@walle.cc> References: <20220823093018.3157715-1-michael@walle.cc> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean By default the OCRAM is marked as secure. While the SPL runs in EL3 and thus can access it, DMA devices cannot. Mark the whole OCRAM as non-secure. This will fix MMC and SD card boot on LS1028A when using SPL instead of TF-A. Signed-off-by: Michael Walle --- arch/arm/cpu/armv8/fsl-layerscape/spl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c index 5f09ef0a4a..3a4b665f24 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c @@ -67,11 +67,24 @@ void spl_board_init(void) #endif } +void tzpc_init(void) +{ + /* + * Mark the whole OCRAM as non-secure, otherwise DMA devices cannot + * access it. This is for example necessary for MMC boot. + */ +#ifdef TZPCR0SIZE_BASE + out_le32(TZPCR0SIZE_BASE, 0); +#endif +} + void board_init_f(ulong dummy) { int ret; icache_enable(); + tzpc_init(); + /* Clear global data */ memset((void *)gd, 0, sizeof(gd_t)); if (IS_ENABLED(CONFIG_DEBUG_UART)) -- 2.30.2