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 26

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 arniml
 
2
README for the spi_boot core
3
============================
4 26 arniml
Version: $Date: 2005-02-27 19:05:14 $
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 22 arniml
The schematic (rev. A) shows how the core can be used with an FPGA board. I
24
use it to configure/boot the Xilinx Spartan IIe on BurchED's B5-X300
25
board. SV2 fits the "SERIAL MODE" connector on this board but you will have to
26
add a separate wire from R6 to attach INIT. Please check the proper use of the
27
pull-up resistors for your specific board.
28 10 arniml
 
29 23 arniml
 
30 11 arniml
Features
31
--------
32 10 arniml
 
33 26 arniml
* Configuration mode: configures 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 24 arniml
  * Hama 64 MB SD
48 18 arniml
  * SanDisk 128 MB SD
49
  * SanDisk 64 MB MMC
50
  * Panasonic 32 MB SD
51
 
52
Some MMC might fail with this core as not all cards support CMD18
53
(READ_MULTIPLE_BLOCK). Please consult the data sheet of your specific
54
model. In case your MMC does not implement CMD18 you might want to have a look
55
at the FPGA MMC-Card Config project.
56
 
57
 
58 25 arniml
Tools
59
-----
60
 
61
Downloading the configuration data to the card is a straight forward
62
process. The images have to be written starting at dedicated locations. For
63
the provided toplevel designs, these locations are multiples of 256 K. I.e. 0,
64
0x40000, 0x80000 and so forth.
65
 
66
dd (part of the GNU coreutils) serves this purpose:
67
$ dd if=ram_loader.bin of=/dev/sdX bs=512
68
$ dd if=pongrom_6.bin of=/dev/sdX bs=512 seek=512
69
$ dd if=pacman.bin of=/dev/sdX bs=512 seek=1024
70
 
71
The name of the device node depends on how the card reader is attached to the
72 26 arniml
kernel. For Linux systems this is most often something like /dev/sdX with X
73 25 arniml
ranging from a-z. Please note that it is essential to use the device without
74
any trailing numbers as they refer to partitions leading to wrong offsets for
75
data written to the card.
76
All this works perfectly for my Spartan IIe device as this FPGA expects the
77
configuration data as it is delivered from the card: Consecutive bytes each
78
with its most significant bit first. Altera devices like the FLEX family are
79
different here. They expect the bytes with least significant bit
80
first. Therefore, the configuration data has to be swapped bitwise before it
81
is written to the card.
82
 
83
 
84 10 arniml
Verification
85
------------
86
 
87
The spi_boot core comes with a simple testbench that simulates an SD/MMC
88
card. All four implementations of the core are verified there in parallel
89
while transferring the data for several sets.
90
You should normally not need to run the testbench. But in case you modified
91
the VHDL code the testbench gives some hints if the design has been broken.
92
 
93
 
94
Directory Structure
95
-------------------
96
 
97
The core's directory structure follows the proposal of OpenCores.org.
98
 
99
spi_boot
100
 |
101
 \--+-- rtl
102
    |    |
103
    |    \-- vhdl           : VHDL code containing the RTL description
104
    |                         of the core.
105
    |
106
    +-- bench
107
    |    |
108
    |    \-- vhdl           : VHDL testbench code.
109
    |
110
    \-- sim
111
         |
112
         \-- rtl_sim        : Directory for running simulations.
113
 
114
 
115 21 arniml
RAM Loader
116
----------
117
 
118
Directory rtl/vhdl/ram_loader contains the sample design which loads the next
119
image from the card and stores its contents to external asynchronous
120
RAM. After reading 64 KB it triggers a new configuration process for the final
121
FPGA design.
122
Refer to the code for the mechanisms involved.
123
 
124
 
125 10 arniml
Compiling the VHDL Code
126
-----------------------
127
 
128
VHDL compilation and simulation tasks take place inside in sim/rtl_sim
129
directory. The project setup supports only the GHDL simulator (see
130
http://ghdl.free.fr).
131
 
132
To compile the code simply type at the shell
133
 
134
$ make
135
 
136
This should result in a file called tb_behav_c0 which can be executed as any
137
other executable.
138
 
139
The basic simple sequence list can be found in COMPILE_LIST. This can be
140
useful to quickly set up the analyze stage of any compiler or
141
synthesizer. Especially when synthesizing the code, you want to skip the VHDL
142
configurations in *-c.vhd and everything below the bench/ directory.
143
 
144
 
145
References
146
----------
147
 
148
  * SanDisk SD Card Product Manual
149
    http://www.sandisk.com/pdf/oem/ProdManualSDCardv1.9.pdf
150
 
151
  * SanDisk MMC Product Manual
152
    http://www.sandisk.com/pdf/oem/manual-rs-mmcv1.0.pdf
153
 
154
  * Toshiba SD Card Specification
155
    http://i.cmpnet.com/chipcenter/memory/images/prod055.pdf
156 18 arniml
 
157 22 arniml
  * BurchED
158
    http://burched.biz/
159
 
160 18 arniml
  * FPGA MMC-Card Config project
161
    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.