]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/ArmVExpressPkg: Add System ID of FVP models to VE LCD driver.
authorOlivier Martin <olivier.martin@arm.com>
Mon, 19 Aug 2013 17:35:18 +0000 (17:35 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Aug 2013 17:35:18 +0000 (17:35 +0000)
- Setting DVI fails on VE models. The FVP models behave the same.
  These have updated SYS ID numbers and they need to be added to the
  driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14564 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmVExpressPkg/Include/VExpressMotherBoard.h
ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c

index 37bd0b64afb2d094ff4ec44503ec63034753e3b1..2ac0034aa1e3e7036780f48198fa9affe6f8dcc6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 *  Header defining Versatile Express constants (Base addresses, sizes, flags)\r
 *\r
-*  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
 // Can not access the battery backed-up hardware clock on the Versatile Express motherboard\r
 #define SYS_CFG_RTC                               VIRTUAL_SYS_CFG(ARM_VE_UNSUPPORTED,1)\r
 \r
+//\r
+// System ID\r
+//\r
+// All RTSM VE models have the same System ID : 0x225F500\r
+//\r
+// FVP models have a different System ID.\r
+// Default Base model System ID : 0x00201100\r
+// [31:28] Rev     - Board revision:          0x0     = Rev A\r
+// [27:16] HBI     - HBI board number in BCD: 0x020   = v8 Base Platform\r
+// [15:12] Variant - Build variant of board:  0x1     = Variant B. (GIC 64k map)\r
+// [11:8]  Plat    - Platform type:           0x1     = Model\r
+// [7:0]   FPGA    - FPGA build, BCD coded:   0x00\r
+//\r
+//HBI = 010 = Foundation Model\r
+//HBI = 020 = Base Platform\r
+//\r
+// And specifically, the GIC register banks start at the following\r
+// addresses:\r
+//              Variant = 0             Variant = 1\r
+//GICD          0x2c001000              0x2f000000\r
+//GICC          0x2c002000              0x2c000000\r
+//GICH          0x2c004000              0x2c010000\r
+//GICV          0x2c006000              0x2c020000\r
+\r
+// The default SYS_IDs. These can be changed when starting the model.\r
+#define ARM_RTSM_SYS_ID                (0x225F500)\r
+#define ARM_FVP_BASE_SYS_ID            (0x00201100)\r
+#define ARM_FVP_FOUNDATION_SYS_ID      (0x00101100)\r
+\r
+#define ARM_FVP_SYS_ID_VARIANT_MASK    (UINT32)(0xFUL << 12)\r
+\r
 #endif /* VEXPRESSMOTHERBOARD_H_ */\r
index f6f01fa20df55d10a29eff591c8baaec81d8d10f..c6b37fca0153d920892bf71d5f7611aac39c6156 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -234,6 +234,7 @@ LcdPlatformSetMode (
   UINT32                LcdSite;\r
   UINT32                OscillatorId;\r
   SYS_CONFIG_FUNCTION   Function;\r
+  UINT32                SysId;\r
 \r
   if (ModeNumber >= LcdPlatformGetMaxMode ()) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -261,14 +262,20 @@ LcdPlatformSetMode (
     return Status;\r
   }\r
 \r
-  // On the ARM Versatile Express Model (RTSM) the value of the SysId is equal to 0x225F500.\r
-  // Note: The DVI Mode is not modelled on RTSM\r
-  if (MmioRead32 (ARM_VE_SYS_ID_REG) != 0x225F500) {\r
-    // Set the DVI into the new mode\r
-    Status = ArmPlatformSysConfigSet (SYS_CFG_DVIMODE, mResolutions[ModeNumber].Mode);\r
-    if (EFI_ERROR(Status)) {\r
-      ASSERT_EFI_ERROR (Status);\r
-      return Status;\r
+  // The FVP foundation model does not have an LCD.\r
+  // On the FVP models the GIC variant in encoded in bits [15:12].\r
+  // Note: The DVI Mode is not modelled by RTSM or FVP models.\r
+  SysId = MmioRead32 (ARM_VE_SYS_ID_REG);\r
+  if (SysId != ARM_RTSM_SYS_ID) {\r
+    // Take out the FVP GIC variant to reduce the permutations.\r
+    SysId &= ~ARM_FVP_SYS_ID_VARIANT_MASK;\r
+    if (SysId != (ARM_FVP_BASE_SYS_ID & ~ARM_FVP_SYS_ID_VARIANT_MASK)) {\r
+      // Set the DVI into the new mode\r
+      Status = ArmPlatformSysConfigSet (SYS_CFG_DVIMODE, mResolutions[ModeNumber].Mode);\r
+      if (EFI_ERROR(Status)) {\r
+        ASSERT_EFI_ERROR (Status);\r
+        return Status;\r
+      }\r
     }\r
   }\r
 \r