public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: zwei4 <david.wei@intel.com>
To: edk2-devel@lists.01.org
Cc: Mang Guo <mang.guo@intel.com>, Shifei Lu <shifeix.a.lu@intel.com>
Subject: [Patch][edk2-platforms/devel-MinnowBoard3] Clean up BOARD_ID identification code.
Date: Fri,  5 May 2017 14:05:49 +0800	[thread overview]
Message-ID: <20170505060549.16816-1-david.wei@intel.com> (raw)

BOARD_ID bits and GPIO pins mapping:
  BOARD_ID0   GPIO_224(J45)
  BOARD_ID1   GPIO_213(M47)
  BOARD_ID2   GPIO_223(H48)
  BOARD_ID3   GP_CAMERASB10(R34)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: zwei4 <david.wei@intel.com>
CC: Mang Guo <mang.guo@intel.com>
CC: Shifei Lu <shifeix.a.lu@intel.com>
---
 .../Board/LeafHill/BoardInitPreMem/PlatformId.c    | 268 ++++++++-------------
 .../MinnowBoard3/BoardInitPreMem/PlatformId.c      | 265 ++++++++------------
 .../Common/Include/Guid/PlatformInfo.h             |   4 +-
 .../Common/Include/Guid/PlatformInfo_Aplk.h        |   4 +-
 4 files changed, 211 insertions(+), 330 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c
index 19c1bb561..d550fd400 100644
--- a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c
+++ b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c
@@ -1,7 +1,7 @@
 /** @file
   Implement Platform ID code.
 
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -20,59 +20,6 @@
 #include <Guid/PlatformInfo.h>
 #include "PlatformId.h"
 
-/**
-  Read in GPIO state and return it.
-
-**/
-BOOLEAN
-IsThisMinnow (
-  VOID
-  )
-{
-  UINT32           CommAndOffset      = NW_GPIO_215;
-  BXT_CONF_PAD0    PadConfg0;
-  BXT_CONF_PAD1    PadConfg1;
-  BOOLEAN          ReturnValue;
-
-  if (PcdGetBool (PcdMinnowBoardDetectionRun)) {
-    //
-    // Already detected this. Return stored value.
-    //
-    ReturnValue = PcdGetBool (PcdMinnowBoardDetected);
-    DEBUG ((EFI_D_INFO, "Already detected. Returning stored value = %x\n", ReturnValue));
-  } else {
-    //
-    // Enable GPI mode with a pull-up
-    //
-    PadConfg0.padCnf0       = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    PadConfg1.padCnf1       = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
-    PadConfg0.r.PMode       = M0;      // Set to GPIO mode
-    PadConfg0.r.GPIORxTxDis = GPI;     // Set to GPI
-    PadConfg1.r.IOSTerm     = EnPu;    // Enable pull-up
-    PadConfg1.r.Term        = P_20K_H; // Set to 20K pull-up
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, PadConfg0.padCnf0);
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, PadConfg1.padCnf1);
-
-    //
-    // Read in GPI state and set return value
-    //
-    PadConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    ReturnValue       = (BOOLEAN) PadConfg0.r.GPIORxState;
-
-    //
-    // Set detection PCDs
-    //
-    PcdSetBoolS (PcdMinnowBoardDetectionRun, TRUE);
-    PcdSetBoolS (PcdMinnowBoardDetected, ReturnValue);
-  }
-
-  //
-  // Return answer
-  //
-  return ReturnValue;
-}
-
-
 EFI_STATUS
 EFIAPI
 GetEmbeddedBoardIdFabId(
@@ -88,121 +35,114 @@ GetEmbeddedBoardIdFabId(
   DEBUG ((DEBUG_INFO, "GetEmbeddedBoardIdFabId++\n"));
 
   //
-  // Set BoardId & FabId
+  // Board_ID0: PMIC_STDBY
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00F0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;         // Set to GPIO mode
+  padConfg0.r.GPIORxTxDis = 0x1; // Set to GPI
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  padConfg1.padCnf1 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Board_ID1: PMIC_SDWN_B
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00D0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Board_ID2: PMIC_RESET_B
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00C8);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Board_ID3: PMIC_PWRGOOD
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00C0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
   //
-  if (IsThisMinnow ()) {
-    //
-    // NW_PMIC_PWRGOOD says this is a Minnow board. Force Minnow defaults.
-    //
-    *BoardId = BOARD_ID_MINNOW;
-    *FabId   = PcdGet8 (PcdDefaultFabId);
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  
+  *BoardId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00F0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
+                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
+                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00C8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2) | \
+                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00C0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
+
+  DEBUG ((DEBUG_INFO,  "BoardId from PMIC strap: %02X\n", *BoardId));
 
-    DEBUG ((EFI_D_INFO,  "BoardId forced from NW_GPIO_215 detection: %02X\n", *BoardId));
-    DEBUG ((EFI_D_INFO,  "  FabId forced from NW_GPIO_215 detection: %02X\n", *FabId));
-  } else {
-    //
-    // Board_ID0: PMIC_STDBY
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00F0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;         // Set to GPIO mode
-    padConfg0.r.GPIORxTxDis = 0x1; // Set to GPI
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    padConfg1.padCnf1 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Board_ID1: PMIC_SDWN_B
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00D0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Board_ID2: PMIC_RESET_B
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00C8);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Board_ID3: PMIC_PWRGOOD
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00C0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    *BoardId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00F0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
-                       (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
-                       (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00C8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2));
+  //
+  // Fab_ID0: PMIC_I2C_SDA
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x0108);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Fab_ID1: PMIC_I2C_SCL
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x0100);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //Set to Pull Up 20K
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Fab_ID2: PMIC_BCUDISW2
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00D8);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Fab_ID3: PMIC_BCUDISCRIT
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00E0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
 
