From nobody Sat Nov 2 12:28:55 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; dkim=fail spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491484573840588.6360171633816; Thu, 6 Apr 2017 06:16:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A81DE20D77DB5; Thu, 6 Apr 2017 06:16:11 -0700 (PDT) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 35E7121A18AA9 for ; Thu, 6 Apr 2017 06:16:09 -0700 (PDT) Received: by mail-wm0-x22a.google.com with SMTP id t189so8825499wmt.1 for ; Thu, 06 Apr 2017 06:16:09 -0700 (PDT) Received: from localhost.localdomain ([160.163.145.113]) by smtp.gmail.com with ESMTPSA id c8sm2087660wrd.57.2017.04.06.06.16.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Apr 2017 06:16:07 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yntV8JR7Qedy6lfVbKLklwBn0TCaGGzxSRflo1jlGUc=; b=QHyFyoYYE/pyJrl7DLE1JpsHTyaaHV31fQV8j0zi359NZcgyb2+eG9SS837lfblHOq yUPXp8Dp/CQXyOApDdmD5jBWUcW3V9MHrLEn49fh3XoHGYYviMN4RxVArxlSVDvVaP3i q/yBOOyFhmkYYSyjkLOrZVPc8hem36O+Uq/CU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yntV8JR7Qedy6lfVbKLklwBn0TCaGGzxSRflo1jlGUc=; b=p8dgZ7UCtpiNhwuqTx0sxwDoz7M25lLGY0nV//EDug1VekoU4U8GhEQO62r8KO3HvK czm1sN5WIIna1Fai2bJHiT0WGSNTYXww3A/49LQx6cym2UcYT7Jp7D8w+zmwNTO3ghu2 VxjKRTxxfZFlNT4gYUHkZIaY2oZZtdabunU22YWVGp2M6nu6EmUKItLe/oY5Z+jDSTk/ ZiFom/7Zl5xKNBNmq0pigSYNq6TYWAKWeO5ItIuwMoL3YnOQV0YI45wcvAqLM+fBYFYU YIH194cEONjtFf8iMeJrmGYgkG/bTBHfLttiYomSnh+Ls1FkPPDURmqdfGLr8oZ5Nxj1 CkBQ== X-Gm-Message-State: AFeK/H3l/E92neJ41PuIkLjazHQq/FNN9diE+DrvbRVPSdgi2/JxGPc85Bf2kuDL+quJ7KjC X-Received: by 10.28.220.212 with SMTP id t203mr24693383wmg.62.1491484567771; Thu, 06 Apr 2017 06:16:07 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ryan.harkin@linaro.org, evan.lloyd@arm.com, jeremy.linton@arm.com Date: Thu, 6 Apr 2017 14:15:47 +0100 Message-Id: <20170406131551.3322-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170406131551.3322-1-ard.biesheuvel@linaro.org> References: <20170406131551.3322-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 1/5] ArmPlatformPkg/FVP: map motherboard VRAM as uncached memory X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The VRAM of the PL111 on the FVP Base/Foundation models is described as device memory rather than uncached memory, which is not an accurate description of the nature of the region (i.e., a framebuffer), and may result in problems when using accelerated string routines to access the region, since this may legally involve unaligned accesses or DC ZVA instructions, which are not allowed on device mappings. So split of the 8 MB VRAM region into a separate region, and map it using memory attributes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h | 10 ++= ++++---- ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c | 8 ++= +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatfor= m.h b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h index 06414e6e7208..4e17c800a34f 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h +++ b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h @@ -40,9 +40,11 @@ #define ARM_VE_SMB_SRAM_BASE 0x2E000000 #define ARM_VE_SMB_SRAM_SZ SIZE_64KB // USB, Ethernet, VRAM -#define ARM_VE_SMB_PERIPH_BASE 0x18000000 -#define PL111_CLCD_VRAM_MOTHERBOARD_BASE ARM_VE_SMB_PERIPH_BASE -#define ARM_VE_SMB_PERIPH_SZ SIZE_64MB +#define ARM_VE_SMB_PERIPH_BASE 0x18800000 +#define ARM_VE_SMB_PERIPH_SZ (SIZE_64MB - SIZE_8MB) + +#define PL111_CLCD_VRAM_MOTHERBOARD_BASE 0x18000000 +#define PL111_CLCD_VRAM_MOTHERBOARD_SIZE SIZE_8MB =20 // DRAM #define ARM_VE_DRAM_BASE PcdGet64 (PcdSystemMemoryB= ase) @@ -75,6 +77,6 @@ #define PL111_CLCD_CORE_TILE_VIDEO_MODE_OSC_ID 1 =20 // VRAM offset for the PL111 Colour LCD Controller on the motherboard -#define VRAM_MOTHERBOARD_BASE (ARM_VE_SMB_PERIPH_BASE = + 0x00000) +#define VRAM_MOTHERBOARD_BASE (PL111_CLCD_VRAM_MOTHERB= OARD_BASE) =20 #endif diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMM= em.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c index 14c7e8e1d672..70c17ae70478 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/RTSMMem.c @@ -21,7 +21,7 @@ #include =20 // Number of Virtual Memory Map Descriptors -#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 8 +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 9 =20 // DDR attributes #define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK @@ -130,6 +130,12 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length =3D 2 * ARM_VE_SMB_PERIPH_SZ; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_DEV= ICE; =20 + // VRAM + VirtualMemoryTable[++Index].PhysicalBase =3D PL111_CLCD_VRAM_MOTHERBOARD= _BASE; + VirtualMemoryTable[Index].VirtualBase =3D PL111_CLCD_VRAM_MOTHERBOARD_BA= SE; + VirtualMemoryTable[Index].Length =3D PL111_CLCD_VRAM_MOTHERBOARD_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_UNC= ACHED_UNBUFFERED; + // Map sparse memory region if present if (HasSparseMemory) { VirtualMemoryTable[++Index].PhysicalBase =3D SparseMemoryBase; --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel