Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-20 Thread Albin Tonnerre
On Wed, Aug 19, 2009 at 11:30:05PM +0200, Jean-Christophe PLAGNIOL-VILLARD 
wrote :
 On 21:14 Wed 19 Aug , Albin Tonnerre wrote:
  diff --git a/MAKEALL b/MAKEALL
  index edebaea..5882ceb 100755
  --- a/MAKEALL
  +++ b/MAKEALL
  @@ -607,6 +607,7 @@ LIST_at91= \
  m501sk  \
  pm9261  \
  pm9263  \
  +   tny_a9260   \
 why not 9g20 too?

Oops. Thanks.

   #
  diff --git a/Makefile b/Makefile
  index 329e0f5..2abaeeb 100644
  --- a/Makefile
  +++ b/Makefile
  @@ -2838,6 +2838,16 @@ at91sam9g45ekes_config   :   unconfig
   pm9263_config  :   unconfig
  @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
   
  +TNY_A9G20_NANDFLASH_config \
  +TNY_A9G20_EEPROM_config \
  +TNY_A9G20_config \
  +TNY_A9260_NANDFLASH_config \
  +TNY_A9260_EEPROM_config \
  +TNY_A9260_config   :   unconfig
  +   @mkdir -p $(obj)include
  +   @echo #define CONFIG_$(@:_config=) 1 $(obj)include/config.h
 try somethink like this so you do not need to put the config name uppercase
   @echo -n #define  $(obj)include/config.h
   @echo$(@:_config=) | tr [a-z] [A-Z]  $(obj)include/config.h

I think I'll go with uppercase. If the shell ends up being /bin/sh, it might not
provide the '-n' switch for echo, so I'd rather avoid it when possible.

Thanks for your comments,
-- 
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com


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


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-20 Thread Jean-Christophe PLAGNIOL-VILLARD
On 15:43 Thu 20 Aug , Albin Tonnerre wrote:
 On Wed, Aug 19, 2009 at 11:30:05PM +0200, Jean-Christophe PLAGNIOL-VILLARD 
 wrote :
  On 21:14 Wed 19 Aug , Albin Tonnerre wrote:
   diff --git a/MAKEALL b/MAKEALL
   index edebaea..5882ceb 100755
   --- a/MAKEALL
   +++ b/MAKEALL
   @@ -607,6 +607,7 @@ LIST_at91=   \
 m501sk  \
 pm9261  \
 pm9263  \
   + tny_a9260   \
  why not 9g20 too?
 
 Oops. Thanks.
 
#
   diff --git a/Makefile b/Makefile
   index 329e0f5..2abaeeb 100644
   --- a/Makefile
   +++ b/Makefile
   @@ -2838,6 +2838,16 @@ at91sam9g45ekes_config :   unconfig
pm9263_config:   unconfig
 @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91

   +TNY_A9G20_NANDFLASH_config \
   +TNY_A9G20_EEPROM_config \
   +TNY_A9G20_config \
   +TNY_A9260_NANDFLASH_config \
   +TNY_A9260_EEPROM_config \
   +TNY_A9260_config :   unconfig
   + @mkdir -p $(obj)include
   + @echo #define CONFIG_$(@:_config=) 1 $(obj)include/config.h
  try somethink like this so you do not need to put the config name uppercase
  @echo -n #define  $(obj)include/config.h
  @echo$(@:_config=) | tr [a-z] [A-Z]  $(obj)include/config.h
 
 I think I'll go with uppercase. If the shell ends up being /bin/sh, it might 
 not
 provide the '-n' switch for echo, so I'd rather avoid it when possible.
you can use \c too
but as you prefer

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


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-19 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:14 Wed 19 Aug , Albin Tonnerre wrote:
 The Calao TNY-A9260 and TNY-9G20 are boards manufactured and sold by
 Calao Systems http://www.calao-systems.com. Their components are very
 similar to the AT91SAM9260EK board, so their configuration is based on
 the configuration of this board. There are however some differences:
 different clocks, no LCD, no ethernet. They also can use SPI EEPROM to
 store the environment.
 
 Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com
 ---
please put the version in the subject to known which one is the last
 Changes since previous version:
  - As per Jean-Christophe's commentes, fix long lines and use uppercase for
defines in include/configs/tny_a9260.h. Slightly rework the ifdef logic in
the process
  - Add an entry in MAINTAINERS for the tny_a9g20 as weel, since both 9260 and
9g20 are supported
 
  MAINTAINERS  |5 +
  MAKEALL  |1 +
  Makefile |   10 ++
  board/calao/tny_a9260/Makefile   |   55 ++
  board/calao/tny_a9260/config.mk  |1 +
  board/calao/tny_a9260/spi.c  |   50 +
  board/calao/tny_a9260/tny_a9260.c|  110 +++
  cpu/arm926ejs/at91/at91sam9260_devices.c |2 +-
  include/configs/tny_a9260.h  |  172 
 ++
  9 files changed, 405 insertions(+), 1 deletions(-)
  create mode 100644 board/calao/tny_a9260/Makefile
  create mode 100644 board/calao/tny_a9260/config.mk
  create mode 100644 board/calao/tny_a9260/spi.c
  create mode 100644 board/calao/tny_a9260/tny_a9260.c
  create mode 100644 include/configs/tny_a9260.h
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 620604c..91e2c7f 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -681,6 +681,11 @@ Andrea Scian andrea.sc...@dave-tech.it
  
   B2  ARM7TDMI (S3C44B0X)
  
 +Albin Tonnerre albin.tonne...@free-electrons.com
 +
 + tny_a9260   ARM926EJS (AT91SAM9260 SoC)
 + tny_a9g20   ARM926EJS (AT91SAM9G20 SoC)
 +
  Greg Ungerer greg.unge...@opengear.com
  
   cm4008  ks8695p
 diff --git a/MAKEALL b/MAKEALL
 index edebaea..5882ceb 100755
 --- a/MAKEALL
 +++ b/MAKEALL
 @@ -607,6 +607,7 @@ LIST_at91=   \
   m501sk  \
   pm9261  \
   pm9263  \
 + tny_a9260   \
why not 9g20 too?
  
  
  #
 diff --git a/Makefile b/Makefile
 index 329e0f5..2abaeeb 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -2838,6 +2838,16 @@ at91sam9g45ekes_config :   unconfig
  pm9263_config:   unconfig
   @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
  
 +TNY_A9G20_NANDFLASH_config \
 +TNY_A9G20_EEPROM_config \
 +TNY_A9G20_config \
 +TNY_A9260_NANDFLASH_config \
 +TNY_A9260_EEPROM_config \
 +TNY_A9260_config :   unconfig
 + @mkdir -p $(obj)include
 + @echo #define CONFIG_$(@:_config=) 1 $(obj)include/config.h
try somethink like this so you do not need to put the config name uppercase
@echo -n #define  $(obj)include/config.h
@echo$(@:_config=) | tr [a-z] [A-Z]  $(obj)include/config.h

please also remember that if you update the config you need to update the
MAKEALL too
 + @$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
 +
Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-18 Thread Albin Tonnerre
On Tue, Aug 18, 2009 at 12:48:02AM +0200, Jean-Christophe PLAGNIOL-VILLARD 
wrote :
 On 00:13 Tue 18 Aug , Albin Tonnerre wrote:
  On Mon, Aug 17, 2009 at 11:41:06PM +0200, Jean-Christophe PLAGNIOL-VILLARD 
  wrote :
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#if defined(CONFIG_tny_a9260) || defined(CONFIG_tny_a9260_nandflash) 
|| defined(CONFIG_tny_a9260_eeprom)
   too long
   and define must be upper case
  
  Those defines are generated directly from the target names in the Makfile, 
  and
  are used for internal purposes only. Moving them to uppercase would mean
  changing the target names from tny_a9g20_nandflash to TNY_A9G20_NANDFLASH, 
  while
  the existing Calao-provided BSP uses lowercase. I'd rather not change that.
 you make them uppercase before put them in the config.h

