All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V5 30/31] imx: mx8m: add ddr controller memory map
Date: Wed, 10 Jan 2018 13:20:47 +0800	[thread overview]
Message-ID: <20180110052048.4425-31-peng.fan@nxp.com> (raw)
In-Reply-To: <20180110052048.4425-1-peng.fan@nxp.com>

Add ddrc memory map and enum types used in ddr initialization.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/include/asm/arch-mx8m/ddr.h | 356 +++++++++++++++++++++++++++++++++++
 1 file changed, 356 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mx8m/ddr.h

diff --git a/arch/arm/include/asm/arch-mx8m/ddr.h b/arch/arm/include/asm/arch-mx8m/ddr.h
new file mode 100644
index 0000000000..b37382eab0
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx8m/ddr.h
@@ -0,0 +1,356 @@
+/*
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __ASM_ARCH_MX8M_DDR_H
+#define __ASM_ARCH_MX8M_DDR_H
+
+#define DDRC_DDR_SS_GPR0		0x3d000000
+#define DDRC_IPS_BASE_ADDR_0		0x3f400000
+#define IP2APB_DDRPHY_IPS_BASE_ADDR(X)	(0x3c000000 + (X * 0x2000000))
+#define DDRPHY_MEM(X)			(0x3c000000 + (X * 0x2000000) + 0x50000)
+
+struct ddrc_freq {
+	u32 res0[8];
+	u32 derateen;
+	u32 derateint;
+	u32 res1[10];
+	u32 rfshctl0;
+	u32 res2[4];
+	u32 rfshtmg;
+	u32 rfshtmg1;
+	u32 res3[28];
+	u32 init3;
+	u32 init4;
+	u32 res;
+	u32 init6;
+	u32 init7;
+	u32 res4[4];
+	u32 dramtmg0;
+	u32 dramtmg1;
+	u32 dramtmg2;
+	u32 dramtmg3;
+	u32 dramtmg4;
+	u32 dramtmg5;
+	u32 dramtmg6;
+	u32 dramtmg7;
+	u32 dramtmg8;
+	u32 dramtmg9;
+	u32 dramtmg10;
+	u32 dramtmg11;
+	u32 dramtmg12;
+	u32 dramtmg13;
+	u32 dramtmg14;
+	u32 dramtmg15;
+	u32 dramtmg16;
+	u32 dramtmg17;
+	u32 res5[10];
+	u32 mramtmg0;
+	u32 mramtmg1;
+	u32 mramtmg4;
+	u32 mramtmg9;
+	u32 zqctl0;
+	u32 res6[3];
+	u32 dfitmg0;
+	u32 dfitmg1;
+	u32 res7[7];
+	u32 dfitmg2;
+	u32 dfitmg3;
+	u32 res8[33];
+	u32 odtcfg;
+};
+
+struct imx8m_ddrc_regs {
+	u32 mstr;
+	u32 stat;
+	u32 mstr1;
+	u32 res1;
+	u32 mrctrl0;
+	u32 mrctrl1;
+	u32 mrstat;
+	u32 mrctrl2;
+	u32 derateen;
+	u32 derateint;
+	u32 mstr2;
+	u32 res2;
+	u32 pwrctl;
+	u32 pwrtmg;
+	u32 hwlpctl;
+	u32 hwffcctl;
+	u32 hwffcstat;
+	u32 res3[3];
+	u32 rfshctl0;
+	u32 rfshctl1;
+	u32 rfshctl2;
+	u32 rfshctl4;
+	u32 rfshctl3;
+	u32 rfshtmg;
+	u32 rfshtmg1;
+	u32 res4;
+	u32 ecccfg0;
+	u32 ecccfg1;
+	u32 eccstat;
+	u32 eccclr;
+	u32 eccerrcnt;
+	u32 ecccaddr0;
+	u32 ecccaddr1;
+	u32 ecccsyn0;
+	u32 ecccsyn1;
+	u32 ecccsyn2;
+	u32 eccbitmask0;
+	u32 eccbitmask1;
+	u32 eccbitmask2;
+	u32 eccuaddr0;
+	u32 eccuaddr1;
+	u32 eccusyn0;
+	u32 eccusyn1;
+	u32 eccusyn2;
+	u32 eccpoisonaddr0;
+	u32 eccpoisonaddr1;
+	u32 crcparctl0;
+	u32 crcparctl1;
+	u32 crcparctl2;
+	u32 crcparstat;
+	u32 init0;
+	u32 init1;
+	u32 init2;
+	u32 init3;
+	u32 init4;
+	u32 init5;
+	u32 init6;
+	u32 init7;
+	u32 dimmctl;
+	u32 rankctl;
+	u32 res5;
+	u32 chctl;
+	u32 dramtmg0;
+	u32 dramtmg1;
+	u32 dramtmg2;
+	u32 dramtmg3;
+	u32 dramtmg4;
+	u32 dramtmg5;
+	u32 dramtmg6;
+	u32 dramtmg7;
+	u32 dramtmg8;
+	u32 dramtmg9;
+	u32 dramtmg10;
+	u32 dramtmg11;
+	u32 dramtmg12;
+	u32 dramtmg13;
+	u32 dramtmg14;
+	u32 dramtmg15;
+	u32 dramtmg16;
+	u32 dramtmg17;
+	u32 res6[10];
+	u32 mramtmg0;
+	u32 mramtmg1;
+	u32 mramtmg4;
+	u32 mramtmg9;
+	u32 zqctl0;
+	u32 zqctl1;
+	u32 zqctl2;
+	u32 zqstat;
+	u32 dfitmg0;
+	u32 dfitmg1;
+	u32 dfilpcfg0;
+	u32 dfilpcfg1;
+	u32 dfiupd0;
+	u32 dfiupd1;
+	u32 dfiupd2;
+	u32 res7;
+	u32 dfimisc;
+	u32 dfitmg2;
+	u32 dfitmg3;
+	u32 dfistat;
+	u32 dbictl;
+	u32 dfiphymstr;
+	u32 res8[14];
+	u32 addrmap0;
+	u32 addrmap1;
+	u32 addrmap2;
+	u32 addrmap3;
+	u32 addrmap4;
+	u32 addrmap5;
+	u32 addrmap6;
+	u32 addrmap7;
+	u32 addrmap8;
+	u32 addrmap9;
+	u32 addrmap10;
+	u32 addrmap11;
+	u32 res9[4];
+	u32 odtcfg;
+	u32 odtmap;
+	u32 res10[2];
+	u32 sched;
+	u32 sched1;
+	u32 sched2;
+	u32 perfhpr1;
+	u32 res11;
+	u32 perflpr1;
+	u32 res12;
+	u32 perfwr1;
+	u32 res13[4];
+	u32 dqmap0;
+	u32 dqmap1;
+	u32 dqmap2;
+	u32 dqmap3;
+	u32 dqmap4;
+	u32 dqmap5;
+	u32 res14[26];
+	u32 dbg0;
+	u32 dbg1;
+	u32 dbgcam;
+	u32 dbgcmd;
+	u32 dbgstat;
+	u32 res15[3];
+	u32 swctl;
+	u32 swstat;
+	u32 res16[2];
+	u32 ocparcfg0;
+	u32 ocparcfg1;
+	u32 ocparcfg2;
+	u32 ocparcfg3;
+	u32 ocparstat0;
+	u32 ocparstat1;
+	u32 ocparwlog0;
+	u32 ocparwlog1;
+	u32 ocparwlog2;
+	u32 ocparawlog0;
+	u32 ocparawlog1;
+	u32 ocparrlog0;
+	u32 ocparrlog1;
+	u32 ocpararlog0;
+	u32 ocpararlog1;
+	u32 poisoncfg;
+	u32 poisonstat;
+	u32 adveccindex;
+	union  {
+		u32 adveccstat;
+		u32 eccapstat;
+	};
+	u32 eccpoisonpat0;
+	u32 eccpoisonpat1;
+	u32 eccpoisonpat2;
+	u32 res17[6];
+	u32 caparpoisonctl;
+	u32 caparpoisonstat;
+	u32 res18[2];
+	u32 dynbsmstat;
+	u32 res19[18];
+	u32 pstat;
+	u32 pccfg;
+	struct {
+		u32 pcfgr;
+		u32 pcfgw;
+		u32 pcfgc;
+		struct {
+			u32 pcfgidmaskch0;
+			u32 pcfidvaluech0;
+		} pcfgid[16];
+		u32 pctrl;
+		u32 pcfgqos0;
+		u32 pcfgqos1;
+		u32 pcfgwqos0;
+		u32 pcfgwqos1;
+		u32 res[4];
+	} pcfg[16];
+	struct {
+		u32 sarbase;
+		u32 sarsize;
+	} sar[4];
+	u32 sbrctl;
+	u32 sbrstat;
+	u32 sbrwdata0;
+	u32 sbrwdata1;
+	u32 pdch;
+	u32 res20[755];
+	/* umctl2_regs_dch1 */
+	u32 ch1_stat;
+	u32 res21[2];
+	u32 ch1_mrctrl0;
+	u32 ch1_mrctrl1;
+	u32 ch1_mrstat;
+	u32 ch1_mrctrl2;
+	u32 res22[4];
+	u32 ch1_pwrctl;
+	u32 ch1_pwrtmg;
+	u32 ch1_hwlpctl;
+	u32 res23[15];
+	u32 ch1_eccstat;
+	u32 ch1_eccclr;
+	u32 ch1_eccerrcnt;
+	u32 ch1_ecccaddr0;
+	u32 ch1_ecccaddr1;
+	u32 ch1_ecccsyn0;
+	u32 ch1_ecccsyn1;
+	u32 ch1_ecccsyn2;
+	u32 ch1_eccbitmask0;
+	u32 ch1_eccbitmask1;
+	u32 ch1_eccbitmask2;
+	u32 ch1_eccuaddr0;
+	u32 ch1_eccuaddr1;
+	u32 ch1_eccusyn0;
+	u32 ch1_eccusyn1;
+	u32 ch1_eccusyn2;
+	u32 res24[2];
+	u32 ch1_crcparctl0;
+	u32 res25[2];
+	u32 ch1_crcparstat;
+	u32 res26[46];
+	u32 ch1_zqctl2;
+	u32 ch1_zqstat;
+	u32 res27[11];
+	u32 ch1_dfistat;
+	u32 res28[33];
+	u32 ch1_odtmap;
+	u32 res29[47];
+	u32 ch1_dbg1;
+	u32 ch1_dbgcam;
+	u32 ch1_dbgcmd;
+	u32 ch1_dbgstat;
+	u32 res30[123];
+	/* umctl2_regs_freq1 */
+	struct ddrc_freq freq1;
+	u32 res31[109];
+	/* umctl2_regs_addrmap_alt */
+	u32 addrmap0_alt;
+	u32 addrmap1_alt;
+	u32 addrmap2_alt;
+	u32 addrmap3_alt;
+	u32 addrmap4_alt;
+	u32 addrmap5_alt;
+	u32 addrmap6_alt;
+	u32 addrmap7_alt;
+	u32 addrmap8_alt;
+	u32 addrmap9_alt;
+	u32 addrmap10_alt;
+	u32 addrmap11_alt;
+	u32 res32[758];
+	/* umctl2_regs_freq2 */
+	struct ddrc_freq freq2;
+	u32 res33[879];
+	/* umctl2_regs_freq3 */
+	struct ddrc_freq freq3;
+};
+
+struct imx8m_ddrphy_regs {
+	u32 reg[0xf0000];
+};
+
+/* PHY State */
+enum pstate {
+	PS0,
+	PS1,
+	PS2,
+	PS3,
+};
+
+enum msg_response {
+	TRAIN_SUCCESS = 0x7,
+	TRAIN_STREAM_START = 0x8,
+	TRAIN_FAIL = 0xff,
+};
+
+#endif
-- 
2.14.1

  parent reply	other threads:[~2018-01-10  5:20 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10  5:20 [U-Boot] [PATCH V5 00/31] imx: add i.MX8M support and i.MX8MQ EVK Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 01/31] arm: imx: Rework i.MX specific commands to be excluded from SPL Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 02/31] imx: add i.MX8M into Kconfig Peng Fan
2018-01-21 15:53   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 03/31] imx: mx8m: add register definition header file Peng Fan
2018-01-21 15:54   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 04/31] imx: mx8m: add pin " Peng Fan
2018-01-21 15:53   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 05/31] imx: mx8m: add clock driver Peng Fan
2018-01-21 16:28   ` Stefano Babic
2018-01-23  8:58     ` Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 06/31] imx: add sip function Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 07/31] imx: boot_mode: add USB_BOOT entry Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 08/31] imx: cpu: update cpu file to support i.MX8M Peng Fan
2018-01-21 16:28   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 09/31] imx: spl: implement spl_boot_device for i.MX8M Peng Fan
2018-01-21 16:29   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 10/31] imx: add i.MX8MQ SoC Revision and is_mx8m helper Peng Fan
2018-01-21 16:30   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 11/31] imx: add pad settings bit definition for i.MX8M Peng Fan
2018-01-21 16:30   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 12/31] imx: cpu: move speed/temp to common cpu Peng Fan
2018-01-21 16:30   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 13/31] imx: cpu: add cpu speed/grade for i.MX8M Peng Fan
2018-01-21 16:31   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 14/31] imx: refactor imx_get_mac_from_fuse Peng Fan
2018-01-21 16:31   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 15/31] imx: cleanup bootaux Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 16/31] imx: bootaux: support i.MX8M Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 17/31] imx: mx7: move get_boot_device to cpu.c Peng Fan
2018-01-21 16:33   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 18/31] imx: cpu: support get_boot_device for i.MX8M Peng Fan
2018-01-21 16:33   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 19/31] imx: mx7: move mmc env code to mmc_env.c Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 20/31] imx: mx8m: add soc related settings and files Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 21/31] imx: makefile: compile files for i.MX8M Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 22/31] misc: ocotp: add i.MX8M support Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 23/31] mmc: fsl_esdhc: support i.MX8M Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 24/31] imx: lcdif: include i.MX8M Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 25/31] gpio: mxc: add i.MX8M support Peng Fan
2018-01-21 16:33   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 26/31] net: fec: do not access reserved register for i.MX8M Peng Fan
2018-01-21 16:34   ` Stefano Babic
2018-01-10  5:20 ` [U-Boot] [PATCH V5 27/31] net: fec: fix build warnings for 64bits support Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 28/31] imx: imx8mq: add dtsi file Peng Fan
2018-01-10  5:20 ` [U-Boot] [PATCH V5 29/31] power: pmic/regulator allow dm be omitted by SPL Peng Fan
2018-01-17 12:16   ` Jaehoon Chung
2018-01-10  5:20 ` Peng Fan [this message]
2018-01-10  5:20 ` [U-Boot] [PATCH V5 31/31] imx: add i.MX8MQ EVK support Peng Fan
2018-01-22 14:00   ` Stefano Babic
2018-01-22 15:23     ` Fabio Estevam
2018-01-22 16:20       ` Stefano Babic
2018-01-31 10:25         ` Fabio Estevam
2018-01-31 10:30           ` Stefano Babic
2018-02-04  9:42             ` Stefano Babic
2018-02-22 16:40               ` Fabio Estevam
2018-02-23  6:02                 ` Peng Fan
2018-02-23 13:37                   ` Fabio Estevam
2018-03-20 19:46                   ` Fabio Estevam
2018-03-21  9:07                     ` Peng Fan
2018-02-23  9:46                 ` Stefano Babic
2018-02-23 13:21                   ` Fabio Estevam
2018-01-23  2:24     ` Peng Fan
2018-01-23  9:52       ` Stefano Babic
     [not found]   ` <88fee187-cf7f-cd2a-659a-eb67ba814178@denx.de>
2018-01-23  1:54     ` Peng Fan
2018-01-23 10:02       ` Stefano Babic
2018-06-20  8:57   ` Paul Kocialkowski
2018-06-20 11:37     ` Andre Przywara
2018-06-20 11:54       ` Paul Kocialkowski
2018-06-20 12:08         ` Paul Kocialkowski
2018-06-20 11:56     ` Peng Fan
2018-06-20 15:24       ` Paul Kocialkowski
2018-06-20 16:12         ` Andre Przywara
2018-06-20 17:16           ` Paul Kocialkowski
2018-06-21  1:07             ` André Przywara
2018-06-21 18:29               ` Todd Weaver
2018-06-21  7:08           ` Wolfgang Denk
2018-01-10 13:08 ` [U-Boot] [PATCH V5 00/31] imx: add i.MX8M support and i.MX8MQ EVK Diego Dorta
2018-01-11  1:16   ` Peng Fan
2018-01-11 12:36     ` Diego Dorta
2018-01-13 10:55       ` Peng Fan
2018-01-16 12:15         ` Diego Dorta
2018-01-16 12:25           ` Peng Fan
2018-01-17 14:59             ` Diego Dorta
2018-01-18  1:13               ` Peng Fan
2018-01-18 14:58                 ` Diego Dorta
2018-01-18  1:24 ` Peng Fan
2018-01-18  8:50   ` Stefano Babic
2018-01-18  8:58     ` Peng Fan
2018-01-22 13:04 ` Diego Dorta
2018-08-31  6:27   ` Jon Nettleton
2018-09-06 13:37     ` Fabio Estevam
2018-09-07  6:03       ` Jon Nettleton
2018-09-07  6:09         ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180110052048.4425-31-peng.fan@nxp.com \
    --to=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.