2011-10-14 02:58:24 +00:00
|
|
|
/*
|
|
|
|
* ddr_defs.h
|
|
|
|
*
|
|
|
|
* ddr specific header
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2011-10-14 02:58:24 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DDR_DEFS_H
|
|
|
|
#define _DDR_DEFS_H
|
|
|
|
|
|
|
|
#include <asm/arch/hardware.h>
|
2012-07-24 21:55:38 +00:00
|
|
|
#include <asm/emif.h>
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
/* AM335X EMIF Register values */
|
|
|
|
#define VTP_CTRL_READY (0x1 << 5)
|
|
|
|
#define VTP_CTRL_ENABLE (0x1 << 6)
|
|
|
|
#define VTP_CTRL_START_EN (0x1)
|
2013-12-10 09:32:22 +00:00
|
|
|
#ifdef CONFIG_AM43XX
|
|
|
|
#define DDR_CKE_CTRL_NORMAL 0x3
|
|
|
|
#else
|
2012-07-24 21:03:24 +00:00
|
|
|
#define DDR_CKE_CTRL_NORMAL 0x1
|
2013-12-10 09:32:22 +00:00
|
|
|
#endif
|
2013-03-14 21:11:16 +00:00
|
|
|
#define PHY_EN_DYN_PWRDN (0x1 << 20)
|
2011-10-14 02:58:24 +00:00
|
|
|
|
2012-10-18 01:21:12 +00:00
|
|
|
/* Micron MT47H128M16RT-25E */
|
2012-10-18 01:21:13 +00:00
|
|
|
#define MT47H128M16RT25E_EMIF_READ_LATENCY 0x100005
|
|
|
|
#define MT47H128M16RT25E_EMIF_TIM1 0x0666B3C9
|
|
|
|
#define MT47H128M16RT25E_EMIF_TIM2 0x243631CA
|
|
|
|
#define MT47H128M16RT25E_EMIF_TIM3 0x0000033F
|
|
|
|
#define MT47H128M16RT25E_EMIF_SDCFG 0x41805332
|
|
|
|
#define MT47H128M16RT25E_EMIF_SDREF 0x0000081a
|
|
|
|
#define MT47H128M16RT25E_RATIO 0x80
|
|
|
|
#define MT47H128M16RT25E_RD_DQS 0x12
|
|
|
|
#define MT47H128M16RT25E_PHY_WR_DATA 0x40
|
|
|
|
#define MT47H128M16RT25E_PHY_FIFO_WE 0x80
|
|
|
|
#define MT47H128M16RT25E_IOCTRL_VALUE 0x18B
|
2011-10-14 02:58:24 +00:00
|
|
|
|
2012-07-30 21:49:50 +00:00
|
|
|
/* Micron MT41J128M16JT-125 */
|
2013-12-19 04:30:29 +00:00
|
|
|
#define MT41J128MJT125_EMIF_READ_LATENCY 0x100006
|
2012-10-18 01:21:13 +00:00
|
|
|
#define MT41J128MJT125_EMIF_TIM1 0x0888A39B
|
|
|
|
#define MT41J128MJT125_EMIF_TIM2 0x26337FDA
|
|
|
|
#define MT41J128MJT125_EMIF_TIM3 0x501F830F
|
|
|
|
#define MT41J128MJT125_EMIF_SDCFG 0x61C04AB2
|
|
|
|
#define MT41J128MJT125_EMIF_SDREF 0x0000093B
|
|
|
|
#define MT41J128MJT125_ZQ_CFG 0x50074BE4
|
|
|
|
#define MT41J128MJT125_RATIO 0x40
|
|
|
|
#define MT41J128MJT125_INVERT_CLKOUT 0x1
|
|
|
|
#define MT41J128MJT125_RD_DQS 0x3B
|
|
|
|
#define MT41J128MJT125_WR_DQS 0x85
|
|
|
|
#define MT41J128MJT125_PHY_WR_DATA 0xC1
|
|
|
|
#define MT41J128MJT125_PHY_FIFO_WE 0x100
|
|
|
|
#define MT41J128MJT125_IOCTRL_VALUE 0x18B
|
2012-07-30 21:49:50 +00:00
|
|
|
|
2016-05-16 06:17:24 +00:00
|
|
|
/* Micron MT41J128M16JT-125 at 400MHz*/
|
|
|
|
#define MT41J128MJT125_EMIF_READ_LATENCY_400MHz 0x100007
|
|
|
|
#define MT41J128MJT125_EMIF_TIM1_400MHz 0x0AAAD4DB
|
|
|
|
#define MT41J128MJT125_EMIF_TIM2_400MHz 0x26437FDA
|
|
|
|
#define MT41J128MJT125_EMIF_TIM3_400MHz 0x501F83FF
|
|
|
|
#define MT41J128MJT125_EMIF_SDCFG_400MHz 0x61C052B2
|
|
|
|
#define MT41J128MJT125_EMIF_SDREF_400MHz 0x00000C30
|
|
|
|
#define MT41J128MJT125_ZQ_CFG_400MHz 0x50074BE4
|
|
|
|
#define MT41J128MJT125_RATIO_400MHz 0x80
|
|
|
|
#define MT41J128MJT125_INVERT_CLKOUT_400MHz 0x0
|
|
|
|
#define MT41J128MJT125_RD_DQS_400MHz 0x3A
|
|
|
|
#define MT41J128MJT125_WR_DQS_400MHz 0x3B
|
|
|
|
#define MT41J128MJT125_PHY_WR_DATA_400MHz 0x76
|
|
|
|
#define MT41J128MJT125_PHY_FIFO_WE_400MHz 0x96
|
|
|
|
|
2014-01-31 16:34:14 +00:00
|
|
|
/* Micron MT41K128M16JT-187E */
|
|
|
|
#define MT41K128MJT187E_EMIF_READ_LATENCY 0x06
|
|
|
|
#define MT41K128MJT187E_EMIF_TIM1 0x0888B3DB
|
|
|
|
#define MT41K128MJT187E_EMIF_TIM2 0x36337FDA
|
|
|
|
#define MT41K128MJT187E_EMIF_TIM3 0x501F830F
|
|
|
|
#define MT41K128MJT187E_EMIF_SDCFG 0x61C04AB2
|
|
|
|
#define MT41K128MJT187E_EMIF_SDREF 0x0000093B
|
|
|
|
#define MT41K128MJT187E_ZQ_CFG 0x50074BE4
|
|
|
|
#define MT41K128MJT187E_RATIO 0x40
|
|
|
|
#define MT41K128MJT187E_INVERT_CLKOUT 0x1
|
|
|
|
#define MT41K128MJT187E_RD_DQS 0x3B
|
|
|
|
#define MT41K128MJT187E_WR_DQS 0x85
|
|
|
|
#define MT41K128MJT187E_PHY_WR_DATA 0xC1
|
|
|
|
#define MT41K128MJT187E_PHY_FIFO_WE 0x100
|
|
|
|
#define MT41K128MJT187E_IOCTRL_VALUE 0x18B
|
|
|
|
|
2013-11-07 05:57:33 +00:00
|
|
|
/* Micron MT41J64M16JT-125 */
|
|
|
|
#define MT41J64MJT125_EMIF_SDCFG 0x61C04A32
|
|
|
|
|
|
|
|
/* Micron MT41J256M16JT-125 */
|
|
|
|
#define MT41J256MJT125_EMIF_SDCFG 0x61C04B32
|
|
|
|
|
2013-01-11 00:53:31 +00:00
|
|
|
/* Micron MT41J256M8HX-15E */
|
2013-12-19 04:30:29 +00:00
|
|
|
#define MT41J256M8HX15E_EMIF_READ_LATENCY 0x100006
|
2013-01-11 00:53:31 +00:00
|
|
|
#define MT41J256M8HX15E_EMIF_TIM1 0x0888A39B
|
|
|
|
#define MT41J256M8HX15E_EMIF_TIM2 0x26337FDA
|
|
|
|
#define MT41J256M8HX15E_EMIF_TIM3 0x501F830F
|
|
|
|
#define MT41J256M8HX15E_EMIF_SDCFG 0x61C04B32
|
|
|
|
#define MT41J256M8HX15E_EMIF_SDREF 0x0000093B
|
|
|
|
#define MT41J256M8HX15E_ZQ_CFG 0x50074BE4
|
|
|
|
#define MT41J256M8HX15E_RATIO 0x40
|
|
|
|
#define MT41J256M8HX15E_INVERT_CLKOUT 0x1
|
|
|
|
#define MT41J256M8HX15E_RD_DQS 0x3B
|
|
|
|
#define MT41J256M8HX15E_WR_DQS 0x85
|
|
|
|
#define MT41J256M8HX15E_PHY_WR_DATA 0xC1
|
|
|
|
#define MT41J256M8HX15E_PHY_FIFO_WE 0x100
|
|
|
|
#define MT41J256M8HX15E_IOCTRL_VALUE 0x18B
|
|
|
|
|
2013-03-21 04:30:02 +00:00
|
|
|
/* Micron MT41K256M16HA-125E */
|
2013-04-10 13:10:54 +00:00
|
|
|
#define MT41K256M16HA125E_EMIF_READ_LATENCY 0x100007
|
|
|
|
#define MT41K256M16HA125E_EMIF_TIM1 0x0AAAD4DB
|
2013-04-12 16:38:16 +00:00
|
|
|
#define MT41K256M16HA125E_EMIF_TIM2 0x266B7FDA
|
|
|
|
#define MT41K256M16HA125E_EMIF_TIM3 0x501F867F
|
|
|
|
#define MT41K256M16HA125E_EMIF_SDCFG 0x61C05332
|
2013-04-10 13:10:54 +00:00
|
|
|
#define MT41K256M16HA125E_EMIF_SDREF 0xC30
|
2013-03-21 04:30:02 +00:00
|
|
|
#define MT41K256M16HA125E_ZQ_CFG 0x50074BE4
|
2013-04-10 13:10:54 +00:00
|
|
|
#define MT41K256M16HA125E_RATIO 0x80
|
2013-03-21 04:30:02 +00:00
|
|
|
#define MT41K256M16HA125E_INVERT_CLKOUT 0x0
|
2013-04-12 16:38:16 +00:00
|
|
|
#define MT41K256M16HA125E_RD_DQS 0x38
|
|
|
|
#define MT41K256M16HA125E_WR_DQS 0x44
|
|
|
|
#define MT41K256M16HA125E_PHY_WR_DATA 0x7D
|
|
|
|
#define MT41K256M16HA125E_PHY_FIFO_WE 0x94
|
2013-03-21 04:30:02 +00:00
|
|
|
#define MT41K256M16HA125E_IOCTRL_VALUE 0x18B
|
|
|
|
|
2013-01-14 05:32:20 +00:00
|
|
|
/* Micron MT41J512M8RH-125 on EVM v1.5 */
|
2013-12-19 04:30:29 +00:00
|
|
|
#define MT41J512M8RH125_EMIF_READ_LATENCY 0x100006
|
2013-01-14 05:32:20 +00:00
|
|
|
#define MT41J512M8RH125_EMIF_TIM1 0x0888A39B
|
|
|
|
#define MT41J512M8RH125_EMIF_TIM2 0x26517FDA
|
|
|
|
#define MT41J512M8RH125_EMIF_TIM3 0x501F84EF
|
|
|
|
#define MT41J512M8RH125_EMIF_SDCFG 0x61C04BB2
|
|
|
|
#define MT41J512M8RH125_EMIF_SDREF 0x0000093B
|
|
|
|
#define MT41J512M8RH125_ZQ_CFG 0x50074BE4
|
|
|
|
#define MT41J512M8RH125_RATIO 0x80
|
|
|
|
#define MT41J512M8RH125_INVERT_CLKOUT 0x0
|
|
|
|
#define MT41J512M8RH125_RD_DQS 0x3B
|
|
|
|
#define MT41J512M8RH125_WR_DQS 0x3C
|
|
|
|
#define MT41J512M8RH125_PHY_FIFO_WE 0xA5
|
|
|
|
#define MT41J512M8RH125_PHY_WR_DATA 0x74
|
|
|
|
#define MT41J512M8RH125_IOCTRL_VALUE 0x18B
|
2013-01-11 00:53:31 +00:00
|
|
|
|
2013-04-04 22:27:57 +00:00
|
|
|
/* Samsung K4B2G1646E-BIH9 */
|
2013-12-19 04:30:29 +00:00
|
|
|
#define K4B2G1646EBIH9_EMIF_READ_LATENCY 0x100007
|
2013-09-10 09:12:26 +00:00
|
|
|
#define K4B2G1646EBIH9_EMIF_TIM1 0x0AAAE51B
|
|
|
|
#define K4B2G1646EBIH9_EMIF_TIM2 0x2A1D7FDA
|
|
|
|
#define K4B2G1646EBIH9_EMIF_TIM3 0x501F83FF
|
|
|
|
#define K4B2G1646EBIH9_EMIF_SDCFG 0x61C052B2
|
|
|
|
#define K4B2G1646EBIH9_EMIF_SDREF 0x00000C30
|
2013-04-04 22:27:57 +00:00
|
|
|
#define K4B2G1646EBIH9_ZQ_CFG 0x50074BE4
|
2013-09-10 09:12:26 +00:00
|
|
|
#define K4B2G1646EBIH9_RATIO 0x80
|
|
|
|
#define K4B2G1646EBIH9_INVERT_CLKOUT 0x0
|
|
|
|
#define K4B2G1646EBIH9_RD_DQS 0x35
|
|
|
|
#define K4B2G1646EBIH9_WR_DQS 0x3A
|
|
|
|
#define K4B2G1646EBIH9_PHY_FIFO_WE 0x97
|
|
|
|
#define K4B2G1646EBIH9_PHY_WR_DATA 0x76
|
2013-04-04 22:27:57 +00:00
|
|
|
#define K4B2G1646EBIH9_IOCTRL_VALUE 0x18B
|
|
|
|
|
2013-12-10 09:32:22 +00:00
|
|
|
#define LPDDR2_ADDRCTRL_IOCTRL_VALUE 0x294
|
|
|
|
#define LPDDR2_ADDRCTRL_WD0_IOCTRL_VALUE 0x00000000
|
|
|
|
#define LPDDR2_ADDRCTRL_WD1_IOCTRL_VALUE 0x00000000
|
|
|
|
#define LPDDR2_DATA0_IOCTRL_VALUE 0x20000294
|
|
|
|
#define LPDDR2_DATA1_IOCTRL_VALUE 0x20000294
|
|
|
|
#define LPDDR2_DATA2_IOCTRL_VALUE 0x20000294
|
|
|
|
#define LPDDR2_DATA3_IOCTRL_VALUE 0x20000294
|
|
|
|
|
2013-12-10 09:32:23 +00:00
|
|
|
#define DDR3_ADDRCTRL_WD0_IOCTRL_VALUE 0x00000000
|
|
|
|
#define DDR3_ADDRCTRL_WD1_IOCTRL_VALUE 0x00000000
|
|
|
|
#define DDR3_ADDRCTRL_IOCTRL_VALUE 0x84
|
|
|
|
#define DDR3_DATA0_IOCTRL_VALUE 0x84
|
|
|
|
#define DDR3_DATA1_IOCTRL_VALUE 0x84
|
|
|
|
#define DDR3_DATA2_IOCTRL_VALUE 0x84
|
|
|
|
#define DDR3_DATA3_IOCTRL_VALUE 0x84
|
|
|
|
|
2013-03-15 10:07:07 +00:00
|
|
|
/**
|
|
|
|
* Configure DMM
|
|
|
|
*/
|
|
|
|
void config_dmm(const struct dmm_lisa_map_regs *regs);
|
|
|
|
|
2011-10-14 02:58:24 +00:00
|
|
|
/**
|
|
|
|
* Configure SDRAM
|
|
|
|
*/
|
2013-03-15 10:07:03 +00:00
|
|
|
void config_sdram(const struct emif_regs *regs, int nr);
|
2013-12-10 09:32:22 +00:00
|
|
|
void config_sdram_emif4d5(const struct emif_regs *regs, int nr);
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set SDRAM timings
|
|
|
|
*/
|
2013-03-15 10:07:03 +00:00
|
|
|
void set_sdram_timings(const struct emif_regs *regs, int nr);
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure DDR PHY
|
|
|
|
*/
|
2013-03-15 10:07:03 +00:00
|
|
|
void config_ddr_phy(const struct emif_regs *regs, int nr);
|
|
|
|
|
|
|
|
struct ddr_cmd_regs {
|
|
|
|
unsigned int resv0[7];
|
|
|
|
unsigned int cm0csratio; /* offset 0x01C */
|
2013-11-07 16:42:57 +00:00
|
|
|
unsigned int resv1[3];
|
2013-03-15 10:07:03 +00:00
|
|
|
unsigned int cm0iclkout; /* offset 0x02C */
|
|
|
|
unsigned int resv2[8];
|
|
|
|
unsigned int cm1csratio; /* offset 0x050 */
|
2013-11-07 16:42:57 +00:00
|
|
|
unsigned int resv3[3];
|
2013-03-15 10:07:03 +00:00
|
|
|
unsigned int cm1iclkout; /* offset 0x060 */
|
|
|
|
unsigned int resv4[8];
|
|
|
|
unsigned int cm2csratio; /* offset 0x084 */
|
2013-11-07 16:42:57 +00:00
|
|
|
unsigned int resv5[3];
|
2013-03-15 10:07:03 +00:00
|
|
|
unsigned int cm2iclkout; /* offset 0x094 */
|
|
|
|
unsigned int resv6[3];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ddr_data_regs {
|
|
|
|
unsigned int dt0rdsratio0; /* offset 0x0C8 */
|
|
|
|
unsigned int resv1[4];
|
|
|
|
unsigned int dt0wdsratio0; /* offset 0x0DC */
|
|
|
|
unsigned int resv2[4];
|
|
|
|
unsigned int dt0wiratio0; /* offset 0x0F0 */
|
|
|
|
unsigned int resv3;
|
|
|
|
unsigned int dt0wimode0; /* offset 0x0F8 */
|
|
|
|
unsigned int dt0giratio0; /* offset 0x0FC */
|
|
|
|
unsigned int resv4;
|
|
|
|
unsigned int dt0gimode0; /* offset 0x104 */
|
|
|
|
unsigned int dt0fwsratio0; /* offset 0x108 */
|
|
|
|
unsigned int resv5[4];
|
|
|
|
unsigned int dt0dqoffset; /* offset 0x11C */
|
|
|
|
unsigned int dt0wrsratio0; /* offset 0x120 */
|
|
|
|
unsigned int resv6[4];
|
|
|
|
unsigned int dt0rdelays0; /* offset 0x134 */
|
|
|
|
unsigned int dt0dldiff0; /* offset 0x138 */
|
|
|
|
unsigned int resv7[12];
|
|
|
|
};
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This structure represents the DDR registers on AM33XX devices.
|
2012-07-30 18:49:47 +00:00
|
|
|
* We make use of DDR_PHY_BASE_ADDR2 to address the DATA1 registers that
|
|
|
|
* correspond to DATA1 registers defined here.
|
2011-10-14 02:58:24 +00:00
|
|
|
*/
|
|
|
|
struct ddr_regs {
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv0[3];
|
|
|
|
unsigned int cm0config; /* offset 0x00C */
|
|
|
|
unsigned int cm0configclk; /* offset 0x010 */
|
2012-07-30 18:49:47 +00:00
|
|
|
unsigned int resv1[2];
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int cm0csratio; /* offset 0x01C */
|
2013-11-07 16:42:57 +00:00
|
|
|
unsigned int resv2[3];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int cm0iclkout; /* offset 0x02C */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv3[4];
|
|
|
|
unsigned int cm1config; /* offset 0x040 */
|
|
|
|
unsigned int cm1configclk; /* offset 0x044 */
|
|
|
|
unsigned int resv4[2];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int cm1csratio; /* offset 0x050 */
|
2013-11-07 16:42:57 +00:00
|
|
|
unsigned int resv5[3];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int cm1iclkout; /* offset 0x060 */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv6[4];
|
|
|
|
unsigned int cm2config; /* offset 0x074 */
|
|
|
|
unsigned int cm2configclk; /* offset 0x078 */
|
|
|
|
unsigned int resv7[2];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int cm2csratio; /* offset 0x084 */
|
2013-11-07 16:42:57 +00:00
|
|
|
unsigned int resv8[3];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int cm2iclkout; /* offset 0x094 */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv9[12];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int dt0rdsratio0; /* offset 0x0C8 */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv10[4];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int dt0wdsratio0; /* offset 0x0DC */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv11[4];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int dt0wiratio0; /* offset 0x0F0 */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv12;
|
2012-07-30 18:49:47 +00:00
|
|
|
unsigned int dt0wimode0; /* offset 0x0F8 */
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int dt0giratio0; /* offset 0x0FC */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv13;
|
2012-07-30 18:49:47 +00:00
|
|
|
unsigned int dt0gimode0; /* offset 0x104 */
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int dt0fwsratio0; /* offset 0x108 */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv14[4];
|
2012-07-30 18:49:47 +00:00
|
|
|
unsigned int dt0dqoffset; /* offset 0x11C */
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int dt0wrsratio0; /* offset 0x120 */
|
2013-07-02 10:05:59 +00:00
|
|
|
unsigned int resv15[4];
|
2011-10-14 02:58:24 +00:00
|
|
|
unsigned int dt0rdelays0; /* offset 0x134 */
|
|
|
|
unsigned int dt0dldiff0; /* offset 0x138 */
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Encapsulates DDR CMD control registers.
|
|
|
|
*/
|
|
|
|
struct cmd_control {
|
|
|
|
unsigned long cmd0csratio;
|
|
|
|
unsigned long cmd0csforce;
|
|
|
|
unsigned long cmd0csdelay;
|
|
|
|
unsigned long cmd0iclkout;
|
|
|
|
unsigned long cmd1csratio;
|
|
|
|
unsigned long cmd1csforce;
|
|
|
|
unsigned long cmd1csdelay;
|
|
|
|
unsigned long cmd1iclkout;
|
|
|
|
unsigned long cmd2csratio;
|
|
|
|
unsigned long cmd2csforce;
|
|
|
|
unsigned long cmd2csdelay;
|
|
|
|
unsigned long cmd2iclkout;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Encapsulates DDR DATA registers.
|
|
|
|
*/
|
|
|
|
struct ddr_data {
|
|
|
|
unsigned long datardsratio0;
|
|
|
|
unsigned long datawdsratio0;
|
|
|
|
unsigned long datawiratio0;
|
|
|
|
unsigned long datagiratio0;
|
|
|
|
unsigned long datafwsratio0;
|
|
|
|
unsigned long datawrsratio0;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure DDR CMD control registers
|
|
|
|
*/
|
2013-03-15 10:07:03 +00:00
|
|
|
void config_cmd_ctrl(const struct cmd_control *cmd, int nr);
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure DDR DATA registers
|
|
|
|
*/
|
2013-03-15 10:07:03 +00:00
|
|
|
void config_ddr_data(const struct ddr_data *data, int nr);
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This structure represents the DDR io control on AM33XX devices.
|
|
|
|
*/
|
|
|
|
struct ddr_cmdtctrl {
|
|
|
|
unsigned int cm0ioctl;
|
|
|
|
unsigned int cm1ioctl;
|
|
|
|
unsigned int cm2ioctl;
|
|
|
|
unsigned int resv2[12];
|
|
|
|
unsigned int dt0ioctl;
|
|
|
|
unsigned int dt1ioctl;
|
2013-12-10 09:32:22 +00:00
|
|
|
unsigned int dt2ioctrl;
|
|
|
|
unsigned int dt3ioctrl;
|
|
|
|
unsigned int resv3[4];
|
|
|
|
unsigned int emif_sdram_config_ext;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ctrl_ioregs {
|
|
|
|
unsigned int cm0ioctl;
|
|
|
|
unsigned int cm1ioctl;
|
|
|
|
unsigned int cm2ioctl;
|
|
|
|
unsigned int dt0ioctl;
|
|
|
|
unsigned int dt1ioctl;
|
|
|
|
unsigned int dt2ioctrl;
|
|
|
|
unsigned int dt3ioctrl;
|
|
|
|
unsigned int emif_sdram_config_ext;
|
2011-10-14 02:58:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure DDR io control registers
|
|
|
|
*/
|
2013-12-10 09:32:22 +00:00
|
|
|
void config_io_ctrl(const struct ctrl_ioregs *ioregs);
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
struct ddr_ctrl {
|
|
|
|
unsigned int ddrioctrl;
|
|
|
|
unsigned int resv1[325];
|
|
|
|
unsigned int ddrckectrl;
|
|
|
|
};
|
|
|
|
|
2013-12-10 09:32:22 +00:00
|
|
|
void config_ddr(unsigned int pll, const struct ctrl_ioregs *ioregs,
|
2012-10-18 01:21:12 +00:00
|
|
|
const struct ddr_data *data, const struct cmd_control *ctrl,
|
2013-03-15 10:07:03 +00:00
|
|
|
const struct emif_regs *regs, int nr);
|
2013-12-10 09:32:22 +00:00
|
|
|
void emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size);
|
2011-10-14 02:58:24 +00:00
|
|
|
|
|
|
|
#endif /* _DDR_DEFS_H */
|