diff options
author | Juli Mallett <jmallett@FreeBSD.org> | 2012-03-11 04:14:00 +0000 |
---|---|---|
committer | Juli Mallett <jmallett@FreeBSD.org> | 2012-03-11 04:14:00 +0000 |
commit | f8b73ad2e16934621a86fd1fd67b46aa21521d0b (patch) | |
tree | cd40bd62c08fa360ceced004ce74decd1b26ca3c /octeon-boot-info.h | |
parent | 7a1e830cbcd5d33aa7fcdd8732e6ea26510508fd (diff) |
Notes
Diffstat (limited to 'octeon-boot-info.h')
-rw-r--r-- | octeon-boot-info.h | 95 |
1 files changed, 84 insertions, 11 deletions
diff --git a/octeon-boot-info.h b/octeon-boot-info.h index 086682294760..6a3e9279b3b7 100644 --- a/octeon-boot-info.h +++ b/octeon-boot-info.h @@ -1,5 +1,5 @@ /***********************license start*************** - * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights + * Copyright (c) 2003-2011 Cavium Inc. (support@cavium.com). All rights * reserved. * * @@ -15,7 +15,7 @@ * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Cavium Networks nor the names of + * * Neither the name of Cavium Inc. nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written * permission. @@ -26,7 +26,7 @@ * countries. * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM @@ -52,6 +52,9 @@ #ifdef CVMX_BUILD_FOR_LINUX_KERNEL #include <linux/types.h> +#include <asm/octeon/cvmx-asm.h> +#else +#include "cvmx-asm.h" #endif #ifndef __ASSEMBLY__ @@ -89,6 +92,79 @@ typedef struct uint32_t pad; } boot_init_vector_t; +#if defined(__ASM_GBL_DATA_H) /* defined above */ +/* + * Definition of a data structure to mimic the old u-boot gd_t data structure. + */ +#undef GD_TMP_STR_SIZE +#define GD_TMP_STR_SIZE 32 + +#define LINUX_APP_GLOBAL_DATA_MAGIC 0x221eb111476f410full +#define LINUX_APP_GLOBAL_DATA_VERSION 2 + +struct linux_app_global_data { + bd_t *bd; + unsigned long flags; + unsigned long baudrate; + unsigned long have_console; /* serial_init() was called */ + uint64_t ram_size; /* RAM size */ + uint64_t reloc_off; /* Relocation Offset */ + unsigned long env_addr; /* Address of Environment struct */ + unsigned long env_valid; /* Checksum of Environment valid? */ + unsigned long cpu_clock_mhz; /* CPU clock speed in MHz */ + unsigned long ddr_clock_mhz; /* DDR clock (not data rate!) in MHz */ + unsigned long ddr_ref_hertz; /* DDR Ref clock Hertz */ + int mcu_rev_maj; + int mcu_rev_min; + int console_uart; + + /* EEPROM data structures as read from EEPROM or populated by other + * means on boards without an EEPROM + */ + octeon_eeprom_board_desc_t board_desc; + octeon_eeprom_clock_desc_t clock_desc; + octeon_eeprom_mac_addr_t mac_desc; + + void **jt; /* jump table, not used */ + char *err_msg; /* pointer to error message to save + * until console is up. Not used. + */ + union { + struct { /* Keep under 32 bytes! */ + uint64_t magic; + uint32_t version; + uint32_t fdt_addr; + }; + char tmp_str[GD_TMP_STR_SIZE]; + }; + unsigned long uboot_flash_address; /* Address of normal bootloader + * in flash + */ + unsigned long uboot_flash_size; /* Size of normal bootloader */ + uint64_t dfm_ram_size; /* DFM RAM size */ +}; +typedef struct linux_app_global_data linux_app_global_data_t; + +/* Flags for linux_app_global_data */ +#define LA_GD_FLG_RELOC 0x0001 /* Code was relocated to RAM */ +#define LA_GD_FLG_DEVINIT 0x0002 /* Devices have been initialized */ +#define LA_GD_FLG_SILENT 0x0004 /* Silent mode */ +#define LA_GD_FLG_CLOCK_DESC_MISSING 0x0008 +#define LA_GD_FLG_BOARD_DESC_MISSING 0x0010 +#define LA_GD_FLG_DDR_VERBOSE 0x0020 +#define LA_GD_FLG_DDR0_CLK_INITIALIZED 0x0040 +#define LA_GD_FLG_DDR1_CLK_INITIALIZED 0x0080 +#define LA_GD_FLG_DDR2_CLK_INITIALIZED 0x0100 +#define LA_GD_FLG_DDR3_CLK_INITIALIZED 0x0200 +#define LA_GD_FLG_FAILSAFE_MODE 0x0400 /* Use failsafe mode */ +#define LA_GD_FLG_DDR_TRACE_INIT 0x0800 +#define LA_GD_FLG_DFM_CLK_INITIALIZED 0x1000 +#define LA_GD_FLG_DFM_VERBOSE 0x2000 +#define LA_GD_FLG_DFM_TRACE_INIT 0x4000 +#define LA_GD_FLG_MEMORY_PRESERVED 0x8000 +#define LA_GD_FLG_RAM_RESIDENT 0x10000 /* RAM boot detected */ +#endif /* __ASM_GBL_DATA_H */ + /* * Definition of a data structure setup by the bootloader to enable Linux to * launch SE apps on idle cores. @@ -108,10 +184,8 @@ struct linux_app_boot_info uint32_t compact_flash_common_base_addr; uint32_t compact_flash_attribute_base_addr; uint32_t led_display_base_addr; -#ifndef __OCTEON_NEWLIB__ -#if defined(__U_BOOT__) || !defined(__KERNEL__) - gd_t gd; -#endif +#if defined(__ASM_GBL_DATA_H) /* defined above */ + linux_app_global_data_t gd; #endif }; typedef struct linux_app_boot_info linux_app_boot_info_t; @@ -130,11 +204,10 @@ typedef struct linux_app_boot_info linux_app_boot_info_t; #define LABI_SIGNATURE 0xAABBCC01 /* from uboot-headers/octeon_mem_map.h */ -#if defined(CVMX_BUILD_FOR_LINUX_KERNEL) || defined(__OCTEON_NEWLIB__) +#if defined(CVMX_BUILD_FOR_LINUX_KERNEL) || defined(CVMX_BUILD_FOR_TOOLCHAIN) #define EXCEPTION_BASE_INCR (4 * 1024) #endif -#define OCTEON_NUM_CORES 16 /* Increment size for exception base addresses (4k minimum) */ #define EXCEPTION_BASE_BASE 0 #define BOOTLOADER_PRIV_DATA_BASE (EXCEPTION_BASE_BASE + 0x800) @@ -142,11 +215,11 @@ typedef struct linux_app_boot_info linux_app_boot_info_t; #define BOOTLOADER_DEBUG_TRAMPOLINE (BOOTLOADER_BOOT_VECTOR + BOOT_VECTOR_SIZE) /* WORD */ #define BOOTLOADER_DEBUG_TRAMPOLINE_CORE (BOOTLOADER_DEBUG_TRAMPOLINE + 4) /* WORD */ -#define OCTEON_EXCEPTION_VECTOR_BLOCK_SIZE (OCTEON_NUM_CORES*EXCEPTION_BASE_INCR) /* 16 4k blocks */ +#define OCTEON_EXCEPTION_VECTOR_BLOCK_SIZE (CVMX_MAX_CORES*EXCEPTION_BASE_INCR) /* 32 4k blocks */ #define BOOTLOADER_DEBUG_REG_SAVE_BASE (EXCEPTION_BASE_BASE + OCTEON_EXCEPTION_VECTOR_BLOCK_SIZE) #define BOOT_VECTOR_NUM_WORDS (8) -#define BOOT_VECTOR_SIZE ((OCTEON_NUM_CORES*4)*BOOT_VECTOR_NUM_WORDS) +#define BOOT_VECTOR_SIZE ((CVMX_MAX_CORES*4)*BOOT_VECTOR_NUM_WORDS) #endif /* __OCTEON_BOOT_INFO_H__ */ |