Skip to contentSkip to conversation

Setup extra MIMC200 chip selects

PATCH New Mark Jackson 2 participants 3 messages Nov 24, 2008 – Feb 6, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Setup extra MIMC200 chip selects

Added code to setup the extra Flash and FRAM chip selects as used on the MIMC200 board.

---
 cpu/at32ap/cpu.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
cpu/at32ap/cpu.c +14 -0
index 1a13702..3902efe 100644
@@ -56,6 +56,20 @@ int cpu_init(void)
 	hsmc3_writel(PULSE0, 0x0b0a0906);
 	hsmc3_writel(SETUP0, 0x00010002);
 
+#ifdef CONFIG_MIMC200
+	/* setup Data Flash chip select (NCS2) */
+	hsmc3_writel(MODE2, 0x20121003);
+	hsmc3_writel(CYCLE2, 0x000a0009);
+	hsmc3_writel(PULSE2, 0x0a060806);
+	hsmc3_writel(SETUP2, 0x00030102);
+
+	/* setup FRAM chip select (NCS3) */
+	hsmc3_writel(MODE3, 0x10120001);
+	hsmc3_writel(CYCLE3, 0x001e001d);
+	hsmc3_writel(PULSE3, 0x08040704);
+	hsmc3_writel(SETUP3, 0x02050204);
+#endif
+ 
 	clk_init();
 
 	/* Update the CPU speed according to the PLL configuration */
#1 lore raw

PATCH 1/1 Setup extra MIMC200 chip selects

Dear Mark Jackson,

Quoted 20 lines · In message <[email protected]> you wrote:

Added code to setup the extra Flash and FRAM chip selects as used on the MIMC200 board.

---
 cpu/at32ap/cpu.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
cpu/at32ap/cpu.c +3 -0
index 1a13702..3902efe 100644
@@ -56,6 +56,20 @@ int cpu_init(void)
 	hsmc3_writel(PULSE0, 0x0b0a0906);
 	hsmc3_writel(SETUP0, 0x00010002);
 
+#ifdef CONFIG_MIMC200
+	/* setup Data Flash chip select (NCS2) */
+	hsmc3_writel(MODE2, 0x20121003);

cpu/at32ap/cpu.c int cpu_init(void) · line 71

Quoted 10 lines
cpu/at32ap/cpu.c +10 -0
+	hsmc3_writel(CYCLE2, 0x000a0009);
+	hsmc3_writel(PULSE2, 0x0a060806);
+	hsmc3_writel(SETUP2, 0x00030102);
+
+	/* setup FRAM chip select (NCS3) */
+	hsmc3_writel(MODE3, 0x10120001);
+	hsmc3_writel(CYCLE3, 0x001e001d);
+	hsmc3_writel(PULSE3, 0x08040704);
+	hsmc3_writel(SETUP3, 0x02050204);
+#endif

I feel it is conceptually wrong to add board specific code to a common CPU specific file.

Haavard, please comment?

Best regards,

Wolfgang Denk

Signature · 5 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
Accident: A condition in which presence of mind is good, but  absence
of body is better.
#2 lore raw

PATCH 1/1 Setup extra MIMC200 chip selects

Quoted 12 lines · Wolfgang Denk

Dear Mark Jackson,

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

Added code to setup the extra Flash and FRAM chip selects as used on the MIMC200 board.

---
 cpu/at32ap/cpu.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

<snip>

Quoted 3 lines

I feel it is conceptually wrong to add board specific code to a common CPU specific file.

I do agree !! Is there something in place (like the gclk setup) to allow me to do this ?

Mark