You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

thunderxcfg.h 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #ifndef _THUNDERXCFG_H
  2. #define _THUNDERXCFG_H
  3. /** @file
  4. *
  5. * Cavium ThunderX Board Configuration
  6. *
  7. * The definitions in this section are extracted from BSD-licensed
  8. * (but non-public) portions of ThunderPkg.
  9. *
  10. */
  11. FILE_LICENCE ( BSD2 );
  12. #include <ipxe/efi/efi.h>
  13. /******************************************************************************
  14. *
  15. * From ThunderxBoardConfig.h
  16. *
  17. ******************************************************************************
  18. *
  19. * Header file for Cavium ThunderX Board Configurations
  20. * Copyright (c) 2015, Cavium Inc.
  21. * All rights reserved.
  22. *
  23. * Redistribution and use in source and binary forms, with or without
  24. * modification, are permitted provided that the following conditions
  25. * are met:
  26. *
  27. * 1. Redistributions of source code must retain the above copyright
  28. * notice, this list of conditions and the following disclaimer.
  29. * 2. Redistributions in binary form must reproduce the above
  30. * copyright notice, this list of conditions and the following
  31. * disclaimer in the documentation and/or other materials provided
  32. * with the distribution.
  33. *
  34. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  35. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  36. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  37. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  39. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  40. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  41. * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  42. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  43. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  44. * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  45. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  46. * SUCH DAMAGE.
  47. *
  48. */
  49. #define MAX_NODES 2
  50. #define CLUSTER_COUNT 3
  51. #define CORE_PER_CLUSTER_COUNT 16
  52. #define CORE_COUNT (CLUSTER_COUNT*CORE_PER_CLUSTER_COUNT)
  53. #define BGX_PER_NODE_COUNT 2
  54. #define LMAC_PER_BGX_COUNT 4
  55. #define PEM_PER_NODE_COUNT 6
  56. #define LMC_PER_NODE_COUNT 4
  57. #define DIMM_PER_LMC_COUNT 2
  58. #define THUNDERX_CPU_ID(node, cluster, core) (((node) << 16) | ((cluster) << 8) | (core))
  59. /******************************************************************************
  60. *
  61. * From ThunderConfigProtocol.h
  62. *
  63. ******************************************************************************
  64. *
  65. * Thunder board Configuration Protocol
  66. *
  67. * Copyright (c) 2015, Cavium Inc. All rights reserved.<BR>
  68. *
  69. * This program and the accompanying materials are licensed and made
  70. * available under the terms and conditions of the BSD License which
  71. * accompanies this distribution. The full text of the license may
  72. * be found at http://opensource.org/licenses/bsd-license.php
  73. *
  74. * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
  75. * BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
  76. * EXPRESS OR IMPLIED.
  77. *
  78. */
  79. #define EFI_THUNDER_CONFIG_PROTOCOL_GUID \
  80. {0xc12b1873, 0xac17, 0x4176, {0xac, 0x77, 0x7e, 0xcb, 0x4d, 0xef, 0xff, 0xec}}
  81. ///
  82. /// Forward declaration
  83. ///
  84. typedef struct _EFI_THUNDER_CONFIG_PROTOCOL EFI_THUNDER_CONFIG_PROTOCOL;
  85. typedef enum {
  86. BGX_ENABLED,
  87. BGX_MODE,
  88. LMAC_COUNT,
  89. BASE_ADDRESS,
  90. LMAC_TYPE_BGX,
  91. QLM_MASK,
  92. QLM_FREQ,
  93. USE_TRAINING
  94. } BGX_PROPERTY;
  95. typedef enum {
  96. ENABLED,
  97. LANE_TO_SDS,
  98. MAC_ADDRESS
  99. } LMAC_PROPERTY;
  100. ///
  101. /// Function prototypes
  102. ///
  103. typedef
  104. EFI_STATUS
  105. (EFIAPI *EFI_THUNDER_CONFIG_PROTOCOL_GET_CONFIG)(
  106. IN EFI_THUNDER_CONFIG_PROTOCOL *This,
  107. OUT VOID** cfg
  108. );
  109. typedef
  110. EFI_STATUS
  111. (EFIAPI *EFI_THUNDER_CONFIG_PROTOCOL_GET_BGX_PROP)(
  112. IN EFI_THUNDER_CONFIG_PROTOCOL *This,
  113. IN UINTN NodeId,
  114. IN UINTN BgxId,
  115. IN BGX_PROPERTY BgxProp,
  116. IN UINT64 ValueSize,
  117. OUT UINT64 *Value
  118. );
  119. typedef
  120. EFI_STATUS
  121. (EFIAPI *EFI_THUNDER_CONFIG_PROTOCOL_GET_LMAC_PROP)(
  122. IN EFI_THUNDER_CONFIG_PROTOCOL *This,
  123. IN UINTN NodeId,
  124. IN UINTN BgxId,
  125. IN UINTN LmacId,
  126. IN LMAC_PROPERTY LmacProp,
  127. IN UINT64 ValueSize,
  128. OUT UINT64 *Value
  129. );
  130. ///
  131. /// Protocol structure
  132. ///
  133. struct _EFI_THUNDER_CONFIG_PROTOCOL {
  134. EFI_THUNDER_CONFIG_PROTOCOL_GET_CONFIG GetConfig;
  135. EFI_THUNDER_CONFIG_PROTOCOL_GET_BGX_PROP GetBgxProp;
  136. EFI_THUNDER_CONFIG_PROTOCOL_GET_LMAC_PROP GetLmacProp;
  137. VOID* BoardConfig;
  138. };
  139. #endif /* _THUNDERXCFG_H */