Skip to contentSkip to conversation

pcm051: Support for revision 3

PATCH In review Lars Poeschel 3 participants 5 messages Nov 19, 2013 – Dec 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcm051: Support for revision 3

From: Lars Poeschel <[email protected]>

Phytec sells revision or version 3 of pcm051. It is labeled 1358.3 on the board. The difference for u-boot is that is has other DDR3 RAM on it:
1 x MT41K256M16HA125E instead of 2 x MT41J256M8HX15E on revisions 1 and
2. Both configurations are 512 MiB.
Configure your u-boot build with pcm051_rev3 for the new RAM and pcm051_rev1 for the old RAM configuration. Board revision 2 has to use pcm051_rev1 also.

---
 board/phytec/pcm051/board.c | 53 ++++++++++++++++++++++++++++++++++++++++-----
 boards.cfg                  |  3 ++-
 2 files changed, 49 insertions(+), 7 deletions(-)
board/phytec/pcm051/board.c +47 -6
index e40b0bd..629bc52 100644
@@ -49,6 +49,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
 	return &dpll_ddr;
 }
 
+#ifdef CONFIG_REV1
 static const struct ddr_data ddr3_data = {
 	.datardsratio0 = MT41J256M8HX15E_RD_DQS,
 	.datawdsratio0 = MT41J256M8HX15E_WR_DQS,
@@ -82,6 +83,52 @@ static struct emif_regs ddr3_emif_reg_data = {
 				PHY_EN_DYN_PWRDN,
 };
 
+void sdram_init(void)
+{
+	config_ddr(DDR_CLK_MHZ, MT41J256M8HX15E_IOCTRL_VALUE, &ddr3_data,
+		   &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
+}
+#else
+static const struct ddr_data ddr3_data = {
+	.datardsratio0 = MT41K256M16HA125E_RD_DQS,
+	.datawdsratio0 = MT41K256M16HA125E_WR_DQS,
+	.datafwsratio0 = MT41K256M16HA125E_PHY_FIFO_WE,
+	.datawrsratio0 = MT41K256M16HA125E_PHY_WR_DATA,
+	.datadldiff0 = PHY_DLL_LOCK_DIFF,
+};
+
+static const struct cmd_control ddr3_cmd_ctrl_data = {
+	.cmd0csratio = MT41K256M16HA125E_RATIO,
+	.cmd0dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
+	.cmd0iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
+
+	.cmd1csratio = MT41K256M16HA125E_RATIO,
+	.cmd1dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
+	.cmd1iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
+
+	.cmd2csratio = MT41K256M16HA125E_RATIO,
+	.cmd2dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
+	.cmd2iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
+};
+
+static struct emif_regs ddr3_emif_reg_data = {
+	.sdram_config = MT41K256M16HA125E_EMIF_SDCFG,
+	.ref_ctrl = MT41K256M16HA125E_EMIF_SDREF,
+	.sdram_tim1 = MT41K256M16HA125E_EMIF_TIM1,
+	.sdram_tim2 = MT41K256M16HA125E_EMIF_TIM2,
+	.sdram_tim3 = MT41K256M16HA125E_EMIF_TIM3,
+	.zq_config = MT41K256M16HA125E_ZQ_CFG,
+	.emif_ddr_phy_ctlr_1 = MT41K256M16HA125E_EMIF_READ_LATENCY |
+				PHY_EN_DYN_PWRDN,
+};
+
+void sdram_init(void)
+{
+	config_ddr(DDR_CLK_MHZ, MT41K256M16HA125E_IOCTRL_VALUE, &ddr3_data,
+		   &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
+}
+#endif
+
 void set_uart_mux_conf(void)
 {
 	enable_uart0_pin_mux();
@@ -95,12 +142,6 @@ void set_mux_conf_regs(void)
 
 	enable_board_pin_mux();
 }
-
-void sdram_init(void)
-{
-	config_ddr(DDR_CLK_MHZ, MT41J256M8HX15E_IOCTRL_VALUE, &ddr3_data,
-			&ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
-}
 #endif
 
 /*
boards.cfg +2 -1
index 9fc77fb..c2e24d6 100644
@@ -244,7 +244,8 @@ Active  arm         armv7          -           armltd          vexpress
 Active  arm         armv7          -           armltd          vexpress            vexpress_ca5x2                       -                                                                                                                                 Matt Waddel <[email protected]>
 Active  arm         armv7          -           armltd          vexpress            vexpress_ca9x4                       -                                                                                                                                 Matt Waddel <[email protected]>
 Active  arm         armv7          am33xx      isee            igep0033            igep0033                             -                                                                                                                                 Enric Balletbo i Serra <[email protected]>
-Active  arm         armv7          am33xx      phytec          pcm051              pcm051                               pcm051                                                                                                                            Lars Poeschel <[email protected]>
+Active  arm         armv7          am33xx      phytec          pcm051              pcm051_rev1                          pcm051:REV1                                                                                                                       Lars Poeschel <[email protected]>
+Active  arm         armv7          am33xx      phytec          pcm051              pcm051_rev3                          pcm051:REV3                                                                                                                       Lars Poeschel <[email protected]>
 Active  arm         armv7          am33xx      siemens         dxr2                dxr2                                 -                                                                                                                                 Roger Meier <[email protected]>
 Active  arm         armv7          am33xx      siemens         pxm2                pxm2                                 -                                                                                                                                 Roger Meier <[email protected]>
 Active  arm         armv7          am33xx      siemens         rut                 rut                                  -                                                                                                                                 Roger Meier <[email protected]>
Signature · 1 line
1.8.4.2
#1 lore raw

PATCH 1/1 pcm051: Support for revision 3

Quoted 11 lines · Lars Poeschel

From: Lars Poeschel <[email protected]>

Phytec sells revision or version 3 of pcm051. It is labeled 1358.3 on the board. The difference for u-boot is that is has other DDR3 RAM on it:
1 x MT41K256M16HA125E instead of 2 x MT41J256M8HX15E on revisions 1 and
2. Both configurations are 512 MiB.
Configure your u-boot build with pcm051_rev3 for the new RAM and pcm051_rev1 for the old RAM configuration. Board revision 2 has to use pcm051_rev1 also.

Is there no run-time way to tell if we're on rev1/2/3?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131119/1e711fce/attachment.pgp>
#2 lore raw

PATCH 1/1 pcm051: Support for revision 3

Am Dienstag, 19. November 2013, 15:08:27 schrieb Tom Rini:

Quoted 11 lines · Lars Poeschel
Quoted 10 lines

From: Lars Poeschel <[email protected]>

Phytec sells revision or version 3 of pcm051. It is labeled 1358.3 on the board. The difference for u-boot is that is has other DDR3 RAM on it:
1 x MT41K256M16HA125E instead of 2 x MT41J256M8HX15E on revisions 1 and
2. Both configurations are 512 MiB.
Configure your u-boot build with pcm051_rev3 for the new RAM and pcm051_rev1 for the old RAM configuration. Board revision 2 has to use pcm051_rev1 also.

Quoted 3 lines
Quoted 1 line

Is there no run-time way to tell if we're on rev1/2/3?

Unfortunately I am not aware of a 100% bullet proof one.
One way would be to read the AM3359 silicon ID. I have two boards here: rev1 and rev3. The phytec rev3 board has a newer silicon on it. I don't know about rev2's silicon ID. And I am not sure if the rev3 silicon change directly corresponds to the DDR RAM change and if all rev3 boards have the new silicon. What I know for sure is that the RAM change was with rev3. Nevertheless phytec itself supplies a patched barebox as bootloader. And they have a compile time config option for different RAM configurations of the board. And they even seem to have more RAM configurations than the two I have seen yet.

Lars

#3 lore raw

PATCH 1/1 pcm051: Support for revision 3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 16 lines · Lars Poeschel

Am Dienstag, 19. November 2013, 15:08:27 schrieb Tom Rini:

Quoted 11 lines · Lars Poeschel
Quoted 10 lines

From: Lars Poeschel <[email protected]>

Phytec sells revision or version 3 of pcm051. It is labeled 1358.3 on the board. The difference for u-boot is that is has other DDR3 RAM on it: 1 x MT41K256M16HA125E instead of 2 x MT41J256M8HX15E on revisions 1 and 2. Both configurations are 512 MiB. Configure your u-boot build with pcm051_rev3 for the new RAM and pcm051_rev1 for the old RAM configuration. Board revision 2 has to use pcm051_rev1 also.

Quoted 3 lines
Quoted 1 line

Is there no run-time way to tell if we're on rev1/2/3?

Quoted 10 lines

Unfortunately I am not aware of a 100% bullet proof one. One way would be to read the AM3359 silicon ID. I have two boards here:
rev1 and rev3. The phytec rev3 board has a newer silicon on it. I don't know about rev2's silicon ID. And I am not sure if the rev3 silicon change directly corresponds to the DDR RAM change and if all rev3 boards have the new silicon. What I know for sure is that the RAM change was with rev3. Nevertheless phytec itself supplies a patched barebox as bootloader. And they have a compile time config option for different RAM configurations of the board. And they even seem to have more RAM configurations than the two I have seen yet.

OK, thanks.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSjggcAAoJENk4IS6UOR1WOFcQAJmvkp5P2nkvSRhYAgqupGBL EczfkW/hERfExMHjzas+UUGUcr7WJgX4lnFMZOou0hdTBilkjl4gI1xVQfuoUMQA fw0Gya8R6dI8I9x7rtoFRM69+mbA2HXNei040aqlX7mmqK5BSUA85IFlTUf7//A8 zXsiUDNzze6V0+TvzM/IFdA9ma1aQnNDoiuMEjcwFKC5/d4wgC0Lntx6SfwlFiKD BuddoIglkMHDJ1ZjAhGgrZU0Jt4LuctD+mHRdN4GRo9evO8sXpbDU95ZsEefbza0 eT0mvXXy/gUEg7LUnRmmAKgOstLmX4ttC+9PxMWpmdO4LX8b4zEGPfI3Ev39KTj1 GwiKlmNudhBHIcCgfoj9dYTgXdpgGgw5KVU1sms1Nn/uTEvAG9wVIeiibzzHLmh3 XgibqSjMD3FosqG+tnliELJKnh/yAqpYVAV7ldVpKXP2VeKAdSRHwffTgbkYUYhS KI2G+JXvQjOYS176uTTRkwDwPOSwx8A7cs/fkbTkPyWkzlyzn6ZDemmcLnv48f6F XD+HBtcFpfplAxg4kJ9bws97tKgtYYJK0eoC6C82eM/k8XFkb/lJ7FaLusU4KGtM 4njiBYktv8I3J/kh2fOe2r9ACJpyBJFm+ffFJlN+x1GInMHiJ9tYpDliA0+Pw5Jm vjbvV/rGHT9Lo1o73FUY
=hMkr
-----END PGP SIGNATURE-----

#4 lore raw
In reply to Lars Poeschel
Quoted 11 lines · Lars Poeschel

From: Lars Poeschel <[email protected]>

Phytec sells revision or version 3 of pcm051. It is labeled 1358.3 on the board. The difference for u-boot is that is has other DDR3 RAM on it:
1 x MT41K256M16HA125E instead of 2 x MT41J256M8HX15E on revisions 1 and
2. Both configurations are 512 MiB.
Configure your u-boot build with pcm051_rev3 for the new RAM and pcm051_rev1 for the old RAM configuration. Board revision 2 has to use pcm051_rev1 also.

Applied to u-boot-ti/master, after adapting to my change about not touching some EMIF4D registers, :thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131204/9b82cb6a/attachment.pgp>