Re: [U-Boot-Users] [PATCH 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-11-04 Thread Jean-Christophe PLAGNIOL-VILLARD
On 10:17 Tue 29 Jul , Hong Xu wrote:
 From 8e7f74804f86c25639f4009ba14fd6c1affe5ee6 Mon Sep 17 00:00:00 2001
 From: Hong Xu [EMAIL PROTECTED]
 Date: Tue, 29 Jul 2008 09:23:47 +0800
 Subject: [PATCH 1/1] Add support for ATMEL AT91SAM9G20EK board.
 
 This patch add support for ATMEL AT91SAM9G20EK board.
 - Per J's request, this patch's based on branch for-1.3.5
 - Per *'s suggestion, remove the *big* #ifdef
 - Per Ben's suggestion, don't touch net/eth.c, move code to board init part.
 
 Thanks
 BR,
 Eric
 
 Signed-off-by: Hong Xu [EMAIL PROTECTED]
 ---
  Makefile  |2 +
  board/atmel/at91sam9g20ek/Makefile|   57 +++
  board/atmel/at91sam9g20ek/at91sam9g20ek.c |  257 
 +
  board/atmel/at91sam9g20ek/config.mk   |1 +
  board/atmel/at91sam9g20ek/led.c   |   64 +++
  board/atmel/at91sam9g20ek/nand.c  |   79 +
  board/atmel/at91sam9g20ek/partition.c |   40 +
  drivers/net/macb.c|   14 +-
  include/asm-arm/arch-at91/hardware.h  |2 +-
  include/configs/at91sam9g20ek.h   |  202 ++
  10 files changed, 709 insertions(+), 9 deletions(-)
  create mode 100644 board/atmel/at91sam9g20ek/Makefile
  create mode 100644 board/atmel/at91sam9g20ek/at91sam9g20ek.c
  create mode 100644 board/atmel/at91sam9g20ek/config.mk
  create mode 100644 board/atmel/at91sam9g20ek/led.c
  create mode 100644 board/atmel/at91sam9g20ek/nand.c
  create mode 100644 board/atmel/at91sam9g20ek/partition.c
  create mode 100644 include/configs/at91sam9g20ek.h

Do you have any plan to send a rebase version?

Best Regards,
J.

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-30 Thread Haavard Skinnemoen
Ben Warren [EMAIL PROTECTED] wrote:
   extern int macb_eth_initialize(int id, void *regs, unsigned int 
   phy_addr);  
 
  We're getting more and more of these. Does anyone know an appropriate
  header to put it in?
   
 At one point I had a netdev.h file, but removed it because it only
 contained this type of definition.  Maybe it's time to resurrect.

Yeah, perhaps that would be nice. I get the feeling this isn't the only
instance of this kind of thing:

~/work/u-boot/upstream$ find -name '*.c' | xargs grep '^extern' | wc -l
1042

All of those instances are potentially dangerous. The
macb_eth_initialize() thing has certainly blown up in my face before...

Btw, shouldn't board_eth_init() and cpu_eth_init() be declared in some
header file as well? It might catch the wrong function definitions
you've pointed out quite a few times already.

Haavard

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-30 Thread Ben Warren
On Wed, Jul 30, 2008 at 12:44 AM, Haavard Skinnemoen
[EMAIL PROTECTED] wrote:
 Ben Warren [EMAIL PROTECTED] wrote:
   extern int macb_eth_initialize(int id, void *regs, unsigned int 
   phy_addr);
 
  We're getting more and more of these. Does anyone know an appropriate
  header to put it in?
 
 At one point I had a netdev.h file, but removed it because it only
 contained this type of definition.  Maybe it's time to resurrect.

 Yeah, perhaps that would be nice. I get the feeling this isn't the only
 instance of this kind of thing:

 ~/work/u-boot/upstream$ find -name '*.c' | xargs grep '^extern' | wc -l
 1042

Yikes.  I don't mean to be an ass, but did you know that modern grep
has a '-R' (recurse) switch?
e.g. $ grep -R --include *.c '^extern' * | wc -l

 All of those instances are potentially dangerous. The
 macb_eth_initialize() thing has certainly blown up in my face before...

 Btw, shouldn't board_eth_init() and cpu_eth_init() be declared in some
 header file as well? It might catch the wrong function definitions
 you've pointed out quite a few times already.

Yeah, the fact that I've corrected several wrong return types in one
day makes me think it's time.

thanks,
Ben

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-29 Thread Hong Xu
Thanks Ben.
I'll wait for more suggestions and re-generate the whole patch again.
Hope I do not bother you guys too much. It's my first time saying
something in this list. :-)

On Tue, Jul 29, 2008 at 12:57, Ben Warren [EMAIL PROTECTED] wrote:
 Hi Hong,

 Thanks for all the hard work.  One more thing...
 snip
 +#if defined(CONFIG_CMD_NET)
 +int board_eth_init(bd_t *bis)
 +{
 +   return at91sam9_eth_initialize(bis);
 +}
 +#endif

 Here's at91sam9_eth_initialize:

 #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
 void at91sam9_eth_initialize(bd_t *bi)
 {
macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
 }
 #endif

 Issues:
 1. It returns void
 2. It just calls the MACB initializer.

 Please change your code to:

 extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);

 #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
 int board_eth_init(bd_t *bi)
 {
return macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
 }
 #endif

 or something like this.  I don't know if AT91_BASE_EMAC is visible
 from this code, so you may need to modify slightly.

 regards,
 Ben


-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-29 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:57 Mon 28 Jul , Ben Warren wrote:
 Hi Hong,
 
 Thanks for all the hard work.  One more thing...
 snip
  +#if defined(CONFIG_CMD_NET)
  +int board_eth_init(bd_t *bis)
  +{
  +   return at91sam9_eth_initialize(bis);
  +}
  +#endif
 
 Here's at91sam9_eth_initialize:
 
 #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
 void at91sam9_eth_initialize(bd_t *bi)
 {
 macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
 }
 #endif
 
 Issues:
 1. It returns void
 2. It just calls the MACB initializer.
 
 Please change your code to:
 
 extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 
 #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
 int board_eth_init(bd_t *bi)
 {
 return macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
 }
 #endif
 
 or something like this.  I don't know if AT91_BASE_EMAC is visible
 from this code, so you may need to modify slightly.
Can we do a cpu_eth_init instead?

Best Regards,
J.

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-29 Thread Hong Xu
On Tue, Jul 29, 2008 at 15:25, Jean-Christophe PLAGNIOL-VILLARD
[EMAIL PROTECTED] wrote:
 On 21:57 Mon 28 Jul , Ben Warren wrote:
 Hi Hong,

 Thanks for all the hard work.  One more thing...
 snip
  +#if defined(CONFIG_CMD_NET)
  +int board_eth_init(bd_t *bis)
  +{
  +   return at91sam9_eth_initialize(bis);
  +}
  +#endif

 Here's at91sam9_eth_initialize:

 #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
 void at91sam9_eth_initialize(bd_t *bi)
 {
 macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
 }
 #endif

 Issues:
 1. It returns void
 2. It just calls the MACB initializer.

 Please change your code to:

 extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);

 #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
 int board_eth_init(bd_t *bi)
 {
 return macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
 }
 #endif

 or something like this.  I don't know if AT91_BASE_EMAC is visible
 from this code, so you may need to modify slightly.
 Can we do a cpu_eth_init instead?
Not all arm926ejs series have built-in ethernet controller (e.g.
AT91SAM9261 does not have). If we do it in cpu_eth_init, we may need
other more #ifdef_s to distinguish. :-)

 Best Regards,
 J.


