I want to read MIO status in driver.
Dev_LOG_ADDR = ioremap(0xe000a000, 0x1000);
#define REG_DATA_0tt(Dev_LOG_ADDR+0x40)
#define REG_DATA_0_ROtt(Dev_LOG_ADDR+0x60)
I test the speed of writing MIO0 with oscilloscope:
while(1){
*(volatile int *)(REG_DATA_0)=1;
*(volatile int *)(REG_DATA_0)=0;tt
}
The speed is about 25Mhz.
But if add reading status of IO:
while(1){
*(volatile int *)(REG_DATA_0)=1;
dat=*(volatile int *)(REG_DATA_0_RO);
*(volatile int *)(REG_DATA_0)=0;tt
}
The speed is much slower,and the reading speed is only 7Mhz.
Why the reading REG is much slower than write REG?
And I change REG_DATA_0_RO to other REG such as REG_DIRM_0, the speed of reading is also very slow.