[U-Boot] [[PATCH]pandaboard: 0/1] Modification of Elpida DDR2 RAM for Pandaboard-ES Rev B3

From: Hardik Patel hardik.patel@volansystech.com
This patch adds Elpida DDR2 RAM support for Pandaboard-ES Rev-B3 board.Enable automatic sdram detection in pandaboard defconfig, so that Elpida DDR2 RAM gets detected on Pandaboard-ES Rev-B3 board. We verified that u-boot works on Panadaboard-ES Rev-B2 board with this patch.
Hardik Patel (1): Modification of Elpida DDR2 RAM for Pandaboard-ES Rev B3
include/configs/omap4_common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)

From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com --- include/configs/omap4_common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h index e9f2383..9aa4030 100644 --- a/include/configs/omap4_common.h +++ b/include/configs/omap4_common.h @@ -240,7 +240,12 @@ #define CONFIG_SYS_CACHELINE_SIZE 32
/* Defines for SDRAM init */ -#define CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS + +/* + * Enable automatic sdram detection + * for detecting Elpida RAM on Rev B3 + */ +#undef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
#ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS #define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION

On 10/25/2013 10:42 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
include/configs/omap4_common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h index e9f2383..9aa4030 100644 --- a/include/configs/omap4_common.h +++ b/include/configs/omap4_common.h @@ -240,7 +240,12 @@ #define CONFIG_SYS_CACHELINE_SIZE 32
/* Defines for SDRAM init */ -#define CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
+/*
- Enable automatic sdram detection
- for detecting Elpida RAM on Rev B3
- */
+#undef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
Nak
This is used on all other Panda revisions.
Why are we just disabling this for all devices when one device is the issue? And as discussed off line I have an older B3 which boots fine on the uBoot mainline.
So what is the difference between your B3 and my B3? Please answer this to the community or point to a reference were one can determine what B3 board they have
Dan
#ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS #define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/28/2013 08:51 AM, Dan Murphy wrote:
On 10/25/2013 10:42 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com --- include/configs/omap4_common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h index e9f2383..9aa4030 100644 --- a/include/configs/omap4_common.h +++ b/include/configs/omap4_common.h @@ -240,7 +240,12 @@ #define CONFIG_SYS_CACHELINE_SIZE 32
/* Defines for SDRAM init */ -#define CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS + +/* + * Enable automatic sdram detection + * for detecting Elpida RAM on Rev B3
- */ +#undef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
Nak
This is used on all other Panda revisions.
Why are we just disabling this for all devices when one device is the issue? And as discussed off line I have an older B3 which boots fine on the uBoot mainline.
So what is the difference between your B3 and my B3? Please answer this to the community or point to a reference were one can determine what B3 board they have
I think we've got two issues here: a) Your B3 is apparently an early non-public rev. b) When we use the automatic timing calculation code, it then spits out what the values are (I would swear) so that you can then plug them back in.
We should make B3 know what the right timing values to use are.
- -- Tom

Tom, Dan,
Thanks for your feedback on patch.
If I understand correctly, you are suggesting to put static timing values for RevB3(instead of putting it for auto detection) in "emif_get_reg_dump" and "emif_get_dmm_regs_sdp" functions as we do it for other panda revisions.
We have already figured out timing values for Elpida RAM on Rev B3. However, We need a way to differentiate "Rev-B2" and "Rev-B3", as both boards are very similar. We have checked that "omap_revision()" returns same value on both B2 and B3.
We have found one difference between both revisions that we may use. GPIO171 is '0' for Rev B1/B2, and it comes to '1' for Rev B3. We have verified this between two boards. * GPIO2, GPIO3, GPIO171, GPIO48, GPIO182: 0 0 0 1 1 => B1/B2 * GPIO2, GPIO3, GPIO171, GPIO48, GPIO182: 0 0 1 1 1 => B3
Please suggest a correct way to differentiate between B2 and B3 in "sdram_elpida.c", so that patch gets accepted. Should we export and use "get_board_revision()" along with "omap_revision()" in "sdram_elpida.c" to differentiate between B2 and B3? In current code "get_board_revision()" is not exported to "sdram_elpida.c".
Thanks, Hardik
On Mon, Oct 28, 2013 at 6:34 PM, Tom Rini trini@ti.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/28/2013 08:51 AM, Dan Murphy wrote:
On 10/25/2013 10:42 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com --- include/configs/omap4_common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h index e9f2383..9aa4030 100644 --- a/include/configs/omap4_common.h +++ b/include/configs/omap4_common.h @@ -240,7 +240,12 @@ #define CONFIG_SYS_CACHELINE_SIZE 32
/* Defines for SDRAM init */ -#define CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS + +/* + * Enable automatic sdram detection + * for detecting Elpida RAM on Rev B3
- */ +#undef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
Nak
This is used on all other Panda revisions.
Why are we just disabling this for all devices when one device is the issue? And as discussed off line I have an older B3 which boots fine on the uBoot mainline.
So what is the difference between your B3 and my B3? Please answer this to the community or point to a reference were one can determine what B3 board they have
I think we've got two issues here: a) Your B3 is apparently an early non-public rev. b) When we use the automatic timing calculation code, it then spits out what the values are (I would swear) so that you can then plug them back in.
We should make B3 know what the right timing values to use are.
Tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJSbmD5AAoJENk4IS6UOR1WuZcQAIvGDclBm78ecq6NTz+3Otv1 ln5C67Yo+7ZuiP5s7N5Ag7kKP2ZkzioouV+W9qFj/VxQBY6k2auyfXGRQ/aCamm5 pTmvdkQQCnqFgTfBTWofpRTQJkwMTT16cVpe+BQa4EriowklvHRfR8dHGmS5Figp 5Ta/xTo3HVa2eU5AK4StB7eQHjqMxHA5EUSD+c1sSmqSdX6aXi2DDjA3IpvakrOf GsrZ6hKzooMPYPEgg/kqWRO5fOESu+bTw87afkpxntkanTa8XTq8INb4EiR8iMSp 3dyvZxEzmslykPV5k38hN8UPT/ZInn9pD6nXtXp/JqqQm7MQguCR+nvS/BpP3S9z LWwCYtxtHoigw9v+LBTZ93AbgGgeOH8w5l0DFABFNWQhEilSHPYn7t3cpH9GfLjy 1nmTYezYTfoeiIkqtuUmGzJ6zM43W0lka/yCIi0TfFRha6qvR5LYadSe2YmKZaSg yxV4Q6v4VIMQWLXpS2777ExQDcTcGLZR+MHdLfLsmUd4X+3kU9Dk7XO0o0Ek/n8F pleX3+d6QJpPe7kFUReHPGRaGbRo52zwz5J8k2FcUY7aAS2fPBC4l/xbH+iD7TAn q6k7yAs0r5+zsWtosg/tkWwQUzlvgf7KmmYyBnMRtQojvQrhbRfj8a7wuboPmzlT 6XuJH/wGNtgCFZ/IQuBe =+35Q -----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/29/2013 10:17 AM, Hardik Patel wrote:
Tom, Dan,
Thanks for your feedback on patch.
If I understand correctly, you are suggesting to put static timing values for RevB3(instead of putting it for auto detection) in "emif_get_reg_dump" and "emif_get_dmm_regs_sdp" functions as we do it for other panda revisions.
We have already figured out timing values for Elpida RAM on Rev B3. However, We need a way to differentiate "Rev-B2" and "Rev-B3", as both boards are very similar. We have checked that "omap_revision()" returns same value on both B2 and B3.
We have found one difference between both revisions that we may use. GPIO171 is '0' for Rev B1/B2, and it comes to '1' for Rev B3. We have verified this between two boards.
- GPIO2, GPIO3, GPIO171, GPIO48, GPIO182: 0 0 0 1 1 => B1/B2
- GPIO2, GPIO3, GPIO171, GPIO48, GPIO182: 0 0 1 1 1 => B3
Please suggest a correct way to differentiate between B2 and B3 in "sdram_elpida.c", so that patch gets accepted. Should we export and use "get_board_revision()" along with "omap_revision()" in "sdram_elpida.c" to differentiate between B2 and B3? In current code "get_board_revision()" is not exported to "sdram_elpida.c".
Note that emif_get_device_details is a weak function, so you can just add one to board/ti/panda/panda.c that will provide the correct data out of sdram_elpida.c, and not have to modify the function in sdram_elpida.c
- -- Tom

From: Hardik Patel hardik.patel@volansystech.com
This patch adds Elpida DDR2 RAM support for Pandaboard-ES Rev-B3 board. We need to use emif_regs_elpida_400_mhz_1cs struct to dump timings required for Elpida RAM on Pandaboard-ES Rev-B3. So, we detected Pandaboard-ES Rev-B3, and put a check to differentiate Rev-B3 with other panda boards. We verified that u-boot works on Panadaboard-ES Rev-B2 board with this patch.
--- Changes for v2: - Use pre-calculated timings for Elpida RAM instead of automatic - Added function to detect Pandaboard-ES Rev-B3 using GPIO 171
Hardik Patel (1): Modification of Elpida DDR2 RAM
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)

From: Hardik Patel hardik.patel@volansystech.com
This patch adds Elpida DDR2 RAM support for Pandaboard-ES Rev-B3 board. We need to use emif_regs_elpida_400_mhz_1cs struct to dump timings required for Elpida RAM on Pandaboard-ES Rev-B3. So, we detected Pandaboard-ES Rev-B3, and put a check to differentiate Rev-B3 with other panda boards. We verified that u-boot works on Panadaboard-ES Rev-B2 board with this patch.
--- Changes for v2: - Use pre-calculated timings for Elpida RAM instead of automatic - Added function to detect Pandaboard-ES Rev-B3 using GPIO 171
Hardik Patel (1): Modification of Elpida DDR2 RAM
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)

