diff mbox

[U-Boot] ppc, mgcoge: add DIP switch detection

Message ID 1295951175-3635-1-git-send-email-holger.brunck@keymile.com
State Accepted
Commit 91a3c14cd0edb7cf427eb025ae25920c8546767c
Headers show

Commit Message

Holger Brunck Jan. 25, 2011, 10:26 a.m. UTC
From: Andreas Huber <andreas.huber@keymile.com>

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.

Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 board/keymile/mgcoge/mgcoge.c |   18 ++++++++++++++++++
 include/configs/mgcoge.h      |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)

Comments

Wolfgang Denk April 11, 2011, 8:41 p.m. UTC | #1
Dear Holger Brunck,

In message <1295951175-3635-1-git-send-email-holger.brunck@keymile.com> you wrote:
> From: Andreas Huber <andreas.huber@keymile.com>
> 
> 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.
> 
> Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> ---
>  board/keymile/mgcoge/mgcoge.c |   18 ++++++++++++++++++
>  include/configs/mgcoge.h      |    5 +++++
>  2 files changed, 23 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Wolfgang Denk May 4, 2011, 8:01 p.m. UTC | #2
Dear Holger Brunck,

In message <1295951175-3635-1-git-send-email-holger.brunck@keymile.com> you wrote:
> From: Andreas Huber <andreas.huber@keymile.com>
> 
> 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.
> 
> Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> ---
>  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
Holger Brunck May 5, 2011, 7:12 a.m. UTC | #3
Hi,

On 05/04/2011 10:01 PM, Wolfgang Denk wrote:
> Dear Holger Brunck,
> 
> In message <1295951175-3635-1-git-send-email-holger.brunck@keymile.com> you wrote:
>> From: Andreas Huber <andreas.huber@keymile.com>
>>
>> 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.
>>
>> Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> ---
>>  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.)
> 

Argh sorry.

> 
> 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
Wolfgang Denk May 5, 2011, 7:29 a.m. UTC | #4
Dear Holger Brunck,

In message <4DC24DEA.7010201@keymile.com> you wrote:
> 
> > This patch breaks compiling of the  mgcoge2ne  board:
...
> 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
Holger Brunck May 5, 2011, 7:37 a.m. UTC | #5
Hi,

On 05/05/2011 09:29 AM, Wolfgang Denk wrote:
> Dear Holger Brunck,
> 
> In message <4DC24DEA.7010201@keymile.com> you wrote:
>>
>>> This patch breaks compiling of the  mgcoge2ne  board:
> ...
>> 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
Wolfgang Denk May 5, 2011, 6:16 p.m. UTC | #6
Dear Holger Brunck,

In message <4DC253A5.6010109@keymile.com> you wrote:
> 
> > 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
Holger Brunck May 6, 2011, 8:10 a.m. UTC | #7
On 05/05/2011 08:16 PM, Wolfgang Denk wrote:
> Dear Holger Brunck,
> 
> In message <4DC253A5.6010109@keymile.com> you wrote:
>>
>>> 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.
> 

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
Wolfgang Denk May 6, 2011, 10:17 a.m. UTC | #8
Dear Holger Brunck,

In message <4DC3AD11.5080509@keymile.com> 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.

> 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
Holger Brunck May 6, 2011, 11:26 a.m. UTC | #9
On 05/06/2011 12:17 PM, Wolfgang Denk wrote:
>> 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
diff mbox

Patch

diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 5c9496c..5dcdf37 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -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.
  */
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 6dec0ee..f1bd32a 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -348,4 +348,9 @@ 
 #define OF_TBCLK		(bd->bi_busfreq / 4)
 #define OF_STDOUT_PATH		"/soc/cpm/serial@11a90"
 
+/* enable last_stage_init */
+#define CONFIG_LAST_STAGE_INIT          1
+/* bfticu address */
+#define CONFIG_SYS_BFTICU_BASE          0x40000000
+
 #endif /* __CONFIG_H */