Commit 5f3b8ace authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'add-functional-support-for-gigabit-ethernet-driver'

Biju Das says:

====================
Add functional support for Gigabit Ethernet driver

The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC are
similar to the R-Car Ethernet AVB IP.

The Gigabit Ethernet IP consists of Ethernet controller (E-MAC), Internal
TCP/IP Offload Engine (TOE)  and Dedicated Direct memory access controller
(DMAC).

With a few changes in the driver we can support both IPs.

This patch series is aims to add functional support for Gigabit Ethernet
driver by filling all the stubs except set_features.

set_feature patch will send as separate RFC patch along with rx_checksum
patch, as it needs further discussion related to HW checksum.

With this series, we can do boot kernel with rootFS mounted on NFS on
RZ/G2L platforms.
====================

Link: https://lore.kernel.org/r/20211012163613.30030-1-biju.das.jz@bp.renesas.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 50515cac 94040926
...@@ -196,12 +196,15 @@ enum ravb_reg { ...@@ -196,12 +196,15 @@ enum ravb_reg {
MAHR = 0x05c0, MAHR = 0x05c0,
MALR = 0x05c8, MALR = 0x05c8,
TROCR = 0x0700, /* R-Car Gen3 and RZ/G2L only */ TROCR = 0x0700, /* R-Car Gen3 and RZ/G2L only */
CXR41 = 0x0708, /* RZ/G2L only */
CXR42 = 0x0710, /* RZ/G2L only */
CEFCR = 0x0740, CEFCR = 0x0740,
FRECR = 0x0748, FRECR = 0x0748,
TSFRCR = 0x0750, TSFRCR = 0x0750,
TLFRCR = 0x0758, TLFRCR = 0x0758,
RFCR = 0x0760, RFCR = 0x0760,
MAFCR = 0x0778, MAFCR = 0x0778,
CSR0 = 0x0800, /* RZ/G2L only */
}; };
...@@ -826,7 +829,7 @@ enum ECSR_BIT { ...@@ -826,7 +829,7 @@ enum ECSR_BIT {
ECSR_MPD = 0x00000002, ECSR_MPD = 0x00000002,
ECSR_LCHNG = 0x00000004, ECSR_LCHNG = 0x00000004,
ECSR_PHYI = 0x00000008, ECSR_PHYI = 0x00000008,
ECSR_PFRI = 0x00000010, ECSR_PFRI = 0x00000010, /* Documented for R-Car Gen3 and RZ/G2L */
}; };
/* ECSIPR */ /* ECSIPR */
...@@ -962,6 +965,11 @@ enum CXR31_BIT { ...@@ -962,6 +965,11 @@ enum CXR31_BIT {
CXR31_SEL_LINK1 = 0x00000008, CXR31_SEL_LINK1 = 0x00000008,
}; };
enum CSR0_BIT {
CSR0_TPE = 0x00000010,
CSR0_RPE = 0x00000020,
};
#define DBAT_ENTRY_NUM 22 #define DBAT_ENTRY_NUM 22
#define RX_QUEUE_OFFSET 4 #define RX_QUEUE_OFFSET 4
#define NUM_RX_QUEUE 2 #define NUM_RX_QUEUE 2
...@@ -970,6 +978,7 @@ enum CXR31_BIT { ...@@ -970,6 +978,7 @@ enum CXR31_BIT {
#define RX_BUF_SZ (2048 - ETH_FCS_LEN + sizeof(__sum16)) #define RX_BUF_SZ (2048 - ETH_FCS_LEN + sizeof(__sum16))
#define GBETH_RX_BUFF_MAX 8192 #define GBETH_RX_BUFF_MAX 8192
#define GBETH_RX_DESC_DATA_SIZE 4080
struct ravb_tstamp_skb { struct ravb_tstamp_skb {
struct list_head list; struct list_head list;
...@@ -1009,16 +1018,18 @@ struct ravb_hw_info { ...@@ -1009,16 +1018,18 @@ struct ravb_hw_info {
netdev_features_t net_features; netdev_features_t net_features;
int stats_len; int stats_len;
size_t max_rx_len; size_t max_rx_len;
u32 tsrq; u32 tccr_mask;
u32 rx_max_buf_size;
unsigned aligned_tx: 1; unsigned aligned_tx: 1;
/* hardware features */ /* hardware features */
unsigned internal_delay:1; /* AVB-DMAC has internal delays */ unsigned internal_delay:1; /* AVB-DMAC has internal delays */
unsigned tx_counters:1; /* E-MAC has TX counters */ unsigned tx_counters:1; /* E-MAC has TX counters */
unsigned carrier_counters:1; /* E-MAC has carrier counters */
unsigned multi_irqs:1; /* AVB-DMAC and E-MAC has multiple irqs */ unsigned multi_irqs:1; /* AVB-DMAC and E-MAC has multiple irqs */
unsigned gptp:1; /* AVB-DMAC has gPTP support */ unsigned gptp:1; /* AVB-DMAC has gPTP support */
unsigned ccc_gac:1; /* AVB-DMAC has gPTP support active in config mode */ unsigned ccc_gac:1; /* AVB-DMAC has gPTP support active in config mode */
unsigned nc_queue:1; /* AVB-DMAC has NC queue */ unsigned nc_queues:1; /* AVB-DMAC has RX and TX NC queues */
unsigned magic_pkt:1; /* E-MAC supports magic packet detection */ unsigned magic_pkt:1; /* E-MAC supports magic packet detection */
unsigned half_duplex:1; /* E-MAC supports half duplex mode */ unsigned half_duplex:1; /* E-MAC supports half duplex mode */
}; };
...@@ -1037,9 +1048,11 @@ struct ravb_private { ...@@ -1037,9 +1048,11 @@ struct ravb_private {
struct ravb_desc *desc_bat; struct ravb_desc *desc_bat;
dma_addr_t rx_desc_dma[NUM_RX_QUEUE]; dma_addr_t rx_desc_dma[NUM_RX_QUEUE];
dma_addr_t tx_desc_dma[NUM_TX_QUEUE]; dma_addr_t tx_desc_dma[NUM_TX_QUEUE];
struct ravb_rx_desc *gbeth_rx_ring;
struct ravb_ex_rx_desc *rx_ring[NUM_RX_QUEUE]; struct ravb_ex_rx_desc *rx_ring[NUM_RX_QUEUE];
struct ravb_tx_desc *tx_ring[NUM_TX_QUEUE]; struct ravb_tx_desc *tx_ring[NUM_TX_QUEUE];
void *tx_align[NUM_TX_QUEUE]; void *tx_align[NUM_TX_QUEUE];
struct sk_buff *rx_1st_skb;
struct sk_buff **rx_skb[NUM_RX_QUEUE]; struct sk_buff **rx_skb[NUM_RX_QUEUE];
struct sk_buff **tx_skb[NUM_TX_QUEUE]; struct sk_buff **tx_skb[NUM_TX_QUEUE];
u32 rx_over_errors; u32 rx_over_errors;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment