Re: [U-Boot-Users] [PATCH] Allow console input to be disabled

2008-08-10 Thread Mark Jackson
Wolfgang Denk wrote:
 Dear Jerry Van Baren,
 
 In message [EMAIL PROTECTED] you wrote:
 For what it is worth, I'm with Haavard - it seems useful.  WRT the 
 dangerous part - it's intended use is for debug, so presumably it will 
 
 It may be intended for debug, but it's available there without warning
 for the end user.

Is there some warning mechanism I should use ?

 be the developer that locks himself out of the console and will have the 
 tools to break back in.  From that POV, it isn't any more dangerous than 
 all the other ways a user/developer can brick a board (starting with 
 erasing flash ;-).
 
 I think this one is a bit nastier. It's like this rope hanging out of
 a black box labeled silencer. The label  doesn't  mention  that  it
 goes KABM! first, before there is a big silence (and a cloud of
 dust and a pile of debris).

I agree that it could all go very wrong, but it was a quick and easy way for me 
to implement that particular feature.

Does anyone have any suggestions on how to achieve the same outcome in a less 
hoist by your own petard way ?

Mark

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH v2] Fix bitmap display for atmel lcd controller

2008-08-01 Thread Mark Jackson
The current lcd_display_bitmap() function does not work properly
for the Atmel LCD controller.

2 fixes need to be done:-

(a) when setting the colour map, use the lcd_setcolreg() function
as provided by the Atmel driver
(b) the data is never actually written to the lcd framebuffer !!

Below is a patch to fix these issues.

Signed-off-by: Mark Jackson [EMAIL PROTECTED]
---

diff --git a/common/lcd.c b/common/lcd.c
index eec1f53..e03cff3 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -678,6 +678,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
/* Set color map */
for (i=0; icolors; ++i) {
bmp_color_table_entry_t cte = bmp-color_table[i];
+#if !defined(CONFIG_ATMEL_LCD)
ushort colreg =
( ((cte.red)8)  0xf800) |
( ((cte.green)  3)  0x07e0) |
@@ -692,6 +693,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #elif defined(CONFIG_MPC823)
cmap--;
 #endif
+#else /* CONFIG_ATMEL_LCD */
+   lcd_setcolreg(i, cte.red, cte.green, cte.blue);
+#endif
}
}
 #endif
@@ -727,7 +731,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
for (i = 0; i  height; ++i) {
WATCHDOG_RESET();
for (j = 0; j  width ; j++)
-#if defined(CONFIG_PXA250)
+#if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD)
*(fb++) = *(bmap++);
 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
*(fb++)=255-*(bmap++);

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Fix Atmel lcd controller endian for AVR32 processors

2008-07-31 Thread Mark Jackson
The Atmel lcd controller is used on Atmel's AT91 (little endian) and AVR32 (big 
endian) platforms.

As such, the controller can handle both big and little endian memory.

This patch fixes the driver for the AVR32 platform.

Signed-off-by: Mark Jackson [EMAIL PROTECTED]
---

 drivers/video/atmel_lcdfb.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 27df449..b332a82 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -100,7 +100,11 @@ void lcd_ctrl_init(void *lcdbase)
value  ATMEL_LCDC_CLKVAL_OFFSET);
 
/* Initialize control register 2 */
+#ifdef CONFIG_AVR32
+   value = ATMEL_LCDC_MEMOR_BIG | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
+#else
value = ATMEL_LCDC_MEMOR_LITTLE | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
+#endif
if (panel_info.vl_tft)
value |= ATMEL_LCDC_DISTYPE_TFT;
 

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Add gzipped logo support

2008-07-31 Thread Mark Jackson
The README file states that CONFIG_VIDEO_BMP_GZIP behaves as follows:-

  If this option is set, additionally to standard BMP
  images, gzipped BMP images can be displayed via the
  splashscreen support or the bmp command.

However, the splashscreen function *only* supports standard BMP images.

This patch adds the documented gzip support.

Signed-off-by: Mark Jackson [EMAIL PROTECTED]
---

 common/lcd.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index eec1f53..3bbc7ba 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -740,6 +740,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
+#ifdef CONFIG_VIDEO_BMP_GZIP
+extern bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp);
+#endif
 
 static void *lcd_logo (void)
 {
@@ -761,6 +764,16 @@ static void *lcd_logo (void)
addr = simple_strtoul(s, NULL, 16);
do_splash = 0;
 
+#ifdef CONFIG_VIDEO_BMP_GZIP
+   bmp_image_t *bmp = (bmp_image_t *)addr;
+   unsigned long len;
+
+   if (!((bmp-header.signature[0]=='B') 
+ (bmp-header.signature[1]=='M'))) {
+   addr = (ulong)gunzip_bmp(addr, len);
+   }
+#endif
+
if (lcd_display_bitmap (addr, 0, 0) == 0) {
return ((void *)lcd_base);
}

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add MIMC200 board - now uses board_eth_init()

2008-07-30 Thread Mark Jackson
Scott Wood wrote:
 On Tue, Jul 29, 2008 at 09:52:12AM +0100, Mark Jackson wrote:
 I didn't want to use u-boot's slient boot options, since they're 
 hard-coded at compile time.  The only place I could think to this was to 
 modify the atmel_usart.c file as above.
 
 It's not hard-coded at compile-time -- set GD_FLG_SILENT in gd-flags
 from early board code depending on the state of the GPIO pin.  For
 example, 8313erdb does this depending on whether it's booting or resuming
 from suspend.

Yes ... I can see that can be used to disable any console outputs.

*But* I'm also needing to disable any console *inputs* in a similar way.

Any ideas on how to do that ?

I'm guessing I need any extra silent check in console.c tstc() ?

Is it acceptable to modify console.c if I use a nicely generic #ifdef ?

e.g.

int tstc (void)
{
+#if defined(CONFIG_SILENT_CONSOLE)  defined(CONFIG_SILENT_CONSOLE_INPUT)
+   if (gd-flags  GD_FLG_SILENT)
+   return 0;
+#endif
+
if (gd-flags  GD_FLG_DEVINIT) {
/* Test the standard input */
return ftstc (stdin);
}

/* Send directly to the handler */
return serial_tstc ();
}

Mark

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH v3] Add MIMC200 board

2008-07-30 Thread Mark Jackson
The MIMC200 board is based on Atmel's NGW100 dev kit, but with an extra 8MByte 
FLASH and 128KByte FRAM.
---

 CREDITS   |4 +
 MAINTAINERS   |4 +
 MAKEALL   |1 +
 Makefile  |3 +
 board/mimc/mimc200/Makefile   |   40 
 board/mimc/mimc200/config.mk  |3 +
 board/mimc/mimc200/mimc200.c  |  209 +
 board/mimc/mimc200/u-boot.lds |   73 ++
 common/console.c  |5 +
 include/configs/mimc200.h |  177 ++
 10 files changed, 519 insertions(+), 0 deletions(-)

diff --git a/CREDITS b/CREDITS
index 2b0dab7..5010c78 100644
--- a/CREDITS
+++ b/CREDITS
@@ -217,6 +217,10 @@ H: Rich Ireland
 E: [EMAIL PROTECTED]
 D: FPGA device configuration driver
 
+H: Mark Jackson
+E: [EMAIL PROTECTED]
+D: Port to MIMC200 board
+
 N: Gary Jennejohn
 E: [EMAIL PROTECTED], [EMAIL PROTECTED]
 D: Support for Samsung ARM920T S3C2400X, ARM920T TRAB
diff --git a/MAINTAINERS b/MAINTAINERS
index cbe5c47..d4f6639 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -709,6 +709,10 @@ Haavard Skinnemoen [EMAIL PROTECTED]
ATSTK1006   AT32AP7000
ATNGW100AT32AP7000
 
+Mark Jackson [EMAIL PROTECTED]
+
+   MIMC200 AT32AP7000
+
 #
 # SuperH Systems:  #
 #  #
