2016-05-27 12:04:13 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2017-09-23 15:21:02 +02:00
|
|
|
#include <AGESA.h>
|
2019-04-19 17:59:38 +02:00
|
|
|
#include <northbridge/amd/agesa/state_machine.h>
|
2016-05-27 12:04:13 +02:00
|
|
|
|
2020-03-20 16:14:36 +01:00
|
|
|
#define PCIE_NIC_RESET_ID 1
|
|
|
|
|
|
|
|
#if CONFIG(BOARD_PCENGINES_APU2)
|
|
|
|
#define PCIE_GFX_RESET_ID 55
|
|
|
|
#define PCIE_PORT3_RESET_ID 51
|
|
|
|
#else
|
|
|
|
#define PCIE_GFX_RESET_ID PCIE_NIC_RESET_ID
|
|
|
|
#define PCIE_PORT3_RESET_ID PCIE_NIC_RESET_ID
|
|
|
|
#endif
|
2016-05-27 12:04:13 +02:00
|
|
|
|
2017-09-21 11:32:43 +02:00
|
|
|
static const PCIe_PORT_DESCRIPTOR PortList[] = {
|
2016-05-27 12:04:13 +02:00
|
|
|
{
|
|
|
|
0,
|
2017-09-21 11:32:43 +02:00
|
|
|
PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 3, 3),
|
|
|
|
PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 5,
|
2016-05-27 12:04:13 +02:00
|
|
|
HotplugDisabled,
|
|
|
|
PcieGenMaxSupported,
|
|
|
|
PcieGenMaxSupported,
|
2020-03-20 16:19:55 +01:00
|
|
|
AspmL0sL1,
|
|
|
|
PCIE_PORT3_RESET_ID,
|
2020-03-31 13:36:23 +02:00
|
|
|
0)
|
2016-05-27 12:04:13 +02:00
|
|
|
},
|
|
|
|
/* Initialize Port descriptor (PCIe port, Lanes 1, PCI Device Number 2, ...) */
|
|
|
|
{
|
|
|
|
0,
|
2017-09-21 11:32:43 +02:00
|
|
|
PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 2, 2),
|
|
|
|
PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 4,
|
2016-05-27 12:04:13 +02:00
|
|
|
HotplugDisabled,
|
|
|
|
PcieGenMaxSupported,
|
|
|
|
PcieGenMaxSupported,
|
2020-03-20 16:19:55 +01:00
|
|
|
AspmL0sL1,
|
|
|
|
PCIE_NIC_RESET_ID,
|
2020-03-31 13:36:23 +02:00
|
|
|
0)
|
2016-05-27 12:04:13 +02:00
|
|
|
},
|
|
|
|
/* Initialize Port descriptor (PCIe port, Lanes 2, PCI Device Number 2, ...) */
|
|
|
|
{
|
|
|
|
0,
|
2017-09-21 11:32:43 +02:00
|
|
|
PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 1, 1),
|
|
|
|
PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 3,
|
2016-05-27 12:04:13 +02:00
|
|
|
HotplugDisabled,
|
|
|
|
PcieGenMaxSupported,
|
|
|
|
PcieGenMaxSupported,
|
2020-03-20 16:19:55 +01:00
|
|
|
AspmL0sL1,
|
|
|
|
PCIE_NIC_RESET_ID,
|
2020-03-31 13:36:23 +02:00
|
|
|
0)
|
2016-05-27 12:04:13 +02:00
|
|
|
},
|
|
|
|
/* Initialize Port descriptor (PCIe port, Lanes 3, PCI Device Number 2, ...) */
|
|
|
|
{
|
|
|
|
0,
|
2017-09-21 11:32:43 +02:00
|
|
|
PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 0, 0),
|
|
|
|
PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 2,
|
2016-05-27 12:04:13 +02:00
|
|
|
HotplugDisabled,
|
|
|
|
PcieGenMaxSupported,
|
|
|
|
PcieGenMaxSupported,
|
2020-03-20 16:19:55 +01:00
|
|
|
AspmL0sL1,
|
|
|
|
PCIE_NIC_RESET_ID,
|
2020-03-31 13:36:23 +02:00
|
|
|
0)
|
2016-05-27 12:04:13 +02:00
|
|
|
},
|
|
|
|
/* Initialize Port descriptor (PCIe port, Lanes 4-7, PCI Device Number 4, ...) */
|
|
|
|
{
|
|
|
|
DESCRIPTOR_TERMINATE_LIST,
|
2017-09-21 11:32:43 +02:00
|
|
|
PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 4, 7),
|
|
|
|
PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 1,
|
2016-05-27 12:04:13 +02:00
|
|
|
HotplugDisabled,
|
|
|
|
PcieGenMaxSupported,
|
|
|
|
PcieGenMaxSupported,
|
2020-03-20 16:19:55 +01:00
|
|
|
AspmL0sL1,
|
|
|
|
PCIE_GFX_RESET_ID,
|
2020-03-31 13:36:23 +02:00
|
|
|
0)
|
2016-05-27 12:04:13 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
|
|
|
|
.Flags = DESCRIPTOR_TERMINATE_LIST,
|
|
|
|
.SocketId = 0,
|
|
|
|
.PciePortList = PortList,
|
2017-01-14 12:01:16 +01:00
|
|
|
.DdiLinkList = NULL,
|
2016-05-27 12:04:13 +02:00
|
|
|
};
|
|
|
|
|
2019-04-19 17:59:38 +02:00
|
|
|
void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly)
|
2016-05-27 12:04:13 +02:00
|
|
|
{
|
|
|
|
InitEarly->GnbConfig.PcieComplexList = &PcieComplex;
|
2019-02-04 15:22:01 +01:00
|
|
|
InitEarly->PlatformConfig.CStateMode = CStateModeC6;
|
|
|
|
InitEarly->PlatformConfig.CpbMode = CpbModeAuto;
|
2016-05-27 12:04:13 +02:00
|
|
|
}
|