I am trying to set the PXP CSC2 registers in an IMX6SX, similar to this post.
To begin with I simply attempt to read the PXP_CTRL register at 0x2218000
My code looks like this:
import ctypes
import mmap
def read_word(address):
with open('/dev/mem', 'rb') as f:
mem = mmap.mmap(f.fileno(), mmap.PAGESIZE, mmap.MAP_SHARED, mmap.PROT_READ, offset=address&~(mmap.PAGESIZE-1))
s = ctypes.c_uint32.from_buffer_copy(mem, address&(mmap.PAGESIZE-1))
mem.close()
return s
print(read_word(0x2218000))
The result is that the kernel hangs with no error.
I am able to read other registers (for example GPIOs at 0x20E0014).
I have the PXP enabled and clocks configured in the device tree:
pxp: pxp@2218000 {
compatible = "fsl,imx6sx-pxp-dma", "fsl,imx6sl-pxp-dma", "fsl,imx6dl-pxp-dma";
reg = <0x02218000 0x4000>;
interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6SX_CLK_PXP_AXI>,
<&clks IMX6SX_CLK_DISPLAY_AXI>;
clock-names = "pxp-axi", "disp-axi";
power-domains = <&pd_disp>;
status = "okay";
};
Is there anything else I need to set up before I can read/set the PXP registers?