<?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>ColdFire/68K Microcontrollers and Processors中的主题 MCF5271 SKHA and MDHA endian</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249076#M11548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently trying to setup the 5271 SKHA to do AES encryption/decryption and the MDHA to do SHA-1 hashing. But I am not getting the correct data out.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw a related post about the SKHA that says it is expecting little endian data, &lt;A _jive_internal="true" data-containerid="2018" data-containertype="14" data-objectid="303776" data-objecttype="1" href="https://community.nxp.com/thread/303776"&gt;Coldfire SEC and SKHA Benchmarks&lt;/A&gt;, does anyone have more info about this, or know where to find more detailed info? Is it the input/output FIFOs that are expecting the reversed endian, or is it also the IV and Key?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Apr 2013 20:12:52 GMT</pubDate>
    <dc:creator>matthewc</dc:creator>
    <dc:date>2013-04-02T20:12:52Z</dc:date>
    <item>
      <title>MCF5271 SKHA and MDHA endian</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249076#M11548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently trying to setup the 5271 SKHA to do AES encryption/decryption and the MDHA to do SHA-1 hashing. But I am not getting the correct data out.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw a related post about the SKHA that says it is expecting little endian data, &lt;A _jive_internal="true" data-containerid="2018" data-containertype="14" data-objectid="303776" data-objecttype="1" href="https://community.nxp.com/thread/303776"&gt;Coldfire SEC and SKHA Benchmarks&lt;/A&gt;, does anyone have more info about this, or know where to find more detailed info? Is it the input/output FIFOs that are expecting the reversed endian, or is it also the IV and Key?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 20:12:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249076#M11548</guid>
      <dc:creator>matthewc</dc:creator>
      <dc:date>2013-04-02T20:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: MCF5271 SKHA and MDHA endian</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249077#M11549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote that other post. Asking the programmer who got it working, everything needs to be byte-reversed, keys and all FIFO data..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like the SKHA was a piece of IP that was designed to be little-endian (possibly for matching CPUs) and it was dropped into the big-endian Coldfire without any consideration being given to the problems that causes. Or even mentioning this anywhere in the documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chapter 30 in the MCF5235 manual looks to be almost identical to Chapter 28 in the MCF5271 manual. The only difference is that the MCF5235 chapter warns that the MCF5232-4 don't have the SKHA. So they're the same hardware.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Searching Freescale for "SKHA" doesn't find any little-endian chips with an "SKHA" in them. Searching for "Encryption" finds this training course:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/site/training_information.jsp?code=WBT_28756&amp;amp;fsrch=1&amp;amp;sr=5" title="http://www.freescale.com/webapp/sps/site/training_information.jsp?code=WBT_28756&amp;amp;fsrch=1&amp;amp;sr=5"&gt;Training Information Page&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above includes the text:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;In order to help increase performance some new features have been added to the HAs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-canvas-width="848.0804299495699" data-font-name="Helvetica" dir="ltr" style="font-family: sans-serif; padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt; These changes are &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;available starting with the MCF532x and MCF537x family&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-canvas-width="400.69316690826435" data-font-name="Helvetica" dir="ltr" style="font-family: sans-serif; padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt; devices. The updated modules are programmable &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;for big or little endian modes,&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-canvas-width="400.69316690826435" data-font-name="Helvetica" dir="ltr" style="font-family: sans-serif; padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt; where the original HA &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;implementations only supported little endian data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-canvas-width="726.1855570129397" data-font-name="Helvetica" dir="ltr" style="font-family: sans-serif; padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Programmable DMA request capability has also been added to the SKHA&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-canvas-width="726.1855570129397" data-font-name="Helvetica" dir="ltr" style="font-family: sans-serif; padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt; and MDHA blocks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;It also refers to the SKHA (in the MCF54xx chips) in the Performance Graph as "Talitos".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Searching for that finds ONE mention of that name in the "MPC185 Security Co-Processor User's Manual". So it looks like the SKHA design might have come from the MPC line. The word "Talitos" also finds other MPC and DSP core documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading through THAT manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;NOTE&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;The execution units used in the MPC185 are identical to those used in previous&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;security processors, and are natively little endian. Register values are shown in&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;a big endian format to assist in debug in a 60x (big endian) environment. Much&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;of the following detail is required only for debug and operation of the MPC185&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;in target mode. When operating as an initiator, the device drivers abstract&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;register-level operations, and the crypto-channels and controller operate the&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;execution units&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;So if you want to know how to use the MCF SKHA you should start by reading the MCP150 manual. This is a standalone encryption chip rather than a module inside a micro.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Except the above effectively says "you don't have to worry about which way around the bytes are as the device drivers handle all that for you". Device drivers?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Maybe MQX or the Processor Expert has drivers for this hardware. Does anyone know?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Tom&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 23:12:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249077#M11549</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2013-04-02T23:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: MCF5271 SKHA and MDHA endian</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249078#M11550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like you're exactly right. When loading the SKCRn registers, the SKKDRn registers, and the input FIFO (and when reading from the SKCRn and the output FIFO) the bytes need to be reversed. The other registers, such as the key size (SKKSR) and the data size (SKDSR), appear to expect big endian.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a shame there was never an errata or notice covering this, but I guess that's what forums are for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Matt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Apr 2013 01:01:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249078#M11550</guid>
      <dc:creator>matthewc</dc:creator>
      <dc:date>2013-04-06T01:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: MCF5271 SKHA and MDHA endian</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249079#M11551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect the reason the SKHA is little-endian in a big-endian CPU is that the protocols are little-endian in the way the bit manipulation works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At least in the MCF532x there's the option of using DMA and having it reverse the data order on transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a different problem with the SKHA. Given that there's no example code to copy we've had to write our own from the manual. We load up all the registers, load up the FIFO and set the "GO" bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't work. We've found we have to load up the FIFO, sit in a "for (i = 0; i &amp;lt; 20; i++)"&amp;nbsp; loop to waste some time and THEN set the "GO" bit or it never finishes (apparently never starts). There's nothing suggesting this is needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might be that we're polling for completion and the high load of the register polling may be upsetting it. It might also be that we've misunderstood the "GO" bit as detailed in this post on the MHDA (which is similar to the SKHA)::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/19117"&gt;MCF5329 - Using the Message Digest Hardware Accelerator (MDHA)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've just used Google with every keyword I can think of and I can't find any code anywhere that handles the SKHA. I'm getting hits on "MCF_SKHA_SKCMR" where it is defined in various copies of "mcf532x_skha.h" and "mcf523x_skha.h" out there, but no code at all in any publicly available sources. Nothing "#includes" the "mcf532x_skha.h" file either. So either it isn't used or code that does use it is "secret".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just found a bug in the MCF5329 manual (Revision 3, 2008, latest version). Luckily the MCF5235 manual is correct. In the MCF5329 manual the MDMR bits are described as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bit 10, diagram "SSL",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; description "10 SSL Secure Socket Layer MAC"&lt;/P&gt;&lt;P&gt;Bit 9, Diagram "MAC FULL",&amp;nbsp;&amp;nbsp;&amp;nbsp; description &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;MISSING&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Bit 8, Diagram "SWAP,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; description "&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;8 SWAP Message Authentication Code Full&lt;/STRONG&gt;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;Bit 7, Diagram "OPAD",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; description "&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;7 OPAD Swap message digest&lt;/STRONG&gt;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;Bit 6, Diagram "IPAD",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; description "6 IPAD Inner padding of message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Apr 2013 02:24:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5271-SKHA-and-MDHA-endian/m-p/249079#M11551</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2013-04-07T02:24:16Z</dc:date>
    </item>
  </channel>
</rss>

