mlxsw: reg: Extend PMMP register with new slot number field
Extend PMMP (Port Module Memory Map Properties Register) with new field specifying the slot number. The purpose of this field is to enable overriding the cable/module memory map advertisement. For non-modular systems the 'module' number uniquely identifies the transceiver location. For modular systems the transceivers are identified by two indexes: - 'slot_index', specifying the slot number, where line card is located; - 'module', specifying cage transceiver within the line card. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
655cbb1d75
commit
7cb85d3c69
@ -563,7 +563,7 @@ static int mlxsw_env_module_low_power_set(struct mlxsw_core *mlxsw_core,
|
|||||||
u16 eeprom_override_mask, eeprom_override;
|
u16 eeprom_override_mask, eeprom_override;
|
||||||
char pmmp_pl[MLXSW_REG_PMMP_LEN];
|
char pmmp_pl[MLXSW_REG_PMMP_LEN];
|
||||||
|
|
||||||
mlxsw_reg_pmmp_pack(pmmp_pl, module);
|
mlxsw_reg_pmmp_pack(pmmp_pl, 0, module);
|
||||||
mlxsw_reg_pmmp_sticky_set(pmmp_pl, true);
|
mlxsw_reg_pmmp_sticky_set(pmmp_pl, true);
|
||||||
/* Mask all the bits except low power mode. */
|
/* Mask all the bits except low power mode. */
|
||||||
eeprom_override_mask = ~MLXSW_REG_PMMP_EEPROM_OVERRIDE_LOW_POWER_MASK;
|
eeprom_override_mask = ~MLXSW_REG_PMMP_EEPROM_OVERRIDE_LOW_POWER_MASK;
|
||||||
|
@ -5984,6 +5984,12 @@ MLXSW_REG_DEFINE(pmmp, MLXSW_REG_PMMP_ID, MLXSW_REG_PMMP_LEN);
|
|||||||
*/
|
*/
|
||||||
MLXSW_ITEM32(reg, pmmp, module, 0x00, 16, 8);
|
MLXSW_ITEM32(reg, pmmp, module, 0x00, 16, 8);
|
||||||
|
|
||||||
|
/* reg_pmmp_slot_index
|
||||||
|
* Slot index.
|
||||||
|
* Access: Index
|
||||||
|
*/
|
||||||
|
MLXSW_ITEM32(reg, pmmp, slot_index, 0x00, 24, 4);
|
||||||
|
|
||||||
/* reg_pmmp_sticky
|
/* reg_pmmp_sticky
|
||||||
* When set, will keep eeprom_override values after plug-out event.
|
* When set, will keep eeprom_override values after plug-out event.
|
||||||
* Access: OP
|
* Access: OP
|
||||||
@ -6011,9 +6017,10 @@ enum {
|
|||||||
*/
|
*/
|
||||||
MLXSW_ITEM32(reg, pmmp, eeprom_override, 0x04, 0, 16);
|
MLXSW_ITEM32(reg, pmmp, eeprom_override, 0x04, 0, 16);
|
||||||
|
|
||||||
static inline void mlxsw_reg_pmmp_pack(char *payload, u8 module)
|
static inline void mlxsw_reg_pmmp_pack(char *payload, u8 slot_index, u8 module)
|
||||||
{
|
{
|
||||||
MLXSW_REG_ZERO(pmmp, payload);
|
MLXSW_REG_ZERO(pmmp, payload);
|
||||||
|
mlxsw_reg_pmmp_slot_index_set(payload, slot_index);
|
||||||
mlxsw_reg_pmmp_module_set(payload, module);
|
mlxsw_reg_pmmp_module_set(payload, module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user