diff --git a/MAKEALL b/MAKEALL
index c1a9c60..cfd376c 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -715,6 +715,7 @@ LIST_avr32=\
atstk1004   \
atstk1006   \
atngw100\
+   mimc200 \
 
 
 #
diff --git a/Makefile b/Makefile
index 369bbd7..d434ea3 100644
--- a/Makefile
+++ b/Makefile
@@ -2914,6 +2914,9 @@ atstk1004_config  :   unconfig
 atstk1006_config   :   unconfig
@$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x
 
+mimc200_config :   unconfig
+   @$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 mimc at32ap700x
+
 #
 # SH3 (SuperH)
 #
diff --git a/board/mimc/mimc200/Makefile b/board/mimc/mimc200/Makefile
new file mode 100644
index 000..9f3849f
--- /dev/null
+++ b/board/mimc/mimc200/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2005-2006 Atmel Corporation
+#
+# See file CREDITS for list of people who contributed to this project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+
+include $(TOPDIR)/config.mk
+
+LIB:= $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/mimc/mimc200/config.mk b/board/mimc/mimc200/config.mk
new file mode 100644
index 000..9a794e5
--- /dev/null
+++ b/board/mimc/mimc200/config.mk
@@ -0,0 +1,3 @@
+TEXT_BASE  = 0x
+PLATFORM_RELFLAGS  += -ffunction-sections -fdata-sections
+PLATFORM_LDFLAGS   += --gc-sections
diff --git a/board/mimc/mimc200/mimc200.c b/board/mimc/mimc200/mimc200.c
new file mode 100644
index 000..089fc6c
--- /dev/null
+++ b/board/mimc/mimc200/mimc200.c
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2006 Atmel Corporation
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY

[U-Boot-Users] [PATCH v4] Add MIMC200 board

2008-07-30 Thread Mark Jackson
The MIMC200 board is based on Atmel's NGW100 dev kit, but with an extra 8MByte 
FLASH and 128KByte FRAM.
---
 CREDITS   |4 +
 MAINTAINERS   |4 +
 MAKEALL   |1 +
 Makefile  |3 +
 board/mimc/mimc200/Makefile   |   40 
 board/mimc/mimc200/config.mk  |3 +
 board/mimc/mimc200/mimc200.c  |  209 +
 board/mimc/mimc200/u-boot.lds |   73 ++
 include/configs/mimc200.h |  177 ++
 10 files changed, 519 insertions(+), 0 deletions(-)

diff --git a/CREDITS b/CREDITS
index 2b0dab7..5010c78 100644
--- a/CREDITS
+++ b/CREDITS
@@ -217,6 +217,10 @@ H: Rich Ireland
 E: [EMAIL PROTECTED]
 D: FPGA device configuration driver
 
+H: Mark Jackson
+E: [EMAIL PROTECTED]
+D: Port to MIMC200 board
+
 N: Gary Jennejohn
 E: [EMAIL PROTECTED], [EMAIL PROTECTED]
 D: Support for Samsung ARM920T S3C2400X, ARM920T TRAB
diff --git a/MAINTAINERS b/MAINTAINERS
index cbe5c47..d4f6639 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -709,6 +709,10 @@ Haavard Skinnemoen [EMAIL PROTECTED]
ATSTK1006   AT32AP7000
ATNGW100AT32AP7000
 
+Mark Jackson [EMAIL PROTECTED]
+
+   MIMC200 AT32AP7000
+
 #
 # SuperH Systems:  #
 #  #
diff --git a/MAKEALL b/MAKEALL
index c1a9c60..cfd376c 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -715,6 +715,7 @@ LIST_avr32=\
atstk1004   \
atstk1006   \
atngw100\
+   mimc200 \
 
 
 #
diff --git a/Makefile b/Makefile
index 369bbd7..d434ea3 100644
--- a/Makefile
+++ b/Makefile
@@ -2914,6 +2914,9 @@ atstk1004_config  :   unconfig
 atstk1006_config   :   unconfig
@$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x
 
+mimc200_config :   unconfig
+   @$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 mimc at32ap700x
+
 #
 # SH3 (SuperH)
 #
