All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards
Date: Sat, 1 Aug 2009 16:15:32 +0200	[thread overview]
Message-ID: <20090801141532.GC19785@game.jcrosoft.org> (raw)
In-Reply-To: <1248424321-29411-1-git-send-email-albin.tonnerre@free-electrons.com>

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.tonnerre@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.scian@dave-tech.it>
>  
>  	B2		ARM7TDMI (S3C44B0X)
>  
> +Albin Tonnerre <albin.tonnerre@free-electrons.com>
> +
> +	tny_a9260	ARM926EJS (AT91SAM9260 SoC)
> +
>  Greg Ungerer <greg.ungerer@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;
> +
> +	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
> +	return 0;
> +}
> diff --git a/cpu/arm926ejs/at91/at91sam9260_devices.c b/cpu/arm926ejs/at91/at91sam9260_devices.c
> index 5309ba2..f86cb99 100644
<qnip>
> +
> +/* 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
> +
> +#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
> +
> +/* 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
> +                            "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.

  reply	other threads:[~2009-08-01 14:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 15:53 [U-Boot] [PATCH] Support for the Calao TNY-A9260 board Albin Tonnerre
2009-07-21 17:40 ` Wolfgang Denk
2009-07-21 18:02   ` Albin Tonnerre
2009-07-22  7:33     ` Wolfgang Denk
2009-07-22  8:16       ` Albin Tonnerre
2009-07-22  9:47         ` Wolfgang Denk
2009-07-22 11:03           ` Albin Tonnerre
2009-07-22 11:13             ` Wolfgang Denk
2009-07-24  8:32   ` [U-Boot] [PATCH] Support for the Calao TNY-A9260/TNY-A9G20 boards Albin Tonnerre
2009-08-01 14:15     ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2009-08-03  7:54       ` Albin Tonnerre
2009-08-04 19:45         ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-05 17:16           ` [U-Boot] [PATCH 1/2] Add driver for the ST M95xxx SPI EEPROM Albin Tonnerre
2009-08-05 17:16             ` [U-Boot] [PATCH 2/2] Support for the Calao TNY-A9260/TNY-A9G20 boards Albin Tonnerre
2009-08-05 19:30               ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-05 19:45                 ` Albin Tonnerre
2009-08-05 19:58                   ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-07 10:37                     ` [U-Boot] [PATCH 1/2] Add driver for the ST M95xxx SPI EEPROM Albin Tonnerre
2009-08-07 10:37                       ` [U-Boot] [PATCH 2/2] Support for the Calao TNY-A9260/TNY-A9G20 boards Albin Tonnerre
2009-08-07 10:54                         ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-09 20:38                         ` Wolfgang Denk
2009-08-09 22:40                           ` Albin Tonnerre
2009-08-11 10:44                           ` [U-Boot] [PATCH] " Albin Tonnerre
2009-08-17 21:41                             ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-17 22:13                               ` Albin Tonnerre
2009-08-17 22:48                                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-18  8:26                                   ` Albin Tonnerre
2009-08-19 19:14                               ` Albin Tonnerre
2009-08-19 21:30                                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-20 13:43                                   ` Albin Tonnerre
2009-08-20 14:44                                     ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-20 14:04                                   ` [U-Boot] [PATCH v8] " Albin Tonnerre
2009-09-01 20:53                                     ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-07 10:52                       ` [U-Boot] [PATCH 1/2] Add driver for the ST M95xxx SPI EEPROM Jean-Christophe PLAGNIOL-VILLARD
2009-08-05 19:24             ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-07 10:40               ` Albin Tonnerre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090801141532.GC19785@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.