From: Colin Cross Date: Wed, 8 Dec 2010 02:27:28 +0000 (-0800) Subject: ARM: tegra: stingray: Add emc tables X-Git-Tag: firefly_0821_release~9834^2~242 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9923a076ec37d065aa786871e42699a7f5072eb9;p=firefly-linux-kernel-4.4.55.git ARM: tegra: stingray: Add emc tables Change-Id: I2fb991478c527fc3fc4355110c524037b4e4d372 Signed-off-by: Colin Cross --- diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index 3fc877683894..dc7828a23fd2 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -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 index 000000000000..47f462c70c2c --- /dev/null +++ b/arch/arm/mach-tegra/board-stingray-memory.c @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2010 Google, Inc. + * + * Author: + * Colin Cross + * + * 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 + +#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)); +} diff --git a/arch/arm/mach-tegra/board-stingray.c b/arch/arm/mach-tegra/board-stingray.c index 9ef8c700ec89..e366b8a59823 100644 --- a/arch/arm/mach-tegra/board-stingray.c +++ b/arch/arm/mach-tegra/board-stingray.c @@ -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 diff --git a/arch/arm/mach-tegra/board-stingray.h b/arch/arm/mach-tegra/board-stingray.h index 9a107ae5ee2f..33353ddf63cd 100644 --- a/arch/arm/mach-tegra/board-stingray.h +++ b/arch/arm/mach-tegra/board-stingray.h @@ -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)