[U-Boot] NAND is detected as 0 MiB

Adan Scotney adan-ml at orkiesrealm.co.uk
Wed Jan 21 01:38:05 CET 2009


Hi,
I am trying to update some (for the most part very ugly) code from a source
tree based on u-boot 1.1.6 which I have been given to a more up to date
version (I am trying to get 2008.10 to work for now, and I am hoping that
when it does, keeping in line with the main tree will be a bit easier).

I have managed to get 2008.10 to run, but I simply get this on the serial
output:
U-Boot 2008.10 (Jan  9 2009 - 10:57:15)

DRAM:  64 MB
manufacture ID = 191lx
device ID = 9051lx
Flash:  4 MB
NAND:  0 MiB

And then, it reboots and does the same thing again.

Clearly the NAND driver isn't working properly, so does anybody have any
ideas about specific things I should check? I have included the source below
in case anybody can spot something obviously wrong with it.

Many thanks,
Adan


#include <common.h>
#include <asm/io.h>

#ifdef CONFIG_CMD_NAND

#include <nand.h>

/*
 *    hardware specific access to control-lines
 */
#define    MASK_CLE    0x10
#define    MASK_ALE    0x18

static void pollux_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int
ctrl)
{
    struct nand_chip *chip = mtd->priv;
    void __iomem* addr = chip->IO_ADDR_W;

    if (cmd == NAND_CMD_NONE)
        return;

    if(ctrl & NAND_CLE)
        addr += MASK_CLE;
    else if(ctrl & NAND_ALE)
        addr += MASK_ALE;

    writeb(cmd, addr);
}

void board_nand_init(struct nand_chip *nand)
{
    /* set up nand chip data structure */
    nand->IO_ADDR_R = nand->IO_ADDR_W = (void *)0xAC000000;

    nand->cmd_ctrl = pollux_hwcontrol;
    nand->dev_ready = NULL;

    /* use software ECC for now */
    nand->ecc.mode = NAND_ECC_SOFT;

    nand->options = NAND_SAMSUNG_LP_OPTIONS|NAND_NO_AUTOINCR;
    nand->chip_delay = 18;
}
#endif


More information about the U-Boot mailing list