AGESA: Allow const PcieComplexList for OemCustomize

It's already implemented like this with binaryPI API header.
That implementation is essentially the same with 'const' qualifier
just being ignored in the build process for PI blob.

For open-source AGESA build, work around -Werror=discarded-qualifier
using a simple but ugly cast.

Change-Id: Ib84eb9aa40f1f4442f7aeaa8c15f6f1cbc6ca295
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/21630
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Kyösti Mälkki 2017-09-21 12:58:20 +03:00
parent e52738b428
commit e66e39059e
9 changed files with 31 additions and 10 deletions

View File

@ -1021,7 +1021,7 @@ typedef struct {
/// GNB configuration info
typedef struct {
IN PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
IN const PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
* Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST
* Example of topology definition for single socket system:
* @code

View File

@ -133,7 +133,14 @@ PcieConfigurationInit (
PCIe_COMPLEX_DESCRIPTOR *PcieComplexList;
AGESA_STATUS Status;
EarlyParamsPtr = (AMD_EARLY_PARAMS *) StdHeader;
PcieComplexList = PcieConfigProcessUserConfig (EarlyParamsPtr->GnbConfig.PcieComplexList, StdHeader);
/* FIXME: Intentionally discard qualifier const of
* GnbConfig.PcieComplexList here.
*/
PcieComplexList = PcieConfigProcessUserConfig (
(PCIe_COMPLEX_DESCRIPTOR *)EarlyParamsPtr->GnbConfig.PcieComplexList,
StdHeader);
if (PcieComplexList == NULL) {
return AGESA_FATAL;
}

View File

@ -876,7 +876,7 @@ typedef struct {
/// GNB configuration info
typedef struct {
IN PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
IN const PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
* Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST
* Example of topology definition for single socket system:
* @code

View File

@ -123,7 +123,7 @@ PcieConfigurationInit (
IDS_HDT_CONSOLE (GNB_TRACE, "PcieConfigurationInit Enter\n");
EarlyParamsPtr = (AMD_EARLY_PARAMS *) StdHeader;
ComplexList = EarlyParamsPtr->GnbConfig.PcieComplexList;
ComplexList = (PCIe_COMPLEX_DESCRIPTOR *)EarlyParamsPtr->GnbConfig.PcieComplexList;
AgesaStatus = AGESA_SUCCESS;
ComplexesDataLength = 0;
NumberOfSockets = GnbGetNumberOfSockets (StdHeader);
@ -381,4 +381,4 @@ PcieConfigDebugDump (
SiliconList = PcieLibGetNextDescriptor (SiliconList);
}
IDS_HDT_CONSOLE (PCIE_MISC, "<-------------- PCIe Config End------------------>\n");
}
}

View File

@ -1144,7 +1144,7 @@ typedef struct {
/// GNB configuration info
typedef struct {
IN PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
IN const PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
* Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST
* Example of topology definition for single socket system:
* @code

View File

@ -1243,7 +1243,7 @@ typedef struct {
/// GNB configuration info
typedef struct {
IN PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
IN const PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
* Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST
* Example of topology definition for single socket system:
* @code

View File

@ -215,7 +215,14 @@ PcieConfigurationMap (
IDS_HDT_CONSOLE (GNB_TRACE, "PcieConfigurationMap Enter\n");
AgesaStatus = AGESA_SUCCESS;
EarlyParamsPtr = (AMD_EARLY_PARAMS *) StdHeader;
PcieComplexList = PcieConfigProcessUserConfig (EarlyParamsPtr->GnbConfig.PcieComplexList, StdHeader);
/* FIXME: Intentionally discard qualifier const of
* GnbConfig.PcieComplexList here.
*/
PcieComplexList = PcieConfigProcessUserConfig (
(PCIe_COMPLEX_DESCRIPTOR *)EarlyParamsPtr->GnbConfig.PcieComplexList,
StdHeader);
GNB_DEBUG_CODE (
if (PcieComplexList != NULL) {
PcieUserConfigConfigDump (PcieComplexList);

View File

@ -1276,7 +1276,7 @@ typedef struct {
/// GNB configuration info
typedef struct {
IN PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
IN const PCIe_COMPLEX_DESCRIPTOR *PcieComplexList; /**< Pointer to array of structures describe PCIe topology on each processor package or NULL.
* Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST
* Example of topology definition for single socket system:
* @code

View File

@ -214,7 +214,14 @@ PcieConfigurationMap (
IDS_HDT_CONSOLE (GNB_TRACE, "PcieConfigurationMap Enter\n");
AgesaStatus = AGESA_SUCCESS;
EarlyParamsPtr = (AMD_EARLY_PARAMS *) StdHeader;
PcieComplexList = PcieConfigProcessUserConfig (EarlyParamsPtr->GnbConfig.PcieComplexList, StdHeader);
/* FIXME: Intentionally discard qualifier const of
* GnbConfig.PcieComplexList here.
*/
PcieComplexList = PcieConfigProcessUserConfig (
(PCIe_COMPLEX_DESCRIPTOR *)EarlyParamsPtr->GnbConfig.PcieComplexList,
StdHeader);
GNB_DEBUG_CODE (
if (PcieComplexList != NULL) {
PcieUserConfigConfigDump (PcieComplexList);