blob: 3bce9b687f7d89cec7e231182433a55e82d79b71 [file] [log] [blame]
Kerry Sheh6b909f22012-02-07 20:31:40 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010017 * Foundation, Inc.
Kerry Sheh6b909f22012-02-07 20:31:40 +080018 */
19
20#ifndef _NB_PLATFORM_H_
21#define _NB_PLATFORM_H_
22
23#define SERIAL_OUT_SUPPORT //enable serial output
24#define CIMX_DEBUG
25
26#ifdef CIMX_DEBUG
27#define CIMX_TRACE_SUPPORT
28#define CIMX_ASSERT_SUPPORT
29#endif
30
31#ifdef CIMX_TRACE_SUPPORT
32 #define CIMX_INIT_TRACE(Arguments)
33 #if CONFIG_REDIRECT_NBCIMX_TRACE_TO_SERIAL
34 #define TRACE_DATA(Ptr, Level) BIOS_DEBUG //always enable
35 #define CIMX_TRACE(Argument) do {do_printk Argument;} while (0)
36 #else
37 #define TRACE_DATA(Ptr, Level)
38 #define CIMX_TRACE(Argument)
39 #endif
40#else
41 #define CIMX_TRACE(Argument)
42 #define CIMX_INIT_TRACE(Arguments)
43#endif
44
45#ifdef CIMX_ASSERT_SUPPORT
46 #ifdef ASSERT
47 #undef ASSERT
48 #define ASSERT CIMX_ASSERT
49 #endif
50 #ifdef CIMX_TRACE_SUPPORT
51 #define CIMX_ASSERT(x) if(!(x)) {\
52 LibAmdTraceDebug (CIMX_TRACE_ALL, (CHAR8 *)"ASSERT !!! "__FILE__" - line %d\n", __LINE__); \
53 /*__asm {jmp $}; */\
54 }
55 //#define IDS_HDT_CONSOLE(s, args...) do_printk(BIOS_DEBUG, s, ##args)
56 #else
57 #define CIMX_ASSERT(x) if(!(x)) {\
58 /*__asm {jmp $}; */\
59 }
60 #endif
61#else
62 #define CIMX_ASSERT(x)
63#endif
64
65/*----------------------------------------------------------------------------------------
66 * E X P O R T E D F U N C T I O N S
67 *----------------------------------------------------------------------------------------
68 */
69
70//#define STALL(Ptr, TimeUs, Flag) LibAmdSbStall(TimeUs)
71#define STALL(Ptr, TimeUs, Flag) LibAmdSbStall(TimeUs, Ptr)
72
73#ifdef B2_IMAGE
74#define REPORT_EVENT(Class, Info, Param1, Param2, Param3, Param4, CfgPtr) LibNbEventLog(Class, Info, Param1, Param2, Param3, Param4, CfgPtr)
75#else
76#define REPORT_EVENT(Class, Info, Param1, Param2, Param3, Param4, CfgPtr)
77#endif
78
79
80
81// CIMX configuration parameters
82//#define CIMX_B2_IMAGE_BASE_ADDRESS 0xFFF40000
Martin Rothf4cb4122015-01-06 10:27:39 -070083/*
84 * PCIEX_BASE_ADDRESS - Define PCIE base address
Kerry Sheh6b909f22012-02-07 20:31:40 +080085 */
86#ifdef MOVE_PCIEBAR_TO_F0000000
87#define PCIEX_BASE_ADDRESS 0xF7000000
88#else
89#define PCIEX_BASE_ADDRESS CONFIG_MMCONF_BASE_ADDRESS
90#endif
91
92
93
94#define CIMX_S3_SAVE 1
Vikram Narayanan2f00ce32012-04-21 23:47:56 +053095#include <cpu/amd/common/cbtypes.h>
Kerry Sheh6b909f22012-02-07 20:31:40 +080096#include <console/console.h>
97
98#include "amd.h" //cimx typedef
99#include <amdlib.h>
100#include "amdAcpiLib.h"
101#include "amdAcpiMadt.h"
102#include "amdAcpiIvrs.h"
103#include "amdSbLib.h"
104#include "nbPcie.h"
105
106//must put before the nbType.h
107#include "platform_cfg.h" /*platform dependented configuration */
108#include "nbType.h"
109
110#include "nbLib.h"
111#include "nbDef.h"
112#include "nbInit.h"
113#include "nbHtInit.h"
114#include "nbIommu.h"
115#include "nbEventLog.h"
116#include "nbRegisters.h"
117#include "nbPcieAspm.h"
118#include "nbPcieLinkWidth.h"
119#include "nbPcieHotplug.h"
120#include "nbPciePortRemap.h"
121#include "nbPcieWorkarounds.h"
122#include "nbPcieCplBuffers.h"
123#include "nbPciePllControl.h"
124#include "nbMiscInit.h"
125#include "nbIoApic.h"
126#include "nbPcieSb.h"
127#include "nbRecovery.h"
128#include "nbMaskedMemoryInit.h"
129
130
131#define FIX_PTR_ADDR(x, y) x
132
133#define TRACE_ALWAYS 0xffffffff
134
135#define AmdNbDispatcher NULL
136
137#define CIMX_TRACE_ALL 0xFFFFFFFF
138#define CIMX_NBPOR_TRACE 0xFFFFFFFF
139#define CIMX_NBHT_TRACE 0xFFFFFFFF
140#define CIMX_NBPCIE_TRACE 0xFFFFFFFF
141#define CIMX_NB_TRACE 0xFFFFFFFF
142#define CIMX_NBPCIE_MISC 0xFFFFFFFF
143
144#endif