diff mbox

[U-Boot] powerpc/t2080qds: add fdt_fixup_dma3

Message ID 1399633137-4373-1-git-send-email-Shengzhou.Liu@freescale.com
State Superseded
Delegated to: York Sun
Headers show

Commit Message

Shengzhou Liu May 9, 2014, 10:58 a.m. UTC
On T2080 the 3rd DMA is not functional if SRIO2 is chosen in SerDes2.
we add fdt_fixup_dma3() to disable the 3rd DMA if SRIO2 is chosen.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 board/freescale/t208xqds/t208xqds.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
diff mbox

Patch

diff --git a/board/freescale/t208xqds/t208xqds.c b/board/freescale/t208xqds/t208xqds.c
index 9cfc0bd..548d46a 100644
--- a/board/freescale/t208xqds/t208xqds.c
+++ b/board/freescale/t208xqds/t208xqds.c
@@ -433,6 +433,32 @@  int misc_init_r(void)
 	return 0;
 }
 
+void fdt_fixup_dma3(void *blob)
+{
+	/* the 3rd DMA is not functional if SRIO2 is chosen in SerDes2 */
+	int nodeoff;
+	ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+	u32 srds_prtcl_s2 = in_be32(&gur->rcwsr[4]) &
+				    FSL_CORENET2_RCWSR4_SRDS2_PRTCL;
+	srds_prtcl_s2 >>= FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT;
+#define CONFIG_SYS_ELO3_DMA2 (0xffe000000 + 0x102300)
+
+	switch (srds_prtcl_s2) {
+	case 0x29:
+	case 0x2d:
+	case 0x2e:
+		nodeoff = fdt_node_offset_by_compat_reg(blob, "fsl,elo3-dma",
+							CONFIG_SYS_ELO3_DMA2);
+		if (nodeoff > 0)
+			fdt_status_disabled(blob, nodeoff);
+		else
+			printf("\nWARNING unable to set status for dma3\n");
+		break;
+	default:
+		return;
+	}
+}
+
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	phys_addr_t base;
@@ -456,4 +482,5 @@  void ft_board_setup(void *blob, bd_t *bd)
 	fdt_fixup_fman_ethernet(blob);
 	fdt_fixup_board_enet(blob);
 #endif
+	fdt_fixup_dma3(blob);
 }