Skip to contentSkip to conversation

mpc8569mds: fix CONFIG_ENV_SIZE

PATCH New Haiying.Wang at freescale.com 3 participants 7 messages Sep 29, 2010 – Sep 30, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 mpc8569mds: fix CONFIG_ENV_SIZE

From: Haiying Wang <[email protected]>

CONFIG_ENV_SIZE of MPC8569MDS was wrongly set to CONFIG_ENV_SECT_SIZE which is 128KB, so it took longer time to do crc32 calculation for ENV than it should do. It causes the bootup for MPC8569MDS significantly slow. This patch fixs it to 0x2000(8KB), also fix the comment for CONFIG_ENV_SECT_SIZE to correct size.

Signed-off-by Kai.Jiang <Kai.Jiang at freescale.com
---
 include/configs/MPC8569MDS.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/configs/MPC8569MDS.h +2 -2
index 8ffd458..936f1af 100644
@@ -505,8 +505,8 @@ extern unsigned long get_clock_freq(void);
 #else
 #define CONFIG_ENV_IS_IN_FLASH	1
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SECT_SIZE	0x20000	/* 256K(one sector) for env */
-#define CONFIG_ENV_SIZE		CONFIG_ENV_SECT_SIZE
+#define CONFIG_ENV_SECT_SIZE	0x20000	/* 128K(one sector) for env */
+#define CONFIG_ENV_SIZE		0x2000
 #endif
 
 #define CONFIG_LOADS_ECHO	1	/* echo on for serial download */
Signature · 1 line
1.7.0
#1 lore raw

PATCH 2/3 mpc8569mds: fix consuming long time while relocating code.

From: Haiying Wang <[email protected]>

The original code maps boot flash as non-cacheable region. When calling relocate_code in flash to copy u-boot from flash to ddr, every loop copy command is read from flash. The flash read speed will be the bottleneck, which consuming long time to do this operation. To resovle this, map the boot flash as write-through cache via tlb. And set tlb to remap the flash after code executing in ddr, to confirm flash erase operation properly done.

---
 board/freescale/mpc8569mds/mpc8569mds.c |   25 +++++++++++++++++++++++++
 board/freescale/mpc8569mds/tlb.c        |   15 ++++++++++-----
 include/configs/MPC8569MDS.h            |    3 ++-
 3 files changed, 37 insertions(+), 6 deletions(-)
board/freescale/mpc8569mds/mpc8569mds.c +25 -0
index 01b7dcb..7028ce8 100644
@@ -211,6 +211,31 @@ int board_early_init_f (void)
 	return 0;
 }
 
+int board_early_init_r(void)
+{
+	const unsigned int flashbase = CONFIG_SYS_NAND_BASE;
+	const u8 flash_esel = 0;
+
+	/*
+	 * Remap Boot flash to caching-inhibited
+	 * so that flash can be erased properly.
+	 */
+
+	/* Flush d-cache and invalidate i-cache of any FLASH data */
+	flush_dcache();
+	invalidate_icache();
+
+	/* invalidate existing TLB entry for flash */
+	disable_tlb(flash_esel);
+
+	set_tlb(1, flashbase, CONFIG_SYS_NAND_BASE,	/* tlb, epn, rpn */
+		MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,	/* perms, wimge */
+		0, flash_esel,				/* ts, esel */
+		BOOKE_PAGESZ_64M, 1);			/* tsize, iprot */
+
+	return 0;
+}
+
 int checkboard (void)
 {
 	printf ("Board: 8569 MDS\n");
board/freescale/mpc8569mds/tlb.c +10 -5
index 73dcc3e..f852fc3 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * Copyright 2009-2010 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -46,15 +46,20 @@ struct fsl_e_tlb_entry tlb_table[] = {
 
 	/* TLB 1 Initializations */
 	/*
-	 * TLBe 0:	64M	Non-cacheable, guarded
+	 * TLBe 0:	64M	write-through, guarded
 	 * Out of reset this entry is only 4K.
-	 * 0xfc000000	256K	NAND FLASH (CS3)
-	 * 0xfe000000	32M	NOR FLASH (CS0)
+	 * 0xfc000000	32MB	NAND FLASH (CS3)
+	 * 0xfe000000	32MB	NOR FLASH (CS0)
 	 */
+#ifdef CONFIG_NAND_SPL
 	SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE,
 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+		      0, 0, BOOKE_PAGESZ_1M, 1),
+#else
+	SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_BASE,
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_W|MAS2_G,
 		      0, 0, BOOKE_PAGESZ_64M, 1),
-
+#endif
 	/*
 	 * TLBe 1:	256KB	Non-cacheable, guarded
 	 * 0xf8000000	32K	BCSR
include/configs/MPC8569MDS.h +2 -1
index 936f1af..95c0a9f 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Freescale Semiconductor, Inc.
+ * Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -74,6 +74,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_ENABLE_36BIT_PHYS	1
 
 #define CONFIG_BOARD_EARLY_INIT_F	1	/* Call board_pre_init */
