ravb: Add aligned_tx to struct ravb_hw_info

R-Car Gen2 needs a 4byte aligned address for the transmission buffer,
whereas R-Car Gen3 doesn't have any such restriction.

Add aligned_tx to struct ravb_hw_info to select the driver to choose
between aligned and unaligned tx buffers.

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>
This commit is contained in:
Biju Das
2021-08-18 20:07:54 +01:00
committed by David S. Miller
parent ebb091461a
commit 68ca3c9232
2 changed files with 3 additions and 1 deletions

View File

@@ -990,6 +990,7 @@ enum ravb_chip_id {
struct ravb_hw_info {
enum ravb_chip_id chip_id;
unsigned aligned_tx: 1;
};
struct ravb_private {

View File

@@ -1930,6 +1930,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
static const struct ravb_hw_info ravb_gen2_hw_info = {
.chip_id = RCAR_GEN2,
.aligned_tx = 1,
};
static const struct of_device_id ravb_match_table[] = {
@@ -2140,7 +2141,7 @@ static int ravb_probe(struct platform_device *pdev)
ndev->max_mtu = 2048 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
ndev->min_mtu = ETH_MIN_MTU;
priv->num_tx_desc = info->chip_id == RCAR_GEN2 ?
priv->num_tx_desc = info->aligned_tx ?
NUM_TX_DESC_GEN2 : NUM_TX_DESC_GEN3;
/* Set function */