Skip to content

Commit 7cb85d3

Browse files
vadimp-nvidiakuba-moo
authored andcommitted
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>
1 parent 655cbb1 commit 7cb85d3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/net/ethernet/mellanox/mlxsw/core_env.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ static int mlxsw_env_module_low_power_set(struct mlxsw_core *mlxsw_core,
563563
u16 eeprom_override_mask, eeprom_override;
564564
char pmmp_pl[MLXSW_REG_PMMP_LEN];
565565

566-
mlxsw_reg_pmmp_pack(pmmp_pl, module);
566+
mlxsw_reg_pmmp_pack(pmmp_pl, 0, module);
567567
mlxsw_reg_pmmp_sticky_set(pmmp_pl, true);
568568
/* Mask all the bits except low power mode. */
569569
eeprom_override_mask = ~MLXSW_REG_PMMP_EEPROM_OVERRIDE_LOW_POWER_MASK;

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5984,6 +5984,12 @@ MLXSW_REG_DEFINE(pmmp, MLXSW_REG_PMMP_ID, MLXSW_REG_PMMP_LEN);
59845984
*/
59855985
MLXSW_ITEM32(reg, pmmp, module, 0x00, 16, 8);
59865986

5987+
/* reg_pmmp_slot_index
5988+
* Slot index.
5989+
* Access: Index
5990+
*/
5991+
MLXSW_ITEM32(reg, pmmp, slot_index, 0x00, 24, 4);
5992+
59875993
/* reg_pmmp_sticky
59885994
* When set, will keep eeprom_override values after plug-out event.
59895995
* Access: OP
@@ -6011,9 +6017,10 @@ enum {
60116017
*/
60126018
MLXSW_ITEM32(reg, pmmp, eeprom_override, 0x04, 0, 16);
60136019

6014-
static inline void mlxsw_reg_pmmp_pack(char *payload, u8 module)
6020+
static inline void mlxsw_reg_pmmp_pack(char *payload, u8 slot_index, u8 module)
60156021
{
60166022
MLXSW_REG_ZERO(pmmp, payload);
6023+
mlxsw_reg_pmmp_slot_index_set(payload, slot_index);
60176024
mlxsw_reg_pmmp_module_set(payload, module);
60186025
}
60196026

0 commit comments

Comments
 (0)