Hi,
I wrote a simple kernel mode driver for reading and writing registers on the OMAP3503/3530 processors. It was needed because our BSP does not provide a driver for the WDT2 watchdog timer and I also use it to enable some of the GPIO pins we use (need to switch them from safe mode to mux mode 4). It is a stream driver and reading and writing is done through DeviceIoControl() calls.
It works fine for reading and writing some registers and not for others. For example, I can read and write the CONTROL_PADCONF_CAM_D5 (0x48002120) and GPIO_DATAOUT for GPIO4 (0x4905403C) registers that deal with GPIO.
I cannot read or write the WSPR register for WDT2. I need to write a sequence of values to this register in order to enable the watchdog.
Here are the important calls in the driver:
// Map physical address to virtual address
DWORD *reg = (DWORD*)MmMapIoSpace(regPhysicalAddress, sizeof(DWORD), FALSE);
// Read register using CEDDK macro
ULONG regValue = READ_REGISTER_ULONG(reg);
The READ_REGISTER_ULONG call throws an exception for the WDT2 registers and some others that I tried but always works for GPIO-related registers. I can confirm that it works by looking at the GPIO lines with an oscilloscope. I also tried using BusTransBusAddrToVirtual() instead of MmMapIoSpace() but it returns the same virtual addresses and the same results.
Is there some security reason for why I seemingly do not have access to the WDT2 registers? And what do I need to fix/do in order to get access to them?
Thanks,
Ben