* [PATCH edk2-platforms 0/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix UpXtreme build
@ 2023-05-15 5:43 Rebecca Cran
2023-05-15 5:43 ` [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro Rebecca Cran
2023-05-15 5:43 ` [PATCH edk2-platforms 2/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files Rebecca Cran
0 siblings, 2 replies; 5+ messages in thread
From: Rebecca Cran @ 2023-05-15 5:43 UTC (permalink / raw)
To: devel, Chasel Chiu, Nate DeSimone, Sai Chaganty, Isaac Oram; +Cc: Rebecca Cran
Fix the ALIGN16 macro in Platform/Intel/WhiskeylakeOpenBoardPkg to use
ADDRESS_IS_ALIGNED from MdePkg/Include/Base.h, and delete include files
which appear to be unused.
Testing:
./build_bios.py -p UpXtreme {-d,-r,-tr,-rp,--capsule,--performance,--fsp}
Rebecca Cran (2):
Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro
Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h | 131 --------------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h | 38 ------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h | 103 ---------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h | 42 -------
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h | 3 +-
5 files changed, 1 insertion(+), 316 deletions(-)
delete mode 100644 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
delete mode 100644 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
delete mode 100644 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
delete mode 100644 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h
--
2.39.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro
2023-05-15 5:43 [PATCH edk2-platforms 0/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix UpXtreme build Rebecca Cran
@ 2023-05-15 5:43 ` Rebecca Cran
2023-05-15 13:22 ` [edk2-devel] " Pedro Falcato
2023-05-15 5:43 ` [PATCH edk2-platforms 2/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files Rebecca Cran
1 sibling, 1 reply; 5+ messages in thread
From: Rebecca Cran @ 2023-05-15 5:43 UTC (permalink / raw)
To: devel, Chasel Chiu, Nate DeSimone, Sai Chaganty, Isaac Oram; +Cc: Rebecca Cran
The IS_ALIGNED macro defined in PlatformBoardConfig.h conflicts with the
definition from MdePkg/Include/Base.h. Delete it, and switch to
ADDRESS_IS_ALIGNED.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
index 44b4059f8ebf..4872a0afc65a 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
@@ -15,8 +15,7 @@
#include <GpioConfig.h>
#include <TbtBoardInfo.h>
-#define IS_ALIGNED(addr, size) (((addr) & (size - 1)) ? 0 : 1)
-#define ALIGN16(size) (IS_ALIGNED(size, 16) ? size : ((size + 16) & 0xFFF0))
+#define ALIGN16(size) (ADDRESS_IS_ALIGNED(size, 16) ? size : ((size + 16) & 0xFFF0))
#define BOARD_CONFIG_BLOCK_PEI_PREMEM_VERSION 0x00000001
#define BOARD_CONFIG_BLOCK_PEI_POSTMEM_VERSION 0x00000001
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH edk2-platforms 2/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files
2023-05-15 5:43 [PATCH edk2-platforms 0/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix UpXtreme build Rebecca Cran
2023-05-15 5:43 ` [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro Rebecca Cran
@ 2023-05-15 5:43 ` Rebecca Cran
1 sibling, 0 replies; 5+ messages in thread
From: Rebecca Cran @ 2023-05-15 5:43 UTC (permalink / raw)
To: devel, Chasel Chiu, Nate DeSimone, Sai Chaganty, Isaac Oram; +Cc: Rebecca Cran
The following include files appear to be unused, since the build system
uses the corresponding files under WhiskeylakeOpenBoardPkg/Include
instead:
WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h
Since they're unused and could cause confusion, delete them.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h | 131 --------------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h | 38 ------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h | 103 ---------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h | 42 -------
4 files changed, 314 deletions(-)
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
deleted file mode 100644
index febccdf48282..000000000000
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/** @file
- UP Xtreme Platform Hook library.
-
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _PEI_PLATFORM_HOOK_LIB_H_
-#define _PEI_PLATFORM_HOOK_LIB_H_
-
-#include <PlatformInfo.h>
-#include <Library/PeiServicesLib.h>
-#include <Library/GpioLib.h>
-
-// EC Command to provide one byte of debug indication
-#define BSSB_DEBUG_INDICATION 0xAE
-/**
- Configure EC for specific devices
-
- @param[in] PchLan - The PchLan of PCH_SETUP variable.
- @param[in] BootMode - The current boot mode.
-**/
-VOID
-EcInit (
- IN UINT8 PchLan,
- IN EFI_BOOT_MODE BootMode
- );
-
-/**
- Checks if Premium PMIC present
-
- @retval TRUE if present
- @retval FALSE it discrete/other PMIC
-**/
-BOOLEAN
-IsPremiumPmicPresent (
- VOID
- );
-
-/**
- Pmic Programming to supprort LPAL Feature
-
- @retval NONE
-**/
-VOID
-PremiumPmicDisableSlpS0Voltage (
- VOID
- );
-
-/**
-Pmic Programming to supprort LPAL Feature
- @retval NONE
-**/
-VOID
-PremiumPmicEnableSlpS0Voltage(
- VOID
- );
-
-/**
- Do platform specific programming pre-memory. For example, EC init, Chipset programming
-
- @retval Status
-**/
-EFI_STATUS
-PlatformSpecificInitPreMem (
- VOID
- );
-
-/**
- Do platform specific programming post-memory.
-
- @retval Status
-**/
-EFI_STATUS
-PlatformSpecificInit (
- VOID
- );
-
-/**
- Configure GPIO and SIO Before Memory is ready.
-
- @retval EFI_SUCCESS Operation success.
-**/
-EFI_STATUS
-BoardInitPreMem (
- VOID
- );
-
-/**
- Configure GPIO and SIO
-
- @retval EFI_SUCCESS Operation success.
-**/
-EFI_STATUS
-BoardInit (
- VOID
- );
-
-/**
-Voltage Margining Routine
-
-@retval EFI_SUCCESS Operation success
-**/
-EFI_STATUS
-VoltageMarginingRoutine(
- VOID
- );
-
-/**
- Detect recovery mode
-
- @retval EFI_SUCCESS System in Recovery Mode
- @retval EFI_UNSUPPORTED System doesn't support Recovery Mode
- @retval EFI_NOT_FOUND System is not in Recovery Mode
-**/
-EFI_STATUS
-IsRecoveryMode (
- VOID
- );
-
-/**
- Early board Configuration before Memory is ready.
-
- @retval EFI_SUCCESS Operation success.
-**/
-EFI_STATUS
-BoardInitEarlyPreMem (
- VOID
- );
-
-#endif
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
deleted file mode 100644
index 2514d2ec444b..000000000000
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- UP Xtreme platform library.
-
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _PEI_PLATFORM_LIB_H_
-#define _PEI_PLATFORM_LIB_H_
-
-#define PEI_DEVICE_DISABLED 0
-#define PEI_DEVICE_ENABLED 1
-
-typedef struct {
- UINT8 Register;
- UINT32 Value;
-} PCH_GPIO_DEV;
-
-//
-// GPIO Initialization Data Structure
-//
-typedef struct{
- PCH_GPIO_DEV Use_Sel;
- PCH_GPIO_DEV Use_Sel2;
- PCH_GPIO_DEV Use_Sel3;
- PCH_GPIO_DEV Io_Sel;
- PCH_GPIO_DEV Io_Sel2;
- PCH_GPIO_DEV Io_Sel3;
- PCH_GPIO_DEV Lvl;
- PCH_GPIO_DEV Lvl2;
- PCH_GPIO_DEV Lvl3;
- PCH_GPIO_DEV Inv;
- PCH_GPIO_DEV Blink;
- PCH_GPIO_DEV Rst_Sel;
- PCH_GPIO_DEV Rst_Sel2;
-} GPIO_INIT_STRUCT;
-
-#endif
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
deleted file mode 100644
index db6024a1e49d..000000000000
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/** @file
- Header file for UP Xtreme platform board configuration.
-
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _PLATFORM_BOARD_CONFIG_H
-#define _PLATFORM_BOARD_CONFIG_H
-
-#include <ConfigBlock.h>
-#include <PchPolicyCommon.h>
-#include <ConfigBlock/MemoryConfig.h>
-#include <GpioConfig.h>
-#include <TbtBoardInfo.h>
-
-#define IS_ALIGNED(addr, size) (((addr) & (size - 1)) ? 0 : 1)
-#define ALIGN16(size) (IS_ALIGNED(size, 16) ? size : ((size + 16) & 0xFFF0))
-
-#define BOARD_CONFIG_BLOCK_PEI_PREMEM_VERSION 0x00000001
-#define BOARD_CONFIG_BLOCK_PEI_POSTMEM_VERSION 0x00000001
-#define BOARD_CONFIG_BLOCK_DXE_VERSION 0x00000001
-#define BOARD_NO_BATTERY_SUPPORT 0
-#define BOARD_REAL_BATTERY_SUPPORTED BIT0
-#define BOARD_VIRTUAL_BATTERY_SUPPORTED BIT1
-
-#pragma pack(1)
-
-typedef struct {
- CONFIG_BLOCK_HEADER Header; ///< Offset 0-27 Config Block Header
-} BOARD_CONFIG_BLOCK;
-
-typedef struct {
- UINT8 GpioSupport;
- UINT32 WakeGpioNo;
- UINT8 HoldRstExpanderNo;
- UINT32 HoldRstGpioNo;
- BOOLEAN HoldRstActive;
- UINT8 PwrEnableExpanderNo;
- UINT32 PwrEnableGpioNo;
- BOOLEAN PwrEnableActive;
-} SWITCH_GRAPHIC_GPIO;
-
-typedef struct {
- UINT8 ClkReqNumber : 4;
- UINT8 ClkReqSupported : 1;
- UINT8 DeviceResetPadActiveHigh : 1;
- UINT32 DeviceResetPad;
-} ROOT_PORT_CLK_INFO;
-
-typedef struct {
- UINT8 Section;
- UINT8 Pin;
-} EXPANDER_GPIO_CONFIG;
-
-typedef enum {
- BoardGpioTypePch,
- BoardGpioTypeExpander,
- BoardGpioTypeNotSupported = 0xFF
-} BOARD_GPIO_TYPE;
-
-typedef struct {
- UINT8 Type;
- UINT8 Reserved[3]; // alignment for COMMON_GPIO_CONFIG
- union {
- UINT32 Pin;
- EXPANDER_GPIO_CONFIG Expander;
- } u;
-} BOARD_GPIO_CONFIG;
-
-// Do not change the encoding. It must correspond with PCH_PCIE_CLOCK_USAGE from PCH RC.
-#define NOT_USED 0xFF
-#define FREE_RUNNING 0x80
-#define LAN_CLOCK 0x70
-#define PCIE_PEG 0x40
-#define PCIE_PCH 0x00
-
-typedef struct {
- UINT32 ClockUsage;
- UINT32 ClkReqSupported;
-} PCIE_CLOCK_CONFIG;
-
-typedef union {
- UINT64 Blob;
- BOARD_GPIO_CONFIG BoardGpioConfig;
- ROOT_PORT_CLK_INFO Info;
- PCIE_CLOCK_CONFIG PcieClock;
-} PCD64_BLOB;
-
-typedef union {
- UINT32 Blob;
- USB20_AFE Info;
-} PCD32_BLOB;
-
-#ifndef IO_EXPANDER_DISABLED
-#define IO_EXPANDER_DISABLED 0xFF
-#endif
-
-#define SPD_DATA_SIZE 512
-
-#pragma pack()
-
-#endif // _PLATFORM_BOARD_CONFIG_H
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h
deleted file mode 100644
index 88564e37338d..000000000000
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- GUID used for Platform Info Data entries in the HOB list.
-
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _PLATFORM_INFO_H_
-#define _PLATFORM_INFO_H_
-
-#pragma pack(1)
-
-///
-/// PCH_GPIO_PAD is equivalent to GPIO_PAD which is defined in GpioConfig.h
-///
-typedef UINT32 PCH_GPIO_PAD; //Copied from GpioConfig.h (need to change it based on include)
-
-typedef struct {
-UINT8 Expander;
-UINT8 Pin;
-UINT16 Reserved; // Reserved for future use
-} IO_EXPANDER_PAD;
-
-typedef union {
-PCH_GPIO_PAD PchGpio;
-IO_EXPANDER_PAD IoExpGpio;
-} GPIO_PAD_CONFIG;
-
-typedef struct {
-UINT8 GpioType; // 0: Disabled (no GPIO support), 1: PCH, 2: I/O Expander
-UINT8 Reserved[3]; // Reserved for future use
-GPIO_PAD_CONFIG GpioData;
-} PACKED_GPIO_CONFIG;
-
-typedef union {
-PACKED_GPIO_CONFIG PackedGpio;
-UINT64 Data64;
-} COMMON_GPIO_CONFIG;
-
-#pragma pack()
-
-#endif
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro
2023-05-15 5:43 ` [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro Rebecca Cran
@ 2023-05-15 13:22 ` Pedro Falcato
2023-05-15 14:00 ` Rebecca Cran
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Falcato @ 2023-05-15 13:22 UTC (permalink / raw)
To: devel, rebecca; +Cc: Chasel Chiu, Nate DeSimone, Sai Chaganty, Isaac Oram
On Mon, May 15, 2023 at 6:43 AM Rebecca Cran <rebecca@bsdio.com> wrote:
>
> The IS_ALIGNED macro defined in PlatformBoardConfig.h conflicts with the
> definition from MdePkg/Include/Base.h. Delete it, and switch to
> ADDRESS_IS_ALIGNED.
>
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
> index 44b4059f8ebf..4872a0afc65a 100644
> --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
> +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
> @@ -15,8 +15,7 @@
> #include <GpioConfig.h>
> #include <TbtBoardInfo.h>
>
> -#define IS_ALIGNED(addr, size) (((addr) & (size - 1)) ? 0 : 1)
> -#define ALIGN16(size) (IS_ALIGNED(size, 16) ? size : ((size + 16) & 0xFFF0))
> +#define ALIGN16(size) (ADDRESS_IS_ALIGNED(size, 16) ? size : ((size + 16) & 0xFFF0))
As I mentioned on Discord, ALIGN16 should not need a branch like this.
I propose switching ALIGN16 to use ALIGN_VALUE, or if you need compat
with older edk2s, even:
#define ALIGN16(size) (((size) + 15) & -16)
Which is a common enough pattern that it hopefully is self-explanatory.
--
Pedro
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro
2023-05-15 13:22 ` [edk2-devel] " Pedro Falcato
@ 2023-05-15 14:00 ` Rebecca Cran
0 siblings, 0 replies; 5+ messages in thread
From: Rebecca Cran @ 2023-05-15 14:00 UTC (permalink / raw)
To: Pedro Falcato, devel; +Cc: Chasel Chiu, Nate DeSimone, Sai Chaganty, Isaac Oram
On 5/15/23 07:22, Pedro Falcato wrote:
> As I mentioned on Discord, ALIGN16 should not need a branch like this.
> I propose switching ALIGN16 to use ALIGN_VALUE, or if you need compat
> with older edk2s, even:
>
> #define ALIGN16(size) (((size) + 15) & -16)
>
> Which is a common enough pattern that it hopefully is self-explanatory.
Thanks. I realized ALIGN16 isn't even used anymore, so I've just sent
out a v2 patch to just delete them.
--
Rebecca Cran
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-05-15 14:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-15 5:43 [PATCH edk2-platforms 0/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix UpXtreme build Rebecca Cran
2023-05-15 5:43 ` [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro Rebecca Cran
2023-05-15 13:22 ` [edk2-devel] " Pedro Falcato
2023-05-15 14:00 ` Rebecca Cran
2023-05-15 5:43 ` [PATCH edk2-platforms 2/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files Rebecca Cran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox