Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

uClinux MMC SPI Driver

Altera_Forum
Honored Contributor II
3,732 Views

Just to let everyone know, an MMC SPI Driver for Alteras SPI Core (modified) is in the works.. currently, cards can be recognized, read/write, and even partitioned.. but some bugs are being worked out. If anyone is interested in an early release, let me know....

0 Kudos
56 Replies
Altera_Forum
Honored Contributor II
484 Views

I changed qsf for SSN, but the problem still. So it is not like SSN. 

I am installing "git", and will hack into kernel deeper.
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

hey hippo, 

 

It's true that reflections are primarily caused by rise/fall times and SSO, but, clock frequency does affect it. If you are running RAM at 10M, reflections won't matter because they will have died down by the time data is sampled; running at 100M is different because the over/undershoot can be sampled instead of the stable data. So that's why I increase clock rates in testing.
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

MMC Driver Update 

----------------------- 

 

Due to the issues in 2.6.16, I am continuing work in 2.6.11 instead since it's the last known stable kernel. The driver version is now 0.1.3, and can now be used as a kernel module. This version is much more stable than 0.1.1 (initial release). If anyone is interested in a diff patch, let me know; otherwise, just get the whole/part kernel tree from: 

 

http://via.dynalias.org/svn/uclinux/linux-2.6.11/trunk/ (http://via.dynalias.org/svn/uclinux/linux-2.6.11/trunk/

 

Driver is in drivers/mmc directory. 

 

J
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

 

--- Quote Start ---  

originally posted by jdhar@Apr 10 2006, 04:46 AM 

hey hippo, 

 

it's true that reflections are primarily caused by rise/fall times and sso, but, clock frequency does affect it. if you are running ram at 10m, reflections won't matter because they will have died down by the time data is sampled; running at 100m is different because the over/undershoot can be sampled instead of the stable data. so that's why i increase clock rates in testing. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14178) 

--- quote end ---  

 

--- Quote End ---  

 

you are right. 

 

I am going to trace into memory management to find out the problem. 

What is the error message on your board before crash?
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

No error message, that&#39;s the beautiful part http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif It just hangs.

0 Kudos
Altera_Forum
Honored Contributor II
484 Views

hippo, 

 

do you have a patch for 2.6.12? I&#39;m going to take a shot at looking at the differences between .11 and .12. 2.6.11 was put out by Microtronix, right? I&#39;m worried that maybe they stuck in some specific hacks to get it working that weren&#39;t carried over to any other versions. If I can get up to .12, I will compare .11 and .12 to see if I can spot anything. 

 

J
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

 

--- Quote Start ---  

originally posted by jdhar@Apr 11 2006, 11:05 AM 

hippo, 

 

do you have a patch for 2.6.12? i&#39;m going to take a shot at looking at the differences between .11 and .12. 2.6.11 was put out by microtronix, right? i&#39;m worried that maybe they stuck in some specific hacks to get it working that weren&#39;t carried over to any other versions. if i can get up to .12, i will compare .11 and .12 to see if i can spot anything. 

 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14213) 

--- quote end ---  

 

--- Quote End ---  

 

Yes, please find, 

http://forum.niosforum.com/forum/index.php...ype=post&id=138 (http://forum.niosforum.com/forum/index.php?act=attach&type=post&id=138

 

cd~/download wget -N http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.11.tar.bz2 wget -N http://www.uclinux.org/pub/uClinux/uClinux-2.6.x/linux-2.6.11-uc0.patch.gz wget -N http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.tar.bz2 wget -N http://www.uclinux.org/pub/uClinux/uClinux-2.6.x/linux-2.6.12-uc0.patch.gz cd ~ tar jxf ~/download/linux-2.6.11.tar.bz2 cd ~/linux-2.6.11 zcat ~/download/linux-2.6.11-uc0.patch.gz | patch -p1 patch -p0 <~/download/linux-2.6.11-nios2-01.diff cd ~ tar jxf ~/download/linux-2.6.12.tar.bz2 cd ~/linux-2.6.12 zcat ~/download/linux-2.6.12-uc0.patch.gz | patch -p1 patch -p0 <~/download/linux-2.6.11-nios2-01.diff patch -p0 <~/download/linux-2.6.12-nios2-02.diff 

 

The first patch , linux-2.6.11-nios2-01.diff , come from 2.6.x , is believed to be clean, with only uart and altcf driver. 

The next patch, linux-2.6.12-nios2-02.diff, is the minimal changes that is required to compile 2.6.12. 

 

The linux-2.6.11 passed the tests, but linux-2.6.12 failed on one of my board.
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

Ok, and just so I know, how did you get these patches? Are these a combination of the uClinux patches put out on top of code you have moved yourself (nios2nommu stuff for example - or is that in the uClinux tree?)? This is just so I know what you did and what was already done...

0 Kudos
Altera_Forum
Honored Contributor II
484 Views

 

--- Quote Start ---  

originally posted by jdhar@Apr 11 2006, 12:11 PM 

ok, and just so i know, how did you get these patches? are these a combination of the uclinux patches put out on top of code you have moved yourself (nios2nommu stuff for example - or is that in the uclinux tree?)? this is just so i know what you did and what was already done... 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14222) 

--- quote end ---  

 

--- Quote End ---  

 

 

The uClinux uc0 patch is required for each kernel release.  

 

The first patch is just pull-out from the Microtronix&#39;s 1.4 release, the arch/nios2nommu, include/asm-nios2nommu, include/linux/elf.h, ide.h , uart and altcf. 

 

The second patch fix the compile errors, and got here by looking at other arch&#39;s patches, eg sh,h8300,mips,arm etc.
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

When I change the ptf of a working board from 128M to 64M, then the test failed. 

Just like what it was on the failed 64M board. 

 