-    DEBUG ((DEBUG_INFO,  "BoardId from PMIC strap: %02X\n", *BoardId));
-    //
-    // Fab_ID0: PMIC_I2C_SDA
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x0108);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Fab_ID1: PMIC_I2C_SCL
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x0100);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Fab_ID2: PMIC_BCUDISW2
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00D8);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Fab_ID3: PMIC_BCUDISCRIT
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00E0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  *FabId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0108) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
+                   (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0100) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
+                   (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2) | \
+                   (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00E0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
 
-    *FabId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0108) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
-                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0100) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
-                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2) | \
-                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00E0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
+  DEBUG ((EFI_D_INFO,  "FabId from PMIC strap: %02X\n", *FabId));
 
-    DEBUG ((EFI_D_INFO,  "FabId from PMIC strap: %02X\n", *FabId));
-  }
 
   return EFI_SUCCESS;
 }
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c
index e7135a9dc..d550fd400 100644
--- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c
+++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c
@@ -1,7 +1,7 @@
 /** @file
   Implement Platform ID code.
 
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -20,59 +20,6 @@
 #include <Guid/PlatformInfo.h>
 #include "PlatformId.h"
 
-/**
-  Read in GPIO state and return it.
-
-**/
-BOOLEAN
-IsThisMinnow (
-  VOID
-  )
-{
-  UINT32           CommAndOffset      = NW_GPIO_215;
-  BXT_CONF_PAD0    PadConfg0;
-  BXT_CONF_PAD1    PadConfg1;
-  BOOLEAN          ReturnValue;
-
-  if (PcdGetBool (PcdMinnowBoardDetectionRun)) {
-    //
-    // Already detected this. Return stored value.
-    //
-    ReturnValue = PcdGetBool (PcdMinnowBoardDetected);
-    DEBUG ((EFI_D_INFO, "Already detected. Returning stored value = %x\n", ReturnValue));
-  } else {
-    //
-    // Enable GPI mode with a pull-up
-    //
-    PadConfg0.padCnf0       = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    PadConfg1.padCnf1       = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
-    PadConfg0.r.PMode       = M0;      // Set to GPIO mode
-    PadConfg0.r.GPIORxTxDis = GPI;     // Set to GPI
-    PadConfg1.r.IOSTerm     = EnPu;    // Enable pull-up
-    PadConfg1.r.Term        = P_20K_H; // Set to 20K pull-up
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, PadConfg0.padCnf0);
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, PadConfg1.padCnf1);
-
-    //
-    // Read in GPI state and set return value
-    //
-    PadConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    ReturnValue       = (BOOLEAN) PadConfg0.r.GPIORxState;
-
-    //
-    // Set detection PCDs
-    //
-    PcdSetBoolS (PcdMinnowBoardDetectionRun, TRUE);
-    PcdSetBoolS (PcdMinnowBoardDetected, ReturnValue);
-  }
-
-  //
-  // Return answer
-  //
-  return ReturnValue;
-}
-
-
 EFI_STATUS
 EFIAPI
 GetEmbeddedBoardIdFabId(
@@ -88,120 +35,114 @@ GetEmbeddedBoardIdFabId(
   DEBUG ((DEBUG_INFO, "GetEmbeddedBoardIdFabId++\n"));
 
   //
-  // Set BoardId & FabId
+  // Board_ID0: PMIC_STDBY
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00F0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;         // Set to GPIO mode
+  padConfg0.r.GPIORxTxDis = 0x1; // Set to GPI
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  padConfg1.padCnf1 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Board_ID1: PMIC_SDWN_B
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00D0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Board_ID2: PMIC_RESET_B
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00C8);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Board_ID3: PMIC_PWRGOOD
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00C0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Set to Pull Up 20K
   //
-  if (IsThisMinnow ()) {
-    //
-    // NW_PMIC_PWRGOOD says this is a Minnow board. Force Minnow defaults.
-    //
-    *BoardId = BOARD_ID_MINNOW;
-    *FabId   = PcdGet8 (PcdDefaultFabId);
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  
+  *BoardId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00F0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
+                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
+                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00C8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2) | \
+                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00C0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
 
-    DEBUG ((EFI_D_INFO,  "BoardId forced from NW_GPIO_215 detection: %02X\n", *BoardId));
-    DEBUG ((EFI_D_INFO,  "  FabId forced from NW_GPIO_215 detection: %02X\n", *FabId));
-  } else {
-    //
-    // Board_ID0: PMIC_STDBY
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00F0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;         // Set to GPIO mode
-    padConfg0.r.GPIORxTxDis = 0x1; // Set to GPI
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    padConfg1.padCnf1 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Board_ID1: PMIC_SDWN_B
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00D0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Board_ID2: PMIC_RESET_B
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00C8);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Board_ID3: PMIC_PWRGOOD
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00C0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    *BoardId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00F0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
-                       (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
-                       (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00C8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2));
+  DEBUG ((DEBUG_INFO,  "BoardId from PMIC strap: %02X\n", *BoardId));
 
