aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-09 23:38:02 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-09 23:38:02 -0400
commit3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14 (patch)
tree02e95f15bd8a04071a9a36f534a92a066a8ce66a /drivers/net/ethernet/cadence
parentnet: bcmgenet: core changes for supporting multiple Rx queues (diff)
parentMerge git://git.kernel.org/pub/scm/virt/kvm/kvm (diff)
downloadlinux-dev-3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14.tar.xz
linux-dev-3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14.zip
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')
-rw-r--r--drivers/net/ethernet/cadence/macb.c26
-rw-r--r--drivers/net/ethernet/cadence/macb.h2
2 files changed, 22 insertions, 6 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,
};
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 21e4147d8b5c..bc6e35c40822 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -353,7 +353,7 @@
/* Bitfields in MID */
#define MACB_IDNUM_OFFSET 16
-#define MACB_IDNUM_SIZE 16
+#define MACB_IDNUM_SIZE 12
#define MACB_REV_OFFSET 0
#define MACB_REV_SIZE 16