|
@@ -145,7 +145,7 @@
|
|
|
#define GENERIC_SW_STAT(ext_name) \
|
|
#define GENERIC_SW_STAT(ext_name) \
|
|
|
[GENERIC_STAT_ ## ext_name] = { #ext_name, 0, 0 }
|
|
[GENERIC_STAT_ ## ext_name] = { #ext_name, 0, 0 }
|
|
|
|
|
|
|
|
-static const struct efx_hw_stat_desc falcon_stat_desc[FALCON_STAT_COUNT] = {
|
|
|
|
|
|
|
+static const struct ef4_hw_stat_desc falcon_stat_desc[FALCON_STAT_COUNT] = {
|
|
|
FALCON_DMA_STAT(tx_bytes, XgTxOctets),
|
|
FALCON_DMA_STAT(tx_bytes, XgTxOctets),
|
|
|
FALCON_DMA_STAT(tx_packets, XgTxPkts),
|
|
FALCON_DMA_STAT(tx_packets, XgTxPkts),
|
|
|
FALCON_DMA_STAT(tx_pause, XgTxPausePkts),
|
|
FALCON_DMA_STAT(tx_pause, XgTxPausePkts),
|
|
@@ -273,34 +273,34 @@ struct falcon_nvconfig_board_v3 {
|
|
|
#define SPI_DEV_TYPE_BLOCK_SIZE_LBN 24
|
|
#define SPI_DEV_TYPE_BLOCK_SIZE_LBN 24
|
|
|
#define SPI_DEV_TYPE_BLOCK_SIZE_WIDTH 5
|
|
#define SPI_DEV_TYPE_BLOCK_SIZE_WIDTH 5
|
|
|
#define SPI_DEV_TYPE_FIELD(type, field) \
|
|
#define SPI_DEV_TYPE_FIELD(type, field) \
|
|
|
- (((type) >> EFX_LOW_BIT(field)) & EFX_MASK32(EFX_WIDTH(field)))
|
|
|
|
|
|
|
+ (((type) >> EF4_LOW_BIT(field)) & EF4_MASK32(EF4_WIDTH(field)))
|
|
|
|
|
|
|
|
#define FALCON_NVCONFIG_OFFSET 0x300
|
|
#define FALCON_NVCONFIG_OFFSET 0x300
|
|
|
|
|
|
|
|
#define FALCON_NVCONFIG_BOARD_MAGIC_NUM 0xFA1C
|
|
#define FALCON_NVCONFIG_BOARD_MAGIC_NUM 0xFA1C
|
|
|
struct falcon_nvconfig {
|
|
struct falcon_nvconfig {
|
|
|
- efx_oword_t ee_vpd_cfg_reg; /* 0x300 */
|
|
|
|
|
|
|
+ ef4_oword_t ee_vpd_cfg_reg; /* 0x300 */
|
|
|
u8 mac_address[2][8]; /* 0x310 */
|
|
u8 mac_address[2][8]; /* 0x310 */
|
|
|
- efx_oword_t pcie_sd_ctl0123_reg; /* 0x320 */
|
|
|
|
|
- efx_oword_t pcie_sd_ctl45_reg; /* 0x330 */
|
|
|
|
|
- efx_oword_t pcie_pcs_ctl_stat_reg; /* 0x340 */
|
|
|
|
|
- efx_oword_t hw_init_reg; /* 0x350 */
|
|
|
|
|
- efx_oword_t nic_stat_reg; /* 0x360 */
|
|
|
|
|
- efx_oword_t glb_ctl_reg; /* 0x370 */
|
|
|
|
|
- efx_oword_t srm_cfg_reg; /* 0x380 */
|
|
|
|
|
- efx_oword_t spare_reg; /* 0x390 */
|
|
|
|
|
|
|
+ ef4_oword_t pcie_sd_ctl0123_reg; /* 0x320 */
|
|
|
|
|
+ ef4_oword_t pcie_sd_ctl45_reg; /* 0x330 */
|
|
|
|
|
+ ef4_oword_t pcie_pcs_ctl_stat_reg; /* 0x340 */
|
|
|
|
|
+ ef4_oword_t hw_init_reg; /* 0x350 */
|
|
|
|
|
+ ef4_oword_t nic_stat_reg; /* 0x360 */
|
|
|
|
|
+ ef4_oword_t glb_ctl_reg; /* 0x370 */
|
|
|
|
|
+ ef4_oword_t srm_cfg_reg; /* 0x380 */
|
|
|
|
|
+ ef4_oword_t spare_reg; /* 0x390 */
|
|
|
__le16 board_magic_num; /* 0x3A0 */
|
|
__le16 board_magic_num; /* 0x3A0 */
|
|
|
__le16 board_struct_ver;
|
|
__le16 board_struct_ver;
|
|
|
__le16 board_checksum;
|
|
__le16 board_checksum;
|
|
|
struct falcon_nvconfig_board_v2 board_v2;
|
|
struct falcon_nvconfig_board_v2 board_v2;
|
|
|
- efx_oword_t ee_base_page_reg; /* 0x3B0 */
|
|
|
|
|
|
|
+ ef4_oword_t ee_base_page_reg; /* 0x3B0 */
|
|
|
struct falcon_nvconfig_board_v3 board_v3; /* 0x3C0 */
|
|
struct falcon_nvconfig_board_v3 board_v3; /* 0x3C0 */
|
|
|
} __packed;
|
|
} __packed;
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
-static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method);
|
|
|
|
|
-static void falcon_reconfigure_mac_wrapper(struct efx_nic *efx);
|
|
|
|
|
|
|
+static int falcon_reset_hw(struct ef4_nic *efx, enum reset_type method);
|
|
|
|
|
+static void falcon_reconfigure_mac_wrapper(struct ef4_nic *efx);
|
|
|
|
|
|
|
|
static const unsigned int
|
|
static const unsigned int
|
|
|
/* "Large" EEPROM device: Atmel AT25640 or similar
|
|
/* "Large" EEPROM device: Atmel AT25640 or similar
|
|
@@ -326,40 +326,40 @@ default_flash_type = ((17 << SPI_DEV_TYPE_SIZE_LBN)
|
|
|
*/
|
|
*/
|
|
|
static void falcon_setsda(void *data, int state)
|
|
static void falcon_setsda(void *data, int state)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = (struct efx_nic *)data;
|
|
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = (struct ef4_nic *)data;
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO3_OEN, !state);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_GPIO3_OEN, !state);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_GPIO_CTL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void falcon_setscl(void *data, int state)
|
|
static void falcon_setscl(void *data, int state)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = (struct efx_nic *)data;
|
|
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = (struct ef4_nic *)data;
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO0_OEN, !state);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_GPIO0_OEN, !state);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_GPIO_CTL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int falcon_getsda(void *data)
|
|
static int falcon_getsda(void *data)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = (struct efx_nic *)data;
|
|
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = (struct ef4_nic *)data;
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
- return EFX_OWORD_FIELD(reg, FRF_AB_GPIO3_IN);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
+ return EF4_OWORD_FIELD(reg, FRF_AB_GPIO3_IN);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int falcon_getscl(void *data)
|
|
static int falcon_getscl(void *data)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = (struct efx_nic *)data;
|
|
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = (struct ef4_nic *)data;
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
- return EFX_OWORD_FIELD(reg, FRF_AB_GPIO0_IN);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_GPIO_CTL);
|
|
|
|
|
+ return EF4_OWORD_FIELD(reg, FRF_AB_GPIO0_IN);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static const struct i2c_algo_bit_data falcon_i2c_bit_operations = {
|
|
static const struct i2c_algo_bit_data falcon_i2c_bit_operations = {
|
|
@@ -372,35 +372,35 @@ static const struct i2c_algo_bit_data falcon_i2c_bit_operations = {
|
|
|
.timeout = DIV_ROUND_UP(HZ, 20),
|
|
.timeout = DIV_ROUND_UP(HZ, 20),
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-static void falcon_push_irq_moderation(struct efx_channel *channel)
|
|
|
|
|
|
|
+static void falcon_push_irq_moderation(struct ef4_channel *channel)
|
|
|
{
|
|
{
|
|
|
- efx_dword_t timer_cmd;
|
|
|
|
|
- struct efx_nic *efx = channel->efx;
|
|
|
|
|
|
|
+ ef4_dword_t timer_cmd;
|
|
|
|
|
+ struct ef4_nic *efx = channel->efx;
|
|
|
|
|
|
|
|
/* Set timer register */
|
|
/* Set timer register */
|
|
|
if (channel->irq_moderation_us) {
|
|
if (channel->irq_moderation_us) {
|
|
|
unsigned int ticks;
|
|
unsigned int ticks;
|
|
|
|
|
|
|
|
- ticks = efx_usecs_to_ticks(efx, channel->irq_moderation_us);
|
|
|
|
|
- EFX_POPULATE_DWORD_2(timer_cmd,
|
|
|
|
|
|
|
+ ticks = ef4_usecs_to_ticks(efx, channel->irq_moderation_us);
|
|
|
|
|
+ EF4_POPULATE_DWORD_2(timer_cmd,
|
|
|
FRF_AB_TC_TIMER_MODE,
|
|
FRF_AB_TC_TIMER_MODE,
|
|
|
FFE_BB_TIMER_MODE_INT_HLDOFF,
|
|
FFE_BB_TIMER_MODE_INT_HLDOFF,
|
|
|
FRF_AB_TC_TIMER_VAL,
|
|
FRF_AB_TC_TIMER_VAL,
|
|
|
ticks - 1);
|
|
ticks - 1);
|
|
|
} else {
|
|
} else {
|
|
|
- EFX_POPULATE_DWORD_2(timer_cmd,
|
|
|
|
|
|
|
+ EF4_POPULATE_DWORD_2(timer_cmd,
|
|
|
FRF_AB_TC_TIMER_MODE,
|
|
FRF_AB_TC_TIMER_MODE,
|
|
|
FFE_BB_TIMER_MODE_DIS,
|
|
FFE_BB_TIMER_MODE_DIS,
|
|
|
FRF_AB_TC_TIMER_VAL, 0);
|
|
FRF_AB_TC_TIMER_VAL, 0);
|
|
|
}
|
|
}
|
|
|
BUILD_BUG_ON(FR_AA_TIMER_COMMAND_KER != FR_BZ_TIMER_COMMAND_P0);
|
|
BUILD_BUG_ON(FR_AA_TIMER_COMMAND_KER != FR_BZ_TIMER_COMMAND_P0);
|
|
|
- efx_writed_page_locked(efx, &timer_cmd, FR_BZ_TIMER_COMMAND_P0,
|
|
|
|
|
|
|
+ ef4_writed_page_locked(efx, &timer_cmd, FR_BZ_TIMER_COMMAND_P0,
|
|
|
channel->channel);
|
|
channel->channel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_deconfigure_mac_wrapper(struct efx_nic *efx);
|
|
|
|
|
|
|
+static void falcon_deconfigure_mac_wrapper(struct ef4_nic *efx);
|
|
|
|
|
|
|
|
-static void falcon_prepare_flush(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_prepare_flush(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
falcon_deconfigure_mac_wrapper(efx);
|
|
falcon_deconfigure_mac_wrapper(efx);
|
|
|
|
|
|
|
@@ -420,26 +420,26 @@ static void falcon_prepare_flush(struct efx_nic *efx)
|
|
|
*
|
|
*
|
|
|
* NB most hardware supports MSI interrupts
|
|
* NB most hardware supports MSI interrupts
|
|
|
*/
|
|
*/
|
|
|
-static inline void falcon_irq_ack_a1(struct efx_nic *efx)
|
|
|
|
|
|
|
+static inline void falcon_irq_ack_a1(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_dword_t reg;
|
|
|
|
|
|
|
+ ef4_dword_t reg;
|
|
|
|
|
|
|
|
- EFX_POPULATE_DWORD_1(reg, FRF_AA_INT_ACK_KER_FIELD, 0xb7eb7e);
|
|
|
|
|
- efx_writed(efx, ®, FR_AA_INT_ACK_KER);
|
|
|
|
|
- efx_readd(efx, ®, FR_AA_WORK_AROUND_BROKEN_PCI_READS);
|
|
|
|
|
|
|
+ EF4_POPULATE_DWORD_1(reg, FRF_AA_INT_ACK_KER_FIELD, 0xb7eb7e);
|
|
|
|
|
+ ef4_writed(efx, ®, FR_AA_INT_ACK_KER);
|
|
|
|
|
+ ef4_readd(efx, ®, FR_AA_WORK_AROUND_BROKEN_PCI_READS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id)
|
|
static irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = dev_id;
|
|
|
|
|
- efx_oword_t *int_ker = efx->irq_status.addr;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = dev_id;
|
|
|
|
|
+ ef4_oword_t *int_ker = efx->irq_status.addr;
|
|
|
int syserr;
|
|
int syserr;
|
|
|
int queues;
|
|
int queues;
|
|
|
|
|
|
|
|
/* Check to see if this is our interrupt. If it isn't, we
|
|
/* Check to see if this is our interrupt. If it isn't, we
|
|
|
* exit without having touched the hardware.
|
|
* exit without having touched the hardware.
|
|
|
*/
|
|
*/
|
|
|
- if (unlikely(EFX_OWORD_IS_ZERO(*int_ker))) {
|
|
|
|
|
|
|
+ if (unlikely(EF4_OWORD_IS_ZERO(*int_ker))) {
|
|
|
netif_vdbg(efx, intr, efx->net_dev,
|
|
netif_vdbg(efx, intr, efx->net_dev,
|
|
|
"IRQ %d on CPU %d not for me\n", irq,
|
|
"IRQ %d on CPU %d not for me\n", irq,
|
|
|
raw_smp_processor_id());
|
|
raw_smp_processor_id());
|
|
@@ -447,30 +447,30 @@ static irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id)
|
|
|
}
|
|
}
|
|
|
efx->last_irq_cpu = raw_smp_processor_id();
|
|
efx->last_irq_cpu = raw_smp_processor_id();
|
|
|
netif_vdbg(efx, intr, efx->net_dev,
|
|
netif_vdbg(efx, intr, efx->net_dev,
|
|
|
- "IRQ %d on CPU %d status " EFX_OWORD_FMT "\n",
|
|
|
|
|
- irq, raw_smp_processor_id(), EFX_OWORD_VAL(*int_ker));
|
|
|
|
|
|
|
+ "IRQ %d on CPU %d status " EF4_OWORD_FMT "\n",
|
|
|
|
|
+ irq, raw_smp_processor_id(), EF4_OWORD_VAL(*int_ker));
|
|
|
|
|
|
|
|
if (!likely(ACCESS_ONCE(efx->irq_soft_enabled)))
|
|
if (!likely(ACCESS_ONCE(efx->irq_soft_enabled)))
|
|
|
return IRQ_HANDLED;
|
|
return IRQ_HANDLED;
|
|
|
|
|
|
|
|
/* Check to see if we have a serious error condition */
|
|
/* Check to see if we have a serious error condition */
|
|
|
- syserr = EFX_OWORD_FIELD(*int_ker, FSF_AZ_NET_IVEC_FATAL_INT);
|
|
|
|
|
|
|
+ syserr = EF4_OWORD_FIELD(*int_ker, FSF_AZ_NET_IVEC_FATAL_INT);
|
|
|
if (unlikely(syserr))
|
|
if (unlikely(syserr))
|
|
|
- return efx_farch_fatal_interrupt(efx);
|
|
|
|
|
|
|
+ return ef4_farch_fatal_interrupt(efx);
|
|
|
|
|
|
|
|
/* Determine interrupting queues, clear interrupt status
|
|
/* Determine interrupting queues, clear interrupt status
|
|
|
* register and acknowledge the device interrupt.
|
|
* register and acknowledge the device interrupt.
|
|
|
*/
|
|
*/
|
|
|
- BUILD_BUG_ON(FSF_AZ_NET_IVEC_INT_Q_WIDTH > EFX_MAX_CHANNELS);
|
|
|
|
|
- queues = EFX_OWORD_FIELD(*int_ker, FSF_AZ_NET_IVEC_INT_Q);
|
|
|
|
|
- EFX_ZERO_OWORD(*int_ker);
|
|
|
|
|
|
|
+ BUILD_BUG_ON(FSF_AZ_NET_IVEC_INT_Q_WIDTH > EF4_MAX_CHANNELS);
|
|
|
|
|
+ queues = EF4_OWORD_FIELD(*int_ker, FSF_AZ_NET_IVEC_INT_Q);
|
|
|
|
|
+ EF4_ZERO_OWORD(*int_ker);
|
|
|
wmb(); /* Ensure the vector is cleared before interrupt ack */
|
|
wmb(); /* Ensure the vector is cleared before interrupt ack */
|
|
|
falcon_irq_ack_a1(efx);
|
|
falcon_irq_ack_a1(efx);
|
|
|
|
|
|
|
|
if (queues & 1)
|
|
if (queues & 1)
|
|
|
- efx_schedule_channel_irq(efx_get_channel(efx, 0));
|
|
|
|
|
|
|
+ ef4_schedule_channel_irq(ef4_get_channel(efx, 0));
|
|
|
if (queues & 2)
|
|
if (queues & 2)
|
|
|
- efx_schedule_channel_irq(efx_get_channel(efx, 1));
|
|
|
|
|
|
|
+ ef4_schedule_channel_irq(ef4_get_channel(efx, 1));
|
|
|
return IRQ_HANDLED;
|
|
return IRQ_HANDLED;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -480,7 +480,7 @@ static irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id)
|
|
|
*
|
|
*
|
|
|
**************************************************************************
|
|
**************************************************************************
|
|
|
*/
|
|
*/
|
|
|
-static int dummy_rx_push_rss_config(struct efx_nic *efx, bool user,
|
|
|
|
|
|
|
+static int dummy_rx_push_rss_config(struct ef4_nic *efx, bool user,
|
|
|
const u32 *rx_indir_table)
|
|
const u32 *rx_indir_table)
|
|
|
{
|
|
{
|
|
|
(void) efx;
|
|
(void) efx;
|
|
@@ -489,19 +489,19 @@ static int dummy_rx_push_rss_config(struct efx_nic *efx, bool user,
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_b0_rx_push_rss_config(struct efx_nic *efx, bool user,
|
|
|
|
|
|
|
+static int falcon_b0_rx_push_rss_config(struct ef4_nic *efx, bool user,
|
|
|
const u32 *rx_indir_table)
|
|
const u32 *rx_indir_table)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t temp;
|
|
|
|
|
|
|
+ ef4_oword_t temp;
|
|
|
|
|
|
|
|
(void) user;
|
|
(void) user;
|
|
|
/* Set hash key for IPv4 */
|
|
/* Set hash key for IPv4 */
|
|
|
memcpy(&temp, efx->rx_hash_key, sizeof(temp));
|
|
memcpy(&temp, efx->rx_hash_key, sizeof(temp));
|
|
|
- efx_writeo(efx, &temp, FR_BZ_RX_RSS_TKEY);
|
|
|
|
|
|
|
+ ef4_writeo(efx, &temp, FR_BZ_RX_RSS_TKEY);
|
|
|
|
|
|
|
|
memcpy(efx->rx_indir_table, rx_indir_table,
|
|
memcpy(efx->rx_indir_table, rx_indir_table,
|
|
|
sizeof(efx->rx_indir_table));
|
|
sizeof(efx->rx_indir_table));
|
|
|
- efx_farch_rx_push_indir_table(efx);
|
|
|
|
|
|
|
+ ef4_farch_rx_push_indir_table(efx);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -512,17 +512,17 @@ static int falcon_b0_rx_push_rss_config(struct efx_nic *efx, bool user,
|
|
|
**************************************************************************
|
|
**************************************************************************
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-#define FALCON_SPI_MAX_LEN sizeof(efx_oword_t)
|
|
|
|
|
|
|
+#define FALCON_SPI_MAX_LEN sizeof(ef4_oword_t)
|
|
|
|
|
|
|
|
-static int falcon_spi_poll(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_spi_poll(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t reg;
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_EE_SPI_HCMD);
|
|
|
|
|
- return EFX_OWORD_FIELD(reg, FRF_AB_EE_SPI_HCMD_CMD_EN) ? -EBUSY : 0;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_EE_SPI_HCMD);
|
|
|
|
|
+ return EF4_OWORD_FIELD(reg, FRF_AB_EE_SPI_HCMD_CMD_EN) ? -EBUSY : 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Wait for SPI command completion */
|
|
/* Wait for SPI command completion */
|
|
|
-static int falcon_spi_wait(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_spi_wait(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
/* Most commands will finish quickly, so we start polling at
|
|
/* Most commands will finish quickly, so we start polling at
|
|
|
* very short intervals. Sometimes the command may have to
|
|
* very short intervals. Sometimes the command may have to
|
|
@@ -550,13 +550,13 @@ static int falcon_spi_wait(struct efx_nic *efx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-falcon_spi_cmd(struct efx_nic *efx, const struct falcon_spi_device *spi,
|
|
|
|
|
|
|
+falcon_spi_cmd(struct ef4_nic *efx, const struct falcon_spi_device *spi,
|
|
|
unsigned int command, int address,
|
|
unsigned int command, int address,
|
|
|
const void *in, void *out, size_t len)
|
|
const void *in, void *out, size_t len)
|
|
|
{
|
|
{
|
|
|
bool addressed = (address >= 0);
|
|
bool addressed = (address >= 0);
|
|
|
bool reading = (out != NULL);
|
|
bool reading = (out != NULL);
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
|
/* Input validation */
|
|
/* Input validation */
|
|
@@ -570,18 +570,18 @@ falcon_spi_cmd(struct efx_nic *efx, const struct falcon_spi_device *spi,
|
|
|
|
|
|
|
|
/* Program address register, if we have an address */
|
|
/* Program address register, if we have an address */
|
|
|
if (addressed) {
|
|
if (addressed) {
|
|
|
- EFX_POPULATE_OWORD_1(reg, FRF_AB_EE_SPI_HADR_ADR, address);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_EE_SPI_HADR);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(reg, FRF_AB_EE_SPI_HADR_ADR, address);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_EE_SPI_HADR);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Program data register, if we have data */
|
|
/* Program data register, if we have data */
|
|
|
if (in != NULL) {
|
|
if (in != NULL) {
|
|
|
memcpy(®, in, len);
|
|
memcpy(®, in, len);
|
|
|
- efx_writeo(efx, ®, FR_AB_EE_SPI_HDATA);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_EE_SPI_HDATA);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Issue read/write command */
|
|
/* Issue read/write command */
|
|
|
- EFX_POPULATE_OWORD_7(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_7(reg,
|
|
|
FRF_AB_EE_SPI_HCMD_CMD_EN, 1,
|
|
FRF_AB_EE_SPI_HCMD_CMD_EN, 1,
|
|
|
FRF_AB_EE_SPI_HCMD_SF_SEL, spi->device_id,
|
|
FRF_AB_EE_SPI_HCMD_SF_SEL, spi->device_id,
|
|
|
FRF_AB_EE_SPI_HCMD_DABCNT, len,
|
|
FRF_AB_EE_SPI_HCMD_DABCNT, len,
|
|
@@ -590,7 +590,7 @@ falcon_spi_cmd(struct efx_nic *efx, const struct falcon_spi_device *spi,
|
|
|
FRF_AB_EE_SPI_HCMD_ADBCNT,
|
|
FRF_AB_EE_SPI_HCMD_ADBCNT,
|
|
|
(addressed ? spi->addr_len : 0),
|
|
(addressed ? spi->addr_len : 0),
|
|
|
FRF_AB_EE_SPI_HCMD_ENC, command);
|
|
FRF_AB_EE_SPI_HCMD_ENC, command);
|
|
|
- efx_writeo(efx, ®, FR_AB_EE_SPI_HCMD);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_EE_SPI_HCMD);
|
|
|
|
|
|
|
|
/* Wait for read/write to complete */
|
|
/* Wait for read/write to complete */
|
|
|
rc = falcon_spi_wait(efx);
|
|
rc = falcon_spi_wait(efx);
|
|
@@ -599,7 +599,7 @@ falcon_spi_cmd(struct efx_nic *efx, const struct falcon_spi_device *spi,
|
|
|
|
|
|
|
|
/* Read data */
|
|
/* Read data */
|
|
|
if (out != NULL) {
|
|
if (out != NULL) {
|
|
|
- efx_reado(efx, ®, FR_AB_EE_SPI_HDATA);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_EE_SPI_HDATA);
|
|
|
memcpy(out, ®, len);
|
|
memcpy(out, ®, len);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -614,7 +614,7 @@ falcon_spi_munge_command(const struct falcon_spi_device *spi,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-falcon_spi_read(struct efx_nic *efx, const struct falcon_spi_device *spi,
|
|
|
|
|
|
|
+falcon_spi_read(struct ef4_nic *efx, const struct falcon_spi_device *spi,
|
|
|
loff_t start, size_t len, size_t *retlen, u8 *buffer)
|
|
loff_t start, size_t len, size_t *retlen, u8 *buffer)
|
|
|
{
|
|
{
|
|
|
size_t block_len, pos = 0;
|
|
size_t block_len, pos = 0;
|
|
@@ -644,10 +644,10 @@ falcon_spi_read(struct efx_nic *efx, const struct falcon_spi_device *spi,
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#ifdef CONFIG_SFC_MTD
|
|
|
|
|
|
|
+#ifdef CONFIG_SFC_FALCON_MTD
|
|
|
|
|
|
|
|
struct falcon_mtd_partition {
|
|
struct falcon_mtd_partition {
|
|
|
- struct efx_mtd_partition common;
|
|
|
|
|
|
|
+ struct ef4_mtd_partition common;
|
|
|
const struct falcon_spi_device *spi;
|
|
const struct falcon_spi_device *spi;
|
|
|
size_t offset;
|
|
size_t offset;
|
|
|
};
|
|
};
|
|
@@ -664,7 +664,7 @@ falcon_spi_write_limit(const struct falcon_spi_device *spi, size_t start)
|
|
|
|
|
|
|
|
/* Wait up to 10 ms for buffered write completion */
|
|
/* Wait up to 10 ms for buffered write completion */
|
|
|
static int
|
|
static int
|
|
|
-falcon_spi_wait_write(struct efx_nic *efx, const struct falcon_spi_device *spi)
|
|
|
|
|
|
|
+falcon_spi_wait_write(struct ef4_nic *efx, const struct falcon_spi_device *spi)
|
|
|
{
|
|
{
|
|
|
unsigned long timeout = jiffies + 1 + DIV_ROUND_UP(HZ, 100);
|
|
unsigned long timeout = jiffies + 1 + DIV_ROUND_UP(HZ, 100);
|
|
|
u8 status;
|
|
u8 status;
|
|
@@ -689,7 +689,7 @@ falcon_spi_wait_write(struct efx_nic *efx, const struct falcon_spi_device *spi)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-falcon_spi_write(struct efx_nic *efx, const struct falcon_spi_device *spi,
|
|
|
|
|
|
|
+falcon_spi_write(struct ef4_nic *efx, const struct falcon_spi_device *spi,
|
|
|
loff_t start, size_t len, size_t *retlen, const u8 *buffer)
|
|
loff_t start, size_t len, size_t *retlen, const u8 *buffer)
|
|
|
{
|
|
{
|
|
|
u8 verify_buffer[FALCON_SPI_MAX_LEN];
|
|
u8 verify_buffer[FALCON_SPI_MAX_LEN];
|
|
@@ -741,7 +741,7 @@ static int
|
|
|
falcon_spi_slow_wait(struct falcon_mtd_partition *part, bool uninterruptible)
|
|
falcon_spi_slow_wait(struct falcon_mtd_partition *part, bool uninterruptible)
|
|
|
{
|
|
{
|
|
|
const struct falcon_spi_device *spi = part->spi;
|
|
const struct falcon_spi_device *spi = part->spi;
|
|
|
- struct efx_nic *efx = part->common.mtd.priv;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = part->common.mtd.priv;
|
|
|
u8 status;
|
|
u8 status;
|
|
|
int rc, i;
|
|
int rc, i;
|
|
|
|
|
|
|
@@ -765,7 +765,7 @@ falcon_spi_slow_wait(struct falcon_mtd_partition *part, bool uninterruptible)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-falcon_spi_unlock(struct efx_nic *efx, const struct falcon_spi_device *spi)
|
|
|
|
|
|
|
+falcon_spi_unlock(struct ef4_nic *efx, const struct falcon_spi_device *spi)
|
|
|
{
|
|
{
|
|
|
const u8 unlock_mask = (SPI_STATUS_BP2 | SPI_STATUS_BP1 |
|
|
const u8 unlock_mask = (SPI_STATUS_BP2 | SPI_STATUS_BP1 |
|
|
|
SPI_STATUS_BP0);
|
|
SPI_STATUS_BP0);
|
|
@@ -805,7 +805,7 @@ static int
|
|
|
falcon_spi_erase(struct falcon_mtd_partition *part, loff_t start, size_t len)
|
|
falcon_spi_erase(struct falcon_mtd_partition *part, loff_t start, size_t len)
|
|
|
{
|
|
{
|
|
|
const struct falcon_spi_device *spi = part->spi;
|
|
const struct falcon_spi_device *spi = part->spi;
|
|
|
- struct efx_nic *efx = part->common.mtd.priv;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = part->common.mtd.priv;
|
|
|
unsigned pos, block_len;
|
|
unsigned pos, block_len;
|
|
|
u8 empty[FALCON_SPI_VERIFY_BUF_LEN];
|
|
u8 empty[FALCON_SPI_VERIFY_BUF_LEN];
|
|
|
u8 buffer[FALCON_SPI_VERIFY_BUF_LEN];
|
|
u8 buffer[FALCON_SPI_VERIFY_BUF_LEN];
|
|
@@ -849,9 +849,9 @@ falcon_spi_erase(struct falcon_mtd_partition *part, loff_t start, size_t len)
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_mtd_rename(struct efx_mtd_partition *part)
|
|
|
|
|
|
|
+static void falcon_mtd_rename(struct ef4_mtd_partition *part)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = part->mtd.priv;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = part->mtd.priv;
|
|
|
|
|
|
|
|
snprintf(part->name, sizeof(part->name), "%s %s",
|
|
snprintf(part->name, sizeof(part->name), "%s %s",
|
|
|
efx->name, part->type_name);
|
|
efx->name, part->type_name);
|
|
@@ -861,7 +861,7 @@ static int falcon_mtd_read(struct mtd_info *mtd, loff_t start,
|
|
|
size_t len, size_t *retlen, u8 *buffer)
|
|
size_t len, size_t *retlen, u8 *buffer)
|
|
|
{
|
|
{
|
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
|
- struct efx_nic *efx = mtd->priv;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = mtd->priv;
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
@@ -877,7 +877,7 @@ static int falcon_mtd_read(struct mtd_info *mtd, loff_t start,
|
|
|
static int falcon_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len)
|
|
static int falcon_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len)
|
|
|
{
|
|
{
|
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
|
- struct efx_nic *efx = mtd->priv;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = mtd->priv;
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
@@ -893,7 +893,7 @@ static int falcon_mtd_write(struct mtd_info *mtd, loff_t start,
|
|
|
size_t len, size_t *retlen, const u8 *buffer)
|
|
size_t len, size_t *retlen, const u8 *buffer)
|
|
|
{
|
|
{
|
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
|
- struct efx_nic *efx = mtd->priv;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = mtd->priv;
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
@@ -909,7 +909,7 @@ static int falcon_mtd_write(struct mtd_info *mtd, loff_t start,
|
|
|
static int falcon_mtd_sync(struct mtd_info *mtd)
|
|
static int falcon_mtd_sync(struct mtd_info *mtd)
|
|
|
{
|
|
{
|
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
|
|
|
- struct efx_nic *efx = mtd->priv;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = mtd->priv;
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
@@ -919,7 +919,7 @@ static int falcon_mtd_sync(struct mtd_info *mtd)
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_mtd_probe(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_mtd_probe(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
struct falcon_mtd_partition *parts;
|
|
struct falcon_mtd_partition *parts;
|
|
@@ -963,13 +963,13 @@ static int falcon_mtd_probe(struct efx_nic *efx)
|
|
|
n_parts++;
|
|
n_parts++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts));
|
|
|
|
|
|
|
+ rc = ef4_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts));
|
|
|
if (rc)
|
|
if (rc)
|
|
|
kfree(parts);
|
|
kfree(parts);
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#endif /* CONFIG_SFC_MTD */
|
|
|
|
|
|
|
+#endif /* CONFIG_SFC_FALCON_MTD */
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
/**************************************************************************
|
|
|
*
|
|
*
|
|
@@ -979,27 +979,27 @@ static int falcon_mtd_probe(struct efx_nic *efx)
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/* Configure the XAUI driver that is an output from Falcon */
|
|
/* Configure the XAUI driver that is an output from Falcon */
|
|
|
-static void falcon_setup_xaui(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_setup_xaui(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t sdctl, txdrv;
|
|
|
|
|
|
|
+ ef4_oword_t sdctl, txdrv;
|
|
|
|
|
|
|
|
/* Move the XAUI into low power, unless there is no PHY, in
|
|
/* Move the XAUI into low power, unless there is no PHY, in
|
|
|
* which case the XAUI will have to drive a cable. */
|
|
* which case the XAUI will have to drive a cable. */
|
|
|
if (efx->phy_type == PHY_TYPE_NONE)
|
|
if (efx->phy_type == PHY_TYPE_NONE)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
- efx_reado(efx, &sdctl, FR_AB_XX_SD_CTL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVD, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVD, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVC, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVC, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVB, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVB, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVA, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVA, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
- efx_writeo(efx, &sdctl, FR_AB_XX_SD_CTL);
|
|
|
|
|
-
|
|
|
|
|
- EFX_POPULATE_OWORD_8(txdrv,
|
|
|
|
|
|
|
+ ef4_reado(efx, &sdctl, FR_AB_XX_SD_CTL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVD, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVD, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVC, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVC, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVB, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVB, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_HIDRVA, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(sdctl, FRF_AB_XX_LODRVA, FFE_AB_XX_SD_CTL_DRV_DEF);
|
|
|
|
|
+ ef4_writeo(efx, &sdctl, FR_AB_XX_SD_CTL);
|
|
|
|
|
+
|
|
|
|
|
+ EF4_POPULATE_OWORD_8(txdrv,
|
|
|
FRF_AB_XX_DEQD, FFE_AB_XX_TXDRV_DEQ_DEF,
|
|
FRF_AB_XX_DEQD, FFE_AB_XX_TXDRV_DEQ_DEF,
|
|
|
FRF_AB_XX_DEQC, FFE_AB_XX_TXDRV_DEQ_DEF,
|
|
FRF_AB_XX_DEQC, FFE_AB_XX_TXDRV_DEQ_DEF,
|
|
|
FRF_AB_XX_DEQB, FFE_AB_XX_TXDRV_DEQ_DEF,
|
|
FRF_AB_XX_DEQB, FFE_AB_XX_TXDRV_DEQ_DEF,
|
|
@@ -1008,27 +1008,27 @@ static void falcon_setup_xaui(struct efx_nic *efx)
|
|
|
FRF_AB_XX_DTXC, FFE_AB_XX_TXDRV_DTX_DEF,
|
|
FRF_AB_XX_DTXC, FFE_AB_XX_TXDRV_DTX_DEF,
|
|
|
FRF_AB_XX_DTXB, FFE_AB_XX_TXDRV_DTX_DEF,
|
|
FRF_AB_XX_DTXB, FFE_AB_XX_TXDRV_DTX_DEF,
|
|
|
FRF_AB_XX_DTXA, FFE_AB_XX_TXDRV_DTX_DEF);
|
|
FRF_AB_XX_DTXA, FFE_AB_XX_TXDRV_DTX_DEF);
|
|
|
- efx_writeo(efx, &txdrv, FR_AB_XX_TXDRV_CTL);
|
|
|
|
|
|
|
+ ef4_writeo(efx, &txdrv, FR_AB_XX_TXDRV_CTL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-int falcon_reset_xaui(struct efx_nic *efx)
|
|
|
|
|
|
|
+int falcon_reset_xaui(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
int count;
|
|
int count;
|
|
|
|
|
|
|
|
/* Don't fetch MAC statistics over an XMAC reset */
|
|
/* Don't fetch MAC statistics over an XMAC reset */
|
|
|
WARN_ON(nic_data->stats_disable_count == 0);
|
|
WARN_ON(nic_data->stats_disable_count == 0);
|
|
|
|
|
|
|
|
/* Start reset sequence */
|
|
/* Start reset sequence */
|
|
|
- EFX_POPULATE_OWORD_1(reg, FRF_AB_XX_RST_XX_EN, 1);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_XX_PWR_RST);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(reg, FRF_AB_XX_RST_XX_EN, 1);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XX_PWR_RST);
|
|
|
|
|
|
|
|
/* Wait up to 10 ms for completion, then reinitialise */
|
|
/* Wait up to 10 ms for completion, then reinitialise */
|
|
|
for (count = 0; count < 1000; count++) {
|
|
for (count = 0; count < 1000; count++) {
|
|
|
- efx_reado(efx, ®, FR_AB_XX_PWR_RST);
|
|
|
|
|
- if (EFX_OWORD_FIELD(reg, FRF_AB_XX_RST_XX_EN) == 0 &&
|
|
|
|
|
- EFX_OWORD_FIELD(reg, FRF_AB_XX_SD_RST_ACT) == 0) {
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XX_PWR_RST);
|
|
|
|
|
+ if (EF4_OWORD_FIELD(reg, FRF_AB_XX_RST_XX_EN) == 0 &&
|
|
|
|
|
+ EF4_OWORD_FIELD(reg, FRF_AB_XX_SD_RST_ACT) == 0) {
|
|
|
falcon_setup_xaui(efx);
|
|
falcon_setup_xaui(efx);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
@@ -1039,12 +1039,12 @@ int falcon_reset_xaui(struct efx_nic *efx)
|
|
|
return -ETIMEDOUT;
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_ack_status_intr(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_ack_status_intr(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- if ((efx_nic_rev(efx) != EFX_REV_FALCON_B0) || LOOPBACK_INTERNAL(efx))
|
|
|
|
|
|
|
+ if ((ef4_nic_rev(efx) != EF4_REV_FALCON_B0) || LOOPBACK_INTERNAL(efx))
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
/* We expect xgmii faults if the wireside link is down */
|
|
/* We expect xgmii faults if the wireside link is down */
|
|
@@ -1056,33 +1056,33 @@ static void falcon_ack_status_intr(struct efx_nic *efx)
|
|
|
if (nic_data->xmac_poll_required)
|
|
if (nic_data->xmac_poll_required)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_XM_MGT_INT_MSK);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XM_MGT_INT_MSK);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static bool falcon_xgxs_link_ok(struct efx_nic *efx)
|
|
|
|
|
|
|
+static bool falcon_xgxs_link_ok(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
bool align_done, link_ok = false;
|
|
bool align_done, link_ok = false;
|
|
|
int sync_status;
|
|
int sync_status;
|
|
|
|
|
|
|
|
/* Read link status */
|
|
/* Read link status */
|
|
|
- efx_reado(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
|
|
|
- align_done = EFX_OWORD_FIELD(reg, FRF_AB_XX_ALIGN_DONE);
|
|
|
|
|
- sync_status = EFX_OWORD_FIELD(reg, FRF_AB_XX_SYNC_STAT);
|
|
|
|
|
|
|
+ align_done = EF4_OWORD_FIELD(reg, FRF_AB_XX_ALIGN_DONE);
|
|
|
|
|
+ sync_status = EF4_OWORD_FIELD(reg, FRF_AB_XX_SYNC_STAT);
|
|
|
if (align_done && (sync_status == FFE_AB_XX_STAT_ALL_LANES))
|
|
if (align_done && (sync_status == FFE_AB_XX_STAT_ALL_LANES))
|
|
|
link_ok = true;
|
|
link_ok = true;
|
|
|
|
|
|
|
|
/* Clear link status ready for next read */
|
|
/* Clear link status ready for next read */
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_COMMA_DET, FFE_AB_XX_STAT_ALL_LANES);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_CHAR_ERR, FFE_AB_XX_STAT_ALL_LANES);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_DISPERR, FFE_AB_XX_STAT_ALL_LANES);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_COMMA_DET, FFE_AB_XX_STAT_ALL_LANES);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_CHAR_ERR, FFE_AB_XX_STAT_ALL_LANES);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_DISPERR, FFE_AB_XX_STAT_ALL_LANES);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
|
|
|
return link_ok;
|
|
return link_ok;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static bool falcon_xmac_link_ok(struct efx_nic *efx)
|
|
|
|
|
|
|
+static bool falcon_xmac_link_ok(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
/*
|
|
/*
|
|
|
* Check MAC's XGXS link status except when using XGMII loopback
|
|
* Check MAC's XGXS link status except when using XGMII loopback
|
|
@@ -1094,66 +1094,66 @@ static bool falcon_xmac_link_ok(struct efx_nic *efx)
|
|
|
falcon_xgxs_link_ok(efx)) &&
|
|
falcon_xgxs_link_ok(efx)) &&
|
|
|
(!(efx->mdio.mmds & (1 << MDIO_MMD_PHYXS)) ||
|
|
(!(efx->mdio.mmds & (1 << MDIO_MMD_PHYXS)) ||
|
|
|
LOOPBACK_INTERNAL(efx) ||
|
|
LOOPBACK_INTERNAL(efx) ||
|
|
|
- efx_mdio_phyxgxs_lane_sync(efx));
|
|
|
|
|
|
|
+ ef4_mdio_phyxgxs_lane_sync(efx));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_reconfigure_xmac_core(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_reconfigure_xmac_core(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
unsigned int max_frame_len;
|
|
unsigned int max_frame_len;
|
|
|
- efx_oword_t reg;
|
|
|
|
|
- bool rx_fc = !!(efx->link_state.fc & EFX_FC_RX);
|
|
|
|
|
- bool tx_fc = !!(efx->link_state.fc & EFX_FC_TX);
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
+ bool rx_fc = !!(efx->link_state.fc & EF4_FC_RX);
|
|
|
|
|
+ bool tx_fc = !!(efx->link_state.fc & EF4_FC_TX);
|
|
|
|
|
|
|
|
/* Configure MAC - cut-thru mode is hard wired on */
|
|
/* Configure MAC - cut-thru mode is hard wired on */
|
|
|
- EFX_POPULATE_OWORD_3(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_3(reg,
|
|
|
FRF_AB_XM_RX_JUMBO_MODE, 1,
|
|
FRF_AB_XM_RX_JUMBO_MODE, 1,
|
|
|
FRF_AB_XM_TX_STAT_EN, 1,
|
|
FRF_AB_XM_TX_STAT_EN, 1,
|
|
|
FRF_AB_XM_RX_STAT_EN, 1);
|
|
FRF_AB_XM_RX_STAT_EN, 1);
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_GLB_CFG);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_GLB_CFG);
|
|
|
|
|
|
|
|
/* Configure TX */
|
|
/* Configure TX */
|
|
|
- EFX_POPULATE_OWORD_6(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_6(reg,
|
|
|
FRF_AB_XM_TXEN, 1,
|
|
FRF_AB_XM_TXEN, 1,
|
|
|
FRF_AB_XM_TX_PRMBL, 1,
|
|
FRF_AB_XM_TX_PRMBL, 1,
|
|
|
FRF_AB_XM_AUTO_PAD, 1,
|
|
FRF_AB_XM_AUTO_PAD, 1,
|
|
|
FRF_AB_XM_TXCRC, 1,
|
|
FRF_AB_XM_TXCRC, 1,
|
|
|
FRF_AB_XM_FCNTL, tx_fc,
|
|
FRF_AB_XM_FCNTL, tx_fc,
|
|
|
FRF_AB_XM_IPG, 0x3);
|
|
FRF_AB_XM_IPG, 0x3);
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_TX_CFG);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_TX_CFG);
|
|
|
|
|
|
|
|
/* Configure RX */
|
|
/* Configure RX */
|
|
|
- EFX_POPULATE_OWORD_5(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_5(reg,
|
|
|
FRF_AB_XM_RXEN, 1,
|
|
FRF_AB_XM_RXEN, 1,
|
|
|
FRF_AB_XM_AUTO_DEPAD, 0,
|
|
FRF_AB_XM_AUTO_DEPAD, 0,
|
|
|
FRF_AB_XM_ACPT_ALL_MCAST, 1,
|
|
FRF_AB_XM_ACPT_ALL_MCAST, 1,
|
|
|
FRF_AB_XM_ACPT_ALL_UCAST, !efx->unicast_filter,
|
|
FRF_AB_XM_ACPT_ALL_UCAST, !efx->unicast_filter,
|
|
|
FRF_AB_XM_PASS_CRC_ERR, 1);
|
|
FRF_AB_XM_PASS_CRC_ERR, 1);
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_RX_CFG);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_RX_CFG);
|
|
|
|
|
|
|
|
/* Set frame length */
|
|
/* Set frame length */
|
|
|
- max_frame_len = EFX_MAX_FRAME_LEN(efx->net_dev->mtu);
|
|
|
|
|
- EFX_POPULATE_OWORD_1(reg, FRF_AB_XM_MAX_RX_FRM_SIZE, max_frame_len);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_RX_PARAM);
|
|
|
|
|
- EFX_POPULATE_OWORD_2(reg,
|
|
|
|
|
|
|
+ max_frame_len = EF4_MAX_FRAME_LEN(efx->net_dev->mtu);
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(reg, FRF_AB_XM_MAX_RX_FRM_SIZE, max_frame_len);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_RX_PARAM);
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg,
|
|
|
FRF_AB_XM_MAX_TX_FRM_SIZE, max_frame_len,
|
|
FRF_AB_XM_MAX_TX_FRM_SIZE, max_frame_len,
|
|
|
FRF_AB_XM_TX_JUMBO_MODE, 1);
|
|
FRF_AB_XM_TX_JUMBO_MODE, 1);
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_TX_PARAM);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_TX_PARAM);
|
|
|
|
|
|
|
|
- EFX_POPULATE_OWORD_2(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg,
|
|
|
FRF_AB_XM_PAUSE_TIME, 0xfffe, /* MAX PAUSE TIME */
|
|
FRF_AB_XM_PAUSE_TIME, 0xfffe, /* MAX PAUSE TIME */
|
|
|
FRF_AB_XM_DIS_FCNTL, !rx_fc);
|
|
FRF_AB_XM_DIS_FCNTL, !rx_fc);
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_FC);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_FC);
|
|
|
|
|
|
|
|
/* Set MAC address */
|
|
/* Set MAC address */
|
|
|
memcpy(®, &efx->net_dev->dev_addr[0], 4);
|
|
memcpy(®, &efx->net_dev->dev_addr[0], 4);
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_ADR_LO);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_ADR_LO);
|
|
|
memcpy(®, &efx->net_dev->dev_addr[4], 2);
|
|
memcpy(®, &efx->net_dev->dev_addr[4], 2);
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_ADR_HI);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_ADR_HI);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_reconfigure_xgxs_core(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_reconfigure_xgxs_core(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
bool xgxs_loopback = (efx->loopback_mode == LOOPBACK_XGXS);
|
|
bool xgxs_loopback = (efx->loopback_mode == LOOPBACK_XGXS);
|
|
|
bool xaui_loopback = (efx->loopback_mode == LOOPBACK_XAUI);
|
|
bool xaui_loopback = (efx->loopback_mode == LOOPBACK_XAUI);
|
|
|
bool xgmii_loopback = (efx->loopback_mode == LOOPBACK_XGMII);
|
|
bool xgmii_loopback = (efx->loopback_mode == LOOPBACK_XGMII);
|
|
@@ -1161,12 +1161,12 @@ static void falcon_reconfigure_xgxs_core(struct efx_nic *efx)
|
|
|
|
|
|
|
|
/* XGXS block is flaky and will need to be reset if moving
|
|
/* XGXS block is flaky and will need to be reset if moving
|
|
|
* into our out of XGMII, XGXS or XAUI loopbacks. */
|
|
* into our out of XGMII, XGXS or XAUI loopbacks. */
|
|
|
- efx_reado(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
- old_xgxs_loopback = EFX_OWORD_FIELD(reg, FRF_AB_XX_XGXS_LB_EN);
|
|
|
|
|
- old_xgmii_loopback = EFX_OWORD_FIELD(reg, FRF_AB_XX_XGMII_LB_EN);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
+ old_xgxs_loopback = EF4_OWORD_FIELD(reg, FRF_AB_XX_XGXS_LB_EN);
|
|
|
|
|
+ old_xgmii_loopback = EF4_OWORD_FIELD(reg, FRF_AB_XX_XGMII_LB_EN);
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_XX_SD_CTL);
|
|
|
|
|
- old_xaui_loopback = EFX_OWORD_FIELD(reg, FRF_AB_XX_LPBKA);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XX_SD_CTL);
|
|
|
|
|
+ old_xaui_loopback = EF4_OWORD_FIELD(reg, FRF_AB_XX_LPBKA);
|
|
|
|
|
|
|
|
/* The PHY driver may have turned XAUI off */
|
|
/* The PHY driver may have turned XAUI off */
|
|
|
if ((xgxs_loopback != old_xgxs_loopback) ||
|
|
if ((xgxs_loopback != old_xgxs_loopback) ||
|
|
@@ -1174,30 +1174,30 @@ static void falcon_reconfigure_xgxs_core(struct efx_nic *efx)
|
|
|
(xgmii_loopback != old_xgmii_loopback))
|
|
(xgmii_loopback != old_xgmii_loopback))
|
|
|
falcon_reset_xaui(efx);
|
|
falcon_reset_xaui(efx);
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_FORCE_SIG,
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_FORCE_SIG,
|
|
|
(xgxs_loopback || xaui_loopback) ?
|
|
(xgxs_loopback || xaui_loopback) ?
|
|
|
FFE_AB_XX_FORCE_SIG_ALL_LANES : 0);
|
|
FFE_AB_XX_FORCE_SIG_ALL_LANES : 0);
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_XGXS_LB_EN, xgxs_loopback);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_XGMII_LB_EN, xgmii_loopback);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_XGXS_LB_EN, xgxs_loopback);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_XGMII_LB_EN, xgmii_loopback);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XX_CORE_STAT);
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_XX_SD_CTL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKD, xaui_loopback);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKC, xaui_loopback);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKB, xaui_loopback);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKA, xaui_loopback);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_XX_SD_CTL);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XX_SD_CTL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKD, xaui_loopback);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKC, xaui_loopback);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKB, xaui_loopback);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_XX_LPBKA, xaui_loopback);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XX_SD_CTL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Try to bring up the Falcon side of the Falcon-Phy XAUI link */
|
|
/* Try to bring up the Falcon side of the Falcon-Phy XAUI link */
|
|
|
-static bool falcon_xmac_link_ok_retry(struct efx_nic *efx, int tries)
|
|
|
|
|
|
|
+static bool falcon_xmac_link_ok_retry(struct ef4_nic *efx, int tries)
|
|
|
{
|
|
{
|
|
|
bool mac_up = falcon_xmac_link_ok(efx);
|
|
bool mac_up = falcon_xmac_link_ok(efx);
|
|
|
|
|
|
|
|
if (LOOPBACK_MASK(efx) & LOOPBACKS_EXTERNAL(efx) & LOOPBACKS_WS ||
|
|
if (LOOPBACK_MASK(efx) & LOOPBACKS_EXTERNAL(efx) & LOOPBACKS_WS ||
|
|
|
- efx_phy_mode_disabled(efx->phy_mode))
|
|
|
|
|
|
|
+ ef4_phy_mode_disabled(efx->phy_mode))
|
|
|
/* XAUI link is expected to be down */
|
|
/* XAUI link is expected to be down */
|
|
|
return mac_up;
|
|
return mac_up;
|
|
|
|
|
|
|
@@ -1217,16 +1217,16 @@ static bool falcon_xmac_link_ok_retry(struct efx_nic *efx, int tries)
|
|
|
return mac_up;
|
|
return mac_up;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static bool falcon_xmac_check_fault(struct efx_nic *efx)
|
|
|
|
|
|
|
+static bool falcon_xmac_check_fault(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
return !falcon_xmac_link_ok_retry(efx, 5);
|
|
return !falcon_xmac_link_ok_retry(efx, 5);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_reconfigure_xmac(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_reconfigure_xmac(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
|
|
|
|
|
- efx_farch_filter_sync_rx_mode(efx);
|
|
|
|
|
|
|
+ ef4_farch_filter_sync_rx_mode(efx);
|
|
|
|
|
|
|
|
falcon_reconfigure_xgxs_core(efx);
|
|
falcon_reconfigure_xgxs_core(efx);
|
|
|
falcon_reconfigure_xmac_core(efx);
|
|
falcon_reconfigure_xmac_core(efx);
|
|
@@ -1239,7 +1239,7 @@ static int falcon_reconfigure_xmac(struct efx_nic *efx)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_poll_xmac(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_poll_xmac(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
|
|
|
|
@@ -1258,32 +1258,32 @@ static void falcon_poll_xmac(struct efx_nic *efx)
|
|
|
**************************************************************************
|
|
**************************************************************************
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-static void falcon_push_multicast_hash(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_push_multicast_hash(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- union efx_multicast_hash *mc_hash = &efx->multicast_hash;
|
|
|
|
|
|
|
+ union ef4_multicast_hash *mc_hash = &efx->multicast_hash;
|
|
|
|
|
|
|
|
WARN_ON(!mutex_is_locked(&efx->mac_lock));
|
|
WARN_ON(!mutex_is_locked(&efx->mac_lock));
|
|
|
|
|
|
|
|
- efx_writeo(efx, &mc_hash->oword[0], FR_AB_MAC_MC_HASH_REG0);
|
|
|
|
|
- efx_writeo(efx, &mc_hash->oword[1], FR_AB_MAC_MC_HASH_REG1);
|
|
|
|
|
|
|
+ ef4_writeo(efx, &mc_hash->oword[0], FR_AB_MAC_MC_HASH_REG0);
|
|
|
|
|
+ ef4_writeo(efx, &mc_hash->oword[1], FR_AB_MAC_MC_HASH_REG1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_reset_macs(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_reset_macs(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t reg, mac_ctrl;
|
|
|
|
|
|
|
+ ef4_oword_t reg, mac_ctrl;
|
|
|
int count;
|
|
int count;
|
|
|
|
|
|
|
|
- if (efx_nic_rev(efx) < EFX_REV_FALCON_B0) {
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0) {
|
|
|
/* It's not safe to use GLB_CTL_REG to reset the
|
|
/* It's not safe to use GLB_CTL_REG to reset the
|
|
|
* macs, so instead use the internal MAC resets
|
|
* macs, so instead use the internal MAC resets
|
|
|
*/
|
|
*/
|
|
|
- EFX_POPULATE_OWORD_1(reg, FRF_AB_XM_CORE_RST, 1);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_XM_GLB_CFG);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(reg, FRF_AB_XM_CORE_RST, 1);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_XM_GLB_CFG);
|
|
|
|
|
|
|
|
for (count = 0; count < 10000; count++) {
|
|
for (count = 0; count < 10000; count++) {
|
|
|
- efx_reado(efx, ®, FR_AB_XM_GLB_CFG);
|
|
|
|
|
- if (EFX_OWORD_FIELD(reg, FRF_AB_XM_CORE_RST) ==
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_XM_GLB_CFG);
|
|
|
|
|
+ if (EF4_OWORD_FIELD(reg, FRF_AB_XM_CORE_RST) ==
|
|
|
0)
|
|
0)
|
|
|
return;
|
|
return;
|
|
|
udelay(10);
|
|
udelay(10);
|
|
@@ -1296,22 +1296,22 @@ static void falcon_reset_macs(struct efx_nic *efx)
|
|
|
/* Mac stats will fail whist the TX fifo is draining */
|
|
/* Mac stats will fail whist the TX fifo is draining */
|
|
|
WARN_ON(nic_data->stats_disable_count == 0);
|
|
WARN_ON(nic_data->stats_disable_count == 0);
|
|
|
|
|
|
|
|
- efx_reado(efx, &mac_ctrl, FR_AB_MAC_CTRL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(mac_ctrl, FRF_BB_TXFIFO_DRAIN_EN, 1);
|
|
|
|
|
- efx_writeo(efx, &mac_ctrl, FR_AB_MAC_CTRL);
|
|
|
|
|
|
|
+ ef4_reado(efx, &mac_ctrl, FR_AB_MAC_CTRL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(mac_ctrl, FRF_BB_TXFIFO_DRAIN_EN, 1);
|
|
|
|
|
+ ef4_writeo(efx, &mac_ctrl, FR_AB_MAC_CTRL);
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_GLB_CTL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_XGTX, 1);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_XGRX, 1);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AB_RST_EM, 1);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_GLB_CTL);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_GLB_CTL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_RST_XGTX, 1);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_RST_XGRX, 1);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AB_RST_EM, 1);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_GLB_CTL);
|
|
|
|
|
|
|
|
count = 0;
|
|
count = 0;
|
|
|
while (1) {
|
|
while (1) {
|
|
|
- efx_reado(efx, ®, FR_AB_GLB_CTL);
|
|
|
|
|
- if (!EFX_OWORD_FIELD(reg, FRF_AB_RST_XGTX) &&
|
|
|
|
|
- !EFX_OWORD_FIELD(reg, FRF_AB_RST_XGRX) &&
|
|
|
|
|
- !EFX_OWORD_FIELD(reg, FRF_AB_RST_EM)) {
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_GLB_CTL);
|
|
|
|
|
+ if (!EF4_OWORD_FIELD(reg, FRF_AB_RST_XGTX) &&
|
|
|
|
|
+ !EF4_OWORD_FIELD(reg, FRF_AB_RST_XGRX) &&
|
|
|
|
|
+ !EF4_OWORD_FIELD(reg, FRF_AB_RST_EM)) {
|
|
|
netif_dbg(efx, hw, efx->net_dev,
|
|
netif_dbg(efx, hw, efx->net_dev,
|
|
|
"Completed MAC reset after %d loops\n",
|
|
"Completed MAC reset after %d loops\n",
|
|
|
count);
|
|
count);
|
|
@@ -1327,47 +1327,47 @@ static void falcon_reset_macs(struct efx_nic *efx)
|
|
|
|
|
|
|
|
/* Ensure the correct MAC is selected before statistics
|
|
/* Ensure the correct MAC is selected before statistics
|
|
|
* are re-enabled by the caller */
|
|
* are re-enabled by the caller */
|
|
|
- efx_writeo(efx, &mac_ctrl, FR_AB_MAC_CTRL);
|
|
|
|
|
|
|
+ ef4_writeo(efx, &mac_ctrl, FR_AB_MAC_CTRL);
|
|
|
|
|
|
|
|
falcon_setup_xaui(efx);
|
|
falcon_setup_xaui(efx);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_drain_tx_fifo(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_drain_tx_fifo(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- if ((efx_nic_rev(efx) < EFX_REV_FALCON_B0) ||
|
|
|
|
|
|
|
+ if ((ef4_nic_rev(efx) < EF4_REV_FALCON_B0) ||
|
|
|
(efx->loopback_mode != LOOPBACK_NONE))
|
|
(efx->loopback_mode != LOOPBACK_NONE))
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AB_MAC_CTRL);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_MAC_CTRL);
|
|
|
/* There is no point in draining more than once */
|
|
/* There is no point in draining more than once */
|
|
|
- if (EFX_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN))
|
|
|
|
|
|
|
+ if (EF4_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN))
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
falcon_reset_macs(efx);
|
|
falcon_reset_macs(efx);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_deconfigure_mac_wrapper(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_deconfigure_mac_wrapper(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- if (efx_nic_rev(efx) < EFX_REV_FALCON_B0)
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
/* Isolate the MAC -> RX */
|
|
/* Isolate the MAC -> RX */
|
|
|
- efx_reado(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 0);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 0);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
|
|
|
/* Isolate TX -> MAC */
|
|
/* Isolate TX -> MAC */
|
|
|
falcon_drain_tx_fifo(efx);
|
|
falcon_drain_tx_fifo(efx);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_reconfigure_mac_wrapper(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- struct efx_link_state *link_state = &efx->link_state;
|
|
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ struct ef4_link_state *link_state = &efx->link_state;
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
int link_speed, isolate;
|
|
int link_speed, isolate;
|
|
|
|
|
|
|
|
isolate = !!ACCESS_ONCE(efx->reset_pending);
|
|
isolate = !!ACCESS_ONCE(efx->reset_pending);
|
|
@@ -1383,7 +1383,7 @@ static void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
|
|
|
* as advertised. Disable to ensure packets are not
|
|
* as advertised. Disable to ensure packets are not
|
|
|
* indefinitely held and TX queue can be flushed at any point
|
|
* indefinitely held and TX queue can be flushed at any point
|
|
|
* while the link is down. */
|
|
* while the link is down. */
|
|
|
- EFX_POPULATE_OWORD_5(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_5(reg,
|
|
|
FRF_AB_MAC_XOFF_VAL, 0xffff /* max pause time */,
|
|
FRF_AB_MAC_XOFF_VAL, 0xffff /* max pause time */,
|
|
|
FRF_AB_MAC_BCAD_ACPT, 1,
|
|
FRF_AB_MAC_BCAD_ACPT, 1,
|
|
|
FRF_AB_MAC_UC_PROM, !efx->unicast_filter,
|
|
FRF_AB_MAC_UC_PROM, !efx->unicast_filter,
|
|
@@ -1391,30 +1391,30 @@ static void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
|
|
|
FRF_AB_MAC_SPEED, link_speed);
|
|
FRF_AB_MAC_SPEED, link_speed);
|
|
|
/* On B0, MAC backpressure can be disabled and packets get
|
|
/* On B0, MAC backpressure can be disabled and packets get
|
|
|
* discarded. */
|
|
* discarded. */
|
|
|
- if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) {
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN,
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) {
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BB_TXFIFO_DRAIN_EN,
|
|
|
!link_state->up || isolate);
|
|
!link_state->up || isolate);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_MAC_CTRL);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MAC_CTRL);
|
|
|
|
|
|
|
|
/* Restore the multicast hash registers. */
|
|
/* Restore the multicast hash registers. */
|
|
|
falcon_push_multicast_hash(efx);
|
|
falcon_push_multicast_hash(efx);
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AZ_RX_CFG);
|
|
|
/* Enable XOFF signal from RX FIFO (we enabled it during NIC
|
|
/* Enable XOFF signal from RX FIFO (we enabled it during NIC
|
|
|
* initialisation but it may read back as 0) */
|
|
* initialisation but it may read back as 0) */
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AZ_RX_XOFF_MAC_EN, 1);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AZ_RX_XOFF_MAC_EN, 1);
|
|
|
/* Unisolate the MAC -> RX */
|
|
/* Unisolate the MAC -> RX */
|
|
|
- if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0)
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, !isolate);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0)
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, !isolate);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AZ_RX_CFG);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_stats_request(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_stats_request(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
WARN_ON(nic_data->stats_pending);
|
|
WARN_ON(nic_data->stats_pending);
|
|
|
WARN_ON(nic_data->stats_disable_count);
|
|
WARN_ON(nic_data->stats_disable_count);
|
|
@@ -1424,16 +1424,16 @@ static void falcon_stats_request(struct efx_nic *efx)
|
|
|
wmb(); /* ensure done flag is clear */
|
|
wmb(); /* ensure done flag is clear */
|
|
|
|
|
|
|
|
/* Initiate DMA transfer of stats */
|
|
/* Initiate DMA transfer of stats */
|
|
|
- EFX_POPULATE_OWORD_2(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg,
|
|
|
FRF_AB_MAC_STAT_DMA_CMD, 1,
|
|
FRF_AB_MAC_STAT_DMA_CMD, 1,
|
|
|
FRF_AB_MAC_STAT_DMA_ADR,
|
|
FRF_AB_MAC_STAT_DMA_ADR,
|
|
|
efx->stats_buffer.dma_addr);
|
|
efx->stats_buffer.dma_addr);
|
|
|
- efx_writeo(efx, ®, FR_AB_MAC_STAT_DMA);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MAC_STAT_DMA);
|
|
|
|
|
|
|
|
mod_timer(&nic_data->stats_timer, round_jiffies_up(jiffies + HZ / 2));
|
|
mod_timer(&nic_data->stats_timer, round_jiffies_up(jiffies + HZ / 2));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_stats_complete(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_stats_complete(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
|
|
|
|
@@ -1443,7 +1443,7 @@ static void falcon_stats_complete(struct efx_nic *efx)
|
|
|
nic_data->stats_pending = false;
|
|
nic_data->stats_pending = false;
|
|
|
if (FALCON_XMAC_STATS_DMA_FLAG(efx)) {
|
|
if (FALCON_XMAC_STATS_DMA_FLAG(efx)) {
|
|
|
rmb(); /* read the done flag before the stats */
|
|
rmb(); /* read the done flag before the stats */
|
|
|
- efx_nic_update_stats(falcon_stat_desc, FALCON_STAT_COUNT,
|
|
|
|
|
|
|
+ ef4_nic_update_stats(falcon_stat_desc, FALCON_STAT_COUNT,
|
|
|
falcon_stat_mask, nic_data->stats,
|
|
falcon_stat_mask, nic_data->stats,
|
|
|
efx->stats_buffer.addr, true);
|
|
efx->stats_buffer.addr, true);
|
|
|
} else {
|
|
} else {
|
|
@@ -1454,7 +1454,7 @@ static void falcon_stats_complete(struct efx_nic *efx)
|
|
|
|
|
|
|
|
static void falcon_stats_timer_func(unsigned long context)
|
|
static void falcon_stats_timer_func(unsigned long context)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = (struct efx_nic *)context;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = (struct ef4_nic *)context;
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
|
|
|
|
|
spin_lock(&efx->stats_lock);
|
|
spin_lock(&efx->stats_lock);
|
|
@@ -1466,9 +1466,9 @@ static void falcon_stats_timer_func(unsigned long context)
|
|
|
spin_unlock(&efx->stats_lock);
|
|
spin_unlock(&efx->stats_lock);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static bool falcon_loopback_link_poll(struct efx_nic *efx)
|
|
|
|
|
|
|
+static bool falcon_loopback_link_poll(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- struct efx_link_state old_state = efx->link_state;
|
|
|
|
|
|
|
+ struct ef4_link_state old_state = efx->link_state;
|
|
|
|
|
|
|
|
WARN_ON(!mutex_is_locked(&efx->mac_lock));
|
|
WARN_ON(!mutex_is_locked(&efx->mac_lock));
|
|
|
WARN_ON(!LOOPBACK_INTERNAL(efx));
|
|
WARN_ON(!LOOPBACK_INTERNAL(efx));
|
|
@@ -1478,14 +1478,14 @@ static bool falcon_loopback_link_poll(struct efx_nic *efx)
|
|
|
efx->link_state.up = true;
|
|
efx->link_state.up = true;
|
|
|
efx->link_state.speed = 10000;
|
|
efx->link_state.speed = 10000;
|
|
|
|
|
|
|
|
- return !efx_link_state_equal(&efx->link_state, &old_state);
|
|
|
|
|
|
|
+ return !ef4_link_state_equal(&efx->link_state, &old_state);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_reconfigure_port(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_reconfigure_port(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
|
- WARN_ON(efx_nic_rev(efx) > EFX_REV_FALCON_B0);
|
|
|
|
|
|
|
+ WARN_ON(ef4_nic_rev(efx) > EF4_REV_FALCON_B0);
|
|
|
|
|
|
|
|
/* Poll the PHY link state *before* reconfiguring it. This means we
|
|
/* Poll the PHY link state *before* reconfiguring it. This means we
|
|
|
* will pick up the correct speed (in loopback) to select the correct
|
|
* will pick up the correct speed (in loopback) to select the correct
|
|
@@ -1508,7 +1508,7 @@ static int falcon_reconfigure_port(struct efx_nic *efx)
|
|
|
falcon_start_nic_stats(efx);
|
|
falcon_start_nic_stats(efx);
|
|
|
|
|
|
|
|
/* Synchronise efx->link_state with the kernel */
|
|
/* Synchronise efx->link_state with the kernel */
|
|
|
- efx_link_status_changed(efx);
|
|
|
|
|
|
|
+ ef4_link_status_changed(efx);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
@@ -1520,13 +1520,13 @@ static int falcon_reconfigure_port(struct efx_nic *efx)
|
|
|
* flow control on this end.
|
|
* flow control on this end.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-static void falcon_a1_prepare_enable_fc_tx(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_a1_prepare_enable_fc_tx(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
/* Schedule a reset to recover */
|
|
/* Schedule a reset to recover */
|
|
|
- efx_schedule_reset(efx, RESET_TYPE_INVISIBLE);
|
|
|
|
|
|
|
+ ef4_schedule_reset(efx, RESET_TYPE_INVISIBLE);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_b0_prepare_enable_fc_tx(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_b0_prepare_enable_fc_tx(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
/* Recover by resetting the EM block */
|
|
/* Recover by resetting the EM block */
|
|
|
falcon_stop_nic_stats(efx);
|
|
falcon_stop_nic_stats(efx);
|
|
@@ -1543,21 +1543,21 @@ static void falcon_b0_prepare_enable_fc_tx(struct efx_nic *efx)
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/* Wait for GMII access to complete */
|
|
/* Wait for GMII access to complete */
|
|
|
-static int falcon_gmii_wait(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_gmii_wait(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t md_stat;
|
|
|
|
|
|
|
+ ef4_oword_t md_stat;
|
|
|
int count;
|
|
int count;
|
|
|
|
|
|
|
|
/* wait up to 50ms - taken max from datasheet */
|
|
/* wait up to 50ms - taken max from datasheet */
|
|
|
for (count = 0; count < 5000; count++) {
|
|
for (count = 0; count < 5000; count++) {
|
|
|
- efx_reado(efx, &md_stat, FR_AB_MD_STAT);
|
|
|
|
|
- if (EFX_OWORD_FIELD(md_stat, FRF_AB_MD_BSY) == 0) {
|
|
|
|
|
- if (EFX_OWORD_FIELD(md_stat, FRF_AB_MD_LNFL) != 0 ||
|
|
|
|
|
- EFX_OWORD_FIELD(md_stat, FRF_AB_MD_BSERR) != 0) {
|
|
|
|
|
|
|
+ ef4_reado(efx, &md_stat, FR_AB_MD_STAT);
|
|
|
|
|
+ if (EF4_OWORD_FIELD(md_stat, FRF_AB_MD_BSY) == 0) {
|
|
|
|
|
+ if (EF4_OWORD_FIELD(md_stat, FRF_AB_MD_LNFL) != 0 ||
|
|
|
|
|
+ EF4_OWORD_FIELD(md_stat, FRF_AB_MD_BSERR) != 0) {
|
|
|
netif_err(efx, hw, efx->net_dev,
|
|
netif_err(efx, hw, efx->net_dev,
|
|
|
"error from GMII access "
|
|
"error from GMII access "
|
|
|
- EFX_OWORD_FMT"\n",
|
|
|
|
|
- EFX_OWORD_VAL(md_stat));
|
|
|
|
|
|
|
+ EF4_OWORD_FMT"\n",
|
|
|
|
|
+ EF4_OWORD_VAL(md_stat));
|
|
|
return -EIO;
|
|
return -EIO;
|
|
|
}
|
|
}
|
|
|
return 0;
|
|
return 0;
|
|
@@ -1572,9 +1572,9 @@ static int falcon_gmii_wait(struct efx_nic *efx)
|
|
|
static int falcon_mdio_write(struct net_device *net_dev,
|
|
static int falcon_mdio_write(struct net_device *net_dev,
|
|
|
int prtad, int devad, u16 addr, u16 value)
|
|
int prtad, int devad, u16 addr, u16 value)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
+ struct ef4_nic *efx = netdev_priv(net_dev);
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
|
netif_vdbg(efx, hw, efx->net_dev,
|
|
netif_vdbg(efx, hw, efx->net_dev,
|
|
@@ -1589,30 +1589,30 @@ static int falcon_mdio_write(struct net_device *net_dev,
|
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
|
|
/* Write the address/ID register */
|
|
/* Write the address/ID register */
|
|
|
- EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_PHY_ADR);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_PHY_ADR);
|
|
|
|
|
|
|
|
- EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad,
|
|
|
FRF_AB_MD_DEV_ADR, devad);
|
|
FRF_AB_MD_DEV_ADR, devad);
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_ID);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_ID);
|
|
|
|
|
|
|
|
/* Write data */
|
|
/* Write data */
|
|
|
- EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_TXD, value);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_TXD);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(reg, FRF_AB_MD_TXD, value);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_TXD);
|
|
|
|
|
|
|
|
- EFX_POPULATE_OWORD_2(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg,
|
|
|
FRF_AB_MD_WRC, 1,
|
|
FRF_AB_MD_WRC, 1,
|
|
|
FRF_AB_MD_GC, 0);
|
|
FRF_AB_MD_GC, 0);
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
|
|
|
|
|
/* Wait for data to be written */
|
|
/* Wait for data to be written */
|
|
|
rc = falcon_gmii_wait(efx);
|
|
rc = falcon_gmii_wait(efx);
|
|
|
if (rc) {
|
|
if (rc) {
|
|
|
/* Abort the write operation */
|
|
/* Abort the write operation */
|
|
|
- EFX_POPULATE_OWORD_2(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg,
|
|
|
FRF_AB_MD_WRC, 0,
|
|
FRF_AB_MD_WRC, 0,
|
|
|
FRF_AB_MD_GC, 1);
|
|
FRF_AB_MD_GC, 1);
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
udelay(10);
|
|
udelay(10);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1625,9 +1625,9 @@ out:
|
|
|
static int falcon_mdio_read(struct net_device *net_dev,
|
|
static int falcon_mdio_read(struct net_device *net_dev,
|
|
|
int prtad, int devad, u16 addr)
|
|
int prtad, int devad, u16 addr)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = netdev_priv(net_dev);
|
|
|
|
|
|
|
+ struct ef4_nic *efx = netdev_priv(net_dev);
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
|
mutex_lock(&nic_data->mdio_lock);
|
|
mutex_lock(&nic_data->mdio_lock);
|
|
@@ -1637,31 +1637,31 @@ static int falcon_mdio_read(struct net_device *net_dev,
|
|
|
if (rc)
|
|
if (rc)
|
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
|
|
- EFX_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_PHY_ADR);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(reg, FRF_AB_MD_PHY_ADR, addr);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_PHY_ADR);
|
|
|
|
|
|
|
|
- EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg, FRF_AB_MD_PRT_ADR, prtad,
|
|
|
FRF_AB_MD_DEV_ADR, devad);
|
|
FRF_AB_MD_DEV_ADR, devad);
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_ID);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_ID);
|
|
|
|
|
|
|
|
/* Request data to be read */
|
|
/* Request data to be read */
|
|
|
- EFX_POPULATE_OWORD_2(reg, FRF_AB_MD_RDC, 1, FRF_AB_MD_GC, 0);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg, FRF_AB_MD_RDC, 1, FRF_AB_MD_GC, 0);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
|
|
|
|
|
/* Wait for data to become available */
|
|
/* Wait for data to become available */
|
|
|
rc = falcon_gmii_wait(efx);
|
|
rc = falcon_gmii_wait(efx);
|
|
|
if (rc == 0) {
|
|
if (rc == 0) {
|
|
|
- efx_reado(efx, ®, FR_AB_MD_RXD);
|
|
|
|
|
- rc = EFX_OWORD_FIELD(reg, FRF_AB_MD_RXD);
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AB_MD_RXD);
|
|
|
|
|
+ rc = EF4_OWORD_FIELD(reg, FRF_AB_MD_RXD);
|
|
|
netif_vdbg(efx, hw, efx->net_dev,
|
|
netif_vdbg(efx, hw, efx->net_dev,
|
|
|
"read from MDIO %d register %d.%d, got %04x\n",
|
|
"read from MDIO %d register %d.%d, got %04x\n",
|
|
|
prtad, devad, addr, rc);
|
|
prtad, devad, addr, rc);
|
|
|
} else {
|
|
} else {
|
|
|
/* Abort the read operation */
|
|
/* Abort the read operation */
|
|
|
- EFX_POPULATE_OWORD_2(reg,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(reg,
|
|
|
FRF_AB_MD_RIC, 0,
|
|
FRF_AB_MD_RIC, 0,
|
|
|
FRF_AB_MD_GC, 1);
|
|
FRF_AB_MD_GC, 1);
|
|
|
- efx_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AB_MD_CS);
|
|
|
|
|
|
|
|
netif_dbg(efx, hw, efx->net_dev,
|
|
netif_dbg(efx, hw, efx->net_dev,
|
|
|
"read from MDIO %d register %d.%d, got error %d\n",
|
|
"read from MDIO %d register %d.%d, got error %d\n",
|
|
@@ -1674,7 +1674,7 @@ out:
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* This call is responsible for hooking in the MAC and PHY operations */
|
|
/* This call is responsible for hooking in the MAC and PHY operations */
|
|
|
-static int falcon_probe_port(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_probe_port(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
int rc;
|
|
int rc;
|
|
@@ -1709,15 +1709,15 @@ static int falcon_probe_port(struct efx_nic *efx)
|
|
|
efx->link_state.fd = true;
|
|
efx->link_state.fd = true;
|
|
|
|
|
|
|
|
/* Hardware flow ctrl. FalconA RX FIFO too small for pause generation */
|
|
/* Hardware flow ctrl. FalconA RX FIFO too small for pause generation */
|
|
|
- if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0)
|
|
|
|
|
- efx->wanted_fc = EFX_FC_RX | EFX_FC_TX;
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0)
|
|
|
|
|
+ efx->wanted_fc = EF4_FC_RX | EF4_FC_TX;
|
|
|
else
|
|
else
|
|
|
- efx->wanted_fc = EFX_FC_RX;
|
|
|
|
|
|
|
+ efx->wanted_fc = EF4_FC_RX;
|
|
|
if (efx->mdio.mmds & MDIO_DEVS_AN)
|
|
if (efx->mdio.mmds & MDIO_DEVS_AN)
|
|
|
- efx->wanted_fc |= EFX_FC_AUTO;
|
|
|
|
|
|
|
+ efx->wanted_fc |= EF4_FC_AUTO;
|
|
|
|
|
|
|
|
/* Allocate buffer for stats */
|
|
/* Allocate buffer for stats */
|
|
|
- rc = efx_nic_alloc_buffer(efx, &efx->stats_buffer,
|
|
|
|
|
|
|
+ rc = ef4_nic_alloc_buffer(efx, &efx->stats_buffer,
|
|
|
FALCON_MAC_STATS_SIZE, GFP_KERNEL);
|
|
FALCON_MAC_STATS_SIZE, GFP_KERNEL);
|
|
|
if (rc)
|
|
if (rc)
|
|
|
return rc;
|
|
return rc;
|
|
@@ -1730,40 +1730,40 @@ static int falcon_probe_port(struct efx_nic *efx)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_remove_port(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_remove_port(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
efx->phy_op->remove(efx);
|
|
efx->phy_op->remove(efx);
|
|
|
- efx_nic_free_buffer(efx, &efx->stats_buffer);
|
|
|
|
|
|
|
+ ef4_nic_free_buffer(efx, &efx->stats_buffer);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Global events are basically PHY events */
|
|
/* Global events are basically PHY events */
|
|
|
static bool
|
|
static bool
|
|
|
-falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
|
|
|
|
|
|
|
+falcon_handle_global_event(struct ef4_channel *channel, ef4_qword_t *event)
|
|
|
{
|
|
{
|
|
|
- struct efx_nic *efx = channel->efx;
|
|
|
|
|
|
|
+ struct ef4_nic *efx = channel->efx;
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
|
|
|
|
|
- if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) ||
|
|
|
|
|
- EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
|
|
|
|
|
- EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XFP_PHY0_INTR))
|
|
|
|
|
|
|
+ if (EF4_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) ||
|
|
|
|
|
+ EF4_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
|
|
|
|
|
+ EF4_QWORD_FIELD(*event, FSF_AB_GLB_EV_XFP_PHY0_INTR))
|
|
|
/* Ignored */
|
|
/* Ignored */
|
|
|
return true;
|
|
return true;
|
|
|
|
|
|
|
|
- if ((efx_nic_rev(efx) == EFX_REV_FALCON_B0) &&
|
|
|
|
|
- EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
|
|
|
|
|
|
|
+ if ((ef4_nic_rev(efx) == EF4_REV_FALCON_B0) &&
|
|
|
|
|
+ EF4_QWORD_FIELD(*event, FSF_BB_GLB_EV_XG_MGT_INTR)) {
|
|
|
nic_data->xmac_poll_required = true;
|
|
nic_data->xmac_poll_required = true;
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1 ?
|
|
|
|
|
- EFX_QWORD_FIELD(*event, FSF_AA_GLB_EV_RX_RECOVERY) :
|
|
|
|
|
- EFX_QWORD_FIELD(*event, FSF_BB_GLB_EV_RX_RECOVERY)) {
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1 ?
|
|
|
|
|
+ EF4_QWORD_FIELD(*event, FSF_AA_GLB_EV_RX_RECOVERY) :
|
|
|
|
|
+ EF4_QWORD_FIELD(*event, FSF_BB_GLB_EV_RX_RECOVERY)) {
|
|
|
netif_err(efx, rx_err, efx->net_dev,
|
|
netif_err(efx, rx_err, efx->net_dev,
|
|
|
"channel %d seen global RX_RESET event. Resetting.\n",
|
|
"channel %d seen global RX_RESET event. Resetting.\n",
|
|
|
channel->channel);
|
|
channel->channel);
|
|
|
|
|
|
|
|
atomic_inc(&efx->rx_reset);
|
|
atomic_inc(&efx->rx_reset);
|
|
|
- efx_schedule_reset(efx, EFX_WORKAROUND_6555(efx) ?
|
|
|
|
|
|
|
+ ef4_schedule_reset(efx, EF4_WORKAROUND_6555(efx) ?
|
|
|
RESET_TYPE_RX_RECOVERY : RESET_TYPE_DISABLE);
|
|
RESET_TYPE_RX_RECOVERY : RESET_TYPE_DISABLE);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -1778,7 +1778,7 @@ falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)
|
|
|
**************************************************************************/
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
|
|
|
|
|
|
|
+falcon_read_nvram(struct ef4_nic *efx, struct falcon_nvconfig *nvconfig_out)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
struct falcon_nvconfig *nvconfig;
|
|
struct falcon_nvconfig *nvconfig;
|
|
@@ -1849,52 +1849,52 @@ falcon_read_nvram(struct efx_nic *efx, struct falcon_nvconfig *nvconfig_out)
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_test_nvram(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_test_nvram(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
return falcon_read_nvram(efx, NULL);
|
|
return falcon_read_nvram(efx, NULL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static const struct efx_farch_register_test falcon_b0_register_tests[] = {
|
|
|
|
|
|
|
+static const struct ef4_farch_register_test falcon_b0_register_tests[] = {
|
|
|
{ FR_AZ_ADR_REGION,
|
|
{ FR_AZ_ADR_REGION,
|
|
|
- EFX_OWORD32(0x0003FFFF, 0x0003FFFF, 0x0003FFFF, 0x0003FFFF) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x0003FFFF, 0x0003FFFF, 0x0003FFFF, 0x0003FFFF) },
|
|
|
{ FR_AZ_RX_CFG,
|
|
{ FR_AZ_RX_CFG,
|
|
|
- EFX_OWORD32(0xFFFFFFFE, 0x00017FFF, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0xFFFFFFFE, 0x00017FFF, 0x00000000, 0x00000000) },
|
|
|
{ FR_AZ_TX_CFG,
|
|
{ FR_AZ_TX_CFG,
|
|
|
- EFX_OWORD32(0x7FFF0037, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x7FFF0037, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AZ_TX_RESERVED,
|
|
{ FR_AZ_TX_RESERVED,
|
|
|
- EFX_OWORD32(0xFFFEFE80, 0x1FFFFFFF, 0x020000FE, 0x007FFFFF) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0xFFFEFE80, 0x1FFFFFFF, 0x020000FE, 0x007FFFFF) },
|
|
|
{ FR_AB_MAC_CTRL,
|
|
{ FR_AB_MAC_CTRL,
|
|
|
- EFX_OWORD32(0xFFFF0000, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0xFFFF0000, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AZ_SRM_TX_DC_CFG,
|
|
{ FR_AZ_SRM_TX_DC_CFG,
|
|
|
- EFX_OWORD32(0x001FFFFF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x001FFFFF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AZ_RX_DC_CFG,
|
|
{ FR_AZ_RX_DC_CFG,
|
|
|
- EFX_OWORD32(0x0000000F, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x0000000F, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AZ_RX_DC_PF_WM,
|
|
{ FR_AZ_RX_DC_PF_WM,
|
|
|
- EFX_OWORD32(0x000003FF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x000003FF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_BZ_DP_CTRL,
|
|
{ FR_BZ_DP_CTRL,
|
|
|
- EFX_OWORD32(0x00000FFF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x00000FFF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_GM_CFG2,
|
|
{ FR_AB_GM_CFG2,
|
|
|
- EFX_OWORD32(0x00007337, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x00007337, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_GMF_CFG0,
|
|
{ FR_AB_GMF_CFG0,
|
|
|
- EFX_OWORD32(0x00001F1F, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x00001F1F, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_XM_GLB_CFG,
|
|
{ FR_AB_XM_GLB_CFG,
|
|
|
- EFX_OWORD32(0x00000C68, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x00000C68, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_XM_TX_CFG,
|
|
{ FR_AB_XM_TX_CFG,
|
|
|
- EFX_OWORD32(0x00080164, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x00080164, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_XM_RX_CFG,
|
|
{ FR_AB_XM_RX_CFG,
|
|
|
- EFX_OWORD32(0x07100A0C, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x07100A0C, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_XM_RX_PARAM,
|
|
{ FR_AB_XM_RX_PARAM,
|
|
|
- EFX_OWORD32(0x00001FF8, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x00001FF8, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_XM_FC,
|
|
{ FR_AB_XM_FC,
|
|
|
- EFX_OWORD32(0xFFFF0001, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0xFFFF0001, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_XM_ADR_LO,
|
|
{ FR_AB_XM_ADR_LO,
|
|
|
- EFX_OWORD32(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
{ FR_AB_XX_SD_CTL,
|
|
{ FR_AB_XX_SD_CTL,
|
|
|
- EFX_OWORD32(0x0003FF0F, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
|
|
|
|
+ EF4_OWORD32(0x0003FF0F, 0x00000000, 0x00000000, 0x00000000) },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-falcon_b0_test_chip(struct efx_nic *efx, struct efx_self_tests *tests)
|
|
|
|
|
|
|
+falcon_b0_test_chip(struct ef4_nic *efx, struct ef4_self_tests *tests)
|
|
|
{
|
|
{
|
|
|
enum reset_type reset_method = RESET_TYPE_INVISIBLE;
|
|
enum reset_type reset_method = RESET_TYPE_INVISIBLE;
|
|
|
int rc, rc2;
|
|
int rc, rc2;
|
|
@@ -1908,18 +1908,18 @@ falcon_b0_test_chip(struct efx_nic *efx, struct efx_self_tests *tests)
|
|
|
else
|
|
else
|
|
|
efx->loopback_mode = __ffs(efx->loopback_modes);
|
|
efx->loopback_mode = __ffs(efx->loopback_modes);
|
|
|
}
|
|
}
|
|
|
- __efx_reconfigure_port(efx);
|
|
|
|
|
|
|
+ __ef4_reconfigure_port(efx);
|
|
|
mutex_unlock(&efx->mac_lock);
|
|
mutex_unlock(&efx->mac_lock);
|
|
|
|
|
|
|
|
- efx_reset_down(efx, reset_method);
|
|
|
|
|
|
|
+ ef4_reset_down(efx, reset_method);
|
|
|
|
|
|
|
|
tests->registers =
|
|
tests->registers =
|
|
|
- efx_farch_test_registers(efx, falcon_b0_register_tests,
|
|
|
|
|
|
|
+ ef4_farch_test_registers(efx, falcon_b0_register_tests,
|
|
|
ARRAY_SIZE(falcon_b0_register_tests))
|
|
ARRAY_SIZE(falcon_b0_register_tests))
|
|
|
? -1 : 1;
|
|
? -1 : 1;
|
|
|
|
|
|
|
|
rc = falcon_reset_hw(efx, reset_method);
|
|
rc = falcon_reset_hw(efx, reset_method);
|
|
|
- rc2 = efx_reset_up(efx, reset_method, rc == 0);
|
|
|
|
|
|
|
+ rc2 = ef4_reset_up(efx, reset_method, rc == 0);
|
|
|
return rc ? rc : rc2;
|
|
return rc ? rc : rc2;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1974,10 +1974,10 @@ static int falcon_map_reset_flags(u32 *flags)
|
|
|
|
|
|
|
|
/* Resets NIC to known state. This routine must be called in process
|
|
/* Resets NIC to known state. This routine must be called in process
|
|
|
* context and is allowed to sleep. */
|
|
* context and is allowed to sleep. */
|
|
|
-static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
|
|
|
|
|
|
|
+static int __falcon_reset_hw(struct ef4_nic *efx, enum reset_type method)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t glb_ctl_reg_ker;
|
|
|
|
|
|
|
+ ef4_oword_t glb_ctl_reg_ker;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
|
netif_dbg(efx, hw, efx->net_dev, "performing %s hardware reset\n",
|
|
netif_dbg(efx, hw, efx->net_dev, "performing %s hardware reset\n",
|
|
@@ -1992,7 +1992,7 @@ static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
|
|
|
"function prior to hardware reset\n");
|
|
"function prior to hardware reset\n");
|
|
|
goto fail1;
|
|
goto fail1;
|
|
|
}
|
|
}
|
|
|
- if (efx_nic_is_dual_func(efx)) {
|
|
|
|
|
|
|
+ if (ef4_nic_is_dual_func(efx)) {
|
|
|
rc = pci_save_state(nic_data->pci_dev2);
|
|
rc = pci_save_state(nic_data->pci_dev2);
|
|
|
if (rc) {
|
|
if (rc) {
|
|
|
netif_err(efx, drv, efx->net_dev,
|
|
netif_err(efx, drv, efx->net_dev,
|
|
@@ -2003,12 +2003,12 @@ static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- EFX_POPULATE_OWORD_2(glb_ctl_reg_ker,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(glb_ctl_reg_ker,
|
|
|
FRF_AB_EXT_PHY_RST_DUR,
|
|
FRF_AB_EXT_PHY_RST_DUR,
|
|
|
FFE_AB_EXT_PHY_RST_DUR_10240US,
|
|
FFE_AB_EXT_PHY_RST_DUR_10240US,
|
|
|
FRF_AB_SWRST, 1);
|
|
FRF_AB_SWRST, 1);
|
|
|
} else {
|
|
} else {
|
|
|
- EFX_POPULATE_OWORD_7(glb_ctl_reg_ker,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_7(glb_ctl_reg_ker,
|
|
|
/* exclude PHY from "invisible" reset */
|
|
/* exclude PHY from "invisible" reset */
|
|
|
FRF_AB_EXT_PHY_RST_CTL,
|
|
FRF_AB_EXT_PHY_RST_CTL,
|
|
|
method == RESET_TYPE_INVISIBLE,
|
|
method == RESET_TYPE_INVISIBLE,
|
|
@@ -2021,14 +2021,14 @@ static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
|
|
|
FFE_AB_EXT_PHY_RST_DUR_10240US,
|
|
FFE_AB_EXT_PHY_RST_DUR_10240US,
|
|
|
FRF_AB_SWRST, 1);
|
|
FRF_AB_SWRST, 1);
|
|
|
}
|
|
}
|
|
|
- efx_writeo(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL);
|
|
|
|
|
|
|
+ ef4_writeo(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL);
|
|
|
|
|
|
|
|
netif_dbg(efx, hw, efx->net_dev, "waiting for hardware reset\n");
|
|
netif_dbg(efx, hw, efx->net_dev, "waiting for hardware reset\n");
|
|
|
schedule_timeout_uninterruptible(HZ / 20);
|
|
schedule_timeout_uninterruptible(HZ / 20);
|
|
|
|
|
|
|
|
/* Restore PCI configuration if needed */
|
|
/* Restore PCI configuration if needed */
|
|
|
if (method == RESET_TYPE_WORLD) {
|
|
if (method == RESET_TYPE_WORLD) {
|
|
|
- if (efx_nic_is_dual_func(efx))
|
|
|
|
|
|
|
+ if (ef4_nic_is_dual_func(efx))
|
|
|
pci_restore_state(nic_data->pci_dev2);
|
|
pci_restore_state(nic_data->pci_dev2);
|
|
|
pci_restore_state(efx->pci_dev);
|
|
pci_restore_state(efx->pci_dev);
|
|
|
netif_dbg(efx, drv, efx->net_dev,
|
|
netif_dbg(efx, drv, efx->net_dev,
|
|
@@ -2036,8 +2036,8 @@ static int __falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Assert that reset complete */
|
|
/* Assert that reset complete */
|
|
|
- efx_reado(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL);
|
|
|
|
|
- if (EFX_OWORD_FIELD(glb_ctl_reg_ker, FRF_AB_SWRST) != 0) {
|
|
|
|
|
|
|
+ ef4_reado(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL);
|
|
|
|
|
+ if (EF4_OWORD_FIELD(glb_ctl_reg_ker, FRF_AB_SWRST) != 0) {
|
|
|
rc = -ETIMEDOUT;
|
|
rc = -ETIMEDOUT;
|
|
|
netif_err(efx, hw, efx->net_dev,
|
|
netif_err(efx, hw, efx->net_dev,
|
|
|
"timed out waiting for hardware reset\n");
|
|
"timed out waiting for hardware reset\n");
|
|
@@ -2055,7 +2055,7 @@ fail3:
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
|
|
|
|
|
|
|
+static int falcon_reset_hw(struct ef4_nic *efx, enum reset_type method)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
int rc;
|
|
int rc;
|
|
@@ -2067,7 +2067,7 @@ static int falcon_reset_hw(struct efx_nic *efx, enum reset_type method)
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_monitor(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_monitor(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
bool link_changed;
|
|
bool link_changed;
|
|
|
int rc;
|
|
int rc;
|
|
@@ -2080,7 +2080,7 @@ static void falcon_monitor(struct efx_nic *efx)
|
|
|
"Board sensor %s; shutting down PHY\n",
|
|
"Board sensor %s; shutting down PHY\n",
|
|
|
(rc == -ERANGE) ? "reported fault" : "failed");
|
|
(rc == -ERANGE) ? "reported fault" : "failed");
|
|
|
efx->phy_mode |= PHY_MODE_LOW_POWER;
|
|
efx->phy_mode |= PHY_MODE_LOW_POWER;
|
|
|
- rc = __efx_reconfigure_port(efx);
|
|
|
|
|
|
|
+ rc = __ef4_reconfigure_port(efx);
|
|
|
WARN_ON(rc);
|
|
WARN_ON(rc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2099,7 +2099,7 @@ static void falcon_monitor(struct efx_nic *efx)
|
|
|
|
|
|
|
|
falcon_start_nic_stats(efx);
|
|
falcon_start_nic_stats(efx);
|
|
|
|
|
|
|
|
- efx_link_status_changed(efx);
|
|
|
|
|
|
|
+ ef4_link_status_changed(efx);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
falcon_poll_xmac(efx);
|
|
falcon_poll_xmac(efx);
|
|
@@ -2108,22 +2108,22 @@ static void falcon_monitor(struct efx_nic *efx)
|
|
|
/* Zeroes out the SRAM contents. This routine must be called in
|
|
/* Zeroes out the SRAM contents. This routine must be called in
|
|
|
* process context and is allowed to sleep.
|
|
* process context and is allowed to sleep.
|
|
|
*/
|
|
*/
|
|
|
-static int falcon_reset_sram(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_reset_sram(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t srm_cfg_reg_ker, gpio_cfg_reg_ker;
|
|
|
|
|
|
|
+ ef4_oword_t srm_cfg_reg_ker, gpio_cfg_reg_ker;
|
|
|
int count;
|
|
int count;
|
|
|
|
|
|
|
|
/* Set the SRAM wake/sleep GPIO appropriately. */
|
|
/* Set the SRAM wake/sleep GPIO appropriately. */
|
|
|
- efx_reado(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OEN, 1);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OUT, 1);
|
|
|
|
|
- efx_writeo(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL);
|
|
|
|
|
|
|
+ ef4_reado(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OEN, 1);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(gpio_cfg_reg_ker, FRF_AB_GPIO1_OUT, 1);
|
|
|
|
|
+ ef4_writeo(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL);
|
|
|
|
|
|
|
|
/* Initiate SRAM reset */
|
|
/* Initiate SRAM reset */
|
|
|
- EFX_POPULATE_OWORD_2(srm_cfg_reg_ker,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_2(srm_cfg_reg_ker,
|
|
|
FRF_AZ_SRM_INIT_EN, 1,
|
|
FRF_AZ_SRM_INIT_EN, 1,
|
|
|
FRF_AZ_SRM_NB_SZ, 0);
|
|
FRF_AZ_SRM_NB_SZ, 0);
|
|
|
- efx_writeo(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG);
|
|
|
|
|
|
|
+ ef4_writeo(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG);
|
|
|
|
|
|
|
|
/* Wait for SRAM reset to complete */
|
|
/* Wait for SRAM reset to complete */
|
|
|
count = 0;
|
|
count = 0;
|
|
@@ -2135,8 +2135,8 @@ static int falcon_reset_sram(struct efx_nic *efx)
|
|
|
schedule_timeout_uninterruptible(HZ / 50);
|
|
schedule_timeout_uninterruptible(HZ / 50);
|
|
|
|
|
|
|
|
/* Check for reset complete */
|
|
/* Check for reset complete */
|
|
|
- efx_reado(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG);
|
|
|
|
|
- if (!EFX_OWORD_FIELD(srm_cfg_reg_ker, FRF_AZ_SRM_INIT_EN)) {
|
|
|
|
|
|
|
+ ef4_reado(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG);
|
|
|
|
|
+ if (!EF4_OWORD_FIELD(srm_cfg_reg_ker, FRF_AZ_SRM_INIT_EN)) {
|
|
|
netif_dbg(efx, hw, efx->net_dev,
|
|
netif_dbg(efx, hw, efx->net_dev,
|
|
|
"SRAM reset complete\n");
|
|
"SRAM reset complete\n");
|
|
|
|
|
|
|
@@ -2148,7 +2148,7 @@ static int falcon_reset_sram(struct efx_nic *efx)
|
|
|
return -ETIMEDOUT;
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_spi_device_init(struct efx_nic *efx,
|
|
|
|
|
|
|
+static void falcon_spi_device_init(struct ef4_nic *efx,
|
|
|
struct falcon_spi_device *spi_device,
|
|
struct falcon_spi_device *spi_device,
|
|
|
unsigned int device_id, u32 device_type)
|
|
unsigned int device_id, u32 device_type)
|
|
|
{
|
|
{
|
|
@@ -2174,7 +2174,7 @@ static void falcon_spi_device_init(struct efx_nic *efx,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Extract non-volatile configuration */
|
|
/* Extract non-volatile configuration */
|
|
|
-static int falcon_probe_nvconfig(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_probe_nvconfig(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
struct falcon_nvconfig *nvconfig;
|
|
struct falcon_nvconfig *nvconfig;
|
|
@@ -2215,7 +2215,7 @@ out:
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_dimension_resources(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_dimension_resources(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
efx->rx_dc_base = 0x20000;
|
|
efx->rx_dc_base = 0x20000;
|
|
|
efx->tx_dc_base = 0x26000;
|
|
efx->tx_dc_base = 0x26000;
|
|
@@ -2223,18 +2223,18 @@ static int falcon_dimension_resources(struct efx_nic *efx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Probe all SPI devices on the NIC */
|
|
/* Probe all SPI devices on the NIC */
|
|
|
-static void falcon_probe_spi_devices(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_probe_spi_devices(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
- efx_oword_t nic_stat, gpio_ctl, ee_vpd_cfg;
|
|
|
|
|
|
|
+ ef4_oword_t nic_stat, gpio_ctl, ee_vpd_cfg;
|
|
|
int boot_dev;
|
|
int boot_dev;
|
|
|
|
|
|
|
|
- efx_reado(efx, &gpio_ctl, FR_AB_GPIO_CTL);
|
|
|
|
|
- efx_reado(efx, &nic_stat, FR_AB_NIC_STAT);
|
|
|
|
|
- efx_reado(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0);
|
|
|
|
|
|
|
+ ef4_reado(efx, &gpio_ctl, FR_AB_GPIO_CTL);
|
|
|
|
|
+ ef4_reado(efx, &nic_stat, FR_AB_NIC_STAT);
|
|
|
|
|
+ ef4_reado(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0);
|
|
|
|
|
|
|
|
- if (EFX_OWORD_FIELD(gpio_ctl, FRF_AB_GPIO3_PWRUP_VALUE)) {
|
|
|
|
|
- boot_dev = (EFX_OWORD_FIELD(nic_stat, FRF_AB_SF_PRST) ?
|
|
|
|
|
|
|
+ if (EF4_OWORD_FIELD(gpio_ctl, FRF_AB_GPIO3_PWRUP_VALUE)) {
|
|
|
|
|
+ boot_dev = (EF4_OWORD_FIELD(nic_stat, FRF_AB_SF_PRST) ?
|
|
|
FFE_AB_SPI_DEVICE_FLASH : FFE_AB_SPI_DEVICE_EEPROM);
|
|
FFE_AB_SPI_DEVICE_FLASH : FFE_AB_SPI_DEVICE_EEPROM);
|
|
|
netif_dbg(efx, probe, efx->net_dev, "Booted from %s\n",
|
|
netif_dbg(efx, probe, efx->net_dev, "Booted from %s\n",
|
|
|
boot_dev == FFE_AB_SPI_DEVICE_FLASH ?
|
|
boot_dev == FFE_AB_SPI_DEVICE_FLASH ?
|
|
@@ -2246,12 +2246,12 @@ static void falcon_probe_spi_devices(struct efx_nic *efx)
|
|
|
netif_dbg(efx, probe, efx->net_dev,
|
|
netif_dbg(efx, probe, efx->net_dev,
|
|
|
"Booted from internal ASIC settings;"
|
|
"Booted from internal ASIC settings;"
|
|
|
" setting SPI config\n");
|
|
" setting SPI config\n");
|
|
|
- EFX_POPULATE_OWORD_3(ee_vpd_cfg, FRF_AB_EE_VPD_EN, 0,
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_3(ee_vpd_cfg, FRF_AB_EE_VPD_EN, 0,
|
|
|
/* 125 MHz / 7 ~= 20 MHz */
|
|
/* 125 MHz / 7 ~= 20 MHz */
|
|
|
FRF_AB_EE_SF_CLOCK_DIV, 7,
|
|
FRF_AB_EE_SF_CLOCK_DIV, 7,
|
|
|
/* 125 MHz / 63 ~= 2 MHz */
|
|
/* 125 MHz / 63 ~= 2 MHz */
|
|
|
FRF_AB_EE_EE_CLOCK_DIV, 63);
|
|
FRF_AB_EE_EE_CLOCK_DIV, 63);
|
|
|
- efx_writeo(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0);
|
|
|
|
|
|
|
+ ef4_writeo(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
mutex_init(&nic_data->spi_lock);
|
|
mutex_init(&nic_data->spi_lock);
|
|
@@ -2266,12 +2266,12 @@ static void falcon_probe_spi_devices(struct efx_nic *efx)
|
|
|
large_eeprom_type);
|
|
large_eeprom_type);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static unsigned int falcon_a1_mem_map_size(struct efx_nic *efx)
|
|
|
|
|
|
|
+static unsigned int falcon_a1_mem_map_size(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
return 0x20000;
|
|
return 0x20000;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static unsigned int falcon_b0_mem_map_size(struct efx_nic *efx)
|
|
|
|
|
|
|
+static unsigned int falcon_b0_mem_map_size(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
/* Map everything up to and including the RSS indirection table.
|
|
/* Map everything up to and including the RSS indirection table.
|
|
|
* The PCI core takes care of mapping the MSI-X tables.
|
|
* The PCI core takes care of mapping the MSI-X tables.
|
|
@@ -2280,7 +2280,7 @@ static unsigned int falcon_b0_mem_map_size(struct efx_nic *efx)
|
|
|
FR_BZ_RX_INDIRECTION_TBL_STEP * FR_BZ_RX_INDIRECTION_TBL_ROWS;
|
|
FR_BZ_RX_INDIRECTION_TBL_STEP * FR_BZ_RX_INDIRECTION_TBL_ROWS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_probe_nic(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_probe_nic(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data;
|
|
struct falcon_nic_data *nic_data;
|
|
|
struct falcon_board *board;
|
|
struct falcon_board *board;
|
|
@@ -2296,14 +2296,14 @@ static int falcon_probe_nic(struct efx_nic *efx)
|
|
|
|
|
|
|
|
rc = -ENODEV;
|
|
rc = -ENODEV;
|
|
|
|
|
|
|
|
- if (efx_farch_fpga_ver(efx) != 0) {
|
|
|
|
|
|
|
+ if (ef4_farch_fpga_ver(efx) != 0) {
|
|
|
netif_err(efx, probe, efx->net_dev,
|
|
netif_err(efx, probe, efx->net_dev,
|
|
|
"Falcon FPGA not supported\n");
|
|
"Falcon FPGA not supported\n");
|
|
|
goto fail1;
|
|
goto fail1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) {
|
|
|
|
|
- efx_oword_t nic_stat;
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1) {
|
|
|
|
|
+ ef4_oword_t nic_stat;
|
|
|
struct pci_dev *dev;
|
|
struct pci_dev *dev;
|
|
|
u8 pci_rev = efx->pci_dev->revision;
|
|
u8 pci_rev = efx->pci_dev->revision;
|
|
|
|
|
|
|
@@ -2312,13 +2312,13 @@ static int falcon_probe_nic(struct efx_nic *efx)
|
|
|
"Falcon rev A0 not supported\n");
|
|
"Falcon rev A0 not supported\n");
|
|
|
goto fail1;
|
|
goto fail1;
|
|
|
}
|
|
}
|
|
|
- efx_reado(efx, &nic_stat, FR_AB_NIC_STAT);
|
|
|
|
|
- if (EFX_OWORD_FIELD(nic_stat, FRF_AB_STRAP_10G) == 0) {
|
|
|
|
|
|
|
+ ef4_reado(efx, &nic_stat, FR_AB_NIC_STAT);
|
|
|
|
|
+ if (EF4_OWORD_FIELD(nic_stat, FRF_AB_STRAP_10G) == 0) {
|
|
|
netif_err(efx, probe, efx->net_dev,
|
|
netif_err(efx, probe, efx->net_dev,
|
|
|
"Falcon rev A1 1G not supported\n");
|
|
"Falcon rev A1 1G not supported\n");
|
|
|
goto fail1;
|
|
goto fail1;
|
|
|
}
|
|
}
|
|
|
- if (EFX_OWORD_FIELD(nic_stat, FRF_AA_STRAP_PCIE) == 0) {
|
|
|
|
|
|
|
+ if (EF4_OWORD_FIELD(nic_stat, FRF_AA_STRAP_PCIE) == 0) {
|
|
|
netif_err(efx, probe, efx->net_dev,
|
|
netif_err(efx, probe, efx->net_dev,
|
|
|
"Falcon rev A1 PCI-X not supported\n");
|
|
"Falcon rev A1 PCI-X not supported\n");
|
|
|
goto fail1;
|
|
goto fail1;
|
|
@@ -2350,7 +2350,7 @@ static int falcon_probe_nic(struct efx_nic *efx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Allocate memory for INT_KER */
|
|
/* Allocate memory for INT_KER */
|
|
|
- rc = efx_nic_alloc_buffer(efx, &efx->irq_status, sizeof(efx_oword_t),
|
|
|
|
|
|
|
+ rc = ef4_nic_alloc_buffer(efx, &efx->irq_status, sizeof(ef4_oword_t),
|
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
|
if (rc)
|
|
if (rc)
|
|
|
goto fail4;
|
|
goto fail4;
|
|
@@ -2372,8 +2372,8 @@ static int falcon_probe_nic(struct efx_nic *efx)
|
|
|
goto fail5;
|
|
goto fail5;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- efx->max_channels = (efx_nic_rev(efx) <= EFX_REV_FALCON_A1 ? 4 :
|
|
|
|
|
- EFX_MAX_CHANNELS);
|
|
|
|
|
|
|
+ efx->max_channels = (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1 ? 4 :
|
|
|
|
|
+ EF4_MAX_CHANNELS);
|
|
|
efx->max_tx_channels = efx->max_channels;
|
|
efx->max_tx_channels = efx->max_channels;
|
|
|
efx->timer_quantum_ns = 4968; /* 621 cycles */
|
|
efx->timer_quantum_ns = 4968; /* 621 cycles */
|
|
|
efx->timer_max_ns = efx->type->timer_period_max *
|
|
efx->timer_max_ns = efx->type->timer_period_max *
|
|
@@ -2409,7 +2409,7 @@ static int falcon_probe_nic(struct efx_nic *efx)
|
|
|
i2c_del_adapter(&board->i2c_adap);
|
|
i2c_del_adapter(&board->i2c_adap);
|
|
|
memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
|
|
memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
|
|
|
fail5:
|
|
fail5:
|
|
|
- efx_nic_free_buffer(efx, &efx->irq_status);
|
|
|
|
|
|
|
+ ef4_nic_free_buffer(efx, &efx->irq_status);
|
|
|
fail4:
|
|
fail4:
|
|
|
fail3:
|
|
fail3:
|
|
|
if (nic_data->pci_dev2) {
|
|
if (nic_data->pci_dev2) {
|
|
@@ -2422,66 +2422,66 @@ static int falcon_probe_nic(struct efx_nic *efx)
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_init_rx_cfg(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_init_rx_cfg(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
/* RX control FIFO thresholds (32 entries) */
|
|
/* RX control FIFO thresholds (32 entries) */
|
|
|
const unsigned ctrl_xon_thr = 20;
|
|
const unsigned ctrl_xon_thr = 20;
|
|
|
const unsigned ctrl_xoff_thr = 25;
|
|
const unsigned ctrl_xoff_thr = 25;
|
|
|
- efx_oword_t reg;
|
|
|
|
|
|
|
+ ef4_oword_t reg;
|
|
|
|
|
|
|
|
- efx_reado(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
- if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) {
|
|
|
|
|
|
|
+ ef4_reado(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
+ if (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1) {
|
|
|
/* Data FIFO size is 5.5K. The RX DMA engine only
|
|
/* Data FIFO size is 5.5K. The RX DMA engine only
|
|
|
* supports scattering for user-mode queues, but will
|
|
* supports scattering for user-mode queues, but will
|
|
|
* split DMA writes at intervals of RX_USR_BUF_SIZE
|
|
* split DMA writes at intervals of RX_USR_BUF_SIZE
|
|
|
* (32-byte units) even for kernel-mode queues. We
|
|
* (32-byte units) even for kernel-mode queues. We
|
|
|
* set it to be so large that that never happens.
|
|
* set it to be so large that that never happens.
|
|
|
*/
|
|
*/
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE,
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE,
|
|
|
(3 * 4096) >> 5);
|
|
(3 * 4096) >> 5);
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, 512 >> 8);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, 2048 >> 8);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_TX_TH, ctrl_xoff_thr);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, 512 >> 8);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, 2048 >> 8);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_TX_TH, ctrl_xoff_thr);
|
|
|
} else {
|
|
} else {
|
|
|
/* Data FIFO size is 80K; register fields moved */
|
|
/* Data FIFO size is 80K; register fields moved */
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE,
|
|
|
|
|
- EFX_RX_USR_BUF_SIZE >> 5);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE,
|
|
|
|
|
+ EF4_RX_USR_BUF_SIZE >> 5);
|
|
|
/* Send XON and XOFF at ~3 * max MTU away from empty/full */
|
|
/* Send XON and XOFF at ~3 * max MTU away from empty/full */
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, 27648 >> 8);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, 54272 >> 8);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, 27648 >> 8);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, 54272 >> 8);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1);
|
|
|
|
|
|
|
|
/* Enable hash insertion. This is broken for the
|
|
/* Enable hash insertion. This is broken for the
|
|
|
* 'Falcon' hash so also select Toeplitz TCP/IPv4 and
|
|
* 'Falcon' hash so also select Toeplitz TCP/IPv4 and
|
|
|
* IPv4 hashes. */
|
|
* IPv4 hashes. */
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_HASH_INSRT_HDR, 1);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_HASH_ALG, 1);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_IP_HASH, 1);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_HASH_INSRT_HDR, 1);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_HASH_ALG, 1);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_BZ_RX_IP_HASH, 1);
|
|
|
}
|
|
}
|
|
|
/* Always enable XOFF signal from RX FIFO. We enable
|
|
/* Always enable XOFF signal from RX FIFO. We enable
|
|
|
* or disable transmission of pause frames at the MAC. */
|
|
* or disable transmission of pause frames at the MAC. */
|
|
|
- EFX_SET_OWORD_FIELD(reg, FRF_AZ_RX_XOFF_MAC_EN, 1);
|
|
|
|
|
- efx_writeo(efx, ®, FR_AZ_RX_CFG);
|
|
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(reg, FRF_AZ_RX_XOFF_MAC_EN, 1);
|
|
|
|
|
+ ef4_writeo(efx, ®, FR_AZ_RX_CFG);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* This call performs hardware-specific global initialisation, such as
|
|
/* This call performs hardware-specific global initialisation, such as
|
|
|
* defining the descriptor cache sizes and number of RSS channels.
|
|
* defining the descriptor cache sizes and number of RSS channels.
|
|
|
* It does not set up any buffers, descriptor rings or event queues.
|
|
* It does not set up any buffers, descriptor rings or event queues.
|
|
|
*/
|
|
*/
|
|
|
-static int falcon_init_nic(struct efx_nic *efx)
|
|
|
|
|
|
|
+static int falcon_init_nic(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
- efx_oword_t temp;
|
|
|
|
|
|
|
+ ef4_oword_t temp;
|
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
|
|
/* Use on-chip SRAM */
|
|
/* Use on-chip SRAM */
|
|
|
- efx_reado(efx, &temp, FR_AB_NIC_STAT);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_AB_ONCHIP_SRAM, 1);
|
|
|
|
|
- efx_writeo(efx, &temp, FR_AB_NIC_STAT);
|
|
|
|
|
|
|
+ ef4_reado(efx, &temp, FR_AB_NIC_STAT);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_AB_ONCHIP_SRAM, 1);
|
|
|
|
|
+ ef4_writeo(efx, &temp, FR_AB_NIC_STAT);
|
|
|
|
|
|
|
|
rc = falcon_reset_sram(efx);
|
|
rc = falcon_reset_sram(efx);
|
|
|
if (rc)
|
|
if (rc)
|
|
@@ -2490,55 +2490,55 @@ static int falcon_init_nic(struct efx_nic *efx)
|
|
|
/* Clear the parity enables on the TX data fifos as
|
|
/* Clear the parity enables on the TX data fifos as
|
|
|
* they produce false parity errors because of timing issues
|
|
* they produce false parity errors because of timing issues
|
|
|
*/
|
|
*/
|
|
|
- if (EFX_WORKAROUND_5129(efx)) {
|
|
|
|
|
- efx_reado(efx, &temp, FR_AZ_CSR_SPARE);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_AB_MEM_PERR_EN_TX_DATA, 0);
|
|
|
|
|
- efx_writeo(efx, &temp, FR_AZ_CSR_SPARE);
|
|
|
|
|
|
|
+ if (EF4_WORKAROUND_5129(efx)) {
|
|
|
|
|
+ ef4_reado(efx, &temp, FR_AZ_CSR_SPARE);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_AB_MEM_PERR_EN_TX_DATA, 0);
|
|
|
|
|
+ ef4_writeo(efx, &temp, FR_AZ_CSR_SPARE);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (EFX_WORKAROUND_7244(efx)) {
|
|
|
|
|
- efx_reado(efx, &temp, FR_BZ_RX_FILTER_CTL);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_BZ_UDP_FULL_SRCH_LIMIT, 8);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_BZ_UDP_WILD_SRCH_LIMIT, 8);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_BZ_TCP_FULL_SRCH_LIMIT, 8);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_BZ_TCP_WILD_SRCH_LIMIT, 8);
|
|
|
|
|
- efx_writeo(efx, &temp, FR_BZ_RX_FILTER_CTL);
|
|
|
|
|
|
|
+ if (EF4_WORKAROUND_7244(efx)) {
|
|
|
|
|
+ ef4_reado(efx, &temp, FR_BZ_RX_FILTER_CTL);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_BZ_UDP_FULL_SRCH_LIMIT, 8);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_BZ_UDP_WILD_SRCH_LIMIT, 8);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_BZ_TCP_FULL_SRCH_LIMIT, 8);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_BZ_TCP_WILD_SRCH_LIMIT, 8);
|
|
|
|
|
+ ef4_writeo(efx, &temp, FR_BZ_RX_FILTER_CTL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* XXX This is documented only for Falcon A0/A1 */
|
|
/* XXX This is documented only for Falcon A0/A1 */
|
|
|
/* Setup RX. Wait for descriptor is broken and must
|
|
/* Setup RX. Wait for descriptor is broken and must
|
|
|
* be disabled. RXDP recovery shouldn't be needed, but is.
|
|
* be disabled. RXDP recovery shouldn't be needed, but is.
|
|
|
*/
|
|
*/
|
|
|
- efx_reado(efx, &temp, FR_AA_RX_SELF_RST);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_NODESC_WAIT_DIS, 1);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_SELF_RST_EN, 1);
|
|
|
|
|
- if (EFX_WORKAROUND_5583(efx))
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_AA_RX_ISCSI_DIS, 1);
|
|
|
|
|
- efx_writeo(efx, &temp, FR_AA_RX_SELF_RST);
|
|
|
|
|
|
|
+ ef4_reado(efx, &temp, FR_AA_RX_SELF_RST);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_AA_RX_NODESC_WAIT_DIS, 1);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_AA_RX_SELF_RST_EN, 1);
|
|
|
|
|
+ if (EF4_WORKAROUND_5583(efx))
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_AA_RX_ISCSI_DIS, 1);
|
|
|
|
|
+ ef4_writeo(efx, &temp, FR_AA_RX_SELF_RST);
|
|
|
|
|
|
|
|
/* Do not enable TX_NO_EOP_DISC_EN, since it limits packets to 16
|
|
/* Do not enable TX_NO_EOP_DISC_EN, since it limits packets to 16
|
|
|
* descriptors (which is bad).
|
|
* descriptors (which is bad).
|
|
|
*/
|
|
*/
|
|
|
- efx_reado(efx, &temp, FR_AZ_TX_CFG);
|
|
|
|
|
- EFX_SET_OWORD_FIELD(temp, FRF_AZ_TX_NO_EOP_DISC_EN, 0);
|
|
|
|
|
- efx_writeo(efx, &temp, FR_AZ_TX_CFG);
|
|
|
|
|
|
|
+ ef4_reado(efx, &temp, FR_AZ_TX_CFG);
|
|
|
|
|
+ EF4_SET_OWORD_FIELD(temp, FRF_AZ_TX_NO_EOP_DISC_EN, 0);
|
|
|
|
|
+ ef4_writeo(efx, &temp, FR_AZ_TX_CFG);
|
|
|
|
|
|
|
|
falcon_init_rx_cfg(efx);
|
|
falcon_init_rx_cfg(efx);
|
|
|
|
|
|
|
|
- if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) {
|
|
|
|
|
|
|
+ if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) {
|
|
|
falcon_b0_rx_push_rss_config(efx, false, efx->rx_indir_table);
|
|
falcon_b0_rx_push_rss_config(efx, false, efx->rx_indir_table);
|
|
|
|
|
|
|
|
/* Set destination of both TX and RX Flush events */
|
|
/* Set destination of both TX and RX Flush events */
|
|
|
- EFX_POPULATE_OWORD_1(temp, FRF_BZ_FLS_EVQ_ID, 0);
|
|
|
|
|
- efx_writeo(efx, &temp, FR_BZ_DP_CTRL);
|
|
|
|
|
|
|
+ EF4_POPULATE_OWORD_1(temp, FRF_BZ_FLS_EVQ_ID, 0);
|
|
|
|
|
+ ef4_writeo(efx, &temp, FR_BZ_DP_CTRL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- efx_farch_init_common(efx);
|
|
|
|
|
|
|
+ ef4_farch_init_common(efx);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_remove_nic(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_remove_nic(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
struct falcon_board *board = falcon_board(efx);
|
|
struct falcon_board *board = falcon_board(efx);
|
|
@@ -2549,7 +2549,7 @@ static void falcon_remove_nic(struct efx_nic *efx)
|
|
|
i2c_del_adapter(&board->i2c_adap);
|
|
i2c_del_adapter(&board->i2c_adap);
|
|
|
memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
|
|
memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
|
|
|
|
|
|
|
|
- efx_nic_free_buffer(efx, &efx->irq_status);
|
|
|
|
|
|
|
+ ef4_nic_free_buffer(efx, &efx->irq_status);
|
|
|
|
|
|
|
|
__falcon_reset_hw(efx, RESET_TYPE_ALL);
|
|
__falcon_reset_hw(efx, RESET_TYPE_ALL);
|
|
|
|
|
|
|
@@ -2564,40 +2564,40 @@ static void falcon_remove_nic(struct efx_nic *efx)
|
|
|
efx->nic_data = NULL;
|
|
efx->nic_data = NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static size_t falcon_describe_nic_stats(struct efx_nic *efx, u8 *names)
|
|
|
|
|
|
|
+static size_t falcon_describe_nic_stats(struct ef4_nic *efx, u8 *names)
|
|
|
{
|
|
{
|
|
|
- return efx_nic_describe_stats(falcon_stat_desc, FALCON_STAT_COUNT,
|
|
|
|
|
|
|
+ return ef4_nic_describe_stats(falcon_stat_desc, FALCON_STAT_COUNT,
|
|
|
falcon_stat_mask, names);
|
|
falcon_stat_mask, names);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static size_t falcon_update_nic_stats(struct efx_nic *efx, u64 *full_stats,
|
|
|
|
|
|
|
+static size_t falcon_update_nic_stats(struct ef4_nic *efx, u64 *full_stats,
|
|
|
struct rtnl_link_stats64 *core_stats)
|
|
struct rtnl_link_stats64 *core_stats)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
u64 *stats = nic_data->stats;
|
|
u64 *stats = nic_data->stats;
|
|
|
- efx_oword_t cnt;
|
|
|
|
|
|
|
+ ef4_oword_t cnt;
|
|
|
|
|
|
|
|
if (!nic_data->stats_disable_count) {
|
|
if (!nic_data->stats_disable_count) {
|
|
|
- efx_reado(efx, &cnt, FR_AZ_RX_NODESC_DROP);
|
|
|
|
|
|
|
+ ef4_reado(efx, &cnt, FR_AZ_RX_NODESC_DROP);
|
|
|
stats[FALCON_STAT_rx_nodesc_drop_cnt] +=
|
|
stats[FALCON_STAT_rx_nodesc_drop_cnt] +=
|
|
|
- EFX_OWORD_FIELD(cnt, FRF_AB_RX_NODESC_DROP_CNT);
|
|
|
|
|
|
|
+ EF4_OWORD_FIELD(cnt, FRF_AB_RX_NODESC_DROP_CNT);
|
|
|
|
|
|
|
|
if (nic_data->stats_pending &&
|
|
if (nic_data->stats_pending &&
|
|
|
FALCON_XMAC_STATS_DMA_FLAG(efx)) {
|
|
FALCON_XMAC_STATS_DMA_FLAG(efx)) {
|
|
|
nic_data->stats_pending = false;
|
|
nic_data->stats_pending = false;
|
|
|
rmb(); /* read the done flag before the stats */
|
|
rmb(); /* read the done flag before the stats */
|
|
|
- efx_nic_update_stats(
|
|
|
|
|
|
|
+ ef4_nic_update_stats(
|
|
|
falcon_stat_desc, FALCON_STAT_COUNT,
|
|
falcon_stat_desc, FALCON_STAT_COUNT,
|
|
|
falcon_stat_mask,
|
|
falcon_stat_mask,
|
|
|
stats, efx->stats_buffer.addr, true);
|
|
stats, efx->stats_buffer.addr, true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Update derived statistic */
|
|
/* Update derived statistic */
|
|
|
- efx_update_diff_stat(&stats[FALCON_STAT_rx_bad_bytes],
|
|
|
|
|
|
|
+ ef4_update_diff_stat(&stats[FALCON_STAT_rx_bad_bytes],
|
|
|
stats[FALCON_STAT_rx_bytes] -
|
|
stats[FALCON_STAT_rx_bytes] -
|
|
|
stats[FALCON_STAT_rx_good_bytes] -
|
|
stats[FALCON_STAT_rx_good_bytes] -
|
|
|
stats[FALCON_STAT_rx_control] * 64);
|
|
stats[FALCON_STAT_rx_control] * 64);
|
|
|
- efx_update_sw_stats(efx, stats);
|
|
|
|
|
|
|
+ ef4_update_sw_stats(efx, stats);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (full_stats)
|
|
if (full_stats)
|
|
@@ -2628,7 +2628,7 @@ static size_t falcon_update_nic_stats(struct efx_nic *efx, u64 *full_stats,
|
|
|
return FALCON_STAT_COUNT;
|
|
return FALCON_STAT_COUNT;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void falcon_start_nic_stats(struct efx_nic *efx)
|
|
|
|
|
|
|
+void falcon_start_nic_stats(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
|
|
|
|
@@ -2641,12 +2641,12 @@ void falcon_start_nic_stats(struct efx_nic *efx)
|
|
|
/* We don't acutally pull stats on falcon. Wait 10ms so that
|
|
/* We don't acutally pull stats on falcon. Wait 10ms so that
|
|
|
* they arrive when we call this just after start_stats
|
|
* they arrive when we call this just after start_stats
|
|
|
*/
|
|
*/
|
|
|
-static void falcon_pull_nic_stats(struct efx_nic *efx)
|
|
|
|
|
|
|
+static void falcon_pull_nic_stats(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
msleep(10);
|
|
msleep(10);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void falcon_stop_nic_stats(struct efx_nic *efx)
|
|
|
|
|
|
|
+void falcon_stop_nic_stats(struct ef4_nic *efx)
|
|
|
{
|
|
{
|
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
struct falcon_nic_data *nic_data = efx->nic_data;
|
|
|
int i;
|
|
int i;
|
|
@@ -2672,7 +2672,7 @@ void falcon_stop_nic_stats(struct efx_nic *efx)
|
|
|
spin_unlock_bh(&efx->stats_lock);
|
|
spin_unlock_bh(&efx->stats_lock);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void falcon_set_id_led(struct efx_nic *efx, enum efx_led_mode mode)
|
|
|
|
|
|
|
+static void falcon_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode)
|
|
|
{
|
|
{
|
|
|
falcon_board(efx)->type->set_id_led(efx, mode);
|
|
falcon_board(efx)->type->set_id_led(efx, mode);
|
|
|
}
|
|
}
|
|
@@ -2684,14 +2684,14 @@ static void falcon_set_id_led(struct efx_nic *efx, enum efx_led_mode mode)
|
|
|
**************************************************************************
|
|
**************************************************************************
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-static void falcon_get_wol(struct efx_nic *efx, struct ethtool_wolinfo *wol)
|
|
|
|
|
|
|
+static void falcon_get_wol(struct ef4_nic *efx, struct ethtool_wolinfo *wol)
|
|
|
{
|
|
{
|
|
|
wol->supported = 0;
|
|
wol->supported = 0;
|
|
|
wol->wolopts = 0;
|
|
wol->wolopts = 0;
|
|
|
memset(&wol->sopass, 0, sizeof(wol->sopass));
|
|
memset(&wol->sopass, 0, sizeof(wol->sopass));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int falcon_set_wol(struct efx_nic *efx, u32 type)
|
|
|
|
|
|
|
+static int falcon_set_wol(struct ef4_nic *efx, u32 type)
|
|
|
{
|
|
{
|
|
|
if (type != 0)
|
|
if (type != 0)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -2705,9 +2705,8 @@ static int falcon_set_wol(struct efx_nic *efx, u32 type)
|
|
|
**************************************************************************
|
|
**************************************************************************
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-const struct efx_nic_type falcon_a1_nic_type = {
|
|
|
|
|
- .is_vf = false,
|
|
|
|
|
- .mem_bar = EFX_MEM_BAR,
|
|
|
|
|
|
|
+const struct ef4_nic_type falcon_a1_nic_type = {
|
|
|
|
|
+ .mem_bar = EF4_MEM_BAR,
|
|
|
.mem_map_size = falcon_a1_mem_map_size,
|
|
.mem_map_size = falcon_a1_mem_map_size,
|
|
|
.probe = falcon_probe_nic,
|
|
.probe = falcon_probe_nic,
|
|
|
.remove = falcon_remove_nic,
|
|
.remove = falcon_remove_nic,
|
|
@@ -2721,11 +2720,11 @@ const struct efx_nic_type falcon_a1_nic_type = {
|
|
|
.probe_port = falcon_probe_port,
|
|
.probe_port = falcon_probe_port,
|
|
|
.remove_port = falcon_remove_port,
|
|
.remove_port = falcon_remove_port,
|
|
|
.handle_global_event = falcon_handle_global_event,
|
|
.handle_global_event = falcon_handle_global_event,
|
|
|
- .fini_dmaq = efx_farch_fini_dmaq,
|
|
|
|
|
|
|
+ .fini_dmaq = ef4_farch_fini_dmaq,
|
|
|
.prepare_flush = falcon_prepare_flush,
|
|
.prepare_flush = falcon_prepare_flush,
|
|
|
- .finish_flush = efx_port_dummy_op_void,
|
|
|
|
|
- .prepare_flr = efx_port_dummy_op_void,
|
|
|
|
|
- .finish_flr = efx_farch_finish_flr,
|
|
|
|
|
|
|
+ .finish_flush = ef4_port_dummy_op_void,
|
|
|
|
|
+ .prepare_flr = ef4_port_dummy_op_void,
|
|
|
|
|
+ .finish_flr = ef4_farch_finish_flr,
|
|
|
.describe_stats = falcon_describe_nic_stats,
|
|
.describe_stats = falcon_describe_nic_stats,
|
|
|
.update_stats = falcon_update_nic_stats,
|
|
.update_stats = falcon_update_nic_stats,
|
|
|
.start_stats = falcon_start_nic_stats,
|
|
.start_stats = falcon_start_nic_stats,
|
|
@@ -2739,48 +2738,48 @@ const struct efx_nic_type falcon_a1_nic_type = {
|
|
|
.check_mac_fault = falcon_xmac_check_fault,
|
|
.check_mac_fault = falcon_xmac_check_fault,
|
|
|
.get_wol = falcon_get_wol,
|
|
.get_wol = falcon_get_wol,
|
|
|
.set_wol = falcon_set_wol,
|
|
.set_wol = falcon_set_wol,
|
|
|
- .resume_wol = efx_port_dummy_op_void,
|
|
|
|
|
|
|
+ .resume_wol = ef4_port_dummy_op_void,
|
|
|
.test_nvram = falcon_test_nvram,
|
|
.test_nvram = falcon_test_nvram,
|
|
|
- .irq_enable_master = efx_farch_irq_enable_master,
|
|
|
|
|
- .irq_test_generate = efx_farch_irq_test_generate,
|
|
|
|
|
- .irq_disable_non_ev = efx_farch_irq_disable_master,
|
|
|
|
|
- .irq_handle_msi = efx_farch_msi_interrupt,
|
|
|
|
|
|
|
+ .irq_enable_master = ef4_farch_irq_enable_master,
|
|
|
|
|
+ .irq_test_generate = ef4_farch_irq_test_generate,
|
|
|
|
|
+ .irq_disable_non_ev = ef4_farch_irq_disable_master,
|
|
|
|
|
+ .irq_handle_msi = ef4_farch_msi_interrupt,
|
|
|
.irq_handle_legacy = falcon_legacy_interrupt_a1,
|
|
.irq_handle_legacy = falcon_legacy_interrupt_a1,
|
|
|
- .tx_probe = efx_farch_tx_probe,
|
|
|
|
|
- .tx_init = efx_farch_tx_init,
|
|
|
|
|
- .tx_remove = efx_farch_tx_remove,
|
|
|
|
|
- .tx_write = efx_farch_tx_write,
|
|
|
|
|
- .tx_limit_len = efx_farch_tx_limit_len,
|
|
|
|
|
|
|
+ .tx_probe = ef4_farch_tx_probe,
|
|
|
|
|
+ .tx_init = ef4_farch_tx_init,
|
|
|
|
|
+ .tx_remove = ef4_farch_tx_remove,
|
|
|
|
|
+ .tx_write = ef4_farch_tx_write,
|
|
|
|
|
+ .tx_limit_len = ef4_farch_tx_limit_len,
|
|
|
.rx_push_rss_config = dummy_rx_push_rss_config,
|
|
.rx_push_rss_config = dummy_rx_push_rss_config,
|
|
|
- .rx_probe = efx_farch_rx_probe,
|
|
|
|
|
- .rx_init = efx_farch_rx_init,
|
|
|
|
|
- .rx_remove = efx_farch_rx_remove,
|
|
|
|
|
- .rx_write = efx_farch_rx_write,
|
|
|
|
|
- .rx_defer_refill = efx_farch_rx_defer_refill,
|
|
|
|
|
- .ev_probe = efx_farch_ev_probe,
|
|
|
|
|
- .ev_init = efx_farch_ev_init,
|
|
|
|
|
- .ev_fini = efx_farch_ev_fini,
|
|
|
|
|
- .ev_remove = efx_farch_ev_remove,
|
|
|
|
|
- .ev_process = efx_farch_ev_process,
|
|
|
|
|
- .ev_read_ack = efx_farch_ev_read_ack,
|
|
|
|
|
- .ev_test_generate = efx_farch_ev_test_generate,
|
|
|
|
|
|
|
+ .rx_probe = ef4_farch_rx_probe,
|
|
|
|
|
+ .rx_init = ef4_farch_rx_init,
|
|
|
|
|
+ .rx_remove = ef4_farch_rx_remove,
|
|
|
|
|
+ .rx_write = ef4_farch_rx_write,
|
|
|
|
|
+ .rx_defer_refill = ef4_farch_rx_defer_refill,
|
|
|
|
|
+ .ev_probe = ef4_farch_ev_probe,
|
|
|
|
|
+ .ev_init = ef4_farch_ev_init,
|
|
|
|
|
+ .ev_fini = ef4_farch_ev_fini,
|
|
|
|
|
+ .ev_remove = ef4_farch_ev_remove,
|
|
|
|
|
+ .ev_process = ef4_farch_ev_process,
|
|
|
|
|
+ .ev_read_ack = ef4_farch_ev_read_ack,
|
|
|
|
|
+ .ev_test_generate = ef4_farch_ev_test_generate,
|
|
|
|
|
|
|
|
/* We don't expose the filter table on Falcon A1 as it is not
|
|
/* We don't expose the filter table on Falcon A1 as it is not
|
|
|
* mapped into function 0, but these implementations still
|
|
* mapped into function 0, but these implementations still
|
|
|
* work with a degenerate case of all tables set to size 0.
|
|
* work with a degenerate case of all tables set to size 0.
|
|
|
*/
|
|
*/
|
|
|
- .filter_table_probe = efx_farch_filter_table_probe,
|
|
|
|
|
- .filter_table_restore = efx_farch_filter_table_restore,
|
|
|
|
|
- .filter_table_remove = efx_farch_filter_table_remove,
|
|
|
|
|
- .filter_insert = efx_farch_filter_insert,
|
|
|
|
|
- .filter_remove_safe = efx_farch_filter_remove_safe,
|
|
|
|
|
- .filter_get_safe = efx_farch_filter_get_safe,
|
|
|
|
|
- .filter_clear_rx = efx_farch_filter_clear_rx,
|
|
|
|
|
- .filter_count_rx_used = efx_farch_filter_count_rx_used,
|
|
|
|
|
- .filter_get_rx_id_limit = efx_farch_filter_get_rx_id_limit,
|
|
|
|
|
- .filter_get_rx_ids = efx_farch_filter_get_rx_ids,
|
|
|
|
|
-
|
|
|
|
|
-#ifdef CONFIG_SFC_MTD
|
|
|
|
|
|
|
+ .filter_table_probe = ef4_farch_filter_table_probe,
|
|
|
|
|
+ .filter_table_restore = ef4_farch_filter_table_restore,
|
|
|
|
|
+ .filter_table_remove = ef4_farch_filter_table_remove,
|
|
|
|
|
+ .filter_insert = ef4_farch_filter_insert,
|
|
|
|
|
+ .filter_remove_safe = ef4_farch_filter_remove_safe,
|
|
|
|
|
+ .filter_get_safe = ef4_farch_filter_get_safe,
|
|
|
|
|
+ .filter_clear_rx = ef4_farch_filter_clear_rx,
|
|
|
|
|
+ .filter_count_rx_used = ef4_farch_filter_count_rx_used,
|
|
|
|
|
+ .filter_get_rx_id_limit = ef4_farch_filter_get_rx_id_limit,
|
|
|
|
|
+ .filter_get_rx_ids = ef4_farch_filter_get_rx_ids,
|
|
|
|
|
+
|
|
|
|
|
+#ifdef CONFIG_SFC_FALCON_MTD
|
|
|
.mtd_probe = falcon_mtd_probe,
|
|
.mtd_probe = falcon_mtd_probe,
|
|
|
.mtd_rename = falcon_mtd_rename,
|
|
.mtd_rename = falcon_mtd_rename,
|
|
|
.mtd_read = falcon_mtd_read,
|
|
.mtd_read = falcon_mtd_read,
|
|
@@ -2789,7 +2788,7 @@ const struct efx_nic_type falcon_a1_nic_type = {
|
|
|
.mtd_sync = falcon_mtd_sync,
|
|
.mtd_sync = falcon_mtd_sync,
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- .revision = EFX_REV_FALCON_A1,
|
|
|
|
|
|
|
+ .revision = EF4_REV_FALCON_A1,
|
|
|
.txd_ptr_tbl_base = FR_AA_TX_DESC_PTR_TBL_KER,
|
|
.txd_ptr_tbl_base = FR_AA_TX_DESC_PTR_TBL_KER,
|
|
|
.rxd_ptr_tbl_base = FR_AA_RX_DESC_PTR_TBL_KER,
|
|
.rxd_ptr_tbl_base = FR_AA_RX_DESC_PTR_TBL_KER,
|
|
|
.buf_tbl_base = FR_AA_BUF_FULL_TBL_KER,
|
|
.buf_tbl_base = FR_AA_BUF_FULL_TBL_KER,
|
|
@@ -2798,21 +2797,19 @@ const struct efx_nic_type falcon_a1_nic_type = {
|
|
|
.max_dma_mask = DMA_BIT_MASK(FSF_AZ_TX_KER_BUF_ADDR_WIDTH),
|
|
.max_dma_mask = DMA_BIT_MASK(FSF_AZ_TX_KER_BUF_ADDR_WIDTH),
|
|
|
.rx_buffer_padding = 0x24,
|
|
.rx_buffer_padding = 0x24,
|
|
|
.can_rx_scatter = false,
|
|
.can_rx_scatter = false,
|
|
|
- .max_interrupt_mode = EFX_INT_MODE_MSI,
|
|
|
|
|
|
|
+ .max_interrupt_mode = EF4_INT_MODE_MSI,
|
|
|
.timer_period_max = 1 << FRF_AB_TC_TIMER_VAL_WIDTH,
|
|
.timer_period_max = 1 << FRF_AB_TC_TIMER_VAL_WIDTH,
|
|
|
.offload_features = NETIF_F_IP_CSUM,
|
|
.offload_features = NETIF_F_IP_CSUM,
|
|
|
- .mcdi_max_ver = -1,
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const struct efx_nic_type falcon_b0_nic_type = {
|
|
|
|
|
- .is_vf = false,
|
|
|
|
|
- .mem_bar = EFX_MEM_BAR,
|
|
|
|
|
|
|
+const struct ef4_nic_type falcon_b0_nic_type = {
|
|
|
|
|
+ .mem_bar = EF4_MEM_BAR,
|
|
|
.mem_map_size = falcon_b0_mem_map_size,
|
|
.mem_map_size = falcon_b0_mem_map_size,
|
|
|
.probe = falcon_probe_nic,
|
|
.probe = falcon_probe_nic,
|
|
|
.remove = falcon_remove_nic,
|
|
.remove = falcon_remove_nic,
|
|
|
.init = falcon_init_nic,
|
|
.init = falcon_init_nic,
|
|
|
.dimension_resources = falcon_dimension_resources,
|
|
.dimension_resources = falcon_dimension_resources,
|
|
|
- .fini = efx_port_dummy_op_void,
|
|
|
|
|
|
|
+ .fini = ef4_port_dummy_op_void,
|
|
|
.monitor = falcon_monitor,
|
|
.monitor = falcon_monitor,
|
|
|
.map_reset_reason = falcon_map_reset_reason,
|
|
.map_reset_reason = falcon_map_reset_reason,
|
|
|
.map_reset_flags = falcon_map_reset_flags,
|
|
.map_reset_flags = falcon_map_reset_flags,
|
|
@@ -2820,11 +2817,11 @@ const struct efx_nic_type falcon_b0_nic_type = {
|
|
|
.probe_port = falcon_probe_port,
|
|
.probe_port = falcon_probe_port,
|
|
|
.remove_port = falcon_remove_port,
|
|
.remove_port = falcon_remove_port,
|
|
|
.handle_global_event = falcon_handle_global_event,
|
|
.handle_global_event = falcon_handle_global_event,
|
|
|
- .fini_dmaq = efx_farch_fini_dmaq,
|
|
|
|
|
|
|
+ .fini_dmaq = ef4_farch_fini_dmaq,
|
|
|
.prepare_flush = falcon_prepare_flush,
|
|
.prepare_flush = falcon_prepare_flush,
|
|
|
- .finish_flush = efx_port_dummy_op_void,
|
|
|
|
|
- .prepare_flr = efx_port_dummy_op_void,
|
|
|
|
|
- .finish_flr = efx_farch_finish_flr,
|
|
|
|
|
|
|
+ .finish_flush = ef4_port_dummy_op_void,
|
|
|
|
|
+ .prepare_flr = ef4_port_dummy_op_void,
|
|
|
|
|
+ .finish_flr = ef4_farch_finish_flr,
|
|
|
.describe_stats = falcon_describe_nic_stats,
|
|
.describe_stats = falcon_describe_nic_stats,
|
|
|
.update_stats = falcon_update_nic_stats,
|
|
.update_stats = falcon_update_nic_stats,
|
|
|
.start_stats = falcon_start_nic_stats,
|
|
.start_stats = falcon_start_nic_stats,
|
|
@@ -2838,48 +2835,48 @@ const struct efx_nic_type falcon_b0_nic_type = {
|
|
|
.check_mac_fault = falcon_xmac_check_fault,
|
|
.check_mac_fault = falcon_xmac_check_fault,
|
|
|
.get_wol = falcon_get_wol,
|
|
.get_wol = falcon_get_wol,
|
|
|
.set_wol = falcon_set_wol,
|
|
.set_wol = falcon_set_wol,
|
|
|
- .resume_wol = efx_port_dummy_op_void,
|
|
|
|
|
|
|
+ .resume_wol = ef4_port_dummy_op_void,
|
|
|
.test_chip = falcon_b0_test_chip,
|
|
.test_chip = falcon_b0_test_chip,
|
|
|
.test_nvram = falcon_test_nvram,
|
|
.test_nvram = falcon_test_nvram,
|
|
|
- .irq_enable_master = efx_farch_irq_enable_master,
|
|
|
|
|
- .irq_test_generate = efx_farch_irq_test_generate,
|
|
|
|
|
- .irq_disable_non_ev = efx_farch_irq_disable_master,
|
|
|
|
|
- .irq_handle_msi = efx_farch_msi_interrupt,
|
|
|
|
|
- .irq_handle_legacy = efx_farch_legacy_interrupt,
|
|
|
|
|
- .tx_probe = efx_farch_tx_probe,
|
|
|
|
|
- .tx_init = efx_farch_tx_init,
|
|
|
|
|
- .tx_remove = efx_farch_tx_remove,
|
|
|
|
|
- .tx_write = efx_farch_tx_write,
|
|
|
|
|
- .tx_limit_len = efx_farch_tx_limit_len,
|
|
|
|
|
|
|
+ .irq_enable_master = ef4_farch_irq_enable_master,
|
|
|
|
|
+ .irq_test_generate = ef4_farch_irq_test_generate,
|
|
|
|
|
+ .irq_disable_non_ev = ef4_farch_irq_disable_master,
|
|
|
|
|
+ .irq_handle_msi = ef4_farch_msi_interrupt,
|
|
|
|
|
+ .irq_handle_legacy = ef4_farch_legacy_interrupt,
|
|
|
|
|
+ .tx_probe = ef4_farch_tx_probe,
|
|
|
|
|
+ .tx_init = ef4_farch_tx_init,
|
|
|
|
|
+ .tx_remove = ef4_farch_tx_remove,
|
|
|
|
|
+ .tx_write = ef4_farch_tx_write,
|
|
|
|
|
+ .tx_limit_len = ef4_farch_tx_limit_len,
|
|
|
.rx_push_rss_config = falcon_b0_rx_push_rss_config,
|
|
.rx_push_rss_config = falcon_b0_rx_push_rss_config,
|
|
|
- .rx_probe = efx_farch_rx_probe,
|
|
|
|
|
- .rx_init = efx_farch_rx_init,
|
|
|
|
|
- .rx_remove = efx_farch_rx_remove,
|
|
|
|
|
- .rx_write = efx_farch_rx_write,
|
|
|
|
|
- .rx_defer_refill = efx_farch_rx_defer_refill,
|
|
|
|
|
- .ev_probe = efx_farch_ev_probe,
|
|
|
|
|
- .ev_init = efx_farch_ev_init,
|
|
|
|
|
- .ev_fini = efx_farch_ev_fini,
|
|
|
|
|
- .ev_remove = efx_farch_ev_remove,
|
|
|
|
|
- .ev_process = efx_farch_ev_process,
|
|
|
|
|
- .ev_read_ack = efx_farch_ev_read_ack,
|
|
|
|
|
- .ev_test_generate = efx_farch_ev_test_generate,
|
|
|
|
|
- .filter_table_probe = efx_farch_filter_table_probe,
|
|
|
|
|
- .filter_table_restore = efx_farch_filter_table_restore,
|
|
|
|
|
- .filter_table_remove = efx_farch_filter_table_remove,
|
|
|
|
|
- .filter_update_rx_scatter = efx_farch_filter_update_rx_scatter,
|
|
|
|
|
- .filter_insert = efx_farch_filter_insert,
|
|
|
|
|
- .filter_remove_safe = efx_farch_filter_remove_safe,
|
|
|
|
|
- .filter_get_safe = efx_farch_filter_get_safe,
|
|
|
|
|
- .filter_clear_rx = efx_farch_filter_clear_rx,
|
|
|
|
|
- .filter_count_rx_used = efx_farch_filter_count_rx_used,
|
|
|
|
|
- .filter_get_rx_id_limit = efx_farch_filter_get_rx_id_limit,
|
|
|
|
|
- .filter_get_rx_ids = efx_farch_filter_get_rx_ids,
|
|
|
|
|
|
|
+ .rx_probe = ef4_farch_rx_probe,
|
|
|
|
|
+ .rx_init = ef4_farch_rx_init,
|
|
|
|
|
+ .rx_remove = ef4_farch_rx_remove,
|
|
|
|
|
+ .rx_write = ef4_farch_rx_write,
|
|
|
|
|
+ .rx_defer_refill = ef4_farch_rx_defer_refill,
|
|
|
|
|
+ .ev_probe = ef4_farch_ev_probe,
|
|
|
|
|
+ .ev_init = ef4_farch_ev_init,
|
|
|
|
|
+ .ev_fini = ef4_farch_ev_fini,
|
|
|
|
|
+ .ev_remove = ef4_farch_ev_remove,
|
|
|
|
|
+ .ev_process = ef4_farch_ev_process,
|
|
|
|
|
+ .ev_read_ack = ef4_farch_ev_read_ack,
|
|
|
|
|
+ .ev_test_generate = ef4_farch_ev_test_generate,
|
|
|
|
|
+ .filter_table_probe = ef4_farch_filter_table_probe,
|
|
|
|
|
+ .filter_table_restore = ef4_farch_filter_table_restore,
|
|
|
|
|
+ .filter_table_remove = ef4_farch_filter_table_remove,
|
|
|
|
|
+ .filter_update_rx_scatter = ef4_farch_filter_update_rx_scatter,
|
|
|
|
|
+ .filter_insert = ef4_farch_filter_insert,
|
|
|
|
|
+ .filter_remove_safe = ef4_farch_filter_remove_safe,
|
|
|
|
|
+ .filter_get_safe = ef4_farch_filter_get_safe,
|
|
|
|
|
+ .filter_clear_rx = ef4_farch_filter_clear_rx,
|
|
|
|
|
+ .filter_count_rx_used = ef4_farch_filter_count_rx_used,
|
|
|
|
|
+ .filter_get_rx_id_limit = ef4_farch_filter_get_rx_id_limit,
|
|
|
|
|
+ .filter_get_rx_ids = ef4_farch_filter_get_rx_ids,
|
|
|
#ifdef CONFIG_RFS_ACCEL
|
|
#ifdef CONFIG_RFS_ACCEL
|
|
|
- .filter_rfs_insert = efx_farch_filter_rfs_insert,
|
|
|
|
|
- .filter_rfs_expire_one = efx_farch_filter_rfs_expire_one,
|
|
|
|
|
|
|
+ .filter_rfs_insert = ef4_farch_filter_rfs_insert,
|
|
|
|
|
+ .filter_rfs_expire_one = ef4_farch_filter_rfs_expire_one,
|
|
|
#endif
|
|
#endif
|
|
|
-#ifdef CONFIG_SFC_MTD
|
|
|
|
|
|
|
+#ifdef CONFIG_SFC_FALCON_MTD
|
|
|
.mtd_probe = falcon_mtd_probe,
|
|
.mtd_probe = falcon_mtd_probe,
|
|
|
.mtd_rename = falcon_mtd_rename,
|
|
.mtd_rename = falcon_mtd_rename,
|
|
|
.mtd_read = falcon_mtd_read,
|
|
.mtd_read = falcon_mtd_read,
|
|
@@ -2888,7 +2885,7 @@ const struct efx_nic_type falcon_b0_nic_type = {
|
|
|
.mtd_sync = falcon_mtd_sync,
|
|
.mtd_sync = falcon_mtd_sync,
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- .revision = EFX_REV_FALCON_B0,
|
|
|
|
|
|
|
+ .revision = EF4_REV_FALCON_B0,
|
|
|
.txd_ptr_tbl_base = FR_BZ_TX_DESC_PTR_TBL,
|
|
.txd_ptr_tbl_base = FR_BZ_TX_DESC_PTR_TBL,
|
|
|
.rxd_ptr_tbl_base = FR_BZ_RX_DESC_PTR_TBL,
|
|
.rxd_ptr_tbl_base = FR_BZ_RX_DESC_PTR_TBL,
|
|
|
.buf_tbl_base = FR_BZ_BUF_FULL_TBL,
|
|
.buf_tbl_base = FR_BZ_BUF_FULL_TBL,
|
|
@@ -2899,9 +2896,8 @@ const struct efx_nic_type falcon_b0_nic_type = {
|
|
|
.rx_hash_offset = FS_BZ_RX_PREFIX_HASH_OFST,
|
|
.rx_hash_offset = FS_BZ_RX_PREFIX_HASH_OFST,
|
|
|
.rx_buffer_padding = 0,
|
|
.rx_buffer_padding = 0,
|
|
|
.can_rx_scatter = true,
|
|
.can_rx_scatter = true,
|
|
|
- .max_interrupt_mode = EFX_INT_MODE_MSIX,
|
|
|
|
|
|
|
+ .max_interrupt_mode = EF4_INT_MODE_MSIX,
|
|
|
.timer_period_max = 1 << FRF_AB_TC_TIMER_VAL_WIDTH,
|
|
.timer_period_max = 1 << FRF_AB_TC_TIMER_VAL_WIDTH,
|
|
|
.offload_features = NETIF_F_IP_CSUM | NETIF_F_RXHASH | NETIF_F_NTUPLE,
|
|
.offload_features = NETIF_F_IP_CSUM | NETIF_F_RXHASH | NETIF_F_NTUPLE,
|
|
|
- .mcdi_max_ver = -1,
|
|
|
|
|
.max_rx_ip_filters = FR_BZ_RX_FILTER_TBL0_ROWS,
|
|
.max_rx_ip_filters = FR_BZ_RX_FILTER_TBL0_ROWS,
|
|
|
};
|
|
};
|