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-2016 Cavium, Inc. 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 * This module provides system/board information obtained by the bootloader. 308c2ecf20Sopenharmony_ci */ 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#ifndef __CVMX_SYSINFO_H__ 338c2ecf20Sopenharmony_ci#define __CVMX_SYSINFO_H__ 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#include "cvmx-coremask.h" 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci#define OCTEON_SERIAL_LEN 20 388c2ecf20Sopenharmony_ci/** 398c2ecf20Sopenharmony_ci * Structure describing application specific information. 408c2ecf20Sopenharmony_ci * __cvmx_app_init() populates this from the cvmx boot descriptor. 418c2ecf20Sopenharmony_ci * This structure is private to simple executive applications, so 428c2ecf20Sopenharmony_ci * no versioning is required. 438c2ecf20Sopenharmony_ci * 448c2ecf20Sopenharmony_ci * This structure must be provided with some fields set in order to 458c2ecf20Sopenharmony_ci * use simple executive functions in other applications (Linux kernel, 468c2ecf20Sopenharmony_ci * u-boot, etc.) The cvmx_sysinfo_minimal_initialize() function is 478c2ecf20Sopenharmony_ci * provided to set the required values in these cases. 488c2ecf20Sopenharmony_ci */ 498c2ecf20Sopenharmony_cistruct cvmx_sysinfo { 508c2ecf20Sopenharmony_ci /* System wide variables */ 518c2ecf20Sopenharmony_ci /* installed DRAM in system, in bytes */ 528c2ecf20Sopenharmony_ci uint64_t system_dram_size; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci /* ptr to memory descriptor block */ 558c2ecf20Sopenharmony_ci uint64_t phy_mem_desc_addr; 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci /* Application image specific variables */ 588c2ecf20Sopenharmony_ci /* stack top address (virtual) */ 598c2ecf20Sopenharmony_ci uint64_t stack_top; 608c2ecf20Sopenharmony_ci /* heap base address (virtual) */ 618c2ecf20Sopenharmony_ci uint64_t heap_base; 628c2ecf20Sopenharmony_ci /* stack size in bytes */ 638c2ecf20Sopenharmony_ci uint32_t stack_size; 648c2ecf20Sopenharmony_ci /* heap size in bytes */ 658c2ecf20Sopenharmony_ci uint32_t heap_size; 668c2ecf20Sopenharmony_ci /* coremask defining cores running application */ 678c2ecf20Sopenharmony_ci struct cvmx_coremask core_mask; 688c2ecf20Sopenharmony_ci /* Deprecated, use cvmx_coremask_first_core() to select init core */ 698c2ecf20Sopenharmony_ci uint32_t init_core; 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci /* exception base address, as set by bootloader */ 728c2ecf20Sopenharmony_ci uint64_t exception_base_addr; 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci /* cpu clock speed in hz */ 758c2ecf20Sopenharmony_ci uint32_t cpu_clock_hz; 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci /* dram data rate in hz (data rate = 2 * clock rate */ 788c2ecf20Sopenharmony_ci uint32_t dram_data_rate_hz; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci uint16_t board_type; 828c2ecf20Sopenharmony_ci uint8_t board_rev_major; 838c2ecf20Sopenharmony_ci uint8_t board_rev_minor; 848c2ecf20Sopenharmony_ci uint8_t mac_addr_base[6]; 858c2ecf20Sopenharmony_ci uint8_t mac_addr_count; 868c2ecf20Sopenharmony_ci char board_serial_number[OCTEON_SERIAL_LEN]; 878c2ecf20Sopenharmony_ci /* 888c2ecf20Sopenharmony_ci * Several boards support compact flash on the Octeon boot 898c2ecf20Sopenharmony_ci * bus. The CF memory spaces may be mapped to different 908c2ecf20Sopenharmony_ci * addresses on different boards. These values will be 0 if 918c2ecf20Sopenharmony_ci * CF is not present. Note that these addresses are physical 928c2ecf20Sopenharmony_ci * addresses, and it is up to the application to use the 938c2ecf20Sopenharmony_ci * proper addressing mode (XKPHYS, KSEG0, etc.) 948c2ecf20Sopenharmony_ci */ 958c2ecf20Sopenharmony_ci uint64_t compact_flash_common_base_addr; 968c2ecf20Sopenharmony_ci uint64_t compact_flash_attribute_base_addr; 978c2ecf20Sopenharmony_ci /* 988c2ecf20Sopenharmony_ci * Base address of the LED display (as on EBT3000 board) This 998c2ecf20Sopenharmony_ci * will be 0 if LED display not present. Note that this 1008c2ecf20Sopenharmony_ci * address is a physical address, and it is up to the 1018c2ecf20Sopenharmony_ci * application to use the proper addressing mode (XKPHYS, 1028c2ecf20Sopenharmony_ci * KSEG0, etc.) 1038c2ecf20Sopenharmony_ci */ 1048c2ecf20Sopenharmony_ci uint64_t led_display_base_addr; 1058c2ecf20Sopenharmony_ci /* DFA reference clock in hz (if applicable)*/ 1068c2ecf20Sopenharmony_ci uint32_t dfa_ref_clock_hz; 1078c2ecf20Sopenharmony_ci /* configuration flags from bootloader */ 1088c2ecf20Sopenharmony_ci uint32_t bootloader_config_flags; 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci /* Uart number used for console */ 1118c2ecf20Sopenharmony_ci uint8_t console_uart_num; 1128c2ecf20Sopenharmony_ci}; 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci/** 1158c2ecf20Sopenharmony_ci * This function returns the system/board information as obtained 1168c2ecf20Sopenharmony_ci * by the bootloader. 1178c2ecf20Sopenharmony_ci * 1188c2ecf20Sopenharmony_ci * 1198c2ecf20Sopenharmony_ci * Returns Pointer to the boot information structure 1208c2ecf20Sopenharmony_ci * 1218c2ecf20Sopenharmony_ci */ 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ciextern struct cvmx_sysinfo *cvmx_sysinfo_get(void); 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci#endif /* __CVMX_SYSINFO_H__ */ 126