Commit Graph

127 Commits

Author SHA1 Message Date
91a23d808c sw: Makefile: fix third_party and package naming
With these changes, litex mode should now work.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-06 10:51:08 +08:00
2a7e431947 hw: foboot-bitstream: support building bios
Now that the failsafe bios has stabilized, support building it as part
of the ROM.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-06 09:42:29 +08:00
a9a5f0cc0d sw: minor removal of unused code
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-06 09:35:50 +08:00
d6ae51f69b sw: ld: add support for litex build
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-06 09:35:23 +08:00
2437e8b5c1 sw: Makefile: support litex build environment
Allow this software package to be built from within the Litex build system.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-06 09:34:26 +08:00
6435aec3db foboot-bitstream: add hacker revision
Untested commit -- this should add support for the Hacker version of the
PCB.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 18:58:19 +08:00
b40a9bad43 rgb: fix typo in macro
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 18:17:11 +08:00
b5f17acdf6 sw: enable fancy led effects
Support different LED patterns depending on the mode.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 18:10:05 +08:00
db65ccc199 hw: document warmboot some more
Realized that there are 5 images and not 4.  With this, everything
works as it should.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 17:34:10 +08:00
fd76536351 usb-dev: reboot to image 0
Since this is a failsafe bootloader, reboot to Image 0.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 17:33:28 +08:00
eaa0d63ccb usb-epfifo: fix DATA0/DATA1 swaps for Tx
We were sometimes sending DATA0 instead of DATA1.  Fix that.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 17:33:02 +08:00
7d091a72b9 main: poll dfu in main loop
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 15:10:19 +08:00
7bcc8529d6 dfu: initial working commit
This commit actually works, but still has a few issues.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 15:09:52 +08:00
ac349ce1a1 spi: support 32- and 64-kB erase blocks
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 15:09:04 +08:00
cbf4958236 usb-epfifo: remove extra USB_NAK setting
This works around an issue, though it's still not properly working.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 13:21:09 +08:00
2b0575889f usb-dev: remove commented-out printf statements
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 13:20:54 +08:00
c92af747cd spi: actually transmit data
We were sending data on CS, not on CLK.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-05 13:19:46 +08:00
d72925fdeb sw: experimental improved dfu performance
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-03 22:11:31 +08:00
4c3f0f2402 valentyusb: use experimental shorter pipeline
This helps to improve timing.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-03 22:11:02 +08:00
1660681d38 hw: add 2-stage-1024-cache
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-03 21:57:53 +08:00
c33d86adb9 foboot-bitstream: fix warmboot and add rgb block
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 18:11:58 +08:00
85b6d75882 sw: update to latest generated files
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 18:11:25 +08:00
dbc0f81715 usb: re-enable extra usb descriptors
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 18:11:09 +08:00
851e54e70c main: initialize rgb driver
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 18:10:56 +08:00
85bdc7991c rgb: add initial rgb code
It initializes the rgb driver, and can write to its registers.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 18:10:17 +08:00
a3c05bd19e sw: system: add reset key to reboot()
Add the key `0xac` to the reset command, to prevent accidental resets.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 16:40:09 +08:00
33aec0876b sw: usb-epfifo: disable usb events before disconnect
If we don't disconnect the usb event system, then we will lock up
in an irq storm.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 16:39:13 +08:00
8599ec7007 hw: bitstream: simplify command line argument parsing
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-02 13:03:47 +08:00
0e720d5acc README: add information about sw and hw and building
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-01 10:10:13 +08:00
2fd01b8303 foboot-bitstream: more help description, add dvt support
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-01 10:09:20 +08:00
0a4c73a63a sw: wip commit -- dfu state machine works, spi broken
Need to fix SPI and SB_WARMBOOT, but the DFU state machine now works.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-28 11:13:25 +08:00
6595eb1ef1 valentyusb: increase incoming buffer to 128 bytes
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-28 11:12:32 +08:00
7191c12490 wip: just need to get WARMBOOT working
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-28 11:11:36 +08:00
a3298226e5 sw: getting dfu working about to add debug bridge
We're having issues getteing DFU working.  It almost works, but has some
issues.  Unfortunately, we're out of space for printf.

Now we will work to get the UART Wishbone bridge working, to move
forward on debugging support.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-26 09:39:55 +08:00
b0afd2b0ae sw: puts: don't eat first character
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-25 18:59:57 +08:00
3d6acaf51e sw: wip commit -- getting dfu working
Now that we have SPI and USB both working, we can start to close the
loop and get DFU working.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-25 17:39:06 +08:00
7210ee219d sw: add div/mul instructions
For foboot, we're using a CPU without a divide or multiply instruction,
to save gates.  Replace these with software implementations.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-21 11:01:46 +08:00
2139317530 sw: include: sync csr.h and mem.h
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 13:14:57 +08:00
dd9cdfa7a3 sw: usb-epfifo: make buffer pointers static
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 13:14:20 +08:00
23b9962067 hw: foboot-bitstream: remove pmod debug comments
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 13:12:53 +08:00
fa690d63ed hw: foboot-bitstream: clean up debug generation
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 13:12:29 +08:00
4f0507fc77 hw: foboot-bitstream: remove "generating firmware" message
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 13:12:08 +08:00
f3d779787b hw: foboot-bitstream: add reset to usb_48
This is required to meet timing.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 13:11:45 +08:00
b09333f023 hw: add spi and new vexriscv to foboot
This is the beginning of having SPI.

Also add a new two-stage pipeline.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 11:25:09 +08:00
03327067ff sw: add spi base
This is taken from fomu-flash, and needs to be adapted.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-20 11:23:19 +08:00
c7632ae8bd deps: litex: sync with latest version
This pulls in several fixes, including custom vexriscv modules.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-17 17:33:31 +01:00
4aa3861c03 hw: deps: update to first feature-complete valentyusb
This is the first version of `valentyusb` that successfully enumerates
without any errors.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-11 11:52:03 +08:00
ff4774ebc3 sw: usb-epfifo: fixups to remove errors in enumeration
With these fixups, we can now enumerate successfully.

The code is a mess, but this is the first functionally-correct build.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-11 11:51:19 +08:00
9909b3bbdb sw: usb-desc: set product name to "Fomu Bootloader"
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-11 11:50:55 +08:00
f5fd282d61 sw: usb-dev: remove errant i++
Signed-off-by: Sean Cross <sean@xobs.io>
2019-03-10 22:46:02 +08:00