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

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Oct 31 08:05:38 CET 2008


On 21:03 Mon 06 Oct     , Cristian Birsan wrote:
> Added support for the Olimex SAM9-L9260 development board.
> This patch is based on u-boot v1.3.4.
> 
> Tested with data flash only (not with NAND).
> 
> Signed-off-by: Cristian Birsan <cristian.birsan at gmail.com>
> ---
>   MAKEALL                            |    1 +
>   Makefile                           |   21 ++--
>   board/olimex/sam9l9260/Makefile    |   59 ++++++++
>   board/olimex/sam9l9260/config.mk   |    1 +
>   board/olimex/sam9l9260/led.c       |   64 +++++++++
>   board/olimex/sam9l9260/nand.c      |   78 +++++++++++
>   board/olimex/sam9l9260/partition.c |   39 ++++++
>   board/olimex/sam9l9260/sam9l9260.c |  264 ++++++++++++++++++++++++++++++++++++
>   drivers/mtd/nand/nand_ids.c        |    2 +
>   include/configs/sam9l9260.h        |  212 +++++++++++++++++++++++++++++
>   10 files changed, 732 insertions(+), 9 deletions(-)
>   create mode 100644 board/olimex/sam9l9260/Makefile
>   create mode 100644 board/olimex/sam9l9260/config.mk
>   create mode 100644 board/olimex/sam9l9260/led.c
>   create mode 100644 board/olimex/sam9l9260/nand.c
>   create mode 100644 board/olimex/sam9l9260/partition.c
>   create mode 100644 board/olimex/sam9l9260/sam9l9260.c
>   create mode 100644 include/configs/sam9l9260.h
> 
> diff --git a/MAKEALL b/MAKEALL
> index 9ccb9ac..0e2cb36 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -542,6 +542,7 @@ LIST_at91="		\
>   	kb9202		\
>   	mp2usb		\
>   	m501sk		\
> +	sam9l9260	\
>   "
> 
>   #########################################################################
> diff --git a/Makefile b/Makefile
> index 7c13ce8..5b0acae 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2487,15 +2487,6 @@ shannon_config	:	unconfig
>   at91rm9200dk_config	:	unconfig
>   	@$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200
> 
> -at91sam9261ek_config	:	unconfig
> -	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
> -
> -at91sam9263ek_config	:	unconfig
> -	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
> -
> -at91sam9rlek_config	:	unconfig
> -	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
> -
>   cmc_pu2_config	:	unconfig
>   	@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
> 
> @@ -2521,6 +2512,18 @@ at91cap9adk_config	:	unconfig
>   at91sam9260ek_config	:	unconfig
>   	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91
> 
> +at91sam9261ek_config	:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
> +
> +at91sam9263ek_config	:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
> +
> +at91sam9rlek_config	:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
> +
> +sam9l9260_config	:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm926ejs sam9l9260 olimex at91
> +
why do you touch other at91 config?
>   ########################################################################
>   ## ARM Integrator boards - see doc/README-integrator for more info.
>   integratorap_config	\
> diff --git a/board/olimex/sam9l9260/Makefile b/board/olimex/sam9l9260/Makefile
> new file mode 100644
> index 0000000..8853b7c
> --- /dev/null
> +++ b/board/olimex/sam9l9260/Makefile
> @@ -0,0 +1,59 @@
> +#
> +# (C) Copyright 2003-2008
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# (C) Copyright 2008
> +#
> +# Cristian Birsan <cristian.birsan at gmail.com> based on the work of
> +# Stelian Pop <stelian.pop at leadtechdesign.com>
> +# Lead Tech Design <www.leadtechdesign.com>
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB	= $(obj)lib$(BOARD).a
> +
> +COBJS-y	+= sam9l9260.o
> +COBJS-y	+= led.o
> +COBJS-y	+= partition.o
> +COBJS-$(CONFIG_CMD_NAND) += nand.o
> +
> +SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS-y))
> +SOBJS	:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
> +	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
> +
> +clean:
> +	rm -f $(SOBJS) $(OBJS)
> +
> +distclean:	clean
> +	rm -f $(LIB) core *.bak $(obj).depend
> +
> +#########################################################################
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/olimex/sam9l9260/config.mk b/board/olimex/sam9l9260/config.mk
> new file mode 100644
> +
> +	return 0;
> +}
> diff --git a/board/olimex/sam9l9260/partition.c b/board/olimex/sam9l9260/partition.c
> new file mode 100644
> index 0000000..b29c29a
> --- /dev/null
> +++ b/board/olimex/sam9l9260/partition.c
> @@ -0,0 +1,39 @@
> +/*
> + * (C) Copyright 2008
> + * Ulf Samuelsson <ulf at atmel.com>
> + *
> + * 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 <config.h>
> +#include <asm/hardware.h>
> +#include <dataflash.h>
> +
> +AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
> +
> +struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
> +	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
> +	{CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
> +};
> +
> +/*define the area offsets*/
> +dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
> +	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
                                                  ^^^