diff --git a/board/mimc/mimc200/Makefile b/board/mimc/mimc200/Makefile
new file mode 100644
index 000..9f3849f
--- /dev/null
+++ b/board/mimc/mimc200/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2005-2006 Atmel Corporation
+#
+# See file CREDITS for list of people who contributed to this project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+
+include $(TOPDIR)/config.mk
+
+LIB:= $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/mimc/mimc200/config.mk b/board/mimc/mimc200/config.mk
new file mode 100644
index 000..9a794e5
--- /dev/null
+++ b/board/mimc/mimc200/config.mk
@@ -0,0 +1,3 @@
+TEXT_BASE  = 0x
+PLATFORM_RELFLAGS  += -ffunction-sections -fdata-sections
+PLATFORM_LDFLAGS   += --gc-sections
diff --git a/board/mimc/mimc200/mimc200.c b/board/mimc/mimc200/mimc200.c
new file mode 100644
index 000..089fc6c
--- /dev/null
+++ b/board/mimc/mimc200/mimc200.c
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2006 Atmel Corporation
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See

[U-Boot-Users] [PATCH] Allow console input to be disabled

2008-07-30 Thread Mark Jackson
Added CONFIG_SILENT_CONSOLE_INPUT define.

When used (in conjunction with CONFIG_SILENT_CONSOLE) it disables all console 
input.

---

 common/console.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/common/console.c b/common/console.c