From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com --- arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs; - else if (omap4_rev < OMAP4470_ES1_0) + else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs; diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{ + int processor_rev = omap_revision(); + int ret = 0; + + if ((processor_rev >= OMAP4460_ES1_0 && + processor_rev <= OMAP4460_ES1_1)) { + + /* Setup the mux for the common board ID pins (gpio 171) */ + writew((IEN | M3), (*ctrl)->control_padconf_core_base + UNIPRO_TX0); + + /* if processor_rev is panda ES and GPIO171 is 1, it is rev b3 */ + ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO); + } + return ret; +} + /** * @brief misc_init_r - Configure Panda board specific configurations * such as power configurations, ethernet initialization as phase2 of

On Thu, Nov 14, 2013 at 4:06 AM, Hardik hardik.patel@volansystech.com wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs;
else if (omap4_rev < OMAP4470_ES1_0)
else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio 171) */
writew((IEN | M3), (*ctrl)->control_padconf_core_base + UNIPRO_TX0);
/* if processor_rev is panda ES and GPIO171 is 1, it is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of
Nice, this works great on my Panda ES B3.
Tested-by: Robert Nelson robertcnelson@gmai.com
U-Boot SPL 2013.10-00339-g712d969 (Nov 14 2013 - 09:21:19) OMAP4460 ES1.1 SPL: Please implement spl_start_uboot() for your board SPL: Direct Linux boot not active! reading u-boot.img reading u-boot.img
U-Boot 2013.10-00339-g712d969 (Nov 14 2013 - 09:21:19)
CPU : OMAP4460 ES1.1 Board: OMAP4 Panda I2C: ready DRAM: 1 GiB MMC: OMAP SD/MMC: 0 Using default environment
BTW, should be bump the system enviroment board_name, that way it loads a different kernel *.dtb? (omap4-panda-es-b3.dtb)
As right now it'll load the omap4-panda-es.dtb which currently uses both cs lines on the emif driver..
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/ar...
Regards,

Hi
On Thu, Nov 14, 2013 at 11:06 AM, Hardik hardik.patel@volansystech.com wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs;
else if (omap4_rev < OMAP4470_ES1_0)
else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644
No, it's not ok. Sorry but implement in this way it's a no-sense
else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3() && !is_cat() &&
!is_dog())
*regs = &emif_regs_elpida_400_mhz_2cs;
Michael
--- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio 171) */
writew((IEN | M3), (*ctrl)->control_padconf_core_base + UNIPRO_TX0);
/* if processor_rev is panda ES and GPIO171 is 1, it is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of
-- 1.7.9.5
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/14/2013 05:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs;
- else if (omap4_rev < OMAP4470_ES1_0)
- else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio 171) */
writew((IEN | M3), (*ctrl)->control_padconf_core_base + UNIPRO_TX0);
/* if processor_rev is panda ES and GPIO171 is 1, it is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of
This isn't right. What I was saying is that board/ti/panda/panda.c needs to provide its own emif_get_reg_dump function, which will (as designed) override the current one from arch/arm/cpu/armv7/omap4/sdram_elpida.c
- -- Tom

Hi
On Thu, Nov 14, 2013 at 5:19 PM, Tom Rini trini@ti.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/14/2013 05:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs;
else if (omap4_rev < OMAP4470_ES1_0)
else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio 171) */
writew((IEN | M3), (*ctrl)->control_padconf_core_base + UNIPRO_TX0);
/* if processor_rev is panda ES and GPIO171 is 1, it is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of
This isn't right. What I was saying is that board/ti/panda/panda.c needs to provide its own emif_get_reg_dump function, which will (as designed) override the current one from arch/arm/cpu/armv7/omap4/sdram_elpida.c
Any problem to have visibility of emif_regs array of lpddr?
Michael
Tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJShPgfAAoJENk4IS6UOR1WROMP/3lqEirFqwVeXUaq2eyphdnD AQzrzGE3ARc/gb7PqoAKGcvr7HZXQqa/ueRib/QyCRT53gc9S/nJu/wLN/i3NAVJ 4Y2LOgIkWlPi1k2l1mHvb6SZRVC4ZBFr3MwxoOQCRzMmBCAOwjSzimllT/nA9oSF 7r2/4tsYpidEoXxK8hn8lKpcfLeAda3MRdQwRjnWXfkJD+rBuAE/w0xCy8I5UmJr +7J25HFacEbdceexAuzn4wFpSjex5o4yMyD6TFShzsG3GP8aktvWzXi94gx2FZhF r6526qnjRXH7+RefIVlb95u2+/VpGz9Zu69xga2aszvU+kLHV0s2TTV6SVVmf2aG Rj4JUxHc6wBYSB3tVNP1NJBiSS3WrmEIlmnQqZXmx51GfJKBHPGaljt5ldGMAUtT /gtTRw0tw5q/Lv2dHy7BByqxTxk+8iko52X/9zl+vqzKuZS9oOS7/8Wu6q6pXeZc jm8W/dCRCtO8h1j7BZVJTA+LE05MWKiA6P79lWAR08Eh7U2OwvkCq8WsRBtdxk5z hqqy09OliHnMliNIRzW5LA8UiBmbw4mXIl27HrX8eNJ0PSXuRFCravm50OLph88L BQDhKETjVy/dguq/L5lC+FgHwI0U6Hoip20Y8qy/m8YywdutKhw5Zk9jxMZFNCOb KrOq3OJiJE8d4oSe8VnA =NxpQ -----END PGP SIGNATURE----- _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/14/2013 11:28 AM, Michael Trimarchi wrote:
Hi
On Thu, Nov 14, 2013 at 5:19 PM, Tom Rini trini@ti.com wrote: On 11/14/2013 05:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs;
else if (omap4_rev < OMAP4470_ES1_0)
else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio 171) */
writew((IEN | M3), (*ctrl)->control_padconf_core_base + UNIPRO_TX0);
/* if processor_rev is panda ES and GPIO171 is 1, it is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of
This isn't right. What I was saying is that board/ti/panda/panda.c needs to provide its own emif_get_reg_dump function, which will (as designed) override the current one from arch/arm/cpu/armv7/omap4/sdram_elpida.c
Any problem to have visibility of emif_regs array of lpddr?
Things that need exposing so that we can do what was intended before should be exposed, in <asm/arch-omap4/sys_proto.h> I think.
- -- Tom

On Thu, Nov 14, 2013 at 10:02 PM, Tom Rini trini@ti.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/14/2013 11:28 AM, Michael Trimarchi wrote:
Hi
On Thu, Nov 14, 2013 at 5:19 PM, Tom Rini trini@ti.com wrote: On 11/14/2013 05:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24
++++++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c
b/arch/arm/cpu/armv7/omap4/sdram_elpida.c
index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr,
const struct emif_regs **regs)
*regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs;
else if (omap4_rev < OMAP4470_ES1_0)
else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda
board,
+* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio
171) */
writew((IEN | M3),
(*ctrl)->control_padconf_core_base + UNIPRO_TX0);
/* if processor_rev is panda ES and GPIO171 is 1, it
is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of
This isn't right. What I was saying is that board/ti/panda/panda.c needs to provide its own emif_get_reg_dump function, which will (as designed) override the current one from arch/arm/cpu/armv7/omap4/sdram_elpida.c
Any problem to have visibility of emif_regs array of lpddr?
Things that need exposing so that we can do what was intended before should be exposed, in <asm/arch-omap4/sys_proto.h> I think.
Tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJShPszAAoJENk4IS6UOR1W2TMP/RzK77vL75h5HYP23RKP/CWx i7A/xbStKYT8ozh2s1IyHsKohVmnFmIh6lIa4cTYMzrqQBIJxnw9NB1p73qRFPFS M8Bwx0QS3IU9Wqybk2w1x26Ymm65NWcAQ9SvPh4EBCpdnu1JnJoaceekw1fp55Pb B+H/44Xr5D57F4R0DAuLqT2Kc6uoMf69X6I/DU7CuxhcceoMAMaFrZq+WrLAqIeY M5qsCTsyOIQdzV4pheR9gH7F6dbzlA9uee2lshIP0yN5JJmWkZc1CjMR0SsStSpy RKFJuNOgv32v7CGwvyA/HAk6KdKy5VSWUhHT/+1B3fMzIZhxypOlL90Vbz2Zlh5N J5E5RNWsQaBJnVaEpo/4wWOTWmq/L5+lQLyJVPUkZFGocHgRBT8gqkcREe/+mSKx DaxX4mLNlCvooMrNSakPPZHtPHXnVieMAvhdKDDdhLRKHAST+1hZD/ztBD63bwcJ eSvGBe6SDv/K/mScU9eeNtJzVYs6O1VZm9sqgJBPhgUTN/Mfv7NbZVF3m4rMpkeB PbQ/eSzxERBxeiInrPh2Ns62oDxCXTodOw5qy+jUQ72WPI/3zMNRHaBbyXTNn9nZ NAj4XSex3tiQUpJYw21wbshEuCz4/Lo5LBWXeksdg0bfSxWX9jG/mpkOE6NACSyE 7TeL/tTeum0zVByyfhjG =ZmUi -----END PGP SIGNATURE-----
Hi Tom, Michel,
Thanks for your feedback on this.
We had implemented override of "emif_get_reg_dump" function in panda.c. However, we thought checking detection of pandaboard in sdram_elpida.c be smaller change and it was also under omap4. However, now I realized after discussing that this may break in case of non panda.c OMAP4 boards.
Based on your feedback,we are going to correct it like below. I am trying to explain it in brief:
1) We are going to extern emif_regs in <asm/arch-omap4/sys_proto.h>, so that we can access them in panda.c #ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS extern const struct emif_regs emif_regs_elpida_200_mhz_2cs; extern const struct emif_regs emif_regs_elpida_380_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_2cs; #endif
2) "emif_regs_elpida_200_mhz_2cs" & "emif_regs_elpida_380_mhz_1cs" are defined as "*static* const" in sdram_elpida.c. So, we need to remove "static" out of them as we are accessing it outside. This will be change in sdram_elpida.c.
3) In Panda.c, we will write "emif_get_reg_dump" strong function as below to override one of sdram_elpida.c. We would still need "is_panda_es_rev_b3()" function to identify rev b3. However we will use it properly by NOT using NOT OPERATOR( ! is_panda_es_rev_b3() ) .
#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS static void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs) { u32 omap4_rev = omap_revision();
/* Same devices and geometry on both EMIFs */ if (omap4_rev == OMAP4430_ES1_0) *regs = &emif_regs_elpida_380_mhz_1cs; else if (omap4_rev == OMAP4430_ES2_0) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs; else if (omap4_rev < OMAP4470_ES1_0) { if( *is_panda_es_rev_b3()* ) *regs = &emif_regs_elpida_400_mhz_1cs; else *regs = &emif_regs_elpida_400_mhz_2cs; } else *regs = &emif_regs_elpida_400_mhz_1cs; } #endif
All changes will be protected by "#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS" macro.
Please let me know if above changes makes sense.
Thanks, Hardik

