Commit a2791943 authored by David S. Miller's avatar David S. Miller

Merge branch 'ravb-gbit'

Biju Das says:

====================
ravb: Add Gigabit Ethernet driver support

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.

Currently a runtime decision based on the chip type is used to distinguish
the HW differences between the SoC families.

This patch series is in preparation for supporting the RZ/G2L SoC by
replacing driver data chip type with struct ravb_hw_info by moving chip
type to it and also adding gstrings_stats, gstrings_size, net_hw_features,
net_features, aligned_tx, stats_len, max_rx_len variables to
it. This patch also adds the feature bit for {RX, TX} clock internal
delays and TX counters HW features found on R-Car Gen3 to struct
ravb_hw_info.

This patch series is based on net-next.
v2->v3:
 * Removed num_gstat_queue variable from struct ravb_hw_info.
 * started using unsigned int for num_tx_desc variable in struct ravb_private
 * split the patch 'Add struct ravb_hw_info to driver data' into two
 * Renamed skb_sz to max_rx_len and tx_drop_cntrs to tx_counters
   and also updated the comments.
v1->v2:
 * Replaced driver data chip type with struct ravb_hw_info
 * Added gstrings_stats, gstrings_size, net_hw_features, net_features,
   num_gstat_queue, num_tx_desc, stats_len, skb_sz to struct ravb_hw_info
 * Added internal_delay and tx_drop_cntrs hw feature bit to struct ravb_hw_info

RFC->V1
  * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar
  * https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=515525
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 19b8ece4 0b81d673
......@@ -988,6 +988,21 @@ enum ravb_chip_id {
RCAR_GEN3,
};
struct ravb_hw_info {
const char (*gstrings_stats)[ETH_GSTRING_LEN];
size_t gstrings_size;
netdev_features_t net_hw_features;
netdev_features_t net_features;
enum ravb_chip_id chip_id;
int stats_len;
size_t max_rx_len;
unsigned aligned_tx: 1;
/* hardware features */
unsigned internal_delay:1; /* AVB-DMAC has internal delays */
unsigned tx_counters:1; /* E-MAC has TX counters */
};
struct ravb_private {
struct net_device *ndev;
struct platform_device *pdev;
......@@ -1039,7 +1054,9 @@ struct ravb_private {
unsigned rxcidm:1; /* RX Clock Internal Delay Mode */
unsigned txcidm:1; /* TX Clock Internal Delay Mode */
unsigned rgmii_override:1; /* Deprecated rgmii-*id behavior */
int num_tx_desc; /* TX descriptors per packet */
unsigned int num_tx_desc; /* TX descriptors per packet */
const struct ravb_hw_info *info;
};
static inline u32 ravb_read(struct net_device *ndev, enum ravb_reg reg)
......
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