i.MX6 boot from Nand flash

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

i.MX6 boot from Nand flash

16,706 次查看
rajabalaji
Contributor II

Hi,

I am currently using wandboard which boots from SD card. SD Card has 2 partitions. The boot partition has U-boot,zImage and the .dtb files. The other partition has the root file system. I want to replace this SD card with a Nand flash in my custom board. How to copy those files(uboot,zImage and .dtb files) and the root files to the Nand flash ? I came across kobs-ng. But did not get enough information. Please help me to proceed further. And also is it possible to reuse the same files(uboot,zImage and .dtb), if i boot from SD card or Nand flash?

Awaiting your reply !!

18 回复数

8,146 次查看
hengyewlim
Contributor III

Hi,

I am trying to flash u-boot onto my custom IMX6SoloX board without success using mfgtool2.

The board always boot up to serial download mode.

I have a few questions.

1. How do I validate u-boot was flashed correctly by kobs-ng?

2. Can I flash using uboot nand write command? I was able to read back correctly the flashed data but still not booting.

3. After flashing u-boot using kobs-ng, u-boot nand command not working, is it normal? (See debug log at the end)

I have attached the debug log below and looking for ideas to further debug this issue.

U-Boot 2015.04-imx_v2015.04_3.14.52_1.1.0_ga+g6cf684a (Jun 16 2016 - 15:05:37)

CPU:   Freescale i.MX6SX rev1.2 at 792 MHz

CPU:   Temperature 41 C

Reset cause: POR

Board: MX6SX SABRE SDB

I2C:   ready

DRAM:  512 MiB

PMIC:  PFUZE100 ID=0x30

NAND:  128 MiB

Using default environment

In:    serial

Out:   serial

Err:   serial

Net:   CPU Net Initialization Failed

No ethernet found.

Boot from USB for mfgtools

Use default environment for                              mfgtools

Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};

Hit any key to stop autoboot:  0

Kernel image @ 0x80800000 [ 0x000000 - 0x48b760 ]

## Loading init Ramdisk from Legacy Image at 83800000 ...

   Image Name:   fsl-image-mfgtool-initramfs-imx6

   Image Type:   ARM Linux RAMDisk Image (gzip compressed)

   Data Size:    7508220 Bytes = 7.2 MiB

   Load Address: 00000000

   Entry Point:  00000000

   Verifying Checksum ... OK

## Flattened Device Tree blob at 83000000

   Booting using the fdt blob at 0x83000000

   Using Device Tree in place at 83000000, end 8300db6d

Starting kernel ...

Booting Linux on physical CPU 0x0

Linux version 3.14.52-1.1.0_ga (administrator@sghelivm03) (gcc version 4.9.1 (GCC) ) #10 SMP PREEMPT Thu Jun 16 17:34:22 MYT 2016

CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d

CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine model: Freescale i.MX6 SoloX SDB Board

cma: CMA: reserved 320 MiB at 8c000000

Memory policy: Data cache writealloc

PERCPU: Embedded 8 pages/cpu @8bb3c000 s8256 r8192 d16320 u32768

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048

Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber=

PID hash table entries: 2048 (order: 1, 8192 bytes)

Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)

Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)

Memory: 175124K/524288K available (5976K kernel code, 333K rwdata, 1864K rodata, 248K init, 387K bss, 349164K reserved, 0K highmem)

Virtual kernel memory layout:

    vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

    vmalloc : 0xa0800000 - 0xff000000   (1512 MB)

    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)

    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)

    modules : 0x7f000000 - 0x7fe00000   (  14 MB)

      .text : 0x80008000 - 0x807b04fc   (7842 kB)

      .init : 0x807b1000 - 0x807ef040   ( 249 kB)

      .data : 0x807f0000 - 0x80843720   ( 334 kB)

       .bss : 0x8084372c - 0x808a4434   ( 388 kB)

SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

Preemptible hierarchical RCU implementation.

        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.

RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1

NR_IRQS:16 nr_irqs:16 16

L310 cache controller enabled

l2x0: 16 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x32030000, Cache size: 256 kB

Switching to timer-based delay loop

sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655765682ns

clocksource_of_init: no matching clocksources found

Console: colour dummy device 80x30

Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)

Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)

CPU: Testing write buffer coherency: ok

CPU0: thread -1, cpu 0, socket 0, mpidr 80000000

Setting up static identity map for 0x805b0f80 - 0x805b0fd8

Brought up 1 CPUs

SMP: Total of 1 processors activated (6.00 BogoMIPS).

CPU: All CPU(s) started in SVC mode.

devtmpfs: initialized

VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

pinctrl core: initialized pinctrl subsystem

regulator-dummy: no parameters

NET: Registered protocol family 16

DMA: preallocated 256 KiB pool for atomic coherent allocations

cpuidle: using governor ladder

cpuidle: using governor menu

Use WDOG1 as reset source

syscon 20c8000.anatop: regmap [mem 0x020c8000-0x020c8fff] registered

vdd1p1: 800 <--> 1375 mV at 1100 mV

vdd3p0: 2625 <--> 3400 mV at 3000 mV

vdd2p5: 2100 <--> 2875 mV at 2500 mV

cpu: 725 <--> 1450 mV at 1150 mV

vddpcie-phy: 725 <--> 1450 mV

vddsoc: 725 <--> 1450 mV at 1175 mV

syscon 20e4000.iomuxc-gpr: regmap [mem 0x020e4000-0x020e7fff] registered

syscon 21bc000.ocotp-ctrl: regmap [mem 0x021bc000-0x021bffff] registered

syscon 21ac000.romcp: regmap [mem 0x021ac000-0x021affff] registered

hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.

hw-breakpoint: maximum watchpoint size is 4 bytes.

imx6sx-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver

20dc000.gpc supply pu not found, using dummy regulator

MU is ready for cross core communication!

bio: create slab <bio-0> at 0

mxs-dma 1804000.dma-apbh: initialized

VCC_SD3: 3000 mV

PSU-5V0: 5000 mV

vref-3v3: 3300 mV

usb_otg1_vbus: 5000 mV

usb_otg2_vbus: 5000 mV

MPCIE_3V3: 3300 mV

i2c-core: driver [max17135] using legacy suspend method

i2c-core: driver [max17135] using legacy resume method

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

usbphy_nop1.12 supply vcc not found, using dummy regulator

i2c i2c-0: IMX I2C adapter registered

i2c i2c-1: IMX I2C adapter registered

i2c i2c-2: IMX I2C adapter registered

i2c i2c-3: IMX I2C adapter registered

pps_core: LinuxPPS API ver. 1 registered

pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

PTP clock support registered

MIPI CSI2 driver module loaded

Switched to clocksource mxc_timer1

cfg80211: Calling CRDA to update world regulatory domain

NET: Registered protocol family 2

TCP established hash table entries: 4096 (order: 2, 16384 bytes)

TCP bind hash table entries: 4096 (order: 3, 32768 bytes)

TCP: Hash tables configured (established 4096 bind 4096)

TCP: reno registered

UDP hash table entries: 256 (order: 1, 8192 bytes)

UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)

NET: Registered protocol family 1

RPC: Registered named UNIX socket transport module.

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

Trying to unpack rootfs image as initramfs...

Freeing initrd memory: 7328K (83801000 - 83f29000)

hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available

imx rpmsg driver is registered.

Bus freq driver module loaded

futex hash table entries: 256 (order: 2, 16384 bytes)

VFS: Disk quotas dquot_6.5.2

Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)

NFS: Registering the id_resolver key type

Key type id_resolver registered

Key type id_legacy registered

jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

fuse init (API version 7.22)

msgmni has been set to 996

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

imx-weim 21b8000.weim: Driver registered.

imx-sdma 20ec000.sdma: no iram assigned, using external mem

imx-sdma 20ec000.sdma: no event needs to be remapped

imx-sdma 20ec000.sdma: loaded firmware 3.2

imx-sdma 20ec000.sdma: initialized

pfuze100-regulator 0-0008: Illegal ID: 30

pfuze100-regulator 0-0008: unrecognized pfuze chip ID!

Serial: IMX driver

2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 58, base_baud = 5000000) is a IMX

console [ttymxc0] enabled

21f4000.serial: ttymxc4 at MMIO 0x21f4000 (irq = 62, base_baud = 5000000) is a IMX

serial: Freescale lpuart driver

imx sema4 driver is registered.

brd: module loaded

loop: module loaded

nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1

nand: Unknown W29N01GV

nand: 128MiB, SLC, page size: 2048, OOB size: 64

gpmi-nand 1806000.gpmi-nand: mode:4 ,failed in set feature.

Bad block table found at page 65472, version 0x01

Bad block table found at page 65408, version 0x01

nand_read_bbt: bad block at 0x000000000000

nand_read_bbt: bad block at 0x000000020000

nand_read_bbt: bad block at 0x000000080000

nand_read_bbt: bad block at 0x0000000a0000

nand_read_bbt: bad block at 0x0000000c0000

nand_read_bbt: bad block at 0x0000000e0000

nand_read_bbt: bad block at 0x000000100000

nand_read_bbt: bad block at 0x000000120000

nand_read_bbt: bad block at 0x000000140000

nand_read_bbt: bad block at 0x000000160000

nand_read_bbt: bad block at 0x000000180000

nand_read_bbt: bad block at 0x0000001a0000

nand_read_bbt: bad block at 0x0000001c0000

nand_read_bbt: bad block at 0x0000001e0000

