[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] drivers/mtd/chips/jedec_probe.c MTD M25P16 SPI Flash Problems



Hi John,

> 
> I tried enabling it here, and it builds OK, but wasn't able to boot test 
> due to lack of suitable hardware.
> 
> Options I enabled were
> 
> drivers -> SPI -> SPI master and SPI bitbang
> drivers -> MTD -> self contained -> M25P80

After enabling these two options i could also build the kernel without problems, but as you said, the Flash Device wasn't detected when booting PetaLinux.

> 
> There is one more complication, the xilinx_spoi driver in 
> drivers/char/xilinx_spi is a raw character device, and doesn't hook into 
> the Kernel SPI bus infrastructure.  So, it will not work with this MTD 
> driver.
> 
> However, at git.xilinx.org there is a drivers/spi/xilinx_spi.c driver, 
> which has the necessary plumbing.

These steps I did:

1. I downloaded the file 'drivers/spi/xilinx_spi.c' from git.xilinx.com and stored it into PetaLinux tree '/petalinux-v0.30-rc1/software/linux-2.6.x-petalogix/drivers/spi'.

2. I added following line into the '/petalinux-v0.30-rc1/software/linux-2.6.x-petalogix/drivers/spi/Makefile':

obj-$(CONFIG_SPI_XILINX)                += xilinx_spi.o

3. I added following lines into '/petalinux-v0.30-rc1/software/linux-2.6.x-petalogix/drivers/spi/Kconfig':

config SPI_XILINX
	tristate "Xilinx SPI controller"
	depends on SPI_MASTER && XILINX_VIRTEX && EXPERIMENTAL
	select SPI_BITBANG

 	help
	This exposes the SPI controller IP from the Xilinx EDK.
	See the "OPB Serial Peripheral Interface (SPI) (v1.00e)"
	Product Specification document (DS464) for hardware details.

Do I have to add some more bits of the drivers/spi/Makefile and Kconfig?

4. Finally I build the image.bin and booted PetaLinux. Unfortunately the SPI Flash could wasn't detected as you can see in the bootup-sequence below. 

*********************************************************
Found romfs @ 0x4c192000 (0x000c1000)

#### klimit 4c1a5000 ####

Moving 0x000c1000 bytes from 0x4c192000 to 0x4c1a4d9c

New klimit: 0x4c266000

Linux version 2.6.20-uc0 (root@uCLinuxHost) (gcc version 3.4.1 ( PetaLinux 0.20 Build -rc1 050607 )) #84 Wed Feb 27 13:52:48 CET 2008
setup_cpuinfo: initialising
setup_cpuinfo: No PVR support in CPU.  Using static compile-time info
set_cpuinfo_static: Using static CPU info.
setup_memory: max_mapnr: 0x4ffff
setup_memory: min_low_pfn: 0x4c000
setup_memory: max_low_pfn: 0x4000
On node 0 totalpages: 16384
  DMA zone: 128 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 16256 pages, LIFO batch:3
  Normal zone: 0 pages used for memmap
Built 1 zonelists.  Total pages: 16256
Kernel command line: 
OPB INTC #0 at 0x81800000
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 62444k/65536k available
Calibrating delay loop... 32.76 BogoMIPS (lpj=163840)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
xgpio0 #0 at 0x81400000 mapped to 0x81400000 device: 10,185 not using IRQ

uartlite.0: ttyS0 at MMIO 0x84000000 (irq = 4) is a uartlite
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
eth0: using fifo mode.
eth0: No PHY detected.  Assuming a PHY at address 0.
eth0: Xilinx EMACLite #0 at 0x81000000 mapped to 0x81000000, irq=3
uclinux[mtd]: RAM probe address=0x4c1a4d9c size=0xc1000
Creating 1 MTD partitions on "RAM":
0x00000000-0x000c1000 : "ROMfs"
uclinux[mtd]: set ROMfs to be root filesystem index=0
i8042.c: i8042 controller self test timeout.
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
VFS: Mounted root (cramfs filesystem) readonly.
Freeing unused kernel memory: 88k freed
Mounting proc: 
Mounting var: 
Populating /var: 
Running local start scripts.
Mounting /etc/config: 
Populating /etc/config: 
flatfsd: Nonexistent or bad flatfs (-48), creating new one...
flatfsd: Failed to write flatfs (-48): No such device
flatfsd: Created 5 configuration files (383 bytes)
Mounting sysfs:
Setting hostname: 
Setting up interface lo: 
Setting up interface eth0: 

petalinux login: root
Password: 
# ls
bin   dev   etc   home  lib   mnt   proc  sys   tmp   usr   var
# cd dev
# ls
console     mtd14       mtdblock3   mtdr5       ptypa       ttyp4
fb0         mtd2        mtdblock4   mtdr6       ptypb       ttyp5
flash       mtd3        mtdblock5   mtdr7       ptypc       ttyp6
gpio        mtd4        mtdblock6   mtdr8       ptypd       ttyp7
gpio0       mtd5        mtdblock7   mtdr9       ptype       ttyp8
gpio1       mtd6        mtdblock8   null        ptypf       ttyp9
gpio2       mtd7        mtdblock9   nvram       random      ttypa
gpio3       mtd8        mtdr0       ptyp0       rtc         ttypb
gpio4       mtd9        mtdr1       ptyp1       tty         ttypc
kmem  
*********************************************************

What did I forgot to do? BTW: Could you mount the SPI Flash doing it this way?


> 
> Pulling that driver out of the Xilinx Git tree and plugging in to 
> PetaLinux should be pretty straight forward.  Don't forget the relevant 
> bits of the drivers/spi/Makefile and Kconfig.
> 
> Have a go and see if you can do it.
> 
> As for the build errors you sw, I expect you've enabled more MTD options 
> than strictly necessary -

I enabled one more MTD option which caused this error...you were right.

Thank you!

Regards,
Eldin





-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/