iPXE
thunderxcfg.h
Go to the documentation of this file.
00001 #ifndef _THUNDERXCFG_H
00002 #define _THUNDERXCFG_H
00003 
00004 /** @file
00005  *
00006  * Cavium ThunderX Board Configuration
00007  *
00008  * The definitions in this section are extracted from BSD-licensed
00009  * (but non-public) portions of ThunderPkg.
00010  *
00011  */
00012 
00013 FILE_LICENCE ( BSD2 );
00014 
00015 #include <ipxe/efi/efi.h>
00016 
00017 /******************************************************************************
00018  *
00019  * From ThunderxBoardConfig.h
00020  *
00021  ******************************************************************************
00022  *
00023  *  Header file for Cavium ThunderX Board Configurations
00024  *  Copyright (c) 2015, Cavium Inc.
00025  *  All rights reserved.
00026  *
00027  *  Redistribution and use in source and binary forms, with or without
00028  *  modification, are permitted provided that the following conditions
00029  *  are met:
00030  *
00031  *  1. Redistributions of source code must retain the above copyright
00032  *     notice, this list of conditions and the following disclaimer.
00033  *  2. Redistributions in binary form must reproduce the above
00034  *     copyright notice, this list of conditions and the following
00035  *     disclaimer in the documentation and/or other materials provided
00036  *     with the distribution.
00037  *
00038  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
00039  *  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
00040  *  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00041  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00042  *  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
00043  *  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00044  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
00045  *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00046  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00047  *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
00048  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00049  *  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00050  *  SUCH DAMAGE.
00051  *
00052  */
00053 
00054 #define MAX_NODES               2
00055 #define CLUSTER_COUNT           3
00056 #define CORE_PER_CLUSTER_COUNT  16
00057 #define CORE_COUNT              (CLUSTER_COUNT*CORE_PER_CLUSTER_COUNT)
00058 #define BGX_PER_NODE_COUNT      2
00059 #define LMAC_PER_BGX_COUNT      4
00060 #define PEM_PER_NODE_COUNT      6
00061 #define LMC_PER_NODE_COUNT      4
00062 #define DIMM_PER_LMC_COUNT      2
00063 
00064 #define THUNDERX_CPU_ID(node, cluster, core) (((node) << 16) | ((cluster) << 8) | (core))
00065 
00066 /******************************************************************************
00067  *
00068  * From ThunderConfigProtocol.h
00069  *
00070  ******************************************************************************
00071  *
00072  *  Thunder board Configuration Protocol
00073  *
00074  *  Copyright (c) 2015, Cavium Inc. All rights reserved.<BR>
00075  *
00076  *  This program and the accompanying materials are licensed and made
00077  *  available under the terms and conditions of the BSD License which
00078  *  accompanies this distribution.  The full text of the license may
00079  *  be found at http://opensource.org/licenses/bsd-license.php
00080  *
00081  *  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
00082  *  BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
00083  *  EXPRESS OR IMPLIED.
00084  *
00085  */
00086 
00087 #define EFI_THUNDER_CONFIG_PROTOCOL_GUID \
00088   {0xc12b1873, 0xac17, 0x4176, {0xac, 0x77, 0x7e, 0xcb, 0x4d, 0xef, 0xff, 0xec}}
00089 
00090 ///
00091 /// Forward declaration
00092 ///
00093 typedef struct _EFI_THUNDER_CONFIG_PROTOCOL EFI_THUNDER_CONFIG_PROTOCOL;
00094 
00095 typedef enum {
00096   BGX_ENABLED,
00097   BGX_MODE,
00098   LMAC_COUNT,
00099   BASE_ADDRESS,
00100   LMAC_TYPE_BGX,
00101   QLM_MASK,
00102   QLM_FREQ,
00103   USE_TRAINING
00104 } BGX_PROPERTY;
00105 
00106 typedef enum {
00107   ENABLED,
00108   LANE_TO_SDS,
00109   MAC_ADDRESS
00110 } LMAC_PROPERTY;
00111 
00112 ///
00113 /// Function prototypes
00114 ///
00115 typedef
00116 EFI_STATUS
00117 (EFIAPI *EFI_THUNDER_CONFIG_PROTOCOL_GET_CONFIG)(
00118   IN EFI_THUNDER_CONFIG_PROTOCOL  *This,
00119   OUT VOID** cfg
00120   );
00121 
00122 typedef
00123 EFI_STATUS
00124 (EFIAPI *EFI_THUNDER_CONFIG_PROTOCOL_GET_BGX_PROP)(
00125   IN EFI_THUNDER_CONFIG_PROTOCOL   *This,
00126   IN UINTN                         NodeId,
00127   IN UINTN                         BgxId,
00128   IN BGX_PROPERTY                  BgxProp,
00129   IN UINT64                        ValueSize,
00130   OUT UINT64                       *Value
00131   );
00132 
00133 typedef
00134 EFI_STATUS
00135 (EFIAPI *EFI_THUNDER_CONFIG_PROTOCOL_GET_LMAC_PROP)(
00136   IN EFI_THUNDER_CONFIG_PROTOCOL   *This,
00137   IN UINTN                         NodeId,
00138   IN UINTN                         BgxId,
00139   IN UINTN                         LmacId,
00140   IN LMAC_PROPERTY                 LmacProp,
00141   IN UINT64                        ValueSize,
00142   OUT UINT64                       *Value
00143   );
00144 
00145 ///
00146 /// Protocol structure
00147 ///
00148 struct _EFI_THUNDER_CONFIG_PROTOCOL {
00149   EFI_THUNDER_CONFIG_PROTOCOL_GET_CONFIG GetConfig;
00150   EFI_THUNDER_CONFIG_PROTOCOL_GET_BGX_PROP GetBgxProp;
00151   EFI_THUNDER_CONFIG_PROTOCOL_GET_LMAC_PROP GetLmacProp;
00152   VOID* BoardConfig;
00153 };
00154 
00155 #endif /* _THUNDERXCFG_H */