From 992eb6ff881792f5c753ef6c85be0ceb2d162c78 Mon Sep 17 00:00:00 2001
From: Joel Fernandes <agnel.joel@gmail.com>
Date: Tue, 7 Jun 2011 09:50:03 +0200
Subject: [PATCH] Beagle Rev C5 support

---
 board/omap3530beagle/omap3530beagle.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/board/omap3530beagle/omap3530beagle.c b/board/omap3530beagle/omap3530beagle.c
index 15943f5..2b8c3c0 100644
--- a/board/omap3530beagle/omap3530beagle.c
+++ b/board/omap3530beagle/omap3530beagle.c
@@ -281,6 +281,7 @@ u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
 
 #define MICRON_DDR	0
 #define NUMONYX_MCP	1
+#define MICRON_MCP	2
 int identify_xm_ddr()
 {
 	int	mfr, id;
@@ -303,6 +304,8 @@ int identify_xm_ddr()
 		return MICRON_DDR;
 	if ((mfr == 0x20) && (id == 0xba))
 		return NUMONYX_MCP;
+	if ((mfr == 0x2c) && (id == 0xbc))
+		return MICRON_MCP;
 }
 /*********************************************************************
  * config_3430sdram_ddr() - Init DDR on 3430SDP dev board.
@@ -329,6 +332,17 @@ void config_3430sdram_ddr(void)
 			__raw_writel(NUMONYX_V_ACTIMB_165, SDRC_ACTIM_CTRLB_1);
 			__raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_0);
 			__raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_1);
+		} else if (identify_xm_ddr() == MICRON_MCP) {
+			/* Beagleboard Rev C5 */
+			__raw_writel(0x2, SDRC_CS_CFG); /* 256MB/bank */
+			__raw_writel(SDP_SDRC_MDCFG_0_DDR_MICRON_XM, SDRC_MCFG_0);
+			__raw_writel(SDP_SDRC_MDCFG_0_DDR_MICRON_XM, SDRC_MCFG_1);
+			__raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_0);
+			__raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_0);
+			__raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_1);
+			__raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_1);
+			__raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_0);
+			__raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_1);
 		} else {
 			__raw_writel(0x1, SDRC_CS_CFG); /* 128MB/bank */
 			__raw_writel(SDP_SDRC_MDCFG_0_DDR, SDRC_MCFG_0);
@@ -699,6 +713,8 @@ int misc_init_r(void)
 	case REVISION_C4:
 		if (identify_xm_ddr() == NUMONYX_MCP)
 			printf("Beagle Rev C4 from Special Computing\n");
+		else if(identify_xm_ddr() == MICRON_MCP)
+			printf("Beagle Rev C5\n");
 		else
 			printf("Beagle Rev C4\n");
 		break;
-- 
1.6.6.1

