Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cvmx-bootinfo.h
Go to the documentation of this file.
1 /***********************license start***************
2  * Author: Cavium Networks
3  *
4  * Contact: [email protected]
5  * This file is part of the OCTEON SDK
6  *
7  * Copyright (c) 2003-2008 Cavium Networks
8  *
9  * This file is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License, Version 2, as
11  * published by the Free Software Foundation.
12  *
13  * This file is distributed in the hope that it will be useful, but
14  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16  * NONINFRINGEMENT. See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this file; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  * or visit http://www.gnu.org/licenses/.
23  *
24  * This file may also be available under a different license from Cavium.
25  * Contact Cavium Networks for more information
26  ***********************license end**************************************/
27 
28 /*
29  * Header file containing the ABI with the bootloader.
30  */
31 
32 #ifndef __CVMX_BOOTINFO_H__
33 #define __CVMX_BOOTINFO_H__
34 
35 /*
36  * Current major and minor versions of the CVMX bootinfo block that is
37  * passed from the bootloader to the application. This is versioned
38  * so that applications can properly handle multiple bootloader
39  * versions.
40  */
41 #define CVMX_BOOTINFO_MAJ_VER 1
42 #define CVMX_BOOTINFO_MIN_VER 3
43 
44 #if (CVMX_BOOTINFO_MAJ_VER == 1)
45 #define CVMX_BOOTINFO_OCTEON_SERIAL_LEN 20
46 /*
47  * This structure is populated by the bootloader. For binary
48  * compatibility the only changes that should be made are
49  * adding members to the end of the structure, and the minor
50  * version should be incremented at that time.
51  * If an incompatible change is made, the major version
52  * must be incremented, and the minor version should be reset
53  * to 0.
54  */
55 struct cvmx_bootinfo {
58 
63 
68  /* DRAM size in megabytes */
70  /* physical address of free memory descriptor block*/
72  /* used to pass flags from app to debugger */
74 
75  /* CPU clock speed, in hz */
77 
78  /* DRAM clock speed, in hz */
80 
91 #if (CVMX_BOOTINFO_MIN_VER >= 1)
92  /*
93  * Several boards support compact flash on the Octeon boot
94  * bus. The CF memory spaces may be mapped to different
95  * addresses on different boards. These are the physical
96  * addresses, so care must be taken to use the correct
97  * XKPHYS/KSEG0 addressing depending on the application's
98  * ABI. These values will be 0 if CF is not present.
99  */
102  /*
103  * Base address of the LED display (as on EBT3000 board)
104  * This will be 0 if LED display not present.
105  */
107 #endif
108 #if (CVMX_BOOTINFO_MIN_VER >= 2)
109  /* DFA reference clock in hz (if applicable)*/
111 
112  /*
113  * flags indicating various configuration options. These
114  * flags supercede the 'flags' variable and should be used
115  * instead if available.
116  */
118 #endif
119 #if (CVMX_BOOTINFO_MIN_VER >= 3)
120  /*
121  * Address of the OF Flattened Device Tree structure
122  * describing the board.
123  */
125 #endif
126 };
127 
128 #define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0)
129 #define CVMX_BOOTINFO_CFG_FLAG_PCI_TARGET (1ull << 1)
130 #define CVMX_BOOTINFO_CFG_FLAG_DEBUG (1ull << 2)
131 #define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3)
132 /* This flag is set if the TLB mappings are not contained in the
133  * 0x10000000 - 0x20000000 boot bus region. */
134 #define CVMX_BOOTINFO_CFG_FLAG_OVERSIZE_TLB_MAPPING (1ull << 4)
135 #define CVMX_BOOTINFO_CFG_FLAG_BREAK (1ull << 5)
136 
137 #endif /* (CVMX_BOOTINFO_MAJ_VER == 1) */
138 
139 /* Type defines for board and chip types */
146  CVMX_BOARD_TYPE_NAC38 = 5, /* formerly NAO38 */
155  /* Deprecated, CVMX_BOARD_TYPE_CN3010_EVB_HS5 supports the CN3020 */
170  /* Special 'generic' board type, supports many boards */
190 
191  /*
192  * The range from CVMX_BOARD_TYPE_MAX to
193  * CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved for future
194  * SDK use.
195  */
196 
197  /*
198  * Set aside a range for customer boards. These numbers are managed
199  * by Cavium.
200  */
224 
225  /*
226  * Set aside a range for customer private use. The SDK won't
227  * use any numbers in this range.
228  */
231 
232  /* The remaining range is reserved for future use. */
233 };
234 
240 };
241 
242 /* Compatibility alias for NAC38 name change, planned to be removed
243  * from SDK 1.7 */
244 #define CVMX_BOARD_TYPE_NAO38 CVMX_BOARD_TYPE_NAC38
245 
246 /* Functions to return string based on type */
247 #define ENUM_BRD_TYPE_CASE(x) \
248  case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
249 static inline const char *cvmx_board_type_to_string(enum
251 {
252  switch (type) {
300 
301  /* Customer boards listed here */
325 
326  /* Customer private range */
329  }
330  return "Unsupported Board";
331 }
332 
333 #define ENUM_CHIP_TYPE_CASE(x) \
334  case x: return(#x + 15); /* Skip CVMX_CHIP_TYPE */
335 static inline const char *cvmx_chip_type_to_string(enum
337 {
338  switch (type) {
343  }
344  return "Unsupported Chip";
345 }
346 
347 #endif /* __CVMX_BOOTINFO_H__ */