The mlxreg utility allows users to obtain information regarding supported access registers, such as their fields and attributes. It also allows getting access to register data from firmware and setting access register data on firmware.
Registers can be get/set in unknown (RAW) mode by providing register ID and length.
Unknown (RAW) mode is risky as no checks are performed, please consult with Support before using it.
mlxreg Usage
mst driver must be started prior to running mlxreg tool.
Some access registers depend on setup configuration such as link up/down. Invalid setup may cause failures.
To run mlxreg, use the following line:
mlxreg [options]
where:
|
-h |--help |
Displays help message. |
|
-v |--version |
Displays version info. |
|
-d |--device <device> |
Performs operation for a specified mst device. |
|
-a |--adb_file <adb_file> |
An external ADB file |
|
--reg_name <reg_name> |
Known access register name |
|
--reg_id <reg_ID> |
Access register ID |
|
--reg_len <reg_length> |
Access register layout length (bytes) |
|
-i |--indexes <idxs_vals> |
Register indexes |
|
-g |--get |
Register access GET |
|
-s |--set <reg_dataStr> |
Register access SET |
|
--show_reg <reg_name> |
Prints the fields of a given reg access (must have reg_name) |
|
--show_regs |
Prints all available access registers |
|
--yes |
Non-interactive mode, answer yes to all questions |
|
--i2c_secondary <i2c_secondary> |
I2C secondary address |
|
-w |--overwrite |
Set only specified fields, set unspecified fields to zero (only valid for SET command) |
|
--full_path |
Show field names with full hierarchical path. (Recommended to use it always to avoid field ambiguity) |
|
--detailed |
Show detailed output including enum names and decimal values |
|
--advanced |
Show field descriptions (truncated by default, use with --show_reg) |
|
--full_desc |
Show full wrapped descriptions instead of truncated (use with --advanced) |
|
--field <field_name> |
Filter to show specific field only (use with --advanced) |
Examples:
Show all available access registers (the example below shows a sample of the whole list):
mlxreg -d /dev/mst/mt4115_pciconf0 --show_regs
Available Access Registers
========================================================================================
CWTP
CWTPM
MCIA
MLCR
MPCNT
MPEIN
NCFG
PAOS
PDDR
PMDR
PMLP
PPAOS
PPCNT
PPLM
PPLR
PPRT
PPTT
PTAS
PTYS
ROCE_ACCL
SBCM
SBDCR
SBPM
SBPR
SBSR
SLRG
SLRP
SLTP
......
Query a single access register (PAOS):
mlxreg -d /dev/mst/mt4115_pciconf0 --show_reg PAOS
Field Name | Address (Bytes) | Offset (Bits) | Size (Bits) | Access
=========================================================================
oper_status | 0x00000000 | 0 | 4 | RO
admin_status | 0x00000000 | 8 | 4 | RW
local_port | 0x00000000 | 16 | 8 | INDEX
swid | 0x00000000 | 24 | 8 | INDEX
e | 0x00000004 | 0 | 2 | RW
ee | 0x00000004 | 30 | 1 | WO
ase | 0x00000004 | 31 | 1 | WO
=========================================================================
Note: There might be indexes in access register fields that must be provided when setting or getting data.
Get access register data (PAOS with indexes: local port 1, swid 0):
mlxreg -d /dev/mst/mt4115_pciconf0 --reg_name PAOS --get --indexes "local_port=0x1,swid=0x0"
Field Name | Data
=============================
oper_status | 0x00000001
admin_status | 0x00000001
local_port | 0x00000001
swid | 0x00000000
e | 0x00000000
ee | 0x00000000
ase | 0x00000000
=============================
Set access register data (PAOS with indexes: local_port 1 swid 0x0 and data: e 1):
mlxreg -d /dev/mst/mt4115_pciconf0 --reg_name PAOS --indexes "local_port=0x1,swid=0x0" --yes --set "e=0x1"
You are about to send access register: PAOS with the following data:
Field Name | Data
=============================
oper_status | 0x00000002
admin_status | 0x00000001
local_port | 0x00000001
swid | 0x00000000
e | 0x00000001
ee | 0x00000000
ase | 0x00000000
=============================
Do you want to continue ? (y/n) [n] : y
Sending access register...
Get access register data (PAOS (0x5006) in unknown mode (RAW) with indexes: local_port=0x1 swid=0x0):
mlxreg -d /dev/mst/mt4115_pciconf0 --reg_id 0x5006 --reg_len 0x10 --indexes "0x0.16:8=0x1,0x0.24:8=0x0" --get
Address | Data
=======================
0x00000000 | 0x00010101
0x00000004 | 0x00000000
0x00000008 | 0x00000000
0x0000000c | 0x00000000
=======================
Set access register data (PAOS in unknown mode (RAW) with indexes: local_port=0x1 swid=0x0 and data e 1):
mlxreg -d /dev/mst/mt4115_pciconf0 --reg_id 0x5006 --reg_len 0x10 --indexes "0x0.16:8=0x1,0x0.24:8=0x0" --yes --set "0x4.0:2=0x1"
You are about to send access register id: 0x5006 with the following data:
Address | Data
=======================
0x00000000 | 0x00010102
0x00000004 | 0x00000001
0x00000008 | 0x00000000
0x0000000c | 0x00000000
=======================
Do you want to continue ? (y/n) [n] : y
Sending access register...
Get access register data (PAOS with indexes: local port 1, swid 0) with --detailed:
mlxreg -d /dev/mst/mt4115_pciconf0 --get --reg_name PAOS --indexes "local_port=0x1,swid=0x0" --detailed
Sending access register...
Field Name | Hex Value | Decimal | Enum/Type
=================================================================================
oper_status | 0x00000002 | 2 | down
plane_ind | 0x00000000 | 0 |
admin_status | 0x00000001 | 1 | up
lp_msb | 0x00000000 | 0 |
pnat | 0x00000000 | 0 |
local_port | 0x00000001 | 1 |
swid | 0x00000000 | 0 |
e | 0x00000000 | 0 | Do_not_generate_event
Query a single access register (PAOS) with --advanced:
mlxreg -d /dev/mst/mt4115_pciconf0 --show_reg PAOS --advanced
Field Name | Address | Offset | Size | Access | Description
===============================================================================================================================================
oper_status | 0x00000000 | 0 | 4 | RO | Port operational state: 1: up 2: down 4: down_by_port_failure - (transitione...
| | | | | Possible values (oper_status):
| | | | | 1 (0x1): up
| | | | | 2 (0x2): down
| | | | | 4 (0x4): down_by_port_failure
-----------------------------------------------------------------------------------------------------------------------------------------------
plane_ind | 0x00000000 | 4 | 4 | INDEX | Reserved for non-planarized port. Plane port index of the aggregated port. A...
-----------------------------------------------------------------------------------------------------------------------------------------------
admin_status | 0x00000000 | 8 | 4 | RW | Port administrative state (the desired state of the interface): 1: up 2: dow...
| | | | | Possible values (admin_status):
| | | | | 1 (0x1): up
| | | | | 2 (0x2): down_by_configuration
| | | | | 3 (0x3): up_once
| | | | | 4 (0x4): disabled_by_system
| | | | | 6 (0x6): sleep
-----------------------------------------------------------------------------------------------------------------------------------------------
lp_msb | 0x00000000 | 12 | 2 | INDEX | Local port number [9:8]
-----------------------------------------------------------------------------------------------------------------------------------------------
.
.
.
-----------------------------------------------------------------------------------------------------------------------------------------------
phy_force_linkup_mode | 0x00000008 | 31 | 1 | RO | Indicates physical link entered forced linkup debug mode
===============================================================================================================================================
Suggested 'get' command:
mlxreg -d /dev/mst/apps-95:23108,@dev@mst@mt4115_pciconf0.1 --reg_name PAOS --indexes "plane_ind=0,lp_msb=0,pnat=0,local_port=0,swid=0" --get
Query a single access register (PAOS) with --advanced --full_desc:
mlxreg -d /dev/mst/mt4115_pciconf0 --show_reg PAOS --advanced --full_desc
Field Name | Address | Offset | Size | Access | Description
===============================================================================================================================================
oper_status | 0x00000000 | 0 | 4 | RO | Port operational state: 1: up 2: down 4: down_by_port_failure - (transitioned by
| | | | | the hardware)
| | | | | Possible values (oper_status):
| | | | | 1 (0x1): up
| | | | | 2 (0x2): down
| | | | | 4 (0x4): down_by_port_failure
-----------------------------------------------------------------------------------------------------------------------------------------------
plane_ind | 0x00000000 | 4 | 4 | INDEX | Reserved for non-planarized port. Plane port index of the aggregated port. A
| | | | | value of 0 refers to the aggregated port only.
-----------------------------------------------------------------------------------------------------------------------------------------------
admin_status | 0x00000000 | 8 | 4 | RW | Port administrative state (the desired state of the interface): 1: up 2:
| | | | | down_by_configuration 3: up_once - if the port goes up and then down, the
| | | | | operational status should go to "down by port failure" and can only go back up
| | | | | upon explicit command 4: disabled_by_system - this mode cannot be set by the
| | | | | software, only by the hardware. 6: sleep - can be configured only if sleep_cap
| | | | | is set. Note that a sleep setting will cause the port to transition immediately
| | | | | into sleep state regardless of previous admin_status. [Internal] - up_once shall
| | | | | not be used for GPU case. In order to define link down state set PLDS register
| | | | | Possible values (admin_status):
| | | | | 1 (0x1): up
| | | | | 2 (0x2): down_by_configuration
| | | | | 3 (0x3): up_once
| | | | | 4 (0x4): disabled_by_system
| | | | | 6 (0x6): sleep
-----------------------------------------------------------------------------------------------------------------------------------------------
lp_msb | 0x00000000 | 12 | 2 | INDEX | Local port number [9:8]
-----------------------------------------------------------------------------------------------------------------------------------------------
.
.
.
-----------------------------------------------------------------------------------------------------------------------------------------------
phy_force_linkup_mode | 0x00000008 | 31 | 1 | RO | Indicates physical link entered forced linkup debug mode
===============================================================================================================================================
Suggested 'get' command:
mlxreg -d /dev/mst/apps-95:23108,@dev@mst@mt4115_pciconf0.1 --reg_name PAOS --indexes "plane_ind=0,lp_msb=0,pnat=0,local_port=0,swid=0" --get
Query a single access register (PAOS) with --advanced --field admin_status:
mlxreg -d /dev/mst/mt4115_pciconf0 --show_reg PAOS --advanced --field admin_status
Field Name | Address | Offset | Size | Access | Description
======================================================================================================================================
admin_status | 0x00000000 | 8 | 4 | RW | Port administrative state (the desired state of the interface): 1: up 2: dow...
| | | | | Possible values (admin_status):
| | | | | 1 (0x1): up
| | | | | 2 (0x2): down_by_configuration
| | | | | 3 (0x3): up_once
| | | | | 4 (0x4): disabled_by_system
| | | | | 6 (0x6): sleep
======================================================================================================================================
Last updated: