ARM: tegra: stingray: Add emc tables
authorColin Cross <ccross@android.com>
Wed, 8 Dec 2010 02:27:28 +0000 (18:27 -0800)
committerColin Cross <ccross@android.com>
Wed, 15 Dec 2010 20:35:19 +0000 (12:35 -0800)
Change-Id: I2fb991478c527fc3fc4355110c524037b4e4d372
Signed-off-by: Colin Cross <ccross@android.com>
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-stingray-memory.c [new file with mode: 0644]
arch/arm/mach-tegra/board-stingray.c
arch/arm/mach-tegra/board-stingray.h

index 3fc877683894e4e176a6ff8925c22ea58d4104f2..dc7828a23fd226172dec8eb920435c2bf3a9edfa 100644 (file)
@@ -71,3 +71,4 @@ obj-${CONFIG_MACH_STINGRAY}             += board-stingray-bluetooth.o
 obj-${CONFIG_MACH_STINGRAY}             += board-stingray-gps.o
 obj-${CONFIG_MACH_STINGRAY}             += board-stingray-usbnet.o
 obj-${CONFIG_MACH_STINGRAY}             += board-stingray-bootinfo.o
+obj-${CONFIG_MACH_STINGRAY}             += board-stingray-memory.o
diff --git a/arch/arm/mach-tegra/board-stingray-memory.c b/arch/arm/mach-tegra/board-stingray-memory.c
new file mode 100644 (file)
index 0000000..47f462c
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Author:
+ *     Colin Cross <ccross@google.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/kernel.h>
+
+#include "board-stingray.h"
+#include "tegra2_emc.h"
+
+static const struct tegra_emc_table stingray_emc_tables[] = {
+       {
+               .rate = 150000,   /* SDRAM frquency */
+               .regs = {
+                       0x00000009,   /* RC */
+                       0x00000014,   /* RFC */
+                       0x00000007,   /* RAS */
+                       0x00000003,   /* RP */
+                       0x00000006,   /* R2W */
+                       0x00000004,   /* W2R */
+                       0x00000002,   /* R2P */
+                       0x00000009,   /* W2P */
+                       0x00000003,   /* RD_RCD */
+                       0x00000003,   /* WR_RCD */
+                       0x00000002,   /* RRD */
+                       0x00000002,   /* REXT */
+                       0x00000002,   /* WDV */
+                       0x00000005,   /* QUSE */
+                       0x00000003,   /* QRST */
+                       0x00000008,   /* QSAFE */
+                       0x0000000b,   /* RDV */
+                       0x0000021f,   /* REFRESH */
+                       0x00000000,   /* BURST_REFRESH_NUM */
+                       0x00000003,   /* PDEX2WR */
+                       0x00000003,   /* PDEX2RD */
+                       0x00000003,   /* PCHG2PDEN */
+                       0x00000008,   /* ACT2PDEN */
+                       0x00000001,   /* AR2PDEN */
+                       0x0000000a,   /* RW2PDEN */
+                       0x00000015,   /* TXSR */
+                       0x00000003,   /* TCKE */
+                       0x00000008,   /* TFAW */
+                       0x00000004,   /* TRPAB */
+                       0x00000006,   /* TCLKSTABLE */
+                       0x00000002,   /* TCLKSTOP */
+                       0x00000270,   /* TREFBW */
+                       0x00000004,   /* QUSE_EXTRA */
+                       0x00000001,   /* FBIO_CFG6 */
+                       0x00000000,   /* ODT_WRITE */
+                       0x00000000,   /* ODT_READ */
+                       0x00000082,   /* FBIO_CFG5 */
+                       0xa06804ae,   /* CFG_DIG_DLL */
+                       0x007fe010,   /* DLL_XFORM_DQS */
+                       0x00000000,   /* DLL_XFORM_QUSE */
+                       0x00000000,   /* ZCAL_REF_CNT */
+                       0x0000000e,   /* ZCAL_WAIT_CNT */
+                       0x00000000,   /* AUTO_CAL_INTERVAL */
+                       0x00000000,   /* CFG_CLKTRIM_0 */
+                       0x00000000,   /* CFG_CLKTRIM_1 */
+                       0x00000000,   /* CFG_CLKTRIM_2 */
+               }
+       },
+       {
+               .rate = 300000,   /* SDRAM frquency */
+               .regs = {
+                       0x00000012,   /* RC */
+                       0x00000027,   /* RFC */
+                       0x0000000d,   /* RAS */
+                       0x00000006,   /* RP */
+                       0x00000007,   /* R2W */
+                       0x00000005,   /* W2R */
+                       0x00000003,   /* R2P */
+                       0x00000009,   /* W2P */
+                       0x00000006,   /* RD_RCD */
+                       0x00000006,   /* WR_RCD */
+                       0x00000003,   /* RRD */
+                       0x00000003,   /* REXT */
+                       0x00000002,   /* WDV */
+                       0x00000006,   /* QUSE */
+                       0x00000003,   /* QRST */
+                       0x00000009,   /* QSAFE */
+                       0x0000000c,   /* RDV */
+                       0x0000045f,   /* REFRESH */
+                       0x00000000,   /* BURST_REFRESH_NUM */
+                       0x00000004,   /* PDEX2WR */
+                       0x00000004,   /* PDEX2RD */
+                       0x00000006,   /* PCHG2PDEN */
+                       0x00000008,   /* ACT2PDEN */
+                       0x00000001,   /* AR2PDEN */
+                       0x0000000e,   /* RW2PDEN */
+                       0x0000002a,   /* TXSR */
+                       0x00000003,   /* TCKE */
+                       0x0000000f,   /* TFAW */
+                       0x00000007,   /* TRPAB */
+                       0x00000005,   /* TCLKSTABLE */
+                       0x00000002,   /* TCLKSTOP */
+                       0x000004e0,   /* TREFBW */
+                       0x00000005,   /* QUSE_EXTRA */
+                       0x00000002,   /* FBIO_CFG6 */
+                       0x00000000,   /* ODT_WRITE */
+                       0x00000000,   /* ODT_READ */
+                       0x00000282,   /* FBIO_CFG5 */
+                       0xe04c048b,   /* CFG_DIG_DLL */
+                       0x007fd010,   /* DLL_XFORM_DQS */
+                       0x00000000,   /* DLL_XFORM_QUSE */
+                       0x00000000,   /* ZCAL_REF_CNT */
+                       0x0000001b,   /* ZCAL_WAIT_CNT */
+                       0x00000000,   /* AUTO_CAL_INTERVAL */
+                       0x00000000,   /* CFG_CLKTRIM_0 */
+                       0x00000000,   /* CFG_CLKTRIM_1 */
+                       0x00000000,   /* CFG_CLKTRIM_2 */
+               }
+       },
+};
+
+void stingray_init_emc(void)
+{
+       tegra_init_emc(stingray_emc_tables, ARRAY_SIZE(stingray_emc_tables));
+}
index 9ef8c700ec89211ec1d9b6c0df4cae9c92eedbc2..e366b8a59823a28870d192982ee30e0502f9f61d 100644 (file)
@@ -897,6 +897,7 @@ static void __init tegra_stingray_init(void)
 
        tegra_common_init();
        tegra_init_suspend(&stingray_suspend);
+       stingray_init_emc();
 
        /* Stingray has a USB switch that disconnects the usb port from the T20
           unless a factory cable is used, the factory jumper is set, or the
index 9a107ae5ee2f2a1791757e6f4c451d4c6f298018..33353ddf63cd75fbc76db498c0c8ec93f660b373 100644 (file)
@@ -30,6 +30,7 @@ unsigned int stingray_revision(void);
 unsigned int stingray_powerup_reason (void);
 void stingray_gps_init(void);
 int stingray_qbp_usb_hw_bypass_enabled(void);
+void stingray_init_emc(void);
 
 /* as defined in the bootloader*/
 #define HWREV(x)    (((x)>>16) & 0xFFFF)