All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 06/11] mx6: add structs for mmdc and ddr iomux registers
Date: Wed,  7 May 2014 22:16:17 -0700	[thread overview]
Message-ID: <1399526182-11966-7-git-send-email-tharvey@gateworks.com> (raw)
In-Reply-To: <1399526182-11966-1-git-send-email-tharvey@gateworks.com>

Add memory-mapped structures for MMDC iomux and configuration. Note that
the MMDC configuration registers are common between the IMX6DQ
(IMX6DUAL/IMX6QUAD) and IMX6SDL (IMX6SOLO/IMX6DUALLITE) the iomux
register addresses differ. This requires two sets of structures.

Add structures to describe DDR3 device information, system information
(memory layout, etc), and MMDC calibration regitsers that can be used to
configure the MMDC dynamically.

We define these structures for SPL builds instead of including mx6q-ddr.h an
mx6dl-ddr.h which use the same namespace and are only useful for imximage cf
files.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
v3:
 - moved portions into following patch

v2:
 - split out from original mmdc configuration patch
 - only define for SPL build
 - do not include mx6q-ddr.h and mx6dl-ddr.h for SPL build - these use the
   same namespace and are only useful for imximage cfg files
---
 arch/arm/include/asm/arch-mx6/mx6-ddr.h | 159 ++++++++++++++++++++++++++++++++
 1 file changed, 159 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/mx6-ddr.h b/arch/arm/include/asm/arch-mx6/mx6-ddr.h
index 43d377a..c2a31d2 100644
--- a/arch/arm/include/asm/arch-mx6/mx6-ddr.h
+++ b/arch/arm/include/asm/arch-mx6/mx6-ddr.h
@@ -6,6 +6,7 @@
 #ifndef __ASM_ARCH_MX6_DDR_H__
 #define __ASM_ARCH_MX6_DDR_H__
 
+#ifndef CONFIG_SPL_BUILD
 #ifdef CONFIG_MX6Q
 #include "mx6q-ddr.h"
 #else
@@ -15,6 +16,164 @@
 #error "Please select cpu"
 #endif	/* CONFIG_MX6DL or CONFIG_MX6S */
 #endif	/* CONFIG_MX6Q */
+#else
+
+/* MMDC P0/P1 Registers */
+struct mmdc_p_regs {
+	u32 mdctl;
+	u32 mdpdc;
+	u32 mdotc;
+	u32 mdcfg0;
+	u32 mdcfg1;
+	u32 mdcfg2;
+	u32 mdmisc;
+	u32 mdscr;
+	u32 mdref;
+	u32 res1[2];
+	u32 mdrwd;
+	u32 mdor;
+	u32 res2[3];
+	u32 mdasp;
+	u32 res3[240];
+	u32 mapsr;
+	u32 res4[254];
+	u32 mpzqhwctrl;
+	u32 res5[2];
+	u32 mpwldectrl0;
+	u32 mpwldectrl1;
+	u32 res6;
+	u32 mpodtctrl;
+	u32 mprddqby0dl;
+	u32 mprddqby1dl;
+	u32 mprddqby2dl;
+	u32 mprddqby3dl;
+	u32 res7[4];
+	u32 mpdgctrl0;
+	u32 mpdgctrl1;
+	u32 res8;
+	u32 mprddlctl;
+	u32 res9;
+	u32 mpwrdlctl;
+	u32 res10[25];
+	u32 mpmur0;
+};
+
+/*
+ * MMDC iomux registers (pinctl/padctl) - (different for IMX6DQ vs IMX6SDL)
+ */
+#define MX6DQ_IOM_DDR_BASE      0x020e0500
+struct mx6dq_iomux_ddr_regs {
+	u32 res1[3];
+	u32 dram_sdqs5;
+	u32 dram_dqm5;
+	u32 dram_dqm4;
+	u32 dram_sdqs4;
+	u32 dram_sdqs3;
+	u32 dram_dqm3;
+	u32 dram_sdqs2;
+	u32 dram_dqm2;
+	u32 res2[16];
+	u32 dram_cas;
+	u32 res3[2];
+	u32 dram_ras;
+	u32 dram_reset;
+	u32 res4[2];
+	u32 dram_sdclk_0;
+	u32 dram_sdba2;
+	u32 dram_sdcke0;
+	u32 dram_sdclk_1;
+	u32 dram_sdcke1;
+	u32 dram_sdodt0;
+	u32 dram_sdodt1;
+	u32 res5;
+	u32 dram_sdqs0;
+	u32 dram_dqm0;
+	u32 dram_sdqs1;
+	u32 dram_dqm1;
+	u32 dram_sdqs6;
+	u32 dram_dqm6;
+	u32 dram_sdqs7;
+	u32 dram_dqm7;
+};
+
+#define MX6DQ_IOM_GRP_BASE      0x020e0700
+struct mx6dq_iomux_grp_regs {
+	u32 res1[18];
+	u32 grp_b7ds;
+	u32 grp_addds;
+	u32 grp_ddrmode_ctl;
+	u32 res2;
+	u32 grp_ddrpke;
+	u32 res3[6];
+	u32 grp_ddrmode;
+	u32 res4[3];
+	u32 grp_b0ds;
+	u32 grp_b1ds;
+	u32 grp_ctlds;
+	u32 res5;
+	u32 grp_b2ds;
+	u32 grp_ddr_type;
+	u32 grp_b3ds;
+	u32 grp_b4ds;
+	u32 grp_b5ds;
+	u32 grp_b6ds;
+};
+
+#define MX6SDL_IOM_DDR_BASE     0x020e0400
+struct mx6sdl_iomux_ddr_regs {
+	u32 res1[25];
+	u32 dram_cas;
+	u32 res2[2];
+	u32 dram_dqm0;
+	u32 dram_dqm1;
+	u32 dram_dqm2;
+	u32 dram_dqm3;
+	u32 dram_dqm4;
+	u32 dram_dqm5;
+	u32 dram_dqm6;
+	u32 dram_dqm7;
+	u32 dram_ras;
+	u32 dram_reset;
+	u32 res3[2];
+	u32 dram_sdba2;
+	u32 dram_sdcke0;
+	u32 dram_sdcke1;
+	u32 dram_sdclk_0;
+	u32 dram_sdclk_1;
+	u32 dram_sdodt0;
+	u32 dram_sdodt1;
+	u32 dram_sdqs0;
+	u32 dram_sdqs1;
+	u32 dram_sdqs2;
+	u32 dram_sdqs3;
+	u32 dram_sdqs4;
+	u32 dram_sdqs5;
+	u32 dram_sdqs6;
+	u32 dram_sdqs7;
+};
+
+#define MX6SDL_IOM_GRP_BASE     0x020e0700
+struct mx6sdl_iomux_grp_regs {
+	u32 res1[18];
+	u32 grp_b7ds;
+	u32 grp_addds;
+	u32 grp_ddrmode_ctl;
+	u32 grp_ddrpke;
+	u32 res2[2];
+	u32 grp_ddrmode;
+	u32 grp_b0ds;
+	u32 res3;
+	u32 grp_ctlds;
+	u32 grp_b1ds;
+	u32 grp_ddr_type;
+	u32 grp_b2ds;
+	u32 grp_b3ds;
+	u32 grp_b4ds;
+	u32 grp_b5ds;
+	u32 res4;
+	u32 grp_b6ds;
+};
+#endif /* CONFIG_SPL_BUILD */
 
 #define MX6_MMDC_P0_MDCTL	0x021b0000
 #define MX6_MMDC_P0_MDPDC	0x021b0004
-- 
1.8.3.2

  parent reply	other threads:[~2014-05-08  5:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  5:16 [U-Boot] [PATCH v3 00/11] mx6: SPL NAND support Tim Harvey
2014-05-08  5:16 ` [U-Boot] [PATCH v3 01/11] nand: remove CONFIG_SYS_NAND_PAGE_SIZE Tim Harvey
2014-05-14  8:52   ` Masahiro Yamada
2014-05-14 10:14     ` Stefano Babic
2014-05-15  8:31   ` Stefano Babic
2014-05-08  5:16 ` [U-Boot] [PATCH v3 02/11] spl: nand: add support for mxs nand Tim Harvey
2014-05-08  5:16 ` [U-Boot] [PATCH v3 03/11] mx6: add common SPL configuration Tim Harvey
2014-05-08  5:16 ` [U-Boot] [PATCH v3 04/11] mx6: add boot device support for SPL Tim Harvey
2014-05-28 16:38   ` Nikita Kiryanov
2014-05-29  4:11     ` Tim Harvey
2014-05-29  6:45       ` Igor Grinberg
2014-05-08  5:16 ` [U-Boot] [PATCH v3 05/11] imx: add comments and remove unused struct fields Tim Harvey
2014-05-28 16:38   ` Nikita Kiryanov
2014-05-08  5:16 ` Tim Harvey [this message]
2014-05-28 17:06   ` [U-Boot] [PATCH v3 06/11] mx6: add structs for mmdc and ddr iomux registers Nikita Kiryanov
2014-05-29  4:16     ` Tim Harvey
2014-05-29  6:48       ` Stefano Babic
2014-05-29  7:20         ` Nikita Kiryanov
2014-05-08  5:16 ` [U-Boot] [PATCH v3 07/11] mx6: add mmdc configuration for MX6Q/MX6DL Tim Harvey
2014-05-22 22:28   ` [U-Boot] [PATCH v4 " Tim Harvey
2014-05-08  5:16 ` [U-Boot] [PATCH v3 08/11] imx: iomux: add macros to setup iomux for multiple SoC types Tim Harvey
2014-05-08  5:16 ` [U-Boot] [PATCH v3 09/11] imx: ventana: split read_eeprom into standalone file Tim Harvey
2014-05-08  5:16 ` [U-Boot] [PATCH v3 10/11] imx: ventana: auto-configure for IMX6Q vs IMX6DL Tim Harvey
2014-05-08  5:16 ` [U-Boot] [PATCH v3 11/11] imx: ventana: switch to SPL Tim Harvey
2014-05-29  7:02   ` Stefano Babic
2014-05-30  4:52     ` Tim Harvey
2014-05-30  7:36       ` Stefano Babic
2014-05-22  6:14 ` [U-Boot] [PATCH v3 00/11] mx6: SPL NAND support Tim Harvey
2014-05-22  6:34   ` Stefano Babic
2014-05-22 22:17     ` Tim Harvey

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=1399526182-11966-7-git-send-email-tharvey@gateworks.com \
    --to=tharvey@gateworks.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.