index 1b095b1..ab071e2 100644
--- a/common/console.c
+++ b/common/console.c
@@ -162,6 +162,11 @@ void fprintf (int file, const char *fmt, ...)
 
 int getc (void)
 {
+#if defined(CONFIG_SILENT_CONSOLE)  defined(CONFIG_SILENT_CONSOLE_INPUT)
+   if (gd-flags  GD_FLG_SILENT)
+   return 0;
+#endif
+
if (gd-flags  GD_FLG_DEVINIT) {
/* Get from the standard input */
return fgetc (stdin);
@@ -173,6 +178,11 @@ int getc (void)
 
 int tstc (void)
 {
+#if defined(CONFIG_SILENT_CONSOLE)  defined(CONFIG_SILENT_CONSOLE_INPUT)
+   if (gd-flags  GD_FLG_SILENT)
+   return 0;
+#endif
+
if (gd-flags  GD_FLG_DEVINIT) {
/* Test the standard input */
return ftstc (stdin);

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Fix bitmap display for atmel lcd controller

2008-07-30 Thread Mark Jackson
The current lcd_display_bitmap() function does not work properly for the Atmel 
LCD controller.

2 fixes need to be done:-

(a) when setting the colour map, use the lcd_setcolreg() function as provided 
by the Atmel driver
(b) the actual data is never actually written to the lcd framebuffer !!

Below is a patch to fix these issues.

---

diff --git a/common/lcd.c b/common/lcd.c
index eec1f53..e03cff3 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -678,6 +678,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
/* Set color map */
for (i=0; icolors; ++i) {
bmp_color_table_entry_t cte = bmp-color_table[i];
+#if !defined(CONFIG_ATMEL_LCD)
ushort colreg =
( ((cte.red)8)  0xf800) |
( ((cte.green)  3)  0x07e0) |
@@ -692,6 +693,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 #elif defined(CONFIG_MPC823)
cmap--;
 #endif
+#else /* CONFIG_ATMEL_LCD */
+   lcd_setcolreg(i, cte.red, cte.green, cte.blue);
+#endif
}
}
 #endif
@@ -727,7 +731,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
for (i = 0; i  height; ++i) {
WATCHDOG_RESET();
for (j = 0; j  width ; j++)
-#if defined(CONFIG_PXA250)
+#if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD)
*(fb++) = *(bmap++);
 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
*(fb++)=255-*(bmap++);

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add MIMC200 board - now uses board_eth_init()

2008-07-29 Thread Mark Jackson
Ben Warren wrote:
 C++ style comments are not allowed.  Please fix them all.

 snip
   
Okay.

 The prototype is:

 int board_eth_init(bd_t *);

 You'll need to return 0 if you can't get anything useful from
 macb_eth_initialize();

 snip
   
Okay.

 It's frowned upon to conditionally compile board-specific code in CPU
 files.  Can this be done in your board code?
   
I'll give it a go !!
   
 diff --git a/cpu/at32ap/at32ap700x/gpio.c b/cpu/at32ap/at32ap700x/gpio.c
 index 56ba2f9..7c6679d 100644
 --- a/cpu/at32ap/at32ap700x/gpio.c
 +++ b/cpu/at32ap/at32ap700x/gpio.c
 @@ -104,8 +104,10 @@ void gpio_enable_macb0(void)
gpio_select_periph_A(GPIO_PIN_PC11, 0);/* RXD2*/
gpio_select_periph_A(GPIO_PIN_PC12, 0);/* RXD3*/
gpio_select_periph_A(GPIO_PIN_PC14, 0);/* RXCK*/
 +#ifndef CONFIG_MIMC200
gpio_select_periph_A(GPIO_PIN_PC18, 0);/* SPD*/
 #endif
 +#endif
 }

 void gpio_enable_macb1(void)
 @@ -129,8 +131,10 @@ void gpio_enable_macb1(void)
gpio_select_periph_B(GPIO_PIN_PC29, 0);/* RXD2*/
gpio_select_periph_B(GPIO_PIN_PC30, 0);/* RXD3*/
gpio_select_periph_B(GPIO_PIN_PC24, 0);/* RXCK*/
 +#ifndef CONFIG_MIMC200
gpio_select_periph_B(GPIO_PIN_PD15, 0);/* SPD*/
 #endif
 +#endif
 }
 #endif
 
Should I just provide my own *complete* alternatives to these functions ?
 diff --git a/cpu/at32ap/cpu.c b/cpu/at32ap/cpu.c
 index 0ba8361..8985b68 100644
 --- a/cpu/at32ap/cpu.c
 +++ b/cpu/at32ap/cpu.c
 @@ -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();
 
Okay ... this can probably go in my board setup file.
/* Update the CPU speed according to the PLL configuration */
 diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
 index f35b997..9e131c0 100644
 --- a/drivers/serial/atmel_usart.c
 +++ b/drivers/serial/atmel_usart.c
 @@ -21,6 +21,9 @@
 #include asm/io.h
 #include asm/arch/clk.h
 #include asm/arch/memory-map.h
 +#if defined(CONFIG_MIMC200_DBGLINK)
 +#include asm/arch/gpio.h
 +#endif

 
 This is definitely uncool.  Don't pollute common code with your debug stuff.
   
Right ... this one's got me stumped.  This *isn't* debug code.

In standard operation, the standard u-boot comms port will drive (e.g.) 
a printer, and we don't want any u-boot messages being printed out every 
time the unit reboots.

*But* we do want to be able to use this port for normal u-boot operation 
when units are returned for calibration / testing / repair / etc,

So we have an external link that is meant to disconnect all comms 
traffic from u-boot.

I didn't want to use u-boot's slient boot options, since they're 
hard-coded at compile time.  The only place I could think to this was to 
modify the atmel_usart.c file as above.

How else should I do it ?
 Looking forward to V3
   
Me too !!

Mark

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add MIMC200 board - now uses board_eth_init()

2008-07-29 Thread Mark Jackson
Haavard Skinnemoen wrote:
 Mark Jackson [EMAIL PROTECTED] wrote:
 The MIMC200 board is based on Atmel's NGW100 dev kit,
 but with an extra 8MByte FLASH and 128KByte FRAM.
 
 Do you have a link with some more information about the board?

Not at this moment ... it's still under development, so to speak.

 I also think your mailer mangles whitespace. Thunderbird can apparently
 be fixed; please see the instructions here:
 
 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/email-clients.txt

I'll fix this.

 board/atmel/mimc200/Makefile   |   40 +
 board/atmel/mimc200/config.mk  |3 +
 board/atmel/mimc200/mimc200.c  |  158 
 board/atmel/mimc200/u-boot.lds |   73 +
 
 Is this really an Atmel board? Note that the directory under board is
 supposed to indicate the _board_ vendor, not the chip vendor.

Urm ... no, I'll create a new vendor directory.

 --- a/cpu/at32ap/at32ap700x/clk.c
 +++ b/cpu/at32ap/at32ap700x/clk.c
 @@ -65,4 +65,12 @@ void clk_init(void)
 /* Use PLL0 as main clock */
 sm_writel(PM_MCCTRL, SM_BIT(PLLSEL));
 #endif
 +
 +#ifdef CONFIG_MIMC200
 +// enable gclk outputs
 +//AVR32_PM.gcctrl[0] = 0x0004; /* LVDS at 10MHz */
 +sm_writel(PM_GCCTRL, 0x0004);
 +//AVR32_PM.gcctrl[1] = 0x0216; /* Ethernet at 25MHz if PLL running */
 +//sm_writel(PM_GCCTRL + 4, 0x0216);
 +#endif
 
 Please define a gclk_init() function in your board file and move this
 stuff there. That's what Hammerhead ended up doing.
 
 The gclk_init() hook isn't in mainline yet. I'll create a next branch
 that you can base your work on in the mean time.

I've just moved it to my main board setup code.

 +#ifndef CONFIG_MIMC200
 gpio_select_periph_A(GPIO_PIN_PC18, 0);/* SPD*/
 #endif
 +#endif
 }

 void gpio_enable_macb1(void)
 @@ -129,8 +131,10 @@ void gpio_enable_macb1(void)
 gpio_select_periph_B(GPIO_PIN_PC29, 0);/* RXD2*/
 gpio_select_periph_B(GPIO_PIN_PC30, 0);/* RXD3*/
 gpio_select_periph_B(GPIO_PIN_PC24, 0);/* RXCK*/
 +#ifndef CONFIG_MIMC200
 gpio_select_periph_B(GPIO_PIN_PD15, 0);/* SPD*/
 #endif
 +#endif
 
 I'd prefer a more generic define here...or possibly some sort of
 parameter that can be passed from the board code. Let's leave that for
 later though -- this is fine for now.

Again, I've moved this to my board setup code.

 +#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
 
 Hmm, ok, I guess you currently don't have much choice but put to those
 here. Let's make a mental note that this should be improved later.

I've actually removed this, since the extra chips contain no boot-related info 
/ code.

 void serial_putc(char c)
 {
 +#if defined(CONFIG_MIMC200_DBGLINK)
 +// only output serial data if DEBUG link connected
 +// this is connected to PIOE_21
 +if (gpio_get_value(GPIO_PIN_PE21) == 0)
 +{
 +#endif
 
 As others have noted, this is pretty ugly. There must be a better way
 to do this...but I don't know exactly how. Moving this test to a
 separate function and providing a dummy stub for the case when
 CONFIG_MIMC200_DBGLINK is not set might be a good first step. Something like
 

snip

 
 Alternatively, we could do some tricks involving weak functions here
 and move the actual test into the board code.

Is there any way I can tell u-boot (on-the-fly) to enable / disable any comms 
output ?

If so, I could just check the debug link in my boot code, and adjust the 
u-boot comms accordingly.

 Thanks for posting this, but please Cc me when posting new avr32 board
 patches. I think I missed you first submission.

No problems.  Thanks for the comments.

Mark

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] On-the-fly suppressing stdin, stdout and stderr

2008-07-29 Thread Mark Jackson
I'd like to know if it's possible to suppress comms to / from stdio, stdout and 
stderr.

I know there's support to suppress the console output (stdout and stderr) using 
CONFIG_SILENT_CONSOLE and the silent env variable, but this isn't 
particularly dynamic.

Our target board has a bitlink which I'd like to read at boot time.  If the 
link is not connected, all comms to / from the u-boot console should be 
suppress (including any key presses).

In normal running mode, we are wanting to use the comms port for (say) a 
printer or connected to a host system.  As such, when the unit boots we're not 
wanting it to output the u-boot console text to the printer.

But in debug / test / repair / maintenance / upgrade mode, we'd remove any 
printer / etc, we'd fit the link, which would then give us the normal u-boot 
startup and prompt.

From what I can see in the code, there's no real way to do this on-the-fly 
suppressing.

Any ideas ?

Thanks
Mark

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Add MIMC200 board

2008-07-28 Thread Mark Jackson
The MIMC200 board is based on Atmel's NGW100 dev kit,
but with an extra 8MByte FLASH and 128KByte FRAM.
---
 CREDITS|4 ++
 MAINTAINERS|4 ++
 MAKEALL|1 +
 Makefile   |3 +
 board/atmel/mimc200/Makefile   |   40 +
 board/atmel/mimc200/config.mk  |3 +
 board/atmel/mimc200/eth.c  |   36 
 board/atmel/mimc200/mimc200.c  |  147 
 board/atmel/mimc200/u-boot.lds |   73 
 cpu/at32ap/at32ap700x/clk.c|8 
 cpu/at32ap/at32ap700x/gpio.c   |4 ++
 cpu/at32ap/cpu.c   |   14 +++
 drivers/serial/atmel_usart.c   |   43 +
 include/configs/mimc200.h  |  179 

 net/eth.c  |4 ++
 15 files changed, 563 insertions(+), 0 deletions(-)

diff --git a/CREDITS b/CREDITS
index 2b0dab7..5010c78 100644
--- a/CREDITS
+++ b/CREDITS
@@ -217,6 +217,10 @@ H: Rich Ireland
 E: [EMAIL PROTECTED]
 D: FPGA device configuration driver
 
+H: Mark Jackson
+E: [EMAIL PROTECTED]
+D: Port to MIMC200 board
+
 N: Gary Jennejohn
 E: [EMAIL PROTECTED], [EMAIL PROTECTED]
 D: Support for Samsung ARM920T S3C2400X, ARM920T TRAB
diff --git a/MAINTAINERS b/MAINTAINERS
index cbe5c47..d4f6639 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -709,6 +709,10 @@ Haavard Skinnemoen [EMAIL PROTECTED]
 ATSTK1006AT32AP7000
 ATNGW100AT32AP7000
 
+Mark Jackson [EMAIL PROTECTED]
+
+MIMC200AT32AP7000
+
 #
 # SuperH Systems:#
 ##
diff --git a/MAKEALL b/MAKEALL
index c1a9c60..cfd376c 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -715,6 +715,7 @@ LIST_avr32=\
 atstk1004\
 atstk1006\
 atngw100\
+mimc200\
 
 
 #
diff --git a/Makefile b/Makefile
index 369bbd7..d85867c 100644
--- a/Makefile
+++ b/Makefile
@@ -2914,6 +2914,9 @@ atstk1004_config:unconfig
 atstk1006_config:unconfig
 @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x
 
+mimc200_config:unconfig
+@$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 atmel at32ap700x
+
 #
 # SH3 (SuperH)
 #
diff --git a/board/atmel/mimc200/config.mk b/board/atmel/mimc200/config.mk
new file mode 100644
index 000..9a794e5
--- /dev/null
+++ b/board/atmel/mimc200/config.mk
@@ -0,0 +1,3 @@
+TEXT_BASE= 0x
+PLATFORM_RELFLAGS+= -ffunction-sections -fdata-sections
+PLATFORM_LDFLAGS+= --gc-sections
diff --git a/board/atmel/mimc200/eth.c b/board/atmel/mimc200/eth.c
new file mode 100644
index 000..4e13399
--- /dev/null
+++ b/board/atmel/mimc200/eth.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2006 Atmel Corporation
+ *
+ * Ethernet initialization for the AVR32 Network Gateway
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include common.h
+
+#include asm/arch/memory-map.h
+
+extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
+
+#ifdef CONFIG_CMD_NET
+void mimc200_eth_initialize(bd_t *bi)
+{
+macb_eth_initialize(0, (void *)MACB0_BASE, bi-bi_phy_id[0]);
+macb_eth_initialize(1, (void *)MACB1_BASE, bi-bi_phy_id[1]);
+}
+#endif
diff --git a/board/atmel/mimc200/Makefile b/board/atmel/mimc200/Makefile
new file mode 100644
index 000..1b5c635
--- /dev/null
+++ b/board/atmel/mimc200/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2005-2006 Atmel Corporation
+#
+# See file CREDITS for list of people who contributed to this project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied

[U-Boot-Users] [PATCH] Add MIMC200 board - now uses board_eth_init()

2008-07-28 Thread Mark Jackson
The MIMC200 board is based on Atmel's NGW100 dev kit,
but with an extra 8MByte FLASH and 128KByte FRAM.

---
CREDITS|4 +
MAINTAINERS|4 +
MAKEALL|1 +
Makefile   |3 +
board/atmel/mimc200/Makefile   |   40 +
board/atmel/mimc200/config.mk  |3 +
board/atmel/mimc200/mimc200.c  |  158 
board/atmel/mimc200/u-boot.lds |   73 +
cpu/at32ap/at32ap700x/clk.c|8 ++
cpu/at32ap/at32ap700x/gpio.c   |4 +
cpu/at32ap/cpu.c   |   14 +++
drivers/serial/atmel_usart.c   |   43 ++
include/configs/mimc200.h  |  173 
13 files changed, 528 insertions(+), 0 deletions(-)

diff --git a/CREDITS b/CREDITS
index 2b0dab7..5010c78 100644
--- a/CREDITS
+++ b/CREDITS
@@ -217,6 +217,10 @@ H: Rich Ireland
E: [EMAIL PROTECTED]
D: FPGA device configuration driver

+H: Mark Jackson
+E: [EMAIL PROTECTED]
+D: Port to MIMC200 board
+
N: Gary Jennejohn
E: [EMAIL PROTECTED], [EMAIL PROTECTED]
D: Support for Samsung ARM920T S3C2400X, ARM920T TRAB
diff --git a/MAINTAINERS b/MAINTAINERS
index cbe5c47..d4f6639 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -709,6 +709,10 @@ Haavard Skinnemoen [EMAIL PROTECTED]
ATSTK1006AT32AP7000
ATNGW100AT32AP7000

+Mark Jackson [EMAIL PROTECTED]
+
+MIMC200AT32AP7000
+
#
# SuperH Systems:#
##
diff --git a/MAKEALL b/MAKEALL
index c1a9c60..cfd376c 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -715,6 +715,7 @@ LIST_avr32=\
atstk1004\
atstk1006\
atngw100\
+mimc200\


#
diff --git a/Makefile b/Makefile
index 369bbd7..d85867c 100644
--- a/Makefile
+++ b/Makefile
@@ -2914,6 +2914,9 @@ atstk1004_config:unconfig
atstk1006_config:unconfig
@$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x

+mimc200_config:unconfig
+@$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 atmel at32ap700x
+
#
# SH3 (SuperH)
#
diff --git a/board/atmel/mimc200/Makefile b/board/atmel/mimc200/Makefile
new file mode 100644
index 000..9f3849f
--- /dev/null
+++ b/board/atmel/mimc200/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2005-2006 Atmel Corporation
+#
+# See file CREDITS for list of people who contributed to this project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+
+include $(TOPDIR)/config.mk
+
+LIB:= $(obj)lib$(BOARD).a
+
+COBJS:= $(BOARD).o
+
+SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/atmel/mimc200/config.mk b/board/atmel/mimc200/config.mk
new file mode 100644
index 000..9a794e5
--- /dev/null
+++ b/board/atmel/mimc200/config.mk
@@ -0,0 +1,3 @@
+TEXT_BASE= 0x
+PLATFORM_RELFLAGS+= -ffunction-sections -fdata-sections
+PLATFORM_LDFLAGS+= --gc-sections
diff --git a/board/atmel/mimc200/mimc200.c b/board/atmel/mimc200/mimc200.c
new file mode 100644
index 000..3f89059
--- /dev/null
+++ b/board/atmel/mimc200/mimc200.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2006 Atmel Corporation
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR