Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | ***************************************************************************** |
| 3 | * |
| 4 | * This file is part of the coreboot project. |
| 5 | * |
| 6 | * Copyright (C) 2011 Advanced Micro Devices, Inc. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; version 2 of the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
Paul Menzel | a46a712 | 2013-02-23 18:37:27 +0100 | [diff] [blame] | 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 20 | * *************************************************************************** |
| 21 | * |
| 22 | */ |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 23 | |
Elyes HAOUAS | 65fa598 | 2014-07-22 23:12:38 +0200 | [diff] [blame] | 24 | #ifndef _AMD_SBPLATFORM_H_ |
| 25 | #define _AMD_SBPLATFORM_H_ |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 26 | |
Aaron Durbin | d907a34 | 2014-01-30 22:20:01 -0600 | [diff] [blame] | 27 | #include <stddef.h> |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 28 | |
| 29 | typedef unsigned long long PLACEHOLDER; |
| 30 | |
| 31 | #ifndef SBOEM_ACPI_RESTORE_SWSMI |
| 32 | #define SBOEM_BEFORE_PCI_RESTORE_SWSMI 0xD3 |
| 33 | #define SBOEM_AFTER_PCI_RESTORE_SWSMI 0xD4 |
| 34 | #endif |
| 35 | |
| 36 | #ifndef _AMD_NB_CIM_X_PROTOCOL_H_ |
| 37 | |
| 38 | /* |
| 39 | /// Extended PCI Address |
| 40 | typedef struct _EXT_PCI_ADDR { |
| 41 | UINT32 Reg :16; ///< / PCI Register |
| 42 | UINT32 Func:3; ///< / PCI Function |
| 43 | UINT32 Dev :5; ///< / PCI Device |
| 44 | UINT32 Bus :8; ///< / PCI Address |
| 45 | } EXT_PCI_ADDR; |
| 46 | |
| 47 | /// PCI Address |
| 48 | typedef union _PCI_ADDR { |
| 49 | UINT32 ADDR; ///< / 32 bit Address |
| 50 | EXT_PCI_ADDR Addr; ///< / Extended PCI Address |
| 51 | } PCI_ADDR; |
| 52 | */ |
| 53 | #endif |
| 54 | #define FIXUP_PTR(ptr) ptr |
| 55 | |
Martin Roth | e899e51 | 2012-12-05 16:07:11 -0700 | [diff] [blame] | 56 | #if CONFIG_SB800_IMC_FWM |
| 57 | #define IMC_ENABLE_OVER_WRITE 0x01 |
| 58 | #endif |
| 59 | |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 60 | #include <console/console.h> |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 61 | #include "AmdSbLib.h" |
| 62 | #include "Amd.h" |
| 63 | #include "SB800.h" |
| 64 | #include "SBTYPE.h" |
| 65 | #include "ACPILIB.h" |
| 66 | #include "SBDEF.h" |
| 67 | #include "AMDSBLIB.h" |
| 68 | #include "SBSUBFUN.h" |
Kerry She | feed329 | 2011-08-18 18:03:44 +0800 | [diff] [blame] | 69 | #include "platform_cfg.h" /* mainboard specific configuration */ |
| 70 | #include "OEM.h" /* platform default configuration */ |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 71 | #include "AMD.h" |
| 72 | |
| 73 | |
| 74 | //------------------------------------------------------------------------------------------------------------------------// |
| 75 | /** |
Martin Roth | 3c3a50c | 2014-12-16 20:50:26 -0700 | [diff] [blame^] | 76 | * SB_CIMx_PARAMETER 0 1 2 Default Value When CIMx Take over |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 77 | * SpreadSpectrum CIMx take over User (Setup Option) User (Setup Option) Enable |
| 78 | * SpreadSpectrumType CIMx take over User (Setup Option) User (Setup Option) Normal |
| 79 | * HpetTimer CIMx take over User (Setup Option) User (Setup Option) Enable |
| 80 | * HpetMsiDis CIMx take over User (Setup Option) User (Setup Option) Enable (0x00) |
| 81 | * IrConfig CIMx take over User (Setup Option) User (Setup Option) Disable (0x00) |
| 82 | * SpiFastReadEnable CIMx take over User (Setup Option) User (Setup Option) Disable |
| 83 | * SpiFastReadSpeed CIMx take over User (Setup Option) User (Setup Option) Disable (NULL) |
| 84 | * NbSbGen2 CIMx take over User (Setup Option) User (Setup Option) Enable |
| 85 | * AlinkPhyPllPowerDown CIMx take over User (Setup Option) User (Setup Option) Enable |
| 86 | * ResetCpuOnSyncFlood CIMx take over User (Setup Option) User (Setup Option) Enable |
| 87 | * GppGen2 CIMx take over User (Setup Option) User (Setup Option) Disable |
| 88 | * GppMemWrImprove CIMx take over User (Setup Option) User (Setup Option) Enable |
| 89 | * GppPortAspm CIMx take over User (Setup Option) User (Setup Option) Disable |
| 90 | * GppLaneReversal CIMx take over User (Setup Option) User (Setup Option) Disable |
| 91 | * GppPhyPllPowerDown CIMx take over User (Setup Option) User (Setup Option) Enable |
| 92 | * UsbPhyPowerDown CIMx take over User (Setup Option) User (Setup Option) Disable |
| 93 | * SBGecDebugBus CIMx take over User (Setup Option) User (Setup Option) Disable |
Martin Roth | 3c3a50c | 2014-12-16 20:50:26 -0700 | [diff] [blame^] | 94 | * SBGecPwr CIMx take over User (Setup Option) User (Setup Option) Never Power down (0x11) |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 95 | * SataSetMaxGen2 CIMx take over User (Setup Option) User (Setup Option) Max Gen3 (0x00) |
| 96 | * SataClkMode CIMx take over User (Setup Option) User (Setup Option) 0x90 int. 100Mhz |
| 97 | * SataAggrLinkPmCap CIMx take over User (Setup Option) User (Setup Option) Enable |
| 98 | * SataPortMultCap CIMx take over User (Setup Option) User (Setup Option) Enable |
| 99 | * SataPscCap CIMx take over User (Setup Option) User (Setup Option) Enable (0x00) |
| 100 | * SataSscCap CIMx take over User (Setup Option) User (Setup Option) Enable (0x00) |
| 101 | * SataFisBasedSwitching CIMx take over User (Setup Option) User (Setup Option) Disable |
| 102 | * SataCccSupport CIMx take over User (Setup Option) User (Setup Option) Disable |
| 103 | * SataMsiCapability CIMx take over User (Setup Option) User (Setup Option) Enable |
| 104 | * SataClkAutoOff CIMx take over User (Setup Option) User (Setup Option) Disable |
| 105 | * AcDcMsg CIMx take over User (Setup Option) User (Setup Option) Disable |
| 106 | * TimerTickTrack CIMx take over User (Setup Option) User (Setup Option) Disable |
| 107 | * ClockInterruptTag CIMx take over User (Setup Option) User (Setup Option) Disable |
| 108 | * OhciTrafficHanding CIMx take over User (Setup Option) User (Setup Option) Disable |
| 109 | * EhciTrafficHanding CIMx take over User (Setup Option) User (Setup Option) Disable |
| 110 | * FusionMsgCMultiCore CIMx take over User (Setup Option) User (Setup Option) Disable |
| 111 | * FusionMsgCStage CIMx take over User (Setup Option) User (Setup Option) Disable |
| 112 | */ |
| 113 | #define SB_CIMx_PARAMETER 0x02 |
| 114 | |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 115 | // Generic |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 116 | #define cimSpreadSpectrumDefault TRUE |
| 117 | #define cimSpreadSpectrumTypeDefault 0x00 // Normal |
| 118 | #define cimHpetTimerDefault TRUE |
| 119 | #define cimHpetMsiDisDefault FALSE // Enable |
| 120 | #define cimIrConfigDefault 0x00 // Disable |
Scott Duplichan | e78ae24 | 2011-05-15 21:18:59 +0000 | [diff] [blame] | 121 | #define cimSpiFastReadEnableDefault 0x01 // Enable |
| 122 | #define cimSpiFastReadSpeedDefault 0x01 // 33 MHz |
Kerry She | 6209c82 | 2011-08-18 18:44:00 +0800 | [diff] [blame] | 123 | #define cimSioHwmPortEnableDefault FALSE |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 124 | // GPP/AB Controller |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 125 | #define cimNbSbGen2Default TRUE |
| 126 | #define cimAlinkPhyPllPowerDownDefault TRUE |
| 127 | #define cimResetCpuOnSyncFloodDefault TRUE |
| 128 | #define cimGppGen2Default FALSE |
| 129 | #define cimGppMemWrImproveDefault TRUE |
| 130 | #define cimGppPortAspmDefault FALSE |
| 131 | #define cimGppLaneReversalDefault FALSE |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 132 | #define cimGppPhyPllPowerDownDefault TRUE |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 133 | // USB Controller |
| 134 | #define cimUsbPhyPowerDownDefault FALSE |
| 135 | // GEC Controller |
| 136 | #define cimSBGecDebugBusDefault FALSE |
| 137 | #define cimSBGecPwrDefault 0x03 |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 138 | // Sata Controller |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 139 | #define cimSataSetMaxGen2Default 0x00 |
| 140 | #define cimSATARefClkSelDefault 0x10 |
| 141 | #define cimSATARefDivSelDefault 0x80 |
| 142 | #define cimSataAggrLinkPmCapDefault TRUE |
| 143 | #define cimSataPortMultCapDefault TRUE |
| 144 | #define cimSataPscCapDefault 0x00 // Enable |
| 145 | #define cimSataSscCapDefault 0x00 // Enable |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 146 | #define cimSataFisBasedSwitchingDefault FALSE |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 147 | #define cimSataCccSupportDefault FALSE |
| 148 | #define cimSataClkAutoOffDefault FALSE |
| 149 | #define cimNativepciesupportDefault FALSE |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 150 | // Fusion Related |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 151 | #define cimAcDcMsgDefault FALSE |
| 152 | #define cimTimerTickTrackDefault FALSE |
| 153 | #define cimClockInterruptTagDefault FALSE |
| 154 | #define cimOhciTrafficHandingDefault FALSE |
| 155 | #define cimEhciTrafficHandingDefault FALSE |
| 156 | #define cimFusionMsgCMultiCoreDefault FALSE |
| 157 | #define cimFusionMsgCStageDefault FALSE |
Stefan Reinauer | 971ebd8 | 2011-10-13 17:26:43 -0700 | [diff] [blame] | 158 | |
| 159 | #include "vendorcode/amd/cimx/sb800/AMDSBLIB.h" |
| 160 | |
Patrick Georgi | e166782 | 2012-05-05 15:29:32 +0200 | [diff] [blame] | 161 | #if CONFIG_HAVE_ACPI_RESUME |
Zheng Bao | 600784e | 2013-02-07 17:30:23 +0800 | [diff] [blame] | 162 | #include <spi-generic.h> |
zbao | 01bd79f | 2012-03-23 11:36:08 +0800 | [diff] [blame] | 163 | #endif |
| 164 | |
Elyes HAOUAS | 65fa598 | 2014-07-22 23:12:38 +0200 | [diff] [blame] | 165 | #define BIOSRAM_INDEX 0xcd4 |
| 166 | #define BIOSRAM_DATA 0xcd5 |
zbao | 9bcdbf8 | 2012-04-05 13:18:49 +0800 | [diff] [blame] | 167 | |
Frank Vibrans | 63e62b0 | 2011-02-14 18:38:14 +0000 | [diff] [blame] | 168 | #endif // _AMD_SBPLATFORM_H_ |