<?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: mmc-utils writing RPMB key fails with general error</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1435927#M188768</link>
    <description>&lt;P&gt;The key is 32byte long and I have read the emmc spec.&lt;BR /&gt;For writing RPMB key it said :&amp;nbsp; "If some other error occurs during Authentication Key programming then returned result is 0x01 (General Failure)."&lt;/P&gt;&lt;P&gt;That same error occurs when trying to rewrite the key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ mmc rpmb write-key /dev/mmcblk0rpmb real_rpmbkey =&amp;gt; no error
$ mmc rpmb write-key /dev/mmcblk0rpmb fake_rpmbkey
RPMB operation failed, retcode 0x0001&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Is there a way to verify whether the key is written or some other issue with the emmc?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2022 06:47:28 GMT</pubDate>
    <dc:creator>bluemonkeysrock</dc:creator>
    <dc:date>2022-03-30T06:47:28Z</dc:date>
    <item>
      <title>mmc-utils writing RPMB key fails with general error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1435616#M188744</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="3"&gt;Hello,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="3"&gt;I'm trying to program an RPMB key on iMX6DLSABRESD.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$mmc rpmb write-key /dev/mmcblk3rpmb rpmbkey
RPMB operation failed, retcode 0x0001&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="3"&gt;I added extra logs on the mmc driver to track the commands/responses.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mmc rpmb write-key /dev/mmcblk3rpmb rpmbkey
[  110.970140] mmc_blk_ioctl_copy_from_user
[  110.974125] mmc_blk_ioctl_copy_from_user
[  110.978056] mmc_blk_ioctl_copy_from_user
[  110.982113] __mmc_blk_ioctl_cmd : cmd.opcode = 25
[  110.986905] sdhci_finish_command: MMC_RSP_PRESENT
[  110.991618] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  110.998109] sdhci_finish_command: MMC_RSP_PRESENT
[  111.002823] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.008282] __mmc_blk_ioctl_cmd : mmc_blk_part_switch ret 0
[  111.013902] __mmc_blk_ioctl_cmd : copy the 'Reliable Write' bit
[  111.019866] sdhci_finish_command: MMC_RSP_PRESENT
[  111.024576] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.030056] __mmc_blk_ioctl_cmd : cmd.resp[0] = 00000900
[  111.035420] sdhci_finish_command: MMC_RSP_PRESENT
[  111.040131] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.045580] __mmc_blk_ioctl_cmd : return 0x0
[  111.049857] mmc_blk_issue_drv_op : (0) __mmc_blk_ioctl_cmd ret 0x0
[  111.056069] __mmc_blk_ioctl_cmd : cmd.opcode = 25
[  111.056076] __mmc_blk_ioctl_cmd : mmc_blk_part_switch ret 0
[  111.056082] __mmc_blk_ioctl_cmd : copy the 'Reliable Write' bit
[  111.072331] sdhci_finish_command: MMC_RSP_PRESENT
[  111.077039] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.082514] __mmc_blk_ioctl_cmd : cmd.resp[0] = 00000900
[  111.087880] sdhci_finish_command: MMC_RSP_PRESENT
[  111.092591] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.098264] __mmc_blk_ioctl_cmd : return 0x0
[  111.102545] mmc_blk_issue_drv_op : (1) __mmc_blk_ioctl_cmd ret 0x0
[  111.108764] __mmc_blk_ioctl_cmd : cmd.opcode = 18
[  111.108770] __mmc_blk_ioctl_cmd : mmc_blk_part_switch ret 0
[  111.108774] __mmc_blk_ioctl_cmd : copy the 'Reliable Write' bit
[  111.108831] sdhci_finish_command: MMC_RSP_PRESENT
[  111.129687] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.135180] __mmc_blk_ioctl_cmd : cmd.resp[0] = 00000900
[  111.140526] sdhci_finish_command: MMC_RSP_PRESENT
[  111.145233] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.150671] __mmc_blk_ioctl_cmd : return 0x0
[  111.154964] mmc_blk_issue_drv_op : (2) __mmc_blk_ioctl_cmd ret 0x0
[  111.154991] sdhci_finish_command: MMC_RSP_PRESENT
[  111.165859] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.172312] sdhci_finish_command: MMC_RSP_PRESENT
[  111.177021] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.182457] mmc_blk_issue_drv_op : mq_rq-&amp;gt;drv_op_result ret 0x0
[  111.188422] mmc_blk_ioctl_copy_to_user
[  111.188672] sdhci_finish_command: MMC_RSP_PRESENT
[  111.192183] mmc_blk_ioctl_copy_to_user
[  111.196883] sdhci_finish_command: cmd-&amp;gt;resp[0]=0x00000900
[  111.196941] sdhci_finish_command: MMC_RSP_PRESENT
[  111.200670] mmc_blk_ioctl_copy_to_user&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the uSDHC configuration from device tree. I'm running linux 5.4&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;usdhc4: usdhc@219c000 {
                compatible = "fsl,imx6q-usdhc";
                reg = &amp;lt;0x0219c000 0x4000&amp;gt;;
                interrupts = &amp;lt;0 25 IRQ_TYPE_LEVEL_HIGH&amp;gt;;
                clocks = &amp;lt;&amp;amp;clks IMX6QDL_CLK_USDHC4&amp;gt;,
                     &amp;lt;&amp;amp;clks IMX6QDL_CLK_USDHC4&amp;gt;,
                     &amp;lt;&amp;amp;clks IMX6QDL_CLK_USDHC4&amp;gt;;
                clock-names = "ipg", "ahb", "per";
                bus-width = &amp;lt;4&amp;gt;;
                status = "disabled";
            };

        pinctrl_usdhc4: usdhc4grp {
            fsl,pins = &amp;lt;
                MX6QDL_PAD_SD4_CMD__SD4_CMD     0x17059
                MX6QDL_PAD_SD4_CLK__SD4_CLK     0x10059
                MX6QDL_PAD_SD4_DAT0__SD4_DATA0      0x17059
                MX6QDL_PAD_SD4_DAT1__SD4_DATA1      0x17059
                MX6QDL_PAD_SD4_DAT2__SD4_DATA2      0x17059
                MX6QDL_PAD_SD4_DAT3__SD4_DATA3      0x17059
                MX6QDL_PAD_SD4_DAT4__SD4_DATA4      0x17059
                MX6QDL_PAD_SD4_DAT5__SD4_DATA5      0x17059
                MX6QDL_PAD_SD4_DAT6__SD4_DATA6      0x17059
                MX6QDL_PAD_SD4_DAT7__SD4_DATA7      0x17059
            &amp;gt;;
        };
 
