2011-02-01 15:12:36     nand partions not mounting ilnux 2010R1

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-02-01 15:12:36     nand partions not mounting ilnux 2010R1

Chris Page (UNITED STATES)

Message: 97849   

 

I have successfully mounted two nand partitions in the previous version of uClinux, 2009. In the new version used the same configurations in the new kernel 2010R1-RC5, however when I cat /proc/mtd I only see my flash partition. I should have three total.

 

I additionaly followed instructions here

 

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin_async_nand

 

I configured the mtd nand both as a module and built in (not at the same time). I have even enabled debugging for the ubi mtd driver. What is strange is that nothing is printed or reported to the kernel in dmesg or /var/log/messages. It is like the driver is not doing anything (probably becasue my nand is not mounted). I modified the bf537-stamp.c file similar to the last and made sure the changes were accurate. I have also checked to make sure that I have set all of the configurations for the kernel. I am not sure why I am having so much difficulty wtih this version of uclinux. I even checked the /include/config/auto.conf to make sure the configurations were set.

 

I have searched all over online for somebody with a similar problem. The closest I found was someone having similar trouble but it was a result of not having glubie configured. I do. If there is anybody that could help me it would be greatly appreciated.

 

 

 

Configuration in stamp.c below

 

 

 

#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)

#ifdef CONFIG_MTD_PARTITIONS

const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };

 

static struct mtd_partition bfin_plat_nand_partitions[] = {

    {

        .name   = "linux kernel and file system(nand)",                    // Contain the current image

        .size   = 0x1000000,

        .offset = 0x1000000,

    },{

        .name   = "Data(nand)",

        .size   = MTDPART_SIZ_FULL,

        .offset = MTDPART_OFS_APPEND,//0x3000000,

    }

};

#endif

 

#define BFIN_NAND_PLAT_CLE 2

#define BFIN_NAND_PLAT_ALE 1

static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)

{

    struct nand_chip *this = mtd->priv;

 

    if (cmd == NAND_CMD_NONE)

        return;

 

    if (ctrl & NAND_CLE)

        writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));

    else

        writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));

}

 

#define BFIN_NAND_PLAT_READY GPIO_PF14

static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)

{

    return gpio_get_value(BFIN_NAND_PLAT_READY);

}

 

static struct platform_nand_data bfin_plat_nand_data = {

    .chip = {

        .nr_chips = 1,

        .chip_delay = 30,

#ifdef CONFIG_MTD_PARTITIONS

        .part_probe_types = part_probes,

        .partitions = bfin_plat_nand_partitions,

        .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),

#endif

    },

    .ctrl = {

        .cmd_ctrl  = bfin_plat_nand_cmd_ctrl,

        .dev_ready = bfin_plat_nand_dev_ready,

    },

};

 

#define MAX(x, y) (x > y ? x : y)

static struct resource bfin_plat_nand_resources = {

    .start = 0x20000000,

    .end   = 0x20000000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),

    .flags = IORESOURCE_IO,

};

 

static struct platform_device bfin_async_nand_device = {

    .name = "gen_nand",

    .id = -1,

    .num_resources = 1,

    .resource = &bfin_plat_nand_resources,

    .dev = {

        .platform_data = &bfin_plat_nand_data,

    },

};

 

static void bfin_plat_nand_init(void)

{

    gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");

}

QuoteReplyEditDelete

 

 

2011-02-01 19:07:59     Re: nand partions not mounting ilnux 2010R1

Mike Frysinger (UNITED STATES)

Message: 97850   

 

why do you need to modify the BF537-STAMP boards file ?  it already has NAND resources in it.

QuoteReplyEditDelete

 

 

2011-02-02 10:52:47     Re: nand partions not mounting ilnux 2010R1

Chris Page (UNITED STATES)

Message: 97870   

 

Hi

 

It is a different modified board. plus i would like to create my own partitions. as can be seen the changes are minimal. In fact all i really modified was the size, name, and offsets of my partitions. This worked on last version of uclinux .

Attachments

    Outcomes