whitespace please fix
> +	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
> +	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
                                                  ^^^
whitespace please fix
> +	{0x00042000, 0x0020FFFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
> +};
> diff --git a/board/olimex/sam9l9260/sam9l9260.c b/board/olimex/sam9l9260/sam9l9260.c
> new file mode 100644
> index 0000000..15578d1
> --- /dev/null
> +++ b/board/olimex/sam9l9260/sam9l9260.c
> @@ -0,0 +1,264 @@
> +/*
> + * (C) Copyright 2007-2008
> + *
> + * Cristian Birsan <cristian.birsan at gmail.com> based on the work of
> + * Stelian Pop <stelian.pop at leadtechdesign.com>
> + * Lead Tech Design <www.leadtechdesign.com>
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <common.h>
> +#include <asm/arch/at91sam9260.h>
> +#include <asm/arch/at91sam9260_matrix.h>
> +#include <asm/arch/at91sam9_smc.h>
> +#include <asm/arch/at91_pmc.h>
> +#include <asm/arch/at91_rstc.h>
> +#include <asm/arch/gpio.h>
> +#include <asm/arch/io.h>
> +#include <asm/arch/hardware.h>
> +#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
> +
> +	return 0;
> +}
> +
> +int dram_init(void)
> +{
> +	gd->bd->bi_dram[0].start = PHYS_SDRAM;
> +	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
> +	return 0;
> +}
> +
> +#ifdef CONFIG_RESET_PHY_R
> +void reset_phy(void)
> +{
> +#ifdef CONFIG_MACB
> +	/*
> +	 * Initialize ethernet HW addr prior to starting Linux,
> +	 * needed for nfsroot
> +	 */
> +	eth_init(gd->bd);
> +#endif
> +}
> +#endif
> +
> +int board_eth_init(bd_t *bis)
> +{
> +	int rc = 0;
> +#ifdef CONFIG_MACB
> +	/* The default address for the KS8721BL PHY is 0x01 */
> +	rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x01);
> +#endif
> +	return rc;
> +}
> diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
> index 2ff75c9..ec2ac55 100644
> --- a/drivers/mtd/nand/nand_ids.c
> +++ b/drivers/mtd/nand/nand_ids.c
> @@ -69,6 +69,8 @@ struct nand_flash_dev nand_flash_ids[] = {
> 
>   	{"NAND 256MiB 3,3V 8-bit",	0x71, 512, 256, 0x4000, 0},
> 
> +	{"NAND 512MiB 3,3V 8-bit",      0xDC, 512, 512, 0x4000, 0},
                                  ^^^
whitespace please fix
> +
>   	/*
>   	 * These are the new chips with large page size. The pagesize and the
>   	 * erasesize is determined from the extended id bytes
> diff --git a/include/configs/sam9l9260.h b/include/configs/sam9l9260.h
> new file mode 100644
> index 0000000..90089b0
> --- /dev/null
> +++ b/include/configs/sam9l9260.h
> @@ -0,0 +1,212 @@
> +/*
> + * (C) Copyright 2007-2008
> + *
> + * Cristian Birsan <cristian.birsan at gmail.com> based on the work of
> + * Stelian Pop <stelian.pop at leadtechdesign.com>
> + * Lead Tech Design <www.leadtechdesign.com>
> + *
> + * Configuration settings for the SAM9-L9260 board.
> + *
> + * 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
> + */
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +/* Hostname */
> +#define	CONFIG_HOSTNAME			sam9l9260
> +
> +/* ARM asynchronous clock */
> +#define AT91_MAIN_CLOCK		198656000	/* from 18.432 MHz crystal */
> +#define AT91_MASTER_CLOCK	99328000	/* peripheral = main / 2 */
> +#define CFG_HZ			1000000		/* 1us resolution */
please update to CONFIG_SYS_

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

Best Regards,
J.


More information about the U-Boot mailing list