Other Parts Discussed in Thread: TPS65217
Hello,
I am facing problems with the nand flash in a custom board. The nand chip is TOSHIBA TH58BVG3S0HTAI0. The nand operates OK from u-boot, but when I try to execute ubiattach from linux I get the following message:
ubiattach /dev/ubi_ctrl -m ,5
[ 2464.815719] ubi0: attaching mtd5
[ 2465.071990] ubi0: scanning is finished
[ 2465.075975] ubi0: empty MTD device detected
[ 2465.081179] ubi0 error: ubi_early_get_peb: no free eraseblocks
[ 2465.087968] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd5, error -28
ubiattach: UBI_IOCATT: No space left on device
The dts configuration is:
nandflash_pins_s0: nandflash_pins_s0 {
pinctrl-single,pins = <
0x0 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */
0x4 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */
0x8 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */
0xc (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */
0x10 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */
0x14 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */
0x18 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */
0x1c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */
0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */
0x74 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */
0x7c (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */
0x90 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */
0x94 (PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */
0x98 (PIN_OUTPUT | MUX_MODE0) /* gpmc_wen.gpmc_wen */
0x9c (PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */
>;
};
&gpmc {
pinctrl-names = "default";
pinctrl-0 = <&nandflash_pins_s0>;
ranges = <0 0 0x08000000 0x20000000>;
status = "okay";
nand@0,0 {
compatible = "ti,omap2-nand";
reg = <0 0 4>;
interrupt-parent = <&gpmc>;
interrupts = <0 IRQ_TYPE_NONE>, <1 IRQ_TYPE_NONE>;
rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>;
nand-bus-width = <8>;
ti,nand-ecc-opt = "bch8";
ti,nand-xfer-type = "polled";
gpmc,device-nand = "true";
gpmc,device-width = <1>;
gpmc,sync-clk-ps = <0>;
gpmc,cs-on-ns = <0>;
gpmc,cs-rd-off-ns = <44>;
gpmc,cs-wr-off-ns = <44>;
gpmc,adv-on-ns = <6>;
gpmc,adv-rd-off-ns = <34>;
gpmc,adv-wr-off-ns = <44>;
gpmc,we-on-ns = <0>;
gpmc,we-off-ns = <40>;
gpmc,oe-on-ns = <0>;
gpmc,oe-off-ns = <54>;
gpmc,access-ns = <64>;
gpmc,rd-cycle-ns = <82>;
gpmc,wr-cycle-ns = <82>;
gpmc,bus-turnaround-ns = <0>;
gpmc,cycle2cycle-delay-ns = <0>;
gpmc,clk-activation-ns = <0>;
gpmc,wr-access-ns = <40>;
gpmc,wr-data-mux-bus-ns = <0>;
#address-cells = <1>;
#size-cells = <1>;
ti,elm-id = <&elm>;
partition@0 {
label = "NAND.SPL";
reg = <0x00000000 0x000040000>;
};
partition@1 {
label = "NAND.u-boot";
reg = <0x00040000 0x00100000>;
};
partition@2 {
label = "NAND.u-boot-env";
reg = <0x00140000 0x00040000>;
};
partition@3 {
label = "NAND.dtb";
reg = <0x00180000 0x00040000>;
};
partition@4 {
label = "NAND.kernel";
reg = <0x001C0000 0x00800000>;
};
partition@5 {
label = "NAND.rootfs";
reg = <0x009c0000 0x3f640000>;
};
};
};
The output from kernel boot is:
[ 1.859673] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[ 1.865450] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[ 1.873889] nand: device found, Manufacturer ID: 0x98, Chip ID: 0xd3
[ 1.880695] nand: Toshiba NAND 1GiB 3,3V 8-bit
[ 1.885385] nand: 1024 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 128
[ 1.893573] nand: using OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
[ 1.904845] 6 ofpart partitions found on MTD device omap2-nand.0
[ 1.911268] Creating 6 MTD partitions on "omap2-nand.0":
[ 1.916886] 0x000000000000-0x000000040000 : "partition"
[ 1.931165] 0x000000040000-0x000000140000 : "partition"
[ 1.945078] 0x000000140000-0x000000180000 : "partition"
[ 1.955133] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.966589] 0x000000180000-0x0000001c0000 : "partition"
[ 1.975140] mmc0: new high speed SDHC card at address 0001
[ 1.985685] mmcblk0: mmc0:0001 TEAM 29.5 GiB
[ 1.996151] 0x0000001c0000-0x0000009c0000 : "partition"
[ 2.008685] mmcblk0: p1
[ 2.019145] 0x0000009c0000-0x000040000000 : "partition"
[ 2.328784] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[ 2.334657] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
I boot the device from nand (MLO, uboot, dtb, kernel) and I use rootfs from mmc. The nand chip has been erased from uboot with "nand erase.chip"
Thanks a lot,
Best Regards,
Ioannis