Skip to content

Commit

Permalink
net: macb: Add default usrio config to default gem config
Browse files Browse the repository at this point in the history
[ Upstream commit b124223 ]

There is no usrio config defined for default gem config leading to
a kernel panic devices that don't define a data. This issue can be
reprdouced with microchip polar fire soc where compatible string
is defined as "cdns,macb".

Fixes: edac638 ("add userio bits as platform configuration")

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
atishp04 authored and gregkh committed Mar 17, 2021
1 parent 98bac6b commit a902066
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/net/ethernet/cadence/macb_main.c
Expand Up @@ -3950,6 +3950,13 @@ static int macb_init(struct platform_device *pdev)
return 0;
}

static const struct macb_usrio_config macb_default_usrio = {
.mii = MACB_BIT(MII),
.rmii = MACB_BIT(RMII),
.rgmii = GEM_BIT(RGMII),
.refclk = MACB_BIT(CLKEN),
};

#if defined(CONFIG_OF)
/* 1518 rounded up */
#define AT91ETHER_MAX_RBUFF_SZ 0x600
Expand Down Expand Up @@ -4435,13 +4442,6 @@ static int fu540_c000_init(struct platform_device *pdev)
return macb_init(pdev);
}

static const struct macb_usrio_config macb_default_usrio = {
.mii = MACB_BIT(MII),
.rmii = MACB_BIT(RMII),
.rgmii = GEM_BIT(RGMII),
.refclk = MACB_BIT(CLKEN),
};

static const struct macb_usrio_config sama7g5_usrio = {
.mii = 0,
.rmii = 1,
Expand Down Expand Up @@ -4590,6 +4590,7 @@ static const struct macb_config default_gem_config = {
.dma_burst_length = 16,
.clk_init = macb_clk_init,
.init = macb_init,
.usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
};

Expand Down

0 comments on commit a902066

Please sign in to comment.