<?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>LayerscapeのトピックRe: LS1012A OCRAM Access</title>
    <link>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1653014#M12513</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/179917"&gt;@Gyosun&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;OCRAM should not be accessed from user space.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;It is restricted to Secure World access only by the CSU.&lt;/DIV&gt;
&lt;DIV&gt;Please refer to&amp;nbsp;&lt;STRONG&gt;Chapter 7 CSU, OCRAM, and MSCM &lt;/STRONG&gt;in LS1012ARM&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;One can look into ATF for OCRAM access.&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h&amp;amp;source=gmail&amp;amp;ust=1684486332442000&amp;amp;usg=AOvVaw2PoYMM76JGo2Y1-D3IhKdP"&gt;/plat/nxp/soc-ls1012a/include/&lt;WBR /&gt;ns_access.h&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;&lt;SPAN&gt;&lt;STRONG&gt;{CSU_CSLX_OCRAM, CSU_S_SUP_RW},&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial, sans-serif"&gt;here,ocram access is not given to userspace&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial, sans-serif"&gt;Thanks&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial, sans-serif"&gt;Khushbu&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 18 May 2023 09:30:04 GMT</pubDate>
    <dc:creator>khushbur</dc:creator>
    <dc:date>2023-05-18T09:30:04Z</dc:date>
    <item>
      <title>LS1012A OCRAM Access</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1650806#M12479</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I am using the LS1012A custom board and currently using LSDK1812.&lt;BR /&gt;I would like to use OCRAM, but when I try to read it with devmem,&lt;BR /&gt;it seems that I don't have the access permission.&lt;BR /&gt;I would appreciate it if you could let me know what I should do to read and write to it.&lt;/P&gt;&lt;P&gt;[root@LS1012A ~]# devmem 0x10000000&lt;BR /&gt;[&amp;nbsp; 238.273220] Unhandled fault: synchronous external abort (0x92000210) at 0x0000ffff920f1000&lt;BR /&gt;Bus error&lt;BR /&gt;[root@LS1012A ~]#&lt;/P&gt;&lt;P&gt;Thank you.&lt;BR /&gt;Best regards.&lt;BR /&gt;Gyosun.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 05:53:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1650806#M12479</guid>
      <dc:creator>Gyosun</dc:creator>
      <dc:date>2023-05-16T05:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: LS1012A OCRAM Access</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1653014#M12513</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/179917"&gt;@Gyosun&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;OCRAM should not be accessed from user space.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;It is restricted to Secure World access only by the CSU.&lt;/DIV&gt;
