Now,I can boot my u-boot from spi flash,but why can't load cramfs romfs in the kernel? refered <TI81XX_PSP_McSPI_Driver_User_Guide.pdf>,I add some code as blow,
1.kernel configure
Device Drivers --->
[*] SPI support --->
<*> McSPI driver for OMAP24xx/OMAP34xx/TI81XX
Device Drivers --->
<*> Memory Technology Device (MTD) support --->
Self-contained MTD device drivers --->
<*> Support most SPI Flash chips (AT26DF, M25P, W25X, ...)
[*] Use FAST_READ OPCode allowing SPI CLK <= 50MHz (NEW)
File systems --->
[*] Miscellaneous filesystems --->
<*> Compressed ROM file system support (cramfs)
2.add code
board-ti8148ipnc.c
static struct mtd_partition ti8148_spi_partitions[] = {
{
.name = "romfs",
.offset = 0x00062000,
.size = 3998 * SZ_4K,
},
};
const struct flash_platform_data ti8148_spi_flash = {
.type = "w25q128",
.name = "spi_flash",
.parts = ti8148_spi_partitions,
.nr_parts = ARRAY_SIZE(ti8148_spi_partitions),
};
struct spi_board_info __initdata ti8148_spi_slave_info[] = {
{
.modalias = "m25p80",
.platform_data = &ti8148_spi_flash,
.irq = -1,
.max_speed_hz = 100000,
.bus_num = 1,
.chip_select = 0,
.mode = SPI_MODE_3,
},
};
m25p80.c
{ "m25p64", INFO(0x202017, 0, 64 * 1024, 128, 0) },
+ { "m25p128", INFO(0x202018, 0, 256 * 1024, 64, 0) },
error log out put
Net: Detected MACID:0:17:eb:57:85:2c
cpsw
Press CTRL-C to abort autoboot in 0 seconds=====>phy_init phy_id 0x4dd074
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.100; our IP address is 192.168.1.30
Filename 'uImage'.
Load address: 0x81000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
###################################################
done
Bytes transferred = 2255464 (226a68 hex)
## Booting kernel from Legacy Image at 81000000 ...
Image Name: Linux-2.6.37_DM8127_IPNC_3.20.00
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2255400 Bytes = 2.2 MiB
Load Address: 80008000
Entry Point: 80008000
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.37_DM8127_IPNC_3.20.00 (danson@IPNCServer) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #11 Fri May 3 15:24:56 CST 2013
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: ti8148ipnc
vram size = 4194304 at 0x0
ti81xx_reserve: ### Reserved DDR region @84f00000
reserved size = 4194304 at 0x0
FB: Reserving 4194304 bytes SDRAM for VRAM
Memory policy: ECC disabled, Data cache writeback
OMAP chip is TI8148 2.1
SRAM: Mapped pa 0x402f1000 to va 0xfe400000 size: 0xf000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 19040
Kernel command line: console=ttyO0,115200n8 mem=80M, console=ttyO0,115200n8 ip=192.168.1.38 netmask=255.255.0.0 noinitrd rw rootfstype=cramfs root=/dev/mtdblock0 cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 earlyprint vram=4M notifyk.vpssm3_sva=0xBFD00000 ootwait=1 rw lpj=4997120
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: 74MB 1MB = 75MB total
Memory: 71124k/71124k available, 10796k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
vmalloc : 0xc5800000 - 0xf8000000 ( 808 MB)
lowmem : 0xc0000000 - 0xc5000000 ( 80 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.init : 0xc0008000 - 0xc003d000 ( 212 kB)
.text : 0xc003d000 - 0xc044a000 (4148 kB)
.data : 0xc044a000 - 0xc0483e80 ( 232 kB)
SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:375
IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
Total of 128 interrupts on 1 active controller
GPMC revision 6.0
Trying to install interrupt handler for IRQ368
Trying to install interrupt handler for IRQ369
Trying to install interrupt handler for IRQ370
Trying to install interrupt handler for IRQ371
Trying to install interrupt handler for IRQ372
Trying to install interrupt handler for IRQ373
Trying to install interrupt handler for IRQ374
Trying to install type control for IRQ375
Trying to set irq flags for IRQ375
OMAP clockevent source: GPTIMER1 at 20000000 Hz
Console: colour dummy device 80x30
Calibrating delay loop (skipped) preset value.. 999.42 BogoMIPS (lpj=4997120)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
TI81XX: Map 0x84f00000 to 0xfe500000 for dram barrier
TI81XX: Map 0x40300000 to 0xfe600000 for sram barrier
omap_voltage_early_init: voltage driver support not added
regulator: core version 0.5
regulator: dummy:
NET: Registered protocol family 16
omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
omap_voltage_add_dev: VDD specified does not exist!
OMAP GPIO hardware version 0.1
OMAP GPIO hardware version 0.1
OMAP GPIO hardware version 0.1
OMAP GPIO hardware version 0.1
omap_mux_init: Add partition: #1: core, flags: 4
_omap_mux_init_gpio: Could not set gpio79
_omap_mux_init_gpio: Could not set gpio80
Cannot clk_get ck_32
Debugfs: Only enabling/disabling deep sleep and wakeup timer is supported now
registered ti81xx_vpss device
registered ti81xx on-chip HDMI device
registered ti81xx_fb device
PWM0 init success.
PWM1 init success.
bio: create slab <bio-0> at 0
SCSI subsystem initialized
USBSS revision 4ea2080b
registerd cppi-dma Intr @ IRQ 17
Cppi41 Init Done
omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz
tps65910 1-002d: read from reg 3f failed
tps65910 1-002d: read from reg 1e failed
set_machine_constraints: failed to enable VRTC
tps65910 1-002d: failed to register tps65910-pmic regulator
tps65910-pmic: probe of tps65910-pmic failed with error -121
tps65911-rtc tps65911-rtc: rtc core: registered tps65911-rtc as rtc0
tps65910 1-002d: No interrupt support, no core IRQ
Advanced Linux Sound Architecture Driver Version 1.0.23.
Switching to clocksource gp timer
musb-hdrc: version 6.0, peripheral, debug=0
musb-hdrc musb-hdrc.0: dma type: dma-cppi41
MUSB controller-0 revision 4ea20800
usb2phy: computed values rxcalib(15)DACs(26 12 13)
usb2phy: override computed values rxcalib(15)DACs(26 12 13)
usb2phy_config: musb(0) rxcalib done, rxcalib read value 6f6d596e
musb-hdrc musb-hdrc.0: USB Peripheral mode controller at c581e000 using DMA, IRQ 18
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)
PMU: registered new PMU device of type 0
omap-iommu omap-iommu.0: ducati registered
omap-iommu omap-iommu.1: sys registered
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
msgmni has been set to 138
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
CMEMK module: built on May 3 2013 at 13:05:45
Reference Linux version 2.6.37
File /home/danson/work/olddisk/puwell/sdk/ipnc/GA_Release_3.2.0.1/Source/ti_tools/linuxutils_3_22_00_02/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
allocated heap buffer 0xc7000000 of size 0x4000000
cmemk initialized
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
console [ttyO0] enabled
omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
brd: module loaded
loop: module loaded
No recognised DiskOnChip devices found
m25p80 spi1.0: w25q128 (16384 Kbytes)
Creating 1 MTD partitions on "spi_flash":
0x000000062000-0x000001000000 : "romfs"
davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
davinci_mdio davinci_mdio.0: detected phy mask fffffffe
davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
Linux video capture interface: v2.00
OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
notify_init : notify drivercreated for remote proc id 2 at physical Address 0xbfd00000
ALSA device list:
No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
omap_voltage_late_init: Voltage driver support not added
Power Management for TI81XX.
Detected MACID=0:17:eb:57:85:2c
tps65911-rtc tps65911-rtc: hctosys: unable to read the hardware clock
CPSW phy found : id is : 0x4dd074
PHY 0:01 not found
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
device=eth0, addr=192.168.1.38, mask=255.255.255.0, gw=255.255.255.255,
host=192.168.1.38, domain=, nis-domain=(none),
bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
PHY: 0:00 - Link is Up - 100/Full
List of all partitions:
1f00 15992 mtdblock0 (driver?)
No filesystem could mount root, tried: cramfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)
Backtrace:
[<c004af70>] (dump_backtrace+0x0/0x110) from [<c033c18c>] (dump_stack+0x18/0x1c)
r6:00008000 r5:c4414007 r4:c04849d8 r3:60000013
[<c033c174>] (dump_stack+0x0/0x1c) from [<c033c1ec>] (panic+0x5c/0x178)
[<c033c190>] (panic+0x0/0x178) from [<c0009184>] (mount_block_root+0x1c4/0x204)
r3:00000000 r2:00000020 r1:c4425f58 r0:c03de095
r7:c03de0f9
[<c0008fc0>] (mount_block_root+0x0/0x204) from [<c0009358>] (mount_root+0xac/0xcc)
[<c00092ac>] (mount_root+0x0/0xcc) from [<c00094e4>] (prepare_namespace+0x16c/0x1cc)
r4:c0483ee4
[<c0009378>] (prepare_namespace+0x0/0x1cc) from [<c0008d70>] (kernel_init+0x114/0x154)
r5:c002bbfc r4:c002bbfc
[<c0008c5c>] (kernel_init+0x0/0x154) from [<c0071eb4>] (do_exit+0x0/0x5d0)
r5:c0008c5c r4:00000000