rmi_boot_info.h revision 198160
1198160Srrs/*-
2198160Srrs * Copyright (c) 2003-2009 RMI Corporation
3198160Srrs * All rights reserved.
4198160Srrs *
5198160Srrs * Redistribution and use in source and binary forms, with or without
6198160Srrs * modification, are permitted provided that the following conditions
7198160Srrs * are met:
8198160Srrs * 1. Redistributions of source code must retain the above copyright
9198160Srrs *    notice, this list of conditions and the following disclaimer.
10198160Srrs * 2. Redistributions in binary form must reproduce the above copyright
11198160Srrs *    notice, this list of conditions and the following disclaimer in the
12198160Srrs *    documentation and/or other materials provided with the distribution.
13198160Srrs * 3. Neither the name of RMI Corporation, nor the names of its contributors,
14198160Srrs *    may be used to endorse or promote products derived from this software
15198160Srrs *    without specific prior written permission.
16198160Srrs *
17198160Srrs * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18198160Srrs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19198160Srrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20198160Srrs * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21198160Srrs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22198160Srrs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23198160Srrs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24198160Srrs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25198160Srrs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26198160Srrs * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27198160Srrs * SUCH DAMAGE.
28198160Srrs *
29198160Srrs * RMI_BSD */
30198160Srrs#ifndef _SHARED_STRUCTS_H
31198160Srrs#define _SHARED_STRUCTS_H
32198160Srrs
33198160Srrs/* If you make any changes to the below structs, shared_structs_offsets.h
34198160Srrs * should be regenerated
35198160Srrs */
36198160Srrs#define BOOT1_INFO_VERSION 0x0001
37198160Srrs
38198160Srrsstruct boot1_info {
39198160Srrs  uint64_t boot_level;
40198160Srrs  uint64_t io_base;
41198160Srrs  uint64_t output_device;
42198160Srrs  uint64_t uart_print;
43198160Srrs  uint64_t led_output;
44198160Srrs  uint64_t init;
45198160Srrs  uint64_t exit;
46198160Srrs  uint64_t warm_reset;
47198160Srrs  uint64_t wakeup;
48198160Srrs  uint64_t cpu_online_map;
49198160Srrs  uint64_t master_reentry_sp;
50198160Srrs  uint64_t master_reentry_gp;
51198160Srrs  uint64_t master_reentry_fn;
52198160Srrs  uint64_t slave_reentry_fn;
53198160Srrs  uint64_t magic_dword;
54198160Srrs  uint64_t uart_putchar;
55198160Srrs  uint64_t size;
56198160Srrs  uint64_t uart_getchar;
57198160Srrs  uint64_t nmi_handler;
58198160Srrs  uint64_t psb_version;
59198160Srrs  uint64_t mac_addr;
60198160Srrs  uint64_t cpu_frequency;
61198160Srrs  uint64_t board_version;
62198160Srrs  uint64_t malloc;
63198160Srrs  uint64_t free;
64198160Srrs  uint64_t alloc_pbuf;
65198160Srrs  uint64_t free_pbuf;
66198160Srrs  uint64_t psb_os_cpu_map;
67198160Srrs  uint64_t userapp_cpu_map;
68198160Srrs  uint64_t wakeup_os;
69198160Srrs  uint64_t psb_mem_map;
70198160Srrs  uint64_t board_major_version;
71198160Srrs  uint64_t board_minor_version;
72198160Srrs  uint64_t board_manf_revision;
73198160Srrs  uint64_t board_serial_number;
74198160Srrs  uint64_t psb_physaddr_map;
75198160Srrs};
76198160Srrs
77198160Srrsextern struct boot1_info xlr_boot1_info;
78198160Srrs
79198160Srrs
80198160Srrs/* This structure is passed to all applications launched from the linux
81198160Srrs   loader through K0 register
82198160Srrs */
83198160Srrs#define XLR_LOADER_INFO_MAGIC 0x600ddeed
84198160Srrsstruct xlr_loader_info {
85198160Srrs	uint32_t magic;
86198160Srrs	/* xlr_loader_shared_struct_t for CPU 0 will start here */
87198160Srrs	unsigned long sh_mem_start;
88198160Srrs	/* Size of the shared memory b/w linux apps and rmios apps  */
89198160Srrs	uint32_t app_sh_mem_size;
90198160Srrs};
91198160Srrs
92198160Srrs/* Boot loader uses the linux mips convention */
93198160Srrs#define BOOT1_MEMMAP_MAX	32
94198160Srrs
95198160Srrsenum xlr_phys_memmap_t { BOOT1_MEM_RAM=1, BOOT1_MEM_ROM_DATA, BOOT1_MEM_RESERVED};
96198160Srrs
97198160Srrsstruct xlr_boot1_mem_map {
98198160Srrs        uint32_t num_entries;
99198160Srrs        struct {
100198160Srrs                uint64_t addr;
101198160Srrs                uint64_t size;
102198160Srrs                uint32_t type;
103198160Srrs                uint32_t pad;
104198160Srrs        } physmem_map[BOOT1_MEMMAP_MAX];
105198160Srrs};
106198160Srrs
107198160Srrs
108198160Srrs#endif
109