10-13-2011 06:11 AM
I am trying to write a Linux driver for accessing the FPGA through the EMIFA bus.
I am unable to access the EMIFA control registers at 0x68000000.
I wrote the following the code:
if (resrc== NULL)
printk("resource not allocated\n");
location = (unsigned int *)ioremap_nocache(0x68000000,64);
printk("AEMIFA CTL BASE NOT AVAILABLE\n");
regval = readl(location);
regval = ioread32(location);
I have tried to use both ioread32 as well as readl functions but I always get 0 as return values.
The value expected is 0x4000 0205h. Its a read only location so there is no question of something else overwriting the register.
I get the correct value when I access the same register in u-boot.
10-18-2011 12:05 AM
I was able to recreate the same results as you and I am also perplexed by this behavior.
If I run the following code to read the JTAG ID register:
jtag_id_reg = ioread32(0xFEC14018);
printk(KERN_WARNING "Read JTAGID 0x%08X\n",jtag_id_reg);
I observe the expected value of 0x1B7D102F but when reading the EMIFA module ID register I also read back 0x00000000. One might expect this behavior if the EMIFA controller was powered down or disabled internally. I tried dumping the PSC0 status registers from the same driver, but I am not sure if all of those values make sense either:
PSC0 REVID: 0x44825A00
PSC0 MDSTAT0: 0x00001E03
PSC0 MDSTAT1: 0x00000E02
PSC0 MDSTAT2: 0x00001E03
PSC0 MDSTAT3: 0x00001E03
PSC0 MDSTAT4: 0x00000E02
PSC0 MDSTAT5: 0x00001E03
PSC0 MDSTAT6: 0x00001E03
PSC0 MDSTAT7: 0x00000000
PSC0 MDSTAT8: 0x00001E03
PSC0 MDSTAT9: 0x00001E03
PSC0 MDSTAT10: 0x00000000
PSC0 MDSTAT11: 0x00000000
PSC0 MDSTAT12: 0x00001E03
PSC0 MDSTAT13: 0x00000000
PSC0 MDSTAT14: 0x00000000
PSC0 MDSTAT15: 0x00000000
From u-boot, I see the power on values as:
01c10000: 44825a00 00000000 00000000 00000000 .Z.D............
01c10800: 00001e03 00001e03 00001e03 00001e03 ................
01c10810: 00001e03 00001e03 00001e03 00001e03 ................
01c10820: 00001e03 00001e03 00001e03 00001e03 ................
01c10830: 00001e03 00000a00 00001f03 00001d03 ................
I would recommend posting this issue to the TI E2E forums to see if there is something obvious that is being overlooked here.
P.S. Out of curiousity, what is the value of resrc after your call to request_mem_region()