Skip to content
/ linux Public

Commit f10ba08

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: reg: Add Port Module Memory Map Properties register
Add the Port Module Memory Map Properties register. It will be used to set the power mode of a module in subsequent patches. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 353407d commit f10ba08

File tree

1 file changed

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

1 file changed

+50
-0
lines changed

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5946,6 +5946,55 @@ static inline void mlxsw_reg_pddr_pack(char *payload, u8 local_port,
59465946
mlxsw_reg_pddr_page_select_set(payload, page_select);
59475947
}
59485948

5949+
/* PMMP - Port Module Memory Map Properties Register
5950+
* -------------------------------------------------
5951+
* The PMMP register allows to override the module memory map advertisement.
5952+
* The register can only be set when the module is disabled by PMAOS register.
5953+
*/
5954+
#define MLXSW_REG_PMMP_ID 0x5044
5955+
#define MLXSW_REG_PMMP_LEN 0x2C
5956+
5957+
MLXSW_REG_DEFINE(pmmp, MLXSW_REG_PMMP_ID, MLXSW_REG_PMMP_LEN);
5958+
5959+
/* reg_pmmp_module
5960+
* Module number.
5961+
* Access: Index
5962+
*/
5963+
MLXSW_ITEM32(reg, pmmp, module, 0x00, 16, 8);
5964+
5965+
/* reg_pmmp_sticky
5966+
* When set, will keep eeprom_override values after plug-out event.
5967+
* Access: OP
5968+
*/
5969+
MLXSW_ITEM32(reg, pmmp, sticky, 0x00, 0, 1);
5970+
5971+
/* reg_pmmp_eeprom_override_mask
5972+
* Write mask bit (negative polarity).
5973+
* 0 - Allow write
5974+
* 1 - Ignore write
5975+
* On write, indicates which of the bits from eeprom_override field are
5976+
* updated.
5977+
* Access: WO
5978+
*/
5979+
MLXSW_ITEM32(reg, pmmp, eeprom_override_mask, 0x04, 16, 16);
5980+
5981+
enum {
5982+
/* Set module to low power mode */
5983+
MLXSW_REG_PMMP_EEPROM_OVERRIDE_LOW_POWER_MASK = BIT(8),
5984+
};
5985+
5986+
/* reg_pmmp_eeprom_override
5987+
* Override / ignore EEPROM advertisement properties bitmask
5988+
* Access: RW
5989+
*/
5990+
MLXSW_ITEM32(reg, pmmp, eeprom_override, 0x04, 0, 16);
5991+
5992+
static inline void mlxsw_reg_pmmp_pack(char *payload, u8 module)
5993+
{
5994+
MLXSW_REG_ZERO(pmmp, payload);
5995+
mlxsw_reg_pmmp_module_set(payload, module);
5996+
}
5997+
59495998
/* PLLP - Port Local port to Label Port mapping Register
59505999
* -----------------------------------------------------
59516000
* The PLLP register returns the mapping from Local Port into Label Port.
@@ -12348,6 +12397,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
1234812397
MLXSW_REG(pmtdb),
1234912398
MLXSW_REG(pmpe),
1235012399
MLXSW_REG(pddr),
12400+
MLXSW_REG(pmmp),
1235112401
MLXSW_REG(pllp),
1235212402
MLXSW_REG(htgt),
1235312403
MLXSW_REG(hpkt),

0 commit comments

Comments
 (0)