I am learning more kernel debug. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

# df 

 

Filesystem        1k-blocks      Used Available Use% Mounted on 

/dev/hda1            503736        96    503640 0% /mnt# # dd count=800000 bs=512 if=/dev/zero of=/mnt/z2 

 

800000+0 records in 

800000+0 records out# # df 

 

df: page allocation failure. order:8, mode:0xd0 

Stack from 01f37d98:<0> 

    <0> 00000008<0> 000346e8<0> 00000000<0> 00000000<0> 00000000<0> 00000010<0> 00000001<0> 000000d0<0> 

    <0> 000000d0<0> 001e01ec<0> 00000000<0> 001e01e0<0> 001df860<0> ffffe000<0> 03af8e00<0> 000385d0<0> 

    <0> 00000010<0> 00000002<0> 00000000<0> 000a2098<0> 001f8920<0> 00000000<0> 00000077<0> 0039a080<0> 

    <0> 00000001<0> 03af8e00<0> 00038174<0> 00000004<0> 0003f240<0> 00000000<0> 00000004<0> 002518c8<0> 

    <0> 00251880<0> 00000007<0> 000681b8<0> ffffe000<0> 00000004<0> 00018c88<0> 00000001<0> 00003ef8<0> 

    <0> 00000000<0> 00021254<0> 03af8e00<0> 000771e8<0> 00000002<0> 00000000<0> 01f37f20<0> 01f37f18<0> 

Call Trace:<0> 

    <0> [<00032034>]<0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0> 

    <0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0> 

    <0> [<00003ef8>]<0> [<00000000>]<0> [<00000005>]<0> [<00000080>]<0> 

    <0> [<00000000>]<0> [<00032210>]<0> [<00000000>]<0> [<00000000>]<0> 

    <0> [<00000014>]<0> [<0001d35c>]<0> [<000000d2>]<0> [<00000000>]<0> 

    <0> [<000035ae>]<0> [<00060000>]<0> [<00080000>]<0> [<00090000>]<0> 

    <0> [<00003e00>]<0> [<00000000>]<0> [<000a2098>]<0> [<00000000>]<0> 

    <0> [<0000d6b8>]<0> [<00000080>]<0> [<00000058>]<0> [<00000000>]<0> 

    <0> [<00076aa8>]<0> [<0005261c>]<0> [<00000000>]<0> [<00000000>]<0> 

    <0> [<00000000>]<0> [<00052924>]<0> [<00000000>]<0> [<00002310>]<0> 

    <0> [<00000e98>]<0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0> 

    <0> [<000008d0>]<0> [<00000006>]<0> [<00000000>]<0> [<00000008>]<0> 

    <0> [<00000018>]<0> [<00000000>]<0> [<0000000b>]<0> [<00000000>]<0> 

    <0> [<00000000>]<0> [<00000001>]<0> [<00000000>]<0> 

Allocation of length 663704 from process 33 failed 

DMA per-cpu: 

cpu 0 hot: low 14, high 42, batch 7 

cpu 0 cold: low 0, high 14, batch 7 

Normal per-cpu: empty 

HighMem per-cpu: empty 

 

Free pages:        2884kB (0kB HighMem) 

Active:7923 inactive:5290 dirty:0 writeback:0 unstable:0 free:721 slab:1992 mapped:0 pagetables:0 

DMA free:2884kB min:1024kB low:1280kB high:1536kB active:31692kB inactive:21160kB present:65536kB pages_scanned:0 all_unreclaimable? no 

lowmem_reserve[]: 0 0 0 

Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no 

lowmem_reserve[]: 0 0 0 

HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no 

lowmem_reserve[]: 0 0 0 

DMA: 35*4kB 59*8kB 16*16kB 1*32kB 1*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 0*2048kB 0*4096kB = 2884kB 

Normal: empty 

HighMem: empty 

Unable to allocate RAM for process text/data, errno 12 

scheduling while atomic: df/0x00000001/33 

Stack from 01f37f5c:<0> 

    <0> 00000001<0> 000c6c24<0> 0000232c<0> 000e0440<0> 000e04a4<0> 03d85bd5<0[/b] 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
484 Views

..see, the difference between you and me is that you are actually getting page allocation failures, whereas I am just freezing. Waht kernel version did you see that on, .12? Do you think it&#39;s still a kernel bug, or maybe the kernel just can&#39;t handle writing 400M with that little RAM?

0 Kudos
Altera_Forum
Honored Contributor II
484 Views

 

--- Quote Start ---  

originally posted by jdhar@Apr 12 2006, 12:13 AM 

..see, the difference between you and me is that you are actually getting page allocation failures, whereas i am just freezing. waht kernel version did you see that on, .12? do you think it&#39;s still a kernel bug, or maybe the kernel just can&#39;t handle writing 400m with that little ram? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14256) 

--- quote end ---  

 

--- Quote End ---  

 

I am using 2.6.12, as in previous e-mail. 

I think it should be a bug somewhere in arch/nios2nommu . 

It is not the size of ram and the size of file that matter. 

It works with 8M sdram.
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

hello all 

 

Do you have dirve usb device on DE2 board? 

 

if yes. 

 

Can i read or write files form external disk to pass through usb device?  

 

thx
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

 

--- Quote Start ---  

originally posted by jay_1025@Apr 14 2006, 03:56 AM 

hello all 

 

do you have dirve usb device on de2 board? 

 

if yes. 

 

can i read or write files form external disk to pass through usb device?  

 

thx 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14345) 

--- quote end ---  

 

--- Quote End ---  

 

Jay, you have to post this as another new top. Not here.
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

Is the README file still available? I have found the location in the kernel configuration but I cannot find any more information on implementing the SD card interface. 

 

Thanks in advance.
0 Kudos
Reply