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

Scott Wood scottwood at freescale.com
Wed Feb 3 23:32:17 CET 2010


On Wed, Feb 03, 2010 at 04:52:05PM +0100, Heiko Schocher wrote:
> >> +	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 if ((strcmp(argv[1], "on") == 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();
> > 
> > What do you need nand_init for disabled nand operation?
> 
> With it, the nand subsystem knows, that there is no longer
> the nand availiable.

That's not how nand_init() is meant to be used.  It is meant to be called
once on system init.  There is probably at least a memory leak here, e.g.
chip->buffers.

Even as a hack, it looks like these boards use the kirkwood nand controller,
and its board_nand_init() will unconditionally return 0, telling
nand_init_chip that it does indeed have NAND available.  Or is there a patch
somewhere changing that?

-Scott


More information about the U-Boot mailing list