Part Number: AM3351
Other Parts Discussed in Thread: AM3352, TPS65217
Tool/software: Linux
Hi Team,
I am trying to boot AM3351 custom board from the nand chip MT29F4G08ABADAH using ti-processor-sdk-linux-am335x-evm-03.00.00.04. It comes up till u boot successfully. Read/Write from u boot to mtd partitions and booting kernel is successful. But it is failing to read/mount filesystem partition.
My GPMC configuration is :
&gpmc {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&emmc_pins>;
ranges = <0 0 0x08000000 0x20000000>; /* CS0: 512MB for NAND */
ti,elm-id = <&elm>;
nand@0,0 {
compatible = "ti,omap2-nand";
nand-bus-width = <8>;
reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
interrupt-parent = <&gpmc>;
interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
<1 IRQ_TYPE_NONE>; /* termcount */
rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
ti,nand-ecc-opt = "bch8";
ti,elm-id = <&elm>;
gpmc,device-nand = "true";
gpmc,device-width = <1>;
gpmc,sync-clk-ps = <0>; /**/
gpmc,adv-on-ns = <10>; /*t ALS*/
gpmc,rd-cycle-ns = <20>; /*t RC*/
gpmc,wr-cycle-ns = <20>; /*t WC*/
gpmc,cs-rd-off-ns = <25>; /*t CEA*/
gpmc,cs-wr-off-ns = <25>; /*t CEA*/
gpmc,we-on-ns = <7>; /*t WH*/
gpmc,oe-on-ns = <3>; /*REn*/
gpmc,adv-rd-off-ns = <10>;
gpmc,adv-wr-off-ns = <25>;
gpmc,we-off-ns = <10>;
gpmc,oe-off-ns = <10>;
gpmc,access-ns = <30>;
gpmc,wr-access-ns = <40>;
#address-cells = <1>;
#size-cells = <1>;
/* MTD partition table */
/* All SPL-* partitions are sized to minimal length
* which can be independently programmable. For
* NAND flash this is equal to size of erase-block */
partition@0 {
label = "NAND.SPL";
reg = <0x00000000 0x000020000>;
};
partition@1 {
label = "NAND.SPL.backup1";
reg = <0x00020000 0x00020000>;
};
partition@2 {
label = "NAND.SPL.backup2";
reg = <0x00040000 0x00020000>;
};
partition@3 {
label = "NAND.SPL.backup3";
reg = <0x00060000 0x00020000>;
};
partition@4 {
label = "NAND.u-boot-spl-os";
reg = <0x00080000 0x00040000>;
};
partition@5 {
label = "NAND.u-boot";
reg = <0x000C0000 0x00300000>;
};
partition@6 {
label = "NAND.u-boot-env";
reg = <0x003C0000 0x00020000>;
};
partition@7 {
label = "NAND.u-boot-env.backup1";
reg = <0x003E0000 0x00020000>;
};
partition@8 {
label = "NAND.kernel";
reg = <0x00400000 0x00800000>;
};
partition@9 {
label = "NAND.file-system";
reg = <0x00C00000 0x1F400000>;
};
};
};
Pinmux is as below: (taken from u boot)
0x0 (PIN_INPUT | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */
0x4 (PIN_INPUT | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */
0x8 (PIN_INPUT | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */
0xc (PIN_INPUT | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */
0x10 (PIN_INPUT | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */
0x14 (PIN_INPUT | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */
0x18 (PIN_INPUT | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */
0x1c (PIN_INPUT | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */
0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */
0x74 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */
0x7c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */
0x90 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */
0x94 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */
0x98 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* gpmc_wen.gpmc_wen */
0x9c (PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */
This is not recognizing the nand chip. When i print nand ID read i get:
[ 2.234958] nand: **** read ID :
[ 2.238013] nand: id_data[00] : 00nand: id_data[01] : 00
[ 2.243364] nand: id_data[02] : 00nand: id_data[03] : 00
[ 2.248677] nand: id_data[04] : 00nand: id_data[05] : 00
[ 2.254021] nand: id_data[06] : 00nand: id_data[07] : 00
I have compared GPMC configuration from u-boot.
u boot:
#define M_NAND_GPMC_CONFIG1 0x00000800
#define M_NAND_GPMC_CONFIG2 0x001e1e00
#define M_NAND_GPMC_CONFIG3 0x001e1e00
#define M_NAND_GPMC_CONFIG4 0x16051807
#define M_NAND_GPMC_CONFIG5 0x00151e1e
#define M_NAND_GPMC_CONFIG6 0x16000f80
writel((((size & 0xF) << 8) | ((base >> 24) & 0x3F) | (1 << 6)), &gpmc_cfg->cs[0].config7);
This comes to : 0x00000F48
kernel from logs:
[ 1.478548] gpmc cs0 before gpmc_cs_program_settings:
[ 1.483676] cs0 GPMC_CS_CONFIG1: 0x00000800
[ 1.487849] cs0 GPMC_CS_CONFIG2: 0x001e1e00
[ 1.492059] cs0 GPMC_CS_CONFIG3: 0x001e1e00
[ 1.496231] cs0 GPMC_CS_CONFIG4: 0x16051807
[ 1.500398] cs0 GPMC_CS_CONFIG5: 0x00151e1e
[ 1.504601] cs0 GPMC_CS_CONFIG6: 0x16000f80
[ 1.508771] cs0 GPMC_CS_CONFIG7: 0x00000f08
[ 1.823739] gpmc cs0 after gpmc_cs_set_timings:
[ 2.004717] cs0 GPMC_CS_CONFIG1: 0x00000800
[ 2.008888] cs0 GPMC_CS_CONFIG2: 0x00020200
[ 2.013093] cs0 GPMC_CS_CONFIG3: 0x00020101
[ 2.017264] cs0 GPMC_CS_CONFIG4: 0x01010101
[ 2.021462] cs0 GPMC_CS_CONFIG5: 0x00020202
[ 2.025632] cs0 GPMC_CS_CONFIG6: 0x03000000
[ 2.029799] cs0 GPMC_CS_CONFIG7: 0x00000f48
When I remove the CS_CONFIGx parameters from the device tree, it reads chip ID successfully, but i am unable to mount the filesystem partition over ubifs.
[ 2.011376] nand: id_data[00] : c2nand: id_data[01] : dc
[ 2.016695] nand: id_data[02] : 90nand: id_data[03] : 95
[ 2.022042] nand: id_data[04] : 56nand: id_data[05] : 00
[ 2.027357] nand: id_data[06] : 00nand: id_data[07] : 00
[ 2.032701] nand:
[ 2.082728] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xdc
[ 2.089055] nand: Macronix MX30LF4G18AC
[ 2.092919] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 2.100555] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme
[ 2.106100] 10 ofpart partitions found on MTD device 8000000.nand
[ 2.112227] Creating 10 MTD partitions on "8000000.nand":
[ 2.117625] 0x000000000000-0x000000020000 : "NAND.SPL"
[ 2.126045] ftl_cs: FTL header not found.
[ 2.132164] 0x000000020000-0x000000040000 : "NAND.SPL.backup1"
[ 2.140914] ftl_cs: FTL header not found.
[ 2.146644] 0x000000040000-0x000000060000 : "NAND.SPL.backup2"
[ 2.155434] ftl_cs: FTL header not found.
[ 2.161227] 0x000000060000-0x000000080000 : "NAND.SPL.backup3"
[ 2.169929] ftl_cs: FTL header not found.
[ 2.175714] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os"
[ 2.186903] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.194925] 0x0000000c0000-0x0000003c0000 : "NAND.u-boot"
[ 2.206383] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.212611] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.218777] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.224973] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.233012] 0x0000003c0000-0x0000003e0000 : "NAND.u-boot-env"
[ 2.241943] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.249928] 0x0000003e0000-0x000000400000 : "NAND.u-boot-env.backup1"
[ 2.259392] ftl_cs: FTL header not found.
[ 2.265259] 0x000000400000-0x000000c00000 : "NAND.kernel"
[ 2.277394] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.283627] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.289791] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.295988] omap2-nand 8000000.nand: uncorrectable bit-flips found
[ 2.303982] 0x000000c00000-0x000020000000 : "NAND.file-system"
[ 2.375159] omap2-nand 8000000.nand: uncorrectable bit-fli[ 4.935700] ubi0: attaching mtd9
[ 5.001073] ubi0: scanning is finished
[ 5.004825] ubi0: empty MTD device detected
[ 5.018710] ubi0 error: ubi_early_get_peb: no free eraseblocks
[ 5.024795] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd9, error -28
[ 5.031905] UBI error: cannot attach mtd9
[ 5.044701] vmmcsd_fixed: disabling
[ 5.051153] UBIFS error (pid: 1): cannot open "ubi0:rootfs", error -19VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
[ 5.064368] Please append a correct "root=" boot option; here are the available partitions:
[ 5.072827] 1f00 128 mtdblock0 (driver?)
[ 5.077889] 1f01 128 mtdblock1 (driver?)
[ 5.083042] 1f02 128 mtdblock2 (driver?)
[ 5.088094] 1f03 128 mtdblock3 (driver?)
[ 5.093193] 1f04 256 mtdblock4 (driver?)
[ 5.098246] 1f05 3072 mtdblock5 (driver?)
[ 5.103338] 1f06 128 mtdblock6 (driver?)
[ 5.108390] 1f07 128 mtdblock7 (driver?)
[ 5.113481] 1f08 8192 mtdblock8 (driver?)
[ 5.118532] 1f09 512000 mtdblock9 (driver?)
[ 5.123617] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 5.131863] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Please let know if I am missing anything.
Thanks,
Mubeen