diff options
author | David S. Miller <davem@davemloft.net> | 2015-03-09 23:38:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-09 23:38:02 -0400 |
commit | 3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14 (patch) | |
tree | 02e95f15bd8a04071a9a36f534a92a066a8ce66a /drivers/net/ethernet/cadence/macb.c | |
parent | 8ac467e837a24eb024177b4b01013d8e6764913a (diff) | |
parent | affb8172de395a6e1db52ed9790ca0456d8c29a9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/cadence/macb.c
Overlapping changes in macb driver, mostly fixes and cleanups
in 'net' overlapping with the integration of at91_ether into
macb in 'net-next'.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cadence/macb.c')
-rw-r--r-- | drivers/net/ethernet/cadence/macb.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index a4c5462c071a..f032e2a245b0 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -2131,8 +2131,24 @@ static const struct net_device_ops macb_netdev_ops = { */ static void macb_configure_caps(struct macb *bp) { + const struct of_device_id *match; + const struct macb_config *config; u32 dcfg; + if (bp->pdev->dev.of_node) { + match = of_match_node(macb_dt_ids, bp->pdev->dev.of_node); + if (match && match->data) { + config = match->data; + + bp->caps = config->caps; + /* + * As we have access to the matching node, configure + * DMA burst length as well + */ + bp->dma_burst_length = config->dma_burst_length; + } + } + if (MACB_BFEXT(IDNUM, macb_readl(bp, MID)) == 0x2) bp->caps |= MACB_CAPS_MACB_IS_GEM; @@ -2636,30 +2652,30 @@ err_disable_clk: return err; } -static struct macb_config at91sam9260_config = { +static const struct macb_config at91sam9260_config = { .caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII, .init = macb_init, }; -static struct macb_config pc302gem_config = { +static const struct macb_config pc302gem_config = { .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE, .dma_burst_length = 16, .init = macb_init, }; -static struct macb_config sama5d3_config = { +static const struct macb_config sama5d3_config = { .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE, .dma_burst_length = 16, .init = macb_init, }; -static struct macb_config sama5d4_config = { +static const struct macb_config sama5d4_config = { .caps = 0, .dma_burst_length = 4, .init = macb_init, }; -static struct macb_config emac_config = { +static const struct macb_config emac_config = { .init = at91ether_init, }; |