&amp;amp;usdhc4 {
    pinctrl-names = "default";
    pinctrl-0 = &amp;lt;&amp;amp;pinctrl_usdhc4&amp;gt;;
    bus-width = &amp;lt;8&amp;gt;;
    non-removable;
    no-1-8-v;
    auto-cmd23-broken;
    status = "okay";
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What am I missing?&lt;BR /&gt;Thanks for any insight on the matter.&lt;BR /&gt;&lt;BR /&gt;Regards,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 14:27:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1435616#M188744</guid>
      <dc:creator>bluemonkeysrock</dc:creator>
      <dc:date>2022-03-29T14:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: mmc-utils writing RPMB key fails with general error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1435868#M188759</link>
      <description>&lt;P&gt;How long is the RPMB key length you are using?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you read the jedec spec?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The key/MAC must be 32Byte long.&lt;/P&gt;
&lt;P&gt;Your question is about emmc chip, not the usdhc controller&amp;nbsp; of i.MX.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JEDEC Standard No. 84-B51&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/175233i418E19D51E38478A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;eMMC RPMB Enhance and GP&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/eMMC-RPMB-Enhance-and-GP/ta-p/1099818" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/eMMC-RPMB-Enhance-and-GP/ta-p/1099818&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 05:05:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1435868#M188759</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2022-03-30T05:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: mmc-utils writing RPMB key fails with general error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1435927#M188768</link>
      <description>&lt;P&gt;The key is 32byte long and I have read the emmc spec.&lt;BR /&gt;For writing RPMB key it said :&amp;nbsp; "If some other error occurs during Authentication Key programming then returned result is 0x01 (General Failure)."&lt;/P&gt;&lt;P&gt;That same error occurs when trying to rewrite the key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ mmc rpmb write-key /dev/mmcblk0rpmb real_rpmbkey =&amp;gt; no error
$ mmc rpmb write-key /dev/mmcblk0rpmb fake_rpmbkey
RPMB operation failed, retcode 0x0001&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Is there a way to verify whether the key is written or some other issue with the emmc?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 06:47:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1435927#M188768</guid>
      <dc:creator>bluemonkeysrock</dc:creator>
      <dc:date>2022-03-30T06:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: mmc-utils writing RPMB key fails with general error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1436909#M188805</link>
      <description>&lt;P&gt;The&amp;nbsp; RPMB key is OTP.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/175474iC9FAAA716129AF29/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I believe you can use the key now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And please read the document I wrote from page 4.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 09:03:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1436909#M188805</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2022-03-31T09:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: mmc-utils writing RPMB key fails with general error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1437013#M188820</link>
      <description>&lt;P&gt;For that eMMC, I can use the key to write/read with no issues.&lt;BR /&gt;On another one :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ mmc rpmb read-counter /dev/mmcblk3rpmb
RPMB operation failed, retcode 0x0007 =&amp;gt; RPMB_ERR_NO_KEY
$ mmc rpmb write-key /dev/mmcblk3rpmb rpmbkey
RPMB operation failed, retcode 0x0001 =&amp;gt; RPMB_ERR_GENERAL&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I cannot read the counter value because no key is written and general error when I try to write one.&lt;BR /&gt;&lt;BR /&gt;Thanks you,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 11:04:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1437013#M188820</guid>
      <dc:creator>bluemonkeysrock</dc:creator>
      <dc:date>2022-03-31T11:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: mmc-utils writing RPMB key fails with general error</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1437281#M188842</link>
      <description>&lt;P&gt;do you have the problem with&amp;nbsp;&amp;nbsp;read-block/write-block?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finish the write-block, then try read-counter, how's the result?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 01:00:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mmc-utils-writing-RPMB-key-fails-with-general-error/m-p/1437281#M188842</guid>
      <dc:creator>BiyongSUN</dc:creator>
      <dc:date>2022-04-01T01:00:19Z</dc:date>
    </item>
  </channel>
</rss>

