[U-Boot] [PATCH 2/2 v2] arm: suen3, suen3_v1, mgcoge2_arm_p1a support

Wolfgang Denk wd at denx.de
Wed Jan 27 20:49:18 CET 2010


Dear Heiko Schocher,

In message <4B5FEBBB.9000700 at denx.de> you wrote:
> This patch adds support for the Keymile SUEN3 board variants which
> are based on the Marvell Kirkwood (88F6281) SoC. All variants
> uses common code stored in board/keymile/km_arm/km_arm.c
> 
> mgcoge2_arm_p1a board:
> This adds support for the ARM part of the mgcoge2. The suen3
> target was moved to the correct suen3 p1b version. There is a
> difference between the GPIO configuration between suen3 and mgcoge2.
...
> +#if defined(CONFIG_CMD_SF)
> +int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> +	u32 tmp;
> +	if (argc < 2) {
> +		cmd_usage(cmdtp);
> +		return 1;
> +	}
> +
> +	if ((strcmp(argv[1], "on") != 0) &&
> +	    (strcmp(argv[1], "off") != 0)) {
> +		cmd_usage(cmdtp);
> +		return 1;
> +	}

You can omit this code here...

> +	if ((strcmp(argv[1], "off") == 0)) {
> +		printf("SPI FLASH disabled, NAND enabled\n");
> +		/* Multi-Purpose Pins Functionality configuration */
> +		kwmpp_config[0] = MPP0_NF_IO2;
> +		kwmpp_config[1] = MPP1_NF_IO3;
> +		kwmpp_config[2] = MPP2_NF_IO4;
> +		kwmpp_config[3] = MPP3_NF_IO5;
> +
> +		kirkwood_mpp_conf(kwmpp_config);
> +		tmp = readl(KW_GPIO0_BASE);
> +		writel(tmp | FLASH_GPIO_PIN , KW_GPIO0_BASE);
> +
> +		nand_init();
> +	} else {

... by replacing this with a

	} else if (strcmp(argv[1], "off") != 0) {

> +		printf("SPI FLASH enabled, NAND disabled\n");
> +		/* Multi-Purpose Pins Functionality configuration */
> +		kwmpp_config[0] = MPP0_SPI_SCn;
> +		kwmpp_config[1] = MPP1_SPI_MOSI;
> +		kwmpp_config[2] = MPP2_SPI_SCK;
> +		kwmpp_config[3] = MPP3_SPI_MISO;
> +
> +		kirkwood_mpp_conf(kwmpp_config);
> +		tmp = readl(KW_GPIO0_BASE);
> +		writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE);
> +
> +		nand_init();
> +	}

and adding the "else" here.

...
> +#if defined(CONFIG_BOOTCOUNT_LIMIT)
> +void bootcount_store (ulong a)
> +{
> +	volatile ulong *save_addr;
> +	volatile ulong size = 0;
> +	int i;
> +	for (i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
> +		size += gd->bd->bi_dram[i].size;
> +	}
> +	save_addr = (ulong*)(size - BOOTCOUNT_ADDR);
> +	save_addr[0] = a;
> +	save_addr[1] = BOOTCOUNT_MAGIC;

Please use proper I/O accessors instead of volatile pointers.

> +
> +ulong bootcount_load (void)
> +{
> +	volatile ulong *save_addr;
> +	volatile ulong size = 0;
> +	int i;
> +	for (i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
> +		size += gd->bd->bi_dram[i].size;
> +	}
> +	save_addr = (ulong*)(size - BOOTCOUNT_ADDR);
> +	if (save_addr[1] != BOOTCOUNT_MAGIC)
> +		return 0;
> +	else
> +		return save_addr[0];
> +}
> +#endif

Ditto.

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
'What shall we do?' said Twoflower.  'Panic?'  said  Rincewind  hope-
fully. He always held that panic was the best means of survival; back
in  the  olden days, his theory went, people faced with hungry sabre-
toothed tigers could be divided very simply in those who panicked and
those who stood there saying 'What a magnificent  brute!'  or  'Here,
pussy.'                      - Terry Pratchett, _The Light Fantastic_


More information about the U-Boot mailing list