Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-11-01 Thread Cristian Birsan
Dear Jean-Christophe PLAGNIOL-VILLARD,

I will remove all unnecessary white spaces from the previous patch. I
have now a patch version for u-boot u-boot v2008.10


  
#
  diff --git a/Makefile b/Makefile
  index 7c13ce8..5b0acae 100644
  --- a/Makefile
  +++ b/Makefile
  @@ -2487,15 +2487,6 @@ shannon_config   :   unconfig
at91rm9200dk_config   :   unconfig
  @$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200
  
  -at91sam9261ek_config   :   unconfig
  -   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
  -
  -at91sam9263ek_config   :   unconfig
  -   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
  -
  -at91sam9rlek_config:   unconfig
  -   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
  -
cmc_pu2_config:   unconfig
  @$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
  
  @@ -2521,6 +2512,18 @@ at91cap9adk_config   :   unconfig
at91sam9260ek_config  :   unconfig
  @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91
  
  +at91sam9261ek_config   :   unconfig
  +   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
  +
  +at91sam9263ek_config   :   unconfig
  +   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
  +
  +at91sam9rlek_config:   unconfig
  +   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
  +
  +sam9l9260_config   :   unconfig
  +   @$(MKCONFIG) $(@:_config=) arm arm926ejs sam9l9260 olimex at91
  +
 why do you touch other at91 config?

I touched other configs because i tried to put correctly boards with
arm920t and arm926ejs in their sections. I belive that at91sam9261ek
at91sam9263ek should be placed in the arm926ejs core section. Please
correct me if i'm wrong.

  +#ifndef __CONFIG_H
  +#define __CONFIG_H
  +
  +/* Hostname */
  +#defineCONFIG_HOSTNAME sam9l9260
  +
  +/* ARM asynchronous clock */
  +#define AT91_MAIN_CLOCK198656000   /* from 18.432 MHz 
  crystal */
  +#define AT91_MASTER_CLOCK  99328000/* peripheral = main / 2 */
  +#define CFG_HZ 100 /* 1us resolution */
 please update to CONFIG_SYS_

 Note that I've plan and announce that I'll generate a common code for
 at91sam9260 and other to reduce duplicate code.

I can change CFG_HZ to CONFIG_SYS_HZ but that macro is used
in /cpu/arm926ejs/at91/timer.c. If I change the macro from timer.c I
should update all at91 configurations but I can test only on Olimex
(at91sam9260) board. I do not know if it's safe to modify other
configurations without appropriate testing.

Regards,
Cristian

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-11-01 Thread Jean-Christophe PLAGNIOL-VILLARD
On 14:49 Sat 01 Nov , Cristian Birsan wrote:
 Dear Jean-Christophe PLAGNIOL-VILLARD,
 
 I will remove all unnecessary white spaces from the previous patch. I
 have now a patch version for u-boot u-boot v2008.10
 
 
   
 
   #
   diff --git a/Makefile b/Makefile
   index 7c13ce8..5b0acae 100644
   --- a/Makefile
   +++ b/Makefile
   @@ -2487,15 +2487,6 @@ shannon_config :   unconfig
 at91rm9200dk_config :   unconfig
 @$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel 
   at91rm9200
   
   -at91sam9261ek_config :   unconfig
   - @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
   -
   -at91sam9263ek_config :   unconfig
   - @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
   -
   -at91sam9rlek_config  :   unconfig
   - @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
   -
 cmc_pu2_config  :   unconfig
 @$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
   
   @@ -2521,6 +2512,18 @@ at91cap9adk_config :   unconfig
 at91sam9260ek_config:   unconfig
 @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel 
   at91
   
   +at91sam9261ek_config :   unconfig
   + @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
   +
   +at91sam9263ek_config :   unconfig
   + @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
   +
   +at91sam9rlek_config  :   unconfig
   + @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
   +
   +sam9l9260_config :   unconfig
   + @$(MKCONFIG) $(@:_config=) arm arm926ejs sam9l9260 olimex at91
   +
  why do you touch other at91 config?
 
 I touched other configs because i tried to put correctly boards with
 arm920t and arm926ejs in their sections. I belive that at91sam9261ek
 at91sam9263ek should be placed in the arm926ejs core section. Please
 correct me if i'm wrong.
 
It's supposed to be done in an other patch which I've post btw
   +#ifndef __CONFIG_H
   +#define __CONFIG_H
   +
   +/* Hostname */
   +#define  CONFIG_HOSTNAME sam9l9260
   +
   +/* ARM asynchronous clock */
   +#define AT91_MAIN_CLOCK  198656000   /* from 18.432 MHz 
   crystal */
   +#define AT91_MASTER_CLOCK99328000/* peripheral = main / 
   2 */
   +#define CFG_HZ   100 /* 1us resolution */
  please update to CONFIG_SYS_
 
  Note that I've plan and announce that I'll generate a common code for
  at91sam9260 and other to reduce duplicate code.
 
 I can change CFG_HZ to CONFIG_SYS_HZ but that macro is used
 in /cpu/arm926ejs/at91/timer.c. If I change the macro from timer.c I
 should update all at91 configurations but I can test only on Olimex
 (at91sam9260) board. I do not know if it's safe to modify other
 configurations without appropriate testing.
I've merge it at the same time of all CFG_

Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-31 Thread Jean-Christophe PLAGNIOL-VILLARD
On 01:41 Fri 31 Oct , Cristian Birsan wrote:
 Dear Wolfgang Denk,

 I have submitted a few weeks ago a patch for Olimex SAM9-L9260 (similar to 
 AT91SAM9260-EK board from Atmel).

 Is is possible to include that patch in the new version of u-boot ?

 If it's needed I can resend a new patch for the u-boot v2008.10

 Please let me know what should I do next.
please do

Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-31 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:03 Mon 06 Oct , Cristian Birsan wrote:
 Added support for the Olimex SAM9-L9260 development board.
 This patch is based on u-boot v1.3.4.
 
 Tested with data flash only (not with NAND).
 
 Signed-off-by: Cristian Birsan [EMAIL PROTECTED]
 ---
   MAKEALL|1 +
   Makefile   |   21 ++--
   board/olimex/sam9l9260/Makefile|   59 
   board/olimex/sam9l9260/config.mk   |1 +
   board/olimex/sam9l9260/led.c   |   64 +
   board/olimex/sam9l9260/nand.c  |   78 +++
   board/olimex/sam9l9260/partition.c |   39 ++
   board/olimex/sam9l9260/sam9l9260.c |  264 
 
   drivers/mtd/nand/nand_ids.c|2 +
   include/configs/sam9l9260.h|  212 +
   10 files changed, 732 insertions(+), 9 deletions(-)
   create mode 100644 board/olimex/sam9l9260/Makefile
   create mode 100644 board/olimex/sam9l9260/config.mk
   create mode 100644 board/olimex/sam9l9260/led.c
   create mode 100644 board/olimex/sam9l9260/nand.c
   create mode 100644 board/olimex/sam9l9260/partition.c
   create mode 100644 board/olimex/sam9l9260/sam9l9260.c
   create mode 100644 include/configs/sam9l9260.h
 
 diff --git a/MAKEALL b/MAKEALL
 index 9ccb9ac..0e2cb36 100755
 --- a/MAKEALL
 +++ b/MAKEALL
 @@ -542,6 +542,7 @@ LIST_at91=   \
   kb9202  \
   mp2usb  \
   m501sk  \
 + sam9l9260   \
   
 
   #
 diff --git a/Makefile b/Makefile
 index 7c13ce8..5b0acae 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -2487,15 +2487,6 @@ shannon_config :   unconfig
   at91rm9200dk_config :   unconfig
   @$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200
 
 -at91sam9261ek_config :   unconfig
 - @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
 -
 -at91sam9263ek_config :   unconfig
 - @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
 -
 -at91sam9rlek_config  :   unconfig
 - @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
 -
   cmc_pu2_config  :   unconfig
   @$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
 
 @@ -2521,6 +2512,18 @@ at91cap9adk_config :   unconfig
   at91sam9260ek_config:   unconfig
   @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91
 
 +at91sam9261ek_config :   unconfig
 + @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
 +
 +at91sam9263ek_config :   unconfig
 + @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
 +
 +at91sam9rlek_config  :   unconfig
 + @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
 +
 +sam9l9260_config :   unconfig
 + @$(MKCONFIG) $(@:_config=) arm arm926ejs sam9l9260 olimex at91
 +
