Deleted Added
full compact
cvmx-app-init.h (216476) cvmx-app-init.h (232812)
1/***********************license start***************
1/***********************license start***************
2 * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights
2 * Copyright (c) 2003-2012 Cavium Inc. (support@cavium.com). All rights
3 * reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17
3 * reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17
18 * * Neither the name of Cavium Networks nor the names of
18 * * Neither the name of Cavium Inc. nor the names of
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written
21 * permission.
22
23 * This Software, including technical data, may be subject to U.S. export control
24 * laws, including the U.S. Export Administration Act and its associated
25 * regulations, and may be subject to export or import regulations in other
26 * countries.
27
28 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written
21 * permission.
22
23 * This Software, including technical data, may be subject to U.S. export control
24 * laws, including the U.S. Export Administration Act and its associated
25 * regulations, and may be subject to export or import regulations in other
26 * countries.
27
28 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29 * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
29 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
30 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
37 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38 ***********************license end**************************************/
39
40
41
42
43
44
45/**
46 * @file
47 * Header file for simple executive application initialization. This defines
48 * part of the ABI between the bootloader and the application.
30 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
37 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38 ***********************license end**************************************/
39
40
41
42
43
44
45/**
46 * @file
47 * Header file for simple executive application initialization. This defines
48 * part of the ABI between the bootloader and the application.
49 * <hr>$Revision: 52004 $<hr>
49 * <hr>$Revision: 70327 $<hr>
50 *
51 */
52
53#ifndef __CVMX_APP_INIT_H__
54#define __CVMX_APP_INIT_H__
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60
61/* Current major and minor versions of the CVMX bootinfo block that is passed
62** from the bootloader to the application. This is versioned so that applications
63** can properly handle multiple bootloader versions. */
64#define CVMX_BOOTINFO_MAJ_VER 1
50 *
51 */
52
53#ifndef __CVMX_APP_INIT_H__
54#define __CVMX_APP_INIT_H__
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60
61/* Current major and minor versions of the CVMX bootinfo block that is passed
62** from the bootloader to the application. This is versioned so that applications
63** can properly handle multiple bootloader versions. */
64#define CVMX_BOOTINFO_MAJ_VER 1
65#define CVMX_BOOTINFO_MIN_VER 2
65#define CVMX_BOOTINFO_MIN_VER 3
66
67
68#if (CVMX_BOOTINFO_MAJ_VER == 1)
69#define CVMX_BOOTINFO_OCTEON_SERIAL_LEN 20
70/* This structure is populated by the bootloader. For binary
71** compatibility the only changes that should be made are
72** adding members to the end of the structure, and the minor
73** version should be incremented at that time.
74** If an incompatible change is made, the major version
75** must be incremented, and the minor version should be reset
76** to 0.
77*/
78struct cvmx_bootinfo {
66
67
68#if (CVMX_BOOTINFO_MAJ_VER == 1)
69#define CVMX_BOOTINFO_OCTEON_SERIAL_LEN 20
70/* This structure is populated by the bootloader. For binary
71** compatibility the only changes that should be made are
72** adding members to the end of the structure, and the minor
73** version should be incremented at that time.
74** If an incompatible change is made, the major version
75** must be incremented, and the minor version should be reset
76** to 0.
77*/
78struct cvmx_bootinfo {
79#ifdef __BIG_ENDIAN_BITFIELD
79 uint32_t major_version;
80 uint32_t minor_version;
81
82 uint64_t stack_top;
83 uint64_t heap_base;
84 uint64_t heap_end;
85 uint64_t desc_vaddr;
86

--- 28 unchanged lines hidden (view full) ---

115 ** This will be 0 if LED display not present. */
116 uint64_t led_display_base_addr;
117#endif
118#if (CVMX_BOOTINFO_MIN_VER >= 2)
119 uint32_t dfa_ref_clock_hz; /**< DFA reference clock in hz (if applicable)*/
120 uint32_t config_flags; /**< flags indicating various configuration options. These flags supercede
121 ** the 'flags' variable and should be used instead if available */
122#endif
80 uint32_t major_version;
81 uint32_t minor_version;
82
83 uint64_t stack_top;
84 uint64_t heap_base;
85 uint64_t heap_end;
86 uint64_t desc_vaddr;
87

--- 28 unchanged lines hidden (view full) ---

116 ** This will be 0 if LED display not present. */
117 uint64_t led_display_base_addr;
118#endif
119#if (CVMX_BOOTINFO_MIN_VER >= 2)
120 uint32_t dfa_ref_clock_hz; /**< DFA reference clock in hz (if applicable)*/
121 uint32_t config_flags; /**< flags indicating various configuration options. These flags supercede
122 ** the 'flags' variable and should be used instead if available */
123#endif
124#if (CVMX_BOOTINFO_MIN_VER >= 3)
125 uint64_t fdt_addr; /**< Address of the OF Flattened Device Tree structure describing the board. */
126#endif
127#else /* __BIG_ENDIAN */
128 /*
129 * Little-Endian: When the CPU mode is switched to
130 * little-endian, the view of the structure has some of the
131 * fields swapped.
132 */
133 uint32_t minor_version;
134 uint32_t major_version;
123
135
136 uint64_t stack_top;
137 uint64_t heap_base;
138 uint64_t heap_end;
139 uint64_t desc_vaddr;
124
140
141 uint32_t stack_size;
142 uint32_t exception_base_addr;
143
144 uint32_t core_mask;
145 uint32_t flags;
146
147 uint32_t phy_mem_desc_addr;
148 uint32_t dram_size;
149
150 uint32_t eclock_hz;
151 uint32_t debugger_flags_base_addr;
152
153 uint32_t reserved0;
154 uint32_t dclock_hz;
155
156 uint8_t reserved3;
157 uint8_t reserved2;
158 uint16_t reserved1;
159 uint8_t board_rev_minor;
160 uint8_t board_rev_major;
161 uint16_t board_type;
162
163 union cvmx_bootinfo_scramble {
164 /* Must byteswap these four words so that...*/
165 uint64_t s[4];
166 /* ... this strucure has the proper data arrangement. */
167 struct {
168 char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN];
169 uint8_t mac_addr_base[6];
170 uint8_t mac_addr_count;
171 uint8_t pad[5];
172 } le;
173 } scramble1;
174
175#if (CVMX_BOOTINFO_MIN_VER >= 1)
176 uint64_t compact_flash_common_base_addr;
177 uint64_t compact_flash_attribute_base_addr;
178 uint64_t led_display_base_addr;
179#endif
180#if (CVMX_BOOTINFO_MIN_VER >= 2)
181 uint32_t config_flags;
182 uint32_t dfa_ref_clock_hz;
183#endif
184#if (CVMX_BOOTINFO_MIN_VER >= 3)
185 uint64_t fdt_addr;
186#endif
187#endif
125};
126
127typedef struct cvmx_bootinfo cvmx_bootinfo_t;
128
129#define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0)
130#define CVMX_BOOTINFO_CFG_FLAG_PCI_TARGET (1ull << 1)
131#define CVMX_BOOTINFO_CFG_FLAG_DEBUG (1ull << 2)
132#define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3)

