summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c5
-rw-r--r--drivers/net/ethernet/freescale/gianfar.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 65fc7f6..2f67fe8 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -955,6 +955,9 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
/* Find the TBI PHY. If it's not there, we don't support SGMII */
priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
+
+ priv->dma_endian_le = of_property_read_bool(np, "fsl,dma-endian-le");
+
#if defined CONFIG_FSL_GIANFAR_1588
/* Handle IEEE1588 node */
if (!gfar_ptp_init(np, priv))
@@ -2181,6 +2184,8 @@ void gfar_start(struct gfar_private *priv)
/* Initialize DMACTRL to have WWR and WOP */
tempval = gfar_read(&regs->dmactrl);
tempval |= DMACTRL_INIT_SETTINGS;
+ if (priv->dma_endian_le)
+ tempval |= DMACTRL_LE;
gfar_write(&regs->dmactrl, tempval);
/* Make sure we aren't stopped */
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index d27ee80..f7c14a5 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -309,6 +309,7 @@ extern const char gfar_driver_version[];
#endif
#define DMACTRL_GRS 0x00000010
#define DMACTRL_GTS 0x00000008
+#define DMACTRL_LE 0x00008000
#define TSTAT_CLEAR_THALT_ALL 0xFF000000
#define TSTAT_CLEAR_THALT 0x80000000
@@ -1331,6 +1332,9 @@ struct gfar_private {
/* L2 SRAM alloc of BDs */
bd_l2sram_en:1;
+ /* little endian dma buffer and descriptor host interface */
+ unsigned int dma_endian_le;
+
/* The total tx and rx ring size for the enabled queues */
unsigned int total_tx_ring_size;
unsigned int total_rx_ring_size;