nand_read_bbt: bad block at 0x000000200000

nand_read_bbt: bad block at 0x000000220000

nand_read_bbt: bad block at 0x000000240000

nand_read_bbt: bad block at 0x000000260000

gpmi-nand 1806000.gpmi-nand: driver registered.

imx6sx-pinctrl 20e0000.iomuxc: pin MX6SX_PAD_ENET2_COL already requested by 2020000.serial; cannot claim for 2188000.ethernet

imx6sx-pinctrl 20e0000.iomuxc: pin-37 (2188000.ethernet) status -22

imx6sx-pinctrl 20e0000.iomuxc: could not request pin 37 (MX6SX_PAD_ENET2_COL) from group enet1grp  on device 20e0000.iomuxc

fec 2188000.ethernet: Error applying setting, reverse things back

2188000.ethernet supply phy not found, using dummy regulator

pps pps0: new PPS source ptp0

fec 2188000.ethernet (unregistered net_device): Invalid MAC address: 00:00:00:00:00:00

fec 2188000.ethernet (unregistered net_device): Using random MAC address: de:31:ae:b0:77:35

libphy: fec_enet_mii_bus: probed

fec 2188000.ethernet eth0: registered PHC device 0

21b4000.ethernet supply phy not found, using dummy regulator

pps pps1: new PPS source ptp1

fec 21b4000.ethernet (unregistered net_device): Invalid MAC address: 00:00:00:00:00:00

fec 21b4000.ethernet (unregistered net_device): Using random MAC address: f2:e5:f0:b6:1e:e2

fec 21b4000.ethernet eth1: registered PHC device 1

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

ehci-mxc: Freescale On-Chip EHCI Host driver

usbcore: registered new interface driver usb-storage

2184800.usbmisc supply vbus-wakeup not found, using dummy regulator

ci_hdrc ci_hdrc.1: EHCI Host Controller

ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1

ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 1 port detected

mousedev: PS/2 mouse device common for all mice

snvs_pwrkey 20cc000.snvs-pwrkey: can't get snvs clock

input: 20cc000.snvs-pwrkey as /devices/soc0/soc.0/2000000.aips-bus/20cc000.snvs-pwrkey/input/input0

snvs_pwrkey 20cc000.snvs-pwrkey: i.MX snvs powerkey probed

egalax_ts 1-0004: Failed to read firmware version

egalax_ts: probe of 1-0004 failed with error -5

2-0044 supply vdd not found, using dummy regulator

i2c-core: driver [isl29023] using legacy suspend method

i2c-core: driver [isl29023] using legacy resume method

snvs_rtc 20cc034.snvs-rtc-lp: can't get snvs-rtc clock

snvs_rtc 20cc034.snvs-rtc-lp: rtc core: registered 20cc034.snvs-rtc-lp as rtc0

i2c /dev entries driver

2-000e supply vdd not found, using dummy regulator

2-000e supply vddio not found, using dummy regulator

mag3110 2-000e: check mag3110 chip ID

mag3110 2-000e: read chip ID 0xffffff92 is not equal to 0xc4!

mag3110: probe of 2-000e failed with error -22

i2c-core: driver [mag3110] using legacy suspend method

i2c-core: driver [mag3110] using legacy resume method

2-001c supply vdd not found, using dummy regulator

2-001c supply vddio not found, using dummy regulator

usb 1-1: new high-speed USB device number 2 using ci_hdrc

mma8451 2-001c: read chip ID 0x1 is not equal to 0x1a or 0x2a!

mma8451: probe of 2-001c failed with error -22

imx2-wdt 20bc000.wdog: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=0)

hub 1-1:1.0: USB hub found

hub 1-1:1.0: 7 ports detected

snvs-secvio 20cc000.caam-snvs: can't get snvs clock

snvs-secvio 20cc000.caam-snvs: violation handlers armed - non-secure state

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

NET: Registered protocol family 26

TCP: cubic registered

NET: Registered protocol family 10

sit: IPv6 over IPv4 tunneling driver

NET: Registered protocol family 17

8021q: 802.1Q VLAN Support v1.8

Key type dns_resolver registered

cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)

usb_otg1_vbus: disabling

PSU-5V0: disabling

VCC_SD3: disabling

regulator-dummy: disabling

imx mcc test is registered.

Number of LUNs=8

Mass Storage Function, version: 2009/09/11

LUN: removable file: (no medium)

Number of LUNs=1

LUN: removable file: (no medium)

Number of LUNs=1

g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11

g_mass_storage gadget: g_mass_storage ready

snvs_rtc 20cc034.snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)

Freeing unused kernel memory: 248K (807b1000 - 807ef000)

Starting UTP

uuc 0.5 [built Dec  3 2015 08:26:46]

UTP: Waiting for device to appear

UTP: file/device node /dev/utp already exists

cpu_id is 0

g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage

UTP: received command '$ mount -t debugfs debugfs /sys/kernel/debug'

UTP: executing "mount -t debugfs debugfs /sys/kernel/debug"

UTP: sending Success to kernel for command $ mount -t debugfs debugfs /sys/kernel/debug.

utp_poll: pass returned.

UTP: received command '$ mtdinfo'

UTP: executing "mtdinfo"

Count of MTD devices:           1

Present MTD devices:            mtd0

Sysfs interface supported:      yes

UTP: sending Success to kernel for command $ mtdinfo.

utp_poll: pass returned.

UTP: received command '$ flash_erase /dev/mtd0 0 0'

UTP: executing "flash_erase /dev/mtd0 0 0"

flash_erase: Skipping bad block at 00000000

flash_erase: Skipping bad block at 00020000

Erasing 128 Kibyte @ 60000 --  0 % complete flash_erase: Skipping bad block at 00080000

flash_erase: Skipping bad block at 000a0000

flash_erase: Skipping bad block at 000c0000

flash_erase: Skipping bad block at 000e0000

flash_erase: Skipping bad block at 00100000

flash_erase: Skipping bad block at 00120000

flash_erase: Skipping bad block at 00140000

flash_erase: Skipping bad block at 00160000

flash_erase: Skipping bad block at 00180000

flash_erase: Skipping bad block at 001a0000

flash_erase: Skipping bad block at 001c0000

flash_erase: Skipping bad block at 001e0000

flash_erase: Skipping bad block at 00200000

flash_erase: Skipping bad block at 00220000

flash_erase: Skipping bad block at 00240000

flash_erase: Skipping bad block at 00260000

Erasing 128 Kibyte @ 6e40000 -- 86 % crandom: nonblocking pool is initialized

Erasing 128 Kibyte @ 7f60000 -- 99 % complete flash_erase: Skipping bad block at 07f80000

flash_erase: Skipping bad block at 07fa0000

flash_erase: Skipping bad block at 07fc0000

flash_erase: Skipping bad block at 07fe0000

Erasing 128 Kibyte @ 7fe0000 -- 100 % complete

UTP: sending Success to kernel for command $ flash_erase /dev/mtd0 0 0.

utp_poll: pass returned.

UTP: received command 'send'

UTP: sending Success to kernel for command send.

UTP: received command '$ kobs-ng init -x -v --chip_0_device_path=/dev/mtd0 $FILE'

UTP: executing "kobs-ng init -x -v --chip_0_device_path=/dev/mtd0 $FILE"

MTD CONFIG:

  chip_0_device_path = "/dev/mtd0"

  chip_1_device_path = "(null)"

  search_exponent = 2

  data_setup_time = 80

  data_hold_time = 60

  address_setup_time = 25

  data_sample_time = 6

  row_address_size = 3

  column_address_size = 2

  read_command_code1 = 0

  read_command_code2 = 48

  boot_stream_major_version = 1

  boot_stream_minor_version = 0

  boot_stream_sub_version = 0

  ncb_version = 3

  boot_stream_1_address = 0

  boot_stream_2_address = 0

         -- We add the 1k-padding to the uboot.

.tmp_kobs_ng: verifying using key '00000000000000000000000000000000'

.tmp_kobs_ng: is a valid bootstream for key '00000000000000000000000000000000'

mtd: opening: "/dev/mtd0"

mtd: '/dev/mtd0' bad block @ 0x100000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x120000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x140000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x160000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x180000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1a0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1c0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x1e0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x200000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x220000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x240000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x260000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x7f80000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x7fa0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x7fc0000 (MTD)

mtd: '/dev/mtd0' bad block @ 0x7fe0000 (MTD)

NFC geometry :

        ECC Strength       : 2

        Page Size in Bytes : 2071

        Metadata size      : 10

        ECC Chunk Size in byte : 512

        ECC Chunk count        : 4

        Block Mark Byte Offset : 2028

        Block Mark Bit Offset  : 2

====================================================

mtd: opened '/dev/mtd0' - '(null)'

mtd: max_boot_stream_size_in_bytes = 66584576

mtd: boot_stream_size_in_bytes = 319488

mtd: boot_stream_size_in_pages = 156

mtd: #1 0x00100000 - 0x04080000 (0x0014e000)

mtd: #2 0x04080000 - 0x08000000 (0x040ce000)

FCB

  m_u32Checksum = 0x00000000

  m_u32FingerPrint = 0x20424346

  m_u32Version = 0x01000000

  m_NANDTiming.m_u8DataSetup = 80

  m_NANDTiming.m_u8DataHold = 60

  m_NANDTiming.m_u8AddressSetup = 25

  m_NANDTiming.m_u8DSAMPLE_TIME = 6

  m_u32PageDataSize = 2048

  m_u32TotalPageSize = 2112

  m_u32SectorsPerBlock = 64

  m_u32NumberOfNANDs = 0

  m_u32TotalInternalDie = 0

  m_u32CellType = 0

  m_u32EccBlockNEccType = 1

  m_u32EccBlock0Size = 512

  m_u32EccBlockNSize = 512

  m_u32EccBlock0EccType = 1

  m_u32MetadataBytes = 10

  m_u32NumEccBlocksPerPage = 3

  m_u32EccBlockNEccLevelSDK = 0

  m_u32EccBlock0SizeSDK = 0

  m_u32EccBlockNSizeSDK = 0

  m_u32EccBlock0EccLevelSDK = 0

  m_u32NumEccBlocksPerPageSDK = 0

  m_u32MetadataBytesSDK = 0

  m_u32EraseThreshold = 0

  m_u32Firmware1_startingPage = 512

  m_u32Firmware2_startingPage = 33024

  m_u32PagesInFirmware1 = 156

  m_u32PagesInFirmware2 = 156

  m_u32DBBTSearchAreaStartAddress = 256

  m_u32BadBlockMarkerByte = 2028

  m_u32BadBlockMarkerStartBit = 2

  m_u32BBMarkerPhysicalOffset = 2048

  m_u32BCHType = 0

  m_NANDTMTiming.m_u32TMTiming2_ReadLatency = 0

  m_NANDTMTiming.m_u32TMTiming2_PreambleDelay = 0

  m_NANDTMTiming.m_u32TMTiming2_CEDelay = 0

  m_NANDTMTiming.m_u32TMTiming2_PostambleDelay = 0

  m_NANDTMTiming.m_u32TMTiming2_CmdAddPause = 0

  m_NANDTMTiming.m_u32TMTiming2_DataPause = 0

  m_NANDTMTiming.m_u32TMSpeed = 0

  m_NANDTMTiming.m_u32TMTiming1_BusyTimeout = 0

  m_u32DISBBM = 0

  m_u32BBMarkerPhysicalOffsetInSpareData = 0

  m_u32OnfiSyncEnable = 0

  m_NANDONFITiming.m_u32ONFISpeed = 0

  m_NANDONFITiming.m_u32ONFITiming_ReadLatency = 0

  m_NANDONFITiming.m_u32ONFITiming_CEDelay = 0

  m_NANDONFITiming.m_u32ONFITiming_PreambleDelay = 0

  m_NANDONFITiming.m_u32ONFITiming_PostambleDelay = 0

  m_NANDONFITiming.m_u32ONFITiming_CmdAddPause = 0

  m_NANDONFITiming.m_u32ONFITiming_DataPause = 0

  m_NANDONFITiming.m_u32ONFITiming_BusyTimeout = 0

  m_u32DISBBSearch = 0

  m_u32RandomizerEnable = 0

  m_u32ReadRetryEnable = 0

  m_u32ReadRetrySeqLength = 0

DBBT

  m_u32Checksum = 0x00000000

  m_u32FingerPrint = 0x54424244

  m_u32Version = 0x01000000

  m_u32DBBTNumOfPages = 1

BBTN#0

  uNAND = 0

  uNumberBB = 16

  BADBLOCKS:

     0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13 0x3fc 0x3fd 0x3fe 0x3ff

Firmware: image #0 @ 0x100000 size 0x4e000 nand: nand_erase_nand: attempt to erase a bad block at page 0x00000000

- available 0x3f80000

Firmware: nand: nand_erase_nand: attempt to erase a bad block at page 0x00000040

image #1 @ 0x4080000 size 0x4e000 - available 0x3f80000

--------nand: nand_erase_nand: attempt to erase a bad block at page 0x00000100

------ Start to write the [ FCB ]nand: nand_erase_nand: attempt to erase a bad block at page 0x00000140

-----

mtd: erasing @0:0x0-0x200nand: nand_erase_nand: attempt to erase a bad block at page 0x00000180

00

mtd: device 0 fails MEMERASE nand: nand_erase_nand: attempt to erase a bad block at page 0x000001c0

(0x0 - 0x20000)

mtd: Failed to erase block @0x0

mtd: erasing @0:0x20000-0x40000

mtd: device 0 fails MEMERASE (0x20000 - 0x20000)

mtd: Failed to erase block @0x20000

mtd: erasing @0:0x40000-0x60000

mtd: Writing FCB2 [ @0:0x40000 ] (840) *

mtd: erasing @0:0x60000-0x80000

mtd: Writing FCB3 [ @0:0x60000 ] (840) *

mtd_commit_bcb(FCB): status 2

-------------- Start to write the [ DBBT ] -----

mtd: erasing @0:0x80000-0xa0000

mtd: device 0 fails MEMERASE (0x80000 - 0x20000)

mtd: Failed to erase block @0x80000

mtd: erasing @0:0xa0000-0xc0000

mtd: device 0 fails MEMERASE (0xa0000 - 0x20000)

mtd: Failed to erase block @0xa0000

mtd: erasing @0:0xc0000-0xe0000

mtd: device 0 fails MEMERASE (0xc0000 - 0x20000)

mtd: Failed to erase block @0xc0000

mtd: erasing @0:0xe0000-0x100000

mtd: device 0 fails MEMERASE (0xe0000 - 0x20000)

mtd: Failed to erase block @0xe0000

mtd_commit_bcb(DBBT): status 4

mtd: PUTTING down DBBT0 BBTN0 @0x82000 (0x800)

mtd: PUTTING down DBBT1 BBTN0 @0xa2000 (0x800)

mtd: PUTTING down DBBT2 BBTN0 @0xc2000 (0x800)

mtd: PUTTING down DBBT3 BBTN0 @0xe2000 (0x800)

---------- Start to write the [ .tmp_kobs_ng ]----

mtd: Writting .tmp_kobs_ng: #0 @0: 0x00100000 - 0x0014e000

mtd: Skipping bad block at 0x100000

mtd: Skipping bad block at 0x120000

mtd: Skipping bad block at 0x140000

mtd: Skipping bad block at 0x160000

mtd: Skipping bad block at 0x180000

mtd: Skipping bad block at 0x1a0000

mtd: Skipping bad block at 0x1c0000

mtd: Skipping bad block at 0x1e0000

mtd: Skipping bad block at 0x200000

mtd: Skipping bad block at 0x220000

mtd: Skipping bad block at 0x240000

mtd: Skipping bad block at 0x260000

mtd: erasing @0:0x280000-0x2a0000

mtd: erasing @0:0x2a0000-0x2c0000

mtd: erasing @0:0x2c0000-0x2e0000

mtd: We write one page for save guard. *

mtd: Writting .tmp_kobs_ng: #1 @0: 0x04080000 - 0x040ce000

mtd: erasing @0:0x4080000-0x40a0000

mtd: erasing @0:0x40a0000-0x40c0000

mtd: erasing @0:0x40c0000-0x40e0000

mtd: We write one page for save guard. *

-Boot 2015.04-imx_v2015.04_3.14.52_1.1.0_ga+g6cf684a (Jun 22 2016 - 14:19:37)

CPU:   Freescale i.MX6SX rev1.2 at 792 MHz

CPU:   Temperature 43 C

Reset cause: POR

Board: MX6SX VIPER

I2C:   ready

DRAM:  512 MiB

PMIC: PFUZE300 DEV_ID=0x30 REV_ID=0x11

NAND:  128 MiB

Using default environment

In:    serial

Out:   serial

Err:   serial

Net:   FEC0

Boot from USB for mfgtools

Use default environment for                              mfgtools

Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};

Hit any key to stop autoboot:  0

Bad Linux ARM zImage magic!

=> nand read 80080000 0 0

NAND read: device 0 offset 0x0, size 0x0

0 bytes read: OK

=> nand read 80080000 40000 20000

NAND read: device 0 offset 0x40000, size 0x20000

NAND read from offset 40000 failed -74

0 bytes read: ERROR

=> nand read 80080000 20000 20000

NAND read: device 0 offset 0x20000, size 0x20000

Skipping bad block 0x00020000

NAND read from offset 40000 failed -74

0 bytes read: ERROR

=> nand bad

Device 0 bad blocks:

  00000000

  00020000

  00080000

  000a0000

  000c0000

  000e0000

  00100000

  00120000

  00140000

  00160000

  00180000

  001a0000

  001c0000

  001e0000

  00200000

  00220000

  00240000

  00260000

=> nand read 80080000 60000 20000

NAND read: device 0 offset 0x60000, size 0x20000

NAND read from offset 60000 failed -74

0 bytes read: ERROR

Regards,

HengYew

0 项奖励
回复

8,146 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Raja

for nand programming commands one can refer to

ucl2.xml and mfgtool2-yocto-mx6-sabreauto-nand.vbs files in

MFG Tools (these commands can be run from Linux):

Programmers (Flash, etc.) (10)

IMX6_L3.14.28_MFG_TOOL (REV L3.14.28_1.0.0)

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&nodeId=018rH3ZrDRB24A&fpsp=1&t...

Image should be rebuilt adding NAND support, please refer to attached Linux Manual

sect.35.3.1 Menu Configuration Options

Also one can refer to sect.4.7.2 Running the image from NAND Linux Guide and

https://community.freescale.com/thread/319987

https://groups.google.com/forum/#!msg/wandboard/auiBR-PdkkA/cDWLQnFy48kJ

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

