256MB works, 512MB doesn't (PXA255)

Bill Gatliff bgat at billgatliff.com
Tue Oct 11 17:07:46 EDT 2005


Guys:


I'm working on a PXA255 host, trying to use a CF ATA flash card as a 
fixed device, suitable for Linux (2.6.12) root filesystems.  Pcmcia-cs 
isn't an option, because I don't have the room to store an initrd.

My approach so far has worked for cards up to 256MB in size.  During 
boot, I set up the IO lines for the CF slot, and then do an 
ide_setup_ports() and probe_hwif_init().  In other words, I just assume 
the CF device is an ATA drive, and feed the i/o port addresses straight 
into IDE.

This approach seems to universally fail for 512MB (and probably larger) 
CF ATA devices.  I don't know why, as I can't seem to find enough 
information at the PCMCIA website/Google to tell me exactly what the 
information pcmcia-cs gets from the card means.  I can't even seem to 
get meaningful results when I compare the values returned by 
read_cis_mem() with the CF2.0 spec (most of the addresses that 
read_cis_mem() refers to aren't listed).

The very same card works fine under pcmcia-cs.

A 256MB CF ATA card, which works, has the following Configuration registers:

24000000: 01 00 04 00 df 00 72 00   01 00 ff 00 1c 00 04 00   
......r.........
24000010: 03 00 d9 00 01 00 ff 00   18 00 02 00 df 00 01 00   
................
24000020: 20 00 04 00 45 00 00 00   01 00 04 00 15 00 17 00    
...E...........
24000030: 04 00 01 00 53 00 61 00   6e 00 44 00 69 00 73 00   
....S.a.n.D.i.s.
24000040: 6b 00 00 00 53 00 44 00   50 00 00 00 35 00 2f 00   
k...S.D.P...5./.
24000050: 33 00 20 00 30 00 2e 00   36 00 00 00 ff 00 80 00   3. 
.0...6.......
24000060: 03 00 14 00 08 00 00 00   21 00 02 00 04 00 01 00   
........!.......
24000070: 22 00 02 00 01 00 01 00   22 00 03 00 02 00 0c 00   
".......".......
24000080: 0f 00 1a 00 05 00 01 00   07 00 00 00 02 00 0f 00   
................
24000090: 1b 00 0b 00 c0 00 c0 00   a1 00 27 00 55 00 4d 00   
..........'.U.M.
240000a0: 5d 00 75 00 08 00 00 00   21 00 1b 00 06 00 00 00   
].u.....!.......
240000b0: 01 00 21 00 b5 00 1e 00   4d 00 1b 00 0d 00 c1 00   
..!.....M.......
240000c0: 41 00 99 00 27 00 55 00   4d 00 5d 00 75 00 64 00   
A...'.U.M.].u.d.
240000d0: f0 00 ff 00 ff 00 21 00   1b 00 06 00 01 00 01 00   
......!.........
240000e0: 21 00 b5 00 1e 00 4d 00   1b 00 12 00 c2 00 41 00   
!.....M.......A.
240000f0: 99 00 27 00 55 00 4d 00   5d 00 75 00 ea 00 61 00   
..'.U.M.].u...a.
24000100: f0 00 01 00 07 00 f6 00   03 00 01 00 ee 00 21 00   
..............!.


A 512MB card (works under pcmcia-cs, not otherwise) looks like this:

24000000: 01 01 03 03 d9 d9 01 01   ff ff 1c 1c 04 04 03 03   
................
24000010: d9 d9 01 01 ff ff 18 18   02 02 df df 01 01 20 20   ..............
24000020: 04 04 98 98 00 00 00 00   00 00 15 15 20 20 04 04   
............  ..
24000030: 01 01 54 54 4f 4f 53 53   48 48 49 49 42 42 41 41   
..TTOOSSHHIIBBAA
24000040: 20 20 54 54 48 48 4e 4e   43 43 46 46 35 35 31 31     
TTHHNNCCFF5511
24000050: 32 32 4d 4d 50 50 47 47   20 20 00 00 00 00 00 00   22MMPPGG  
......
24000060: 00 00 00 00 00 00 00 00   00 00 00 00 ff ff 21 21   
..............!!
24000070: 02 02 04 04 01 01 22 22   02 02 01 01 01 01 22 22   
......""......""
24000080: 03 03 02 02 0c 0c 0f 0f   1a 1a 05 05 01 01 03 03   
................
24000090: 00 00 02 02 0f 0f 1b 1b   08 08 c0 c0 c0 c0 a1 a1   
................
240000a0: 01 01 55 55 08 08 00 00   20 20 1b 1b 06 06 00 00   ..UU....  
......
240000b0: 01 01 21 21 b5 b5 1e 1e   4d 4d 1b 1b 0a 0a c1 c1   
..!!....MM......
240000c0: 41 41 99 99 01 01 55 55   64 64 f0 f0 ff ff ff ff   
AA....UUdd......
240000d0: 20 20 1b 1b 06 06 01 01   01 01 21 21 b5 b5 1e 1e     
........!!....
240000e0: 4d 4d 1b 1b 0f 0f c2 c2   41 41 99 99 01 01 55 55   
MM......AA....UU
240000f0: ea ea 61 61 f0 f0 01 01   07 07 f6 f6 03 03 01 01   
..aa............
24000100: ee ee 20 20 1b 1b 06 06   02 02 01 01 21 21 b5 b5   ..  
........!!..

With both cards, the only write_cis_mem() calls I see are to addresses 
0x103, 0x100, 0x101, and 0x102.  I have no idea what these registers do 
(though I have found the source in pcmcia_request_configuration()), so I 
hesitate to blindly add that functionality to my code.

Two questions:

1.  Can anyone point me to docs that describe what all those CIS 
registers mean?  I assume they're part of the "Metaformat" 
specification, or some other document that PCMCIA doesn't want to give 
up without exchanging a large sum of money.  I'd be happy to buy the 
Developer's Guide, at $89USD, except that I can't tell for sure that it 
contains the needed information.

2.  Am I going about this all the wrong way?  If so, what's the 
appropriate way to use a CF ATA card as a fixed IDE device when 
pcmcia-cs isn't an option?  Seems like I'm so close...


Thanks!


b.g.

-- 
Bill Gatliff
bgat at billgatliff.com




More information about the linux-pcmcia mailing list