158f07778SDavid Daney /***********************license start*************** 258f07778SDavid Daney * Author: Cavium Networks 358f07778SDavid Daney * 458f07778SDavid Daney * Contact: support@caviumnetworks.com 558f07778SDavid Daney * This file is part of the OCTEON SDK 658f07778SDavid Daney * 758546e3bSDavid Daney * Copyright (c) 2003-2016 Cavium, Inc. 858f07778SDavid Daney * 958f07778SDavid Daney * This file is free software; you can redistribute it and/or modify 1058f07778SDavid Daney * it under the terms of the GNU General Public License, Version 2, as 1158f07778SDavid Daney * published by the Free Software Foundation. 1258f07778SDavid Daney * 1358f07778SDavid Daney * This file is distributed in the hope that it will be useful, but 1458f07778SDavid Daney * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty 1558f07778SDavid Daney * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or 1658f07778SDavid Daney * NONINFRINGEMENT. See the GNU General Public License for more 1758f07778SDavid Daney * details. 1858f07778SDavid Daney * 1958f07778SDavid Daney * You should have received a copy of the GNU General Public License 2058f07778SDavid Daney * along with this file; if not, write to the Free Software 2158f07778SDavid Daney * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 2258f07778SDavid Daney * or visit http://www.gnu.org/licenses/. 2358f07778SDavid Daney * 2458f07778SDavid Daney * This file may also be available under a different license from Cavium. 2558f07778SDavid Daney * Contact Cavium Networks for more information 2658f07778SDavid Daney ***********************license end**************************************/ 2758f07778SDavid Daney 2858f07778SDavid Daney /* 2958f07778SDavid Daney * This module provides system/board information obtained by the bootloader. 3058f07778SDavid Daney */ 3158f07778SDavid Daney 3258f07778SDavid Daney #ifndef __CVMX_SYSINFO_H__ 3358f07778SDavid Daney #define __CVMX_SYSINFO_H__ 3458f07778SDavid Daney 3558f07778SDavid Daney #define OCTEON_SERIAL_LEN 20 3658f07778SDavid Daney /** 3758f07778SDavid Daney * Structure describing application specific information. 3858f07778SDavid Daney * __cvmx_app_init() populates this from the cvmx boot descriptor. 3958f07778SDavid Daney * This structure is private to simple executive applications, so 4058f07778SDavid Daney * no versioning is required. 4158f07778SDavid Daney * 4258f07778SDavid Daney * This structure must be provided with some fields set in order to 4358f07778SDavid Daney * use simple executive functions in other applications (Linux kernel, 4458f07778SDavid Daney * u-boot, etc.) The cvmx_sysinfo_minimal_initialize() function is 4558f07778SDavid Daney * provided to set the required values in these cases. 4658f07778SDavid Daney */ 4758f07778SDavid Daney struct cvmx_sysinfo { 4858f07778SDavid Daney /* System wide variables */ 4958f07778SDavid Daney /* installed DRAM in system, in bytes */ 5058f07778SDavid Daney uint64_t system_dram_size; 5158f07778SDavid Daney 5258f07778SDavid Daney /* ptr to memory descriptor block */ 5358f07778SDavid Daney void *phy_mem_desc_ptr; 5458f07778SDavid Daney 5558f07778SDavid Daney 5658f07778SDavid Daney /* Application image specific variables */ 5758f07778SDavid Daney /* stack top address (virtual) */ 5858f07778SDavid Daney uint64_t stack_top; 5958f07778SDavid Daney /* heap base address (virtual) */ 6058f07778SDavid Daney uint64_t heap_base; 6158f07778SDavid Daney /* stack size in bytes */ 6258f07778SDavid Daney uint32_t stack_size; 6358f07778SDavid Daney /* heap size in bytes */ 6458f07778SDavid Daney uint32_t heap_size; 6558f07778SDavid Daney /* coremask defining cores running application */ 6658f07778SDavid Daney uint32_t core_mask; 6758f07778SDavid Daney /* Deprecated, use cvmx_coremask_first_core() to select init core */ 6858f07778SDavid Daney uint32_t init_core; 6958f07778SDavid Daney 7058f07778SDavid Daney /* exception base address, as set by bootloader */ 7158f07778SDavid Daney uint64_t exception_base_addr; 7258f07778SDavid Daney 7358f07778SDavid Daney /* cpu clock speed in hz */ 7458f07778SDavid Daney uint32_t cpu_clock_hz; 7558f07778SDavid Daney 7658f07778SDavid Daney /* dram data rate in hz (data rate = 2 * clock rate */ 7758f07778SDavid Daney uint32_t dram_data_rate_hz; 7858f07778SDavid Daney 7958f07778SDavid Daney 8058f07778SDavid Daney uint16_t board_type; 8158f07778SDavid Daney uint8_t board_rev_major; 8258f07778SDavid Daney uint8_t board_rev_minor; 8358f07778SDavid Daney uint8_t mac_addr_base[6]; 8458f07778SDavid Daney uint8_t mac_addr_count; 8558f07778SDavid Daney char board_serial_number[OCTEON_SERIAL_LEN]; 8658f07778SDavid Daney /* 8758f07778SDavid Daney * Several boards support compact flash on the Octeon boot 8858f07778SDavid Daney * bus. The CF memory spaces may be mapped to different 8958f07778SDavid Daney * addresses on different boards. These values will be 0 if 9058f07778SDavid Daney * CF is not present. Note that these addresses are physical 9158f07778SDavid Daney * addresses, and it is up to the application to use the 9258f07778SDavid Daney * proper addressing mode (XKPHYS, KSEG0, etc.) 9358f07778SDavid Daney */ 9458f07778SDavid Daney uint64_t compact_flash_common_base_addr; 9558f07778SDavid Daney uint64_t compact_flash_attribute_base_addr; 9658f07778SDavid Daney /* 9758f07778SDavid Daney * Base address of the LED display (as on EBT3000 board) This 9858f07778SDavid Daney * will be 0 if LED display not present. Note that this 9958f07778SDavid Daney * address is a physical address, and it is up to the 10058f07778SDavid Daney * application to use the proper addressing mode (XKPHYS, 10158f07778SDavid Daney * KSEG0, etc.) 10258f07778SDavid Daney */ 10358f07778SDavid Daney uint64_t led_display_base_addr; 10458f07778SDavid Daney /* DFA reference clock in hz (if applicable)*/ 10558f07778SDavid Daney uint32_t dfa_ref_clock_hz; 10658f07778SDavid Daney /* configuration flags from bootloader */ 10758f07778SDavid Daney uint32_t bootloader_config_flags; 10858f07778SDavid Daney 10958f07778SDavid Daney /* Uart number used for console */ 11058f07778SDavid Daney uint8_t console_uart_num; 11158f07778SDavid Daney }; 11258f07778SDavid Daney 11358f07778SDavid Daney /** 11458f07778SDavid Daney * This function returns the system/board information as obtained 11558f07778SDavid Daney * by the bootloader. 11658f07778SDavid Daney * 11758f07778SDavid Daney * 11858f07778SDavid Daney * Returns Pointer to the boot information structure 11958f07778SDavid Daney * 12058f07778SDavid Daney */ 12158f07778SDavid Daney 12258f07778SDavid Daney extern struct cvmx_sysinfo *cvmx_sysinfo_get(void); 12358f07778SDavid Daney 12458f07778SDavid Daney #endif /* __CVMX_SYSINFO_H__ */ 125