[#4114] ATmel at45df321d spi flash card also fails to be copied to
Submitted By: Mingquan Pan
Open Date
2008-05-19 22:59:58 Close Date
2008-05-20 23:28:00
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 at45df321d spi flash card also fails to be copied to
Details:
ATmel at45df321d spi flash card still fails to be copied to.
By selecting ic3 on the add-on spi board, and change the stamp.c like:
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 = "at45df321d",
};
The kernel built out would also fail at copy command:
U-Boot 1.1.6-svn737 (ADI-2007R1) (Apr 4 2007 - 11:42:51)
CPU: ADSP BF537 Rev.: 0.2
Board: ADI BF537 stamp board
Support: blackfin.uclinux.org/
Clock: VCO: 500 MHz, Core: 500 MHz, System: 100 MHz
SDRAM: 64 MB
FLASH: 4 MB
In: serial
Out: serial
Err: serial
Net: BF537 ETHERNET
I2C: ready
Hit any key to stop autoboot: 0
Using BF537 ETHERNET device
TFTP from server 10.100.4.174; our IP address is 10.100.4.50
Filename 'linux'.
Load address: 0x1000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#######################################
done
Bytes transferred = 5188576 (4f2be0 hex)
Loading .text @ 0x00001000 (1167616 bytes)
Loading .exit.text.refok @ 0x0011e100 (296 bytes)
Loading .rodata @ 0x0011e240 (285996 bytes)
Loading __ksymtab @ 0x00163f6c (14992 bytes)
Loading __ksymtab_gpl @ 0x001679fc (4152 bytes)
Loading __ksymtab_strings @ 0x00168a34 (46024 bytes)
Loading __param @ 0x00173dfc (300 bytes)
Clearing .bss @ 0x00173f40 (61604 bytes)
Loading .data @ 0x00182fe4 (77852 bytes)
Loading .init.text @ 0x00196000 (99156 bytes)
Loading .init.data @ 0x001ae354 (13180 bytes)
Loading .init.setup @ 0x001b16d0 (600 bytes)
Loading .initcall.init @ 0x001b1928 (472 bytes)
Loading .con_initcall.init @ 0x001b1b00 (4 bytes)
Loading .init.ramfs @ 0x001b1b04 (2868717 bytes)
Loading .text_l1 @ 0xffa00000 (6952 bytes)
sh_addr: FFA00000, p_paddr: 0046E0F1
Loading from: 01460000 to 0046E0F1, size: 6952
Loading .data_l1 @ 0xff800000 (192 bytes)
sh_addr: FF800000, p_paddr: 0046FC19
Loading from: 01462000 to 0046FC19, size: 192
## Starting application at 0x00196000 ...
Linux version 2.6.24.7-ADI-2008R2-pre-svn4761 (test@Linux54-ADV7393-AD1981) (gcc version 4.1.2 (ADI svn)) #43 Mon May 19 03:47:33 CST 2008
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x0011e100
rodata = 0x0011e240-0x00173f28
bss = 0x00173f40-0x00182fe4
data = 0x00182fe4-0x00196000
stack = 0x00194000-0x00196000
init = 0x00196000-0x00470000
available = 0x00470000-0x037ff000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
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 ip=10.100.4.50:10.100.4.174:192.168.0.1:255.255.255.0:BF537:eth0:off
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
bfin-rtc: invalid date; resetting
console [ttyBF0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 52216k/65536k RAM, (2920k init code, 1140k kernel code, 480k 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
mtd_dataflash spi0.1: AT45DB321x (4224 KBytes)
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 00:00:02 UTC (2)
IP-Config: Gateway not on directly connected network.
Freeing unused kernel memory: 2920k freed
dma_alloc_init: dma_page @ 0x0046d000 - 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-07 01:00:15 CST) built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/> PHY: 0:01 - Link is Up - 100/Full
root:/> cat /proc/mtd
dev: size erasesize name
mtd0: 00420000 00000210 "spi0.1-AT45DB321x"
root:/> eraseall /dev/mtd0
Erased 4224 Kibyte @ 0 -- 100% complete.
root:/> echo This is for mtd driver > /home/test
root:/> mkfs.jffs2 -r /home -e 4 -o mtd.img
root:/> cp mtd.img /dev/mtd0
/dev/mtd0 /dev/mtd0ro
root:/> cp mtd.img /dev/mtd0
root:/> mount -t jffs2 /dev/mtdblock0 /mnt/
JFFS2 write-buffering enabled buffer (528) erasesize (8448)
root:/> ls /mnt/
test
root:/> cat /mnt/test
This is a test
root:/> df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock0 4224 160 4064 4% /mnt
root:/> cp /bin/version /mnt/
Data CRC 3359f0be != calculated CRC 8bab1e85 for node at 00000284
Hardware Trace:
0 Target : <0x000042e8> { _dump_bfin_trace_buffer + 0x0 }
Source : <0x00076b32> { _jffs2_write_end + 0x256 }
1 Target : <0x00076b32> { _jffs2_write_end + 0x256 }
Source : <0x000768fe> { _jffs2_write_end + 0x22 }
2 Target : <0x000768dc> { _jffs2_write_end + 0x0 }
Source : <0x0002e310> { _generic_file_buffered_write + 0x12c }
3 Target : <0x0002e2ee> { _generic_file_buffered_write + 0x10a }
Source : <0x0002cd04> { _iov_iter_copy_from_user_atomic + 0x74 }
4 Target : <0x0002ccec> { _iov_iter_copy_from_user_atomic + 0x5c }
Source : <0x0002cd12> { _iov_iter_copy_from_user_atomic + 0x82 }
5 Target : <0x0002cd10> { _iov_iter_copy_from_user_atomic + 0x80 }
Source : <0xffa0184a> { _memcpy + 0x4e }
6 Target : <0xffa0182c> { _memcpy + 0x30 }
Source : <0xffa0181e> { _memcpy + 0x22 }
7 Target : <0xffa017fc> { _memcpy + 0x0 }
Source : <0x0002cd0c> { _iov_iter_copy_from_user_atomic + 0x7c }
8 Target : <0x0002cd06> { _iov_iter_copy_from_user_atomic + 0x76 }
Source : <0x0002cce8> { _iov_iter_copy_from_user_atomic + 0x58 }
9 Target : <0x0002cce6> { _iov_iter_copy_from_user_atomic + 0x56 }
Source : <0xffa001cc> { __access_ok + 0xb4 }
10 Target : <0xffa001ca> { __access_ok + 0xb2 }
Source : <0xffa001dc> { __access_ok + 0xc4 }
11 Target : <0xffa001d2> { __access_ok + 0xba }
Source : <0xffa00150> { __access_ok + 0x38 }
12 Target : <0xffa00118> { __access_ok + 0x0 }
Source : <0x0002cce2> { _iov_iter_copy_from_user_atomic + 0x52 }
13 Target : <0x0002cc90> { _iov_iter_copy_from_user_atomic + 0x0 }
Source : <0x0002e2ea> { _generic_file_buffered_write + 0x106 }
14 Target : <0x0002e2cc> { _generic_file_buffered_write + 0xe8 }
Source : <0x00076cb4> { _jffs2_write_begin + 0xb4 }
15 Target : <0x00076ca8> { _jffs2_write_begin + 0xa8 }
Source : <0x00076d04> { _jffs2_write_begin + 0x104 }
BUG: failure at fs/jffs2/file.c:251/jffs2_write_end()!
Kernel panic - not syncing: BUG!
icache_enable
U-Boot 1.1.6-svn737 (ADI-2007R1) (Apr 4 2007 - 11:42:51)
CPU: ADSP BF537 Rev.: 0.2
Board: ADI BF537 stamp board
Support: blackfin.uclinux.org/
Clock: VCO: 500 MHz, Core: 500 MHz, System: 100 MHz
SDRAM: 64 MB
FLASH: 4 MB
In: serial
Out: serial
Err: serial
Net: BF537 ETHERNET
I2C: ready
Hit any key to stop autoboot: 0
Follow-ups
--- Michael Hennerich 2008-05-20 03:24:55
Not a bug.
AT45DFxxx are DataFlash Devices they need a different driver.
<*> Support for AT45xxx DataFlash
< > Support most SPI Flash chips (AT26DF, M25P, W25X, ...)
-Michael
--- Mingquan Pan 2008-05-20 04:27:49
I have selected the items like above, so that the kernel can recognize the ic3
chip. It just has problem when copying.
--- Michael Hennerich 2008-05-20 06:39:29
Ok - I see.
Sorry - I should better read all emails to the bottom.
I have done a patch - I wait before I commit - for some clarification with
Atmel.
-Michael
--- Michael Hennerich 2008-05-20 08:40:21
Hi Grace,
can you try again.
The driver now prints out pagesize and erasesize.
mtd_dataflash spi0.1: AT45DB321x (4096 KBytes) pagesize 512 bytes erasesize
4096 bytes
both values needs to be given as arguments when cretin the jffs2 fs.
Here are the commands I used for testing.
-Michael
root:/> eraseall /dev/mtd0
Erased 4096 Kibyte @ 0 -- 100% complete.
root:/> mkfs.jffs2 -r /home -s 512 -e 4096 -o mtd.img
root:/> cp mtd.img /dev/mtd0
root:/> mount -t jffs2 /dev/mtdblock0 /mnt/
JFFS2 version 2.2. (NAND) 2001-2006 Red Hat, Inc.
JFFS2 write-buffering enabled buffer (512) erasesize (8192)
Empty flash at 0x00002ffc ends at 0x00003000
root:/> cp /bin/busybox /mnt
root:/>
--- Mingquan Pan 2008-05-20 23:28:00
Yeah,the testing log of trunk head is about the same like above.
mtd_dataflash spi0.1: AT45DB321x (4096 KBytes) pagesize 512 bytes, erasesize
4096 bytes
is printed when kernel booting up.
root:/> cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00000200 "spi0.1-AT45DB321x"
root:/>
root:/> eraseall /dev/mtd0
Erased 4096 Kibyte @ 0 -- 100% complete.
root:/> ls /home/
root:/> echo 33333 > /home/test
root:/> mkfs.jffs2 -r /home -s 512 -e 4096 -o mtd.img
root:/> cp mtd.img /dev/mtd0
/dev/mtd0 /dev/mtd0ro
root:/> cp mtd.img /dev/mtd0
root:/> mount -t jffs2 /dev/mtdblock0 /mnt/
JFFS2 write-buffering enabled buffer (512) erasesize (8192)
root:/> cp /bin/busybox /mnt/
root:/> ls /mnt/
busybox test
root:/> cat /mnt/test
33333
root:/> umount /mnt/
root:/> ls /mnt/
root:/>
Fixed.Close.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found