Skip to content

Commit feab85c

Browse files
bijudasdavem330
authored andcommitted
ravb: Add support for RZ/G2L SoC
RZ/G2L SoC has Gigabit Ethernet IP consisting of Ethernet controller (E-MAC), Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller (DMAC). This patch adds compatible string for RZ/G2L and fills up the ravb_hw_info struct. Function stubs are added which will be used by gbeth_hw_info and will be filled incrementally. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a92f4f0 commit feab85c

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

drivers/net/ethernet/renesas/ravb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,8 @@ enum RAVB_QUEUE {
956956

957957
#define RX_BUF_SZ (2048 - ETH_FCS_LEN + sizeof(__sum16))
958958

959+
#define GBETH_RX_BUFF_MAX 8192
960+
959961
struct ravb_tstamp_skb {
960962
struct list_head list;
961963
struct sk_buff *skb;

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ static int ravb_config(struct net_device *ndev)
8383
return error;
8484
}
8585

86+
static void ravb_set_rate_gbeth(struct net_device *ndev)
87+
{
88+
/* Place holder */
89+
}
90+
8691
static void ravb_set_rate(struct net_device *ndev)
8792
{
8893
struct ravb_private *priv = netdev_priv(ndev);
@@ -217,6 +222,11 @@ static int ravb_tx_free(struct net_device *ndev, int q, bool free_txed_only)
217222
return free_num;
218223
}
219224

225+
static void ravb_rx_ring_free_gbeth(struct net_device *ndev, int q)
226+
{
227+
/* Place holder */
228+
}
229+
220230
static void ravb_rx_ring_free(struct net_device *ndev, int q)
221231
{
222232
struct ravb_private *priv = netdev_priv(ndev);
@@ -283,6 +293,11 @@ static void ravb_ring_free(struct net_device *ndev, int q)
283293
priv->tx_skb[q] = NULL;
284294
}
285295

296+
static void ravb_rx_ring_format_gbeth(struct net_device *ndev, int q)
297+
{
298+
/* Place holder */
299+
}
300+
286301
static void ravb_rx_ring_format(struct net_device *ndev, int q)
287302
{
288303
struct ravb_private *priv = netdev_priv(ndev);
@@ -356,6 +371,12 @@ static void ravb_ring_format(struct net_device *ndev, int q)
356371
desc->dptr = cpu_to_le32((u32)priv->tx_desc_dma[q]);
357372
}
358373

374+
static void *ravb_alloc_rx_desc_gbeth(struct net_device *ndev, int q)
375+
{
376+
/* Place holder */
377+
return NULL;
378+
}
379+
359380
static void *ravb_alloc_rx_desc(struct net_device *ndev, int q)
360381
{
361382
struct ravb_private *priv = netdev_priv(ndev);
@@ -426,6 +447,11 @@ static int ravb_ring_init(struct net_device *ndev, int q)
426447
return -ENOMEM;
427448
}
428449

450+
static void ravb_emac_init_gbeth(struct net_device *ndev)
451+
{
452+
/* Place holder */
453+
}
454+
429455
static void ravb_rcar_emac_init(struct net_device *ndev)
430456
{
431457
/* Receive frame limit set register */
@@ -461,6 +487,12 @@ static void ravb_emac_init(struct net_device *ndev)
461487
info->emac_init(ndev);
462488
}
463489

490+
static int ravb_dmac_init_gbeth(struct net_device *ndev)
491+
{
492+
/* Place holder */
493+
return 0;
494+
}
495+
464496
static int ravb_dmac_init_rcar(struct net_device *ndev)
465497
{
466498
struct ravb_private *priv = netdev_priv(ndev);
@@ -584,6 +616,14 @@ static void ravb_rx_csum(struct sk_buff *skb)
584616
skb_trim(skb, skb->len - sizeof(__sum16));
585617
}
586618

619+
/* Packet receive function for Gigabit Ethernet */
620+
static bool ravb_rx_gbeth(struct net_device *ndev, int *quota, int q)
621+
{
622+
/* Place holder */
623+
return true;
624+
}
625+
626+
/* Packet receive function for Ethernet AVB */
587627
static bool ravb_rcar_rx(struct net_device *ndev, int *quota, int q)
588628
{
589629
struct ravb_private *priv = netdev_priv(ndev);
@@ -1949,6 +1989,13 @@ static void ravb_set_rx_csum(struct net_device *ndev, bool enable)
19491989
spin_unlock_irqrestore(&priv->lock, flags);
19501990
}
19511991

1992+
static int ravb_set_features_gbeth(struct net_device *ndev,
1993+
netdev_features_t features)
1994+
{
1995+
/* Place holder */
1996+
return 0;
1997+
}
1998+
19521999
static int ravb_set_features_rcar(struct net_device *ndev,
19532000
netdev_features_t features)
19542001
{
@@ -2073,12 +2120,27 @@ static const struct ravb_hw_info ravb_gen2_hw_info = {
20732120
.nc_queue = 1,
20742121
};
20752122

2123+
static const struct ravb_hw_info gbeth_hw_info = {
2124+
.rx_ring_free = ravb_rx_ring_free_gbeth,
2125+
.rx_ring_format = ravb_rx_ring_format_gbeth,
2126+
.alloc_rx_desc = ravb_alloc_rx_desc_gbeth,
2127+
.receive = ravb_rx_gbeth,
2128+
.set_rate = ravb_set_rate_gbeth,
2129+
.set_feature = ravb_set_features_gbeth,
2130+
.dmac_init = ravb_dmac_init_gbeth,
2131+
.emac_init = ravb_emac_init_gbeth,
2132+
.max_rx_len = GBETH_RX_BUFF_MAX + RAVB_ALIGN - 1,
2133+
.aligned_tx = 1,
2134+
.tx_counters = 1,
2135+
};
2136+
20762137
static const struct of_device_id ravb_match_table[] = {
20772138
{ .compatible = "renesas,etheravb-r8a7790", .data = &ravb_gen2_hw_info },
20782139
{ .compatible = "renesas,etheravb-r8a7794", .data = &ravb_gen2_hw_info },
20792140
{ .compatible = "renesas,etheravb-rcar-gen2", .data = &ravb_gen2_hw_info },
20802141
{ .compatible = "renesas,etheravb-r8a7795", .data = &ravb_gen3_hw_info },
20812142
{ .compatible = "renesas,etheravb-rcar-gen3", .data = &ravb_gen3_hw_info },
2143+
{ .compatible = "renesas,rzg2l-gbeth", .data = &gbeth_hw_info },
20822144
{ }
20832145
};
20842146
MODULE_DEVICE_TABLE(of, ravb_match_table);

0 commit comments

Comments
 (0)