Hi everyone! I have problem with installing openWRT on SAMA5D4 Xplained on NAND Flash:
- I've got 4 file from "http://downloads.openwrt.org/releases/18.06.1/targets/at91/sama5d4/"
- u-boot.bin
- at91bootstrap.bin
- openwrt-18.06.1-at91-sama5d4-at91-sama5d4_xplained.dtb
- openwrt-18.06.1-at91-sama5d4-at91-sama5d4_xplained-ubifs-zImage
- openwrt-18.06.1-at91-sama5d4-at91-sama5d4_xplained-ubifs-root.ubi
- And try to build from source:
-
www.at91.com/linux4sam/bin/view/Linux4SAM/OpenWrt
"OR" - source of OPENWRT on github.
-
www.at91.com/linux4sam/bin/view/Linux4SAM/OpenWrt
SO: when i turn on power:
AT91Bootstrap 3.8.10 (Mon Jun 25 15:05:13 UTC 2018)
EEPROM: Loading AT24xx information ...
EEPROM: BoardName | [Revid] | VendorName
EEPROM: Using default information
EEPROM: Board sn: 0x1012420 revision: 0x680820
HDMI SiI9022: Enter D3 Cold mode
NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0xdc
NAND: Page Bytes: 4096, Spare Bytes: 224
NAND: ECC Correctability Bits: 8, ECC Sector Bytes: 512
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 8, sector: 512
NAND: Image: Copy 0xa0000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image
<debug_uart>
U-Boot 2017.03-linux4sam_5.8 (Jun 24 2018 - 20:30:32 +0000)
CPU: SAMA5D44
Crystal frequency: 12 MHz
CPU clock : 600 MHz
Master clock : 200 MHz
DRAM: 512 MiB
NAND: 512 MiB
MMC: Atmel mci: 0
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@f8020000
Hit any key to stop autoboot: 3 2 1 0
NAND read: device 0 offset 0x180000, size 0x80000
524288 bytes read: OK
NAND read: device 0 offset 0x200000, size 0x600000
6291456 bytes read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 3fb47000, end 3fb51f19 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.120 (buildbot@builds-03.infra.lede-project.org) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7102-3f3a2c9) ) #0 Thu Aug 16 07:51:15 2018
[ 0.000000] CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt:Machine model: Atmel SAMA5D4 Xplained
[ 0.000000] cma: Reserved 64 MiB at 0x38000000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,768k(uboot)ro,256K(env_redundant),256k(env),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=6 root=ubi0:rootfs
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 447424K/524288K available (4770K kernel code, 181K rwdata, 1024K rodata, 204K init, 166K bss, 11328K reserved, 65536K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc04b0b98 (4771 kB)
[ 0.000000] .init : 0xc05d5000 - 0xc0608000 ( 204 kB)
[ 0.000000] .data : 0xc0608000 - 0xc0635760 ( 182 kB)
[ 0.000000] .bss : 0xc0635760 - 0xc065efc4 ( 167 kB)
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] L2C-310 ID prefetch enabled, offset 2 lines
[ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[ 0.000000] L2C-310 cache controller enabled, 8 ways, 128 kB
[ 0.000000] L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
[ 0.000000] clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 9556302164 ns
[ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
[ 0.000000] Console: colour dummy device 80x30
[ 0.050000] Calibrating delay loop... 398.13 BogoMIPS (lpj=1990656)
[ 0.050000] pid_max: default: 32768 minimum: 301
[ 0.050000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.050000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.050000] CPU: Testing write buffer coherency: ok
[ 0.050000] Setting up static identity map for 0x20008200 - 0x20008258
[ 0.060000] VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
[ 0.060000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.060000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.070000] pinctrl core: initialized pinctrl subsystem
[ 0.070000] NET: Registered protocol family 16
[ 0.090000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.090000] cpuidle: using governor ladder
[ 0.090000] cpuidle: using governor menu
[ 0.090000] AT91: Detected SoC family: sama5d4
[ 0.090000] AT91: Detected SoC: sama5d44, revision 0
[ 0.110000] gpio-at91 fc06a000.gpio: at address e081a000
[ 0.110000] gpio-at91 fc06b000.gpio: at address e081c000
[ 0.120000] gpio-at91 fc06c000.gpio: at address e081e000
[ 0.120000] gpio-at91 fc068000.gpio: at address e0831000
[ 0.120000] gpio-at91 fc06d000.gpio: at address e0833000
[ 0.120000] pinctrl-at91 ahb:apb:pinctrl@fc06a000: initialized AT91 pinctrl driver
[ 0.130000] clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 152900835740 ns
[ 1.340000] at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xe0839000
[ 1.340000] at_xdmac f0014000.dma-controller: 16 channels, mapped at 0xe083b000
[ 1.340000] VDD MCI1: supplied by VCC 3V3
[ 1.340000] SCSI subsystem initialized
[ 1.340000] usbcore: registered new interface driver usbfs
[ 1.340000] usbcore: registered new interface driver hub
[ 1.340000] usbcore: registered new device driver usb
[ 1.340000] at91_i2c f8014000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
[ 1.340000] at91_i2c f8014000.i2c: AT91 i2c bus driver (hw version: 0x502).
[ 1.340000] Linux video capture interface: v2.00
[ 1.350000] Advanced Linux Sound Architecture Driver Initialized.
[ 1.350000] clocksource: Switched to clocksource tcb_clksrc
[ 1.360000] NET: Registered protocol family 2
[ 1.360000] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 1.360000] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 1.360000] TCP: Hash tables configured (established 4096 bind 4096)
[ 1.360000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.360000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.360000] NET: Registered protocol family 1
[ 1.360000] No memory allocated for crashlog
[ 1.360000] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[ 1.370000] io scheduler noop registered (default)
[ 1.370000] fc00c000.serial: ttyS0 at MMIO 0xfc00c000 (irq = 29, base_baud = 6250000) is a ATMEL_SERIAL
[ 1.860000] console [ttyS0] enabled
[ 1.860000] fc010000.serial: ttyS1 at MMIO 0xfc010000 (irq = 30, base_baud = 6250000) is a ATMEL_SERIAL
[ 1.870000] [drm] Initialized
[ 1.880000] brd: module loaded
[ 1.900000] loop: module loaded
[ 1.900000] atmel_nand_nfc 90000000.nfc: NFC is probed.
[ 1.910000] atmel_nand 80000000.nand: Using dma0chan2 for DMA transfers.
[ 1.920000] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xdc
[ 1.920000] nand: Micron MT29F4G08ABAEAWP
[ 1.930000] nand: 512 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 224
[ 1.940000] atmel_nand 80000000.nand: Use On Flash BBT
[ 1.940000] atmel_nand 80000000.nand: Cannot get PMECC lookup table offset, will build a lookup table in runtime.
[ 1.950000] atmel_nand 80000000.nand: minimum ECC: 8 bits in 512 bytes
[ 1.960000] atmel_nand 80000000.nand: Initialize PMECC params, cap: 8, sector: 512
[ 1.960000] atmel_nand 80000000.nand: Using NFC Sram read and write
[ 1.970000] Bad block table not found for chip 0
[ 1.980000] Bad block table not found for chip 0
[ 1.980000] Scanning device for bad blocks
[ 1.990000] random: fast init done
[ 2.010000] Bad eraseblock 79 at 0x0000013c0000
[ 2.530000] Bad block table written to 0x00001ffc0000, version 0x01
[ 2.540000] Bad block table written to 0x00001ff80000, version 0x01
[ 2.540000] 7 cmdlinepart partitions found on MTD device atmel_nand
[ 2.550000] Creating 7 MTD partitions on "atmel_nand":
[ 2.550000] 0x000000000000-0x000000040000 : "bootstrap"
[ 2.560000] 0x000000040000-0x000000100000 : "uboot"
[ 2.570000] 0x000000100000-0x000000140000 : "env_redundant"
[ 2.570000] 0x000000140000-0x000000180000 : "env"
[ 2.580000] 0x000000180000-0x000000200000 : "dtb"
[ 2.590000] 0x000000200000-0x000000800000 : "kernel"
[ 2.590000] 0x000000800000-0x000020000000 : "rootfs"
[ 2.600000] mtd: device 6 (rootfs) set to be root filesystem
[ 2.610000] mtdsplit: no squashfs found in "rootfs"
[ 2.610000] atmel_spi f8010000.spi: version: 0x221
[ 2.620000] atmel_spi f8010000.spi: Using dma0chan3 (tx) and dma0chan4 (rx) for DMA transfers
[ 2.630000] atmel_spi f8010000.spi: Atmel SPI Controller at 0xf8010000 (irq 24)
[ 2.630000] m25p80 spi32766.0: unrecognized JEDEC id bytes: ff, ff, ff
[ 2.640000] atmel_spi fc018000.spi: version: 0x221
[ 2.650000] atmel_spi fc018000.spi: Using dma0chan5 (tx) and dma0chan6 (rx) for DMA transfers
[ 2.660000] atmel_spi fc018000.spi: Atmel SPI Controller at 0xfc018000 (irq 31)
[ 2.660000] libphy: Fixed MDIO Bus: probed
[ 2.670000] libphy: MACB_mii_bus: probed
[ 2.770000] Micrel KSZ8081 or KSZ8091 f8020000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8020000.ethernet-ffffffff:01, irq=173)
[ 2.780000] macb f8020000.ethernet eth0: Cadence GEM rev 0x00020120 at 0xf8020000 irq 27 (fc:c2:3d:0c:c3:0b)
[ 2.790000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 2.800000] ehci-atmel: EHCI Atmel driver
[ 2.810000] atmel-ehci 600000.ehci: EHCI Host Controller
[ 2.810000] atmel-ehci 600000.ehci: new USB bus registered, assigned bus number 1
[ 2.820000] atmel-ehci 600000.ehci: irq 18, io mem 0x00600000
[ 2.860000] atmel-ehci 600000.ehci: USB 2.0 started, EHCI 1.00
[ 2.860000] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 2.870000] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.870000] usb usb1: Product: EHCI Host Controller
[ 2.880000] usb usb1: Manufacturer: Linux 4.9.120 ehci_hcd
[ 2.890000] usb usb1: SerialNumber: 600000.ehci
[ 2.890000] hub 1-0:1.0: USB hub found
[ 2.890000] hub 1-0:1.0: 3 ports detected
[ 2.900000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 2.910000] ohci-platform: OHCI generic platform driver
[ 2.910000] ohci-atmel: OHCI Atmel driver
[ 2.920000] at91_ohci 500000.ohci: failed to find sfr node
[ 2.920000] at91_ohci 500000.ohci: USB Host Controller
[ 2.930000] at91_ohci 500000.ohci: new USB bus registered, assigned bus number 2
[ 2.930000] at91_ohci 500000.ohci: irq 18, io mem 0x00500000
[ 3.010000] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[ 3.020000] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 3.020000] usb usb2: Product: USB Host Controller
[ 3.030000] usb usb2: Manufacturer: Linux 4.9.120 ohci_hcd
[ 3.030000] usb usb2: SerialNumber: at91
[ 3.040000] hub 2-0:1.0: USB hub found
[ 3.040000] hub 2-0:1.0: 3 ports detected
[ 3.050000] usbcore: registered new interface driver cdc_acm
[ 3.050000] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 3.060000] usbcore: registered new interface driver usb-storage
[ 3.070000] usbcore: registered new interface driver usbserial
[ 3.070000] usbcore: registered new interface driver usbserial_generic
[ 3.080000] usbserial: USB Serial support registered for generic
[ 3.090000] usbcore: registered new interface driver ftdi_sio
[ 3.090000] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 3.100000] usbcore: registered new interface driver pl2303
[ 3.110000] usbserial: USB Serial support registered for pl2303
[ 3.110000] rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
[ 3.120000] at91_rtc fc0686b0.rtc: rtc core: registered fc0686b0.rtc as rtc0
[ 3.120000] at91_rtc fc0686b0.rtc: AT91 Real Time Clock driver.
[ 3.130000] i2c /dev entries driver
[ 3.140000] AT91: Starting after user reset
[ 3.140000] sama5d4_wdt fc068640.watchdog: initialized (timeout = 16 sec, nowayout = 0)
[ 3.150000] sdhci: Secure Digital Host Controller Interface driver
[ 3.160000] sdhci: Copyright(c) Pierre Ossman
[ 3.160000] atmel_mci fc000000.mmc: version: 0x600
[ 3.170000] atmel_mci fc000000.mmc: using dma0chan7 for DMA transfers
[ 3.230000] atmel_mci fc000000.mmc: Atmel MCI controller at 0xfc000000 irq 28, 1 slots
[ 3.230000] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.240000] ledtrig-cpu: registered to indicate activity on CPUs
[ 3.250000] hidraw: raw HID events driver (C) Jiri Kosina
[ 3.250000] usbcore: registered new interface driver usbhid
[ 3.260000] usbhid: USB HID core driver
[ 3.260000] iio iio:device0: Resolution used: 10 bits
[ 3.270000] iio iio:device0: ADC Touch screen is disabled.
[ 3.280000] NET: Registered protocol family 10
[ 3.280000] NET: Registered protocol family 17
[ 3.290000] ubi0: default fastmap pool size: 100
[ 3.300000] ubi0: default fastmap WL pool size: 50
[ 3.300000] ubi0: attaching mtd6
[ 3.310000] ubi0 error: 0xc02d6018: bad VID header offset 2048, expected 4096
[ 3.320000] ubi0 error: 0xc02d6080: bad EC header
[ 3.320000] Erase counter header dump:
[ 3.320000] magic 0x55424923
[ 3.330000] version 1
[ 3.330000] ec 0
[ 3.330000] vid_hdr_offset 2048
[ 3.340000] data_offset 4096
[ 3.340000] image_seq 2052734425
[ 3.340000] hdr_crc 0xbe0c3948
[ 3.350000] erase counter header hexdump:
[ 3.350000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.9.120 #0
[ 3.360000] Hardware name: Atmel SAMA5
[ 3.360000] Function entered at [<c0014ca4>] from [<c00127c4>]
[ 3.370000] Function entered at [<c00127c4>] from [<c02d608c>]
[ 3.370000] Function entered at [<c02d608c>] from [<c02d6b80>]
[ 3.380000] Function entered at [<c02d6b80>] from [<c02db630>]
[ 3.380000] Function entered at [<c02db630>] from [<c02dccc8>]
[ 3.390000] Function entered at [<c02dccc8>] from [<c02d0ca8>]
[ 3.400000] Function entered at [<c02d0ca8>] from [<c05eeac0>]
[ 3.400000] Function entered at [<c05eeac0>] from [<c0009698>]
[ 3.410000] Function entered at [<c0009698>] from [<c05d5d10>]
[ 3.410000] Function entered at [<c05d5d10>] from [<c04ac65c>]
[ 3.420000] Function entered at [<c04ac65c>] from [<c000f5b0>]
[ 3.420000] ubi0 error: 0xc02d6b9c: validation failed for PEB 0
[ 3.430000] ubi0 error: 0xc02d0cc8: failed to attach mtd6, error -22
[ 3.440000] UBI error: cannot attach mtd6[ 3.440000] input: gpio_keys as /devices/soc0/gpio_keys/input/input0
[ 3.450000] at91_rtc fc0686b0.rtc: setting system clock to 2012-01-01 00:28:14 UTC (1325377694)
[ 3.460000] ALSA device list:
[ 3.460000] No soundcards found.
[ 3.460000] atmel_usart fc00c000.serial: using dma0chan8 for rx DMA transfers
[ 3.470000] atmel_usart fc00c000.serial: using dma0chan9 for tx DMA transfers
[ 3.480000] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(31,6): error -19
[ 3.490000] Please append a correct "root=" boot option; here are the available partitions:
[ 3.490000] 0100 8192 ram0 [ 3.500000] (driver?)
[ 3.500000] 0101 8192 ram1 [ 3.500000] (driver?)
[ 3.510000] 0102 8192 ram2 [ 3.510000] (driver?)
[ 3.510000] 0103 8192 ram3 [ 3.520000] (driver?)
[ 3.520000] 1f00 256 mtdblock0 [ 3.520000] (driver?)
[ 3.520000] 1f01 768 mtdblock1 [ 3.530000] (driver?)
[ 3.530000] 1f02 256 mtdblock2 [ 3.530000] (driver?)
[ 3.540000] 1f03 256 mtdblock3 [ 3.540000] (driver?)
[ 3.540000] 1f04 512 mtdblock4 [ 3.550000] (driver?)
[ 3.550000] 1f05 6144 mtdblock5 [ 3.550000] (driver?)
[ 3.560000] 1f06 516096 mtdblock6 [ 3.560000] (driver?)
[ 3.560000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,6)
[ 3.560000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,6)
[ 70.210000] random: crng init done
and it can't load anymore, it is same with two way that i have done above. PLS help me. Thank everyone!