&lt;DIV&gt;Please refer to&amp;nbsp;&lt;STRONG&gt;Chapter 7 CSU, OCRAM, and MSCM &lt;/STRONG&gt;in LS1012ARM&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;One can look into ATF for OCRAM access.&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h&amp;amp;source=gmail&amp;amp;ust=1684486332442000&amp;amp;usg=AOvVaw2PoYMM76JGo2Y1-D3IhKdP"&gt;/plat/nxp/soc-ls1012a/include/&lt;WBR /&gt;ns_access.h&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;&lt;SPAN&gt;&lt;STRONG&gt;{CSU_CSLX_OCRAM, CSU_S_SUP_RW},&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial, sans-serif"&gt;here,ocram access is not given to userspace&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial, sans-serif"&gt;Thanks&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial, sans-serif"&gt;Khushbu&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 May 2023 09:30:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1653014#M12513</guid>
      <dc:creator>khushbur</dc:creator>
      <dc:date>2023-05-18T09:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: LS1012A OCRAM Access</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1653071#M12516</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Khushbu,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;If you could please provide an example of using devmem to set access permissions for CSU OCRAM and read/write to OCRAM, I would greatly appreciate it.&lt;/P&gt;&lt;P&gt;In addition, I tried the following in u-boot, but the CSU_CSL register is not changed.&lt;/P&gt;&lt;P&gt;=&amp;gt; md.l 1510000 8&lt;BR /&gt;01510000: ff00ff00 ff00ff00 &lt;STRONG&gt;ff002200&lt;/STRONG&gt; 2200ff00 ........."....."&lt;BR /&gt;01510010: ff00ff00 ff00ff00 3300ff00 33003300 ...........3.3.3&lt;BR /&gt;=&amp;gt; mw.l 1510008 &lt;STRONG&gt;22002200&lt;/STRONG&gt;&lt;BR /&gt;=&amp;gt; md.l 1510000 8&lt;BR /&gt;01510000: ff00ff00 ff00ff00 &lt;STRONG&gt;ff002200&lt;/STRONG&gt; 2200ff00 ........."....."&lt;BR /&gt;01510010: ff00ff00 ff00ff00 3300ff00 33003300 ...........3.3.3&lt;BR /&gt;=&amp;gt; md.l 10000000 8&lt;BR /&gt;10000000:"Synchronous Abort" handler, esr 0x96000210&lt;BR /&gt;elr: 0000000082058a2c lr : 00000000820589a8 (reloc)&lt;BR /&gt;elr: 0000000097ba7a2c lr : 0000000097ba79a8&lt;BR /&gt;x0 : 0000000000000009 x1 : 000000000000003a&lt;BR /&gt;x2 : 0000000000000020 x3 : 0000000010000000&lt;BR /&gt;x4 : 0000000000000000 x5 : 0000000097bbccdd&lt;BR /&gt;x6 : 0000000000000004 x7 : 000000000000000f&lt;BR /&gt;x8 : 00000000ffffffd0 x9 : 0000000000000008&lt;BR /&gt;x10: 0000000000000010 x11: 0000000000000006&lt;BR /&gt;x12: 000000000001869f x13: 0000000000000c10&lt;BR /&gt;x14: 0000000097b0ceac x15: 0000000000000008&lt;BR /&gt;x16: 0000000000000000 x17: 0000000000000000&lt;BR /&gt;x18: 0000000097b0ed80 x19: 0000000000000008&lt;BR /&gt;x20: 0000000010000000 x21: 0000000010000000&lt;BR /&gt;x22: 0000000097bbb778 x23: 0000000000000008&lt;BR /&gt;x24: 0000000000000004 x25: 0000000000000004&lt;BR /&gt;x26: 0000000000000004 x27: 0000000097b0ccb8&lt;BR /&gt;x28: 0000000000000000 x29: 0000000097b0cc30&lt;/P&gt;&lt;P&gt;Resetting CPU ...&lt;/P&gt;&lt;P&gt;### ERROR ### Please RESET the board ###&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;BR /&gt;Gyosun.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 12:58:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1653071#M12516</guid>
      <dc:creator>Gyosun</dc:creator>
      <dc:date>2023-05-18T12:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: LS1012A OCRAM Access</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1656595#M12545</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/179917"&gt;@Gyosun&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please refer ATF code for OCRAM access.&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h" target="_blank" rel="noopener nofollow noreferrer" data-saferedirecturl="https://www.google.com/url?q=https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h&amp;amp;source=gmail&amp;amp;ust=1684486332442000&amp;amp;usg=AOvVaw2PoYMM76JGo2Y1-D3IhKdP"&gt;/plat/nxp/soc-ls1012a/include/&lt;WBR /&gt;ns_access.h&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;&lt;SPAN&gt;&lt;STRONG&gt;{CSU_CSLX_OCRAM, CSU_S_SUP_RW},&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/soc.c" target="_self"&gt;&lt;SPAN class="pl-c1"&gt;https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/soc.c&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-c1"&gt;enable_layerscape_ns_access&lt;/SPAN&gt;&lt;SPAN&gt;(ns_dev, &lt;/SPAN&gt;&lt;SPAN class="pl-c1"&gt;ARRAY_SIZE&lt;/SPAN&gt;&lt;SPAN&gt;(ns_dev), NXP_CSU_ADDR);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Khushbu&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 11:12:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1656595#M12545</guid>
      <dc:creator>khushbur</dc:creator>
      <dc:date>2023-05-24T11:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: LS1012A OCRAM Access</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1657149#M12548</link>
      <description>&lt;P&gt;Hi&amp;nbsp;khushbur,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code to enable OCRAM was simply written by referring to the code as follows.&lt;/P&gt;&lt;P&gt;void mmap_init(uint8_t **pp_vaddr, uint64_t baddr, uint32_t size)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; int fd;&lt;BR /&gt;&amp;nbsp; fd = open("/dev/mem", O_RDWR | O_SYNC);&lt;BR /&gt;&amp;nbsp; *pp_vaddr = (uint8_t *)mmap64(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, baddr);&lt;BR /&gt;&amp;nbsp; close(fd);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void enable_layerscape_ns_access(void)&lt;BR /&gt;{&lt;BR /&gt;#define CSU_CSLX_OCRAM (4)&lt;BR /&gt;#define CSU_S_SUP_RW (0x22U)&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t *base;&lt;BR /&gt;&amp;nbsp; uint32_t *reg;&lt;BR /&gt;&amp;nbsp; uint32_t val;&lt;BR /&gt;&amp;nbsp; printf("%s\n", __func__);&lt;BR /&gt;&amp;nbsp; mmap_init((uint8_t **)&amp;amp;base, 0x01510000, 0x1000);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; reg = base + CSU_CSLX_OCRAM / 2U;&lt;BR /&gt;&amp;nbsp; val = be32toh(*(volatile uint32_t*)((uintptr_t)reg));&lt;BR /&gt;&amp;nbsp; if (CSU_CSLX_OCRAM % 2U == 0U) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; val &amp;amp;= 0x0000ffffU;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; val |= CSU_S_SUP_RW &amp;lt;&amp;lt; 16U;&lt;BR /&gt;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; val &amp;amp;= 0xffff0000U;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; val |= CSU_S_SUP_RW;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; *(volatile uint32_t*)(uintptr_t)reg = htobe32(val);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;However, when reading the value with devmem, the value is not reflected.&lt;/P&gt;&lt;P&gt;[root@LS1012A ]# devmem 0x1510008&lt;BR /&gt;0xFF002200&lt;BR /&gt;[root@LS1012A ]# ./test&lt;BR /&gt;enable_layerscape_ns_access&lt;BR /&gt;[root@LS1012A ]# devmem 0x1510008&lt;BR /&gt;0xFF002200&lt;BR /&gt;[root@LS1012A ]#&lt;/P&gt;&lt;P&gt;What more do we need to do?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gyosun.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 01:18:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1657149#M12548</guid>
      <dc:creator>Gyosun</dc:creator>
      <dc:date>2023-05-25T01:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: LS1012A OCRAM Access</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1659932#M12574</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/179917"&gt;@Gyosun&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can not update CSU from linux user space.&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please refer ATF code for OCRAM access.&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h" target="_blank" rel="noopener nofollow noreferrer" data-saferedirecturl="https://www.google.com/url?q=https://github.com/nxp-qoriq/atf/blob/lf_v2.6/plat/nxp/soc-ls1012a/include/ns_access.h&amp;amp;source=gmail&amp;amp;ust=1684486332442000&amp;amp;usg=AOvVaw2PoYMM76JGo2Y1-D3IhKdP"&gt;/plat/nxp/soc-ls1012a/include/&lt;WBR /&gt;ns_access.h&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;&lt;SPAN&gt;&lt;STRONG&gt;{CSU_CSLX_OCRAM, CSU_S_SUP_RW}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;Thanks&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="arial, sans-serif"&gt;Khushbu&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 May 2023 11:55:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1012A-OCRAM-Access/m-p/1659932#M12574</guid>
      <dc:creator>khushbur</dc:creator>
      <dc:date>2023-05-30T11:55:59Z</dc:date>
    </item>
  </channel>
</rss>

