[U-Boot] [PATCH v3 3/3] A320: Add support for Faraday A320 evaluation board

Wolfgang Denk wd at denx.de
Thu Jul 9 00:19:13 CEST 2009


Dear Po-Yu Chuang,

In message <ec1aee9f0907012311t2669fe70r8b606c54a4d0b8c6 at mail.gmail.com> you wrote:
> This patch adds support for A320 development board from Faraday. This board
> uses FA526 processor by default and has 512kB and 32MB NOR flash, 64M RAM.
> FA526 is an ARMv4 processor and uses the ARM920T source in this patch.
...
...
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -680,6 +680,10 @@ Sergey Lapin <slapin at ossfans.org>
> 
>  	afeb9260	ARM926EJS (AT91SAM9260 SoC)
> 
> +Po-Yu Chuang <ratbert at faraday-tech.com>
> +
> +	a320		FA526 (ARMv4/reuse arm920t source) faraday SoC

Please keep list of maintainers alphabetically sorted.

> --- a/Makefile
> +++ b/Makefile
> @@ -2991,6 +2991,13 @@ B2_config	:	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm s3c44b0 B2 dave
> 
>  #########################################################################
> +## Faraday A320 Systems
> +#########################################################################

We don't add such big headers for all vendors.

> +a320_config	:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm920t a320 faraday faraday

This is a arm920t processor, so please add it in "ARM720T Systems"
section.

> +#########################################################################
>  ## ARM720T Systems
>  #########################################################################


> diff --git a/board/faraday/a320/a320.c b/board/faraday/a320/a320.c
> new file mode 100644
> index 0000000..f9cca4f
> --- /dev/null
> +++ b/board/faraday/a320/a320.c
> @@ -0,0 +1,64 @@
> +/*
> + * (C) Copyright 2009 Faraday Technology
> + * Po-Yu Chuang <ratbert at faraday-tech.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., 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +#include <common.h>
> +#include <netdev.h>
> +#include <rtc.h>
> +#include <asm/io.h>
> +
> +#include <asm/arch/ftsmc020.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/*
> + * Miscellaneous platform dependent initialisations
> + */
> +
> +int board_init (void)
> +{
> +	gd->bd->bi_arch_number = MACH_TYPE_FARADAY;
> +
> +	ftsmc020_init ();	/* initialize Flash */
> +	rtc_reset ();		/* enable RTC */
> +	return 0;
> +}
> +
> +int dram_init (void)
> +{
> +	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> +	gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
> +
> +	return 0;
> +}

Would it be possible to use get_ram_size() for auto-sizing and memory
testing?

> diff --git a/board/faraday/a320/lowlevel_init.S
> b/board/faraday/a320/lowlevel_init.S
> new file mode 100644
> index 0000000..2adb9ef
> --- /dev/null
> +++ b/board/faraday/a320/lowlevel_init.S
...
> +.globl lowlevel_init
> +lowlevel_init:
> +	mov	r11, lr
> +
> +	led	0x0
> +
> +	/* if REMAP bit is set -> memory had been initialzed */
> +
> +	ldr	r0, =CONFIG_SYS_AHBC_BASE
> +	ldr	r1, [r0, #FTAHBC020_OFFSET_ICR]
> +	tst	r1, #FTAHBC020_ICR_REMAP		@ test REMAP bit
> +	bne	skip_remap
> +
> +	led	0x1
> +
> +	bl	init_sdmc
> +
> +	led	0x2
> +
> +	/*
> +	 * copy U-Boot to RAM
> +	 */
> +copy_code:
> +	ldr	r0, =ROM_DEFAULT_BASE	/* r0 <- source address     */
> +	ldr	r1, =SDRAM_DEFAULT_BASE	/* r1 <- target address     */
> +
> +	ldr	r2, .LC5
> +	ldr	r3, .LC6
> +	sub	r2, r3, r2		/* r2 <- size of armboot            */

Please use TABs for vertical alignment.

> diff --git a/cpu/arm920t/faraday/timer.c b/cpu/arm920t/faraday/timer.c
> new file mode 100644
> index 0000000..7762012
> --- /dev/null
> +++ b/cpu/arm920t/faraday/timer.c
> @@ -0,0 +1,194 @@
> +/*
> + * (C) Copyright 2009 Faraday Technology
> + * Po-Yu Chuang <ratbert at faraday-tech.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., 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +#undef DEBUG

Please do not add dead code.

> +#include <common.h>
> +#include <asm/io.h>
> +#include <asm/arch/ftpmu010.h>
> +#include <asm/arch/fttmr010.h>
> +
> +static ulong timestamp;
> +static ulong lastdec;
> +
> +static volatile struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_SYS_TIMERBASE;
> +static volatile struct ftpmu010 *pmu = (struct ftpmu010
> *)CONFIG_SYS_FTPMU_BASE;

Bad formatting here?

Best regards,

Wolfgang Denk

-- 
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
The speed of time is one second per second.


More information about the U-Boot mailing list