Hi! I am working on a project where I need to use one the GPT1 timer that is available on the IMX8QM. So far I have been trying to modify the device-tree and add the GPT node as follows:
lsio_gpt1: gpt@5d150000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "fsl,imx8qm-gpt";
reg = <0x5d150000 0x10000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&gpt1_lpcg 0>, <&clk_gpt_3m 0>;
clock-names = "ipg", "per";
power-domains = <&pd IMX_SC_R_GPT_1>;
status = "okay";
};
The device-tree compiles just fine using the torizoncore-builder tool and torizon-core-docker 5.7.2. The device-tree base I have been trying to use is the arm64/boot/dts/freescale/imx8qm-apalis-v1.1-ixora-v1.2.dts
from the toradex-linux repository on branch toradex_5.4-2.3.x-imx
as I was not able to get the 5.15
version to boot.
When I try to access memory from GPT1 at address 0x5D150000 using the /dev/mem
driver and mmap
, I get a bus error, and if I use my custom GPT driver to access it, the device crashes and reboots.
I have been investigating the use of the /dev/mem
device a bit as well, and have found that i get the same bus-error when i try to access some of the peripherals that should be enabled in the device-tree by default (such as pwm). So maybe I am using this in a way that it is not intended?
In short; I am unable to access the memory of GPT1 at 0x5D150000 even if I have enabled it through the device-tree. I am using an apalis IMX8QM on an Ixora-v1.2 board.