[#4089] ATmel spi flash card fails to be copied to
Submitted By: Mingquan Pan
Open Date
2008-05-06 06:15:21 Close Date
2008-05-19 05:15:12
Priority:
Medium Assignee:
Michael Hennerich
Status:
Closed Fixed In Release:
N/A
Found In Release:
N/A Release:
Category:
N/A Board:
N/A
Processor:
N/A Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Fixed
Uboot version or rev.:
Toolchain version or rev.:
08r1-8
App binary format:
N/A
Summary: ATmel spi flash card fails to be copied to
Details:
ATmel spi flash card fails to be copied to, The jumper is at Ic1, and stamp.c is edited like:
static struct mtd_partition bfin_spi_flash_partitions[] = {
{
.name = "bootloader",
.size = 0x00040000,
.offset = 0,
.mask_flags = MTD_CAP_ROM
}, {
.name = "kernel",
.size = 0x20000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "file system",
.size = MTDPART_SIZ_FULL,
.offset = MTDPART_OFS_APPEND,
}
};
static struct flash_platform_data bfin_spi_flash_data = {
.name = "m25p80",
.parts = bfin_spi_flash_partitions,
.nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
.type = "at25df041a",
};
When booting the kernel and run the test,it would panic if copy a file to it:
Loading .text @ 0x00001000 (1135840 bytes)
Loading .exit.text.refok @ 0x001164e0 (296 bytes)
Loading .rodata @ 0x00116620 (280704 bytes)
Loading __ksymtab @ 0x0015aea0 (14840 bytes)
Loading __ksymtab_gpl @ 0x0015e898 (4024 bytes)
Loading __ksymtab_strings @ 0x0015f850 (45308 bytes)
Loading __param @ 0x0016a94c (280 bytes)
Clearing .bss @ 0x0016aa80 (61540 bytes)
Loading .data @ 0x00179ae4 (83228 bytes)
Loading .init.text @ 0x0018e000 (98872 bytes)
Loading .init.data @ 0x001a6238 (13124 bytes)
Loading .init.setup @ 0x001a957c (604 bytes)
Loading .initcall.init @ 0x001a97d8 (464 bytes)
Loading .con_initcall.init @ 0x001a99a8 (4 bytes)
Loading .init.ramfs @ 0x001a99ac (3148674 bytes)
Loading .text_l1 @ 0xffa00000 (6952 bytes)
sh_addr: FFA00000, p_paddr: 004AA52E
Loading from: 0249C000 to 004AA52E, size: 6952
Loading .data_l1 @ 0xff800000 (192 bytes)
sh_addr: FF800000, p_paddr: 004AC056
Loading from: 0249E000 to 004AC056, size: 192
## Starting application at 0x0018e000 ...
Linux version 2.6.24.5-ADI-2008R2-pre-svn4696 (test@linux) (gcc version 4.1.2 (ADI svn)) #83 Tue May 6 17:53:39 CST 2008
console [early_BFuart0] enabled
early printk enabled on early_BFuart0
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x001164e0
rodata = 0x00116620-0x0016aa64
bss = 0x0016aa80-0x00179ae4
data = 0x00179ae4-0x0018e000
stack = 0x0018c000-0x0018e000
init = 0x0018e000-0x004ad000
available = 0x004ad000-0x037ff000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
Reset caused by Software reset
Blackfin support (C) 2004-2008 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.2
Blackfin Linux support by blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 100 MHz System Clock
NOMPU: setting up cplb tables for global access
Instruction Cache Enabled
Data Cache Enabled (write-through)
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 14224
Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
console handover: boot [early_BFuart0] -> real [ttyBF0]
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 51972k/65536k RAM, (3196k init code, 1109k kernel code, 479k data, 1024k dma, 7756k reserved)
Blackfin Scratchpad data SRAM: 4 KB
Blackfin Data A SRAM: 16 KB (15 KB free)
Blackfin Data B SRAM: 16 KB (16 KB free)
Blackfin Instruction SRAM: 48 KB (41 KB free)
Security Framework initialized
Mount-cache hash table entries: 512
net_namespace: 64 bytes
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
stamp_init(): registering device resources
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
JFFS2 version 2.2. (NAND) .. 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
bfin_mac_mdio: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=19)@sclk=100MHz)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
m25p80 spi0.1: at25df041a (512 Kbytes)
Creating 3 MTD partitions on "m25p80":
0x00000000-0x00040000 : "bootloader"
0x00040000-0x00060000 : "kernel"
0x00060000-0x00080000 : "file system"
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
rtc-bfin rtc-bfin: setting system clock to 1970-01-01 02:51:28 UTC (10288)
Freeing unused kernel memory: 3196k freed
dma_alloc_init: dma_page @ 0x004aa000 - 256 pages at 0x03f00000
_____________________________________
a8888b. / Welcome to the uClinux distribution \
d888888b. / _ _ \
8P"YP"Y88 / | | |_| __ __ (TM) |
8|o||o|88 _____/ | | _ ____ _ _ \ \/ / |
8' .88 \ | | | | _ \| | | | \ / |
8`._.' Y8. \ | |__ | | | | | |_| | / \ |
d/ `8b. \ \____||_|_| |_|\____|/_/\_\ |
dP . Y8b. \ For embedded processors including |
d8:' " `::88b \ the Analog Devices Blackfin /
d8" 'Y88b \___________________________________/
:8P ' :888
8a. : _a88P For further information, check out:
._/"Yaa_: .| 88P| - blackfin.uclinux.org/
\ YP" `| 8P `. - docs.blackfin.uclinux.org/
/ \.___.d| .' - www.uclinux.org/
`--..__)8888P`._.' jgs/a:f - www.analog.com/blackfin
Have a lot of fun...
BusyBox v1.10.1 (2008-05-06 16:42:01 CST) built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/> cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00001000 "bootloader"
mtd1: 00020000 00001000 "kernel"
mtd2: 00020000 00001000 "file system"
root:/> mount -t jffs2 /dev/mtdblock2 /mnt/
root:/> ls /mnt/
root:/> umount /mnt/
root:/> ls /mnt/
root:/> eraseall /dev/mtd2
Erased 128 Kibyte @ 0 -- 100% complete.
root:/> echo This is test for mtd driver > /home/test
root:/> mkfs.jffs2 -r /home -o mtd.img
root:/> cp mtd.img /dev/mtd2
root:/> mount -t jffs2 /dev/mtdblock2 /mnt/
root:/> ls /mnt/
root:/> cp /bin/pwd /mnt/
Node totlen on flash (0xffffffff) != totlen from node ref (0x0000000c)
Node totlen on flash (0xffffffff) != totlen from node ref (0x00000044)
Node CRC ffffffff != calculated CRC f09e7845 for node at 0001e07c
Hardware Trace:
0 Target : <0x000042e8> { _dump_bfin_trace_buffer + 0x0 }
Source : <0x00076b02> { _jffs2_write_end + 0x256 }
1 Target : <0x00076b02> { _jffs2_write_end + 0x256 }
Source : <0x000768ce> { _jffs2_write_end + 0x22 }
2 Target : <0x000768ac> { _jffs2_write_end + 0x0 }
Source : <0x0002e2b8> { _generic_file_buffered_write + 0x12c }
3 Target : <0x0002e296> { _generic_file_buffered_write + 0x10a }
Source : <0x0002ccac> { _iov_iter_copy_from_user_atomic + 0x74 }
4 Target : <0x0002cc94> { _iov_iter_copy_from_user_atomic + 0x5c }
Source : <0x0002ccba> { _iov_iter_copy_from_user_atomic + 0x82 }
5 Target : <0x0002ccb8> { _iov_iter_copy_from_user_atomic + 0x80 }
Source : <0xffa0184a> { _memcpy + 0x4e }
6 Target : <0xffa0182c> { _memcpy + 0x30 }
Source : <0xffa0181e> { _memcpy + 0x22 }
7 Target : <0xffa01810> { _memcpy + 0x14 }
Source : <0xffa01808> { _memcpy + 0xc }
8 Target : <0xffa017fc> { _memcpy + 0x0 }
Source : <0x0002ccb4> { _iov_iter_copy_from_user_atomic + 0x7c }
9 Target : <0x0002ccae> { _iov_iter_copy_from_user_atomic + 0x76 }
Source : <0x0002cc90> { _iov_iter_copy_from_user_atomic + 0x58 }
10 Target : <0x0002cc8e> { _iov_iter_copy_from_user_atomic + 0x56 }
Source : <0xffa001cc> { __access_ok + 0xb4 }
11 Target : <0xffa001ca> { __access_ok + 0xb2 }
Source : <0xffa001dc> { __access_ok + 0xc4 }
12 Target : <0xffa001d2> { __access_ok + 0xba }
Source : <0xffa00150> { __access_ok + 0x38 }
13 Target : <0xffa00118> { __access_ok + 0x0 }
Source : <0x0002cc8a> { _iov_iter_copy_from_user_atomic + 0x52 }
14 Target : <0x0002cc38> { _iov_iter_copy_from_user_atomic + 0x0 }
Source : <0x0002e292> { _generic_file_buffered_write + 0x106 }
15 Target : <0x0002e274> { _generic_file_buffered_write + 0xe8 }
Source : <0x00076c84> { _jffs2_write_begin + 0xb4 }
BUG: failure at fs/jffs2/file.c:251/jffs2_write_end()!
Kernel panic - not syncing: BUG!
U-Boot 1.1.6-svn1147 (ADI-2008R1) (Feb 15 2008 - 15:51:29)
CPU: ADSP bf537-0.2 (Detected Rev: 0.2)
Board: ADI BF537 stamp board
Support: blackfin.uclinux.org/
Clock: VCO: 500 MHz, Core: 500 MHz, System: 100 MHz
RAM: 64 MB
Flash: 4 MB
In: serial
Out: serial
Err: serial
Net: Blackfin EMAC
MAC: 2A:E8:FF:8D:8C:F8
I2C: ready
Hit any key to stop autoboot: 0
Follow-ups
--- Michael Hennerich 2008-05-15 11:44:38
Fixed.
BTW: Atmel flash driver uses 4Kbyte sector erase size.
You need to tell this mkfs.jffs2 using
-e, --eraseblock=SIZE Use erase block size SIZE (default: 64KiB)
-Michael
--- Mingquan Pan 2008-05-19 05:15:11
Yes,close.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
config.atmel application/octet-stream 26196 Mingquan Pan