why do you touch other at91 config?
   
   ## ARM Integrator boards - see doc/README-integrator for more info.
   integratorap_config \
 diff --git a/board/olimex/sam9l9260/Makefile b/board/olimex/sam9l9260/Makefile
 new file mode 100644
 index 000..8853b7c
 --- /dev/null
 +++ b/board/olimex/sam9l9260/Makefile
 @@ -0,0 +1,59 @@
 +#
 +# (C) Copyright 2003-2008
 +# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
 +#
 +# (C) Copyright 2008
 +#
 +# Cristian Birsan [EMAIL PROTECTED] based on the work of
 +# 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  += sam9l9260.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
 +
 

Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-31 Thread Jean-Christophe PLAGNIOL-VILLARD
On 09:48 Fri 31 Oct , Wolfgang Denk wrote:
 Dear Cristian
 
 In message [EMAIL PROTECTED] Jean-Christophe wrote:
 
  I've forget one think please add an entry to the MAINTAINER file
 
 This can be done by sending an additional patch - no need to resubmit
 all the stuff.
Yes but the patch need to be rebased so If the author can do it a the time it
will nice

Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-30 Thread Cristian Birsan
Dear Wolfgang Denk,

I have submitted a few weeks ago a patch for Olimex SAM9-L9260 (similar to 
AT91SAM9260-EK board from Atmel).

Is is possible to include that patch in the new version of u-boot ?

If it's needed I can resend a new patch for the u-boot v2008.10

Please let me know what should I do next.

Best regards,

Cristian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-10 Thread Cristian Birsan
Dear Wolfgang Denk,

On Wed, Oct 8, 2008 at 1:55 AM, Wolfgang Denk [EMAIL PROTECTED] wrote:

 setenv affects only the U-Boot environment variables. It doe snot
 program any device registers for you.

 And PLEASE: restrict your line length to 70 characters or less.

 Nfs works only with the ugly code that was removed.

 I'm spinning in a circle :(

 Please read the previous postings, and the FAQ.

I read the arm-linux mailing lists and I saw similar discussions
there. Now it's clear to me that u-boot shouldn't initialize the EMAC
(MACB) registers with the MAC address. In the newer kernel releases (
2.6.26 or newer ) there is a fix for the MACB driver and it can be
used for boards that do not store their MAC address in a nonvolatile
memory like an EEPROM.

Thank you for your time and quick response to questions.

Please consider the u-boot patch from the previous post for the next
merge window.

Best regards,

Cristian Birsan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-07 Thread Cristian Birsan
Dear Wolfgang Denk,

Regarding the following:

+#define ROUND(A, B)(((A) + (B))  ~((B) - 1))
+/*
+ * Size of malloc() pool
+ */
+#define CFG_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)

I tried to include the common.h file in my configuration file but this
breaks u-boot compilation (it's
not safe to include common.h standalone) .I noticed that none of other
board configuration files
include common.h

If I replace the ROUND(A,B) macro with #define DIV_ROUND_UP(n,d) (((n)
+ (d) - 1) / (d))
macro when i try to make u-boot I obtain the following errors:

start.S: Assembler messages:
start.S:339: Error: invalid constant (802d) after fixup

It appears to me that the solution for the moment is to use the following fixed
macro:
define ROUND(A, B)  (((A) + (B) -1)  ~((B) - 1))

Regarding the following:

 +#ifdef CONFIG_RESET_PHY_R
 +void reset_phy(void)
 +{
 +#ifdef CONFIG_MACB
 +/*
 + * Initialize ethernet HW addr prior to starting Linux,
 + * needed for nfsroot
 + */
 +eth_init(gd-bd);
 +#endif

 Please do NOT  do  this.  It's  a  violation  of  the  U-Boot  design
 principles,  which  clearly  say that only such periphereals that are
 actually being used by U-Boot shall be initialized, and even if  they
 are being used, these shall be deactivated after use.

I removed the reset_phy() function and I do not use anymore CONFIG_RESET_PHY_R.
I use setenv ethaddr to configure the MAC address of the Ethernet controller.

Is it ok to resend the patch with the above changes ?

Best regards,
Cristian Birsan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-07 Thread Cristian Birsan
Dear all,

In the previous patch i removed the code from the section below.

  +#ifdef CONFIG_RESET_PHY_R
  +void reset_phy(void)
  +{
  +#ifdef CONFIG_MACB
  +/*
  + * Initialize ethernet HW addr prior to starting Linux,
  + * needed for nfsroot
  + */
  +eth_init(gd-bd);
  +#endif
 
  Please do NOT  do  this.  It's  a  violation  of  the  U-Boot  design
  principles,  which  clearly  say that only such periphereals that are
  actually being used by U-Boot shall be initialized, and even if  they
  are being used, these shall be deactivated after use.
 
  Carelessly leaving ports or devices in an initialized stated has been
  the source for problems too many times before.
 
  Don't do that.

The u-boot works but when I try to use nfs as root filesystem i encounter the 
following issue:

.
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (00:00:00:00:00:00)
eth0: attached PHY driver [KS8721BL] (mii_bus:phy_addr=:01, irq=-1)
.

 From previous messages i understand that the MAC is set to 00:00:00:00:00:00 
which is bad.

IP-Config: Failed to open eth0

I used again setenv ethaddr 00:04:25:12:34:56 in u-boot. After saveenv and 
reboot i used md command to display the EMAC 0xFFFC4000 (named MACB in the 
driver )
registers

U-Boot md 0xfff4c000
fff4c000:    
fff4c010:    
fff4c020:    
fff4c030:    
fff4c040:    
fff4c050:    
fff4c060:    
fff4c070:    
fff4c080:    
fff4c090:    
fff4c0a0:    
fff4c0b0:    
fff4c0c0:    
fff4c0d0:    
fff4c0e0:    4000[EMAIL PROTECTED]
fff4c0f0: 53504932 20202020 00010154 01902IPST...

Offset 0x98 Specific Address 1 Bottom Register EMAC_SA1B Read-write
Offset 0x9C Specific Address 1 Top RegisterEMAC_SA1T Read-write

The register EMAC_SA1T and EMAC_SA1B coresponding to top and bottom of the MAC 
address are 0

Nfs works only with the ugly code that was removed.

I'm spinning in a circle :(

Please send me any suggestion.

Best regards,
Cristian Birsan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-07 Thread Wolfgang Denk
Dear Cristian Birsan,

In message [EMAIL PROTECTED] you wrote:
 
 I used again setenv ethaddr 00:04:25:12:34:56 in u-boot. After saveenv and 
 reboot i used md command to display the EMAC 0xFFFC4000 (named MACB in the 
 driver )
 registers

setenv affects only the U-Boot environment variables. It doe snot
program any device registers for you.

And PLEASE: restrict your line length to 70 characters or less.

 Nfs works only with the ugly code that was removed.
 
 I'm spinning in a circle :(

Please read the previous postings, and the FAQ.

 Please send me any suggestion.

Fix your Linux driver to pick up the MAC address from some convenient
place; using a kernel boot argument is one option, using  the  device
tree  is  another one. The former is less effort, the latter is more,
but would earn you a lot of credits :-)

Best regards,

Wolfgang Denk

-- 
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: [EMAIL PROTECTED]
It may be that your whole purpose in life is simply  to  serve  as  a
warning to others.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Olimex SAM9-L9260 board support

2008-10-06 Thread Cristian Birsan
Dear Wolfgang Denk,

Thank you for your quick response.

  +#ifdef CONFIG_RESET_PHY_R
  +void reset_phy(void)
  +{
  +#ifdef CONFIG_MACB
  +/*
  + * Initialize ethernet HW addr prior to starting Linux,
  + * needed for nfsroot
  + */
  +eth_init(gd-bd);
  +#endif
 
  Please do NOT  do  this.  It's  a  violation  of  the  U-Boot  design
  principles,  which  clearly  say that only such periphereals that are
  actually being used by U-Boot shall be initialized, and even if  they
  are being used, these shall be deactivated after use.
 
  Carelessly leaving ports or devices in an initialized stated has been
  the source for problems too many times before.
 
  Don't do that.
 

The above code section is used also in other ATMEL boards like
at91sam9260ek ( /board/atmel/at91sam9260ek/at91sam9260ek.c ),
at91sam9261ek, at91sam9263ek, at91sam9rlek. This is my
first patch sent to U-Boot and I used that code as reference.

The board that i have (SAM9-L9260 from Olimex ) is close to
AT91SAM9260EK from ATMEL.

How do you think i can do this the right way?

  +#define ROUND(A, B)(((A) + (B))  ~((B) - 1))
 
  First I think that this is wrong (maybe you need B-1 instead of B
  in the first part?), second we already have DIV_ROUND_UP  defined  in
  common.h so please use this.

Thanks, good catch. I will fix this and submit a new patch.

Best regards,
Cristian Birsan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot