Skip to contentSkip to conversation

Support for the Calao TNY-A9260 board

PATCH New Albin Tonnerre 4 participants 36 messages Jul 21, 2009 – Sep 1, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

The Calao TNY-A9260 board is a board manufactured and sold by Calao Systems <http://www.calao-systems.com>. Its components are very similar to the AT91SAM9260EK board, so its configuration is based on the configuration of this board. There are however some differences:
different clocks, no LCD, no ethernet. It also uses SPI EEPROM to store the environment.
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

---
 MAINTAINERS                              |    4 +
 MAKEALL                                  |    1 +
 Makefile                                 |   12 +++
 board/calao/tny_a9260/Makefile           |   55 ++++++++++
 board/calao/tny_a9260/config.mk          |    1 +
 board/calao/tny_a9260/spi.c              |   49 +++++++++
 board/calao/tny_a9260/tny_a9260.c        |  102 +++++++++++++++++++
 cpu/arm926ejs/at91/at91sam9260_devices.c |    2 +-
 drivers/spi/Makefile                     |    1 +
 drivers/spi/eeprom_m95xxx.c              |  114 +++++++++++++++++++++
 include/configs/tny_a9260.h              |  158 ++++++++++++++++++++++++++++++
 11 files changed, 498 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
MAINTAINERS +4 -0
index 575a7ec..1ba1921 100644
@@ -624,6 +624,10 @@ Peter Pearse <[email protected]>
 	versatile	ARM926EJ-S
 	versatile	ARM926EJ-S
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+
 Dave Peverley <[email protected]>
 
 	omap730p2	ARM926EJS
MAKEALL +1 -0
index 020ff73..59b65d2 100755
@@ -599,6 +599,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +12 -0
index 25a6254..d05abd9 100644
@@ -2807,6 +2807,18 @@ at91sam9g45ekes_config	:	unconfig
 pm9263_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
+tny_a9260_nandflash_config \
+tny_a9260_eeprom_config \
+tny_a9260_config	:	unconfig
+	@if [ "$(findstring _nandflash,$@)" ] ; then \
+		$(XECHO) "#define CONFIG_ENV_IS_IN_NAND"		>>$(obj)include/config.h ; \
+		$(XECHO) "... with environment variable in NAND FLASH" ; \
+	else \
+		$(XECHO) "#define CONFIG_ENV_IS_IN_EEPROM"	>>$(obj)include/config.h ; \
+		$(XECHO) "... with environment variable in SPI EEPROM CS1" ; \
+	fi;
+	@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
+
 ########################################################################
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config	\
board/calao/tny_a9260/Makefile new file +55 -0

55 lines not on this page · raw message

board/calao/tny_a9260/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/calao/tny_a9260/spi.c new file +49 -0

49 lines not on this page · raw message

board/calao/tny_a9260/tny_a9260.c new file +102 -0

102 lines not on this page · raw message

cpu/arm926ejs/at91/at91sam9260_devices.c +1 -1
index 5309ba2..f86cb99 100644
@@ -75,7 +75,7 @@ void at91_serial_hw_init(void)
 #endif
 }
 
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
 	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
drivers/spi/Makefile +1 -0
index a9f67a0..35c9e02 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+COBJS-$(CONFIG_M95XXX_SPI) += eeprom_m95xxx.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/spi/eeprom_m95xxx.c new file +114 -0

114 lines not on this page · raw message

include/configs/tny_a9260.h new file +158 -0

158 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

Dear Albin Tonnerre,

Quoted 14 lines · In message <1248191599-23258-1-git-send-email-albin.tonnerre@free-electrons.com…

The Calao TNY-A9260 board is a board manufactured and sold by Calao Systems <http://www.calao-systems.com>. Its components are very similar to the AT91SAM9260EK board, so its configuration is based on the configuration of this board. There are however some differences:
different clocks, no LCD, no ethernet. It also uses SPI EEPROM to store the environment.
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

MAINTAINERS +0 -0
index 575a7ec..1ba1921 100644

MAINTAINERS Peter Pearse <[email protected]> · line 633

Quoted 10 lines
MAINTAINERS +4 -0
@@ -624,6 +624,10 @@ Peter Pearse <[email protected]>
 	versatile	ARM926EJ-S
 	versatile	ARM926EJ-S
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+
 Dave Peverley <[email protected]>
 
 	omap730p2	ARM926EJS

Please keep list of names alphabetically sorted.

Quoted 21 lines
MAKEALL +1 -0
index 020ff73..59b65d2 100755
@@ -599,6 +599,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +1 -0
index 25a6254..d05abd9 100644
@@ -2807,6 +2807,18 @@ at91sam9g45ekes_config	:	unconfig
 pm9263_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
+tny_a9260_nandflash_config \

Makefile at91sam9g45ekes_config : unconfig · line 2820

Quoted 10 lines
Makefile +10 -0
+tny_a9260_eeprom_config \
+tny_a9260_config	:	unconfig
+	@if [ "$(findstring _nandflash,$@)" ] ; then \
+		$(XECHO) "#define CONFIG_ENV_IS_IN_NAND"		>>$(obj)include/config.h ; \
+		$(XECHO) "... with environment variable in NAND FLASH" ; \
+	else \
+		$(XECHO) "#define CONFIG_ENV_IS_IN_EEPROM"	>>$(obj)include/config.h ; \
+		$(XECHO) "... with environment variable in SPI EEPROM CS1" ; \
+	fi;
+	@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91

Do we need such verbosity? And is there really only a single environment variable as the message claims?

...

Makefile at91sam9g45ekes_config : unconfig

Quoted 5 lines
Makefile +5 -0
+int dram_init(void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM;
+	gd->bd->bi_dram[0].size = get_ram_size(PHYS_SDRAM, PHYS_SDRAM_SIZE);
+	return 0;

Hm... no error checking here?

...

Quoted 5 lines
include/configs/tny_a9260.h new file +0 -0
new file mode 100644
index 0000000..1dcbb97

...

Quoted 1 line

+#define ROUND(A, B) (((A) + (B)) & ~((B) - 1))

Please do not redefine.

Don't you get a warning message at least?

Best regards,

Wolfgang Denk

Signature · 5 lines
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: wd at denx.de
Documentation is the castor oil of programming.
Managers know it must be good because the programmers hate it so much.
#2 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

Quoted 9 lines · Wolfgang Denk
Quoted 9 lines

#########################################################################

Makefile +0 -0
index 25a6254..d05abd9 100644
@@ -2807,6 +2807,18 @@ at91sam9g45ekes_config	:	unconfig
 pm9263_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
Quoted 15 lines

Makefile at91sam9g45ekes_config : unconfig · line 2820

Quoted 11 lines
Makefile +11 -0
+tny_a9260_nandflash_config \
+tny_a9260_eeprom_config \
+tny_a9260_config	:	unconfig
+	@if [ "$(findstring _nandflash,$@)" ] ; then \
+		$(XECHO) "#define CONFIG_ENV_IS_IN_NAND"		>>$(obj)include/config.h ; \
+		$(XECHO) "... with environment variable in NAND FLASH" ; \
+	else \
+		$(XECHO) "#define CONFIG_ENV_IS_IN_EEPROM"	>>$(obj)include/config.h ; \
+		$(XECHO) "... with environment variable in SPI EEPROM CS1" ; \
+	fi;
+	@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91

Do we need such verbosity? And is there really only a single environment variable as the message claims?

I just copied what's currently done for a number of at91-based boards, but fair enough, I'll remove it.

Quoted 9 lines

...

Makefile

Quoted 5 lines
Makefile +5 -0
+int dram_init(void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM;
+	gd->bd->bi_dram[0].size = get_ram_size(PHYS_SDRAM, PHYS_SDRAM_SIZE);
+	return 0;

Hm... no error checking here?

Will fix, thanks

Quoted 7 lines

...

Quoted 5 lines
include/configs/tny_a9260.h new file +0 -0
new file mode 100644
index 0000000..1dcbb97

...

Quoted 5 lines
Quoted 1 line

+#define ROUND(A, B) (((A) + (B)) & ~((B) - 1))

Please do not redefine.

Don't you get a warning message at least?

ROUND doesn't seem to be defined anywhere except in include/configs, at least in the master branch. Is there another branch where ROUND is defined in some common place, so that I rebase my patch on this ?

Regards,

Signature · 11 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090721/f03e92e6/attachment.pgp 
#3 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

Dear Albin Tonnerre,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Quoted 2 lines

+++ b/include/configs/tny_a9260.h

...

Quoted 1 line

+#define ROUND(A, B) (((A) + (B)) & ~((B) - 1))

Quoted 7 lines
Quoted 3 lines

Please do not redefine.

Don't you get a warning message at least?

ROUND doesn't seem to be defined anywhere except in include/configs, at least in the master branch. Is there another branch where ROUND is defined in some common place, so that I rebase my patch on this ?

Please check again; this patch was posted last Friday:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/64071

Best regards,

Wolfgang Denk

Signature · 4 lines
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: wd at denx.de
Status quo. Latin for "the mess we're in."
#4 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

Hi Wolfgang,

Quoted 2 lines · Wolfgang Denk

Please check again; this patch was posted last Friday:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/64071

I'm not sure how to use this patch. Including <common.h> from include/configs/tny_a9260.h makes the compile fail. Am I overlooking something here ?

Regards,

Signature · 11 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090722/a84a32d3/attachment.pgp 
#5 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

Dear Albin Tonnerre,

Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 2 lines · Wolfgang Denk

Please check again; this patch was posted last Friday:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/64071

I'm not sure how to use this patch. Including <common.h> from

Just rebase your tree against current mainline.

Quoted 2 lines

include/configs/tny_a9260.h makes the compile fail. Am I overlooking something here ?

You should not have to include <common.h>; it's already included virtually everywhere.

Best regards,

Wolfgang Denk

Signature · 5 lines
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: wd at denx.de
It may be bad manners to talk with your mouth full, but it isn't  too
good either if you speak when your head is empty.
#6 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

Hi Wolfgang,

Quoted 1 line · Wolfgang Denk

Just rebase your tree against current mainline.

Ah, it's in git now, thanks.

Quoted 5 lines
Quoted 2 lines

include/configs/tny_a9260.h makes the compile fail. Am I overlooking something here ?

You should not have to include <common.h>; it's already included virtually everywhere.

cpu/arm926ejs/start.S includes directly <config.h>, which in turns includes the config file, but nowhere is common.h included, leading to

start.S:168: Error: garbage following instruction -- `sub r0,r0,#ROUND(3*0x1000+128*1024,0x1000)'

What's the best way to fix this ?

Cheers,

Signature · 11 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090722/43c46098/attachment.pgp 
#7 lore raw

PATCH 1/1 Support for the Calao TNY-A9260 board

Dear Albin Tonnerre,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 3 lines

You should not have to include <common.h>; it's already included virtually everywhere.

cpu/arm926ejs/start.S includes directly <config.h>, which in turns includes the config file, but nowhere is common.h included, leading to

start.S:168: Error: garbage following instruction -- `sub r0,r0,#ROUND(3*0x> 1000+128*1024,0x1000)'

Arghh.. Seems the mising feedback for the patch was caused by nobody actually testing it, not by nobody having any problems with it. Sorry for that.

Quoted 1 line

What's the best way to fix this ?

Hm... give me a few minutes to think about this.

Best regards,

Wolfgang Denk

Signature · 4 lines
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: wd at denx.de
How much net work could a network work, if a network could net work?
#8 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

In reply to Wolfgang Denk

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.
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

---
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

 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
MAINTAINERS +4 -0
index 17b2f9c..54477b3 100644
@@ -675,6 +675,10 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +1 -0
index d38904a..20b22a6 100755
@@ -602,6 +602,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +18 -0
index 2320db6..d9a093d 100644
@@ -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
+	@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	\
board/calao/tny_a9260/Makefile new file +55 -0

55 lines not on this page · raw message

board/calao/tny_a9260/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/calao/tny_a9260/spi.c new file +50 -0

50 lines not on this page · raw message

board/calao/tny_a9260/tny_a9260.c new file +110 -0

110 lines not on this page · raw message

cpu/arm926ejs/at91/at91sam9260_devices.c +1 -1
index 5309ba2..f86cb99 100644
@@ -75,7 +75,7 @@ void at91_serial_hw_init(void)
 #endif
 }
 
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
 	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
drivers/spi/Makefile +1 -0
index a9f67a0..35c9e02 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+COBJS-$(CONFIG_M95XXX_SPI) += eeprom_m95xxx.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/spi/eeprom_m95xxx.c new file +115 -0

115 lines not on this page · raw message

include/configs/tny_a9260.h new file +165 -0

165 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#9 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 6 lines · Albin Tonnerre

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

Quoted 5 lines

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

Quoted 10 lines

---
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

Quoted 52 lines
 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
MAINTAINERS +4 -0
index 17b2f9c..54477b3 100644
@@ -675,6 +675,10 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +1 -0
index d38904a..20b22a6 100755
@@ -602,6 +602,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +0 -0
index 2320db6..d9a093d 100644

Makefile at91sam9g45ekes_config : unconfig · line 2819

Quoted 9 lines
Makefile +6 -0
@@ -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

Quoted 15 lines
Makefile +12 -0
+	@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>

Quoted 7 lines
Makefile +7 -0
+
+int board_init(void)
+{
+	/* Enable Ctrlc */
+	console_init_f();
+
+#if defined(CONFIG_TNY_A9260)

Makefile

Quoted 10 lines
Makefile +10 -0
+	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

cpu/arm926ejs/at91/at91sam9260_devices.c

Quoted 14 lines
Makefile +12 -0
+	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;
+
+	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+	return 0;
+}
cpu/arm926ejs/at91/at91sam9260_devices.c +0 -0
index 5309ba2..f86cb99 100644

<qnip>

cpu/arm926ejs/at91/at91sam9260_devices.c

Quoted 7 lines
cpu/arm926ejs/at91/at91sam9260_devices.c +7 -0
+
+/* SPI EEPROM */
+#define CONFIG_SPI
+#define CONFIG_CMD_SPI
+#define CONFIG_ATMEL_SPI
+#define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
+#define AT91_SPI_CLK			15000000

no need please remove

Quoted 35 lines
cpu/arm926ejs/at91/at91sam9260_devices.c +35 -0
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_M95XXX_SPI
+#define CONFIG_SYS_EEPROM_SIZE 0x10000
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5
+
+/* NAND flash */
+#define CONFIG_CMD_NAND
+#define CONFIG_NAND_ATMEL
+#define CONFIG_SYS_MAX_NAND_DEVICE		1
+#define CONFIG_SYS_NAND_BASE			0x40000000
+#define CONFIG_SYS_NAND_DBW_8			1
+/* our ALE is AD21 */
+#define CONFIG_SYS_NAND_MASK_ALE		(1 << 21)
+/* our CLE is AD22 */
+#define CONFIG_SYS_NAND_MASK_CLE		(1 << 22)
+#define CONFIG_SYS_NAND_ENABLE_PIN		AT91_PIN_PC14
+#define CONFIG_SYS_NAND_READY_PIN		AT91_PIN_PC13
+
+/* NOR flash - no real flash on this board */
+#define CONFIG_SYS_NO_FLASH			1
+
+#define CONFIG_DOS_PARTITION		1
+#define CONFIG_CMD_FAT			1
+
+#define CONFIG_SYS_LOAD_ADDR			0x22000000	/* load address */
+
+#define CONFIG_SYS_MEMTEST_START		PHYS_SDRAM
+#define CONFIG_SYS_MEMTEST_END			0x23e00000
+
+/* Env in EEPROM, bootstrap + u-boot in NAND*/
+#ifdef CONFIG_ENV_IS_IN_EEPROM
+#define CONFIG_ENV_OFFSET		0x20
+#define CONFIG_ENV_SIZE		0x1000
+#endif

cpu/arm926ejs/at91/at91sam9260_devices.c

Quoted 10 lines
cpu/arm926ejs/at91/at91sam9260_devices.c +10 -0
+
+/* Env, bootstrap and u-boot in NAND */
+#ifdef CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET 0x60000
+#define CONFIG_ENV_OFFSET_REDUND 0x80000
+#define CONFIG_ENV_SIZE 0x20000
+#endif
+
+#define CONFIG_BOOTCOMMAND	"nboot 0x21000000 0 400000"
+#define CONFIG_BOOTARGS     "console=ttyS0,115200 " \

whispace please fix and so on

cpu/arm926ejs/at91/at91sam9260_devices.c

Quoted 8 lines
cpu/arm926ejs/at91/at91sam9260_devices.c +8 -0
+                            "root=/dev/mtdblock1 " \
+                            "mtdparts=atmel_nand:16M(kernel)ro," \
+                            "120M(rootfs),-(other) " \
+                            "rw rootfstype=jffs2"
+
+#define CONFIG_BAUDRATE		115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600 }
+

Best Regards,
J.

#10 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · Albin Tonnerre

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.

Quoted 3 lines

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.

Quoted 4 lines

board/calao/tny_a9260/tny_a9260.c line 98

Quoted 3 lines
board/calao/tny_a9260/tny_a9260.c new file +3 -0
+	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,

Signature · 4 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#11 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 8 lines · Albin Tonnerre
Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · Albin Tonnerre

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.

Quoted 9 lines
Quoted 2 lines

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.

Quoted 3 lines

please add

	@mkdir $(obj)include

otherwise the out of tree build will not work

???
all other at91 board do it

Quoted 9 lines

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

Quoted 4 lines

board/calao/tny_a9260/tny_a9260.c line 98

Quoted 3 lines
board/calao/tny_a9260/tny_a9260.c new file +3 -0
+	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

Quoted 4 lines

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.

#12 lore raw

PATCH 1/2 Add driver for the ST M95xxx SPI EEPROM

This chip is used in a number of boards manufactured by Calao-Systems which should be supported soon. This driver provides the necessary spi_read and spi_write functions necessary to communicate with the chip.

---
 drivers/spi/Makefile        |    1 +
 drivers/spi/eeprom_m95xxx.c |  115 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 116 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/eeprom_m95xxx.c
drivers/spi/Makefile +1 -0
index a9f67a0..35c9e02 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+COBJS-$(CONFIG_M95XXX_SPI) += eeprom_m95xxx.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/spi/eeprom_m95xxx.c new file +115 -0

115 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#13 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

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.

---
 MAINTAINERS                              |    4 +
 MAKEALL                                  |    1 +
 Makefile                                 |   19 ++++
 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              |  164 ++++++++++++++++++++++++++++++
 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
MAINTAINERS +4 -0
index 620604c..79873f3 100644
@@ -681,6 +681,10 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +1 -0
index dd0b761..7a583df 100755
@@ -607,6 +607,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +19 -0
index 8096f91..f3e7aa3 100644
@@ -2838,6 +2838,25 @@ 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
+	@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	\
board/calao/tny_a9260/Makefile new file +55 -0

55 lines not on this page · raw message

board/calao/tny_a9260/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/calao/tny_a9260/spi.c new file +50 -0

50 lines not on this page · raw message

board/calao/tny_a9260/tny_a9260.c new file +110 -0

110 lines not on this page · raw message

cpu/arm926ejs/at91/at91sam9260_devices.c +1 -1
index 5309ba2..f86cb99 100644
@@ -75,7 +75,7 @@ void at91_serial_hw_init(void)
 #endif
 }
 
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
 	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
include/configs/tny_a9260.h new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#14 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

Some general comment
please add space before and after '*' & co
and the ligne length limit in 80 chars

include/configs/tny_a9260.h line 140

Quoted 13 lines
include/configs/tny_a9260.h new file +13 -0
+/* Env, bootstrap and u-boot in NAND */
+#ifdef CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET 0x60000
+#define CONFIG_ENV_OFFSET_REDUND 0x80000
+#define CONFIG_ENV_SIZE 0x20000
+#endif
+
+#define CONFIG_BOOTCOMMAND	"nboot 0x21000000 0 400000"
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+							"root=/dev/mtdblock1 " \
+							"mtdparts=atmel_nand:16M(kernel)ro," \
+							"120M(rootfs),-(other) " \
+							"rw rootfstype=jffs2"

here as example

Quoted 8 lines
include/configs/tny_a9260.h new file +8 -0
+
+#define CONFIG_BAUDRATE		115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600 }
+
+#define CONFIG_SYS_PROMPT		"U-Boot> "
+#define CONFIG_SYS_CBSIZE		256
+#define CONFIG_SYS_MAXARGS		16
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)

include/configs/tny_a9260.h line 158

Quoted 10 lines
include/configs/tny_a9260.h new file +10 -0
+#define CONFIG_SYS_LONGHELP		1
+#define CONFIG_CMDLINE_EDITING	1
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
+#define CONFIG_SYS_GBL_DATA_SIZE	128	/* 128 bytes for initial data */
+
+#define CONFIG_STACKSIZE	(32*1024)	/* regular stack */

here too etc..

include/configs/tny_a9260.h line 162

Quoted 4 lines
include/configs/tny_a9260.h new file +4 -0
+
+#ifdef CONFIG_USE_IRQ
+#error CONFIG_USE_IRQ not supported
+#endif

Best Regards,
J.

#15 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD

Some general comment
please add space before and after '*' & co
and the ligne length limit in 80 chars

Fine. Please note that you could have pointed this out earlier, though. That would have saved both of us some time.

Regards,

Signature · 4 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#16 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 7 lines · Albin Tonnerre
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD

Some general comment
please add space before and after '*' & co
and the ligne length limit in 80 chars

Fine. Please note that you could have pointed this out earlier, though. That would have saved both of us some time.

this part was updated between the 2 versions of the patch so I put a comment

if you have one line which is a few more than 80 chars ok but now you increase it's number so I notice you about it

otherwise the patch is clean

Best Regards,
J.

#17 lore raw

PATCH 1/2 Add driver for the ST M95xxx SPI EEPROM

This chip is used in a number of boards manufactured by Calao-Systems which should be supported soon. This driver provides the necessary spi_read and spi_write functions necessary to communicate with the chip.

---
 drivers/mtd/spi/Makefile        |    1 +
 drivers/mtd/spi/eeprom_m95xxx.c |  117 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 118 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/eeprom_m95xxx.c
drivers/mtd/spi/Makefile +1 -0
index 27dcbff..e3e0292 100644
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_SPI_FLASH_MACRONIX)	+= macronix.o
 COBJS-$(CONFIG_SPI_FLASH_SPANSION)	+= spansion.o
 COBJS-$(CONFIG_SPI_FLASH_SST)	+= sst.o
 COBJS-$(CONFIG_SPI_FLASH_STMICRO)	+= stmicro.o
+COBJS-$(CONFIG_SPI_M95XXX) += eeprom_m95xxx.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/mtd/spi/eeprom_m95xxx.c new file +117 -0

117 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#18 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

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.

---
 MAINTAINERS                              |    4 +
 MAKEALL                                  |    1 +
 Makefile                                 |   19 ++++
 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              |  164 ++++++++++++++++++++++++++++++
 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
MAINTAINERS +4 -0
index 620604c..79873f3 100644
@@ -681,6 +681,10 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +1 -0
index dd0b761..7a583df 100755
@@ -607,6 +607,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +19 -0
index 8096f91..f3e7aa3 100644
@@ -2838,6 +2838,25 @@ 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
+	@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	\
board/calao/tny_a9260/Makefile new file +55 -0

55 lines not on this page · raw message

board/calao/tny_a9260/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/calao/tny_a9260/spi.c new file +50 -0

50 lines not on this page · raw message

board/calao/tny_a9260/tny_a9260.c new file +110 -0

110 lines not on this page · raw message

cpu/arm926ejs/at91/at91sam9260_devices.c +1 -1
index 5309ba2..f86cb99 100644
@@ -75,7 +75,7 @@ void at91_serial_hw_init(void)
 #endif
 }
 
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
 	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
include/configs/tny_a9260.h new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#19 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 8 lines · Albin Tonnerre

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.

Quoted 17 lines
---
 MAINTAINERS                              |    4 +
 MAKEALL                                  |    1 +
 Makefile                                 |   19 ++++
 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              |  164 ++++++++++++++++++++++++++++++
 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

Best Regards,
J.

#20 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

In reply to Albin Tonnerre

Dear Albin Tonnerre,

Quoted 6 lines · In message <1249641457-16887-2-git-send-email-albin.tonnerre@free-electrons.com…

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.

...

Quoted 14 lines
Makefile +8 -0
@@ -2838,6 +2838,25 @@ 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
+	@if [ "$(findstring _nandflash,$@)" ] ; then \

Makefile at91sam9g45ekes_config : unconfig · line 2858

Quoted 10 lines
Makefile +10 -0
+		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

Please do not add such scripting to the top level Makefile. Perform it in your board config file instead.

For an example, please see
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/65499

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
A father doesn't destroy his children.
	-- Lt. Carolyn Palamas, "Who Mourns for Adonais?",
	   stardate 3468.1.
#21 lore raw

PATCH 2/2 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 1 line · Wolfgang Denk

Dear Albin Tonnerre,

Hi Wolfgang,

Quoted 23 lines
Quoted 8 lines · In message <1249641457-16887-2-git-send-email-albin.tonnerre@free-electrons.com…
Makefile +8 -0
+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
+	@if [ "$(findstring _nandflash,$@)" ] ; then \

