Back to home page

OSCL-LXR

 
 

    


0001 /***********************license start***************
0002  * Author: Cavium Networks
0003  *
0004  * Contact: support@caviumnetworks.com
0005  * This file is part of the OCTEON SDK
0006  *
0007  * Copyright (c) 2003-2016 Cavium, Inc.
0008  *
0009  * This file is free software; you can redistribute it and/or modify
0010  * it under the terms of the GNU General Public License, Version 2, as
0011  * published by the Free Software Foundation.
0012  *
0013  * This file is distributed in the hope that it will be useful, but
0014  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
0015  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
0016  * NONINFRINGEMENT.  See the GNU General Public License for more
0017  * details.
0018  *
0019  * You should have received a copy of the GNU General Public License
0020  * along with this file; if not, write to the Free Software
0021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
0022  * or visit http://www.gnu.org/licenses/.
0023  *
0024  * This file may also be available under a different license from Cavium.
0025  * Contact Cavium Networks for more information
0026  ***********************license end**************************************/
0027 
0028 /*
0029  * This module provides system/board information obtained by the bootloader.
0030  */
0031 
0032 #ifndef __CVMX_SYSINFO_H__
0033 #define __CVMX_SYSINFO_H__
0034 
0035 #include "cvmx-coremask.h"
0036 
0037 #define OCTEON_SERIAL_LEN 20
0038 /**
0039  * Structure describing application specific information.
0040  * __cvmx_app_init() populates this from the cvmx boot descriptor.
0041  * This structure is private to simple executive applications, so
0042  * no versioning is required.
0043  *
0044  * This structure must be provided with some fields set in order to
0045  * use simple executive functions in other applications (Linux kernel,
0046  * u-boot, etc.)  The cvmx_sysinfo_minimal_initialize() function is
0047  * provided to set the required values in these cases.
0048  */
0049 struct cvmx_sysinfo {
0050     /* System wide variables */
0051     /* installed DRAM in system, in bytes */
0052     uint64_t system_dram_size;
0053 
0054     /* ptr to memory descriptor block */
0055     uint64_t phy_mem_desc_addr;
0056 
0057     /* Application image specific variables */
0058     /* stack top address (virtual) */
0059     uint64_t stack_top;
0060     /* heap base address (virtual) */
0061     uint64_t heap_base;
0062     /* stack size in bytes */
0063     uint32_t stack_size;
0064     /* heap size in bytes */
0065     uint32_t heap_size;
0066     /* coremask defining cores running application */
0067     struct cvmx_coremask core_mask;
0068     /* Deprecated, use cvmx_coremask_first_core() to select init core */
0069     uint32_t init_core;
0070 
0071     /* exception base address, as set by bootloader */
0072     uint64_t exception_base_addr;
0073 
0074     /* cpu clock speed in hz */
0075     uint32_t cpu_clock_hz;
0076 
0077     /* dram data rate in hz (data rate = 2 * clock rate */
0078     uint32_t dram_data_rate_hz;
0079 
0080 
0081     uint16_t board_type;
0082     uint8_t board_rev_major;
0083     uint8_t board_rev_minor;
0084     uint8_t mac_addr_base[6];
0085     uint8_t mac_addr_count;
0086     char board_serial_number[OCTEON_SERIAL_LEN];
0087     /*
0088      * Several boards support compact flash on the Octeon boot
0089      * bus.  The CF memory spaces may be mapped to different
0090      * addresses on different boards.  These values will be 0 if
0091      * CF is not present.  Note that these addresses are physical
0092      * addresses, and it is up to the application to use the
0093      * proper addressing mode (XKPHYS, KSEG0, etc.)
0094      */
0095     uint64_t compact_flash_common_base_addr;
0096     uint64_t compact_flash_attribute_base_addr;
0097     /*
0098      * Base address of the LED display (as on EBT3000 board) This
0099      * will be 0 if LED display not present.  Note that this
0100      * address is a physical address, and it is up to the
0101      * application to use the proper addressing mode (XKPHYS,
0102      * KSEG0, etc.)
0103      */
0104     uint64_t led_display_base_addr;
0105     /* DFA reference clock in hz (if applicable)*/
0106     uint32_t dfa_ref_clock_hz;
0107     /* configuration flags from bootloader */
0108     uint32_t bootloader_config_flags;
0109 
0110     /* Uart number used for console */
0111     uint8_t console_uart_num;
0112 };
0113 
0114 /**
0115  * This function returns the system/board information as obtained
0116  * by the bootloader.
0117  *
0118  *
0119  * Returns  Pointer to the boot information structure
0120  *
0121  */
0122 
0123 extern struct cvmx_sysinfo *cvmx_sysinfo_get(void);
0124 
0125 #endif /* __CVMX_SYSINFO_H__ */