[Cryptech Core] Status re Novena?

Paul Selkirk paul at psgd.org
Mon Sep 8 22:43:48 UTC 2014


Some initial notes on using the Novena board, and building the coretest
for it. This will go in the wiki RSN.

I would have sent this earlier, but I got wrapped up in a semi-unrelated
problem.

				paul

-------------- next part --------------
Novena Notes For the Intrepid

0. Canonical Novena Information

There is a (woefully incomplete) wiki for the Novena project:
http://www.kosagi.com/w/index.php?title=Novena_Main_Page

A (very) few first steps:
http://www.kosagi.com/w/index.php?title=Using_Novena_PVT1

A few notes on using the FPGA:
http://www.kosagi.com/w/index.php?title=Novena/Fpga

If you want to program the Novena, especially the FPGA, you can study the
current and past projects of bunnie and xobs:
https://github.com/bunnie?tab=repositories
https://github.com/xobs?tab=repositories


1. Connecting to the Novena

Bunnie says "The default login password is root / kosagi"

Also "The image, by default intends for you to plug in an HDMI monitor,
keyboard, and mouse, and use the device a bit like a (rudimentary) desktop
environment."

If you like that sort of thing, go right ahead. Note that the window manager
is Xfce. Note also that wireless is not enabled by default, and I spent a
while flailing at it before giving up.

I treat the Novena similarly to my OpenWrt routers and other small Linux
devices: 1) I access it through ssh, and 2) I treat it primarily as an
execution environment, not a development environment.

To ssh to the Novena, you need to know its IP address, which means you need
to either statically configure it, or you need to assign it an address in
your DHCP server.

If you go the DHCP route, be aware that Novena doesn't used fixed hardware
addresses, so you'll have to statically configure *that*.
Open /etc/network/interfaces, and add the following lines:
  allow-hotplug eth0
  iface eth0 inet dhcp
    hwaddress ether 00:0e:c6:87:72:01


2. Building coretest for the Novena

(For the wiki, this may be a separate page based on CoretestHashesC5G.)

First, get the Xilinx ISE Design Suite
http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/design-tools.html
and install the ISE WebPack version.

Note that this software runs on a Windows or x86 Linux host, *not* on the
Novena.

2.1 To build with the Xilinx command-line tools on Linux:

Run 'make' in coretest/core/novena/synth. (Why "synth"? That's how it's set
up in the novena-ws2312b-fpga project, from which I stole the i2c slave
code.)

2.2 To build in ISE:

a. Create project

File > New Project
  Name: novena
  Location: ...\toolruns (automatically appends "novena")

b. Add files to the project:
  coretest/core/coretest/src/rtl/coretest.v
  coretest/core/coretest_test_core/src/rtl/coretest_test_core.v
  coretest/core/i2c/src/rtl/i2c_core.v
  coretest/core/i2c/src/rtl/i2c.v
  coretest/core/novena/src/rtl/coretest_hashes.v
  coretest/core/novena/src/rtl/novena_fpga.v
  coretest/core/sha1/src/rtl/sha1_core.v
  coretest/core/sha1/src/rtl/sha1.v
  coretest/core/sha1/src/rtl/sha1_w_mem.v
  coretest/core/sha256/src/rtl/sha256_core.v
  coretest/core/sha256/src/rtl/sha256_k_constants.v
  coretest/core/sha256/src/rtl/sha256.v
  coretest/core/sha256/src/rtl/sha256_w_mem.v
  coretest/core/sha512/src/rtl/sha512_core.v
  coretest/core/sha512/src/rtl/sha512_h_constants.v
  coretest/core/sha512/src/rtl/sha512_k_constants.v
  coretest/core/sha512/src/rtl/sha512.v
  coretest/core/sha512/src/rtl/sha512_w_mem.v
  coretest/core/novena/synth/coretest-novena.ucf

c. Set some non-default options (from bunnie/xobs):

In the Process window, right-click on "Generate Programming File",
select "Process Properties...".

In Configuration Options, find "-g UnusedPin", and change it from "Pull
Down" to "Float".

In Startup Options, find "-g DriveDone", and check the box.

Click OK to close the dialog.

d. Build
Process > Implement Top Module


3. Running coretest on the Novena

scp the built coretest-novena.bit to the Novena.

Fetch https://github.com/xobs/novena-scope-drivers/blob/master/userspace/devmem2.c
and compile it on the Novena.

scp the following files from coretest/core/novena/src/sw to the Novena:
  configure.sh
  hash_tester.c
  hash_tester.py

To configure the coretest image into the FPGA, run
  ./configure coretest-novena.bit
This should light a small green LED (labeled "fpga") next to the high-speed
expansion connector.


4. What could possibly go wrong?

4.1 Updating the Novena bootloader

Randy has an updated image in btsync, in randy/novena/140327.uImage.

First remove the microSD card from the Novena, and mount it on a PC.
There is a small (34MB) FAT partition with the boot files. Copy
140327.uImage over *both* uImage and bootloader/uimage. Unmount the microSD
card, reinstall it in the Novena, and reboot.

4.2 Debugging i2c

Get the i2c-tools package (with apt-get).

root at quantum-biosys-novena:~# i2cdetect -l
i2c-0   i2c             21a0000.i2c     I2C adapter
i2c-1   i2c             21a4000.i2c     I2C adapter
i2c-2   i2c             21a8000.i2c     I2C adapter

The FPGA is attached to bus 2.

root at quantum-biosys-novena:~# i2cdetect -F 2
Functionalities implemented by /dev/i2c-2:
I2C                              yes
SMBus Quick Command              yes
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes

Send a coretest READ_CMD for the NAME0 field of the sha1 core:
root at quantum-biosys-novena:~# i2cset -y 2 0x0f 0x00 0x55 0x10 0x10 0x00 0xaa s

Read the response, one byte at a time.
(i2cget commands after the first are omitted for clarity of output.)
root at quantum-biosys-novena:~# i2cget -y 2 0x0f
0xaa
0x7f
0x10
0x00
0x73
0x68
0x61
0x31
0x55


More information about the Core mailing list