BR,
Eric

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-29 Thread Jean-Christophe PLAGNIOL-VILLARD
On 16:01 Tue 29 Jul , Hong Xu wrote:
 On Tue, Jul 29, 2008 at 15:25, Jean-Christophe PLAGNIOL-VILLARD
 [EMAIL PROTECTED] wrote:
  On 21:57 Mon 28 Jul , Ben Warren wrote:
  Hi Hong,
 
  Thanks for all the hard work.  One more thing...
  snip
   +#if defined(CONFIG_CMD_NET)
   +int board_eth_init(bd_t *bis)
   +{
   +   return at91sam9_eth_initialize(bis);
   +}
   +#endif
 
  Here's at91sam9_eth_initialize:
 
  #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
  void at91sam9_eth_initialize(bd_t *bi)
  {
  macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
  }
  #endif
 
  Issues:
  1. It returns void
  2. It just calls the MACB initializer.
 
  Please change your code to:
 
  extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 
  #if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
  int board_eth_init(bd_t *bi)
  {
  return macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
  }
  #endif
 
  or something like this.  I don't know if AT91_BASE_EMAC is visible
  from this code, so you may need to modify slightly.
  Can we do a cpu_eth_init instead?
 Not all arm926ejs series have built-in ethernet controller (e.g.
 AT91SAM9261 does not have). If we do it in cpu_eth_init, we may need
 other more #ifdef_s to distinguish. :-)
It already the case, I'll send a patch obout it

Best Regards,
J.

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-29 Thread Haavard Skinnemoen
Hong Xu [EMAIL PROTECTED] wrote:
  or something like this.  I don't know if AT91_BASE_EMAC is visible
  from this code, so you may need to modify slightly.  
  Can we do a cpu_eth_init instead?  
 Not all arm926ejs series have built-in ethernet controller (e.g.
 AT91SAM9261 does not have). If we do it in cpu_eth_init, we may need
 other more #ifdef_s to distinguish. :-)

In _my_ opinion, I think it's much cleaner to just let the board code
decide which and how many ethernet controllers to initialize instead of
having some #ifdef maze in the CPU code. But it's not may call.

Oh, and another thing...

  extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);

We're getting more and more of these. Does anyone know an appropriate
header to put it in?

Haavard

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-29 Thread Ben Warren
On Tue, Jul 29, 2008 at 2:15 AM, Haavard Skinnemoen
[EMAIL PROTECTED] wrote:
 Hong Xu [EMAIL PROTECTED] wrote:
  or something like this.  I don't know if AT91_BASE_EMAC is visible
  from this code, so you may need to modify slightly.
  Can we do a cpu_eth_init instead?
 Not all arm926ejs series have built-in ethernet controller (e.g.
 AT91SAM9261 does not have). If we do it in cpu_eth_init, we may need
 other more #ifdef_s to distinguish. :-)

 In _my_ opinion, I think it's much cleaner to just let the board code
 decide which and how many ethernet controllers to initialize instead of
 having some #ifdef maze in the CPU code. But it's not may call.

Agreed
 Oh, and another thing...

  extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);

 We're getting more and more of these. Does anyone know an appropriate
 header to put it in?

At one point I had a netdev.h file, but removed it because it only
contained this type of definition.  Maybe it's time to resurrect.

regards,
Ben

-
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 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-28 Thread Hong Xu
From 8e7f74804f86c25639f4009ba14fd6c1affe5ee6 Mon Sep 17 00:00:00 2001
From: Hong Xu [EMAIL PROTECTED]
Date: Tue, 29 Jul 2008 09:23:47 +0800
Subject: [PATCH 1/1] Add support for ATMEL AT91SAM9G20EK board.

This patch add support for ATMEL AT91SAM9G20EK board.
- Per J's request, this patch's based on branch for-1.3.5
- Per *'s suggestion, remove the *big* #ifdef
- Per Ben's suggestion, don't touch net/eth.c, move code to board init part.

Thanks
BR,
Eric

