From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 08B3721A18AAB for ; Fri, 5 May 2017 03:43:01 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2017 03:43:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,292,1491289200"; d="scan'208";a="853236492" Received: from zwei4-mobl.ccr.corp.intel.com ([10.239.197.110]) by FMSMGA003.fm.intel.com with ESMTP; 05 May 2017 03:42:59 -0700 From: zwei4 To: edk2-devel@lists.01.org Cc: Mang Guo , Shifei Lu Date: Fri, 5 May 2017 18:42:55 +0800 Message-Id: <20170505104255.14500-1-david.wei@intel.com> X-Mailer: git-send-email 2.11.0.windows.1 Subject: [Patch][edk2-platforms/devel-MinnowBoard3] Use GP_CAMERASB10 as Board_ID3. 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: , X-List-Received-Date: Fri, 05 May 2017 10:43:01 -0000 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: zwei4 CC: Mang Guo CC: Shifei Lu --- .../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