+#define CONFIG_BOARD_EARLY_INIT_R	1
 #define CONFIG_HWCONFIG
 
 #define CONFIG_SYS_MEMTEST_START	0x00200000	/* memtest works on */
Signature · 1 line
1.7.0
#2 lore raw

PATCH 3/3 mpc8569mds: fix some ddr settings

In reply to Haiying.Wang at freescale.com

From: Haiying Wang <[email protected]>

Enable half drive strength, set RTT to 60Ohm and set write leveling override.

---
 board/freescale/mpc8569mds/ddr.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
board/freescale/mpc8569mds/ddr.c +13 -3
index e938788..e3f5b4a 100644
@@ -77,8 +77,18 @@ void fsl_ddr_board_options(memctl_options_t *popts,
 	popts->write_data_delay = 2;
 
 	/*
-	 * Factors to consider for half-strength driver enable:
-	 *	- number of DIMMs installed
+	 * Enable half drive strength
 	 */
-	popts->half_strength_driver_enable = 0;
+	popts->half_strength_driver_enable = 1;
+
+	/* Write leveling override */
+	popts->wrlvl_en = 1;
+	popts->wrlvl_override = 1;
+	popts->wrlvl_sample = 0xa;
+	popts->wrlvl_start = 0x4;
+
+	/* Rtt and Rtt_W override */
+	popts->rtt_override = 1;
+	popts->rtt_override_value = DDR3_RTT_60_OHM;
+	popts->rtt_wr_override_value = 0; /* Rtt_WR= dynamic ODT off */
 }
Signature · 1 line
1.7.0
#3 lore raw

PATCH 1/3 mpc8569mds: fix CONFIG_ENV_SIZE

In reply to Haiying.Wang at freescale.com

Dear Haiying.Wang at freescale.com,

Quoted 9 lines · In message <[email protected]> you…

From: Haiying Wang <[email protected]>

CONFIG_ENV_SIZE of MPC8569MDS was wrongly set to CONFIG_ENV_SECT_SIZE which is 128KB, so it took longer time to do crc32 calculation for ENV than it should do. It causes the bootup for MPC8569MDS significantly slow. This patch fixs it to 0x2000(8KB), also fix the comment for CONFIG_ENV_SECT_SIZE to correct size.

You submitted the same patch series twice, without any version ID in the subject, and without any other indication about possible changes.

Is there any difference between both patch series, and if so, what is it?

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Niklaus Wirth has lamented that, whereas Europeans pronounce his name
correctly (Ni-klows Virt), Americans invariably mangle it into (Nick-
les Worth). Which is to say that Europeans  call  him  by  name,  but
Americans call him by value.
#4 lore raw

PATCH 1/3 mpc8569mds: fix CONFIG_ENV_SIZE

Quoted 2 lines · Wolfgang Denk

You submitted the same patch series twice, without any version ID in the subject, and without any other indication about possible changes.

I am so sorry for sending the patchset twice. I did not add "smtp-server" at the first time, then I thought the patches were lost since the same thing happened in last month. Obviously I was wrong.

Quoted 3 lines

Is there any difference between both patch series, and if so, what is it?

No difference.

Haiying

#5 lore raw

PATCH 1/3 mpc8569mds: fix CONFIG_ENV_SIZE

Dear Haiying Wang,

Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 2 lines · Wolfgang Denk

You submitted the same patch series twice, without any version ID in the subject, and without any other indication about possible changes.

I am so sorry for sending the patchset twice. I did not add "smtp-server" at the first time, then I thought the patches were lost since the same thing happened in last month. Obviously I was wrong.

No problem.

Quoted 4 lines
Quoted 3 lines

Is there any difference between both patch series, and if so, what is it?

No difference.

OK. Thanks for the explanation.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
News is what a chap who doesn't care much  about  anything  wants  to
read. And it's only news until he's read it. After that it's dead.
                           - Evelyn Waugh _Scoop_ (1938) bk. 1, ch. 5
Applied
#6 lore raw

PATCH 1/3 mpc8569mds: fix CONFIG_ENV_SIZE

In reply to Haiying.Wang at freescale.com
Quoted 7 lines · On Sep 29, 2010, at 12:44 PM, <[email protected]>…

From: Haiying Wang <[email protected]>

CONFIG_ENV_SIZE of MPC8569MDS was wrongly set to CONFIG_ENV_SECT_SIZE which is 128KB, so it took longer time to do crc32 calculation for ENV than it should do. It causes the bootup for MPC8569MDS significantly slow. This patch fixs it to 0x2000(8KB), also fix the comment for CONFIG_ENV_SECT_SIZE to correct size.

Quoted 5 lines

---
include/configs/MPC8569MDS.h | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)

applied to 85xx

- k