<div>Hello!</div><div> </div><blockquote><div>The question is what the design actually is - What is the actual clock<br />speed on the real EIM bus on the Novena.</div></blockquote><div> </div><div>This can be easily checked by routing BCLK to some unused pin inside an FPGA, which drivers either as a pushbutton or a LED, and then attaching a scope to this pin and measuring the frequency. Basically you need to add another top-level output port to the FPGA design and instantiate ODDR primitive, which is driven by BCLK and connected to this new pin. I don't have a copy of Novena board so far, so I can't do this myself right now.</div><div> </div><div>Speaking of frequency, I have another question. As far as I understand, you want to use the on-board FPGA as a cryptographic co-processor, so that the CPU could offload time-consuming hash calculations. EIM frequency will obviously limit the maximum achievable data throughput. Have you estimated what throughput you actually need? Is it critical to run the bus at 133 MHz or will 100 MHz be enough?</div><div> </div><div>05.01.2015, 11:16, "Joachim Strömbergson" <joachim@secworks.se>:</div><blockquote type="cite"><p><br /><br />Aloha!<br /><br />Repost to @tech. Thanks to Randy for pointing it out.<br /><br /><br />- -------- Original Message --------<br />Subject: Re: [Cryptech Core] Fwd: [Cryptech Tech] EIM Problems<br />Date: Sun, 04 Jan 2015 22:41:14 +0100<br />From: Joachim Strömbergson <<a href="mailto:joachim@secworks.se">joachim@secworks.se</a>><br />Reply-To: <a href="mailto:joachim@secworks.se">joachim@secworks.se</a><br />To: Randy Bush <<a href="mailto:randy@psg.com">randy@psg.com</a>><br />CC: CrypTech Core <<a href="mailto:core@cryptech.is">core@cryptech.is</a>><br /><br />Aloha!<br /><br />Randy Bush wrote:</p><blockquote> maybe the question is not so much why it is designed the way it is, <br /> though that might be intellectually interesting, but rather how to <br /> code to that design.</blockquote><p>The question is what the design actually is - What is the actual clock<br />speed on the real EIM bus on the Novena.<br /><br />Paul Shatov is correct that the available documentation for the i.MX6<br />processor states that the maximum frequency for the EIM clock (EIM_BCLK)<br />is 104 MHz. (And yes, it is settable by SW and happens somewhere in the<br />boot code, firmware.)<br /><br />Unfortunately, Freescale does not seem to provide a data sheet for the<br />exact version of the i.MX6 that is used on the Novena. The one on the<br />Novena is MCIMX6Q5EYM12AC. The "12" in the code indicates 1.2 GHz. The<br />"5" near the beginning signifies that it is a consumer application CPU.<br /><br />The Data Sheet for this family is here (sorry for ugly link):<br /><br /><a href="http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6DQCEC.pdf?fasp=1&WT_TYPE=Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation&fileExt=.pdf">http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6DQCEC.pdf?fasp=1&WT_TYPE=Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation&fileExt=.pdf</a><br /><br />If we look in that documentation, there is no information about 1.2 GHz<br />devices, only up to 1 GHz, for example the MCIMX6Q5EYM10AC which is the<br />closest match to the one on the Novena.<br /><br />Now. In Bunnies ROMulator Novena design the EIM_BCLK clock is fed via<br />pin C9 on the FPGA into the FPGA where it is connected to a clock buffer<br />that feeds one of the internal clock networks. The clock is also<br />conditioned using a specific delay locked loop (dll), the bclk_dll. That<br />component is configured for the design here:<br /><br /><a href="https://github.com/bunnie/novena-spi-romulator/blob/master/spi-romulator.srcs/sources_1/ip/bclk_dll/bclk_dll.v">https://github.com/bunnie/novena-spi-romulator/blob/master/spi-romulator.srcs/sources_1/ip/bclk_dll/bclk_dll.v</a><br /><br />In that file we can see that the input clock period is set to 7.518 ns,<br />or 133 MHz.<br /><br />Also, the constraint file specifies the EIM_BCLK as a clock with the<br />frequency 133 MHz:<br /><br /><a href="https://github.com/bunnie/novena-spi-romulator/blob/master/spi-romulator.srcs/constrs_1/imports/imports/novena.ucf">https://github.com/bunnie/novena-spi-romulator/blob/master/spi-romulator.srcs/constrs_1/imports/imports/novena.ucf</a><br /><br />It is the bclk_dll that then drives the eim_registers etc. (There are<br />also separate input and output clocks generated for the EIM interface to<br />drive registers next to the I/O buffers.)<br /><br />I've tested to change the settings for this clock from 133 MHz to 104<br />MHz (as Paul suggested) and built the design. The result is that it is<br />impossible to do any readings of data from the FPGA at all (the hard<br />coded version info for example). The correct speed for the EIM_BCLK on<br />the Novena board seems to be 133 MHz.<br /><br />I've sent an email to Bunnie and asked about the discrepancy between the<br />Freescale documentation and what Bunnie has specified. But since Bunnies<br />design works with his settings I think it is a question of missing<br />documentation. Or that I am confused. But changing the settings for<br />EIM_BCLK seems not to be the way forward for us.<br /><br />The Romulator is a good project to look at for the clocking used for the<br />EIM interface. What is missing in the design is a good clock with a nice<br />relation to the EIM_BCLK (66 MHz for example). The problem is getting<br />such a clock with zero skew in relation to the EIM_BCLK (or more exactly<br />bclk_dll)<br /><br />The DLL instantiated in the design for generating the bclk_dll clock<br />seems to also have a DIV clock output port for a divided clock. This may<br />give us what we need. I'll see what the Xilinx documentation says and<br />try to change the core instatiation.<br /><br /><br />- -- <br />Med vänlig hälsning, Yours<br /><br />Joachim Strömbergson - Alltid i harmonisk svängning.<br />========================================================================<br /> Joachim Strömbergson          Secworks AB          <a href="mailto:joachim@secworks.se">joachim@secworks.se</a><br />========================================================================</p><blockquote>-----BEGIN PGP SIGNATURE-----<br />Version: GnuPG/MacGPG2 v2<br />Comment: GPGTools - <a href="http://gpgtools.org/">http://gpgtools.org</a><br />Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/">http://enigmail.mozdev.org/</a><br /><br />iQIcBAEBCAAGBQJUqkhtAAoJEF3cfFQkIuyNvm8P/3ccDyHFTj9Cah3IW7iR1XNR<br />O0zBFs5z75mx/LDKeXbvhDC5HHWBv+eX5L+pqgCGgWOC1jqmK26f2SzA0MkjNHus<br />dcxFJtpWIcntoj2k69halory/OYGwHXmgm454+sDj38pwiW9+fjnsytUhBak9mOf<br />TZGSbiMLpOjnJohGEXhJ6RqXonmlDQxBrQYTa6HtVMN51wd3YcAmVoCUk74ObmFQ<br />NjudOXwKy4ojy+VgZ8YZNMT9ojWZxtTBNTKdmGrkr/z6+pi/0y7Sl6BH6YLHPvnF<br />2WDUfgt9nuOsvUmXo6GFPoQqHvEJMHGTf5rTd4AhZSSncMm9KSo98Jj5Efc5yjmn<br />izcfUvKWvjFnOrTEvC7RapF4UQlNIAIMU9oYb9SOo/Izx/j1tWp6nvsjJnjhUqiP<br />JVXIZWqS6j0ZrXOEqMiw4kWhS4HqbMQeEZe5UcfG7cAuA+nbJkuvfy3sX9W91idd<br />OyR0jxRN0DYVY9QBrTvN0gQUMspxCXjIyzAqa/bQd8B9smpMFskWV34cOYNJE6IV<br />GHi/m6xf+2XmY45bi87Dcfks5SURWktW6LtPuEwQSLAYFg5CJoerad0VNbFufN4l<br />ueBbSjrcn8BwZ2QEzkVbhbZhQOPMjkmGGghPN4nG1f29+gQfE3RkIP9yDEXUhw5t<br />Z1/nH1PS5pZtZMWvmp3I<br />=bJ9Q<br />-----END PGP SIGNATURE-----</blockquote><p><br />_______________________________________________<br />Tech mailing list<br /><a href="mailto:Tech@cryptech.is">Tech@cryptech.is</a><br /><a href="https://lists.cryptech.is/listinfo/tech">https://lists.cryptech.is/listinfo/tech</a></p></blockquote><div> </div><div> </div><div>-- <br />С уважением, Шатов Павел.</div><div> </div>