You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
208 lines
8.2 KiB
208 lines
8.2 KiB
From b3cb0e4c1088d2edecec9171f1377d47f00f7885 Mon Sep 17 00:00:00 2001
|
|
From: Igor Russkikh <irusskik@redhat.com>
|
|
Date: Fri, 6 Nov 2020 18:37:33 -0500
|
|
Subject: [PATCH 076/139] [netdrv] net: atlantic: move IS_CHIP_FEATURE to
|
|
aq_hw.h
|
|
|
|
Message-id: <1604687916-15087-77-git-send-email-irusskik@redhat.com>
|
|
Patchwork-id: 338508
|
|
Patchwork-instance: patchwork
|
|
O-Subject: [RHEL8.4 BZ 1857861 076/139] net: atlantic: move IS_CHIP_FEATURE to aq_hw.h
|
|
Bugzilla: 1857861
|
|
RH-Acked-by: David Arcari <darcari@redhat.com>
|
|
RH-Acked-by: John Linville <linville@redhat.com>
|
|
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
|
|
|
Bugzilla: http://bugzilla.redhat.com/1857861
|
|
|
|
commit d1ad88fe9fa9f5c3e4ecf509efb579852b44cc79
|
|
Author: Mark Starovoytov <mstarovoitov@marvell.com>
|
|
Date: Thu Apr 30 11:04:35 2020 +0300
|
|
|
|
net: atlantic: move IS_CHIP_FEATURE to aq_hw.h
|
|
|
|
IS_CHIP feature will be used to differentiate between A1 and A2,
|
|
where necessary. Thus, move it to aq_hw.h, rename it and make
|
|
it accept the 'hw' pointer.
|
|
|
|
Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
|
Signed-off-by: Igor Russkikh <irusskik@redhat.com>
|
|
|
|
Cc: David Arcari <darcari@redhat.com>
|
|
Cc: Igor Russkikh <irusskik@redhat.com>
|
|
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
---
|
|
drivers/net/ethernet/aquantia/atlantic/aq_hw.h | 13 ++++++++
|
|
.../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 2 +-
|
|
.../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 6 ++--
|
|
.../aquantia/atlantic/hw_atl/hw_atl_utils.c | 36 ++++++++++++----------
|
|
.../aquantia/atlantic/hw_atl/hw_atl_utils.h | 11 -------
|
|
5 files changed, 36 insertions(+), 32 deletions(-)
|
|
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
|
|
index e7a253667336..01208e2d2ae4 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
|
|
@@ -136,6 +136,19 @@ enum aq_priv_flags {
|
|
BIT(AQ_HW_LOOPBACK_PHYINT_SYS) |\
|
|
BIT(AQ_HW_LOOPBACK_PHYEXT_SYS))
|
|
|
|
+#define ATL_HW_CHIP_MIPS 0x00000001U
|
|
+#define ATL_HW_CHIP_TPO2 0x00000002U
|
|
+#define ATL_HW_CHIP_RPF2 0x00000004U
|
|
+#define ATL_HW_CHIP_MPI_AQ 0x00000010U
|
|
+#define ATL_HW_CHIP_ATLANTIC 0x00800000U
|
|
+#define ATL_HW_CHIP_REVISION_A0 0x01000000U
|
|
+#define ATL_HW_CHIP_REVISION_B0 0x02000000U
|
|
+#define ATL_HW_CHIP_REVISION_B1 0x04000000U
|
|
+#define ATL_HW_CHIP_ANTIGUA 0x08000000U
|
|
+
|
|
+#define ATL_HW_IS_CHIP_FEATURE(_HW_, _F_) (!!(ATL_HW_CHIP_##_F_ & \
|
|
+ (_HW_)->chip_features))
|
|
+
|
|
struct aq_hw_s {
|
|
atomic_t flags;
|
|
u8 rbl_enabled:1;
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
|
|
index 2dba8c277ecb..eee265b4415a 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
|
|
@@ -267,7 +267,7 @@ static int hw_atl_a0_hw_init_tx_path(struct aq_hw_s *self)
|
|
hw_atl_tdm_tx_desc_wr_wb_irq_en_set(self, 1U);
|
|
|
|
/* misc */
|
|
- aq_hw_write_reg(self, 0x00007040U, IS_CHIP_FEATURE(TPO2) ?
|
|
+ aq_hw_write_reg(self, 0x00007040U, ATL_HW_IS_CHIP_FEATURE(self, TPO2) ?
|
|
0x00010000U : 0x00000000U);
|
|
hw_atl_tdm_tx_dca_en_set(self, 0U);
|
|
hw_atl_tdm_tx_dca_mode_set(self, 0U);
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
|
|
index 4e2e4eef028d..3b42045b9c7d 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
|
|
@@ -324,7 +324,7 @@ static int hw_atl_b0_hw_init_tx_path(struct aq_hw_s *self)
|
|
hw_atl_tdm_tx_desc_wr_wb_irq_en_set(self, 1U);
|
|
|
|
/* misc */
|
|
- aq_hw_write_reg(self, 0x00007040U, IS_CHIP_FEATURE(TPO2) ?
|
|
+ aq_hw_write_reg(self, 0x00007040U, ATL_HW_IS_CHIP_FEATURE(self, TPO2) ?
|
|
0x00010000U : 0x00000000U);
|
|
hw_atl_tdm_tx_dca_en_set(self, 0U);
|
|
hw_atl_tdm_tx_dca_mode_set(self, 0U);
|
|
@@ -372,8 +372,8 @@ static int hw_atl_b0_hw_init_rx_path(struct aq_hw_s *self)
|
|
hw_atl_rdm_rx_desc_wr_wb_irq_en_set(self, 1U);
|
|
|
|
/* misc */
|
|
- aq_hw_write_reg(self, 0x00005040U,
|
|
- IS_CHIP_FEATURE(RPF2) ? 0x000F0000U : 0x00000000U);
|
|
+ aq_hw_write_reg(self, 0x00005040U, ATL_HW_IS_CHIP_FEATURE(self, RPF2) ?
|
|
+ 0x000F0000U : 0x00000000U);
|
|
|
|
hw_atl_rpfl2broadcast_flr_act_set(self, 1U);
|
|
hw_atl_rpfl2broadcast_count_threshold_set(self, 0xFFFFU & (~0U / 256U));
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
|
|
index bd1712ca9ef2..20655a2170cc 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
|
|
@@ -309,7 +309,7 @@ int hw_atl_utils_fw_downld_dwords(struct aq_hw_s *self, u32 a,
|
|
for (++cnt; --cnt && !err;) {
|
|
aq_hw_write_reg(self, HW_ATL_MIF_CMD, 0x00008000U);
|
|
|
|
- if (IS_CHIP_FEATURE(REVISION_B1))
|
|
+ if (ATL_HW_IS_CHIP_FEATURE(self, REVISION_B1))
|
|
err = readx_poll_timeout_atomic(hw_atl_utils_mif_addr_get,
|
|
self, val, val != a,
|
|
1U, 1000U);
|
|
@@ -405,7 +405,7 @@ static int hw_atl_utils_fw_upload_dwords(struct aq_hw_s *self, u32 addr, u32 *p,
|
|
if (err < 0)
|
|
goto err_exit;
|
|
|
|
- if (IS_CHIP_FEATURE(REVISION_B1))
|
|
+ if (ATL_HW_IS_CHIP_FEATURE(self, REVISION_B1))
|
|
err = hw_atl_utils_write_b1_mbox(self, addr, p, cnt, area);
|
|
else
|
|
err = hw_atl_utils_write_b0_mbox(self, addr, p, cnt);
|
|
@@ -497,7 +497,7 @@ int hw_atl_utils_fw_rpc_call(struct aq_hw_s *self, unsigned int rpc_size)
|
|
struct aq_hw_atl_utils_fw_rpc_tid_s sw;
|
|
int err = 0;
|
|
|
|
- if (!IS_CHIP_FEATURE(MIPS)) {
|
|
+ if (!ATL_HW_IS_CHIP_FEATURE(self, MIPS)) {
|
|
err = -1;
|
|
goto err_exit;
|
|
}
|
|
@@ -603,7 +603,7 @@ void hw_atl_utils_mpi_read_stats(struct aq_hw_s *self,
|
|
if (err < 0)
|
|
goto err_exit;
|
|
|
|
- if (IS_CHIP_FEATURE(REVISION_A0)) {
|
|
+ if (ATL_HW_IS_CHIP_FEATURE(self, REVISION_A0)) {
|
|
unsigned int mtu = self->aq_nic_cfg ?
|
|
self->aq_nic_cfg->mtu : 1514U;
|
|
pmbox->stats.ubrc = pmbox->stats.uprc * mtu;
|
|
@@ -802,22 +802,24 @@ void hw_atl_utils_hw_chip_features_init(struct aq_hw_s *self, u32 *p)
|
|
u32 mif_rev = val & 0xFFU;
|
|
u32 chip_features = 0U;
|
|
|
|
+ chip_features |= ATL_HW_CHIP_ATLANTIC;
|
|
+
|
|
if ((0xFU & mif_rev) == 1U) {
|
|
- chip_features |= HAL_ATLANTIC_UTILS_CHIP_REVISION_A0 |
|
|
- HAL_ATLANTIC_UTILS_CHIP_MPI_AQ |
|
|
- HAL_ATLANTIC_UTILS_CHIP_MIPS;
|
|
+ chip_features |= ATL_HW_CHIP_REVISION_A0 |
|
|
+ ATL_HW_CHIP_MPI_AQ |
|
|
+ ATL_HW_CHIP_MIPS;
|
|
} else if ((0xFU & mif_rev) == 2U) {
|
|
- chip_features |= HAL_ATLANTIC_UTILS_CHIP_REVISION_B0 |
|
|
- HAL_ATLANTIC_UTILS_CHIP_MPI_AQ |
|
|
- HAL_ATLANTIC_UTILS_CHIP_MIPS |
|
|
- HAL_ATLANTIC_UTILS_CHIP_TPO2 |
|
|
- HAL_ATLANTIC_UTILS_CHIP_RPF2;
|
|
+ chip_features |= ATL_HW_CHIP_REVISION_B0 |
|
|
+ ATL_HW_CHIP_MPI_AQ |
|
|
+ ATL_HW_CHIP_MIPS |
|
|
+ ATL_HW_CHIP_TPO2 |
|
|
+ ATL_HW_CHIP_RPF2;
|
|
} else if ((0xFU & mif_rev) == 0xAU) {
|
|
- chip_features |= HAL_ATLANTIC_UTILS_CHIP_REVISION_B1 |
|
|
- HAL_ATLANTIC_UTILS_CHIP_MPI_AQ |
|
|
- HAL_ATLANTIC_UTILS_CHIP_MIPS |
|
|
- HAL_ATLANTIC_UTILS_CHIP_TPO2 |
|
|
- HAL_ATLANTIC_UTILS_CHIP_RPF2;
|
|
+ chip_features |= ATL_HW_CHIP_REVISION_B1 |
|
|
+ ATL_HW_CHIP_MPI_AQ |
|
|
+ ATL_HW_CHIP_MIPS |
|
|
+ ATL_HW_CHIP_TPO2 |
|
|
+ ATL_HW_CHIP_RPF2;
|
|
}
|
|
|
|
*p = chip_features;
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
|
|
index ed3f0307652d..36084152c4c3 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
|
|
@@ -380,17 +380,6 @@ enum hw_atl_rx_ctrl_registers_l3l4 {
|
|
#define HW_ATL_GET_REG_LOCATION_FL3L4(location) \
|
|
((location) - AQ_RX_FIRST_LOC_FL3L4)
|
|
|
|
-#define HAL_ATLANTIC_UTILS_CHIP_MIPS 0x00000001U
|
|
-#define HAL_ATLANTIC_UTILS_CHIP_TPO2 0x00000002U
|
|
-#define HAL_ATLANTIC_UTILS_CHIP_RPF2 0x00000004U
|
|
-#define HAL_ATLANTIC_UTILS_CHIP_MPI_AQ 0x00000010U
|
|
-#define HAL_ATLANTIC_UTILS_CHIP_REVISION_A0 0x01000000U
|
|
-#define HAL_ATLANTIC_UTILS_CHIP_REVISION_B0 0x02000000U
|
|
-#define HAL_ATLANTIC_UTILS_CHIP_REVISION_B1 0x04000000U
|
|
-
|
|
-#define IS_CHIP_FEATURE(_F_) (HAL_ATLANTIC_UTILS_CHIP_##_F_ & \
|
|
- self->chip_features)
|
|
-
|
|
enum hal_atl_utils_fw_state_e {
|
|
MPI_DEINIT = 0,
|
|
MPI_RESET = 1,
|
|
--
|
|
2.13.6
|
|
|