[U-Boot] [PATCH v5] Add support for Eukrea CPUAT91 SBC

Wolfgang Denk wd at denx.de
Sun Aug 9 22:24:47 CEST 2009


Dear Eric Benard,

In message <1249816414-18989-1-git-send-email-eric at eukrea.com> you wrote:
> CPUAT91 is built around Atmel's AT91RM9200 and has up to 16MB of NOR
> flash, up to 128MB of SDRAM, and includes a Micrel KS8721 PHY in RMII
> mode.
...
>  	meesc			\
> diff --git a/Makefile b/Makefile
> index 54c0b67..2386cdc 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2674,6 +2674,19 @@ at91rm9200ek_config	:	unconfig
>  cmc_pu2_config	:	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
>  
> +cpuat91_ram_config \
> +cpuat91_config	:	unconfig
> +	@mkdir -p $(obj)include
> +	@if [ "$(findstring _ram_,$@)" ] ; then \
> +		echo "#define CONFIG_SKIP_LOWLEVEL_INIT" >> $(obj)include/config.h; \
> +		echo "#define CONFIG_SKIP_RELOCATE_UBOOT" >> $(obj)include/config.h; \
> +		$(XECHO) "... CPUAT91 configured for RAM" ; \
> +	else \
> +		echo "#define CONFIG_BOOTDELAY 1" >>$(obj)include/config.h ; \
> +		$(XECHO) "... CPUAT91 configured for Flash" ;\
> +	fi;
> +	@$(MKCONFIG) -a cpuat91 arm arm920t cpuat91 eukrea at91rm9200
> +
>  csb637_config	:	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm arm920t csb637 NULL at91rm9200

Please do not add such scripting to the top level Makefile. Perform it
in your board config file instead.

For an example, please see 
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/65499

...
> +int board_init(void)
> +{
> +	/* Enable Ctrlc */
> +	console_init_f();
> +
> +	/* memory and cpu-speed are setup before relocation
> +	 * so we do _nothing_ here
> +	 */

Incorrect multicomment style.

> +unsigned char ks8721_initphy(AT91PS_EMAC p_mac)
> +{
> +	unsigned char ret = 1;
> +	unsigned short intvalue;
> +
> +	at91rm9200_EmacEnableMDIO(p_mac);
> +
> +	if (!ks8721_getlinkspeed(p_mac)) {
> +		/* Try another time */
> +		ret = ks8721_getlinkspeed(p_mac);
> +	}

Move comment up into the "if" line, and remove the braces for a
single-line statement.

...
> +unsigned char ks8721_autonegotiate(AT91PS_EMAC p_mac, int *status)
> +{
> +	unsigned short value;
> +	unsigned short phyanar;
> +	unsigned short phyanalpar;
> +
> +	/* Set ks8721 control register */
> +	if (!at91rm9200_EmacReadPhy(p_mac,
> +		CONFIG_PHY_ADDRESS | KS8721_BMCR, &value))
> +		return 0;

Here and everywhere else: please add braces around multiline
statements.

> +	value &= ~KS8721_AUTONEG;	/* remove autonegotiation enable */
> +	value |= KS8721_ISOLATE;	/* Electrically isolate PHY */
> +	if (!at91rm9200_EmacWritePhy(p_mac,
> +		CONFIG_PHY_ADDRESS | KS8721_BMCR, &value))
> +		return 0;
> +
> +	/* Set the Auto_negotiation Advertisement Register */
> +	/* MII advertising for Next page, 100BaseTxFD and HD, */
> +	/* 10BaseTFD and HD, IEEE 802.3 */

Incorrect multiline comment style.


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
"Do we define evil as the absence of goodness? It seems only  logical
that shit happens--we discover this by the process of elimination."
                                                        -- Larry Wall


More information about the U-Boot mailing list