From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.96.140; helo=cam-smtp0.cambridge.arm.com; envelope-from=evan.lloyd@arm.com; receiver=edk2-devel@lists.01.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3F7DA208F7A87 for ; Fri, 22 Dec 2017 11:03:41 -0800 (PST) Received: from E111747.Emea.Arm.com (e111747.emea.arm.com [10.1.25.75]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id vBMJ8Qx9005645; Fri, 22 Dec 2017 19:08:28 GMT From: evan.lloyd@arm.com To: edk2-devel@lists.01.org Cc: Arvind Chauhan , Daniil Egranov , Thomas Panakamattam Abraham , "ard.biesheuvel@linaro.org"@arm.com, "leif.lindholm@linaro.org"@arm.com, "Matteo.Carlini@arm.com"@arm.com, "nd@arm.com"@arm.com Date: Fri, 22 Dec 2017 19:08:19 +0000 Message-Id: <20171222190821.12440-17-evan.lloyd@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171222190821.12440-1-evan.lloyd@arm.com> References: <20171222190821.12440-1-evan.lloyd@arm.com> Subject: [PATCH edk2-platforms v2 16/18] ARM/JunoPkg: Mapping Non-Trused SRAM as device memory X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 19:03:42 -0000 From: Girish Pathak This fix changes the cache attribute of Non-Trusted SRAM on the Juno platform to device memory. This change is required to avoid coherency problems as Non-Trusted SRAM is used as a shared memory between the application processor and the SCP for communication. This change is a prerequisite for upcoming SCMI driver for the Juno platform. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Girish Pathak --- Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c index aa8d7d9c3b0d41e62d1849e6e88760e3066617f7..afb2db0050c65b0d1b2b69c9038e168755c152c1 100644 --- a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c +++ b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoMem.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2013-2015, ARM Limited. All rights reserved. +* Copyright (c) 2013-2017, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -111,7 +111,9 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[++Index].PhysicalBase = ARM_JUNO_NON_SECURE_SRAM_BASE; VirtualMemoryTable[Index].VirtualBase = ARM_JUNO_NON_SECURE_SRAM_BASE; VirtualMemoryTable[Index].Length = ARM_JUNO_NON_SECURE_SRAM_SZ; - VirtualMemoryTable[Index].Attributes = CacheAttributes; + // This memory is shared between the application processor + // and the SCP. To avoid coherency problems, map it as device memory. + VirtualMemoryTable[Index].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; // PCI Root Complex VirtualMemoryTable[++Index].PhysicalBase = PcdGet64 (PcdPcieControlBaseAddress); -- Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")