Commit Graph

440 Commits

Author SHA1 Message Date
Sean Cross
e7ec80a592 Merge remote-tracking branch 'xobs/master'
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 15:15:06 +08:00
Sean Cross
c9a0d9d01d releases: add binaries for foboot-v2.0.0
This is the first release of Foboot v2.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 15:11:19 +08:00
Sean Cross
a6fd320f52 Merge branch 'foboot-2' of github.com:im-tomu/foboot into foboot-2 2019-11-25 13:58:18 +08:00
Sean Cross
249404cf41 deps: sync latest versions of dependencies
This just ensures we're forwards-compatible.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 13:24:10 +08:00
Sean Cross
f36a52453e hw: bitstream: move memory range for litex compatability
The latest version of litex requires that we move this memory range up
by 0x80000000 to build.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 12:53:54 +08:00
Sean Cross
aa00485f43 sw: include hardware version in product description
This addresses #21.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 09:34:00 +08:00
Sean Cross
24a9d7e4c7 hw: define C macros indicating hardware revision
These macros can be used by the bios to indicate hardware revision.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 09:34:00 +08:00
Sean Cross
eb054ba3d4 sw: include hardware version in product description
This addresses #21.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 09:15:10 +08:00
Sean Cross
405918134e foboot-bitstream: encode spi flash information into platform
Different platforms have different spi flash sizes and different numbers
of dummy bits to send.  Encode this information in the platform to
simplify spi flash addition.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 21:58:38 +08:00
Sean Cross
c376d30811 hw: deps: update litex-boards to have hacker spiflash4x
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 21:58:09 +08:00
Sean Cross
4d9680ed25 booster: blink error pattern on failure
Set the LED to red, and blink a continuous pattern to inform the user
what failed.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 20:32:32 +08:00
Sean Cross
6a147238aa booster: build with -O2
Earlier we were building with -O0, which is useful for debugging, but
is not particularly fast.  Build with -O2 now for speeeeed.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 20:11:51 +08:00
Sean Cross
3e51649c7e gitignore: ignore swapfiles and make-booster
The pattern for swapfiles was incorrect.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 20:11:27 +08:00
Sean Cross
0b61bfcdc7 booster: get booster working with foboot-2
This fixes the spi driver so that it works with foboot-2.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 20:10:12 +08:00
Sean Cross
4d6746d584 booster: make-booster: print hash on output
Next time I need to debug the hash, this will come in handy.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 20:09:14 +08:00
Sean Cross
fb08d194ca foboot: spi: fix spiId and remove dead code
Remove code that doesn't get called.

