This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Peculiar Register Write problem


This is the code for initializing the CL-PS6700 PCMCIA controller.
Everything from PCCIRR1 on does not happen.  I've put this code inside a
function defined as "void CLPS6700Init (void)".  I then call this
function from within cf_hwr_init () of my PCMCIA driver.  I initialize
my driver by calling cf_init () from my simple ecos program.  Why would
I not be able to set PCCIRR1 and all the registers after that?  If I put
in those 4 lines after a call to cf_init (), the registers do get set
properly.

p.s.
PCCIRRx registers are write only but PCIOSR is R/W.

    // Initialize the controller
    *(unsigned char*)PEDDR      |= 0x02;		// +5V on
    *(unsigned char*)PEDR       |= 0x02;		// +5V on
    *(unsigned short*)PMPCON    |= 0x0002;		// +12V DC-DC
converter on
    *(unsigned *)SYSCON1        |= SYSCON1_EXCKEN;	// EXPCLK on
    *(unsigned short*)SYSCON2   |= SYSCON2_PCMCIA1;	// PCMCIA Slot 1
on
    
    
    *(unsigned*)PCSICR	&= 
        ~PCSICR_ENDIAN_CONVERSION;  // Disable byte swapping
    *(unsigned*)PCPMR	|= 0x3<<10;	// weak pull-up
    
    
    // Enable CL-PS6700 interrupts by writing to reserved registers
    *(unsigned*)PCCIRR1 = 0xFFFFFFFF;
    *(unsigned*)PCCIRR2 = 0xFFFFFFFF;
    *(unsigned*)PCCIRR3 = 0xFFFFFFFF;


    // Setup Interrupt output information
    *(unsigned*)PCIOSR = 0x7FF3;     // Card Detect on EINT1.  All
others FIQ


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]