I am just starting out with the at91sam9x5-ek running a G35 processor and an LCD module. I was able to get the Angstrom demo running as per
http://www.at91.com/linux4sam/bin/view/Linux4SAM/GettingStarted_9x5 . I then setup a BuildRoot as per
http://www.at91.com/linux4sam/bin/view/ ... ldRoot_9x5 , with a few minor modifications to get u-boot to build as per another page from the wiki. The end result is that I have: u-boot.bin, uImage, and rootfs.ubi. I then used the stock bootstrap and SAM-BA tcl script (adjusted for file names) from the demo to transfer everything. This gives me a kernel panic - No Init found. The boot log is below.
Code:
RomBOOT
Start AT91Bootstrap...
Init DDR... Done!
Loading 1-Wire info...
Enumerate all roms:
Rom#0x0: 0x90 0x0 0x0 0x1 0xdc 0x4f 0x2a 0x2d
Rom#0x1: 0x8c 0x0 0x0 0x3 0x6 0xf5 0xe5 0x2d
Rom#0x2: 0x84 0x0 0x0 0x0 0xf3 0xe4 0x98 0x23
Done, 0x3 1-wire chips found!
Board name: SAM9x5-EK [B0]; Vendor name: FLEX
Board name: SAM9X35-CM [B1]; Vendor name: EMBEST
Board name: SAM9x5-DM [B0]; Vendor name: FLEX
sn: 0x4010426; rev: 0x8421
Downloading image...
chip id: 0x2cda
Copy 0x50000 bytes from 0x40000 to 0x26f00000
Done!
U-Boot 2010.06 (Mar 30 2012 - 09:21:29)
DRAM: 128 MiB
NAND: 256 MiB
*** Warning - bad CRC or NAND, using default environment
In: serial
Out: serial
Err: serial
Net: macb0
macb0: Starting autonegotiation...
macb0: Autonegotiation complete
macb0: link up, 100Mbps full-duplex (lpa: 0x4de1)
Hit any key to stop autoboot: 1 0
NAND read: device 0 offset 0x200000, size 0x250000
2424832 bytes read: OK
## Booting kernel from Legacy Image at 22000000 ...
Image Name: Linux-2.6.39
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2053508 Bytes = 2 MiB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.39 (gri6507@Abyss) (gcc version 4.3.5 (Buildroot 2011.05) ) #2 Fri Mar 30 08:50:27 CDT 2012
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9X5-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 400 MHz, master 133 MHz, main 12.000 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: mem=128M console=ttyS0,115200 mtdparts=atmel_nand:8M(bootstrap/uboot/kernel)ro,-(rootfs) root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 125772k/125772k available, 5300k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xff000000 - 0xffe00000 ( 14 MB)
vmalloc : 0xc8800000 - 0xfee00000 ( 870 MB)
lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.init : 0xc0008000 - 0xc002d000 ( 148 kB)
.text : 0xc002d000 - 0xc03cfe60 (3724 kB)
.data : 0xc03d0000 - 0xc03f67e0 ( 154 kB)
NR_IRQS:192
AT91: 128 gpio irqs in 4 banks
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
AT91: CM rev B and higher
AT91: EK rev B and higher
AT91: Power Management (with slow clock mode)
AT91: Starting after user reset
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio.0: using pins 62 (SDA) and 63 (SCL)
at_hdmac at_hdmac.0: Atmel AHB DMA Controller ( cpy slave ), 8 channels
at_hdmac at_hdmac.1: Atmel AHB DMA Controller ( cpy slave ), 8 channels
Switching to clocksource tcb_clksrc
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
JFFS2: default compression mode: priority
msgmni has been set to 245
io scheduler noop registered (default)
atmel_hlcdfb atmel_hlcdfb_base.0: 1500KiB frame buffer at 27a00000 (mapped at ffc00000)
atmel_hlcdfb atmel_hlcdfb_base.0: fb0: Atmel LCDC at 0xf8038000 (mapped at c8864000), irq 25
atmel_hlcdfb atmel_hlcdfb_ovl.0: 1500KiB frame buffer at 27000000 (mapped at ffa00000)
atmel_hlcdfb atmel_hlcdfb_ovl.0: fb1: Atmel LCDC at 0xf8038100 (mapped at c886c100), irq -6
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xf801c000 (irq = 5) is a ATMEL_SERIAL
brd: module loaded
loop: module loaded
ssc ssc.0: Atmel SSC device at 0xc8880000 (irq 28)
atmel_nand atmel_nand: Using dma0chan0 for DMA transfers.
ONFI flash detected
ONFI param page 0 valid
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron MT29F2G08AAD)
atmel_pmecc_init_params
Scanning device for bad blocks
2 cmdlinepart partitions found on MTD device atmel_nand
Creating 2 MTD partitions on "atmel_nand":
0x000000000000-0x000000800000 : "bootstrap/uboot/kernel"
0x000000800000-0x000010000000 : "rootfs"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096
UBI: max. sequence number: 3
UBI: attached mtd1 to ubi0
UBI: MTD device name: "rootfs"
UBI: MTD device size: 248 MiB
UBI: number of good PEBs: 1984
UBI: number of bad PEBs: 0
UBI: number of corrupted PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 1984
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 1/0
UBI: image sequence number: 180165579
UBI: background thread "ubi_bgt0d" started, PID 353
macb macb.0: eth0: Features changed: 0x00004800 -> 0x00004000
MACB_mii_bus: probed
eth0: Atmel MACB at 0xf802c000 irq 24 (04:25:fe:ed:00:18)
eth0: attached PHY driver [Davicom DM9161A] (mii_bus:phy_addr=0:00, irq=-1)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
atmel-ehci atmel-ehci: Atmel EHCI UHP HS
atmel-ehci atmel-ehci: new USB bus registered, assigned bus number 1
atmel-ehci atmel-ehci: irq 22, io mem 0x00700000
atmel-ehci atmel-ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 2
at91_ohci at91_ohci: irq 22, io mem 0x00600000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver libusual
atmel_usba_udc atmel_usba_udc: MMIO registers at 0xf803c000 mapped at c88e6000
atmel_usba_udc atmel_usba_udc: FIFO at 0x00500000 mapped at c8900000
qt1070 0-001b: AT42QT1070 firmware version 15
input: AT42QT1070 QTouch Sensor as /devices/platform/i2c-gpio.0/i2c-0/0-001b/input/input0
atmel_tsadcc atmel_tsadcc: Master clock is set at: 133333333 Hz
atmel_tsadcc atmel_tsadcc: Prescaler is set at: 221
input: atmel touch screen controller as /devices/platform/atmel_tsadcc/input/input1
at91_rtc at91_rtc: rtc core: registered at91_rtc as rtc0
AT91 Real Time Clock driver.
i2c /dev entries driver
Linux media interface: v0.10
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nf
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
at91_rtc at91_rtc: setting system clock to 2007-01-01 00:39:29 UTC (1167611969)
atmel_mci atmel_mci.0: Using dma0chan1 for DMA transfers
atmel_mci atmel_mci.0: Atmel MCI controller at 0xf0008000 irq 12, 1 slots
atmel_mci atmel_mci.1: Using dma1chan0 for DMA transfers
atmel_mci atmel_mci.1: Atmel MCI controller at 0xf000c000 irq 26, 1 slots
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 247603200 bytes (241800 KiB, 236 MiB, 1950 LEBs)
UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:12.
Freeing init memory: 148K
Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
[<c00389f0>] (unwind_backtrace+0x0/0xec) from [<c02e26b4>] (panic+0x4c/0x180)
[<c02e26b4>] (panic+0x4c/0x180) from [<c002d5e0>] (init_post+0x108/0x138)
[<c002d5e0>] (init_post+0x108/0x138) from [<c0008410>] (kernel_init+0x104/0x140)
[<c0008410>] (kernel_init+0x104/0x140) from [<c003485c>] (kernel_thread_exit+0x0/0x8)
I then commented out the NANDFLASH::NandSetTrimffs command (what does this do, anyways?) and tried again. This time, the panic still panicked, but with a different error.
Code:
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 247603200 bytes (241800 KiB, 236 MiB, 1950 LEBs)
UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:12.
Freeing init memory: 148K
Kernel panic - not syncing: No ie Linux Documentation/init.txt for guidance.
[<c00389f0>] (unwind_backtrace+0x0/0xec) from [<c02e26b4>] (panic+0x4c/0x180)
[<c02e26b4>] (panic+0x4c/0x180) from [<c002d5e0>] (init_post+0x108/0x138)
[<c002d5e0>] (init_post+0x108/0x138) from [<c0008410>] kernel_init+0x104/0x140)
[<c0008410>] (kernel_init+0x104/0x140) from [<c003485c>] (kernel_thread_exit+0x0/0x8)
Searching around, I saw several RFFS2 related issues which resulted in kernel panics, but none seem to be applicable in my UBI case. Does anyone have any pointers/suggestions?
For what it's worth, here's my SAM-BA tcl script used to transfer data to NAND flash.
Code:
################################################################################
# Main script: Load the linux demo in NAND Flash
################################################################################
set bootstrapFile "bootstrap.bin"
set ubootFile "u-boot.bin"
set kernelFile "uImage"
set rootfsFile "rootfs.ubi"
## NandFlash Mapping
set ubootAddr 0x00040000
set kernelAddr 0x00200000
set rootfsAddr 0x00800000
## Falshing binaries
puts "-I- === Initialize the NAND access ==="
NANDFLASH::Init
puts "-I- === Enable PMECC OS Parameters ==="
NANDFLASH::NandHeaderValue HEADER 0xc0c00405
puts "-I- === Erase all the NAND flash blocs and test the erasing ==="
NANDFLASH::EraseAllNandFlash
puts "-I- === Load the bootstrap: nandflash_at91sam9-ek in the first sector ==="
NANDFLASH::SendBootFilePmeccCmd $bootstrapFile
puts "-I- === Load the u-boot image ==="
send_file {NandFlash} "$ubootFile" $ubootAddr 0
puts "-I- === Load the Kernel image ==="
send_file {NandFlash} "$kernelFile" $kernelAddr 0
puts "-I- === Enable trimffs ==="
NANDFLASH::NandSetTrimffs 1
puts "-I- === Load the linux file system ==="
send_file {NandFlash} "$rootfsFile" $rootfsAddr 0
puts "-I- === DONE. ==="