Any hint about how to do that in a Makefile without using things like tr ?

Regards,
-- 
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com


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


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-17 Thread Jean-Christophe PLAGNIOL-VILLARD
 +
 +#ifndef __CONFIG_H
 +#define __CONFIG_H
 +
 +#if defined(CONFIG_tny_a9260) || defined(CONFIG_tny_a9260_nandflash) || 
 defined(CONFIG_tny_a9260_eeprom)
too long
and define must be upper case
 +#define CONFIG_TNY_A9260
 +#define CONFIG_AT91SAM9260
 +#elif defined(CONFIG_tny_a9g20) || defined(CONFIG_tny_a9g20_nandflash) || 
 defined(CONFIG_tny_a9g20_eeprom)
ditto
 +#define CONFIG_TNY_A9G20
 +#define CONFIG_AT91SAM9G20
 +#else
 +#error Unknown board
 +#endif
 +
 +#if defined(CONFIG_tny_a9260_nandflash) || 
 defined(CONFIG_tny_a9g20_nandflash)
 +#define CONFIG_ENV_IS_IN_NAND
 +#else
 +#define CONFIG_ENV_IS_IN_EEPROM
 +#endif
 +
Best Regards,
J.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-17 Thread Albin Tonnerre
On Mon, Aug 17, 2009 at 11:41:06PM +0200, Jean-Christophe PLAGNIOL-VILLARD 
wrote :
  +
  +#ifndef __CONFIG_H
  +#define __CONFIG_H
  +
  +#if defined(CONFIG_tny_a9260) || defined(CONFIG_tny_a9260_nandflash) || 
  defined(CONFIG_tny_a9260_eeprom)
 too long
 and define must be upper case

Those defines are generated directly from the target names in the Makfile, and
are used for internal purposes only. Moving them to uppercase would mean
changing the target names from tny_a9g20_nandflash to TNY_A9G20_NANDFLASH, while
the existing Calao-provided BSP uses lowercase. I'd rather not change that.

By the way, I'd appreciate an answer on LED API matter

Cheers,
-- 
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com


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


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-17 Thread Jean-Christophe PLAGNIOL-VILLARD
On 00:13 Tue 18 Aug , Albin Tonnerre wrote:
 On Mon, Aug 17, 2009 at 11:41:06PM +0200, Jean-Christophe PLAGNIOL-VILLARD 
 wrote :
   +
   +#ifndef __CONFIG_H
   +#define __CONFIG_H
   +
   +#if defined(CONFIG_tny_a9260) || defined(CONFIG_tny_a9260_nandflash) || 
   defined(CONFIG_tny_a9260_eeprom)
  too long
  and define must be upper case
 
 Those defines are generated directly from the target names in the Makfile, and
 are used for internal purposes only. Moving them to uppercase would mean
 changing the target names from tny_a9g20_nandflash to TNY_A9G20_NANDFLASH, 
 while
 the existing Calao-provided BSP uses lowercase. I'd rather not change that.
you make them uppercase before put them in the config.h

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


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-04 Thread Jean-Christophe PLAGNIOL-VILLARD
On 09:54 Mon 03 Aug , Albin Tonnerre wrote:
 On Sat, Aug 01, 2009 at 04:15:32PM +0200, Jean-Christophe PLAGNIOL-VILLARD 
 wrote :
  On 10:32 Fri 24 Jul , Albin Tonnerre wrote:
   The Calao TNY-A9260 and TNY-9G20 are boards manufactured and sold by Calao
   Systems http://www.calao-systems.com. Their components are very
   similar to the AT91SAM9260EK board, so their configuration is based on
   the configuration of this board. There are however some differences:
   different clocks, no LCD, no ethernet. They also uses SPI EEPROM to store
   the environment.
  eeprom for the env?
  why not in the same storage as u-boot
 
 Storing the environment in the NAND is also an option, as you can see in the
 board configuration.
 
  please add
  @mkdir $(obj)include
  otherwise the out of tree build will not work
