Commit 534c158e authored by David Daney's avatar David Daney Committed by Ralf Baechle

MIPS: Octeon: Handle bootloader structures in little-endian mode.

Compensate for the differences in the layout of in-memory bootloader
information as seen from little-endian mode.
Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
Signed-off-by: default avatarAleksey Makarov <aleksey.makarov@auriga.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9590/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent be37a990
...@@ -37,11 +37,13 @@ struct boot_init_vector { ...@@ -37,11 +37,13 @@ struct boot_init_vector {
/* similar to bootloader's linux_app_boot_info but without global data */ /* similar to bootloader's linux_app_boot_info but without global data */
struct linux_app_boot_info { struct linux_app_boot_info {
#ifdef __BIG_ENDIAN_BITFIELD
uint32_t labi_signature; uint32_t labi_signature;
uint32_t start_core0_addr; uint32_t start_core0_addr;
uint32_t avail_coremask; uint32_t avail_coremask;
uint32_t pci_console_active; uint32_t pci_console_active;
uint32_t icache_prefetch_disable; uint32_t icache_prefetch_disable;
uint32_t padding;
uint64_t InitTLBStart_addr; uint64_t InitTLBStart_addr;
uint32_t start_app_addr; uint32_t start_app_addr;
uint32_t cur_exception_base; uint32_t cur_exception_base;
...@@ -49,6 +51,27 @@ struct linux_app_boot_info { ...@@ -49,6 +51,27 @@ struct linux_app_boot_info {
uint32_t compact_flash_common_base_addr; uint32_t compact_flash_common_base_addr;
uint32_t compact_flash_attribute_base_addr; uint32_t compact_flash_attribute_base_addr;
uint32_t led_display_base_addr; uint32_t led_display_base_addr;
#else
uint32_t start_core0_addr;
uint32_t labi_signature;
uint32_t pci_console_active;
uint32_t avail_coremask;
uint32_t padding;
uint32_t icache_prefetch_disable;
uint64_t InitTLBStart_addr;
uint32_t cur_exception_base;
uint32_t start_app_addr;
uint32_t compact_flash_common_base_addr;
uint32_t no_mark_private_data;
uint32_t led_display_base_addr;
uint32_t compact_flash_attribute_base_addr;
#endif
}; };
/* If not to copy a lot of bootloader's structures /* If not to copy a lot of bootloader's structures
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
* to 0. * to 0.
*/ */
struct cvmx_bootinfo { struct cvmx_bootinfo {
#ifdef __BIG_ENDIAN_BITFIELD
uint32_t major_version; uint32_t major_version;
uint32_t minor_version; uint32_t minor_version;
...@@ -123,6 +124,60 @@ struct cvmx_bootinfo { ...@@ -123,6 +124,60 @@ struct cvmx_bootinfo {
*/ */
uint64_t fdt_addr; uint64_t fdt_addr;
#endif #endif
#else /* __BIG_ENDIAN */
/*
* Little-Endian: When the CPU mode is switched to
* little-endian, the view of the structure has some of the
* fields swapped.
*/
uint32_t minor_version;
uint32_t major_version;
uint64_t stack_top;
uint64_t heap_base;
uint64_t heap_end;
uint64_t desc_vaddr;
uint32_t stack_size;
uint32_t exception_base_addr;
uint32_t core_mask;
uint32_t flags;
uint32_t phy_mem_desc_addr;
uint32_t dram_size;
uint32_t eclock_hz;
uint32_t debugger_flags_base_addr;
uint32_t reserved0;
uint32_t dclock_hz;
uint8_t reserved3;
uint8_t reserved2;
uint16_t reserved1;
uint8_t board_rev_minor;
uint8_t board_rev_major;
uint16_t board_type;
char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN];
uint8_t mac_addr_base[6];
uint8_t mac_addr_count;
uint8_t pad[5];
#if (CVMX_BOOTINFO_MIN_VER >= 1)
uint64_t compact_flash_common_base_addr;
uint64_t compact_flash_attribute_base_addr;
uint64_t led_display_base_addr;
#endif
#if (CVMX_BOOTINFO_MIN_VER >= 2)
uint32_t config_flags;
uint32_t dfa_ref_clock_hz;
#endif
#if (CVMX_BOOTINFO_MIN_VER >= 3)
uint64_t fdt_addr;
#endif
#endif
}; };
#define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0) #define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment