We (my fellow employees and I) have been working on an MPC860-based target that is not unlike some we've developed in the past except that we have added a PCMCIA slot in which we use compact flash (CF) cards. The PCMCIA section design was based on Wind River's wrMdpPro8xx reference board and, being a VxWorks shop, we used the pccardlib.c and sys8xxPcmcia.c modules from wrMdpPro8xx BSP as our starting point to provide the target- specific portion of the PCMCIA drivers.
One hardware difference from the wrMdpPro8xx is that we omitted the circuits that control power to the PCMCIA slot. We thought that this was acceptable as it appeared that controlling power was all about hot swapping which we do not support.
We have discovered, however, that if the board is reset while a file is being read from the CF, the subsequent PCMCIA initialization sometimes fails to recognize and mount the CF file system, complaining about bad partition table data. Closer examination of the sys8xxPcmcia.c module reveals that power to the CF is turned off early in initialization and then later restored. We hacked in some FETs and added code to control power in a fashion similar to the wrMdpPro8xx and, sure enough, the problem goes away.
So we're going to spin the board to add the FETs but this will take time and there are already units in the field so I'm looking for a software solution to alleviate the problem in the mean time. I've tried a couple of different ways to command CF resets and one way of emptying CF buffers during PCMCIA initialization but with no success.
We're PCMCIA/CF newbies, so I'm asking whether anybody has a favorite way to ensure, without the luxury of power control, that a CF card in a PCMCIA slot is fully reset and ready for action.