aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/cimx/rd890/NbPlatform.h
blob: 20f797468f6130972316871cae2993ccdc3f2679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*
 * This file is part of the coreboot project.
 *
 * Copyright (C) 2012 Advanced Micro Devices, Inc.
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef _NB_PLATFORM_H_
#define _NB_PLATFORM_H_

#define SERIAL_OUT_SUPPORT //enable serial output
#define CIMX_DEBUG

#ifdef  CIMX_DEBUG
#define CIMX_TRACE_SUPPORT
#define CIMX_ASSERT_SUPPORT
#endif

#ifdef  CIMX_TRACE_SUPPORT
	#define CIMX_INIT_TRACE(Arguments)
	#if CONFIG_REDIRECT_NBCIMX_TRACE_TO_SERIAL
		#define TRACE_DATA(Ptr, Level) BIOS_DEBUG //always enable
		#define CIMX_TRACE(Argument) do {do_printk Argument;} while (0)
	#else
		#define TRACE_DATA(Ptr, Level)
		#define CIMX_TRACE(Argument)
	#endif
#else
	#define CIMX_TRACE(Argument)
	#define CIMX_INIT_TRACE(Arguments)
#endif

#ifdef CIMX_ASSERT_SUPPORT
	#ifdef ASSERT
		#undef ASSERT
		#define ASSERT CIMX_ASSERT
	#endif
	#ifdef CIMX_TRACE_SUPPORT
		#define CIMX_ASSERT(x)  if(!(x)) {\
			LibAmdTraceDebug (CIMX_TRACE_ALL, (CHAR8 *)"ASSERT !!! "__FILE__" - line %d\n", __LINE__); \
			/*__asm {jmp $}; */\
		}
	//#define IDS_HDT_CONSOLE(s, args...) do_printk(BIOS_DEBUG, s, ##args)
	#else
		#define CIMX_ASSERT(x) if(!(x)) {\
			/*__asm {jmp $}; */\
		}
	#endif
#else
	#define CIMX_ASSERT(x)
#endif

/*----------------------------------------------------------------------------------------
 *                          E X P O R T E D    F U N C T I O N S
 *----------------------------------------------------------------------------------------
 */

//#define STALL(Ptr, TimeUs, Flag) LibAmdSbStall(TimeUs)
#define STALL(Ptr, TimeUs, Flag) LibAmdSbStall(TimeUs, Ptr)

#ifdef  B2_IMAGE
#define REPORT_EVENT(Class, Info, Param1, Param2, Param3, Param4, CfgPtr) LibNbEventLog(Class, Info, Param1, Param2, Param3, Param4, CfgPtr)
#else
#define REPORT_EVENT(Class, Info, Param1, Param2, Param3, Param4, CfgPtr)
#endif



// CIMX configuration parameters
//#define CIMX_B2_IMAGE_BASE_ADDRESS      0xFFF40000
/**
 * PCIEX_BASE_ADDRESS - Define PCIE base address
 *
 * @param[Option]     MOVE_PCIEBAR_TO_F0000000 Set PCIe base address to 0xF7000000
 */
#ifdef  MOVE_PCIEBAR_TO_F0000000
#define PCIEX_BASE_ADDRESS           0xF7000000
#else
#define PCIEX_BASE_ADDRESS           CONFIG_MMCONF_BASE_ADDRESS
#endif



#define CIMX_S3_SAVE 1
#include <cpu/amd/common/cbtypes.h>
#include <console/console.h>

#include "amd.h" //cimx typedef
#include <amdlib.h>
#include "amdAcpiLib.h"
#include "amdAcpiMadt.h"
#include "amdAcpiIvrs.h"
#include "amdSbLib.h"
#include "nbPcie.h"

//must put before the nbType.h
#include "platform_cfg.h" /*platform dependented configuration */
#include "nbType.h"

#include "nbLib.h"
#include "nbDef.h"
#include "nbInit.h"
#include "nbHtInit.h"
#include "nbIommu.h"
#include "nbEventLog.h"
#include "nbRegisters.h"
#include "nbPcieAspm.h"
#include "nbPcieLinkWidth.h"
#include "nbPcieHotplug.h"
#include "nbPciePortRemap.h"
#include "nbPcieWorkarounds.h"
#include "nbPcieCplBuffers.h"
#include "nbPciePllControl.h"
#include "nbMiscInit.h"
#include "nbIoApic.h"
#include "nbPcieSb.h"
#include "nbRecovery.h"
#include "nbMaskedMemoryInit.h"


#define FIX_PTR_ADDR(x, y) x

#define TRACE_ALWAYS  0xffffffff

#define AmdNbDispatcher NULL

#define CIMX_TRACE_ALL    0xFFFFFFFF
#define CIMX_NBPOR_TRACE  0xFFFFFFFF
#define CIMX_NBHT_TRACE   0xFFFFFFFF
#define CIMX_NBPCIE_TRACE 0xFFFFFFFF
#define CIMX_NB_TRACE     0xFFFFFFFF
#define CIMX_NBPCIE_MISC  0xFFFFFFFF

#endif