--- 7 unchanged lines hidden (view full) ---

140
141/* Type defines for board and chip types */
142enum cvmx_board_types_enum {
143 CVMX_BOARD_TYPE_NULL = 0,
144 CVMX_BOARD_TYPE_SIM = 1,
145 CVMX_BOARD_TYPE_EBT3000 = 2,
146 CVMX_BOARD_TYPE_KODAMA = 3,
147 CVMX_BOARD_TYPE_NIAGARA = 4, /* Obsolete, no longer supported */
188};
189
190typedef struct cvmx_bootinfo cvmx_bootinfo_t;
191
192#define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0)
193#define CVMX_BOOTINFO_CFG_FLAG_PCI_TARGET (1ull << 1)
194#define CVMX_BOOTINFO_CFG_FLAG_DEBUG (1ull << 2)
195#define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3)

--- 7 unchanged lines hidden (view full) ---

203
204/* Type defines for board and chip types */
205enum cvmx_board_types_enum {
206 CVMX_BOARD_TYPE_NULL = 0,
207 CVMX_BOARD_TYPE_SIM = 1,
208 CVMX_BOARD_TYPE_EBT3000 = 2,
209 CVMX_BOARD_TYPE_KODAMA = 3,
210 CVMX_BOARD_TYPE_NIAGARA = 4, /* Obsolete, no longer supported */
148 CVMX_BOARD_TYPE_NAC38 = 5, /* formerly NAO38 */
211 CVMX_BOARD_TYPE_NAC38 = 5, /* Obsolete, no longer supported */
149 CVMX_BOARD_TYPE_THUNDER = 6,
150 CVMX_BOARD_TYPE_TRANTOR = 7, /* Obsolete, no longer supported */
151 CVMX_BOARD_TYPE_EBH3000 = 8,
152 CVMX_BOARD_TYPE_EBH3100 = 9,
153 CVMX_BOARD_TYPE_HIKARI = 10,
154 CVMX_BOARD_TYPE_CN3010_EVB_HS5 = 11,
155 CVMX_BOARD_TYPE_CN3005_EVB_HS5 = 12,
156 CVMX_BOARD_TYPE_KBP = 13,

--- 16 unchanged lines hidden (view full) ---

173 CVMX_BOARD_TYPE_LANAI2_A = 30,
174 CVMX_BOARD_TYPE_LANAI2_U = 31,
175 CVMX_BOARD_TYPE_EBB5600 = 32,
176 CVMX_BOARD_TYPE_EBB6300 = 33,
177 CVMX_BOARD_TYPE_NIC_XLE_10G = 34,
178 CVMX_BOARD_TYPE_LANAI2_G = 35,
179 CVMX_BOARD_TYPE_EBT5810 = 36,
180 CVMX_BOARD_TYPE_NIC10E = 37,
212 CVMX_BOARD_TYPE_THUNDER = 6,
213 CVMX_BOARD_TYPE_TRANTOR = 7, /* Obsolete, no longer supported */
214 CVMX_BOARD_TYPE_EBH3000 = 8,
215 CVMX_BOARD_TYPE_EBH3100 = 9,
216 CVMX_BOARD_TYPE_HIKARI = 10,
217 CVMX_BOARD_TYPE_CN3010_EVB_HS5 = 11,
218 CVMX_BOARD_TYPE_CN3005_EVB_HS5 = 12,
219 CVMX_BOARD_TYPE_KBP = 13,

--- 16 unchanged lines hidden (view full) ---

236 CVMX_BOARD_TYPE_LANAI2_A = 30,
237 CVMX_BOARD_TYPE_LANAI2_U = 31,
238 CVMX_BOARD_TYPE_EBB5600 = 32,
239 CVMX_BOARD_TYPE_EBB6300 = 33,
240 CVMX_BOARD_TYPE_NIC_XLE_10G = 34,
241 CVMX_BOARD_TYPE_LANAI2_G = 35,
242 CVMX_BOARD_TYPE_EBT5810 = 36,
243 CVMX_BOARD_TYPE_NIC10E = 37,
244 CVMX_BOARD_TYPE_EP6300C = 38,
245 CVMX_BOARD_TYPE_EBB6800 = 39,
246 CVMX_BOARD_TYPE_NIC4E = 40,
247 CVMX_BOARD_TYPE_NIC2E = 41,
248 CVMX_BOARD_TYPE_EBB6600 = 42,
249 CVMX_BOARD_TYPE_REDWING = 43,
250 CVMX_BOARD_TYPE_NIC68_4 = 44,
251 CVMX_BOARD_TYPE_NIC10E_66 = 45,
252 CVMX_BOARD_TYPE_EBB6100 = 46,
253 CVMX_BOARD_TYPE_EVB7100 = 47,
181 CVMX_BOARD_TYPE_MAX,
254 CVMX_BOARD_TYPE_MAX,
255 /* NOTE: 256-257 are being used by a customer. */
182
183 /* The range from CVMX_BOARD_TYPE_MAX to CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved
184 ** for future SDK use. */
185
186 /* Set aside a range for customer boards. These numbers are managed
187 ** by Cavium.
188 */
189 CVMX_BOARD_TYPE_CUST_DEFINED_MIN = 10000,

--- 44 unchanged lines hidden (view full) ---

234 CVMX_BOARD_TYPE_MODULE_PCIE_EP_4X = 30003,
235 CVMX_BOARD_TYPE_MODULE_SGMII_MARVEL = 30004,
236 CVMX_BOARD_TYPE_MODULE_SFPPLUS_BCM = 30005,
237 CVMX_BOARD_TYPE_MODULE_SRIO = 30006,
238 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM0 = 30007,
239 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM1 = 30008,
240 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM2 = 30009,
241 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM3 = 30010,
256
257 /* The range from CVMX_BOARD_TYPE_MAX to CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved
258 ** for future SDK use. */
259
260 /* Set aside a range for customer boards. These numbers are managed
261 ** by Cavium.
262 */
263 CVMX_BOARD_TYPE_CUST_DEFINED_MIN = 10000,

--- 44 unchanged lines hidden (view full) ---

308 CVMX_BOARD_TYPE_MODULE_PCIE_EP_4X = 30003,
309 CVMX_BOARD_TYPE_MODULE_SGMII_MARVEL = 30004,
310 CVMX_BOARD_TYPE_MODULE_SFPPLUS_BCM = 30005,
311 CVMX_BOARD_TYPE_MODULE_SRIO = 30006,
312 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM0 = 30007,
313 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM1 = 30008,
314 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM2 = 30009,
315 CVMX_BOARD_TYPE_MODULE_EBB5600_QLM3 = 30010,
242 CVMX_BOARD_TYPE_MODULE_MAX = 31000,
316 CVMX_BOARD_TYPE_MODULE_MAX = 31000
243
244 /* The remaining range is reserved for future use. */
245};
246enum cvmx_chip_types_enum {
247 CVMX_CHIP_TYPE_NULL = 0,
248 CVMX_CHIP_SIM_TYPE_DEPRECATED = 1,
249 CVMX_CHIP_TYPE_OCTEON_SAMPLE = 2,
317
318 /* The remaining range is reserved for future use. */
319};
320enum cvmx_chip_types_enum {
321 CVMX_CHIP_TYPE_NULL = 0,
322 CVMX_CHIP_SIM_TYPE_DEPRECATED = 1,
323 CVMX_CHIP_TYPE_OCTEON_SAMPLE = 2,
250 CVMX_CHIP_TYPE_MAX,
324 CVMX_CHIP_TYPE_MAX
251};
252
253/* Compatability alias for NAC38 name change, planned to be removed from SDK 1.7 */
254#define CVMX_BOARD_TYPE_NAO38 CVMX_BOARD_TYPE_NAC38
255
256/* Functions to return string based on type */
257#define ENUM_BRD_TYPE_CASE(x) case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
258static inline const char *cvmx_board_type_to_string(enum cvmx_board_types_enum type)

