Skip to content

Commit 5290a8f

Browse files
Jiri Pirkodavem330
Jiri Pirko
authored andcommitted
mlxsw: reg: Add Management DownStream Device Control Register
The MDDC register allows to control downstream devices and line cards. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 505f524 commit 5290a8f

File tree

1 file changed

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

1 file changed

+37
-0
lines changed

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

+37
Original file line numberDiff line numberDiff line change
@@ -11635,6 +11635,42 @@ mlxsw_reg_mddq_slot_name_unpack(const char *payload, char *slot_ascii_name)
1163511635
mlxsw_reg_mddq_slot_ascii_name_memcpy_from(payload, slot_ascii_name);
1163611636
}
1163711637

11638+
/* MDDC - Management DownStream Device Control Register
11639+
* ----------------------------------------------------
11640+
* This register allows to control downstream devices and line cards.
11641+
*/
11642+
#define MLXSW_REG_MDDC_ID 0x9163
11643+
#define MLXSW_REG_MDDC_LEN 0x30
11644+
11645+
MLXSW_REG_DEFINE(mddc, MLXSW_REG_MDDC_ID, MLXSW_REG_MDDC_LEN);
11646+
11647+
/* reg_mddc_slot_index
11648+
* Slot index. 0 is reserved.
11649+
* Access: Index
11650+
*/
11651+
MLXSW_ITEM32(reg, mddc, slot_index, 0x00, 0, 4);
11652+
11653+
/* reg_mddc_rst
11654+
* Reset request.
11655+
* Access: OP
11656+
*/
11657+
MLXSW_ITEM32(reg, mddc, rst, 0x04, 29, 1);
11658+
11659+
/* reg_mddc_device_enable
11660+
* When set, FW is the manager and allowed to program the downstream device.
11661+
* Access: RW
11662+
*/
11663+
MLXSW_ITEM32(reg, mddc, device_enable, 0x04, 28, 1);
11664+
11665+
static inline void mlxsw_reg_mddc_pack(char *payload, u8 slot_index, bool rst,
11666+
bool device_enable)
11667+
{
11668+
MLXSW_REG_ZERO(mddc, payload);
11669+
mlxsw_reg_mddc_slot_index_set(payload, slot_index);
11670+
mlxsw_reg_mddc_rst_set(payload, rst);
11671+
mlxsw_reg_mddc_device_enable_set(payload, device_enable);
11672+
}
11673+
1163811674
/* MFDE - Monitoring FW Debug Register
1163911675
* -----------------------------------
1164011676
*/
@@ -12955,6 +12991,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
1295512991
MLXSW_REG(mfgd),
1295612992
MLXSW_REG(mgpir),
1295712993
MLXSW_REG(mddq),
12994+
MLXSW_REG(mddc),
1295812995
MLXSW_REG(mfde),
1295912996
MLXSW_REG(tngcr),
1296012997
MLXSW_REG(tnumt),

0 commit comments

Comments
 (0)