<?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>i.MX ProcessorsのトピックRe: Can the Linux user space call the SCFW API?</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045406#M234076</link>
    <description>&lt;P&gt;0xC80 = 3200 bytes = 800 words.&lt;/P&gt;
&lt;P&gt;Word 722 (decimal) is at byte offset 0xB48, which reads 0x00000000 in your dump. Try hexdump -v, so that hexdump does not squeeze lines.&lt;/P&gt;
&lt;P&gt;I must confess I never tried and burn fuses through nvmem, but the Linux driver seems to support it.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2025 10:42:56 GMT</pubDate>
    <dc:creator>seb_haezebrouck</dc:creator>
    <dc:date>2025-02-17T10:42:56Z</dc:date>
    <item>
      <title>Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2044949#M234047</link>
      <description>&lt;P&gt;Or is it a kernel space only operation?&lt;/P&gt;&lt;P&gt;I would like to burn fuses in Linux for the imx8 Quad Max, and using uboot/serial loader is problematic due to the design of the product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 13:16:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2044949#M234047</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-02-16T13:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2044954#M234048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/198929"&gt;@flobro&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The fuses are exposed already to the userspace. See&amp;nbsp;&lt;A href="https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/drivers/nvmem/imx-ocotp-scu.c" target="_blank"&gt;linux-imx/drivers/nvmem/imx-ocotp-scu.c at lf-6.6.y · nxp-imx/linux-imx · GitHub&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;You can open /sys/devices/platform/scu/scu:imx8qx-ocotp/imx-scu-ocotp0/nvmem (or a similar path for QM), and perform read/write at the proper offsets in the file to access or burn fuses. The nvmem file is a raw binary access to the whole fusemap. Just fseek to the proper offset and fread / fwrite the proper number of bytes. I'd suggest you do read trials first to make sure you get your offsets right, as burning the wrong fuses could irremediably brick your device.&lt;/P&gt;
&lt;P&gt;fuse words 16 and 17 are good candidates, they store the device unique ID, which you can retrieve from uboot, or a sysfs entry (/sys/devices/soc0/... from memory.)&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Sebastien&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 16:01:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2044954#M234048</guid>
      <dc:creator>seb_haezebrouck</dc:creator>
      <dc:date>2025-02-16T16:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2044963#M234049</link>
      <description>&lt;P&gt;I have read that all fuses are not accessible via nvmem.&lt;/P&gt;&lt;P&gt;I would like to burn the SRK fuses and other security fuses... I also an having trouble mapping the fusebanks that would be used in uboot to figuring the offset in nvmem...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example, SRK0 is at word 722, and nvmem does not show anything higher than 0x0c80, and plus the gaps&amp;nbsp; in the output of nvmem:&lt;/P&gt;&lt;P&gt;0000440 0000 0000 0000 0000 0000 0000 0000 0000&lt;BR /&gt;*&lt;BR /&gt;0000c00 0000 0000 2117 0f08 0607 1714 ffff ffff&lt;/P&gt;&lt;P&gt;so nothing in certain gaps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 18:25:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2044963#M234049</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-02-16T18:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045406#M234076</link>
      <description>&lt;P&gt;0xC80 = 3200 bytes = 800 words.&lt;/P&gt;
&lt;P&gt;Word 722 (decimal) is at byte offset 0xB48, which reads 0x00000000 in your dump. Try hexdump -v, so that hexdump does not squeeze lines.&lt;/P&gt;
&lt;P&gt;I must confess I never tried and burn fuses through nvmem, but the Linux driver seems to support it.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:42:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045406#M234076</guid>
      <dc:creator>seb_haezebrouck</dc:creator>
      <dc:date>2025-02-17T10:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045425#M234079</link>
      <description>&lt;P&gt;Assuming I can write the SRK fuses, just reading the values at the offset returns an error:&lt;/P&gt;&lt;P&gt;dd if=/sys/devices/platform/scu/scu\:imx8qm-ocotp/imx-scu-ocotp0/nvmem skip=452 bs=4 count=1 | hexdump -v&lt;/P&gt;&lt;P&gt;I get "Invalid argument"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;452 is the MAC1_ADDR&lt;/P&gt;&lt;P&gt;(assuming I have not screwed that up..)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045425#M234079</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-02-17T11:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045433#M234081</link>
      <description>&lt;P&gt;cat /sys/.../nvmem | dd skip=452 bs=4 count=1 | hexdump -v&lt;/P&gt;
&lt;P&gt;dd'ing directly from a sysfs pseudo-file probably does not work out very well.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:28:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045433#M234081</guid>
      <dc:creator>seb_haezebrouck</dc:creator>
      <dc:date>2025-02-17T11:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045438#M234082</link>
      <description>&lt;P&gt;would that not also apply to a dd write?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:35:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045438#M234082</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-02-17T11:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045468#M234084</link>
      <description>&lt;P&gt;I am afraid so.&amp;nbsp;But a small C program should do the trick.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;fd = open(NVMEM_PATH, O_RDONLY);
pread(fd, &amp;amp;fuse_value, 4, fuse_word_offset);
close(fd);&lt;/LI-CODE&gt;
&lt;P&gt;same for writing with pwrite.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 12:08:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045468#M234084</guid>
      <dc:creator>seb_haezebrouck</dc:creator>
      <dc:date>2025-02-17T12:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045538#M234087</link>
      <description>&lt;P&gt;The c program works as long as a seek is not involved. Either pread or read with a seek beforehand returns all zeros.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I read the whole beginning of the file (I am reading the unique id as a test at offset 0x40), I get the correct 8 bytes, but seek'ing returna all zeros.&lt;/P&gt;&lt;P&gt;This is such a great exact science (not!) with all the articles saying fuses are not supported, then the drivers support read/write, then the drivers dropped write only to allegedly have write added back in.&amp;nbsp; There is more to this and I would love to hear an authority on the nvmem driver to this layman (like the author&amp;nbsp;Peng Fan)... But I hope too much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help, and I an assuming that the original question about SCFW API can only be accessed from kernel space (which is no help).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess I will have to go with my silly idea of using uboot scripts which in our case is not the most efficient way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S.&lt;/P&gt;&lt;P&gt;"Crucible" works great on the imx8mp for reading/writing fuses in Linux, but unfortunately does not&amp;nbsp; support imx8 Quad Max (I guess because of security model).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 14:00:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045538#M234087</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-02-17T14:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045553#M234093</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Either pread or read with a seek beforehand returns all zeros.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;pread/pwrite work for me. No seek beforehand, just specify the offset as the fourth argument: pread(fd, &amp;amp;value, 4, 16) returns the first word of the unique ID. Similarly, I could burn the MAC fuse with pwrite.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Using 6.1.22_2.0.0 release (6.1.22 kernel), on i.MX 8QXP - but QM should be similar.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Admittedly the pread manpage mentions that the file opened must be capable of seeking. So not sure why this works, or if it is a lucky coincidence on my side. Or a compiler dependency: for the sake of speed, I compile using ubuntu aarch64_linux_gnu- Xcompiler and linking statically.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 14:21:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045553#M234093</guid>
      <dc:creator>seb_haezebrouck</dc:creator>
      <dc:date>2025-02-17T14:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045554#M234094</link>
      <description>&lt;P&gt;Unfortunately I am stuck on 5.10.72 (for now), so maybe older driver...&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 14:23:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2045554#M234094</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-02-17T14:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2047138#M234198</link>
      <description>&lt;P&gt;I'll send you a reference, hope that can be helpful for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Harvey&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 09:07:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2047138#M234198</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2025-02-19T09:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2049868#M234370</link>
      <description>&lt;P&gt;Unfortunately, even Uboot cannot write the first fuse for using secure boot:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/imx8-Quad-Max-uboot-fuse-prog-ERROR/m-p/2048429#M234288" target="_blank"&gt;@https://community.nxp.com/t5/i-MX-Processors/imx8-Quad-Max-uboot-fuse-prog-ERROR/m-p/2048429#M234288&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 11:07:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2049868#M234370</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-02-24T11:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2050629#M234414</link>
      <description>&lt;P&gt;Found that you get an update from other case and the version of&amp;nbsp;&lt;A href="https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-3.8.5.bin" target="_blank"&gt;imx-seco-3.8.5.bin&lt;/A&gt;&amp;nbsp;can be helpful.&lt;/P&gt;
&lt;P&gt;There is SECO_FW_release_note.pdf at&amp;nbsp;imx-seco-3.8.5/firmware/seco/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Harvey&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 08:31:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2050629#M234414</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2025-02-25T08:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2056377#M234736</link>
      <description>&lt;P&gt;Seeking does NOT work with this version in 5.10.72 on the Quad Max (you always get zeros...). I can read from the beginning of the file and stop where I need to or read the entire file to a physical file and then seek...&amp;nbsp; &amp;nbsp;I wish we had actual documentation from someone familiar with the driver (Peng Fan, are you listening?) and describe what fuses you can or cannot read/ write on the iMX8 Quad family that have the SECO/SCFW parts...&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 15:13:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2056377#M234736</guid>
      <dc:creator>flobro</dc:creator>
      <dc:date>2025-03-05T15:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Linux user space call the SCFW API?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2058709#M234864</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/198929"&gt;@flobro&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Send you email with a patch&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Harvey&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 11:03:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-the-Linux-user-space-call-the-SCFW-API/m-p/2058709#M234864</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2025-03-10T11:03:51Z</dc:date>
    </item>
  </channel>
</rss>

