mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <renaud.barbier@ge.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] ppc: mpc85xx: enable DDR driver
Date: Wed, 30 Oct 2013 10:22:49 +0000	[thread overview]
Message-ID: <1383128571-8250-4-git-send-email-renaud.barbier@ge.com> (raw)
In-Reply-To: <1383128571-8250-1-git-send-email-renaud.barbier@ge.com>

The use of the DDR driver as well as early I2C support is
enabled for board initialising their memory through SPD EEPROM
data.

A SOC specific function returning the DDR bus frequency
is added for the DDR driver to translate DDR timings to
register values.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
---
 arch/ppc/ddr-8xxx/Makefile                 |    2 ++
 arch/ppc/mach-mpc85xx/Makefile             |    1 +
 arch/ppc/mach-mpc85xx/cpu.c                |    6 ++++--
 arch/ppc/mach-mpc85xx/include/mach/clock.h |    1 +
 arch/ppc/mach-mpc85xx/speed.c              |    9 +++++++++
 5 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 arch/ppc/ddr-8xxx/Makefile

diff --git a/arch/ppc/ddr-8xxx/Makefile b/arch/ppc/ddr-8xxx/Makefile
new file mode 100644
index 0000000..54cb7ce
--- /dev/null
+++ b/arch/ppc/ddr-8xxx/Makefile
@@ -0,0 +1,2 @@
+obj-y	+=  	main.o util.o ctrl_regs.o options.o lc_common_dimm_params.o
+obj-$(CONFIG_FSL_DDR2)	+= ddr2_dimm_params.o ddr2_setctrl.o
diff --git a/arch/ppc/mach-mpc85xx/Makefile b/arch/ppc/mach-mpc85xx/Makefile
index 81d6853..b484d40 100644
--- a/arch/ppc/mach-mpc85xx/Makefile
+++ b/arch/ppc/mach-mpc85xx/Makefile
@@ -6,4 +6,5 @@ obj-y			+= speed.o
 obj-y			+=time.o
 obj-$(CONFIG_MP)	+= mp.o
 obj-$(CONFIG_OFTREE)	+= fdt.o
+obj-$(CONFIG_I2C_IMX)	+= fsl_i2c.o
 obj-$(CONFIG_DRIVER_NET_GIANFAR) += eth-devices.o
diff --git a/arch/ppc/mach-mpc85xx/cpu.c b/arch/ppc/mach-mpc85xx/cpu.c
index 39343ff..17a1c4c 100644
--- a/arch/ppc/mach-mpc85xx/cpu.c
+++ b/arch/ppc/mach-mpc85xx/cpu.c
@@ -44,8 +44,10 @@ long int initdram(int board_type)
 {
 	phys_size_t dram_size = 0;
 
-	dram_size = fixed_sdram();
-
+	if (IS_ENABLED(CONFIG_DDR_SPD))
+		dram_size = fsl_ddr_sdram();
+	else
+		dram_size = fixed_sdram();
 	dram_size = e500_setup_ddr_tlbs(dram_size / 0x100000);
 	dram_size *= 0x100000;
 
diff --git a/arch/ppc/mach-mpc85xx/include/mach/clock.h b/arch/ppc/mach-mpc85xx/include/mach/clock.h
index e20d685..0e68cf6 100644
--- a/arch/ppc/mach-mpc85xx/include/mach/clock.h
+++ b/arch/ppc/mach-mpc85xx/include/mach/clock.h
@@ -11,6 +11,7 @@ struct sys_info {
 };
 
 unsigned long fsl_get_bus_freq(ulong dummy);
+unsigned long fsl_get_ddr_freq(ulong dummy);
 unsigned long fsl_get_timebase_clock(void);
 unsigned long fsl_get_i2c_freq(void);
 void fsl_get_sys_info(struct sys_info *sysInfo);
diff --git a/arch/ppc/mach-mpc85xx/speed.c b/arch/ppc/mach-mpc85xx/speed.c
index 64c10f9..eb9d725 100644
--- a/arch/ppc/mach-mpc85xx/speed.c
+++ b/arch/ppc/mach-mpc85xx/speed.c
@@ -90,6 +90,15 @@ unsigned long fsl_get_bus_freq(ulong dummy)
 	return sys_info.freqSystemBus;
 }
 
+unsigned long fsl_get_ddr_freq(ulong dummy)
+{
+	struct sys_info sys_info;
+
+	fsl_get_sys_info(&sys_info);
+
+	return sys_info.freqDDRBus;
+}
+
 unsigned long fsl_get_timebase_clock(void)
 {
 	struct sys_info sysinfo;
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-10-30 10:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 10:22 [PATCH v2 0/5] GEIP DA923RC board support Renaud Barbier
2013-10-30 10:22 ` [PATCH 1/5] ppc: mpc85xx: mpc8544 support Renaud Barbier
2013-10-30 10:22 ` [PATCH 2/5] ppc: mpc85xx: define Ethernet port count Renaud Barbier
2013-10-30 10:22 ` Renaud Barbier [this message]
2013-10-30 10:22 ` [PATCH 4/5] ppc: DA923RC: add board support Renaud Barbier
2013-10-30 11:34   ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-31  7:48     ` Sascha Hauer
2013-10-31 13:15       ` Renaud Barbier
2013-10-31 20:10       ` Renaud Barbier
2013-11-01 11:58         ` Sascha Hauer
2013-11-01 12:56           ` Renaud Barbier
2013-11-01 13:02             ` Renaud Barbier
2013-11-01 15:03               ` Renaud Barbier
2013-11-01 20:28                 ` Sascha Hauer
2013-11-04 18:06                   ` Renaud Barbier
2013-11-05  7:35                     ` Sascha Hauer
2013-10-31 14:41     ` Renaud Barbier
2013-10-31 16:01       ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-31 18:59         ` Renaud Barbier
2013-10-30 10:22 ` [PATCH 5/5] ppc: mpc85xx: build directives Renaud Barbier
2013-11-05 15:36 [PATCH v3 0/5] GEIP DA923RC board support Renaud Barbier
2013-11-05 15:36 ` [PATCH 3/5] ppc: mpc85xx: enable DDR driver Renaud Barbier

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=1383128571-8250-4-git-send-email-renaud.barbier@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox