<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>S32GのトピックPermission denied when accessing STM2 SoC Level Time Source</title>
    <link>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1412292#M516</link>
    <description>&lt;P&gt;&lt;FONT size="3"&gt;Hi all,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;I'm getting the following errors when trying to use the STM2 driver as shown in &lt;EM&gt;Chapter 14:&amp;nbsp;&lt;SPAN&gt;SoC Level Time Source&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt; in the Linux BSP 30.0 user manual.&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Init driver&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@s32g274ardb2:~# echo 1 &amp;gt; /sys/devices/platform/40124000.stm/init
-sh: /sys/devices/platform/40124000.stm/init: Permission denied&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Reading Timer Value&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@s32g274ardb2:~# cat /sys/devices/platform/40124000.stm/value
cat: /sys/devices/platform/40124000.stm/value: No such file or directory&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;The kernel has been patched successfully and &lt;EM&gt;bitbake virtual/kernel&lt;/EM&gt;&amp;nbsp;generated Image and dtb without any errors. This is confirmed by looking at the runtime kernel config:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@s32g274ardb2:~# zcat /proc/config.gz | grep GLOBAL
CONFIG_FSL_GLOBAL_TIME_STM=m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Kernel Config&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;In&amp;nbsp;&lt;STRONG&gt;fsl-s32-gen1.dtsi&lt;/STRONG&gt; (&lt;EM&gt;tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/boot/dts/freescale/fsl-s32-gen1.dtsi&lt;/EM&gt;), I changed the status of the STM2 device node to "okay":&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;stm2: stm@40124000{
	compatible = "fsl,s32gen1-stm-global";
	reg = &amp;lt;0x0 0x40124000 0x0 0x3000&amp;gt;;
	clocks = &amp;lt;&amp;amp;clks S32GEN1_SCMI_CLK_STM_MODULE&amp;gt;;
	clock-names = "stm";
	status = "okay";
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;In &lt;STRONG&gt;s32gen1_defconfig&lt;/STRONG&gt; (&lt;EM&gt;tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/configs/s32gen1_defconfig&lt;/EM&gt;) CONFIG_FSL_GLOBAL_TIME_STM=m was appended to the end like so:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
# CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_FSL_GLOBAL_TIME_STM=m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then created a patch and copied it to&amp;nbsp;&lt;I&gt;sources/meta-alb/recipes-kernel/linux/linux-s32,&amp;nbsp;&lt;/I&gt;which get append to the end of linux-s32_5.10.bb file like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
SRC_URI += " file://0001-Enable-Global-Time-Source-and-STM2-device-tree.patch"&lt;/LI-CODE&gt;&lt;P&gt;After this, kernel is cleaned and build with the following commands:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bitbake -c cleansstate virtual/kernel
bitbake virtual/kernel&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The output Image and DTS file is transferred to SD card FAT partition and everything booted up successfully.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Feb 2022 08:02:38 GMT</pubDate>
    <dc:creator>kawin</dc:creator>
    <dc:date>2022-02-11T08:02:38Z</dc:date>
    <item>
      <title>Permission denied when accessing STM2 SoC Level Time Source</title>
      <link>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1412292#M516</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;Hi all,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;I'm getting the following errors when trying to use the STM2 driver as shown in &lt;EM&gt;Chapter 14:&amp;nbsp;&lt;SPAN&gt;SoC Level Time Source&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt; in the Linux BSP 30.0 user manual.&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Init driver&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@s32g274ardb2:~# echo 1 &amp;gt; /sys/devices/platform/40124000.stm/init
-sh: /sys/devices/platform/40124000.stm/init: Permission denied&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Reading Timer Value&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@s32g274ardb2:~# cat /sys/devices/platform/40124000.stm/value
cat: /sys/devices/platform/40124000.stm/value: No such file or directory&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;The kernel has been patched successfully and &lt;EM&gt;bitbake virtual/kernel&lt;/EM&gt;&amp;nbsp;generated Image and dtb without any errors. This is confirmed by looking at the runtime kernel config:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@s32g274ardb2:~# zcat /proc/config.gz | grep GLOBAL
CONFIG_FSL_GLOBAL_TIME_STM=m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Kernel Config&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;In&amp;nbsp;&lt;STRONG&gt;fsl-s32-gen1.dtsi&lt;/STRONG&gt; (&lt;EM&gt;tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/boot/dts/freescale/fsl-s32-gen1.dtsi&lt;/EM&gt;), I changed the status of the STM2 device node to "okay":&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;stm2: stm@40124000{
	compatible = "fsl,s32gen1-stm-global";
	reg = &amp;lt;0x0 0x40124000 0x0 0x3000&amp;gt;;
	clocks = &amp;lt;&amp;amp;clks S32GEN1_SCMI_CLK_STM_MODULE&amp;gt;;
	clock-names = "stm";
	status = "okay";
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;In &lt;STRONG&gt;s32gen1_defconfig&lt;/STRONG&gt; (&lt;EM&gt;tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/configs/s32gen1_defconfig&lt;/EM&gt;) CONFIG_FSL_GLOBAL_TIME_STM=m was appended to the end like so:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
# CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_FSL_GLOBAL_TIME_STM=m&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then created a patch and copied it to&amp;nbsp;&lt;I&gt;sources/meta-alb/recipes-kernel/linux/linux-s32,&amp;nbsp;&lt;/I&gt;which get append to the end of linux-s32_5.10.bb file like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
SRC_URI += " file://0001-Enable-Global-Time-Source-and-STM2-device-tree.patch"&lt;/LI-CODE&gt;&lt;P&gt;After this, kernel is cleaned and build with the following commands:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bitbake -c cleansstate virtual/kernel
bitbake virtual/kernel&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The output Image and DTS file is transferred to SD card FAT partition and everything booted up successfully.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 08:02:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1412292#M516</guid>
      <dc:creator>kawin</dc:creator>
      <dc:date>2022-02-11T08:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Permission denied when accessing STM2 SoC Level Time Source</title>
      <link>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1413530#M526</link>
      <description>&lt;P&gt;Hi Kawin&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;In&amp;nbsp;s32gen1_defconfig&amp;nbsp;(tmp/work/s32g274ardb2-fsl-linux/linux-s32/5.10.41-r0/git/arch/arm64/configs/s32gen1_defconfig) CONFIG_FSL_GLOBAL_TIME_STM=m&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;That is not going to work. You should enable the global stm timer from menuconfig menu with 'bitbake -c menuconfig virtual/kernel'.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="src" data-group="2-1"&gt;Device Drivers -&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="src" data-group="2-2"&gt;Clock Source drivers-&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andrei_skok_0-1644912828618.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/170546iF96398A8319AB030/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andrei_skok_0-1644912828618.png" alt="andrei_skok_0-1644912828618.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;save and re-compile the kernel.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Below is the test procedure&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;step1. Boot to reach the Linux console.&lt;/P&gt;
&lt;P&gt;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"&lt;/P&gt;
&lt;P&gt;step3.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andrei_skok_1-1644912828528.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/170545iC7F5A803DA826C1F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andrei_skok_1-1644912828528.png" alt="andrei_skok_1-1644912828528.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This should be a document description error.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 08:16:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1413530#M526</guid>
      <dc:creator>andrei_skok</dc:creator>
      <dc:date>2022-02-15T08:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Permission denied when accessing STM2 SoC Level Time Source</title>
      <link>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1414253#M542</link>
      <description>&lt;P&gt;Hi Andrei,&lt;/P&gt;&lt;P&gt;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 -&amp;gt; clean -&amp;gt; build work? Since a patch should get applied before the compilation.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Kawin&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 08:05:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1414253#M542</guid>
      <dc:creator>kawin</dc:creator>
      <dc:date>2022-02-16T08:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Permission denied when accessing STM2 SoC Level Time Source</title>
      <link>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1415233#M551</link>
      <description>&lt;P&gt;Hi Kawin&lt;/P&gt;
&lt;P&gt;Sorry, I misunderstood your question before.&lt;/P&gt;
&lt;P&gt;There is nothing wrong with your operation. Did you forget to load the '*stm.ko' module ?&lt;/P&gt;
&lt;P&gt;In addition, you can run the 'git status' command in the linux kernel directory to check whether the patch has been applied.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 10:44:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Permission-denied-when-accessing-STM2-SoC-Level-Time-Source/m-p/1415233#M551</guid>
      <dc:creator>andrei_skok</dc:creator>
      <dc:date>2022-02-17T10:44:21Z</dc:date>
    </item>
  </channel>
</rss>

