Skip to contentSkip to conversation

ppc, mgcoge: add DIP switch detection

PATCH New Holger Brunck 2 participants 10 messages Jan 25, 2011 – May 6, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

From: Andreas Huber <[email protected]>

This reads the DIP switch on mgcoge. The DIP switch is connected to the BFTICU (0x40000089) FPGA. If the DIP switch is set the environment variable 'actual_bank' is set to 0 and starts the SW in bank0.

---
 board/keymile/mgcoge/mgcoge.c |   18 ++++++++++++++++++
 include/configs/mgcoge.h      |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)
board/keymile/mgcoge/mgcoge.c +18 -0
index 5c9496c..5dcdf37 100644
@@ -293,6 +293,24 @@ int checkboard(void)
 	return 0;
 }
 
+#define DIPSWITCH_OFFSET 0x89
+#define DIPSWITCH_MASK   0x0f
+
+int last_stage_init(void)
+{
+	u8 dip_switch;
+	/* Dip switch */
+	dip_switch = readb(CONFIG_SYS_BFTICU_BASE + DIPSWITCH_OFFSET);
+	dip_switch &= DIPSWITCH_MASK;
+	/* dip switch 'full reset' or 'db erase' */
+	if (dip_switch & 0x1 || dip_switch & 0x2) {
+		/* start bootloader */
+		puts("DIP:   Enabled\n");
+		setenv("actual_bank", "0");
+	}
+	return 0;
+}
+
 /*
  * Early board initalization.
  */
include/configs/mgcoge.h +5 -0
index 6dec0ee..f1bd32a 100644
@@ -348,4 +348,9 @@
 #define OF_TBCLK		(bd->bi_busfreq / 4)
 #define OF_STDOUT_PATH		"/soc/cpm/serial at 11a90"
 
+/* enable last_stage_init */
+#define CONFIG_LAST_STAGE_INIT          1
+/* bfticu address */
+#define CONFIG_SYS_BFTICU_BASE          0x40000000
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.0.5
#1 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Dear Holger Brunck,

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

From: Andreas Huber <[email protected]>

This reads the DIP switch on mgcoge. The DIP switch is connected to the BFTICU (0x40000089) FPGA. If the DIP switch is set the environment variable 'actual_bank' is set to 0 and starts the SW in bank0.

Quoted 6 lines
---
 board/keymile/mgcoge/mgcoge.c |   18 ++++++++++++++++++
 include/configs/mgcoge.h      |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)

Applied, thanks.

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
When you say "I wrote a program that crashed  Windows",  people  just
stare  at you blankly and say "Hey, I got those with the system, *for
free*".        - Linus Torvalds in <[email protected]>
#2 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

In reply to Holger Brunck

Dear Holger Brunck,

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

From: Andreas Huber <[email protected]>

This reads the DIP switch on mgcoge. The DIP switch is connected to the BFTICU (0x40000089) FPGA. If the DIP switch is set the environment variable 'actual_bank' is set to 0 and starts the SW in bank0.

Quoted 6 lines
---
 board/keymile/mgcoge/mgcoge.c |   18 ++++++++++++++++++
 include/configs/mgcoge.h      |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)

This patch breaks compiling of the mgcoge2ne board:

Configuring for mgcoge2ne board...
mgcoge.c: In function 'last_stage_init':
mgcoge.c:305: error: 'CONFIG_SYS_BFTICU_BASE' undeclared (first use in this function) mgcoge.c:305: error: (Each undeclared identifier is reported only once mgcoge.c:305: error: for each function it appears in.)

Please fix.

Best regards,

Wolfgang Denk

Signature · 9 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
ADVISORY:  There is  an  Extremely Small  but  Nonzero  Chance  That,
Through a Process Know as "Tunneling," This Product May Spontaneously
Disappear  from Its Present Location and Reappear at Any Random Place
in the Universe, Including Your Neighbor's Domicile. The Manufacturer
Will Not Be Responsible for Any Damages  or  Inconvenience  That  May
Result.
#3 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Hi,

Quoted 16 lines · Wolfgang Denk

Dear Holger Brunck,

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

From: Andreas Huber <[email protected]>

This reads the DIP switch on mgcoge. The DIP switch is connected to the BFTICU (0x40000089) FPGA. If the DIP switch is set the environment variable 'actual_bank' is set to 0 and starts the SW in bank0.

Quoted 6 lines
---
 board/keymile/mgcoge/mgcoge.c |   18 ++++++++++++++++++
 include/configs/mgcoge.h      |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)
Quoted 8 lines

This patch breaks compiling of the mgcoge2ne board:

Configuring for mgcoge2ne board...
mgcoge.c: In function 'last_stage_init':
mgcoge.c:305: error: 'CONFIG_SYS_BFTICU_BASE' undeclared (first use in this function) mgcoge.c:305: error: (Each undeclared identifier is reported only once mgcoge.c:305: error: for each function it appears in.)

Argh sorry.

Quoted 3 lines

Please fix.

In the already posted patch serie
http://lists.denx.de/pipermail/u-boot/2011-May/091976.html
the problem is fixed, should I repost the patch
powerpc/km82xx: rework DIP switch detection
as a standalone patch and rebase the serie or can you take the whole serie?

Best regards
Holger Brunck

#4 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Dear Holger Brunck,

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

This patch breaks compiling of the mgcoge2ne board:

...

Quoted 5 lines

In the already posted patch serie
http://lists.denx.de/pipermail/u-boot/2011-May/091976.html
the problem is fixed, should I repost the patch
powerpc/km82xx: rework DIP switch detection
as a standalone patch and rebase the serie or can you take the whole serie?

As the merge window is closed, this new patch series will not go into this upcoming release any more.

Can you please extract a patch that just fixes the build problem for now? Thanks.

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
There's no sense in being precise  when  you  don't  even  know  what
you're talking about.                             -- John von Neumann
#5 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Hi,

Quoted 6 lines · Wolfgang Denk

Dear Holger Brunck,

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

This patch breaks compiling of the mgcoge2ne board:

...

Quoted 9 lines
Quoted 5 lines

In the already posted patch serie
http://lists.denx.de/pipermail/u-boot/2011-May/091976.html
the problem is fixed, should I repost the patch
powerpc/km82xx: rework DIP switch detection
as a standalone patch and rebase the serie or can you take the whole serie?

As the merge window is closed, this new patch series will not go into this upcoming release any more.

Sorry but why this? The initial patch serie was postet on april 8th:
http://lists.denx.de/pipermail/u-boot/2011-April/090012.html
And as far as I know the merge window was closed on april 10th.

The resulting patch series are a rework due to the input of the ML.

Best regards
Holger Brunck

#6 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Dear Holger Brunck,

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

As the merge window is closed, this new patch series will not go into this upcoming release any more.

Sorry but why this? The initial patch serie was postet on april 8th:
http://lists.denx.de/pipermail/u-boot/2011-April/090012.html
And as far as I know the merge window was closed on april 10th.

The resulting patch series are a rework due to the input of the ML.

The reworked series goes in, but there appear to be a number of completely new patches; these go into next.

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
Shakespeare's Law of Prototyping: (Hamlet III, iv, 156-160)
        O, throw away the worser part of it,
        And live the purer with the other half.
#7 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Quoted 7 lines · Wolfgang Denk

Dear Holger Brunck,

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

As the merge window is closed, this new patch series will not go into this upcoming release any more.

Quoted 9 lines
Quoted 5 lines

Sorry but why this? The initial patch serie was postet on april 8th:
http://lists.denx.de/pipermail/u-boot/2011-April/090012.html
And as far as I know the merge window was closed on april 10th.

The resulting patch series are a rework due to the input of the ML.

The reworked series goes in, but there appear to be a number of completely new patches; these go into next.

yes if there is something completely new it goes into next. But both reworked series posted from myside have no new patches and no new features inside the patches. Ok two patches are squashed to one, as a result of an input from your side and I thought this was ok. If you still see something let me know and I remove it from the serie.

So back to my original question should I post a bugfix patch for the compile issue for mgcoge2ne and rebase the serie "[PATCH v2 0/7] km82xx mainlining" above this patch or is it ok if it get fixed with this serie?

Best regards
Holger Brunck

#8 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Dear Holger Brunck,

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

yes if there is something completely new it goes into next. But both reworked series posted from myside have no new patches and no new features inside the patches. Ok two patches are squashed to one, as a result of an input from your side and I thought this was ok. If you still see something let me know and I remove it from the serie.

OK.

Quoted 3 lines

So back to my original question should I post a bugfix patch for the compile issue for mgcoge2ne and rebase the serie "[PATCH v2 0/7] km82xx mainlining" above this patch or is it ok if it get fixed with this serie?

If it's not too much of effort, I'd appreciate a separate bug fix, which I can pull without longer review. Thanks!

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
Heavier than air flying machines are impossible.
                    -- Lord Kelvin, President, Royal Society, c. 1895
#9 lore raw

PATCH 1/1 ppc, mgcoge: add DIP switch detection

Quoted 7 lines · Wolfgang Denk
Quoted 3 lines

So back to my original question should I post a bugfix patch for the compile issue for mgcoge2ne and rebase the serie "[PATCH v2 0/7] km82xx mainlining" above this patch or is it ok if it get fixed with this serie?

If it's not too much of effort, I'd appreciate a separate bug fix, which I can pull without longer review. Thanks!

Ok done. If the patch was ok and pulled, I send an rebased serie for [PATCH 0/7] km82xx mainlining

Best regards
Holger Brunck