From f245f7b0bc5128e7abe86ac264ba2c2019dfe3d1 Mon Sep 17 00:00:00 2001 From: zwei4 Date: Fri, 5 May 2017 14:03:28 +0800 Subject: Clean up BOARD_ID identification code. 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 CC: Mang Guo CC: Shifei Lu --- .../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 19c1bb561d..d550fd400c 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.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
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 #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 e7135a9dc8..d550fd400c 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.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
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 #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 aed58998c7..5db0cbc33e 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.
+ Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.
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 d02afcbd22..e8063de32e 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.
+ Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.
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; -- cgit v1.2.3