Thanks for the help everyone, I think I know where to go from here now. John, I am fairly certain ioremap works with physical addresses. Its declaration is ioremap(phys_addr_t phys_addr, size_t size). I did try 0xFD038000 anyway and it gave the wrong result for the revision number of the McASP.
Charles, after some additional googling, I think you are correct. Because I have the McASP disabled in the device tree, it is turned off and cannot be accessed. I'm not exactly sure how to turn the McASP/clocks on, but will start looking in the TRM. On Thursday, December 17, 2015 at 3:39:57 PM UTC-5, [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 > On Thursday, December 17, 2015 at 3:39:57 PM UTC-5, [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 --- 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.
