[U-Boot] [PATCH] Add support for Eukrea CPU9260/CPU9G20 SBC

Wolfgang Denk wd at denx.de
Tue Sep 22 20:01:32 CEST 2009


Dear Eric Benard,

In message <1252167339-21415-1-git-send-email-eric at eukrea.com> you wrote:
> these boards are built around Atmel's AT91SAM9260/9G20 and have
> up to 64MB of NOR flash, up to 128MB of SDRAM, up to 2GB of NAND
> and include a 10/100 Ethernet PHY in RMII mode.
> 
> Signed-off-by: Eric Benard <eric at eukrea.com>
> ---
>  MAINTAINERS                        |    5 +
>  MAKEALL                            |    2 +
>  Makefile                           |    8 +
>  board/eukrea/cpu9260/Makefile      |   59 +++++
>  board/eukrea/cpu9260/config.mk     |    1 +
>  board/eukrea/cpu9260/cpu9260.c     |  218 +++++++++++++++++
>  board/eukrea/cpu9260/led.c         |  153 ++++++++++++
>  cpu/arm926ejs/at91/lowlevel_init.S |    3 +-
>  include/configs/cpu9260.h          |  453 ++++++++++++++++++++++++++++++++++++
>  9 files changed, 901 insertions(+), 1 deletions(-)
>  create mode 100644 board/eukrea/cpu9260/Makefile
>  create mode 100644 board/eukrea/cpu9260/config.mk
>  create mode 100644 board/eukrea/cpu9260/cpu9260.c
>  create mode 100644 board/eukrea/cpu9260/led.c
>  create mode 100644 include/configs/cpu9260.h
...
> index dd01b66..1d1ded4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2863,6 +2863,14 @@ at91sam9rlek_config	:	unconfig
>  	fi;
>  	@$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
>  
> +CPU9G20_128M_config \
> +CPU9G20_config \
> +CPU9260_128M_config \
> +CPU9260_config	:	unconfig
> +	@mkdir -p $(obj)include
> +	@echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
> +	@$(MKCONFIG) -a cpu9260 arm arm926ejs cpu9260 eukrea at91
> +
>  meesc_config	:	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm arm926ejs meesc esd at91

Please use the new "-t" option to mkconfig to simplify the Makefile
entry.

> +#ifdef CONFIG_CMD_NAND
> +static void cpu9260_nand_hw_init(void)
> +{
> +	unsigned long csa;
> +
> +	/* Enable CS3 */
> +	csa = at91_sys_read(AT91_MATRIX_EBICSA);
> +	at91_sys_write(AT91_MATRIX_EBICSA,
> +		       csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
> +
> +	/* Configure SMC CS3 for NAND/SmartMedia */
> +#if defined(CONFIG_CPU9G20)
> +	at91_sys_write(AT91_SMC_SETUP(3),
> +		       AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(0) |
> +		       AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(0));
> +	at91_sys_write(AT91_SMC_PULSE(3),
> +		       AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(4) |
> +		       AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(4));
> +	at91_sys_write(AT91_SMC_CYCLE(3),
> +		       AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
> +	at91_sys_write(AT91_SMC_MODE(3),
> +		       AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
> +		       AT91_SMC_EXNWMODE_DISABLE |
> +		       AT91_SMC_DBW_8 |
> +		       AT91_SMC_TDF_(3));
> +#elif defined(CONFIG_CPU9260)
> +	at91_sys_write(AT91_SMC_SETUP(3),
> +		       AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
> +		       AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
> +	at91_sys_write(AT91_SMC_PULSE(3),
> +		       AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
> +		       AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
> +	at91_sys_write(AT91_SMC_CYCLE(3),
> +		       AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
> +	at91_sys_write(AT91_SMC_MODE(3),
> +		       AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
> +		       AT91_SMC_EXNWMODE_DISABLE |
> +		       AT91_SMC_DBW_8 |
> +		       AT91_SMC_TDF_(2));
> +#endif

The code here looks the same to me, there are just minor differences
in the data. Please #define appropriate variables in the respective
board config files and get rid of the #if in this common file.

...
> +int board_init(void)
> +{
> +	/* Enable Ctrlc */
> +	console_init_f();
> +
> +	/* arch number of the board */
> +#if defined(CONFIG_CPU9G20)
> +	gd->bd->bi_arch_number = MACH_TYPE_CPUAT9260;
> +#elif defined(CONFIG_CPU9260)
> +	gd->bd->bi_arch_number = MACH_TYPE_CPUAT9260;
> +#endif

Ditto here.

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

Ethernet must not be unconditionally initilaized. Only when U-Boot
runs a network command it may do that, and then it should disable the
interface again before booting Linux. Please see the FAQ, and fix the
Linux driver issue in Linux.


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
No more blah, blah, blah!
	-- Kirk, "Miri", stardate 2713.6


More information about the U-Boot mailing list