18c2ecf20Sopenharmony_ci/***********************license start*************** 28c2ecf20Sopenharmony_ci * Author: Cavium Networks 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Contact: support@caviumnetworks.com 58c2ecf20Sopenharmony_ci * This file is part of the OCTEON SDK 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Copyright (c) 2003-2008 Cavium Networks 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * This file is free software; you can redistribute it and/or modify 108c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License, Version 2, as 118c2ecf20Sopenharmony_ci * published by the Free Software Foundation. 128c2ecf20Sopenharmony_ci * 138c2ecf20Sopenharmony_ci * This file is distributed in the hope that it will be useful, but 148c2ecf20Sopenharmony_ci * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty 158c2ecf20Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or 168c2ecf20Sopenharmony_ci * NONINFRINGEMENT. See the GNU General Public License for more 178c2ecf20Sopenharmony_ci * details. 188c2ecf20Sopenharmony_ci * 198c2ecf20Sopenharmony_ci * You should have received a copy of the GNU General Public License 208c2ecf20Sopenharmony_ci * along with this file; if not, write to the Free Software 218c2ecf20Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 228c2ecf20Sopenharmony_ci * or visit http://www.gnu.org/licenses/. 238c2ecf20Sopenharmony_ci * 248c2ecf20Sopenharmony_ci * This file may also be available under a different license from Cavium. 258c2ecf20Sopenharmony_ci * Contact Cavium Networks for more information 268c2ecf20Sopenharmony_ci ***********************license end**************************************/ 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci/* 298c2ecf20Sopenharmony_ci * Header file containing the ABI with the bootloader. 308c2ecf20Sopenharmony_ci */ 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#ifndef __CVMX_BOOTINFO_H__ 338c2ecf20Sopenharmony_ci#define __CVMX_BOOTINFO_H__ 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#include "cvmx-coremask.h" 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* 388c2ecf20Sopenharmony_ci * Current major and minor versions of the CVMX bootinfo block that is 398c2ecf20Sopenharmony_ci * passed from the bootloader to the application. This is versioned 408c2ecf20Sopenharmony_ci * so that applications can properly handle multiple bootloader 418c2ecf20Sopenharmony_ci * versions. 428c2ecf20Sopenharmony_ci */ 438c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_MAJ_VER 1 448c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_MIN_VER 4 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MAJ_VER == 1) 478c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_OCTEON_SERIAL_LEN 20 488c2ecf20Sopenharmony_ci/* 498c2ecf20Sopenharmony_ci * This structure is populated by the bootloader. For binary 508c2ecf20Sopenharmony_ci * compatibility the only changes that should be made are 518c2ecf20Sopenharmony_ci * adding members to the end of the structure, and the minor 528c2ecf20Sopenharmony_ci * version should be incremented at that time. 538c2ecf20Sopenharmony_ci * If an incompatible change is made, the major version 548c2ecf20Sopenharmony_ci * must be incremented, and the minor version should be reset 558c2ecf20Sopenharmony_ci * to 0. 568c2ecf20Sopenharmony_ci */ 578c2ecf20Sopenharmony_cistruct cvmx_bootinfo { 588c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD 598c2ecf20Sopenharmony_ci uint32_t major_version; 608c2ecf20Sopenharmony_ci uint32_t minor_version; 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci uint64_t stack_top; 638c2ecf20Sopenharmony_ci uint64_t heap_base; 648c2ecf20Sopenharmony_ci uint64_t heap_end; 658c2ecf20Sopenharmony_ci uint64_t desc_vaddr; 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci uint32_t exception_base_addr; 688c2ecf20Sopenharmony_ci uint32_t stack_size; 698c2ecf20Sopenharmony_ci uint32_t flags; 708c2ecf20Sopenharmony_ci uint32_t core_mask; 718c2ecf20Sopenharmony_ci /* DRAM size in megabytes */ 728c2ecf20Sopenharmony_ci uint32_t dram_size; 738c2ecf20Sopenharmony_ci /* physical address of free memory descriptor block*/ 748c2ecf20Sopenharmony_ci uint32_t phy_mem_desc_addr; 758c2ecf20Sopenharmony_ci /* used to pass flags from app to debugger */ 768c2ecf20Sopenharmony_ci uint32_t debugger_flags_base_addr; 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci /* CPU clock speed, in hz */ 798c2ecf20Sopenharmony_ci uint32_t eclock_hz; 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci /* DRAM clock speed, in hz */ 828c2ecf20Sopenharmony_ci uint32_t dclock_hz; 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci uint32_t reserved0; 858c2ecf20Sopenharmony_ci uint16_t board_type; 868c2ecf20Sopenharmony_ci uint8_t board_rev_major; 878c2ecf20Sopenharmony_ci uint8_t board_rev_minor; 888c2ecf20Sopenharmony_ci uint16_t reserved1; 898c2ecf20Sopenharmony_ci uint8_t reserved2; 908c2ecf20Sopenharmony_ci uint8_t reserved3; 918c2ecf20Sopenharmony_ci char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN]; 928c2ecf20Sopenharmony_ci uint8_t mac_addr_base[6]; 938c2ecf20Sopenharmony_ci uint8_t mac_addr_count; 948c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 1) 958c2ecf20Sopenharmony_ci /* 968c2ecf20Sopenharmony_ci * Several boards support compact flash on the Octeon boot 978c2ecf20Sopenharmony_ci * bus. The CF memory spaces may be mapped to different 988c2ecf20Sopenharmony_ci * addresses on different boards. These are the physical 998c2ecf20Sopenharmony_ci * addresses, so care must be taken to use the correct 1008c2ecf20Sopenharmony_ci * XKPHYS/KSEG0 addressing depending on the application's 1018c2ecf20Sopenharmony_ci * ABI. These values will be 0 if CF is not present. 1028c2ecf20Sopenharmony_ci */ 1038c2ecf20Sopenharmony_ci uint64_t compact_flash_common_base_addr; 1048c2ecf20Sopenharmony_ci uint64_t compact_flash_attribute_base_addr; 1058c2ecf20Sopenharmony_ci /* 1068c2ecf20Sopenharmony_ci * Base address of the LED display (as on EBT3000 board) 1078c2ecf20Sopenharmony_ci * This will be 0 if LED display not present. 1088c2ecf20Sopenharmony_ci */ 1098c2ecf20Sopenharmony_ci uint64_t led_display_base_addr; 1108c2ecf20Sopenharmony_ci#endif 1118c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 2) 1128c2ecf20Sopenharmony_ci /* DFA reference clock in hz (if applicable)*/ 1138c2ecf20Sopenharmony_ci uint32_t dfa_ref_clock_hz; 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci /* 1168c2ecf20Sopenharmony_ci * flags indicating various configuration options. These 1178c2ecf20Sopenharmony_ci * flags supercede the 'flags' variable and should be used 1188c2ecf20Sopenharmony_ci * instead if available. 1198c2ecf20Sopenharmony_ci */ 1208c2ecf20Sopenharmony_ci uint32_t config_flags; 1218c2ecf20Sopenharmony_ci#endif 1228c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 3) 1238c2ecf20Sopenharmony_ci /* 1248c2ecf20Sopenharmony_ci * Address of the OF Flattened Device Tree structure 1258c2ecf20Sopenharmony_ci * describing the board. 1268c2ecf20Sopenharmony_ci */ 1278c2ecf20Sopenharmony_ci uint64_t fdt_addr; 1288c2ecf20Sopenharmony_ci#endif 1298c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 4) 1308c2ecf20Sopenharmony_ci /* 1318c2ecf20Sopenharmony_ci * Coremask used for processors with more than 32 cores 1328c2ecf20Sopenharmony_ci * or with OCI. This replaces core_mask. 1338c2ecf20Sopenharmony_ci */ 1348c2ecf20Sopenharmony_ci struct cvmx_coremask ext_core_mask; 1358c2ecf20Sopenharmony_ci#endif 1368c2ecf20Sopenharmony_ci#else /* __BIG_ENDIAN */ 1378c2ecf20Sopenharmony_ci /* 1388c2ecf20Sopenharmony_ci * Little-Endian: When the CPU mode is switched to 1398c2ecf20Sopenharmony_ci * little-endian, the view of the structure has some of the 1408c2ecf20Sopenharmony_ci * fields swapped. 1418c2ecf20Sopenharmony_ci */ 1428c2ecf20Sopenharmony_ci uint32_t minor_version; 1438c2ecf20Sopenharmony_ci uint32_t major_version; 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci uint64_t stack_top; 1468c2ecf20Sopenharmony_ci uint64_t heap_base; 1478c2ecf20Sopenharmony_ci uint64_t heap_end; 1488c2ecf20Sopenharmony_ci uint64_t desc_vaddr; 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci uint32_t stack_size; 1518c2ecf20Sopenharmony_ci uint32_t exception_base_addr; 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci uint32_t core_mask; 1548c2ecf20Sopenharmony_ci uint32_t flags; 1558c2ecf20Sopenharmony_ci 1568c2ecf20Sopenharmony_ci uint32_t phy_mem_desc_addr; 1578c2ecf20Sopenharmony_ci uint32_t dram_size; 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_ci uint32_t eclock_hz; 1608c2ecf20Sopenharmony_ci uint32_t debugger_flags_base_addr; 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci uint32_t reserved0; 1638c2ecf20Sopenharmony_ci uint32_t dclock_hz; 1648c2ecf20Sopenharmony_ci 1658c2ecf20Sopenharmony_ci uint8_t reserved3; 1668c2ecf20Sopenharmony_ci uint8_t reserved2; 1678c2ecf20Sopenharmony_ci uint16_t reserved1; 1688c2ecf20Sopenharmony_ci uint8_t board_rev_minor; 1698c2ecf20Sopenharmony_ci uint8_t board_rev_major; 1708c2ecf20Sopenharmony_ci uint16_t board_type; 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ci char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN]; 1738c2ecf20Sopenharmony_ci uint8_t mac_addr_base[6]; 1748c2ecf20Sopenharmony_ci uint8_t mac_addr_count; 1758c2ecf20Sopenharmony_ci uint8_t pad[5]; 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 1) 1788c2ecf20Sopenharmony_ci uint64_t compact_flash_common_base_addr; 1798c2ecf20Sopenharmony_ci uint64_t compact_flash_attribute_base_addr; 1808c2ecf20Sopenharmony_ci uint64_t led_display_base_addr; 1818c2ecf20Sopenharmony_ci#endif 1828c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 2) 1838c2ecf20Sopenharmony_ci uint32_t config_flags; 1848c2ecf20Sopenharmony_ci uint32_t dfa_ref_clock_hz; 1858c2ecf20Sopenharmony_ci#endif 1868c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 3) 1878c2ecf20Sopenharmony_ci uint64_t fdt_addr; 1888c2ecf20Sopenharmony_ci#endif 1898c2ecf20Sopenharmony_ci#if (CVMX_BOOTINFO_MIN_VER >= 4) 1908c2ecf20Sopenharmony_ci struct cvmx_coremask ext_core_mask; 1918c2ecf20Sopenharmony_ci#endif 1928c2ecf20Sopenharmony_ci#endif 1938c2ecf20Sopenharmony_ci}; 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0) 1968c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_CFG_FLAG_PCI_TARGET (1ull << 1) 1978c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_CFG_FLAG_DEBUG (1ull << 2) 1988c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3) 1998c2ecf20Sopenharmony_ci/* This flag is set if the TLB mappings are not contained in the 2008c2ecf20Sopenharmony_ci * 0x10000000 - 0x20000000 boot bus region. */ 2018c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_CFG_FLAG_OVERSIZE_TLB_MAPPING (1ull << 4) 2028c2ecf20Sopenharmony_ci#define CVMX_BOOTINFO_CFG_FLAG_BREAK (1ull << 5) 2038c2ecf20Sopenharmony_ci 2048c2ecf20Sopenharmony_ci#endif /* (CVMX_BOOTINFO_MAJ_VER == 1) */ 2058c2ecf20Sopenharmony_ci 2068c2ecf20Sopenharmony_ci/* Type defines for board and chip types */ 2078c2ecf20Sopenharmony_cienum cvmx_board_types_enum { 2088c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NULL = 0, 2098c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_SIM = 1, 2108c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBT3000 = 2, 2118c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_KODAMA = 3, 2128c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIAGARA = 4, 2138c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NAC38 = 5, /* formerly NAO38 */ 2148c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_THUNDER = 6, 2158c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_TRANTOR = 7, 2168c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBH3000 = 8, 2178c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBH3100 = 9, 2188c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_HIKARI = 10, 2198c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CN3010_EVB_HS5 = 11, 2208c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CN3005_EVB_HS5 = 12, 2218c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_KBP = 13, 2228c2ecf20Sopenharmony_ci /* Deprecated, CVMX_BOARD_TYPE_CN3010_EVB_HS5 supports the CN3020 */ 2238c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CN3020_EVB_HS5 = 14, 2248c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBT5800 = 15, 2258c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NICPRO2 = 16, 2268c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBH5600 = 17, 2278c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBH5601 = 18, 2288c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBH5200 = 19, 2298c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_BBGW_REF = 20, 2308c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIC_XLE_4G = 21, 2318c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBT5600 = 22, 2328c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBH5201 = 23, 2338c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBT5200 = 24, 2348c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CB5600 = 25, 2358c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CB5601 = 26, 2368c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CB5200 = 27, 2378c2ecf20Sopenharmony_ci /* Special 'generic' board type, supports many boards */ 2388c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_GENERIC = 28, 2398c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBH5610 = 29, 2408c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_LANAI2_A = 30, 2418c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_LANAI2_U = 31, 2428c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBB5600 = 32, 2438c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBB6300 = 33, 2448c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIC_XLE_10G = 34, 2458c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_LANAI2_G = 35, 2468c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBT5810 = 36, 2478c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIC10E = 37, 2488c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EP6300C = 38, 2498c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBB6800 = 39, 2508c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIC4E = 40, 2518c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIC2E = 41, 2528c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_EBB6600 = 42, 2538c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_REDWING = 43, 2548c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIC68_4 = 44, 2558c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_NIC10E_66 = 45, 2568c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_MAX, 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci /* 2598c2ecf20Sopenharmony_ci * The range from CVMX_BOARD_TYPE_MAX to 2608c2ecf20Sopenharmony_ci * CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved for future 2618c2ecf20Sopenharmony_ci * SDK use. 2628c2ecf20Sopenharmony_ci */ 2638c2ecf20Sopenharmony_ci 2648c2ecf20Sopenharmony_ci /* 2658c2ecf20Sopenharmony_ci * Set aside a range for customer boards. These numbers are managed 2668c2ecf20Sopenharmony_ci * by Cavium. 2678c2ecf20Sopenharmony_ci */ 2688c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_DEFINED_MIN = 10000, 2698c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_WSX16 = 10001, 2708c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_NS0216 = 10002, 2718c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_NB5 = 10003, 2728c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_WMR500 = 10004, 2738c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_ITB101 = 10005, 2748c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_NTE102 = 10006, 2758c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_AGS103 = 10007, 2768c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_GST104 = 10008, 2778c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_GCT105 = 10009, 2788c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_AGS106 = 10010, 2798c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_SGM107 = 10011, 2808c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_GCT108 = 10012, 2818c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_AGS109 = 10013, 2828c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_GCT110 = 10014, 2838c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_L2_AIR_SENDER = 10015, 2848c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_L2_AIR_RECEIVER = 10016, 2858c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_L2_ACCTON2_TX = 10017, 2868c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_L2_ACCTON2_RX = 10018, 2878c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_TX = 10019, 2888c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_RX = 10020, 2898c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_L2_ZINWELL = 10021, 2908c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000, 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_ci /* 2938c2ecf20Sopenharmony_ci * Set aside a range for customer private use. The SDK won't 2948c2ecf20Sopenharmony_ci * use any numbers in this range. 2958c2ecf20Sopenharmony_ci */ 2968c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, 2978c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_UBNT_E100 = 20002, 2988c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_UBNT_E200 = 20003, 2998c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_UBNT_E220 = 20005, 3008c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_DSR1000N = 20006, 3018c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_KONTRON_S1901 = 21901, 3028c2ecf20Sopenharmony_ci CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ci /* The remaining range is reserved for future use. */ 3058c2ecf20Sopenharmony_ci}; 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_cienum cvmx_chip_types_enum { 3088c2ecf20Sopenharmony_ci CVMX_CHIP_TYPE_NULL = 0, 3098c2ecf20Sopenharmony_ci CVMX_CHIP_SIM_TYPE_DEPRECATED = 1, 3108c2ecf20Sopenharmony_ci CVMX_CHIP_TYPE_OCTEON_SAMPLE = 2, 3118c2ecf20Sopenharmony_ci CVMX_CHIP_TYPE_MAX, 3128c2ecf20Sopenharmony_ci}; 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_ci/* Compatibility alias for NAC38 name change, planned to be removed 3158c2ecf20Sopenharmony_ci * from SDK 1.7 */ 3168c2ecf20Sopenharmony_ci#define CVMX_BOARD_TYPE_NAO38 CVMX_BOARD_TYPE_NAC38 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci/* Functions to return string based on type */ 3198c2ecf20Sopenharmony_ci#define ENUM_BRD_TYPE_CASE(x) \ 3208c2ecf20Sopenharmony_ci case x: return (&#x[16]); /* Skip CVMX_BOARD_TYPE_ */ 3218c2ecf20Sopenharmony_cistatic inline const char *cvmx_board_type_to_string(enum 3228c2ecf20Sopenharmony_ci cvmx_board_types_enum type) 3238c2ecf20Sopenharmony_ci{ 3248c2ecf20Sopenharmony_ci switch (type) { 3258c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL) 3268c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_SIM) 3278c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT3000) 3288c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KODAMA) 3298c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIAGARA) 3308c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NAC38) 3318c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_THUNDER) 3328c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_TRANTOR) 3338c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3000) 3348c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3100) 3358c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_HIKARI) 3368c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3010_EVB_HS5) 3378c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3005_EVB_HS5) 3388c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KBP) 3398c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3020_EVB_HS5) 3408c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5800) 3418c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NICPRO2) 3428c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5600) 3438c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5601) 3448c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5200) 3458c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_BBGW_REF) 3468c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G) 3478c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600) 3488c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201) 3498c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5200) 3508c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5600) 3518c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5601) 3528c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5200) 3538c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_GENERIC) 3548c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5610) 3558c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_A) 3568c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_U) 3578c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB5600) 3588c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6300) 3598c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_10G) 3608c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_G) 3618c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5810) 3628c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC10E) 3638c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EP6300C) 3648c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6800) 3658c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC4E) 3668c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC2E) 3678c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6600) 3688c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_REDWING) 3698c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC68_4) 3708c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC10E_66) 3718c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX) 3728c2ecf20Sopenharmony_ci 3738c2ecf20Sopenharmony_ci /* Customer boards listed here */ 3748c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MIN) 3758c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WSX16) 3768c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NS0216) 3778c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NB5) 3788c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WMR500) 3798c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_ITB101) 3808c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NTE102) 3818c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS103) 3828c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GST104) 3838c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT105) 3848c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS106) 3858c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_SGM107) 3868c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT108) 3878c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS109) 3888c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT110) 3898c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_AIR_SENDER) 3908c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_AIR_RECEIVER) 3918c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_ACCTON2_TX) 3928c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_ACCTON2_RX) 3938c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_TX) 3948c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_RX) 3958c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_ZINWELL) 3968c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX) 3978c2ecf20Sopenharmony_ci 3988c2ecf20Sopenharmony_ci /* Customer private range */ 3998c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) 4008c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) 4018c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) 4028c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) 4038c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DSR1000N) 4048c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901) 4058c2ecf20Sopenharmony_ci ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) 4068c2ecf20Sopenharmony_ci } 4078c2ecf20Sopenharmony_ci return NULL; 4088c2ecf20Sopenharmony_ci} 4098c2ecf20Sopenharmony_ci 4108c2ecf20Sopenharmony_ci#define ENUM_CHIP_TYPE_CASE(x) \ 4118c2ecf20Sopenharmony_ci case x: return (&#x[15]); /* Skip CVMX_CHIP_TYPE */ 4128c2ecf20Sopenharmony_cistatic inline const char *cvmx_chip_type_to_string(enum 4138c2ecf20Sopenharmony_ci cvmx_chip_types_enum type) 4148c2ecf20Sopenharmony_ci{ 4158c2ecf20Sopenharmony_ci switch (type) { 4168c2ecf20Sopenharmony_ci ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_NULL) 4178c2ecf20Sopenharmony_ci ENUM_CHIP_TYPE_CASE(CVMX_CHIP_SIM_TYPE_DEPRECATED) 4188c2ecf20Sopenharmony_ci ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_OCTEON_SAMPLE) 4198c2ecf20Sopenharmony_ci ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_MAX) 4208c2ecf20Sopenharmony_ci } 4218c2ecf20Sopenharmony_ci return "Unsupported Chip"; 4228c2ecf20Sopenharmony_ci} 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_ci#endif /* __CVMX_BOOTINFO_H__ */ 425