Also, remove the `spi_id` global.  It conflicted with one from
the linker, which was causing contention.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 20:08:24 +08:00
Sean Cross
5a587c5752 booster: README: document how to make and use make-booster
Previously we missed some crucial information about how to use it.
Document that information here now.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 20:06:21 +08:00
Sean Cross
ea04c290eb booster: foboot-2 compatibility
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-24 15:14:07 +08:00
Sean Cross
95e6e8c211 deps: litex-boards: add moduledoc for fomu crg
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-23 14:13:36 +08:00
Sean Cross
f751f51722 foboot-bitstream: move "reset" block below USB pads
This keeps the modules in an order that roughly matches the memory
order.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-23 13:57:49 +08:00
Sean Cross
b40530df41 foboot-bitstream: fix comments and reorder to improve timing
Reordering the file seems to improve timing by quite a lot, even after
adjusting the pnr seed.  With this reordering we now meet timing.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-23 13:29:08 +08:00
Sean Cross
824470a974 foboot-bitstream: start documenting soc
lxsocdoc can't yet document this, but add it anyway in preparation.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-23 12:57:09 +08:00
Sean Cross
45e3b5b617 rtl: break foboot modules into their own files
These are all independent modules, so break each one out into its own
file.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-23 10:03:56 +08:00
Sean Cross
c8e632dd7e foboot: version: work even if git is untagged
Allow the "version" block to not crash python when the git repository is
untagged or doesn't exist.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 22:53:50 +08:00
Sean Cross
ce777d5057 bitstream: touch: remove "field" support to fix inputs
The "touch" block doesn't need field support, since it's just one field.
Remove support, which simplifies the layout and unbreaks "input"
support.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 22:47:37 +08:00
Sean Cross
d6292f5dd3 foboot-bitstream: use little-endian for SPI device
If we don't do this, then the words will all be backwards.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 22:04:45 +08:00
Sean Cross
80056860b6 booster: allow alternate spi id
If the alternate spi id is detected, force it to the original spi id.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 19:04:32 +08:00
Sean Cross
bb8079711b booster: document alternate SPI id
Some boards have this alternate SPI id.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 19:03:16 +08:00
Sean Cross
cba427a7fb spi: switch from SPI mode 1 to mode 0
We got CPHA wrong before.  Set the pin before the clock.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 19:03:05 +08:00
Sean Cross
99f36ceca4 litex-boards: fix pin mapping on pvt
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 18:58:15 +08:00
Sean Cross
b920660d71 booster: compile with -O2
Maybe that's why it was running slowly...

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 12:34:59 +08:00
Sean Cross
449f408cfe booster: finish documenting flash sequence
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 12:34:41 +08:00
Sean Cross
dcb75f1e7e usb: fix interface descriptors
Windows wouldn't enumerate the device because the descriptor was buggy.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 12:18:38 +08:00
Sean Cross
95efe4681e dfu: set manifest-wait-reset timeout to 10ms
This removes the one-second delay after we're done flashing.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:44:08 +08:00
Sean Cross
cc8e9d5af8 sw: eptri: remove rgb led calls
These are an abstraction violation, and emit warnings.  They shouldn't
be needed anymore, now that debugging is finished.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:42:00 +08:00
Sean Cross
a6c888ba50 sw: spi: remove unused gpio functions
Now that we hardcode gpio output, remove the abstracted functions.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:41:36 +08:00
Sean Cross
2d8b8cb047 foboot-bitstream: fix conflict with spibone
Previously, we had two different spibone implementations due to a failed
merge.  This removes the second one.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:37:27 +08:00
Sean Cross
d4b1a64dca sw: get usb working with eptri
This commit is the final commit necessary to get foboot working with the
new eptri api.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:37:27 +08:00
Sean Cross
1ee442d407 dfu: parameterize all timeouts
This makes it easier to try out different timeouts for various DFU
operations.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:31:46 +08:00
Sean Cross
1ed2e4ce5e dfu: use 4 kb erase blocks
There is no benefit to using larger erase block sizes, so stick to using
the smallest available size.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:31:19 +08:00
Sean Cross
c6c3ae8c47 spi: speed up bit banging and special case everything
This patch significantly improves SPI throughput by avoiding
many duplicated writes.  For example, we now only adjust the MISO
direction once during every byte rather than for every bit.

This improves the time it takes to upload a 128 kilobyte file from 29
seconds to 6 seconds.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 11:28:53 +08:00
Sean Cross
1f91f81f8e eptri: work-in-progress to get eptri working
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-22 08:03:35 +08:00
Sean Cross
6766c9323c Merge branch 'foboot-2' of github.com:im-tomu/foboot into foboot-2 2019-11-22 08:00:41 +08:00
Sean Cross
f536429bff deps: update valentyusb and add spibone
Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-12 21:34:43 -08:00
Sean Cross
58f99aebf2 eptri: wip commit
This commit includes the spibone support we're using to debug eptri.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-01 17:07:27 +08:00
Sean Cross
7edde2c26e deps: use fixed litex-boards evt commit
Signed-off-by: Sean Cross <sean@xobs.io>
2019-10-11 21:40:22 +08:00
Sean Cross
5e33feee21 deps: lxsocdoc: fix various document generation issues
Signed-off-by: Sean Cross <sean@xobs.io>
2019-10-07 12:11:44 +08:00
Sean Cross
985de5bde8 hw: bitstream: use 5 dummy cycles for spi flash
With the default of 15, it doesn't actually work.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-10-07 12:10:40 +08:00
Sean Cross
c667d1769e hw: bitstream: document version register
Signed-off-by: Sean Cross <sean@xobs.io>
2019-10-07 12:10:18 +08:00
Sean Cross
25bf6c4335 rtl: add mcycle and minstret CSRs to vexriscv
Signed-off-by: Sean Cross <sean@xobs.io>
2019-10-07 12:08:33 +08:00