OpenCores
URL https://opencores.org/ocsvn/spi_boot/spi_boot/trunk

Subversion Repositories spi_boot

[/] [spi_boot/] [tags/] [rel_3_2_rev_C/] [README] - Blame information for rev 74

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 arniml
 
2
README for the spi_boot core
3
============================
4 72 arniml
Version: $Date: 2007-08-08 22:55:46 $
5
$Name: not supported by cvs2svn $
6 10 arniml
 
7
 
8
Description
9
-----------
10
 
11 11 arniml
The SD/MMC Bootloader is a CPLD design that manages configuration and
12
bootstrapping of FPGAs. It is able to retrieve the required data from
13
SecureDigital (SD) cards or MultiMediaCards (MMC) and manages the FPGA
14
configuration process. SD cards as well as MMCs are operated in SPI mode which
15
is part of both standards thus eliminating the need for dedicated
16
implementations. The SD/MMC Bootloader fits both. Beyond configuration, this
17 18 arniml
core supports a bootstrapping strategy where multiple images are stored on one
18 11 arniml
single memory card.
19
For example consider a system completely based on SRAM. The bootloader
20 39 arniml
provides the initial configuration data from the first image to the FPGA. This
21 18 arniml
image contains a design which pulls the next image from the memory card and
22
transfers this data to SRAM. In the third step the final FPGA design is loaded
23
from the third image.
24 39 arniml
These images are clustered in sets which can be selected by external switches
25
for example. Several configuration sets can be stored on one memory card
26
allowing you to provide a number of applications which are downloaded quickly
27
to the FPGA.
28
The schematic (rev. B) shows how the core can be used with an FPGA board. I
29 22 arniml
use it to configure/boot the Xilinx Spartan IIe on BurchED's B5-X300
30
board. SV2 fits the "SERIAL MODE" connector on this board but you will have to
31
add a separate wire from R6 to attach INIT. Please check the proper use of the
32
pull-up resistors for your specific board.
33 10 arniml
 
34 23 arniml
 
35 11 arniml
Features
36
--------
37 10 arniml
 
38 26 arniml
* Configuration mode: configures SRAM based FPGAs via slave serial mode
39 11 arniml
  (Xilinx and Altera)
40
* Data mode: provides stored data over a simple synchronous serial interface
41 18 arniml
* Broad compatability using SPI mode
42 11 arniml
    + SecureDigital cards using dedicated initialization command
43 18 arniml
    + MultiMediaCards (see below)
44 11 arniml
* Operation triggerd by power-up or card insertion
45 39 arniml
* Multiple configuration sets stored on on single memory card
46 11 arniml
 
47
 
48 18 arniml
Compatability
49
-------------
50
 
51
These cards have been tested with the SD/MMC Bootloader:
52
 
53 24 arniml
  * Hama 64 MB SD
54 18 arniml
  * SanDisk 128 MB SD
55
  * SanDisk 64 MB MMC
56
  * Panasonic 32 MB SD
57
 
58
Some MMC might fail with this core as not all cards support CMD18
59
(READ_MULTIPLE_BLOCK). Please consult the data sheet of your specific
60
model. In case your MMC does not implement CMD18 you might want to have a look
61
at the FPGA MMC-Card Config project.
62
 
63
 
64 25 arniml
Tools
65
-----
66
 
67
Downloading the configuration data to the card is a straight forward
68
process. The images have to be written starting at dedicated locations. For
69
the provided toplevel designs, these locations are multiples of 256 K. I.e. 0,
70
0x40000, 0x80000 and so forth.
71
 
72
dd (part of the GNU coreutils) serves this purpose:
73
$ dd if=ram_loader.bin of=/dev/sdX bs=512
74
$ dd if=pongrom_6.bin of=/dev/sdX bs=512 seek=512
75
$ dd if=pacman.bin of=/dev/sdX bs=512 seek=1024
76
 
77
The name of the device node depends on how the card reader is attached to the
78 26 arniml
kernel. For Linux systems this is most often something like /dev/sdX with X
79 25 arniml
ranging from a-z. Please note that it is essential to use the device without
80
any trailing numbers as they refer to partitions leading to wrong offsets for
81
data written to the card.
82
All this works perfectly for my Spartan IIe device as this FPGA expects the
83
configuration data as it is delivered from the card: Consecutive bytes each
84
with its most significant bit first. Altera devices like the FLEX family are
85
different here. They expect the bytes with least significant bit
86
first. Therefore, the configuration data has to be swapped bitwise before it
87 72 arniml
is written to the card. Michael Libeskind kindly provided a program that
88
accimplishes this task. Find it in sw/misc/bit_reverse.c.
89 25 arniml
 
90
 
91 10 arniml
Verification
92
------------
93
 
94
The spi_boot core comes with a simple testbench that simulates an SD/MMC
95
card. All four implementations of the core are verified there in parallel
96
while transferring the data for several sets.
97
You should normally not need to run the testbench. But in case you modified
98
the VHDL code the testbench gives some hints if the design has been broken.
99
 
100
 
101
Directory Structure
102
-------------------
103
 
104
The core's directory structure follows the proposal of OpenCores.org.
105
 
106
spi_boot
107
 |
108 49 arniml
 \--+-- doc                 : Documentation
109 10 arniml
    |    |
110 49 arniml
    |    \-- src            : Source files of documentation
111
    |
112
    +-- rtl
113
    |    |
114 10 arniml
    |    \-- vhdl           : VHDL code containing the RTL description
115
    |                         of the core.
116
    |
117
    +-- bench
118
    |    |
119
    |    \-- vhdl           : VHDL testbench code.
120
    |
121
    \-- sim
122
         |
123
         \-- rtl_sim        : Directory for running simulations.
124
 
125
 
126 21 arniml
RAM Loader
127
----------
128
 
129
Directory rtl/vhdl/ram_loader contains the sample design which loads the next
130
image from the card and stores its contents to external asynchronous
131
RAM. After reading 64 KB it triggers a new configuration process for the final
132
FPGA design.
133
Refer to the code for the mechanisms involved.
134
 
135
 
136 10 arniml
Compiling the VHDL Code
137
-----------------------
138
 
139
VHDL compilation and simulation tasks take place inside in sim/rtl_sim
140
directory. The project setup supports only the GHDL simulator (see
141
http://ghdl.free.fr).
142
 
143
To compile the code simply type at the shell
144
 
145
$ make
146
 
147
This should result in a file called tb_behav_c0 which can be executed as any
148
other executable.
149
 
150
The basic simple sequence list can be found in COMPILE_LIST. This can be
151
useful to quickly set up the analyze stage of any compiler or
152
synthesizer. Especially when synthesizing the code, you want to skip the VHDL
153
configurations in *-c.vhd and everything below the bench/ directory.
154
 
155
 
156
References
157
----------
158
 
159
  * SanDisk SD Card Product Manual
160
    http://www.sandisk.com/pdf/oem/ProdManualSDCardv1.9.pdf
161
 
162
  * SanDisk MMC Product Manual
163
    http://www.sandisk.com/pdf/oem/manual-rs-mmcv1.0.pdf
164
 
165
  * Toshiba SD Card Specification
166
    http://i.cmpnet.com/chipcenter/memory/images/prod055.pdf
167 18 arniml
 
168 22 arniml
  * BurchED
169
    http://burched.biz/
170
 
171 18 arniml
  * FPGA MMC-Card Config project
172
    http://www.opencores.org/projects.cgi/web/mmcfpgaconfig/overview

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.