blob: 9eab66f3b7bc28e69c74b18b1c92f6106a0e2a18 [file] [log] [blame]
Thomas Gleixner1a59d1b82019-05-27 08:55:05 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Ralf Baechle773cb772009-06-23 10:36:38 +01002/*
3 * (C) Copyright 2004, 2005 Cavium Networks
Ralf Baechle773cb772009-06-23 10:36:38 +01004 */
5
6#ifndef __OCTEON_BOOT_H__
7#define __OCTEON_BOOT_H__
8
9#include <linux/types.h>
10
11struct boot_init_vector {
David Daneybabba4f2010-07-23 10:57:51 -070012 /* First stage address - in ram instead of flash */
13 uint64_t code_addr;
14 /* Setup code for application, NOT application entry point */
Ralf Baechle773cb772009-06-23 10:36:38 +010015 uint32_t app_start_func_addr;
David Daneybabba4f2010-07-23 10:57:51 -070016 /* k0 is used for global data - needs to be passed to other cores */
Ralf Baechle773cb772009-06-23 10:36:38 +010017 uint32_t k0_val;
David Daneybabba4f2010-07-23 10:57:51 -070018 /* Address of boot info block structure */
19 uint64_t boot_info_addr;
Ralf Baechle70342282013-01-22 12:59:30 +010020 uint32_t flags; /* flags */
Ralf Baechle773cb772009-06-23 10:36:38 +010021 uint32_t pad;
Ralf Baechle773cb772009-06-23 10:36:38 +010022};
23
24/* similar to bootloader's linux_app_boot_info but without global data */
25struct linux_app_boot_info {
David Daney534c1582015-03-20 19:11:56 +030026#ifdef __BIG_ENDIAN_BITFIELD
Ralf Baechle773cb772009-06-23 10:36:38 +010027 uint32_t labi_signature;
28 uint32_t start_core0_addr;
29 uint32_t avail_coremask;
30 uint32_t pci_console_active;
31 uint32_t icache_prefetch_disable;
David Daney534c1582015-03-20 19:11:56 +030032 uint32_t padding;
David Daneybabba4f2010-07-23 10:57:51 -070033 uint64_t InitTLBStart_addr;
Ralf Baechle773cb772009-06-23 10:36:38 +010034 uint32_t start_app_addr;
35 uint32_t cur_exception_base;
36 uint32_t no_mark_private_data;
37 uint32_t compact_flash_common_base_addr;
38 uint32_t compact_flash_attribute_base_addr;
39 uint32_t led_display_base_addr;
David Daney534c1582015-03-20 19:11:56 +030040#else
41 uint32_t start_core0_addr;
42 uint32_t labi_signature;
43
44 uint32_t pci_console_active;
45 uint32_t avail_coremask;
46
47 uint32_t padding;
48 uint32_t icache_prefetch_disable;
49
50 uint64_t InitTLBStart_addr;
51
52 uint32_t cur_exception_base;
53 uint32_t start_app_addr;
54
55 uint32_t compact_flash_common_base_addr;
56 uint32_t no_mark_private_data;
57
58 uint32_t led_display_base_addr;
59 uint32_t compact_flash_attribute_base_addr;
60#endif
Ralf Baechle773cb772009-06-23 10:36:38 +010061};
62
63/* If not to copy a lot of bootloader's structures
64 here is only offset of requested member */
Ralf Baechle70342282013-01-22 12:59:30 +010065#define AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK 0x765c
Ralf Baechle773cb772009-06-23 10:36:38 +010066
67/* hardcoded in bootloader */
Ralf Baechle70342282013-01-22 12:59:30 +010068#define LABI_ADDR_IN_BOOTLOADER 0x700
Ralf Baechle773cb772009-06-23 10:36:38 +010069
70#define LINUX_APP_BOOT_BLOCK_NAME "linux-app-boot"
71
David Daneybabba4f2010-07-23 10:57:51 -070072#define LABI_SIGNATURE 0xAABBCC01
Ralf Baechle773cb772009-06-23 10:36:38 +010073
74/* from uboot-headers/octeon_mem_map.h */
Ralf Baechle70342282013-01-22 12:59:30 +010075#define EXCEPTION_BASE_INCR (4 * 1024)
Ralf Baechle773cb772009-06-23 10:36:38 +010076 /* Increment size for exception base addresses (4k minimum) */
Ralf Baechle70342282013-01-22 12:59:30 +010077#define EXCEPTION_BASE_BASE 0
78#define BOOTLOADER_PRIV_DATA_BASE (EXCEPTION_BASE_BASE + 0x800)
79#define BOOTLOADER_BOOT_VECTOR (BOOTLOADER_PRIV_DATA_BASE)
Ralf Baechle773cb772009-06-23 10:36:38 +010080
81#endif /* __OCTEON_BOOT_H__ */