Hi
Found a few minor issues when stressing the ATA + EMIF together
So here is what I did to work around the problems
1. Using the hdparm utility (hdparm -d 0 -r 0 -p 0 /dev/had) --> to put
the hdd into a non-dma, slow mode
2. use this sequence shown below to swap between HDD and EMIF
// read current state if PINMUX0
register
lock_kernel();
local_irq_save(flags); // key here is
to stop the scheduler for switching to some ATA related task
pmr=__REG(DAVINCI_SYSTEM_MODULE_BASE);
tpmr=pmr;
tpmr&=~(1<<17); // restore normal
operations to EMIF (i.e. shut off ATA mode)
__REG(DAVINCI_SYSTEM_MODULE_BASE)=tpmr;
__REG(DAVINCI_ASYNC_EMIF_CNTRL_BASE+0x14)=0x3FFFFFD; // 16-bit slow bus on
CS3
for (delay=0;delay<100;delay++)
asm("nop"); // timing for back-to-back on the CPLD
__MWR(MDIC_REG_BASE+8)=1; // issue hw
reset
for (delay=0;delay<100000;delay++)
asm("nop"); // timing for back-to-back on the CPLD
__MWR(MDIC_REG_BASE+8)=0; // release hw
reset
for (delay=0;delay<100000;delay++)
asm("nop"); // timing for back-to-back on the CPLD
__MWR(MDIC_REG_BASE+8)=2; // allow clock
to run again
for (delay=0;delay<100000;delay++)
asm("nop"); // timing for back-to-back on the CPLD
__REG(DAVINCI_SYSTEM_MODULE_BASE+0x14)=tpmra; // back to the way we were
__REG(DAVINCI_SYSTEM_MODULE_BASE)=pmr;
// back to the way we were
local_irq_restore(flags);
unlock_kernel();
for (delay=0;delay<100000;delay++)
asm("nop");
break;
Steve Spano, President
Finger Lakes Engineering
607-277-1614
www.fl-eng.com
[EMAIL PROTECTED]
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source