cvmx-bootinfo.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Marvell International Ltd.
  4. */
  5. /*
  6. * Header file containing the ABI with the bootloader.
  7. */
  8. #ifndef __CVMX_BOOTINFO_H__
  9. #define __CVMX_BOOTINFO_H__
  10. #include "cvmx-coremask.h"
  11. /*
  12. * Current major and minor versions of the CVMX bootinfo block that is
  13. * passed from the bootloader to the application. This is versioned
  14. * so that applications can properly handle multiple bootloader
  15. * versions.
  16. */
  17. #define CVMX_BOOTINFO_MAJ_VER 1
  18. #define CVMX_BOOTINFO_MIN_VER 4
  19. #if (CVMX_BOOTINFO_MAJ_VER == 1)
  20. #define CVMX_BOOTINFO_OCTEON_SERIAL_LEN 20
  21. /*
  22. * This structure is populated by the bootloader. For binary
  23. * compatibility the only changes that should be made are
  24. * adding members to the end of the structure, and the minor
  25. * version should be incremented at that time.
  26. * If an incompatible change is made, the major version
  27. * must be incremented, and the minor version should be reset
  28. * to 0.
  29. */
  30. struct cvmx_bootinfo {
  31. u32 major_version;
  32. u32 minor_version;
  33. u64 stack_top;
  34. u64 heap_base;
  35. u64 heap_end;
  36. u64 desc_vaddr;
  37. u32 exception_base_addr;
  38. u32 stack_size;
  39. u32 flags;
  40. u32 core_mask;
  41. /* DRAM size in megabytes */
  42. u32 dram_size;
  43. /* physical address of free memory descriptor block*/
  44. u32 phy_mem_desc_addr;
  45. /* used to pass flags from app to debugger */
  46. u32 debugger_flags_base_addr;
  47. /* CPU clock speed, in hz */
  48. u32 eclock_hz;
  49. /* DRAM clock speed, in hz */
  50. u32 dclock_hz;
  51. u32 reserved0;
  52. u16 board_type;
  53. u8 board_rev_major;
  54. u8 board_rev_minor;
  55. u16 reserved1;
  56. u8 reserved2;
  57. u8 reserved3;
  58. char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN];
  59. u8 mac_addr_base[6];
  60. u8 mac_addr_count;
  61. #if (CVMX_BOOTINFO_MIN_VER >= 1)
  62. /*
  63. * Several boards support compact flash on the Octeon boot
  64. * bus. The CF memory spaces may be mapped to different
  65. * addresses on different boards. These are the physical
  66. * addresses, so care must be taken to use the correct
  67. * XKPHYS/KSEG0 addressing depending on the application's
  68. * ABI. These values will be 0 if CF is not present.
  69. */
  70. u64 compact_flash_common_base_addr;
  71. u64 compact_flash_attribute_base_addr;
  72. /*
  73. * Base address of the LED display (as on EBT3000 board)
  74. * This will be 0 if LED display not present.
  75. */
  76. u64 led_display_base_addr;
  77. #endif
  78. #if (CVMX_BOOTINFO_MIN_VER >= 2)
  79. /* DFA reference clock in hz (if applicable)*/
  80. u32 dfa_ref_clock_hz;
  81. /*
  82. * flags indicating various configuration options. These
  83. * flags supercede the 'flags' variable and should be used
  84. * instead if available.
  85. */
  86. u32 config_flags;
  87. #endif
  88. #if (CVMX_BOOTINFO_MIN_VER >= 3)
  89. /*
  90. * Address of the OF Flattened Device Tree structure
  91. * describing the board.
  92. */
  93. u64 fdt_addr;
  94. #endif
  95. #if (CVMX_BOOTINFO_MIN_VER >= 4)
  96. /*
  97. * Coremask used for processors with more than 32 cores
  98. * or with OCI. This replaces core_mask.
  99. */
  100. struct cvmx_coremask ext_core_mask;
  101. #endif
  102. };
  103. #define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0)
  104. #define CVMX_BOOTINFO_CFG_FLAG_PCI_TARGET (1ull << 1)
  105. #define CVMX_BOOTINFO_CFG_FLAG_DEBUG (1ull << 2)
  106. #define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3)
  107. /*
  108. * This flag is set if the TLB mappings are not contained in the
  109. * 0x10000000 - 0x20000000 boot bus region.
  110. */
  111. #define CVMX_BOOTINFO_CFG_FLAG_OVERSIZE_TLB_MAPPING (1ull << 4)
  112. #define CVMX_BOOTINFO_CFG_FLAG_BREAK (1ull << 5)
  113. #endif /* (CVMX_BOOTINFO_MAJ_VER == 1) */
  114. #endif /* __CVMX_BOOTINFO_H__ */