octeon-boot-info.h revision 215976
1215976Sjmallett/***********************license start*************** 2215976Sjmallett * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights 3215976Sjmallett * reserved. 4215976Sjmallett * 5215976Sjmallett * 6215976Sjmallett * Redistribution and use in source and binary forms, with or without 7215976Sjmallett * modification, are permitted provided that the following conditions are 8215976Sjmallett * met: 9215976Sjmallett * 10215976Sjmallett * * Redistributions of source code must retain the above copyright 11215976Sjmallett * notice, this list of conditions and the following disclaimer. 12215976Sjmallett * 13215976Sjmallett * * Redistributions in binary form must reproduce the above 14215976Sjmallett * copyright notice, this list of conditions and the following 15215976Sjmallett * disclaimer in the documentation and/or other materials provided 16215976Sjmallett * with the distribution. 17215976Sjmallett 18215976Sjmallett * * Neither the name of Cavium Networks nor the names of 19215976Sjmallett * its contributors may be used to endorse or promote products 20215976Sjmallett * derived from this software without specific prior written 21215976Sjmallett * permission. 22215976Sjmallett 23215976Sjmallett * This Software, including technical data, may be subject to U.S. export control 24215976Sjmallett * laws, including the U.S. Export Administration Act and its associated 25215976Sjmallett * regulations, and may be subject to export or import regulations in other 26215976Sjmallett * countries. 27215976Sjmallett 28215976Sjmallett * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 29215976Sjmallett * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR 30215976Sjmallett * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO 31215976Sjmallett * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR 32215976Sjmallett * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM 33215976Sjmallett * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, 34215976Sjmallett * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF 35215976Sjmallett * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR 36215976Sjmallett * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR 37215976Sjmallett * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. 38215976Sjmallett ***********************license end**************************************/ 39215976Sjmallett 40215976Sjmallett 41215976Sjmallett 42215976Sjmallett/** 43215976Sjmallett * @file 44215976Sjmallett * 45215976Sjmallett * Interface to Octeon boot structure 46215976Sjmallett * 47215976Sjmallett * <hr>$Revision: $<hr> 48215976Sjmallett */ 49215976Sjmallett 50215976Sjmallett#ifndef __OCTEON_BOOT_INFO_H__ 51215976Sjmallett#define __OCTEON_BOOT_INFO_H__ 52215976Sjmallett 53215976Sjmallett#ifdef CVMX_BUILD_FOR_LINUX_KERNEL 54215976Sjmallett#include <linux/types.h> 55215976Sjmallett#endif 56215976Sjmallett 57215976Sjmallett#ifndef __ASSEMBLY__ 58215976Sjmallett 59215976Sjmallett/* 60215976Sjmallett * This structure is access by bootloader, Linux kernel and the Linux 61215976Sjmallett * user space utility "bootoct". 62215976Sjmallett 63215976Sjmallett * In the bootloader, this structure is accessed by assembly code in start.S, 64215976Sjmallett * so any changes to content or size must be reflected there as well. 65215976Sjmallett 66215976Sjmallett * This is placed at a fixed address in DRAM, so that cores can access it 67215976Sjmallett * when they come out of reset. It is used to setup the minimal bootloader 68215976Sjmallett * runtime environment (stack, but no heap, global data ptr) that is needed 69215976Sjmallett * by the non-boot cores to setup the environment for the applications. 70215976Sjmallett * The boot_info_addr is the address of a boot_info_block_t structure 71215976Sjmallett * which contains more core-specific information. 72215976Sjmallett * 73215976Sjmallett * The Linux kernel and the Linux bootoct utility access this structure for 74215976Sjmallett * implementing CPU hotplug functionality and booting of idle cores with SE 75215976Sjmallett * apps respectively. 76215976Sjmallett * 77215976Sjmallett */ 78215976Sjmalletttypedef struct 79215976Sjmallett{ 80215976Sjmallett /* First stage address - in ram instead of flash */ 81215976Sjmallett uint64_t code_addr; 82215976Sjmallett /* Setup code for application, NOT application entry point */ 83215976Sjmallett uint32_t app_start_func_addr; 84215976Sjmallett /* k0 is used for global data - needs to be passed to other cores */ 85215976Sjmallett uint32_t k0_val; 86215976Sjmallett /* Address of boot info block structure */ 87215976Sjmallett uint64_t boot_info_addr; 88215976Sjmallett uint32_t flags; /* flags */ 89215976Sjmallett uint32_t pad; 90215976Sjmallett} boot_init_vector_t; 91215976Sjmallett 92215976Sjmallett/* 93215976Sjmallett * Definition of a data structure setup by the bootloader to enable Linux to 94215976Sjmallett * launch SE apps on idle cores. 95215976Sjmallett */ 96215976Sjmallett 97215976Sjmallettstruct linux_app_boot_info 98215976Sjmallett{ 99215976Sjmallett uint32_t labi_signature; 100215976Sjmallett uint32_t start_core0_addr; 101215976Sjmallett uint32_t avail_coremask; 102215976Sjmallett uint32_t pci_console_active; 103215976Sjmallett uint32_t icache_prefetch_disable; 104215976Sjmallett uint64_t InitTLBStart_addr; 105215976Sjmallett uint32_t start_app_addr; 106215976Sjmallett uint32_t cur_exception_base; 107215976Sjmallett uint32_t no_mark_private_data; 108215976Sjmallett uint32_t compact_flash_common_base_addr; 109215976Sjmallett uint32_t compact_flash_attribute_base_addr; 110215976Sjmallett uint32_t led_display_base_addr; 111215976Sjmallett#ifndef __OCTEON_NEWLIB__ 112215976Sjmallett#if defined(__U_BOOT__) || !defined(__KERNEL__) 113215976Sjmallett gd_t gd; 114215976Sjmallett#endif 115215976Sjmallett#endif 116215976Sjmallett}; 117215976Sjmalletttypedef struct linux_app_boot_info linux_app_boot_info_t; 118215976Sjmallett 119215976Sjmallett#endif 120215976Sjmallett 121215976Sjmallett/* If not to copy a lot of bootloader's structures 122215976Sjmallett here is only offset of requested member */ 123215976Sjmallett#define AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK 0x765c 124215976Sjmallett 125215976Sjmallett/* hardcoded in bootloader */ 126215976Sjmallett#define LABI_ADDR_IN_BOOTLOADER 0x700 127215976Sjmallett 128215976Sjmallett#define LINUX_APP_BOOT_BLOCK_NAME "linux-app-boot" 129215976Sjmallett 130215976Sjmallett#define LABI_SIGNATURE 0xAABBCC01 131215976Sjmallett 132215976Sjmallett/* from uboot-headers/octeon_mem_map.h */ 133215976Sjmallett#if defined(CVMX_BUILD_FOR_LINUX_KERNEL) || defined(__OCTEON_NEWLIB__) 134215976Sjmallett#define EXCEPTION_BASE_INCR (4 * 1024) 135215976Sjmallett#endif 136215976Sjmallett 137215976Sjmallett#define OCTEON_NUM_CORES 16 138215976Sjmallett/* Increment size for exception base addresses (4k minimum) */ 139215976Sjmallett#define EXCEPTION_BASE_BASE 0 140215976Sjmallett#define BOOTLOADER_PRIV_DATA_BASE (EXCEPTION_BASE_BASE + 0x800) 141215976Sjmallett#define BOOTLOADER_BOOT_VECTOR (BOOTLOADER_PRIV_DATA_BASE) 142215976Sjmallett#define BOOTLOADER_DEBUG_TRAMPOLINE (BOOTLOADER_BOOT_VECTOR + BOOT_VECTOR_SIZE) /* WORD */ 143215976Sjmallett#define BOOTLOADER_DEBUG_TRAMPOLINE_CORE (BOOTLOADER_DEBUG_TRAMPOLINE + 4) /* WORD */ 144215976Sjmallett 145215976Sjmallett#define OCTEON_EXCEPTION_VECTOR_BLOCK_SIZE (OCTEON_NUM_CORES*EXCEPTION_BASE_INCR) /* 16 4k blocks */ 146215976Sjmallett#define BOOTLOADER_DEBUG_REG_SAVE_BASE (EXCEPTION_BASE_BASE + OCTEON_EXCEPTION_VECTOR_BLOCK_SIZE) 147215976Sjmallett 148215976Sjmallett#define BOOT_VECTOR_NUM_WORDS (8) 149215976Sjmallett#define BOOT_VECTOR_SIZE ((OCTEON_NUM_CORES*4)*BOOT_VECTOR_NUM_WORDS) 150215976Sjmallett 151215976Sjmallett 152215976Sjmallett#endif /* __OCTEON_BOOT_INFO_H__ */ 153