Godzil 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
..
bootldr 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
tests 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
utils 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
Makefile 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
README dc478186e5 Firmware: add words of wisdom in README after switching from Ubuntu to Fedora Core ;-) %!s(int64=12) %!d(string=hai) anos
bits.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
ccsbcs.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
cfg.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
cfg.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
cic.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
cic.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
cli.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
cli.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
clock.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
clock.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
conf2h.awk e121b34cf4 Initial Commit %!s(int64=15) %!d(string=hai) anos
config 1d928e7091 Merge branch 'udev' into develop %!s(int64=10) %!d(string=hai) anos
config.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
crc.S 31d9e1a1d2 some sanity checks, early status messages %!s(int64=13) %!d(string=hai) anos
crc.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
crc16.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
crc16.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
crc32.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
crc32.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
diskio.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
faulthandler.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
ff.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
ff.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
ffconf.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
fileops.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
fileops.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
filetypes.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
filetypes.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
flash.cfg d9abb0811e begin ARM firmware %!s(int64=13) %!d(string=hai) anos
flash.script c97278c3d6 Firmware: adjust to reduced bootloader size %!s(int64=12) %!d(string=hai) anos
fpga.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
fpga.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
fpga_spi.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
fpga_spi.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
init.gdb 40248e61af mk2 fw wip %!s(int64=13) %!d(string=hai) anos
integer.h f063cb31f9 mk2 fw wip (cleanup indent+comment) %!s(int64=13) %!d(string=hai) anos
irq.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
led.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
led.h b7654290a1 LED PWM %!s(int64=13) %!d(string=hai) anos
lpc1754.cfg 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
lpc1754.ld c97278c3d6 Firmware: adjust to reduced bootloader size %!s(int64=12) %!d(string=hai) anos
main.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
memory.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
memory.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
msu1.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
msu1.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
openocd-usb.cfg 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
power.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
power.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
printf.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
reset.cfg db45a5afaf mk2 fw wip %!s(int64=13) %!d(string=hai) anos
rle.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
rle.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
rtc.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
rtc.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
sdnative.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
sdnative.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
smc.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
smc.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
snes.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
snes.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
snesboot.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
sort.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
sort.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
spi.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
spi.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
startup.S d9abb0811e begin ARM firmware %!s(int64=13) %!d(string=hai) anos
sysinfo.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
sysinfo.h 0f3138124e add missing files cfg.[ch] and sysinfo.[ch] %!s(int64=12) %!d(string=hai) anos
tests.h 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
timer.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
timer.h d88fbb6124 firmware/timer: move constants to header files %!s(int64=12) %!d(string=hai) anos
uart.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
uart.h 1d928e7091 Merge branch 'udev' into develop %!s(int64=10) %!d(string=hai) anos
uncfgware.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
xmodem.c 8d58ca0f7b Big code cleanup and re-indented, finally ! (Thanks astyle!) %!s(int64=10) %!d(string=hai) anos
xmodem.h f6df5e1158 Firmware: remove magic number for XModem block size %!s(int64=12) %!d(string=hai) anos

README

How to build:

a) Build requirements
* make
* Cortex M3 toolchain
* snescom/sneslink
* Xilinx FPGA synthesis tool (e.g. ISE WebPack)
* PIC assembler

b) Cortex M3 toolchain
* obtain the cm3-toolchain builder:
git clone http://snowcat.de/toolchain-cm3.git/
* build the cm3-toolchain. Some tools, libraries, and headers are required,
including but probably not limited to:
- libz-dev
- libcloog-ppl-dev
- texinfo
- libmpfr-dev
- libgmp3-dev
- gawk
- bison
- recode
- flex
- libncurses5-dev
- libexpat-dev
- make
- gcc
Package names may differ for your distribution.
Newer gccs complain when compiling binutils, so you may have to add
'--disable-werror' to the compiler options for binutils in the Makefile.
The Makefile will install immediately so make sure you can write to the
installation directory.

c) snescom/sneslink
* http://bisqwit.iki.fi/source/snescom.html

d) ISE WebPack
* http://www.xilinx.com/products/design-tools/ise-design-suite/ise-webpack.htm

e) PIC assembler
* e.g. GPUTILS, http://gputils.sourceforge.net/

f) general order of operations
1) program the PIC (cic/supercic/supercic-key.asm)
2) build and program the bootloader.
3) build the firmware and copy it to the memory card
4) build the snes menu and copy it to the memory card
5) build and compress the FPGA configuration and copy it to the memory card
6) insert memory card, power on; the bootloader should begin flashing the
firmware and boot it

1) Programming the PIC
Use a PIC assembler + programmer of your choice and program a PIC12F629 with
cic/supercic/supercic-key.asm. Make sure that the clock source is set to
EC_OSC and MCLRE is disabled.
After programming you can solder the PIC to the board and short JP401.
Open JP401 in case you need to reprogram the PIC on board.

2) Building & programming the bootloader
The Makefile is prepared for JTAG programming using OpenOCD 0.4 and an FT2232
based USB-JTAG adapter.
Connect a JTAG cable to J401 (14-pin header). The pinout is printed on the
board. cd to src/bootldr and make && make program.

3) Building the firmware
cd to src/utils and make.
cd to src/ and make.
You should obtain a firmware file called obj/firmware.img. Copy this file to
/sd2snes/firmware.img.

4) Building the SNES menu
snescom is required.
cd to snes/ and make.
Copy the resulting file menu.bin to /sd2snes/menu.bin.

5) Building the FPGA configuration
Compile the RLE compressor in utils/rle.c:
$ gcc -Wall -o rle rle.c

Load verilog/sd2snes/sd2snes.xise in Xilinx ISE (or create your own project).
Target is a XC3S400-4PQ208.
Generate the programming file and compress it using utils/rle.c:
$ rle main.bit fpga_base.bit

Copy fpga_base.bit to /sd2snes/fpga_base.bit