Hi
On Thu, Nov 14, 2013 at 7:43 PM, Hardik Patel hardik.patel@volansystech.com wrote:
On Thu, Nov 14, 2013 at 10:02 PM, Tom Rini trini@ti.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/14/2013 11:28 AM, Michael Trimarchi wrote:
Hi
On Thu, Nov 14, 2013 at 5:19 PM, Tom Rini trini@ti.com wrote: On 11/14/2013 05:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- board/ti/panda/panda.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..9fbdeea 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs;
else if (omap4_rev < OMAP4470_ES1_0)
else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) *regs = &emif_regs_elpida_400_mhz_2cs; else *regs = &emif_regs_elpida_400_mhz_1cs;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/ +u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio
- */
writew((IEN | M3), (*ctrl)->control_padconf_core_base
- UNIPRO_TX0);
/* if processor_rev is panda ES and GPIO171 is 1, it
is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of
This isn't right. What I was saying is that board/ti/panda/panda.c needs to provide its own emif_get_reg_dump function, which will (as designed) override the current one from arch/arm/cpu/armv7/omap4/sdram_elpida.c
Any problem to have visibility of emif_regs array of lpddr?
Things that need exposing so that we can do what was intended before should be exposed, in <asm/arch-omap4/sys_proto.h> I think.
Tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJShPszAAoJENk4IS6UOR1W2TMP/RzK77vL75h5HYP23RKP/CWx i7A/xbStKYT8ozh2s1IyHsKohVmnFmIh6lIa4cTYMzrqQBIJxnw9NB1p73qRFPFS M8Bwx0QS3IU9Wqybk2w1x26Ymm65NWcAQ9SvPh4EBCpdnu1JnJoaceekw1fp55Pb B+H/44Xr5D57F4R0DAuLqT2Kc6uoMf69X6I/DU7CuxhcceoMAMaFrZq+WrLAqIeY M5qsCTsyOIQdzV4pheR9gH7F6dbzlA9uee2lshIP0yN5JJmWkZc1CjMR0SsStSpy RKFJuNOgv32v7CGwvyA/HAk6KdKy5VSWUhHT/+1B3fMzIZhxypOlL90Vbz2Zlh5N J5E5RNWsQaBJnVaEpo/4wWOTWmq/L5+lQLyJVPUkZFGocHgRBT8gqkcREe/+mSKx DaxX4mLNlCvooMrNSakPPZHtPHXnVieMAvhdKDDdhLRKHAST+1hZD/ztBD63bwcJ eSvGBe6SDv/K/mScU9eeNtJzVYs6O1VZm9sqgJBPhgUTN/Mfv7NbZVF3m4rMpkeB PbQ/eSzxERBxeiInrPh2Ns62oDxCXTodOw5qy+jUQ72WPI/3zMNRHaBbyXTNn9nZ NAj4XSex3tiQUpJYw21wbshEuCz4/Lo5LBWXeksdg0bfSxWX9jG/mpkOE6NACSyE 7TeL/tTeum0zVByyfhjG =ZmUi -----END PGP SIGNATURE-----
Hi Tom, Michel,
Thanks for your feedback on this.
We had implemented override of "emif_get_reg_dump" function in panda.c. However, we thought checking detection of pandaboard in sdram_elpida.c be smaller change and it was also under omap4. However, now I realized after discussing that this may break in case of non panda.c OMAP4 boards.
Based on your feedback,we are going to correct it like below. I am trying to explain it in brief:
- We are going to extern emif_regs in <asm/arch-omap4/sys_proto.h>, so that
we can access them in panda.c #ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS extern const struct emif_regs emif_regs_elpida_200_mhz_2cs; extern const struct emif_regs emif_regs_elpida_380_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_2cs; #endif
I prefer having them in type name and have a function that give back the pointer of the regs?
- "emif_regs_elpida_200_mhz_2cs" & "emif_regs_elpida_380_mhz_1cs" are
defined as "static const" in sdram_elpida.c. So, we need to remove "static" out of them as we are accessing it outside. This will be change in sdram_elpida.c.
- In Panda.c, we will write "emif_get_reg_dump" strong function as below to
override one of sdram_elpida.c. We would still need "is_panda_es_rev_b3()" function to identify rev b3. However we will use it properly by NOT using NOT OPERATOR( ! is_panda_es_rev_b3() ) .
#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS static void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs) { u32 omap4_rev = omap_revision();
/* Same devices and geometry on both EMIFs */ if (omap4_rev == OMAP4430_ES1_0) *regs = &emif_regs_elpida_380_mhz_1cs; else if (omap4_rev == OMAP4430_ES2_0) *regs = &emif_regs_elpida_200_mhz_2cs; else if (omap4_rev == OMAP4430_ES2_3) *regs = &emif_regs_elpida_400_mhz_1cs; else if (omap4_rev < OMAP4470_ES1_0) { if( is_panda_es_rev_b3() ) *regs = &emif_regs_elpida_400_mhz_1cs; else *regs = &emif_regs_elpida_400_mhz_2cs; } else *regs = &emif_regs_elpida_400_mhz_1cs;
}
Is it possible to arrange it in a switch?
Michael
#endif
All changes will be protected by "#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS" macro.
Please let me know if above changes makes sense.
Thanks, Hardik

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/14/2013 01:43 PM, Hardik Patel wrote:
On Thu, Nov 14, 2013 at 10:02 PM, Tom Rini <trini@ti.com mailto:trini@ti.com> wrote: On 11/14/2013 11:28 AM, Michael Trimarchi wrote:
Hi
On Thu, Nov 14, 2013 at 5:19 PM, Tom Rini <trini@ti.com
mailto:trini@ti.com> wrote:
On 11/14/2013 05:06 AM, Hardik wrote:
> From: Hardik Patel <hardik.patel@volansystech.com
mailto:hardik.patel@volansystech.com>
> > Signed-off-by: Hardik Patel <hardik.patel@volansystech.com
mailto:hardik.patel@volansystech.com>
> --- > arch/arm/cpu/armv7/omap4/sdram_elpida.c | 2 +- > board/ti/panda/panda.c | 24
++++++++++++++++++++++++
> 2 files changed, 25 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c
b/arch/arm/cpu/armv7/omap4/sdram_elpida.c
> index e4c8316..9fbdeea 100644 > --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c > +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c > @@ -123,7 +123,7 @@ static void emif_get_reg_dump_sdp(u32 emif_nr,
const struct emif_regs **regs)
> *regs = &emif_regs_elpida_200_mhz_2cs; > else if (omap4_rev == OMAP4430_ES2_3) > *regs = &emif_regs_elpida_400_mhz_1cs; > - else if (omap4_rev < OMAP4470_ES1_0) > + else if (omap4_rev < OMAP4470_ES1_0 && !is_panda_es_rev_b3()) > *regs = &emif_regs_elpida_400_mhz_2cs; > else > *regs = &emif_regs_elpida_400_mhz_1cs; > diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c > index c104024..5a7f80a 100644 > --- a/board/ti/panda/panda.c > +++ b/board/ti/panda/panda.c > @@ -122,6 +122,30 @@ int get_board_revision(void) > return board_id; > } > > +/* > +* Routine: is_panda_es_rev_b3 > +* Description: Detect if we are running on B3 version of ES panda
board,
> +* This can be done by reading the level of GPIO 171 > +* and checking the processor revisions. > +* GPIO171: 1 => Panda ES Rev B3 > +*/ > +u8 is_panda_es_rev_b3(void) > +{ > + int processor_rev = omap_revision(); > + int ret = 0; > + > + if ((processor_rev >= OMAP4460_ES1_0 && > + processor_rev <= OMAP4460_ES1_1)) { > + > + /* Setup the mux for the common board ID pins
(gpio 171) */
> + writew((IEN | M3),
(*ctrl)->control_padconf_core_base + UNIPRO_TX0);
> + > + /* if processor_rev is panda ES and GPIO171 is 1,
it is rev b3 */
> + ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO); > + } > + return ret; > +} > + > /** > * @brief misc_init_r - Configure Panda board specific configurations > * such as power configurations, ethernet initialization as phase2 of
This isn't right. What I was saying is that board/ti/panda/panda.c needs to provide its own emif_get_reg_dump function, which will (as designed) override the current one from arch/arm/cpu/armv7/omap4/sdram_elpida.c
Any problem to have visibility of emif_regs array of lpddr?
Things that need exposing so that we can do what was intended before should be exposed, in <asm/arch-omap4/sys_proto.h> I think.
Hi Tom, Michel,
Thanks for your feedback on this.
We had implemented override of "emif_get_reg_dump" function in panda.c. However, we thought checking detection of pandaboard in sdram_elpida.c be smaller change and it was also under omap4. However, now I realized after discussing that this may break in case of non panda.c OMAP4 boards.
Based on your feedback,we are going to correct it like below. I am trying to explain it in brief:
- We are going to extern emif_regs in <asm/arch-omap4/sys_proto.h>, so
that we can access them in panda.c #ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS extern const struct emif_regs emif_regs_elpida_200_mhz_2cs; extern const struct emif_regs emif_regs_elpida_380_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_1cs; extern const struct emif_regs emif_regs_elpida_400_mhz_2cs; #endif
Minor nit, don't protect externs with #ifdef, that's not required. Otherwise, sounds like a good plan, thanks.
- -- Tom

On 11/14/2013 04:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Add some details about the change -> commit message is usually suggested as a good thing to have.
[...]
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171 +* and checking the processor revisions. +* GPIO171: 1 => Panda ES Rev B3 +*/
will be good to see some kernel-doc style comments here.. /** * u8 is_panda_es_rev_b3 - Detect if we are running on B3 version of ES panda * * This can be done by reading the level of GPIO 171 and checking the * processor revisions. GPIO171: 1 => Panda ES Rev B3 (if using OMAP4460) */
u8 is_panda_es_rev_b3(void)
+u8 is_panda_es_rev_b3(void) +{
int processor_rev = omap_revision();
int ret = 0;
if ((processor_rev >= OMAP4460_ES1_0 &&
processor_rev <= OMAP4460_ES1_1)) {
/* Setup the mux for the common board ID pins (gpio 171) */
writew((IEN | M3), (*ctrl)->control_padconf_core_base + UNIPRO_TX0);
Could rather belong to mux code in board/ti/panda/panda_mux_data.h?
/* if processor_rev is panda ES and GPIO171 is 1, it is rev b3 */
ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO);
}
return ret;
+}
Why cant we do something equivalent to beagle here? see board/ti/beagle/beagle.c
/**
- @brief misc_init_r - Configure Panda board specific configurations
- such as power configurations, ethernet initialization as phase2 of

On Thu, Nov 14, 2013 at 01:41:48PM -0600, Nishanth Menon wrote:
On 11/14/2013 04:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Add some details about the change -> commit message is usually suggested as a good thing to have.
[...]
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..5a7f80a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -122,6 +122,30 @@ int get_board_revision(void) return board_id; }
+/* +* Routine: is_panda_es_rev_b3 +* Description: Detect if we are running on B3 version of ES panda board, +* This can be done by reading the level of GPIO 171
Using Nishanth's reply since I had this one handy. There's trailing whitespace here, which the gerrit test setup makes very visible, but also shows that checkpatch.pl wasn't run before submission, so please fix that in v3. Thanks!

On 11/14/2013 01:41 PM, Nishanth Menon wrote:
On 11/14/2013 04:06 AM, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Add some details about the change -> commit message is usually suggested as a good thing to have.
Forgot to mention that you might want a better $subject here. the current one sucks :(
I suggest some thing like: ARM: OMAP4+: panda-es: Support Rev B3 Elpida DDR2
Commit message will state something on the lines of: OMAP4460 PandaBoard-ES samples till Rev B3 used ABC DDR2, however, starting Rev B3, boards are now manufactured with Elpida XYZ DDR2 ....
This kind of helps folks not reading pandaboard mailing lists to understand the context of the change.

Hello, I'm glad to see that solutions arrive to be able to boot on Pandaboard Rev B3. On top of this, does anybody could indicate me where I can find the u-boot repository and how to build it for Pandaboard ?
To summarize, I made 3 tests:
clone git://git.denx.de/u-boot.git checkout v2013.10 -b tmp build with omap4_panda_config
when I flash MLO and u-boot.bin files in my sdcard, it does not boot at all
clone https://android.googlesource.com/device/ti/panda/bootloader/uboot.git no specific checkout build with omap4_panda_config
when I flash MLO and u-boot.bin files in my sdcard, it does not boot at all
follow instructions from omappedia, i.e. retrieve, patch and build u-boot and xloader from git.omapzoom.org (http://omappedia.org/wiki/4AI.1.7_OMAP4_Icecream_Sandwich_Panda_Notes).
when I flash xloader and bootloader files in my sdcard, it works very well on PandaRevB2, but not on Rev B3. Unfortunately, I do not know how to apply the changes described in this subject, as there is not the same files.
-- View this message in context: http://u-boot.10912.n7.nabble.com/PATCH-pandaboard-0-1-Modification-of-Elpid... Sent from the U-Boot mailing list archive at Nabble.com.

From: Hardik Patel hardik.patel@volansystech.com
OMAP4460 PandaBoard-ES till Rev B3 used Elpida EDB8064B2PB-xx-F RAM. However, starting Rev B3, boards are now manufactured with Elpida EDB8164B3PF-xx-F DDR2 RAM.
--- Changes for v3: - Implemented strong emif_get_reg_dump function in panda.c to eliminate change in sdram_elpida.c - Extern emif_regs_* under sys_proto.h to be used by emif_get_reg_dump function in panda.c - Kernel doc style commenting - Run checkpatch to remove white spaces Changes for v2: - Use pre-calculated timings for Elpida RAM instead of automatic - Added function to detect Pandaboard-ES Rev-B3 using GPIO 171
Hardik Patel (1): Modification of Elpida RAM for Pandaboard-ES Rev-B3
arch/arm/cpu/armv7/omap4/sdram_elpida.c | 4 +- arch/arm/include/asm/arch-omap4/sys_proto.h | 4 ++ board/ti/panda/panda.c | 60 +++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-)

From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com --- arch/arm/cpu/armv7/omap4/sdram_elpida.c | 4 +- arch/arm/include/asm/arch-omap4/sys_proto.h | 4 ++ board/ti/panda/panda.c | 60 +++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap4/sdram_elpida.c b/arch/arm/cpu/armv7/omap4/sdram_elpida.c index e4c8316..7e1c6d0 100644 --- a/arch/arm/cpu/armv7/omap4/sdram_elpida.c +++ b/arch/arm/cpu/armv7/omap4/sdram_elpida.c @@ -32,7 +32,7 @@
#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
-static const struct emif_regs emif_regs_elpida_200_mhz_2cs = { +const struct emif_regs emif_regs_elpida_200_mhz_2cs = { .sdram_config_init = 0x80000eb9, .sdram_config = 0x80001ab9, .ref_ctrl = 0x0000030c, @@ -46,7 +46,7 @@ static const struct emif_regs emif_regs_elpida_200_mhz_2cs = { .emif_ddr_phy_ctlr_1 = 0x049ff808 };
-static const struct emif_regs emif_regs_elpida_380_mhz_1cs = { +const struct emif_regs emif_regs_elpida_380_mhz_1cs = { .sdram_config_init = 0x80000eb1, .sdram_config = 0x80001ab1, .ref_ctrl = 0x000005cd, diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h index 39c5316..ce8217f 100644 --- a/arch/arm/include/asm/arch-omap4/sys_proto.h +++ b/arch/arm/include/asm/arch-omap4/sys_proto.h @@ -16,6 +16,10 @@
DECLARE_GLOBAL_DATA_PTR;
+extern const struct emif_regs emif_regs_elpida_200_mhz_2cs; +extern const struct emif_regs emif_regs_elpida_380_mhz_1cs; +extern const struct emif_regs emif_regs_elpida_400_mhz_1cs; +extern const struct emif_regs emif_regs_elpida_400_mhz_2cs; struct omap_sysinfo { char *board_string; }; diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index c104024..cda09a9 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -123,6 +123,66 @@ int get_board_revision(void) }
/** + * is_panda_es_rev_b3() - Detect if we are running on rev B3 of panda board ES + * + * + * Detect if we are running on B3 version of ES panda board, + * This can be done by reading the level of GPIO 171 and checking the + * processor revisions. + * GPIO171: 1 => Panda ES Rev B3 + * + * Return : return 1 if Panda ES Rev B3 , else return 0 + */ +u8 is_panda_es_rev_b3(void) +{ + int processor_rev = omap_revision(); + int ret = 0; + + if ((processor_rev >= OMAP4460_ES1_0 && + processor_rev <= OMAP4460_ES1_1)) { + + /* Setup the mux for the common board ID pins (gpio 171) */ + writew((IEN | M3), + (*ctrl)->control_padconf_core_base + UNIPRO_TX0); + + /* if processor_rev is panda ES and GPIO171 is 1,it is rev b3 */ + ret = gpio_get_value(PANDA_BOARD_ID_2_GPIO); + } + return ret; +} + +#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS +/* + * emif_get_reg_dump() - emif_get_reg_dump strong function + * + * @emif_nr - emif base + * @regs - reg dump of timing values + * + * Strong function to override emif_get_reg_dump weak function in sdram_elpida.c + */ +void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs) +{ + u32 omap4_rev = omap_revision(); + + /* Same devices and geometry on both EMIFs */ + if (omap4_rev == OMAP4430_ES1_0) + *regs = &emif_regs_elpida_380_mhz_1cs; + else if (omap4_rev == OMAP4430_ES2_0) + *regs = &emif_regs_elpida_200_mhz_2cs; + else if (omap4_rev == OMAP4430_ES2_3) + *regs = &emif_regs_elpida_400_mhz_1cs; + else if (omap4_rev < OMAP4470_ES1_0) { + if(is_panda_es_rev_b3()) + *regs = &emif_regs_elpida_400_mhz_1cs; + else + *regs = &emif_regs_elpida_400_mhz_2cs; + } + else + *regs = &emif_regs_elpida_400_mhz_1cs; +} +#endif + +/** * @brief misc_init_r - Configure Panda board specific configurations * such as power configurations, ethernet initialization as phase2 of * boot sequence

On Wed, Nov 27, 2013 at 09:16:21PM +0530, Hardik wrote:
From: Hardik Patel hardik.patel@volansystech.com
Signed-off-by: Hardik Patel hardik.patel@volansystech.com
Applied to u-boot-ti/master, thanks!
participants (8)
-
Dan Murphy
-
Hardik
-
Hardik Patel
-
jmgrimaud
-
Michael Trimarchi
-
Nishanth Menon
-
Robert Nelson
-
Tom Rini