Hi all,
I'm getting the following errors when trying to use the STM2 driver as shown in Chapter 14: SoC Level Time Source in the Linux BSP 30.0 user manual.
Init driver
root@s32g274ardb2:~# echo 1 > /sys/devices/platform/40124000.stm/init
-sh: /sys/devices/platform/40124000.stm/init: Permission denied
Reading Timer Value
root@s32g274ardb2:~# cat /sys/devices/platform/40124000.stm/value
cat: /sys/devices/platform/40124000.stm/value: No such file or directory
The kernel has been patched successfully and bitbake virtual/kernel generated Image and dtb without any errors. This is confirmed by looking at the runtime kernel config:
root@s32g274ardb2:~# zcat /proc/config.gz | grep GLOBAL
CONFIG_FSL_GLOBAL_TIME_STM=m
Kernel Config
In fsl-s32-gen1.dtsi (tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/boot/dts/freescale/fsl-s32-gen1.dtsi), I changed the status of the STM2 device node to "okay":
stm2: stm@40124000{
compatible = "fsl,s32gen1-stm-global";
reg = <0x0 0x40124000 0x0 0x3000>;
clocks = <&clks S32GEN1_SCMI_CLK_STM_MODULE>;
clock-names = "stm";
status = "okay";
};
In s32gen1_defconfig (tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/configs/s32gen1_defconfig) CONFIG_FSL_GLOBAL_TIME_STM=m was appended to the end like so:
...
# CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_FSL_GLOBAL_TIME_STM=m
I then created a patch and copied it to sources/meta-alb/recipes-kernel/linux/linux-s32, which get append to the end of linux-s32_5.10.bb file like so:
...
SRC_URI += " file://0001-Enable-Global-Time-Source-and-STM2-device-tree.patch"
After this, kernel is cleaned and build with the following commands:
bitbake -c cleansstate virtual/kernel
bitbake virtual/kernel
The output Image and DTS file is transferred to SD card FAT partition and everything booted up successfully.
Solved! Go to Solution.
Hi Kawin
Sorry, I misunderstood your question before.
There is nothing wrong with your operation. Did you forget to load the '*stm.ko' module ?
In addition, you can run the 'git status' command in the linux kernel directory to check whether the patch has been applied.
Hi Kawin
Sorry, I misunderstood your question before.
There is nothing wrong with your operation. Did you forget to load the '*stm.ko' module ?
In addition, you can run the 'git status' command in the linux kernel directory to check whether the patch has been applied.
Hi Kawin
In s32gen1_defconfig (tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/configs/s32gen1_defconfig) CONFIG_FSL_GLOBAL_TIME_STM=m
That is not going to work. You should enable the global stm timer from menuconfig menu with 'bitbake -c menuconfig virtual/kernel'.
Device Drivers ->Clock Source drivers->
save and re-compile the kernel.
Below is the test procedure
step1. Boot to reach the Linux console.
step2. Insert the 'fsl_global_time.ko' kernel module with "insmod /lib/modules/5.10.41-rt42+g98b692708f63/kernel/drivers/clocksource/fsl_global_time.ko"
step3.
This should be a document description error.
Hi Andrei,
Could you give me some explanation on why patching defconfig directly wouldn't work? Is there a mistake in the documentation? In any case, should general procedure of patch -> clean -> build work? Since a patch should get applied before the compilation.
Thank you,
Kawin