Hi Mike,
Please see inline my responses below:
>>When I look at the memory map, that's not accessible:
>>/usr # cat /proc/iomem
>>00001000-00001000 : offset_jr0
>>…
>>40034000-400341ff : fsl-usb2-udc
>><-- Should have been here
>>40038000-40038fff : mxc_pwm.1
The information in /proc/iomem comes from the kernel driver mapping the I/O memory using ioremap. The PIT register is not visible in /proc/iomem for this reason.
>>And when I try to check out what value is in this region of memory:
>>unsigned int PIT_MCR = 0;
>>PIT_MCR = *((unsigned int *)(void *)(0x40037000));
>>printk("In the HW init\nPIT_MCR(0x4003_7000): %u\n", PIT_MCR);
>>the result is an Oops: Unable to handle kernel paging request at virtual address 40037000
>>pgd = 863c0000
>>[40037000] *pgd=00000000
>>Internal error: Oops: 5 [#1]
>>Which is not too surprising because it's not in the memory map. I'd like to ask what is different and what you had to do in order to
>>access/manipulate the memory in the PIT registers.
In order to access the registers, the driver / kernel module needs to map the physical memory to virtual memory using ioremap. Alternatively it can also be done using the MVF_IO_ADDRESS macro for Vybrid which returns the virtual memory address for a given physical address.
<Examples>
void __iomem *pit_mcr_register_base;
pit_mcr_register_base = MVF_IO_ADDRESS(0x40037000)
pit_mcr_register_val = readl(pit_mcr_register_base);
or
pit_mcr_register = (uint32_t *) ioremap(0x40037000, <size>)
pit_mcr_register_val = readl(pit_mcr_register);
Thanks,
Linux Engineer
Timesys Support