[U-Boot] [PATCH] at91: Add esd gmbh MEESC board support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Jun 29 22:01:00 CEST 2009


On 13:24 Mon 29 Jun     , Daniel Gorsulowski wrote:
> This patch adds support for esd gmbh MEESC board.
> The MEESC is based on an Atmel AT91SAM9263 SoC.
> 
> Signed-off-by: Daniel Gorsulowski <Daniel.Gorsulowski at esd.eu>
> ---
>  MAINTAINERS                 |    4 +
>  MAKEALL                     |    1 +
>  Makefile                    |    3 +
>  board/esd/meesc/Makefile    |   55 ++++++++++++
>  board/esd/meesc/config.mk   |    1 +
>  board/esd/meesc/meesc.c     |  197 +++++++++++++++++++++++++++++++++++++++++++
>  board/esd/meesc/partition.c |   37 ++++++++
>  include/configs/meesc.h     |  188 +++++++++++++++++++++++++++++++++++++++++
>  8 files changed, 486 insertions(+), 0 deletions(-)
>  create mode 100644 board/esd/meesc/Makefile
>  create mode 100644 board/esd/meesc/config.mk
>  create mode 100644 board/esd/meesc/meesc.c
>  create mode 100644 board/esd/meesc/partition.c
>  create mode 100644 include/configs/meesc.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f36a1cc..c9066a9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -530,6 +530,10 @@ Peter Figuli <peposh at etc.sk>
>  
>  	wepep250	xscale
>  
> +Daniel Gorsulowski <daniel.gorsulowski at esd.eu>
> +
> +	meesc		ARM926EJS (AT91SAM9263 SoC)
> +
>  Marius Gröger <mag at sysgo.de>
>  
>  	impa7		ARM720T (EP7211)
> diff --git a/MAKEALL b/MAKEALL
> index 063ebfc..47eb5af 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -583,6 +583,7 @@ LIST_at91="		\
>  	cmc_pu2		\
>  	csb637		\
>  	kb9202		\
> +	meesc		\
>  	mp2usb		\
>  	m501sk		\
>  	pm9261		\
> diff --git a/Makefile b/Makefile
> index 0d92d67..282b9fd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2769,6 +2769,9 @@ at91sam9rlek_config	:	unconfig
>  	fi;
>  	@$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
>  
> +meesc_config	:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm926ejs meesc esd at91
> +
>  pm9261_config	:	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9261 ronetix at91
>  
> diff --git a/board/esd/meesc/Makefile b/board/esd/meesc/Makefile
> new file mode 100644
> index 0000000..2dd6b25
> --- /dev/null
> +++ b/board/esd/meesc/Makefile
> @@ -0,0 +1,55 @@
> +#
> +# (C) Copyright 2003-2008
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# (C) Copyright 2008
> +# 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	+= $(BOARD).o
> +COBJS-$(CONFIG_HAS_DATAFLASH) += partition.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/esd/meesc/config.mk b/board/esd/meesc/config.mk
> new file mode 100644
> index 0000000..9ce161e
> --- /dev/null
> +++ b/board/esd/meesc/config.mk
> @@ -0,0 +1 @@
> +TEXT_BASE = 0x21f00000
> diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
> new file mode 100644
> index 0000000..cb567ac
> --- /dev/null
> +++ b/board/esd/meesc/meesc.c
> @@ -0,0 +1,197 @@
> +/*
> + * (C) Copyright 2007-2008
> + * Stelian Pop <stelian.pop at leadtechdesign.com>
> + * Lead Tech Design <www.leadtechdesign.com>
> + *
> + * (C) Copyright 2009
> + * Daniel Gorsulowski <daniel.gorsulowski at esd.eu>
> + * esd electronic system design gmbh <www.esd.eu>
> + *
> + * 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/at91sam9263.h>
> +#include <asm/arch/at91sam9_matrix.h>
> +#include <asm/arch/at91sam9_smc.h>
> +#include <asm/arch/at91_common.h>
> +#include <asm/arch/at91_pmc.h>
> +#include <asm/arch/at91_rstc.h>
> +#include <asm/arch/clk.h>
> +#include <asm/arch/gpio.h>
> +#include <asm/arch/hardware.h>
> +#include <asm/arch/io.h>
> +#include <netdev.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/*
> + * Miscelaneous platform dependent initialisations
> + */
> +
> +
you miss my point here
as if you can use the get_hw_rev multiple time then please do something like
thie

static int hw_rev = -1;	/* hardware revision */

int get_hw_rev(void)
{
	if (hw_rev >= 0)
		return hw_rev;

	hw_rev = at91_get_gpio_value(AT91_PIN_PB19);

	hw_rev |= at91_get_gpio_value(AT91_PIN_PB20) << 1;
	hw_rev |= at91_get_gpio_value(AT91_PIN_PB21) << 2;
	hw_rev |= at91_get_gpio_value(AT91_PIN_PB22) << 3;

	if (hw_rev == 15)
		hw_rev = 0;

	return hw_rev;
}

> +
<snip>
> +#define CONFIG_MACB				1
> +#define CONFIG_RMII				1
> +#define CONFIG_NET_MULTI			1
> +#define CONFIG_NET_RETRY_COUNT			20
> +#undef CONFIG_RESET_PHY_R
> +
> +#define CONFIG_SYS_LOAD_ADDR			0x22000000 /* load address */
> +
> +#define CONFIG_SYS_MEMTEST_START		PHYS_SDRAM
> +#define CONFIG_SYS_MEMTEST_END			0x21e00000
> +
> +#define CONFIG_SYS_USE_DATAFLASH		1
> +#undef CONFIG_SYS_USE_NANDFLASH
> +
> +#ifdef CONFIG_SYS_USE_DATAFLASH
> +
> +/* CAN */
> +#define CONFIG_CAN				1
CONFIG_AT91_CAN will be better as the code is at91 specific

Best Regards,
J.


More information about the U-Boot mailing list