Commit ef23841b authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

mlxsw: reg: Add fields to PMAOS register



The Ports Module Administrative and Operational Status (PMAOS) register
configures and retrieves the per-module status. Extend it with fields
required to support various module settings such as reset and power
mode.

Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 896f399b
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -5681,6 +5681,14 @@ static inline void mlxsw_reg_pspa_pack(char *payload, u8 swid, u8 local_port)

MLXSW_REG_DEFINE(pmaos, MLXSW_REG_PMAOS_ID, MLXSW_REG_PMAOS_LEN);

/* reg_pmaos_rst
 * Module reset toggle.
 * Note: Setting reset while module is plugged-in will result in transition to
 * "initializing" operational state.
 * Access: OP
 */
MLXSW_ITEM32(reg, pmaos, rst, 0x00, 31, 1);

/* reg_pmaos_slot_index
 * Slot index.
 * Access: Index
@@ -5693,6 +5701,24 @@ MLXSW_ITEM32(reg, pmaos, slot_index, 0x00, 24, 4);
 */
MLXSW_ITEM32(reg, pmaos, module, 0x00, 16, 8);

enum mlxsw_reg_pmaos_admin_status {
	MLXSW_REG_PMAOS_ADMIN_STATUS_ENABLED = 1,
	MLXSW_REG_PMAOS_ADMIN_STATUS_DISABLED = 2,
	/* If the module is active and then unplugged, or experienced an error
	 * event, the operational status should go to "disabled" and can only
	 * be enabled upon explicit enable command.
	 */
	MLXSW_REG_PMAOS_ADMIN_STATUS_ENABLED_ONCE = 3,
};

/* reg_pmaos_admin_status
 * Module administrative state (the desired state of the module).
 * Note: To disable a module, all ports associated with the port must be
 * administatively down first.
 * Access: RW
 */
MLXSW_ITEM32(reg, pmaos, admin_status, 0x00, 8, 4);

/* reg_pmaos_ase
 * Admin state update enable.
 * If this bit is set, admin state will be updated based on admin_state field.