i.MX6: Board-config for MTD and NAND

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX6: Board-config for MTD and NAND

跳至解决方案
3,854 次查看
kristianlein-ma
Contributor I

Hi!

We've got a custom board similar to Nitrogen6X (and SabreLite), where we've mounted a 8GB NAND chip (my schematic says K9LBG08U0D-PCB0). I cannot, however, seem to find an existing i.MX6 board that uses any chips like this.

I think my pads have been setup quite fine, but I'm struggeling with the NAND partitioning and drivers.

- How can I patch up my kernel board-config to setup NAND flash?

- Can my NAND-chip be auto-detected in any way?

- Where can I find a board-config example that uses a large NAND chip for main storage (and perhaps even sets up Android partitioning)

- What driver should I use for my NAND? "mxc_nand"? I see some use "physmap-flash" but that may be something entirely different

Thanks in advance,

Kristian

标签 (2)
标记 (3)
0 项奖励
回复
1 解答
1,615 次查看
EgleTeam
Contributor V

Kristian,

Have you tried a basic init? You can take as example the init on "board-mx6q-sabreauto.c" in Linux 3.0.35. Or our config (very simple):

static int __init es6_gpmi_nand_platform_init(void)

{

    return 0;

}

static const struct gpmi_nand_platform_data

     es6_gpmi_nand_platform_data __initconst = {

    .platform_init           = es6_gpmi_nand_platform_init,

    .min_prop_delay_in_ns    = 5,

    .max_prop_delay_in_ns    = 9,

    .max_chip_count          = 1,

    .enable_bbt              = 1,

};

imx6q_add_gpmi(&es6_gpmi_nand_platform_data); // On Board Init.

With the above simple code and adding support for "nand flash", "mtd" and "ubi",  the kernel should detect your device. We have tested two devices of 512MB (8 bit) from Micron and Spansion: both are recognized but the second one doesn't work with this Kernel.

Good luck!

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,615 次查看
jkobs2014
Contributor III

In the end, this was very helpful.  Not all board definitions, even from freescale, properly start up the gpmi code.  HOWEVER, in addition to just the "simple" code above, the MUX tables are required.

Regardless, this was an excellent hint.  If your gpmi driver is not getting started properly, and you're not getting a chip detection, this is a good place to start looking.

0 项奖励
回复
1,616 次查看
EgleTeam
Contributor V

Kristian,

Have you tried a basic init? You can take as example the init on "board-mx6q-sabreauto.c" in Linux 3.0.35. Or our config (very simple):

static int __init es6_gpmi_nand_platform_init(void)

{

    return 0;

}

static const struct gpmi_nand_platform_data

     es6_gpmi_nand_platform_data __initconst = {

    .platform_init           = es6_gpmi_nand_platform_init,

    .min_prop_delay_in_ns    = 5,

    .max_prop_delay_in_ns    = 9,

    .max_chip_count          = 1,

    .enable_bbt              = 1,

};

imx6q_add_gpmi(&es6_gpmi_nand_platform_data); // On Board Init.

With the above simple code and adding support for "nand flash", "mtd" and "ubi",  the kernel should detect your device. We have tested two devices of 512MB (8 bit) from Micron and Spansion: both are recognized but the second one doesn't work with this Kernel.

Good luck!

0 项奖励
回复
1,616 次查看
kristianlein-ma
Contributor I

Thanks Manuel, for pointing me in the right direction. I had tried that before, but my "es6_gpmi_nand_platform_init" was never called so I started looking elsewhere. It turned out I was missing CONFIG_MTD_NAND_GPMI_NAND=y. My flash is now detected:

NAND device: Manufacturer ID: 0x2c, Chip ID: 0x64 (Micron MT29F64G08CBABBWP)

gpmi-nand imx6q-gpmi-nand.0: enable asynchronous EDO mode 5

mtd: Giving out device 0 to gpmi-nand

GPMI NAND driver registered. (IMX)

Thanks!

Krist

0 项奖励
回复