I believe ioremap works on virtual memory and not on physical memory so you 
have to take into account the MMU translation. Look in 

arch/arm/mach-omap2/iomap.h

#define MA33XX_L4_WK_IO_OFFSET 0Xb5000000

This will translate your McASP address to 0xfa038000. Try that and see if that 
works.


Regards,
John




> On Dec 17, 2015, at 12:04 PM, [email protected] wrote:
> 
> I am trying to access the McASP control registers. Reading from the first one 
> fails with the  kernel oops stating "external abort on non-linefetch 
> (0x1028)". I dont know what that means. A minimum failing example of the code 
> is below:
> 
> #include <linux/module.h>
> #include <linux/printk.h>
> #include <asm/io.h>
> 
> #define MCASP_START 0x48038000
> #define MCASP_LENGTH    0x2000
> #define PFUNC_REG_OFFSET 0x10
> 
> static int start(void)
> {
>    pr_info("Calling for ioremap\n");
>    void *mcasp = ioremap(MCASP_START, MCASP_LENGTH);
>    if(mcasp == NULL) {
>       pr_info("ioremap failed!\n");
>       return -1;
>    }
> 
>    u32 pfunc_reg = ioread32(mcasp + PFUNC_REG_OFFSET); // Kernel Oops here!
>    pr_info("Success! PFUNC=%08X\n", test);
>    iounmap(mcasp);
>    return 0;
> }
> module_init(start);
> 
> I have also tried request_mem_region around it, but that changes nothing. The 
> sound drivers are not loaded, and the devicetree entry for the McASP is 
> disabled, so there shouldn't be any problems with conflicts.
> 
> Any help is greatly appreciated.
> Marc
> 
> -- 
> For more options, visit http://beagleboard.org/discuss 
> <http://beagleboard.org/discuss>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to