blob: a6ce7c43e0aea16655a6da5560d15154396d27fb [file] [log] [blame]
Ralf Baechle773cb772009-06-23 10:36:38 +01001/*
2 * (C) Copyright 2004, 2005 Cavium Networks
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17 * MA 02111-1307 USA
18 */
19
20#ifndef __OCTEON_BOOT_H__
21#define __OCTEON_BOOT_H__
22
23#include <linux/types.h>
24
25struct boot_init_vector {
David Daneybabba4f2010-07-23 10:57:51 -070026 /* First stage address - in ram instead of flash */
27 uint64_t code_addr;
28 /* Setup code for application, NOT application entry point */
Ralf Baechle773cb772009-06-23 10:36:38 +010029 uint32_t app_start_func_addr;
David Daneybabba4f2010-07-23 10:57:51 -070030 /* k0 is used for global data - needs to be passed to other cores */
Ralf Baechle773cb772009-06-23 10:36:38 +010031 uint32_t k0_val;
David Daneybabba4f2010-07-23 10:57:51 -070032 /* Address of boot info block structure */
33 uint64_t boot_info_addr;
Ralf Baechle70342282013-01-22 12:59:30 +010034 uint32_t flags; /* flags */
Ralf Baechle773cb772009-06-23 10:36:38 +010035 uint32_t pad;
Ralf Baechle773cb772009-06-23 10:36:38 +010036};
37
38/* similar to bootloader's linux_app_boot_info but without global data */
39struct linux_app_boot_info {
David Daney534c1582015-03-20 19:11:56 +030040#ifdef __BIG_ENDIAN_BITFIELD
Ralf Baechle773cb772009-06-23 10:36:38 +010041 uint32_t labi_signature;
42 uint32_t start_core0_addr;
43 uint32_t avail_coremask;
44 uint32_t pci_console_active;
45 uint32_t icache_prefetch_disable;
David Daney534c1582015-03-20 19:11:56 +030046 uint32_t padding;
David Daneybabba4f2010-07-23 10:57:51 -070047 uint64_t InitTLBStart_addr;
Ralf Baechle773cb772009-06-23 10:36:38 +010048 uint32_t start_app_addr;
49 uint32_t cur_exception_base;
50 uint32_t no_mark_private_data;
51 uint32_t compact_flash_common_base_addr;
52 uint32_t compact_flash_attribute_base_addr;
53 uint32_t led_display_base_addr;
David Daney534c1582015-03-20 19:11:56 +030054#else
55 uint32_t start_core0_addr;
56 uint32_t labi_signature;
57
58 uint32_t pci_console_active;
59 uint32_t avail_coremask;
60
61 uint32_t padding;
62 uint32_t icache_prefetch_disable;
63
64 uint64_t InitTLBStart_addr;
65
66 uint32_t cur_exception_base;
67 uint32_t start_app_addr;
68
69 uint32_t compact_flash_common_base_addr;
70 uint32_t no_mark_private_data;
71
72 uint32_t led_display_base_addr;
73 uint32_t compact_flash_attribute_base_addr;
74#endif
Ralf Baechle773cb772009-06-23 10:36:38 +010075};
76
77/* If not to copy a lot of bootloader's structures
78 here is only offset of requested member */
Ralf Baechle70342282013-01-22 12:59:30 +010079#define AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK 0x765c
Ralf Baechle773cb772009-06-23 10:36:38 +010080
81/* hardcoded in bootloader */
Ralf Baechle70342282013-01-22 12:59:30 +010082#define LABI_ADDR_IN_BOOTLOADER 0x700
Ralf Baechle773cb772009-06-23 10:36:38 +010083
84#define LINUX_APP_BOOT_BLOCK_NAME "linux-app-boot"
85
David Daneybabba4f2010-07-23 10:57:51 -070086#define LABI_SIGNATURE 0xAABBCC01
Ralf Baechle773cb772009-06-23 10:36:38 +010087
88/* from uboot-headers/octeon_mem_map.h */
Ralf Baechle70342282013-01-22 12:59:30 +010089#define EXCEPTION_BASE_INCR (4 * 1024)
Ralf Baechle773cb772009-06-23 10:36:38 +010090 /* Increment size for exception base addresses (4k minimum) */
Ralf Baechle70342282013-01-22 12:59:30 +010091#define EXCEPTION_BASE_BASE 0
92#define BOOTLOADER_PRIV_DATA_BASE (EXCEPTION_BASE_BASE + 0x800)
93#define BOOTLOADER_BOOT_VECTOR (BOOTLOADER_PRIV_DATA_BASE)
Ralf Baechle773cb772009-06-23 10:36:38 +010094
95#endif /* __OCTEON_BOOT_H__ */