Makefile at91sam9g45ekes_config : unconfig · line 2858

Quoted 10 lines
Makefile +10 -0
+		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

Please do not add such scripting to the top level Makefile. Perform it in your board config file instead.

Quoted 2 lines

For an example, please see
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/65499

Thanks for the pointer. As the patch is already part of Jean-Christophe's ARM pull request, do you mind if I provide a patch on top of the current one to fix the issue, or do you want me to resubmit the whole patch ?

Regards,

Signature · 4 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#22 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

In reply to Wolfgang Denk

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.

---

Changes since previous patch:
As per Wolfgang's comments, remove the scripting from the Makefile and do that in the board config instead.

 MAINTAINERS                              |    4 +
 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              |  170 ++++++++++++++++++++++++++++++
 9 files changed, 402 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
MAINTAINERS +4 -0
index 620604c..79873f3 100644
@@ -681,6 +681,10 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +1 -0
index edebaea..5882ceb 100755
@@ -607,6 +607,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +10 -0
index 54c0b67..55e9ccd 100644
@@ -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
+	@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
+
 ########################################################################
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config	\
board/calao/tny_a9260/Makefile new file +55 -0

55 lines not on this page · raw message

board/calao/tny_a9260/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/calao/tny_a9260/spi.c new file +50 -0

50 lines not on this page · raw message

board/calao/tny_a9260/tny_a9260.c new file +110 -0

110 lines not on this page · raw message

cpu/arm926ejs/at91/at91sam9260_devices.c +1 -1
index 5309ba2..f86cb99 100644
@@ -75,7 +75,7 @@ void at91_serial_hw_init(void)
 #endif
 }
 
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
 	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
include/configs/tny_a9260.h new file +170 -0

170 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#23 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

include/configs/tny_a9260.h line 33

Quoted 5 lines
include/configs/tny_a9260.h new file +5 -0
+
+#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

include/configs/tny_a9260.h line 36

Quoted 3 lines
include/configs/tny_a9260.h new file +3 -0
+#define CONFIG_TNY_A9260
+#define CONFIG_AT91SAM9260
+#elif defined(CONFIG_tny_a9g20) || defined(CONFIG_tny_a9g20_nandflash) || defined(CONFIG_tny_a9g20_eeprom)

ditto

include/configs/tny_a9260.h line 48

Quoted 12 lines
include/configs/tny_a9260.h new file +12 -0
+#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.

#24 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD

include/configs/tny_a9260.h line 33

Quoted 5 lines
include/configs/tny_a9260.h new file +5 -0
+
+#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,

Signature · 11 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090818/0a1f3060/attachment.pgp 
#25 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 9 lines · Albin Tonnerre
Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD

include/configs/tny_a9260.h line 33

Quoted 5 lines
include/configs/tny_a9260.h new file +5 -0
+
+#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

Quoted 4 lines

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.

#26 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Albin Tonnerre
Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD

include/configs/tny_a9260.h line 33

Quoted 5 lines
include/configs/tny_a9260.h new file +5 -0
+
+#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

Quoted 5 lines
Quoted 4 lines

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,

Signature · 11 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090818/c5c33807/attachment.pgp 
#27 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

In reply to Jean-Christophe PLAGNIOL-VILLARD

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.

---
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
MAINTAINERS +5 -0
index 620604c..91e2c7f 100644
@@ -681,6 +681,11 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+	tny_a9g20	ARM926EJS (AT91SAM9G20 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +1 -0
index edebaea..5882ceb 100755
@@ -607,6 +607,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\
 "
 
 #########################################################################
Makefile +10 -0
index 329e0f5..2abaeeb 100644
@@ -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
+	@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
+
 ########################################################################
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config	\
board/calao/tny_a9260/Makefile new file +55 -0

55 lines not on this page · raw message

board/calao/tny_a9260/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/calao/tny_a9260/spi.c new file +50 -0

50 lines not on this page · raw message

board/calao/tny_a9260/tny_a9260.c new file +110 -0

110 lines not on this page · raw message

cpu/arm926ejs/at91/at91sam9260_devices.c +1 -1
index 5309ba2..f86cb99 100644
@@ -75,7 +75,7 @@ void at91_serial_hw_init(void)
 #endif
 }
 
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
 	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
include/configs/tny_a9260.h new file +172 -0

172 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#28 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 9 lines · Albin Tonnerre

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.

---

please put the version in the subject to known which one is the last

Quoted 44 lines

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
MAINTAINERS +5 -0
index 620604c..91e2c7f 100644
@@ -681,6 +681,11 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+	tny_a9g20	ARM926EJS (AT91SAM9G20 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +0 -0
index edebaea..5882ceb 100755

MAKEALL LIST_at91=" \ · line 610

Quoted 4 lines
MAKEALL +1 -0
@@ -607,6 +607,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\

why not 9g20 too?

Quoted 9 lines
MAKEALL +0 -0
 "
 
 #########################################################################
Makefile +0 -0
index 329e0f5..2abaeeb 100644
@@ -2838,6 +2838,16 @@ at91sam9g45ekes_config	:	unconfig
 pm9263_config	:	unconfig

Makefile at91sam9g45ekes_config : unconfig · line 2848

Quoted 10 lines
Makefile +8 -0
 	@$(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

Makefile at91sam9g45ekes_config : unconfig · line 2850

Quoted 2 lines
Makefile +2 -0
+	@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
+

Best Regards,
J.

#29 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD

MAKEALL LIST_at91=" \ · line 610

Quoted 9 lines · Albin Tonnerre
MAKEALL +1 -0
index edebaea..5882ceb 100755
@@ -607,6 +607,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\

why not 9g20 too?

Oops. Thanks.

Quoted 18 lines
Quoted 7 lines
MAKEALL +0 -0
 #########################################################################
Makefile +0 -0
index 329e0f5..2abaeeb 100644
@@ -2838,6 +2838,16 @@ at91sam9g45ekes_config	:	unconfig
 pm9263_config	:	unconfig

Makefile at91sam9g45ekes_config : unconfig · line 2848

Quoted 10 lines
Makefile +8 -0
 	@$(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

Quoted 2 lines
	@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,

Signature · 11 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090820/cdbc4a08/attachment.pgp 
#30 lore raw

PATCH 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 36 lines · Albin Tonnerre
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD

MAKEALL LIST_at91=" \ · line 610

Quoted 9 lines · Albin Tonnerre
MAKEALL +1 -0
index edebaea..5882ceb 100755
@@ -607,6 +607,7 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	tny_a9260	\

why not 9g20 too?

Oops. Thanks.

Quoted 18 lines
Quoted 7 lines
MAKEALL +0 -0
 #########################################################################
Makefile +0 -0
index 329e0f5..2abaeeb 100644
@@ -2838,6 +2838,16 @@ at91sam9g45ekes_config	:	unconfig
 pm9263_config	:	unconfig

Makefile at91sam9g45ekes_config : unconfig · line 2848

Quoted 10 lines
Makefile +8 -0
 	@$(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

Quoted 2 lines
	@echo -n "#define " >$(obj)include/config.h
	@echo    "$(@:_config=)" | tr [a-z] [A-Z] >> $(obj)include/config.h
Quoted 2 lines

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.

#31 lore raw

PATCH v8 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

In reply to Jean-Christophe PLAGNIOL-VILLARD

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.

---
Changes in v7:
- 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

Changes in v8:
- Update MAKEALL to reflect the changes in Makefile, and add the tny_a9g20

 MAINTAINERS                              |    5 +
 MAKEALL                                  |    2 +
 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, 406 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
MAINTAINERS +5 -0
index 620604c..91e2c7f 100644
@@ -681,6 +681,11 @@ Andrea Scian <[email protected]>
 
 	B2		ARM7TDMI (S3C44B0X)
 
+Albin Tonnerre <[email protected]>
+
+	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
+	tny_a9g20	ARM926EJS (AT91SAM9G20 SoC)
+
 Greg Ungerer <[email protected]>
 
 	cm4008		ks8695p
MAKEALL +2 -0
index edebaea..accb3bc 100755
@@ -607,6 +607,8 @@ LIST_at91="			\
 	m501sk			\
 	pm9261			\
 	pm9263			\
+	TNY_A9260	\
+	TNY_A9G20	\
 "
 
 #########################################################################
Makefile +10 -0
index 329e0f5..2abaeeb 100644
@@ -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
+	@$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91
+
 ########################################################################
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config	\
board/calao/tny_a9260/Makefile new file +55 -0

55 lines not on this page · raw message

board/calao/tny_a9260/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/calao/tny_a9260/spi.c new file +50 -0

50 lines not on this page · raw message

board/calao/tny_a9260/tny_a9260.c new file +110 -0

110 lines not on this page · raw message

cpu/arm926ejs/at91/at91sam9260_devices.c +1 -1
index 5309ba2..f86cb99 100644
@@ -75,7 +75,7 @@ void at91_serial_hw_init(void)
 #endif
 }
 
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
 	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
include/configs/tny_a9260.h new file +172 -0

172 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#32 lore raw

PATCH v8 1/1 Support for the Calao TNY-A9260/TNY-A9G20 boards

Quoted 19 lines · Albin Tonnerre

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.

---
Changes in v7:
- 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

Changes in v8:
- Update MAKEALL to reflect the changes in Makefile, and add the tny_a9g20

Quoted 16 lines
 MAINTAINERS                              |    5 +
 MAKEALL                                  |    2 +
 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, 406 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

applied to u-boot-arm

but merged manually

please next time when you add different board does it as a patch series to avoid the manual merge

Best Regards,
J.

#33 lore raw

PATCH 1/2 Add driver for the ST M95xxx SPI EEPROM

In reply to Albin Tonnerre
Quoted 10 lines · Albin Tonnerre

This chip is used in a number of boards manufactured by Calao-Systems which should be supported soon. This driver provides the necessary spi_read and spi_write functions necessary to communicate with the chip.

---
 drivers/mtd/spi/Makefile        |    1 +
 drivers/mtd/spi/eeprom_m95xxx.c |  117 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 118 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/eeprom_m95xxx.c

looks fine

Best Regards,
J.

#34 lore raw

PATCH 1/2 Add driver for the ST M95xxx SPI EEPROM

In reply to Albin Tonnerre
Quoted 8 lines · Albin Tonnerre

This chip is used in a number of boards manufactured by Calao-Systems which should be supported soon. This driver provides the necessary spi_read and spi_write functions necessary to communicate with the chip.

---
 drivers/spi/Makefile        |    1 +
 drivers/spi/eeprom_m95xxx.c |  115 +++++++++++++++++++++++++++++++++++++++++++

not sure it's the right place
drivers mtd will better IMHO
as in drivers/spi it will more for spi host drivers and not eeprom

Quoted 65 lines
 2 files changed, 116 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/eeprom_m95xxx.c
drivers/spi/Makefile +1 -0
index a9f67a0..35c9e02 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
+COBJS-$(CONFIG_M95XXX_SPI) += eeprom_m95xxx.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/spi/eeprom_m95xxx.c new file +44 -0
new file mode 100644
index 0000000..9298c9f
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2009
+ * Albin Tonnerre, Free Electrons <[email protected]>
+ *
+ * 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 <spi.h>
+
+#define SPI_EEPROM_WREN		0x06
+#define SPI_EEPROM_RDSR		0x05
+#define SPI_EEPROM_READ		0x03
+#define SPI_EEPROM_WRITE	0x02
+
+#ifndef CONFIG_DEFAULT_SPI_BUS
+#define CONFIG_DEFAULT_SPI_BUS 0
+#endif
+
+#ifndef CONFIG_DEFAULT_SPI_MODE
+#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
+#endif
+
+ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int len)
+{
+	struct spi_slave *slave;
+	u8 cmd = SPI_EEPROM_READ;
+

drivers/spi/eeprom_m95xxx.c line 54

Quoted 10 lines
drivers/spi/eeprom_m95xxx.c new file +10 -0
+	slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
+			CONFIG_DEFAULT_SPI_MODE);
+	spi_claim_bus(slave);
+
+	/* command */
+	if(spi_xfer(slave, 8, &cmd, NULL, SPI_XFER_BEGIN))
+		return -1;
+
+	/* if alen == 3, addr[0] is the block number, we never use it here. All we
+	 * need are the lower 16 bits*/

please use the syle of comment
/*
*
*/

drivers/spi/eeprom_m95xxx.c line 61

Quoted 7 lines
drivers/spi/eeprom_m95xxx.c new file +7 -0
+	if (alen == 3)
+		addr++;
+
+	/* address, and data */
+	if(spi_xfer(slave, 16, addr, NULL, 0))
+		return -1;
+	if(spi_xfer(slave, 8*len, NULL, buffer, SPI_XFER_END))

please add a space before and after the '*'

Quoted 20 lines
drivers/spi/eeprom_m95xxx.c new file +20 -0
+		return -1;
+
+	spi_release_bus(slave);
+	spi_free_slave(slave);
+	return len;
+}
+
+ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
+{
+	struct spi_slave *slave;
+	int i;
+	char buf[3];
+
+	slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
+			CONFIG_DEFAULT_SPI_MODE);
+	spi_claim_bus(slave);
+
+	buf[0] = SPI_EEPROM_WREN;
+	if(spi_xfer(slave, 8, buf, NULL, SPI_XFER_BEGIN | SPI_XFER_END))
+		return -1;

drivers/spi/eeprom_m95xxx.c line 91

Quoted 10 lines
drivers/spi/eeprom_m95xxx.c new file +10 -0
+
+	buf[0] = SPI_EEPROM_WRITE;
+
+	/* As for reading, drop addr[0] if alen is 3 */
+	if (alen == 3) {
+		alen--;
+		addr++;
+	}
+
+	memcpy(buf+1, addr, alen);

please add a space before and after the '+'

drivers/spi/eeprom_m95xxx.c line 95

Quoted 4 lines
drivers/spi/eeprom_m95xxx.c new file +4 -0
+	/* command + addr, then data */
+	if(spi_xfer(slave, 24, buf, NULL, SPI_XFER_BEGIN))
+		return -1;
+	if(spi_xfer(slave, len*8, buffer, NULL, SPI_XFER_END))

please add a space before and after the '*'

drivers/spi/eeprom_m95xxx.c line 98

Quoted 3 lines
drivers/spi/eeprom_m95xxx.c new file +3 -0
+		return -1;
+
+	for (i = 0; i < 1000; i++) {

why 1000?

drivers/spi/eeprom_m95xxx.c line 102

Quoted 4 lines
drivers/spi/eeprom_m95xxx.c new file +4 -0
+		buf[0] = SPI_EEPROM_RDSR;
+		buf[1] = 0;
+		spi_xfer(slave, 16, buf, buf, SPI_XFER_BEGIN | SPI_XFER_END);
+

Best Regards,
J.

#35 lore raw

PATCH 1/2 Add driver for the ST M95xxx SPI EEPROM

Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD

drivers/spi/eeprom_m95xxx.c line 98

Quoted 1 line · Albin Tonnerre
drivers/spi/eeprom_m95xxx.c new file +1 -0
+	for (i = 0; i < 1000; i++) {

why 1000?

Oh, true. I meant to fix that and replace it with something similar to what atmel_dataflash does, ie using CONFIG_SYS_SPI_WRITE_TOUT. Updated in the patch I re-submitted.

Regards,

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