--- 33 unchanged lines hidden (view full) ---

292 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_A)
293 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_U)
294 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB5600)
295 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6300)
296 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_10G)
297 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_G)
298 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5810)
299 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC10E)
325};
326
327/* Compatability alias for NAC38 name change, planned to be removed from SDK 1.7 */
328#define CVMX_BOARD_TYPE_NAO38 CVMX_BOARD_TYPE_NAC38
329
330/* Functions to return string based on type */
331#define ENUM_BRD_TYPE_CASE(x) case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
332static inline const char *cvmx_board_type_to_string(enum cvmx_board_types_enum type)

--- 33 unchanged lines hidden (view full) ---

366 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_A)
367 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_U)
368 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB5600)
369 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6300)
370 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_10G)
371 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_G)
372 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5810)
373 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC10E)
374 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EP6300C)
375 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6800)
376 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC4E)
377 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC2E)
378 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6600)
379 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_REDWING)
380 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC68_4)
381 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC10E_66)
382 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6100)
383 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EVB7100)
300 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX)
301
302 /* Customer boards listed here */
303 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MIN)
304 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WSX16)
305 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NS0216)
306 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NB5)
307 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WMR500)

--- 75 unchanged lines hidden ---
384 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX)
385
386 /* Customer boards listed here */
387 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MIN)
388 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WSX16)
389 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NS0216)
390 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NB5)
391 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WMR500)

--- 75 unchanged lines hidden ---