Signed-off-by: Hong Xu [EMAIL PROTECTED]
---
 Makefile  |2 +
 board/atmel/at91sam9g20ek/Makefile|   57 +++
 board/atmel/at91sam9g20ek/at91sam9g20ek.c |  257 +
 board/atmel/at91sam9g20ek/config.mk   |1 +
 board/atmel/at91sam9g20ek/led.c   |   64 +++
 board/atmel/at91sam9g20ek/nand.c  |   79 +
 board/atmel/at91sam9g20ek/partition.c |   40 +
 drivers/net/macb.c|   14 +-
 include/asm-arm/arch-at91/hardware.h  |2 +-
 include/configs/at91sam9g20ek.h   |  202 ++
 10 files changed, 709 insertions(+), 9 deletions(-)
 create mode 100644 board/atmel/at91sam9g20ek/Makefile
 create mode 100644 board/atmel/at91sam9g20ek/at91sam9g20ek.c
 create mode 100644 board/atmel/at91sam9g20ek/config.mk
 create mode 100644 board/atmel/at91sam9g20ek/led.c
 create mode 100644 board/atmel/at91sam9g20ek/nand.c
 create mode 100644 board/atmel/at91sam9g20ek/partition.c
 create mode 100644 include/configs/at91sam9g20ek.h

diff --git a/Makefile b/Makefile
index 7f74e2a..7f519ef 100644
--- a/Makefile
+++ b/Makefile
@@ -2378,6 +2378,8 @@ at91cap9adk_config:   unconfig
 at91sam9260ek_config   :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91

+at91sam9g20ek_config   :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9g20ek atmel at91
 
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config\
diff --git a/board/atmel/at91sam9g20ek/Makefile
b/board/atmel/at91sam9g20ek/Makefile
new file mode 100644
index 000..cdf5d34
--- /dev/null
+++ b/board/atmel/at91sam9g20ek/Makefile
@@ -0,0 +1,57 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
+#
+# (C) Copyright 2008
+# Stelian Pop [EMAIL PROTECTED]
+# Lead Tech Design www.leadtechdesign.com
+#
+# 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-y+= at91sam9g20ek.o
+COBJS-y+= led.o
+COBJS-y+= partition.o
+COBJS-$(CONFIG_CMD_NAND) += nand.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/atmel/at91sam9g20ek/at91sam9g20ek.c
b/board/atmel/at91sam9g20ek/at91sam9g20ek.c
new file mode 100644
index 000..c8b36bd
--- /dev/null
+++ b/board/atmel/at91sam9g20ek/at91sam9g20ek.c
@@ -0,0 +1,257 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop [EMAIL PROTECTED]
+ * Lead Tech Design www.leadtechdesign.com
+ *
+ * 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 

