summaryrefslogtreecommitdiff
path: root/src/cpu/samsung/exynos5420/dmc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/samsung/exynos5420/dmc.h')
-rw-r--r--src/cpu/samsung/exynos5420/dmc.h208
1 files changed, 129 insertions, 79 deletions
diff --git a/src/cpu/samsung/exynos5420/dmc.h b/src/cpu/samsung/exynos5420/dmc.h
index cd5ff23275..df7797df81 100644
--- a/src/cpu/samsung/exynos5420/dmc.h
+++ b/src/cpu/samsung/exynos5420/dmc.h
@@ -18,17 +18,68 @@
#ifndef CPU_SAMSUNG_EXYNOS5420_DMC_H
#define CPU_SAMSUNG_EXYNOS5420_DMC_H
+#define DMC_INTERLEAVE_SIZE 0x1f
+
+/* CONCONTROL register fields */
+#define CONCONTROL_DFI_INIT_START_SHIFT 28
+#define CONCONTROL_RD_FETCH_SHIFT 12
+#define CONCONTROL_RD_FETCH_MASK (0x7 << CONCONTROL_RD_FETCH_SHIFT)
+#define CONCONTROL_AREF_EN_SHIFT 5
+
+/* PRECHCONFIG register field */
+#define PRECHCONFIG_TP_CNT_SHIFT 24
+
+/* PWRDNCONFIG register field */
+#define PWRDNCONFIG_DPWRDN_CYC_SHIFT 0
+#define PWRDNCONFIG_DSREF_CYC_SHIFT 16
+
+/* PHY_CON0 register fields */
+#define PHY_CON0_T_WRRDCMD_SHIFT 17
+#define PHY_CON0_T_WRRDCMD_MASK (0x7 << PHY_CON0_T_WRRDCMD_SHIFT)
+#define PHY_CON0_CTRL_DDR_MODE_MASK 0x3
+#define PHY_CON0_CTRL_DDR_MODE_SHIFT 11
+
+/* PHY_CON1 register fields */
+#define PHY_CON1_RDLVL_RDDATA_ADJ_SHIFT 0
+
+/* PHY_CON12 register fields */
+#define PHY_CON12_CTRL_START_POINT_SHIFT 24
+#define PHY_CON12_CTRL_INC_SHIFT 16
+#define PHY_CON12_CTRL_FORCE_SHIFT 8
+#define PHY_CON12_CTRL_START_SHIFT 6
+#define PHY_CON12_CTRL_START_MASK (1 << PHY_CON12_CTRL_START_SHIFT)
+#define PHY_CON12_CTRL_DLL_ON_SHIFT 5
+#define PHY_CON12_CTRL_DLL_ON_MASK (1 << PHY_CON12_CTRL_DLL_ON_SHIFT)
+#define PHY_CON12_CTRL_REF_SHIFT 1
+
+/* PHY_CON16 register fields */
+#define PHY_CON16_ZQ_MODE_DDS_SHIFT 24
+#define PHY_CON16_ZQ_MODE_DDS_MASK (0x7 << PHY_CON16_ZQ_MODE_DDS_SHIFT)
+
+#define PHY_CON16_ZQ_MODE_TERM_SHIFT 21
+#define PHY_CON16_ZQ_MODE_TERM_MASK (0x7 << PHY_CON16_ZQ_MODE_TERM_SHIFT)
+
+#define PHY_CON16_ZQ_MODE_NOTERM_MASK (1 << 19)
+
+/* PHY_CON42 register fields */
+#define PHY_CON42_CTRL_BSTLEN_SHIFT 8
+#define PHY_CON42_CTRL_BSTLEN_MASK (0xff << PHY_CON42_CTRL_BSTLEN_SHIFT)
+
+#define PHY_CON42_CTRL_RDLAT_SHIFT 0
+#define PHY_CON42_CTRL_RDLAT_MASK (0x1f << PHY_CON42_CTRL_RDLAT_SHIFT)
+
#ifndef __ASSEMBLER__
struct exynos5_dmc {
unsigned int concontrol;
unsigned int memcontrol;
- unsigned int memconfig0;
+ unsigned int cgcontrol;
unsigned int memconfig1;
unsigned int directcmd;
- unsigned int prechconfig;
+ unsigned int prechconfig0;
unsigned int phycontrol0;
- unsigned char res1[0xc];
- unsigned int pwrdnconfig;
+ unsigned int prechconfig1;
+ unsigned char res1[0x8];
+ unsigned int pwrdnconfig; /* 0x0028*/
unsigned int timingpzq;
unsigned int timingref;
unsigned int timingrow;
@@ -36,12 +87,12 @@ struct exynos5_dmc {
unsigned int timingpower;
unsigned int phystatus;
unsigned char res2[0x4];
- unsigned int chipstatus_ch0;
+ unsigned int chipstatus_ch0; /* 0x0048 */
unsigned int chipstatus_ch1;
unsigned char res3[0x4];
unsigned int mrstatus;
unsigned char res4[0x8];
- unsigned int qoscontrol0;
+ unsigned int qoscontrol0; /* 0x0060 */
unsigned char resr5[0x4];
unsigned int qoscontrol1;
unsigned char res6[0x4];
@@ -72,45 +123,83 @@ struct exynos5_dmc {
unsigned int qoscontrol14;
unsigned char res19[0x4];
unsigned int qoscontrol15;
- unsigned char res20[0x14];
+ unsigned char res20[0x4];
+ unsigned int timing_set_sw; /* 0x00e0 */
+ unsigned int timingrow1;
+ unsigned int timingdata1;
+ unsigned int timingpower1;
unsigned int ivcontrol;
unsigned int wrtra_config;
unsigned int rdlvl_config;
- unsigned char res21[0x8];
+ unsigned char res21[0x4];
+ unsigned int brbrsvcontrol; /* 0x0100*/
unsigned int brbrsvconfig;
unsigned int brbqosconfig;
unsigned int membaseconfig0;
- unsigned int membaseconfig1;
+ unsigned int membaseconfig1; /* 0x0110 */
unsigned char res22[0xc];
- unsigned int wrlvl_config;
- unsigned char res23[0xc];
- unsigned int perevcontrol;
+ unsigned int wrlvl_config0; /* 0x0120 */
+ unsigned int wrlvl_config1;
+ unsigned int wrlvl_status;
+ unsigned char res23[0x4];
+ unsigned int perevcontrol; /* 0x0130 */
unsigned int perev0config;
unsigned int perev1config;
unsigned int perev2config;
unsigned int perev3config;
- unsigned char res24[0xdebc];
- unsigned int pmnc_ppc_a;
- unsigned char res25[0xc];
- unsigned int cntens_ppc_a;
- unsigned char res26[0xc];
- unsigned int cntenc_ppc_a;
- unsigned char res27[0xc];
- unsigned int intens_ppc_a;
- unsigned char res28[0xc];
- unsigned int intenc_ppc_a;
- unsigned char res29[0xc];
- unsigned int flag_ppc_a;
- unsigned char res30[0xac];
- unsigned int ccnt_ppc_a;
- unsigned char res31[0xc];
- unsigned int pmcnt0_ppc_a;
+ unsigned char res22a[0xc];
+ unsigned int ctrl_io_rdata_ch0;
+ unsigned int ctrl_io_rdata_ch1;
+ unsigned char res23a[0x8];
+ unsigned int cacal_config0;
+ unsigned int cacal_config1;
+ unsigned int cacal_status;
+ unsigned char res24[0x94];
+ unsigned int emergent_config0; /* 0x0200 */
+ unsigned int emergent_config1;
+ unsigned char res25[0x8];
+ unsigned int bp_control0;
+ unsigned int bp_control0_r;
+ unsigned int bp_control0_w;
+ unsigned char res26[0x4];
+ unsigned int bp_control1;
+ unsigned int bp_control1_r;
+ unsigned int bp_control1_w;
+ unsigned char res27[0x4];
+ unsigned int bp_control2;
+ unsigned int bp_control2_r;
+ unsigned int bp_control2_w;
+ unsigned char res28[0x4];
+ unsigned int bp_control3;
+ unsigned int bp_control3_r;
+ unsigned int bp_control3_w;
+ unsigned char res29[0xb4];
+ unsigned int winconfig_odt_w; /* 0x0300 */
+ unsigned char res30[0x4];
+ unsigned int winconfig_ctrl_read;
+ unsigned int winconfig_ctrl_gate;
+ unsigned char res31[0xdcf0];
+ unsigned int pmnc_ppc;
unsigned char res32[0xc];
- unsigned int pmcnt1_ppc_a;
+ unsigned int cntens_ppc;
unsigned char res33[0xc];
- unsigned int pmcnt2_ppc_a;
+ unsigned int cntenc_ppc;
unsigned char res34[0xc];
- unsigned int pmcnt3_ppc_a;
+ unsigned int intens_ppc;
+ unsigned char res35[0xc];
+ unsigned int intenc_ppc;
+ unsigned char res36[0xc];
+ unsigned int flag_ppc; /* 0xe050 */
+ unsigned char res37[0xac];
+ unsigned int ccnt_ppc;
+ unsigned char res38[0xc];
+ unsigned int pmcnt0_ppc;
+ unsigned char res39[0xc];
+ unsigned int pmcnt1_ppc;
+ unsigned char res40[0xc];
+ unsigned int pmcnt2_ppc;
+ unsigned char res41[0xc];
+ unsigned int pmcnt3_ppc; /* 0xe140 */
};
struct exynos5_phy_control {
@@ -160,6 +249,15 @@ struct exynos5_phy_control {
unsigned int phy_con42;
};
+struct exynos5_tzasc {
+ unsigned char res1[0xf00];
+ unsigned int membaseconfig0;
+ unsigned int membaseconfig1;
+ unsigned char res2[0x8];
+ unsigned int memconfig0;
+ unsigned int memconfig1;
+};
+
enum ddr_mode {
DDR_MODE_DDR2,
DDR_MODE_DDR3,
@@ -196,54 +294,6 @@ enum {
MEM_TIMINGS_MSR_COUNT = 4,
};
-#define DMC_INTERLEAVE_SIZE 0x1f
-
-/* CONCONTROL register fields */
-#define CONCONTROL_DFI_INIT_START_SHIFT 28
-#define CONCONTROL_RD_FETCH_SHIFT 12
-#define CONCONTROL_RD_FETCH_MASK (0x7 << CONCONTROL_RD_FETCH_SHIFT)
-#define CONCONTROL_AREF_EN_SHIFT 5
-
-/* PRECHCONFIG register field */
-#define PRECHCONFIG_TP_CNT_SHIFT 24
-
-/* PWRDNCONFIG register field */
-#define PWRDNCONFIG_DPWRDN_CYC_SHIFT 0
-#define PWRDNCONFIG_DSREF_CYC_SHIFT 16
-
-/* PHY_CON0 register fields */
-#define PHY_CON0_T_WRRDCMD_SHIFT 17
-#define PHY_CON0_T_WRRDCMD_MASK (0x7 << PHY_CON0_T_WRRDCMD_SHIFT)
-#define PHY_CON0_CTRL_DDR_MODE_SHIFT 11
-
-/* PHY_CON1 register fields */
-#define PHY_CON1_RDLVL_RDDATA_ADJ_SHIFT 0
-
-/* PHY_CON12 register fields */
-#define PHY_CON12_CTRL_START_POINT_SHIFT 24
-#define PHY_CON12_CTRL_INC_SHIFT 16
-#define PHY_CON12_CTRL_FORCE_SHIFT 8
-#define PHY_CON12_CTRL_START_SHIFT 6
-#define PHY_CON12_CTRL_START_MASK (1 << PHY_CON12_CTRL_START_SHIFT)
-#define PHY_CON12_CTRL_DLL_ON_SHIFT 5
-#define PHY_CON12_CTRL_DLL_ON_MASK (1 << PHY_CON12_CTRL_DLL_ON_SHIFT)
-#define PHY_CON12_CTRL_REF_SHIFT 1
-
-/* PHY_CON16 register fields */
-#define PHY_CON16_ZQ_MODE_DDS_SHIFT 24
-#define PHY_CON16_ZQ_MODE_DDS_MASK (0x7 << PHY_CON16_ZQ_MODE_DDS_SHIFT)
-
-#define PHY_CON16_ZQ_MODE_TERM_SHIFT 21
-#define PHY_CON16_ZQ_MODE_TERM_MASK (0x7 << PHY_CON16_ZQ_MODE_TERM_SHIFT)
-
-#define PHY_CON16_ZQ_MODE_NOTERM_MASK (1 << 19)
-
-/* PHY_CON42 register fields */
-#define PHY_CON42_CTRL_BSTLEN_SHIFT 8
-#define PHY_CON42_CTRL_BSTLEN_MASK (0xff << PHY_CON42_CTRL_BSTLEN_SHIFT)
-
-#define PHY_CON42_CTRL_RDLAT_SHIFT 0
-#define PHY_CON42_CTRL_RDLAT_MASK (0x1f << PHY_CON42_CTRL_RDLAT_SHIFT)
/* These are the memory timings for a particular memory type and speed */
struct mem_timings {