blob: 35ddfbb5b529ad8d23df52884cabd38c3e8268fc [file] [log] [blame]
Siyuan Wang8ff97b22012-10-28 18:19:38 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Siyuan Wang8ff97b22012-10-28 18:19:38 +080014 */
15
16#ifndef _RD890_CFG_H_
17#define _RD890_CFG_H_
18
19#include "NbPlatform.h"
20
21/* platform dependent configuration default value */
22
23/**
24 * Path from CPU to NB
25 * [0..7] - Node (0..8)
26 * [8..11] - Link (0..3)
27 * [12..15] - Sublink (1..2), If NB connected to full link than Sublink should be set to 0.
28 */
29#ifndef DEFAULT_HT_PATH
30#if CONFIG_CPU_AMD_AGESA_FAMILY10
31#define DEFAULT_HT_PATH {0x0, 0x3}
32#endif
33#if CONFIG_CPU_AMD_AGESA_FAMILY15
34#define DEFAULT_HT_PATH {0x0, 0x1}
35#endif
36#endif
37
38/**
39 * Bitmap of enabled ports on NB #0/1/2/3
40 * Bit[0] - Reserved
41 * Bit[1] - Reserved
42 * Bit[2] - Enable PCIe port 2
43 * Bit[3] - Enable PCIe port 3
44 * Bit[4] - Enable PCIe port 4
45 * Bit[5] - Enable PCIe port 5
46 * Bit[6] - Enable PCIe port 2
47 * Bit[7] - Enable PCIe port 7
48 * Bit[8] - Reserved
49 * Bit[9] - Enable PCIe port 9
50 * Bit[10]- Enable PCIe port 10
51 * Bit[11]- Enable PCIe port 11
52 * Bit[12]- Enable PCIe port 12
53 * Bit[13]- Enable PCIe port 13
54 * Example:
55 * port_enable = 0x14
56 * Port 2 and 4 enabled for training/initialization
57 */
58#ifndef DEFAULT_PORT_ENABLE_MAP
59#define DEFAULT_PORT_ENABLE_MAP 0x0014
60#endif
61
62/**
63 * Bitmap of ports that have slot or onboard device connected.
64 * Example force PCIe Gen1 supporton port 2 and 4 (DEFAULT_PORT_ENABLE_MAP = BIT2 | BIT4)
Martin Rothd30746ab62015-01-04 15:29:08 -070065 * define DEFAULT_PORT_FORCE_GEN1 0x604
Siyuan Wang8ff97b22012-10-28 18:19:38 +080066 */
67#ifndef DEFAULT_PORT_FORCE_GEN1
68#define DEFAULT_PORT_FORCE_GEN1 0x0
69#endif
70
71/**
72 * Bitmap of ports that have server hotplug support
73 */
74#ifndef DEFAULT_HOTPLUG_SUPPORT
75#define DEFAULT_HOTPLUG_SUPPORT 0x0
76#endif
77
78#ifndef DEFAULT_HOTPLUG_DESCRIPTOR
79#define DEFAULT_HOTPLUG_DESCRIPTOR {0, 0, 0, 0, 0, 0, 0, 0}
80#endif
81
82#ifndef DEFAULT_TEMPMMIO_BASE_ADDRESS
83#define DEFAULT_TEMPMMIO_BASE_ADDRESS 0xD0000000
84#endif
85
86/**
87 * Default GPP1 core configuraton on NB #0/1/2/3.
88 * 2 x8 slot, GFX_CONFIG_AABB
89 * 1 x16 slot, GFX_CONFIG_AAAA
90 */
91#ifndef DEFAULT_GPP1_CONFIG
92#define DEFAULT_GPP1_CONFIG GFX_CONFIG_AABB
93#endif
94
95/**
96 * Default GPP2 core configuraton on NB #0/1/2/3.
97 * 2 x8 slot, GFX_CONFIG_AABB
98 * 1 x16 slot, GFX_CONFIG_AAAA
99 */
100#ifndef DEFAULT_GPP2_CONFIG
101#define DEFAULT_GPP2_CONFIG GFX_CONFIG_AABB
102#endif
103
104/**
105 * Default GPP3a core configuraton on NB #0/1/2/3.
106 * 4:2:0:0:0:0 - GPP_CONFIG_GPP420000, 0x1
107 * 4:1:1:0:0:0 - GPP_CONFIG_GPP411000, 0x2
108 * 2:2:2:0:0:0 - GPP_CONFIG_GPP222000, 0x3
109 * 2:2:1:1:0:0 - GPP_CONFIG_GPP221100, 0x4
110 * 2:1:1:1:1:0 - GPP_CONFIG_GPP211110, 0x5
111 * 1:1:1:1:1:1 - GPP_CONFIG_GPP111111, 0x6
112 */
113#ifndef DEFAULT_GPP3A_CONFIG
114#define DEFAULT_GPP3A_CONFIG GPP_CONFIG_GPP111111
115#endif
116
117
118/**
119 * Default HT Transmitter de-emphasis setting
120 */
121#ifndef DEFAULT_HT_DEEMPASIES
122#define DEFAULT_HT_DEEMPASIES 0x3
123#endif
124
125/**
126 * Default APIC nterrupt base for IOAPIC
127 */
128#ifndef DEFAULT_APIC_INTERRUPT_BASE
129#define DEFAULT_APIC_INTERRUPT_BASE 24
130#endif
131
132
133#define DEFAULT_PLATFORM_CONFIG(name) \
134 NB_PLATFORM_CONFIG name = { \
135 DEFAULT_PORT_ENABLE_MAP, \
136 DEFAULT_PORT_FORCE_GEN1, \
137 DEFAULT_HOTPLUG_SUPPORT, \
138 DEFAULT_HOTPLUG_DESCRIPTOR, \
139 DEFAULT_TEMPMMIO_BASE_ADDRESS, \
140 DEFAULT_GPP1_CONFIG, \
141 DEFAULT_GPP2_CONFIG, \
142 DEFAULT_GPP3A_CONFIG, \
143 DEFAULT_HT_DEEMPASIES, \
144 /*DEFAULT_HT_PATH,*/ \
145 DEFAULT_APIC_INTERRUPT_BASE, \
146 }
147
148/**
149 * Platform configuration
150 */
151typedef struct {
152 UINT16 PortEnableMap; ///< Bitmap of enabled ports
153 UINT16 PortGen1Map; ///< Bitmap of ports to disable Gen2
154 UINT16 PortHotplugMap; ///< Bitmap of ports support hotplug
155 UINT8 PortHotplugDescriptors[8];///< Ports Hotplug descriptors
156 UINT32 TemporaryMmio; ///< Temporary MMIO
157 UINT32 Gpp1Config; ///< Default PCIe GFX core configuration
158 UINT32 Gpp2Config; ///< Default PCIe GPP2 core configuration
159 UINT32 Gpp3aConfig; ///< Default PCIe GPP3a core configuration
160 UINT8 NbTransmitterDeemphasis; ///< HT transmitter de-emphasis level
161 // HT_PATH NbHtPath; ///< HT path to NB
162 UINT8 GlobalApicInterruptBase; ///< Global APIC interrupt base that is used in MADT table for IO APIC.
163} NB_PLATFORM_CONFIG;
164
165/**
166 * Bridge CIMx configuration
167 */
168void rd890_cimx_config(AMD_NB_CONFIG_BLOCK *pConfig, NB_CONFIG *nbConfig, HT_CONFIG *htConfig, PCIE_CONFIG *pcieConfig);
169
170#endif //_RD890_CFG_H_