Re: [U-Boot-Users] [PATCH 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-28 Thread Hong Xu
On Tue, Jul 29, 2008 at 10:17, Hong Xu [EMAIL PROTECTED] wrote:
 From 8e7f74804f86c25639f4009ba14fd6c1affe5ee6 Mon Sep 17 00:00:00 2001
 From: Hong Xu [EMAIL PROTECTED]
 Date: Tue, 29 Jul 2008 09:23:47 +0800
 Subject: [PATCH 1/1] Add support for ATMEL AT91SAM9G20EK board.

 This patch add support for ATMEL AT91SAM9G20EK board.
 - Per J's request, this patch's based on branch for-1.3.5
 - Per *'s suggestion, remove the *big* #ifdef

Thanks to Haavard, modifications in driver/net/macb.c are actually from Haavard.

 - Per Ben's suggestion, don't touch net/eth.c, move code to board init part.

 Thanks
 BR,
 Eric

 Signed-off-by: Hong Xu [EMAIL PROTECTED]
 ---
  Makefile  |2 +
  board/atmel/at91sam9g20ek/Makefile|   57 +++
  board/atmel/at91sam9g20ek/at91sam9g20ek.c |  257 
 +
  board/atmel/at91sam9g20ek/config.mk   |1 +
  board/atmel/at91sam9g20ek/led.c   |   64 +++
  board/atmel/at91sam9g20ek/nand.c  |   79 +
  board/atmel/at91sam9g20ek/partition.c |   40 +
  drivers/net/macb.c|   14 +-
  include/asm-arm/arch-at91/hardware.h  |2 +-
  include/configs/at91sam9g20ek.h   |  202 ++
  10 files changed, 709 insertions(+), 9 deletions(-)
  create mode 100644 board/atmel/at91sam9g20ek/Makefile
  create mode 100644 board/atmel/at91sam9g20ek/at91sam9g20ek.c
  create mode 100644 board/atmel/at91sam9g20ek/config.mk
  create mode 100644 board/atmel/at91sam9g20ek/led.c
  create mode 100644 board/atmel/at91sam9g20ek/nand.c
  create mode 100644 board/atmel/at91sam9g20ek/partition.c
  create mode 100644 include/configs/at91sam9g20ek.h

 diff --git a/Makefile b/Makefile
 index 7f74e2a..7f519ef 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -2378,6 +2378,8 @@ at91cap9adk_config:   unconfig
  at91sam9260ek_config   :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91

 +at91sam9g20ek_config   :   unconfig
 +   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9g20ek atmel at91
  
  ## ARM Integrator boards - see doc/README-integrator for more info.
  integratorap_config\
 diff --git a/board/atmel/at91sam9g20ek/Makefile
 b/board/atmel/at91sam9g20ek/Makefile
 new file mode 100644
 index 000..cdf5d34
 --- /dev/null
 +++ b/board/atmel/at91sam9g20ek/Makefile
 @@ -0,0 +1,57 @@
 +#
 +# (C) Copyright 2003-2008
 +# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
 +#
 +# (C) Copyright 2008
 +# Stelian Pop [EMAIL PROTECTED]
 +# Lead Tech Design www.leadtechdesign.com
 +#
 +# 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-y+= at91sam9g20ek.o
 +COBJS-y+= led.o
 +COBJS-y+= partition.o
 +COBJS-$(CONFIG_CMD_NAND) += nand.o
 +
 +SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 +OBJS   := $(addprefix $(obj),$(COBJS-y))
 +SOBJS  := $(addprefix $(obj),$(SOBJS))
 +
 +$(LIB):$(obj).depend $(OBJS) $(SOBJS)
 +   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 +
 +clean:
 +   rm -f $(SOBJS) $(OBJS)
 +
 +distclean: clean
 +   rm -f $(LIB) core *.bak $(obj).depend
 +
 +#
 +
 +# defines $(obj).depend target
 +include $(SRCTREE)/rules.mk
 +
 +sinclude $(obj).depend
 +
 +#
 diff --git a/board/atmel/at91sam9g20ek/at91sam9g20ek.c
 b/board/atmel/at91sam9g20ek/at91sam9g20ek.c
 new file mode 100644
 index 000..c8b36bd
 --- /dev/null
 +++ b/board/atmel/at91sam9g20ek/at91sam9g20ek.c
 @@ -0,0 +1,257 @@
 +/*
 + * (C) Copyright 2007-2008
 + * Stelian Pop [EMAIL PROTECTED]
 + * Lead Tech Design www.leadtechdesign.com
 + *
 + * 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 

Re: [U-Boot-Users] [PATCH 1/1] Re-Submit: Add support for ATMEL AT91SAM9G20EK board.

2008-07-28 Thread Ben Warren
Hi Hong,

Thanks for all the hard work.  One more thing...
snip
 +#if defined(CONFIG_CMD_NET)
 +int board_eth_init(bd_t *bis)
 +{
 +   return at91sam9_eth_initialize(bis);
 +}
 +#endif

Here's at91sam9_eth_initialize:

#if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
void at91sam9_eth_initialize(bd_t *bi)
{
macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
}
#endif

Issues:
1. It returns void
2. It just calls the MACB initializer.

Please change your code to:

extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);

#if defined(CONFIG_MACB)  defined(CONFIG_CMD_NET)
int board_eth_init(bd_t *bi)
{
return macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
}
#endif

or something like this.  I don't know if AT91_BASE_EMAC is visible
from this code, so you may need to modify slightly.

regards,
Ben

-
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