I am starting out to developed a device driver for the eSDHC peripheral on the P1021. In section 18.104.22.168 Card Detect of the P1021 QorIQ Integrated Processor Reference Manual (Document Number: P1021RM, Rev. 5, 06/2011), it outlines what is needed to initialize the hardware in order to detect a card insertion (card detect). Unfortunately, I am unable to get this working, so I have a few questions and observations of what I am seeing.
As a general statement, I perform a reset of the controller by setting SYSCTL[RSTA] and wait for it to clear. Next, the clock is set as close as possible to 400 KHz. In addition, I am using the P1021 Moduled Development System Processor Board (P1021-MDS-PB) as my current target.
1) It seems that when I have IRQSIGEN[CINSIEN] set, I am seeing a constantly interrupt generated. During the service routine handler, the IRQSTAT register is read and then written back to clear the interrupts, but I don't see this flag (IRQSTAT[CINS]) every get cleared, why????
2) What is odd, is that I am seeing an IRQSTAT[CINS] interrupt even when there is not card present in the system, how can that be??
3) During the configuration, both Card Insert and Card Removal events for the Interrupt Status Enable, IRQSIGEN, and Interrupt Signal Enable , IRQSTATEN, are configured (i.e., set to '1'). I never see a Card Removal even when I insert the card and remove it.
4) I don't understand why there is a Interrupt Status Enable and Interrupt Signal Enable registers? Is the Interrupt Status Enable meant to be use for a system that will implement polling of the Interrupt Status (IRQSTAT) register? If that is the case, if I were to use interrupts then I shouldn't need to configure the Interrupt Status Enable register at all, right? Are they meant to be used in a mutual exclusive manner?
5) I have tried using interrupts, via the IRQSIGEN register, and a polling mechanism, via the IRQSTATEN, but can't can't seem to get them to work properly. I am always seeing a Card Insertion event that never clears and occurs even when there is not card in the system.
6) Is there another peripheral that I need to configure or register(s) somewhere in order to use the eSDHC peripheral? For example, does the eSDHC use one of the QUICCK engines which I need to configure?