1 |
10 |
arniml |
|
2 |
|
|
README for the spi_boot core
|
3 |
|
|
============================
|
4 |
22 |
arniml |
Version: $Date: 2005-02-20 13:33:33 $
|
5 |
10 |
arniml |
|
6 |
|
|
|
7 |
|
|
Description
|
8 |
|
|
-----------
|
9 |
|
|
|
10 |
11 |
arniml |
The SD/MMC Bootloader is a CPLD design that manages configuration and
|
11 |
|
|
bootstrapping of FPGAs. It is able to retrieve the required data from
|
12 |
|
|
SecureDigital (SD) cards or MultiMediaCards (MMC) and manages the FPGA
|
13 |
|
|
configuration process. SD cards as well as MMCs are operated in SPI mode which
|
14 |
|
|
is part of both standards thus eliminating the need for dedicated
|
15 |
|
|
implementations. The SD/MMC Bootloader fits both. Beyond configuration, this
|
16 |
18 |
arniml |
core supports a bootstrapping strategy where multiple images are stored on one
|
17 |
11 |
arniml |
single memory card.
|
18 |
|
|
For example consider a system completely based on SRAM. The bootloader
|
19 |
18 |
arniml |
provides an initial configuration data from the first image to the FPGA. This
|
20 |
|
|
image contains a design which pulls the next image from the memory card and
|
21 |
|
|
transfers this data to SRAM. In the third step the final FPGA design is loaded
|
22 |
|
|
from the third image.
|
23 |
10 |
arniml |
|
24 |
22 |
arniml |
The schematic (rev. A) shows how the core can be used with an FPGA board. I
|
25 |
|
|
use it to configure/boot the Xilinx Spartan IIe on BurchED's B5-X300
|
26 |
|
|
board. SV2 fits the "SERIAL MODE" connector on this board but you will have to
|
27 |
|
|
add a separate wire from R6 to attach INIT. Please check the proper use of the
|
28 |
|
|
pull-up resistors for your specific board.
|
29 |
10 |
arniml |
|
30 |
11 |
arniml |
Features
|
31 |
|
|
--------
|
32 |
10 |
arniml |
|
33 |
18 |
arniml |
* Configuration mode: configurates SRAM based FPGAs via slave serial mode
|
34 |
11 |
arniml |
(Xilinx and Altera)
|
35 |
|
|
* Data mode: provides stored data over a simple synchronous serial interface
|
36 |
18 |
arniml |
* Broad compatability using SPI mode
|
37 |
11 |
arniml |
+ SecureDigital cards using dedicated initialization command
|
38 |
18 |
arniml |
+ MultiMediaCards (see below)
|
39 |
11 |
arniml |
* Operation triggerd by power-up or card insertion
|
40 |
|
|
|
41 |
|
|
|
42 |
18 |
arniml |
Compatability
|
43 |
|
|
-------------
|
44 |
|
|
|
45 |
|
|
These cards have been tested with the SD/MMC Bootloader:
|
46 |
|
|
|
47 |
|
|
* SanDisk 128 MB SD
|
48 |
|
|
* SanDisk 64 MB MMC
|
49 |
|
|
* Panasonic 32 MB SD
|
50 |
|
|
|
51 |
|
|
Some MMC might fail with this core as not all cards support CMD18
|
52 |
|
|
(READ_MULTIPLE_BLOCK). Please consult the data sheet of your specific
|
53 |
|
|
model. In case your MMC does not implement CMD18 you might want to have a look
|
54 |
|
|
at the FPGA MMC-Card Config project.
|
55 |
|
|
|
56 |
|
|
|
57 |
10 |
arniml |
Verification
|
58 |
|
|
------------
|
59 |
|
|
|
60 |
|
|
The spi_boot core comes with a simple testbench that simulates an SD/MMC
|
61 |
|
|
card. All four implementations of the core are verified there in parallel
|
62 |
|
|
while transferring the data for several sets.
|
63 |
|
|
You should normally not need to run the testbench. But in case you modified
|
64 |
|
|
the VHDL code the testbench gives some hints if the design has been broken.
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
Directory Structure
|
68 |
|
|
-------------------
|
69 |
|
|
|
70 |
|
|
The core's directory structure follows the proposal of OpenCores.org.
|
71 |
|
|
|
72 |
|
|
spi_boot
|
73 |
|
|
|
|
74 |
|
|
\--+-- rtl
|
75 |
|
|
| |
|
76 |
|
|
| \-- vhdl : VHDL code containing the RTL description
|
77 |
|
|
| of the core.
|
78 |
|
|
|
|
79 |
|
|
+-- bench
|
80 |
|
|
| |
|
81 |
|
|
| \-- vhdl : VHDL testbench code.
|
82 |
|
|
|
|
83 |
|
|
\-- sim
|
84 |
|
|
|
|
85 |
|
|
\-- rtl_sim : Directory for running simulations.
|
86 |
|
|
|
87 |
|
|
|
88 |
21 |
arniml |
RAM Loader
|
89 |
|
|
----------
|
90 |
|
|
|
91 |
|
|
Directory rtl/vhdl/ram_loader contains the sample design which loads the next
|
92 |
|
|
image from the card and stores its contents to external asynchronous
|
93 |
|
|
RAM. After reading 64 KB it triggers a new configuration process for the final
|
94 |
|
|
FPGA design.
|
95 |
|
|
Refer to the code for the mechanisms involved.
|
96 |
|
|
|
97 |
|
|
|
98 |
10 |
arniml |
Compiling the VHDL Code
|
99 |
|
|
-----------------------
|
100 |
|
|
|
101 |
|
|
VHDL compilation and simulation tasks take place inside in sim/rtl_sim
|
102 |
|
|
directory. The project setup supports only the GHDL simulator (see
|
103 |
|
|
http://ghdl.free.fr).
|
104 |
|
|
|
105 |
|
|
To compile the code simply type at the shell
|
106 |
|
|
|
107 |
|
|
$ make
|
108 |
|
|
|
109 |
|
|
This should result in a file called tb_behav_c0 which can be executed as any
|
110 |
|
|
other executable.
|
111 |
|
|
|
112 |
|
|
The basic simple sequence list can be found in COMPILE_LIST. This can be
|
113 |
|
|
useful to quickly set up the analyze stage of any compiler or
|
114 |
|
|
synthesizer. Especially when synthesizing the code, you want to skip the VHDL
|
115 |
|
|
configurations in *-c.vhd and everything below the bench/ directory.
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
References
|
119 |
|
|
----------
|
120 |
|
|
|
121 |
|
|
* SanDisk SD Card Product Manual
|
122 |
|
|
http://www.sandisk.com/pdf/oem/ProdManualSDCardv1.9.pdf
|
123 |
|
|
|
124 |
|
|
* SanDisk MMC Product Manual
|
125 |
|
|
http://www.sandisk.com/pdf/oem/manual-rs-mmcv1.0.pdf
|
126 |
|
|
|
127 |
|
|
* Toshiba SD Card Specification
|
128 |
|
|
http://i.cmpnet.com/chipcenter/memory/images/prod055.pdf
|
129 |
18 |
arniml |
|
130 |
22 |
arniml |
* BurchED
|
131 |
|
|
http://burched.biz/
|
132 |
|
|
|
133 |
18 |
arniml |
* FPGA MMC-Card Config project
|
134 |
|
|
http://www.opencores.org/projects.cgi/web/mmcfpgaconfig/overview
|