root on pcmcia (EPIA-MII rl5c476 slot 1 CF)

Peter Stuge stuge-linux-pcmcia at cdy.org
Sun Sep 17 13:16:15 EDT 2006


I want to boot my EPIA-MII with LinuxBIOS in ROM and kernel and root
filesystem on a CF card in the CF slot while still being able to use
the Cardbus slot as usual. For added fun it's a Ricoh RL5c476
controller.

I've tried 2.6.17.6, 2.6.18rc6 and am currently at 2.6.18rc7.

Several issues:


1. Booting

Is it possible to let the regular IDE driver control slot 1 while
having yenta_socket running slot 0? This probably requires tricks
to make yenta_socket not reset the 5c476 completely on boot, since
it's being used by someone else as well.. Is it doable? Recommended?

If not, should I be able to have my root behind ide-cs? Currently
ide2 does not show up until after root has been mounted, long after
"pccard: PCMCIA card inserted into slot 1."


2. Socket power

I can confirm intermittent occurences of:

cs: pcmcia_socket0: unable to apply power

for both sockets. This is lots of fun. Same board, same LinuxBIOS,
on some boots everything works, on some boots I get the error.
Working is more common than the error, but once I start getting the
error it didn't go away until I left the board powered off for
several hours. (Over night, next day it would be working again.)

I'll contribute more info if/when I can reproduce more reliably.


3. Ejecting the CF causes slot 1 to stop working

On "working boots", I get this output:

--8<--
epia dev # dmesg|tail -n 22
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 200k freed
spurious 8259A interrupt: IRQ7.
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia: registering new device pcmcia1.0
Probing IDE interface ide2...
hde: SanDisk SDCFX-1024, CFA DISK drive
ide2 at 0x100-0x107,0x10e on irq 7
hde: max request size: 128KiB
hde: 2001888 sectors (1024 MB) w/1KiB Cache, CHS=1986/16/63
 hde: hde1
ide-cs: hde: Vpp = 0.0
-->8--

All is good. The card works. (Why Vpp=0 though?)

I just tried ejecting the CF and then resetting the board. It looks
pretty good..

--8<--
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 200k freed
spurious 8259A interrupt: IRQ7.
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
-->8--

..until I insert the CF:

--8<--
pccard: PCMCIA card inserted into slot 1
cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
cs: warning: no high memory space available!
-->8--

I am now unable to get the CF slot working again. Last night the slot
wasn't working but after being turned off over night it worked per
the first paste above.

Leaving the system off for several hours could possibly make the slot
work again, but why? Uninitialized register bits? Are register docs
available anywhere and are they known to be correct?


I've made a few attempts to tickle it but no progress:

I leave the card in the slot and reset (reset button) and get:

--8<--
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 200k freed
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
cs: warning: no high memory space available!
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: warning: no high memory space available!
-->8--

I try a power cycle leaving power off for just a few seconds:

--8<--
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 200k freed
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
cs: warning: no high memory space available!
cs: warning: no high memory space available!
-->8--

I try a power cycle leaving power off while I disconnect the ATX
power cable and the ethernet cable. Then I connect ATX and ethernet
and power on again:

--8<--
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 200k freed
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
cs: warning: no high memory space available!
cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x37f
cs: IO port probe 0x3e0-0x4ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
cs: warning: no high memory space available!
spurious 8259A interrupt: IRQ7.
-->8--

I just don't know.


LinuxBIOS has some init code for the 5c476 in order to be able to use
a CF in slot 1 as a regular IDE drive (to boot from CF using FILO)
but I just tried disabling this code and it did not affect my
results. Below is a snippet including an interesting comment.

--8<--
// set io window 0 for 1e0 - 1ef
/* note this now sets CF up on a contiguous I/O window of 16 bytes,
   0x1e0 to 0x1ef
   Be warned that this is not a standard IDE address as automatically
   detected by the likes of Filo, and would need patching to
   recognise these addresses as an IDE drive */
/* an earlier version of this driver set up 2 io windows to emulate
   the expected addresses for IDE2, however the pcmcia package within
   Linux then could not re-initiailse the device as it tried to take
   control of it. So I belive it is easier to patch Filo or the like
   to pick up this drive rather than playing silly games as the
   kernel tries to boot. */

  pc16->iostl0 = 0xe0;
  pc16->iosth0 = 1;
  pc16->iospl0 = 0xef;
  pc16->iosph0 = 1;
  pc16->ioffl0 = 0;
  pc16->ioffh0 = 0;

  // clear window 1
  pc16->iostl1 = 0;
  pc16->iosth1 = 0;
  pc16->iospl1 = 0;
  pc16->iosph1 = 0;
  pc16->ioffl1 = 0x0;
  pc16->ioffh1 = 0;
-->8--

..now, while this was true for pcmcia-cs I'm not sure if it's still
true with 2.6 pcmcia?


4. Rogue bit

Somtimes I get FILO and the IDE driver to work halfway with the CF
slot. However, bit 5 appears to be jammed low on some bytes for some
reason..

When forcing Linux to look for the CF card (0:a.1) with
ide2=0x1e0,0x1ec,9 I get:

--8<--
hde: probing with STATUS(0x50) instead of ALTSTATUS(0x00)
hde: SAnDiSk, CFA DISK drive
ide4: I/O resource 0x1E0-0x1E7 not free.
ide4: ports already in use, skipping probe
ide2 at 0x1e0-0x1e7,0x1ec on irq 9
hde: max request size: 128KiB
hde: 985056 sectors (504 MB) w/1KiB Cache, CHS=1986/16/31
 hde:<4>hde: lost interrupt
hde: lost interrupt
hde: lost interrupt
-->8--

Same CF, 1024 MB not 504.


I'd appreciate any comments you may have. Thanks in advance!


//Peter



More information about the linux-pcmcia mailing list