Commit 1bd06938 authored by Amit Cohen's avatar Amit Cohen Committed by David S. Miller
Browse files

mlxsw: reg: Port Diagnostics Database Register



The PDDR register enables to read the Phy debug database.

Signed-off-by: default avatarAmit Cohen <amitc@mellanox.com>
Reviewed-by: default avatarPetr Machata <petrm@mellanox.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ecc31c60
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
@@ -5438,6 +5438,56 @@ static inline void mlxsw_reg_pplr_pack(char *payload, u8 local_port,
				 MLXSW_REG_PPLR_LB_TYPE_BIT_PHY_LOCAL : 0);
}

/* PDDR - Port Diagnostics Database Register
 * -----------------------------------------
 * The PDDR enables to read the Phy debug database
 */
#define MLXSW_REG_PDDR_ID 0x5031
#define MLXSW_REG_PDDR_LEN 0x100

MLXSW_REG_DEFINE(pddr, MLXSW_REG_PDDR_ID, MLXSW_REG_PDDR_LEN);

/* reg_pddr_local_port
 * Local port number.
 * Access: Index
 */
MLXSW_ITEM32(reg, pddr, local_port, 0x00, 16, 8);

enum mlxsw_reg_pddr_page_select {
	MLXSW_REG_PDDR_PAGE_SELECT_TROUBLESHOOTING_INFO = 1,
};

/* reg_pddr_page_select
 * Page select index.
 * Access: Index
 */
MLXSW_ITEM32(reg, pddr, page_select, 0x04, 0, 8);

enum mlxsw_reg_pddr_trblsh_group_opcode {
	/* Monitor opcodes */
	MLXSW_REG_PDDR_TRBLSH_GROUP_OPCODE_MONITOR,
};

/* reg_pddr_group_opcode
 * Group selector.
 * Access: Index
 */
MLXSW_ITEM32(reg, pddr, trblsh_group_opcode, 0x08, 0, 16);

/* reg_pddr_status_opcode
 * Group selector.
 * Access: RO
 */
MLXSW_ITEM32(reg, pddr, trblsh_status_opcode, 0x0C, 0, 16);

static inline void mlxsw_reg_pddr_pack(char *payload, u8 local_port,
				       u8 page_select)
{
	MLXSW_REG_ZERO(pddr, payload);
	mlxsw_reg_pddr_local_port_set(payload, local_port);
	mlxsw_reg_pddr_page_select_set(payload, page_select);
}

/* PMTM - Port Module Type Mapping Register
 * ----------------------------------------
 * The PMTM allows query or configuration of module types.
@@ -10758,6 +10808,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
	MLXSW_REG(pbmc),
	MLXSW_REG(pspa),
	MLXSW_REG(pplr),
	MLXSW_REG(pddr),
	MLXSW_REG(pmtm),
	MLXSW_REG(htgt),
	MLXSW_REG(hpkt),