From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, jiri@mellanox.com,
petrm@mellanox.com, amitc@mellanox.com, mlxsw@mellanox.com,
mkubecek@suse.cz, jacob.e.keller@intel.com, andrew@lunn.ch,
f.fainelli@gmail.com, linux@rempel-privat.de,
Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next v2 06/10] mlxsw: reg: Port Diagnostics Database Register
Date: Mon, 29 Jun 2020 23:46:17 +0300 [thread overview]
Message-ID: <20200629204621.377239-7-idosch@idosch.org> (raw)
In-Reply-To: <20200629204621.377239-1-idosch@idosch.org>
From: Amit Cohen <amitc@mellanox.com>
The PDDR register enables to read the Phy debug database.
Signed-off-by: Amit Cohen <amitc@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/reg.h | 51 +++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index fcb88d4271bf..b76c839223b5 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -5438,6 +5438,56 @@ static inline void mlxsw_reg_pplr_pack(char *payload, u8 local_port,
MLXSW_REG_PPLR_LB_TYPE_BIT_PHY_LOCAL : 0);
}
+/* PDDR - Port Diagnostics Database Register
+ * -----------------------------------------
+ * The PDDR enables to read the Phy debug database
+ */
+#define MLXSW_REG_PDDR_ID 0x5031
+#define MLXSW_REG_PDDR_LEN 0x100
+
+MLXSW_REG_DEFINE(pddr, MLXSW_REG_PDDR_ID, MLXSW_REG_PDDR_LEN);
+
+/* reg_pddr_local_port
+ * Local port number.
+ * Access: Index
+ */
+MLXSW_ITEM32(reg, pddr, local_port, 0x00, 16, 8);
+
+enum mlxsw_reg_pddr_page_select {
+ MLXSW_REG_PDDR_PAGE_SELECT_TROUBLESHOOTING_INFO = 1,
+};
+
+/* reg_pddr_page_select
+ * Page select index.
+ * Access: Index
+ */
+MLXSW_ITEM32(reg, pddr, page_select, 0x04, 0, 8);
+
+enum mlxsw_reg_pddr_trblsh_group_opcode {
+ /* Monitor opcodes */
+ MLXSW_REG_PDDR_TRBLSH_GROUP_OPCODE_MONITOR,
+};
+
+/* reg_pddr_group_opcode
+ * Group selector.
+ * Access: Index
+ */
+MLXSW_ITEM32(reg, pddr, trblsh_group_opcode, 0x08, 0, 16);
+
+/* reg_pddr_status_opcode
+ * Group selector.
+ * Access: RO
+ */
+MLXSW_ITEM32(reg, pddr, trblsh_status_opcode, 0x0C, 0, 16);
+
+static inline void mlxsw_reg_pddr_pack(char *payload, u8 local_port,
+ u8 page_select)
+{
+ MLXSW_REG_ZERO(pddr, payload);
+ mlxsw_reg_pddr_local_port_set(payload, local_port);
+ mlxsw_reg_pddr_page_select_set(payload, page_select);
+}
+
/* PMTM - Port Module Type Mapping Register
* ----------------------------------------
* The PMTM allows query or configuration of module types.
@@ -10758,6 +10808,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
MLXSW_REG(pbmc),
MLXSW_REG(pspa),
MLXSW_REG(pplr),
+ MLXSW_REG(pddr),
MLXSW_REG(pmtm),
MLXSW_REG(htgt),
MLXSW_REG(hpkt),
--
2.26.2
next prev parent reply other threads:[~2020-06-29 20:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-29 20:46 [PATCH net-next v2 00/10] Add ethtool extended link state Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 01/10] mlxsw: spectrum_dcb: Rename mlxsw_sp_port_headroom_set() Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 02/10] mlxsw: Move ethtool_ops to spectrum_ethtool.c Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 03/10] mlxsw: spectrum_ethtool: Move mlxsw_sp_port_type_speed_ops structs Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 04/10] Documentation: networking: ethtool-netlink: Add link extended state Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 05/10] ethtool: " Ido Schimmel
2020-06-29 20:46 ` Ido Schimmel [this message]
2020-06-29 20:46 ` [PATCH net-next v2 07/10] mlxsw: spectrum_ethtool: " Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 08/10] selftests: forwarding: ethtool: Move different_speeds_get() to ethtool_lib Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 09/10] selftests: forwarding: forwarding.config.sample: Add port with no cable connected Ido Schimmel
2020-06-29 20:46 ` [PATCH net-next v2 10/10] selftests: forwarding: Add tests for ethtool extended state Ido Schimmel
2020-06-30 0:45 ` [PATCH net-next v2 00/10] Add ethtool extended link state David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200629204621.377239-7-idosch@idosch.org \
--to=idosch@idosch.org \
--cc=amitc@mellanox.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=idosch@mellanox.com \
--cc=jacob.e.keller@intel.com \
--cc=jiri@mellanox.com \
--cc=kuba@kernel.org \
--cc=linux@rempel-privat.de \
--cc=mkubecek@suse.cz \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).