???
all other at91 board do it
 
 So I guess all the other at91-based boards need fixing too ? They don't seem 
 to
 do that.
 
   + at91_serial_hw_init();
   + tny_a9260_nand_hw_init();
   + at91_spi0_hw_init(1  5 | 1  1);
  you can remove the 1  1 as the dataflash driver is deprecated now
 
 I'm not sure what you mean. There's no dataflash on this board. From what I 
 can
 see, 1  1 is required to set the PC5 pin on the B peripheral controller, and
 PC5 happens to be the chip select pin for the on-board SPI EEPROM. Am I 
 missing
 something here ?
this is for hardware chip select which we do not use as we use gpio instead

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


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-03 Thread Albin Tonnerre
On Sat, Aug 01, 2009 at 04:15:32PM +0200, Jean-Christophe PLAGNIOL-VILLARD 
wrote :
 On 10:32 Fri 24 Jul , Albin Tonnerre wrote:
  The Calao TNY-A9260 and TNY-9G20 are boards manufactured and sold by Calao
  Systems http://www.calao-systems.com. Their components are very
  similar to the AT91SAM9260EK board, so their configuration is based on
  the configuration of this board. There are however some differences:
  different clocks, no LCD, no ethernet. They also uses SPI EEPROM to store
  the environment.
 eeprom for the env?
 why not in the same storage as u-boot

Storing the environment in the NAND is also an option, as you can see in the
board configuration.

 please add
   @mkdir $(obj)include
 otherwise the out of tree build will not work

So I guess all the other at91-based boards need fixing too ? They don't seem to
do that.

  +   at91_serial_hw_init();
  +   tny_a9260_nand_hw_init();
  +   at91_spi0_hw_init(1  5 | 1  1);
 you can remove the 1  1 as the dataflash driver is deprecated now

I'm not sure what you mean. There's no dataflash on this board. From what I can
see, 1  1 is required to set the PC5 pin on the B peripheral controller, and
PC5 happens to be the chip select pin for the on-board SPI EEPROM. Am I missing
something here ?

Regards,
-- 
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards

2009-08-01 Thread Jean-Christophe PLAGNIOL-VILLARD
On 10:32 Fri 24 Jul , Albin Tonnerre wrote:
 The Calao TNY-A9260 and TNY-9G20 are boards manufactured and sold by Calao
 Systems http://www.calao-systems.com. Their components are very
 similar to the AT91SAM9260EK board, so their configuration is based on
 the configuration of this board. There are however some differences:
 different clocks, no LCD, no ethernet. They also uses SPI EEPROM to store
 the environment.
eeprom for the env?
why not in the same storage as u-boot
 The SPI chip is a STM95080, and as it's used in a number of CALAO boards
 which should be supported soon, the corresponding spi_read and spi_write
 functions have been put in drivers/spi/eeprom_m95xxx.c
 
 Signed-off-by: Albin Tonnerre albin.tonne...@free-electrons.com
 ---
 Changelog since v1:
  - Make the Makefile less verbose
  - Add error checking for the result of get_ram_size
  - Remove definition of the ROUND macro in configs/tny_a9260.h
  - Move the MAINTAINERS entry to the correct place
  - Add support for TNY-A9G20 in the process. The board is similar
to the TNY-A9260 except for the CPU, so this only adds a couple
ifdefs
  - Minor formatting changes in comments
