162306a36Sopenharmony_ci/***********************license start*************** 262306a36Sopenharmony_ci * Author: Cavium Networks 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Contact: support@caviumnetworks.com 562306a36Sopenharmony_ci * This file is part of the OCTEON SDK 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Copyright (c) 2003-2016 Cavium, Inc. 862306a36Sopenharmony_ci * 962306a36Sopenharmony_ci * This file is free software; you can redistribute it and/or modify 1062306a36Sopenharmony_ci * it under the terms of the GNU General Public License, Version 2, as 1162306a36Sopenharmony_ci * published by the Free Software Foundation. 1262306a36Sopenharmony_ci * 1362306a36Sopenharmony_ci * This file is distributed in the hope that it will be useful, but 1462306a36Sopenharmony_ci * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty 1562306a36Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or 1662306a36Sopenharmony_ci * NONINFRINGEMENT. See the GNU General Public License for more 1762306a36Sopenharmony_ci * details. 1862306a36Sopenharmony_ci * 1962306a36Sopenharmony_ci * You should have received a copy of the GNU General Public License 2062306a36Sopenharmony_ci * along with this file; if not, write to the Free Software 2162306a36Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 2262306a36Sopenharmony_ci * or visit http://www.gnu.org/licenses/. 2362306a36Sopenharmony_ci * 2462306a36Sopenharmony_ci * This file may also be available under a different license from Cavium. 2562306a36Sopenharmony_ci * Contact Cavium Networks for more information 2662306a36Sopenharmony_ci ***********************license end**************************************/ 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci/* 2962306a36Sopenharmony_ci * This module provides system/board information obtained by the bootloader. 3062306a36Sopenharmony_ci */ 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci#ifndef __CVMX_SYSINFO_H__ 3362306a36Sopenharmony_ci#define __CVMX_SYSINFO_H__ 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci#include "cvmx-coremask.h" 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci#define OCTEON_SERIAL_LEN 20 3862306a36Sopenharmony_ci/** 3962306a36Sopenharmony_ci * Structure describing application specific information. 4062306a36Sopenharmony_ci * __cvmx_app_init() populates this from the cvmx boot descriptor. 4162306a36Sopenharmony_ci * This structure is private to simple executive applications, so 4262306a36Sopenharmony_ci * no versioning is required. 4362306a36Sopenharmony_ci * 4462306a36Sopenharmony_ci * This structure must be provided with some fields set in order to 4562306a36Sopenharmony_ci * use simple executive functions in other applications (Linux kernel, 4662306a36Sopenharmony_ci * u-boot, etc.) The cvmx_sysinfo_minimal_initialize() function is 4762306a36Sopenharmony_ci * provided to set the required values in these cases. 4862306a36Sopenharmony_ci */ 4962306a36Sopenharmony_cistruct cvmx_sysinfo { 5062306a36Sopenharmony_ci /* System wide variables */ 5162306a36Sopenharmony_ci /* installed DRAM in system, in bytes */ 5262306a36Sopenharmony_ci uint64_t system_dram_size; 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci /* ptr to memory descriptor block */ 5562306a36Sopenharmony_ci uint64_t phy_mem_desc_addr; 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci /* Application image specific variables */ 5862306a36Sopenharmony_ci /* stack top address (virtual) */ 5962306a36Sopenharmony_ci uint64_t stack_top; 6062306a36Sopenharmony_ci /* heap base address (virtual) */ 6162306a36Sopenharmony_ci uint64_t heap_base; 6262306a36Sopenharmony_ci /* stack size in bytes */ 6362306a36Sopenharmony_ci uint32_t stack_size; 6462306a36Sopenharmony_ci /* heap size in bytes */ 6562306a36Sopenharmony_ci uint32_t heap_size; 6662306a36Sopenharmony_ci /* coremask defining cores running application */ 6762306a36Sopenharmony_ci struct cvmx_coremask core_mask; 6862306a36Sopenharmony_ci /* Deprecated, use cvmx_coremask_first_core() to select init core */ 6962306a36Sopenharmony_ci uint32_t init_core; 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci /* exception base address, as set by bootloader */ 7262306a36Sopenharmony_ci uint64_t exception_base_addr; 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci /* cpu clock speed in hz */ 7562306a36Sopenharmony_ci uint32_t cpu_clock_hz; 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci /* dram data rate in hz (data rate = 2 * clock rate */ 7862306a36Sopenharmony_ci uint32_t dram_data_rate_hz; 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci uint16_t board_type; 8262306a36Sopenharmony_ci uint8_t board_rev_major; 8362306a36Sopenharmony_ci uint8_t board_rev_minor; 8462306a36Sopenharmony_ci uint8_t mac_addr_base[6]; 8562306a36Sopenharmony_ci uint8_t mac_addr_count; 8662306a36Sopenharmony_ci char board_serial_number[OCTEON_SERIAL_LEN]; 8762306a36Sopenharmony_ci /* 8862306a36Sopenharmony_ci * Several boards support compact flash on the Octeon boot 8962306a36Sopenharmony_ci * bus. The CF memory spaces may be mapped to different 9062306a36Sopenharmony_ci * addresses on different boards. These values will be 0 if 9162306a36Sopenharmony_ci * CF is not present. Note that these addresses are physical 9262306a36Sopenharmony_ci * addresses, and it is up to the application to use the 9362306a36Sopenharmony_ci * proper addressing mode (XKPHYS, KSEG0, etc.) 9462306a36Sopenharmony_ci */ 9562306a36Sopenharmony_ci uint64_t compact_flash_common_base_addr; 9662306a36Sopenharmony_ci uint64_t compact_flash_attribute_base_addr; 9762306a36Sopenharmony_ci /* 9862306a36Sopenharmony_ci * Base address of the LED display (as on EBT3000 board) This 9962306a36Sopenharmony_ci * will be 0 if LED display not present. Note that this 10062306a36Sopenharmony_ci * address is a physical address, and it is up to the 10162306a36Sopenharmony_ci * application to use the proper addressing mode (XKPHYS, 10262306a36Sopenharmony_ci * KSEG0, etc.) 10362306a36Sopenharmony_ci */ 10462306a36Sopenharmony_ci uint64_t led_display_base_addr; 10562306a36Sopenharmony_ci /* DFA reference clock in hz (if applicable)*/ 10662306a36Sopenharmony_ci uint32_t dfa_ref_clock_hz; 10762306a36Sopenharmony_ci /* configuration flags from bootloader */ 10862306a36Sopenharmony_ci uint32_t bootloader_config_flags; 10962306a36Sopenharmony_ci 11062306a36Sopenharmony_ci /* Uart number used for console */ 11162306a36Sopenharmony_ci uint8_t console_uart_num; 11262306a36Sopenharmony_ci}; 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci/** 11562306a36Sopenharmony_ci * This function returns the system/board information as obtained 11662306a36Sopenharmony_ci * by the bootloader. 11762306a36Sopenharmony_ci * 11862306a36Sopenharmony_ci * 11962306a36Sopenharmony_ci * Returns Pointer to the boot information structure 12062306a36Sopenharmony_ci * 12162306a36Sopenharmony_ci */ 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ciextern struct cvmx_sysinfo *cvmx_sysinfo_get(void); 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ci#endif /* __CVMX_SYSINFO_H__ */ 126