^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * (C) Copyright 2004, 2005 Cavium Networks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __OCTEON_BOOT_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define __OCTEON_BOOT_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) struct boot_init_vector {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /* First stage address - in ram instead of flash */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) uint64_t code_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* Setup code for application, NOT application entry point */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) uint32_t app_start_func_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /* k0 is used for global data - needs to be passed to other cores */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) uint32_t k0_val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* Address of boot info block structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) uint64_t boot_info_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) uint32_t flags; /* flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) uint32_t pad;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* similar to bootloader's linux_app_boot_info but without global data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct linux_app_boot_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #ifdef __BIG_ENDIAN_BITFIELD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) uint32_t labi_signature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) uint32_t start_core0_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) uint32_t avail_coremask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) uint32_t pci_console_active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) uint32_t icache_prefetch_disable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) uint32_t padding;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) uint64_t InitTLBStart_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) uint32_t start_app_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) uint32_t cur_exception_base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) uint32_t no_mark_private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) uint32_t compact_flash_common_base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) uint32_t compact_flash_attribute_base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) uint32_t led_display_base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) uint32_t start_core0_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) uint32_t labi_signature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) uint32_t pci_console_active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) uint32_t avail_coremask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) uint32_t padding;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) uint32_t icache_prefetch_disable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) uint64_t InitTLBStart_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) uint32_t cur_exception_base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) uint32_t start_app_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) uint32_t compact_flash_common_base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) uint32_t no_mark_private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) uint32_t led_display_base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) uint32_t compact_flash_attribute_base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* If not to copy a lot of bootloader's structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) here is only offset of requested member */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #define AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK 0x765c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) /* hardcoded in bootloader */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #define LABI_ADDR_IN_BOOTLOADER 0x700
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #define LINUX_APP_BOOT_BLOCK_NAME "linux-app-boot"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #define LABI_SIGNATURE 0xAABBCC01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) /* from uboot-headers/octeon_mem_map.h */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) #define EXCEPTION_BASE_INCR (4 * 1024)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) /* Increment size for exception base addresses (4k minimum) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #define EXCEPTION_BASE_BASE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #define BOOTLOADER_PRIV_DATA_BASE (EXCEPTION_BASE_BASE + 0x800)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #define BOOTLOADER_BOOT_VECTOR (BOOTLOADER_PRIV_DATA_BASE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) #endif /* __OCTEON_BOOT_H__ */