8,146 次查看
rajabalaji
Contributor II

Hi igor,

Thanks for the references.

Based on the imx6 Linux Guide, about the manufacturing tool, I am making the following conclusions.

1. Manufacturing tool is a software that runs on a host PC which the target connected to host PC through USB.

2. The default ROM code in i.MX6 is alone sufficient to load the U-boot and other kernel images through USB to any of the memory in the target(like external NAND flash)

3. If I am going to manufacture my own custom board with only NAND flash as external memory, it is enough if i have a USB port alone to write the necessary files to NAND flash to wakeup my board.

Am i right with these?

I also have the below queries.

1. Is there any other means through which I can load the NAND flash other than USB. Is it a must that i need to have a USB port in my board?

2. Can all the files(U-boot,device tree file,zImage and root file system) be loaded to NAND using the manufacturing tool?

3. Can I completely avoid SD card from board ? (NAND flash being the memory)

4. Is it possible to use ethernet as a way to interact with Manufacturing tool instead of USB? Does the default boot ROM code enable ethernet?

5. Our requirement needs NAND flash and Ethernet. what other additional peripheral is needed for loading the files to NAND flash ?

Awaiting your reply !!

Thanks and Regards,

Raja

0 项奖励
回复

8,146 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Raja

>1. Is there any other means through which I can load the NAND flash other than USB. Is it a must that i need to have a USB port in my board?

In general these commands (in ucl2.xml) can be run from Linux, one can boot from SD and execute them

>2. Can all the files(U-boot,device tree file,zImage and root file system) be loaded to NAND using the manufacturing tool?

Yes.

>3. Can I completely avoid SD card from board ? (NAND flash being the memory)

Yes.

>4. Is it possible to use ethernet as a way to interact with Manufacturing tool instead of USB? Does the default boot ROM code enable ethernet?

Not for both.

>5. Our requirement needs NAND flash and Ethernet. what other additional peripheral is needed for loading the files to NAND flash ?

Other peripherals are not needed.

Best regards

igor

8,146 次查看
rajabalaji
Contributor II

Hi igor,

Please find my queries inline.

>1. Is there any other means through which I can load the NAND flash other than USB. Is it a must that i need to have a USB port in my board?

In general these commands (in ucl2.xml) can be run from Linux, one can boot from SD and execute them

Does that mean that if I have SD card slot, I need not have a host machine to load the files to NAND flash?

>4. Is it possible to use ethernet as a way to interact with Manufacturing tool instead of USB? Does the default boot ROM code enable ethernet?

Not for both.

So, freescale provides i.MX6 boards with either USB or Ethernet enabled by default in ROM code?

>5. Our requirement needs NAND flash and Ethernet. what other additional peripheral is needed for loading the files to NAND flash ?

Other peripherals are not needed.

So, Ethernet can be used to communicate with Manufacturing tool to load the NAND flash? (As I might not have SD card and USB port)

Were the conclusions that I mentioned in the previous reply right?

Awaiting your reply !!

Thanks and Regards,

Raja

0 项奖励
回复

8,146 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Raja

>Does that mean that if I have SD card slot, I need not have a host machine to load the files to NAND flash?

yes.

>So, freescale provides i.MX6 boards with either USB or Ethernet enabled by default in ROM code?

only USB is enabled.

>Ethernet can be used to communicate with Manufacturing tool to load the NAND flash?

No, manufacturing tool works only through usb

~igor

0 项奖励
回复

8,146 次查看
rajabalaji
Contributor II

Hi igor,

Thanks for the information.

So it is not possible to have Ethernet and NAND flash alone in my board.

I need to have either USB or SD card slot to load into NAND flash.

With USB - i can use manufacturing tool.

With SD card - i need to boot with  SD card and what software must be used to boot to NAND flash?

Is there any other peripheral like uart(instead of USB or SD card ; some cheaper peripheral), that can be used to boot to my NAND flash? If so, what is the tool that i should be using to boot to NAND flash.

Thanks and Regards,

Raja

0 项奖励
回复

8,146 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Raja

with SD card you boot linux and execute the same commands as in ucl2.xml.

~igor

8,146 次查看
rajabalaji
Contributor II

Hi igor,

Thanks. Is there any other way other than USB and SD card to boot NAND flash (like UART)?

Thanks,

Raja Balaji

0 项奖励
回复

8,146 次查看
rameshn
Contributor I

Hi
Is there any other way other than USB and SD card to boot NAND flash (like UART)?

2)Is it possible to use UART as a way to interact with Manufacturing tool instead of USB?

thanks

Ramesh n

0 项奖励
回复

8,146 次查看
jamiew
Contributor III

Hi Raja

I do boot and program the NAND using Ethernet and UART.

I connect the UART and to a serial terminal (which can be automated) send a character during UBoot startup to interrupt U-Boot and then set U-Boot for a network boot:-

setenv 'bootargs_nfs' 'setenv bootargs ${bootargs} root=/dev/nfs rw ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp'

setenv 'nfsroot' '/tftpboot/nfs/rootfs'

setenv 'serverip' '192.168.111.1'

setenv 'ipaddr' ' 192.168.111.64'

saveenv

run bootcmd_net

You will need a file system and uImage file on a tftp server for this to work. I did this on a Raspberry PI like this:-

sudo mkdir /tftproot

sudo mkdir /tftproot/nfs

You may need to chmod 777 these folders.

Copy uImage to /tftproot

Untar rootfs to /tftproot/nfs

sudo apt-get install dnsmasq

Add to end of /etc/dnsmasq.conf

dhcp-range=192.168.111.50,192.168.111.150,12h

  enable-tftp

  tftp-root=/tftpboot

From <https://community.freescale.com/docs/DOC-95051>;

sudo apt-get purge rpcbind
sudo apt-get install nfs-kernel-server

From <http://raspberrypi.stackexchange.com/questions/10403/nfs-server-not-starting-portmapper-is-not-runni...;

We need to install the nfs-kernel-server package and setup /etc/exports with a line such as:

/tftpboot 192.168.111.*(rw,no_root_squash,subtree_check)

This allows clients on the 192.168.111.0 network to access filesystems under the /tftpboot folder.

From <https://community.freescale.com/docs/DOC-95051>

Execute rpcinfo -p to check correctness of your NFS installation and to actually confirm that NFS server is indeed running and accepting calls on a port 2049:

# rpcinfo -p | grep nfs
100003    2 udp   2049  nfs
100003    3 udp   2049  nfs
100003    4 udp   2049  nfs
100003    2 tcp   2049  nfs
100003    3 tcp   2049  nfs
100003    4 tcp   2049  nfs

Furthermore, before we start exporting and mounting NFS directories, your system needs to actually support network file system. To check whether your system supports NFS grep /proc/filesystems and search for nfs.

# cat /proc/filesystems | grep nfs
nodev   nfs
nodev   nfs4

From <http://linuxconfig.org/how-to-configure-nfs-on-linux> 

And then program using the flash tools:-

flash_erase /dev/mtd0 0 0

flash_erase /dev/mtd1 0 0

nandwrite /dev/mtd0 -p uImage

ubiformat /dev/mtd1

ubiattach /dev/ubi_ctrl -m 1

ubimkvol /dev/ubi0 -N rootfs -s 900MiB

mkdir -p /mnt/mtd1

mount -t ubifs ubi0:rootfs /mnt/mtd1

cd /mnt/mtd1/

tar xvjf /home/root/core-image-base.tar.bz2

tar zxvf /home/root/modules.tgz

sync

cd /

umount /mnt/mtd1

poweroff

HTH

Jamie

0 项奖励
回复

8,146 次查看
rajabalaji
Contributor II

Hi Jamie,

I agree with your method, but from where does the U-boot run ?  Your method works fine only after U-boot starts running. I have a fresh NAND flash and there isn't any SD card connected.

Thanks,

Raja

0 项奖励
回复

8,146 次查看
jamiew
Contributor III

Hi Raja

U-Boot runs from NOR flash on the i.MX6 module we are using.


Sorry, looks like this wont be much help to you after all.

Jamie

0 项奖励
回复

8,146 次查看
rajabalaji
Contributor II

Hi Jamie,

It would definitely help me in future :smileyhappy:

Are you aware of using JTAG for this purpose. How do u write U-boot into NOR flash? Is it a custom board or have you got it from a vendor?

Thanks,

Raja

0 项奖励
回复

8,146 次查看
jamiew
Contributor III

Hi Raja

I'm using a Bluechip RM3 module on a custom carrier card. The module comes with the NOR pre-programmed with U-Boot.

One other thing I forgot to mention is you also need to setup the NAND partitions in a structure in the yourboard.c file. I have 10MB for the uImage (raw data) and the rest for the file system (using UBI)

I haven't tried the JTAG connection.

Jamie

0 项奖励
回复

8,146 次查看
rajabalaji
Contributor II

Hi igor,

Is it possible to load the kernel through JTAG and then run the commands necessary to load the boot files to NAND flash? Please share the details regarding this.

imx6, arm, and linux - tips and tricks: imx6 board-bringup: the need for JTAG

Thanks,

Raja Balaji

0 项奖励
回复

8,146 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Raja

I am not aware of ways for running linux with jtag

~igor

0 项奖励
回复

8,146 次查看
rajabalaji
Contributor II

Hi igor,

Thanks for all your help. I guess i will need your help in future as well :smileyhappy:

Thanks,

Raja

0 项奖励
回复