-    DEBUG ((DEBUG_INFO,  "BoardId from PMIC strap: %02X\n", *BoardId));
+  //
+  // Fab_ID0: PMIC_I2C_SDA
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x0108);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Fab_ID1: PMIC_I2C_SCL
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x0100);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //Set to Pull Up 20K
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Fab_ID2: PMIC_BCUDISW2
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00D8);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  //
+  // Fab_ID3: PMIC_BCUDISCRIT
+  //
+  CommAndOffset = GetCommOffset (NORTHWEST, 0x00E0);
+  padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
+  padConfg0.r.PMode = 0;
+  padConfg0.r.GPIORxTxDis = 0x1;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+  //
+  // Set to Pull Up 20K
+  //
+  padConfg1.r.Term = 0xC;
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
 
-    //
-    // Fab_ID0: PMIC_I2C_SDA
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x0108);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Fab_ID1: PMIC_I2C_SCL
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x0100);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //Set to Pull Up 20K
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Fab_ID2: PMIC_BCUDISW2
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00D8);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
-    //
-    // Fab_ID3: PMIC_BCUDISCRIT
-    //
-    CommAndOffset = GetCommOffset (NORTHWEST, 0x00E0);
-    padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-    padConfg0.r.PMode = 0;
-    padConfg0.r.GPIORxTxDis = 0x1;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
-    //
-    // Set to Pull Up 20K
-    //
-    padConfg1.r.Term = 0xC;
-    GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+  *FabId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0108) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
+                   (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0100) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
+                   (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2) | \
+                   (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00E0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
 
-    *FabId = (UINT8) (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0108) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) | \
-                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x0100) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 1) | \
-                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00D8) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 2) | \
-                     (((GpioPadRead (GetCommOffset (NORTHWEST, 0x00E0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
+  DEBUG ((EFI_D_INFO,  "FabId from PMIC strap: %02X\n", *FabId));
 
-    DEBUG ((EFI_D_INFO,  "FabId from PMIC strap: %02X\n", *FabId));
-  }
 
   return EFI_SUCCESS;
 }
diff --git a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h
index aed58998c..5db0cbc33 100644
--- a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h
+++ b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h
@@ -1,7 +1,7 @@
 /** @file
   GUID used for Platform Info Data entries in the HOB list.
 
-  Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -163,7 +163,7 @@ typedef enum {
 
 typedef enum {
   BOARD_ID_LFH_CRB         = 0x07,     // Leaf Hill
-  BOARD_ID_MINNOW          = 0x80,     // Minnow Board
+  BOARD_ID_MINNOW          = 0x0F,     // Minnow Board
   BOARD_ID_APL_UNKNOWN     = 0xFF
 } APL_BOARD_ID_LIST;
 
diff --git a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h
index d02afcbd2..e8063de32 100644
--- a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h
+++ b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h
@@ -1,7 +1,7 @@
 /** @file
   GUID used for Platform Info Data entries in the HOB list.
 
-  Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -149,7 +149,7 @@ typedef struct {
 
 typedef enum {
   BOARD_ID_LFH_CRB         = 0x07,     // Leaf Hill
-  BOARD_ID_MINNOW          = 0x80,     // Minnow Board
+  BOARD_ID_MINNOW          = 0x0F,     // Minnow Board
   BOARD_ID_APL_UNKNOWN     = 0xFF
 } APL_BOARD_ID_LIST;
 
-- 
2.11.0.windows.1



                 reply	other threads:[~2017-05-05  6:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170505060549.16816-1-david.wei@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox