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] Use GP_CAMERASB10 as Board_ID3.
Date: Fri,  5 May 2017 18:42:55 +0800	[thread overview]
Message-ID: <20170505104255.14500-1-david.wei@intel.com> (raw)

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    | 24 ++++++++++++++--------
 .../MinnowBoard3/BoardInitPreMem/PlatformId.c      | 24 ++++++++++++++--------
 2 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c
index d550fd400..40554b95e 100644
--- a/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c
+++ b/Platform/BroxtonPlatformPkg/Board/LeafHill/BoardInitPreMem/PlatformId.c
@@ -64,24 +64,30 @@ GetEmbeddedBoardIdFabId(
   padConfg0.r.PMode = 0;
   padConfg0.r.GPIORxTxDis = 0x1;
   GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+
   //
-  // Board_ID3: PMIC_PWRGOOD
+  // Board_ID3: GP_CAMERASB10
   //
-  CommAndOffset = GetCommOffset (NORTHWEST, 0x00C0);
+  
+  CommAndOffset = GetCommOffset (NORTH, 0x01E0);
   padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-  padConfg0.r.PMode = 0;
-  padConfg0.r.GPIORxTxDis = 0x1;
+  padConfg1.padCnf1 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
+
+  padConfg0.r.PMode = M0; // Set to GPIO mode
+  padConfg0.r.GPIORxTxDis = GPI;  // Set to GPI
   GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+
+  padConfg1.r.IOSTerm  = EnPu;    // Enable pull-up
+  padConfg1.r.Term     = P_20K_H; // Set to 20K pull-up    
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+
   //
-  // Set to Pull Up 20K
+  // Read out Board_ID 
   //
-  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));
+                     (((GpioPadRead (GetCommOffset (NORTH, 0x01E0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
 
   DEBUG ((DEBUG_INFO,  "BoardId from PMIC strap: %02X\n", *BoardId));
 
diff --git a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c
index d550fd400..bacdab1f2 100644
--- a/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c
+++ b/Platform/BroxtonPlatformPkg/Board/MinnowBoard3/BoardInitPreMem/PlatformId.c
@@ -64,24 +64,30 @@ GetEmbeddedBoardIdFabId(
   padConfg0.r.PMode = 0;
   padConfg0.r.GPIORxTxDis = 0x1;
   GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+
   //
-  // Board_ID3: PMIC_PWRGOOD
+  // Board_ID3: GP_CAMERASB10
   //
-  CommAndOffset = GetCommOffset (NORTHWEST, 0x00C0);
+
+  CommAndOffset = GetCommOffset (NORTH, 0x01E0);
   padConfg0.padCnf0 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET);
-  padConfg0.r.PMode = 0;
-  padConfg0.r.GPIORxTxDis = 0x1;
+  padConfg1.padCnf1 = GpioPadRead (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET);
+
+  padConfg0.r.PMode = M0; // Set to GPIO mode
+  padConfg0.r.GPIORxTxDis = GPI;  // Set to GPI
   GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF0_OFFSET, padConfg0.padCnf0);
+
+  padConfg1.r.IOSTerm  = EnPu;    // Enable pull-up
+  padConfg1.r.Term     = P_20K_H; // Set to 20K pull-up    
+  GpioPadWrite (CommAndOffset + BXT_GPIO_PAD_CONF1_OFFSET, padConfg1.padCnf1);
+
   //
-  // Set to Pull Up 20K
+  // Read out Board_ID 
   //
-  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));
+                     (((GpioPadRead (GetCommOffset (NORTH, 0x01E0) + BXT_GPIO_PAD_CONF0_OFFSET) & BIT1) >> 1) << 3));
 
   DEBUG ((DEBUG_INFO,  "BoardId from PMIC strap: %02X\n", *BoardId));
 
-- 
2.11.0.windows.1



                 reply	other threads:[~2017-05-05 10:43 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=20170505104255.14500-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