please split in two patch one the the eeprom and one for the board
 
  MAINTAINERS  |4 +
  MAKEALL  |1 +
  Makefile |   18 
  board/calao/tny_a9260/Makefile   |   55 ++
  board/calao/tny_a9260/config.mk  |1 +
  board/calao/tny_a9260/spi.c  |   50 +
  board/calao/tny_a9260/tny_a9260.c|  110 
  cpu/arm926ejs/at91/at91sam9260_devices.c |2 +-
  drivers/spi/Makefile |1 +
  drivers/spi/eeprom_m95xxx.c  |  115 +
  include/configs/tny_a9260.h  |  165 
 ++
  11 files changed, 521 insertions(+), 1 deletions(-)
  create mode 100644 board/calao/tny_a9260/Makefile
  create mode 100644 board/calao/tny_a9260/config.mk
  create mode 100644 board/calao/tny_a9260/spi.c
  create mode 100644 board/calao/tny_a9260/tny_a9260.c
  create mode 100644 drivers/spi/eeprom_m95xxx.c
  create mode 100644 include/configs/tny_a9260.h
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 17b2f9c..54477b3 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -675,6 +675,10 @@ Andrea Scian andrea.sc...@dave-tech.it
  
   B2  ARM7TDMI (S3C44B0X)
  
 +Albin Tonnerre albin.tonne...@free-electrons.com
 +
 + tny_a9260   ARM926EJS (AT91SAM9260 SoC)
 +
  Greg Ungerer greg.unge...@opengear.com
  
   cm4008  ks8695p
 diff --git a/MAKEALL b/MAKEALL
 index d38904a..20b22a6 100755
 --- a/MAKEALL
 +++ b/MAKEALL
 @@ -602,6 +602,7 @@ LIST_at91=   \
   m501sk  \
   pm9261  \
   pm9263  \
 + tny_a9260   \
  
  
  #
 diff --git a/Makefile b/Makefile
 index 2320db6..d9a093d 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -2811,6 +2811,24 @@ at91sam9g45ekes_config :   unconfig
  pm9263_config:   unconfig
   @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
  
 +tny_a9g20_nandflash_config \
 +tny_a9g20_eeprom_config \
 +tny_a9g20_config \
 +tny_a9260_nandflash_config \
 +tny_a9260_eeprom_config \
 +tny_a9260_config :   unconfig
please add
@mkdir $(obj)include
otherwise the out of tree build will not work
 + @if [ $(findstring _nandflash,$@) ] ; then \
 + echo #define CONFIG_ENV_IS_IN_NAND
 $(obj)include/config.h ; \
 + else \
 + echo #define CONFIG_ENV_IS_IN_EEPROM  
 $(obj)include/config.h ; \
 + fi;
 + @if [ $(findstring _a9g20,$@) ] ; then \
 + echo #define CONFIG_TNY_A9G20 $(obj)include/config.h ; \
 + else \
 + echo #define CONFIG_TNY_A9260 $(obj)include/config.h ; \
 + fi;
 + @$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
 +
  
  ## ARM Integrator boards - see doc/README-integrator for more info.
  integratorap_config  \
snip
 +
 +int board_init(void)
 +{
 + /* Enable Ctrlc */
 + console_init_f();
 +
 +#if defined(CONFIG_TNY_A9260)
 + gd-bd-bi_arch_number = MACH_TYPE_TNY_A9260;
 +#elif defined(CONFIG_TNY_A9G20)
 + gd-bd-bi_arch_number = MACH_TYPE_TNY_A9G20;
 +#endif
 + /* adress of boot parameters */
 + gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
 +
 + at91_serial_hw_init();
 + tny_a9260_nand_hw_init();
 + at91_spi0_hw_init(1  5 | 1  1);
you can remove the 1  1 as the dataflash driver is deprecated now
 + return 0;
 +}
 +
 +int dram_init(void)
 +{
 + gd-bd-bi_dram[0].start = PHYS_SDRAM;
 + if(get_ram_size((long *) PHYS_SDRAM, PHYS_SDRAM_SIZE) != 
 PHYS_SDRAM_SIZE)
 + return -1;
 +
 +