Skip to content

Commit 7e9561e

Browse files
mellanoxbmcdavem330
authored andcommitted
mlxsw: reg: Add Management General Peripheral Information Register
Add MGPIR - Management General Peripheral Information Register, which allows software to query the hardware and firmware general information of peripheral entities as Gearboxes etc. Signed-off-by: Vadim Pasternak <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ae57467 commit 7e9561e

File tree

1 file changed

+52
-0
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+52
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9044,6 +9044,57 @@ static inline void mlxsw_reg_mprs_pack(char *payload, u16 parsing_depth,
90449044
mlxsw_reg_mprs_vxlan_udp_dport_set(payload, vxlan_udp_dport);
90459045
}
90469046

9047+
/* MGPIR - Management General Peripheral Information Register
9048+
* ----------------------------------------------------------
9049+
* MGPIR register allows software to query the hardware and
9050+
* firmware general information of peripheral entities.
9051+
*/
9052+
#define MLXSW_REG_MGPIR_ID 0x9100
9053+
#define MLXSW_REG_MGPIR_LEN 0xA0
9054+
9055+
MLXSW_REG_DEFINE(mgpir, MLXSW_REG_MGPIR_ID, MLXSW_REG_MGPIR_LEN);
9056+
9057+
enum mlxsw_reg_mgpir_device_type {
9058+
MLXSW_REG_MGPIR_DEVICE_TYPE_NONE,
9059+
MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE,
9060+
};
9061+
9062+
/* device_type
9063+
* Access: RO
9064+
*/
9065+
MLXSW_ITEM32(reg, mgpir, device_type, 0x00, 24, 4);
9066+
9067+
/* devices_per_flash
9068+
* Number of devices of device_type per flash (can be shared by few devices).
9069+
* Access: RO
9070+
*/
9071+
MLXSW_ITEM32(reg, mgpir, devices_per_flash, 0x00, 16, 8);
9072+
9073+
/* num_of_devices
9074+
* Number of devices of device_type.
9075+
* Access: RO
9076+
*/
9077+
MLXSW_ITEM32(reg, mgpir, num_of_devices, 0x00, 0, 8);
9078+
9079+
static inline void mlxsw_reg_mgpir_pack(char *payload)
9080+
{
9081+
MLXSW_REG_ZERO(mgpir, payload);
9082+
}
9083+
9084+
static inline void
9085+
mlxsw_reg_mgpir_unpack(char *payload, u8 *num_of_devices,
9086+
enum mlxsw_reg_mgpir_device_type *device_type,
9087+
u8 *devices_per_flash)
9088+
{
9089+
if (num_of_devices)
9090+
*num_of_devices = mlxsw_reg_mgpir_num_of_devices_get(payload);
9091+
if (device_type)
9092+
*device_type = mlxsw_reg_mgpir_device_type_get(payload);
9093+
if (devices_per_flash)
9094+
*devices_per_flash =
9095+
mlxsw_reg_mgpir_devices_per_flash_get(payload);
9096+
}
9097+
90479098
/* TNGCR - Tunneling NVE General Configuration Register
90489099
* ----------------------------------------------------
90499100
* The TNGCR register is used for setting up the NVE Tunneling configuration.
@@ -10059,6 +10110,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
1005910110
MLXSW_REG(mcda),
1006010111
MLXSW_REG(mgpc),
1006110112
MLXSW_REG(mprs),
10113+
MLXSW_REG(mgpir),
1006210114
MLXSW_REG(tngcr),
1006310115
MLXSW_REG(tnumt),
1006410116
MLXSW_REG(tnqcr),

0 commit comments

Comments
 (0)