Sean Cross
f88a76c3b0
sw: dfu: use macro for SPI flash offset
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 21:29:58 +08:00
Sean Cross
ae0df08489
sw: usb-desc: update landing URL and product name
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 21:29:29 +08:00
Sean Cross
3ad9853278
sw: usb-desc: mark product name as "static const"
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 21:28:40 +08:00
Sean Cross
58fba5b90e
hw: use ce 5
...
This lets us meet timing.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 13:17:58 +08:00
Sean Cross
47cbc614a1
hw: deps: use valentyusb v0.3.3
...
This version removes retry from the usb wishbone bridge. It was
discovered that this causes crc errors.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 13:01:36 +08:00
Sean Cross
4050898b51
sw: use foosn as the manufacturer
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 12:33:07 +08:00
Sean Cross
b708810f00
sw: dfu: fix sentinal search on null first packet
...
When the first packet is NULL, we weren't searching for the sentinal
properly. Limit the amount of data we search for.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 12:29:42 +08:00
Sean Cross
a3f1ee6d44
sw: fix typo in main
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 11:22:18 +08:00
Sean Cross
050e88ac82
Merge branch 'master' of github.com:im-tomu/foboot
2019-05-20 11:02:53 +08:00
Sean Cross
8e537a9e09
foboot-main: get basic msc working
...
It still doesn't do quite what we want, though.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 11:01:35 +08:00
Sean Cross
c5b5397529
initial commit of foboot main
...
This is an initial commit of a non-recovery version of foboot.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 10:59:48 +08:00
Sean Cross
ab16cc0119
foboot-bitstream: add "version" block
...
This block describes the various git version parameters.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 10:55:56 +08:00
Sean Cross
1913767ca7
tests: add simple program to test tx/rx
...
This program generates random data and makes sure it is received.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-14 19:28:29 +08:00
Sean Cross
c89bb50ebc
dfu: reset timeout to a sane value
...
Somehow it defaults to something that is very unreasonable.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-14 19:26:12 +08:00
Sean Cross
7f025eac5c
valentyusb: fix debug with multiple endpoints
...
Now we properly inhibit other endpoints, and prevent the buffer from
draining when there's a debug packet.
This also prevents an early return from DEBUG READ.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-14 15:33:00 +08:00
Sean Cross
bbfd68ed72
foboot-bitstream: use 5 ce lines
...
This doesn't change much, but it prevents nextpnr from getting into an
infinite loop.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-14 10:24:37 +08:00
Sean Cross
0f5267122b
valentyusb: use generic IO blocks
...
There's no need to use ICE40-specific IO blocks.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-14 10:23:49 +08:00
Sean Cross
8f5de3fb62
sw: usb-epfifo: remove dead code and fix usb behavior
...
This fixes USB behavior so it's much more reliable.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-12 21:48:03 +08:00
Sean Cross
8d6c3dc5fc
deps: valentyusb: use new usb pipeline
...
This pipeline removes the timing violations we had, and improves the
debug bridge by quite a lot.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-12 21:47:11 +08:00
Sean Cross
7ba476b057
examples: usb-cdcacm: fix example with good usb core
...
The USB core has changed a bit, and this fixes this example so that it
works with the new USB core.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-12 21:36:51 +08:00
Sean Cross
2adac57076
sw: epfifo: use new fifo arrangement
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-10 23:41:18 +08:00
Sean Cross
c5eb487951
deps: valentyusb: add fixes from usbalex
...
These fix the timing of the USB connection.
These fixes also fix issues with USB debugging.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-10 22:11:17 +08:00
Sean Cross
5b71eeea7d
foboot-bitstream: tristate pulldown on evt board
...
The EVT board has a pulldown, in case we want to do USB LS. This causes
issues on some hubs, because they end up with weak pullups, which throws
off enumeration.
Set it to a tristate input, which fixes this behavior.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-05 17:40:07 -07:00
Sean Cross
7221e0328b
examples: riscv-blink: don't reset usb on launch
...
This enables debugging, because the connection will remain active.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-01 14:34:05 -07:00
Sean Cross
3a6ae4679a
deps: valentyusb: fix "STALL" error on debug packets
...
We weren't properly ACKing debug packets. This fixes that.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-01 14:21:54 -07:00
Sean Cross
940755b8fb
doc: add BOOT-SEQUENCE.md
...
This is an initial draft of boot variables.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-01 14:08:54 -07:00
Sean Cross
e7493017a0
sw: initial commit of boot options
...
This adds the ability to configure the program that will be loaded.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-01 14:08:30 -07:00
Sean Cross
9c7db8a84a
sw: usb-desc: fix usb version
...
It should be 2.1, not 2.10. This fixes Windows enumeration.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-01 08:59:42 -07:00
Sean Cross
21be05f8ab
hw: foboot-bitstream: simplify duplicate CRG code
...
Much of the clock resource generator was duplicated for the two options:
PLL and adder. Remove this artifical distinction and reuse much of the
CRG code.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-29 16:37:51 -07:00
Sean Cross
e3a04fefa3
Merge branch 'master' of github.com:im-tomu/foboot
2019-04-29 16:33:26 -07:00
Sean Cross
2d26d2f067
fobooster: add initial, non-working version
...
This will be used to update Foboot. It is currently unfinished.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-28 19:43:06 -07:00
Sean Cross
6caffc1eb6
hw: deps: have valentyusb reset itself on error
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-28 16:43:12 +08:00
Sean Cross
39b3fb6507
hw: rtl: use latest release version of vexriscv
...
This doesn't appear to work yet, but is the latest upstream release
version of vexriscv.
Need to investigate more into why it's failing.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-26 09:53:51 +08:00
Sean Cross
5d6a0d0ec7
sw: webusb: fix landing descriptor warning
...
For some reason, -flto didn't like the "extern const struct" definition.
Hide the variable now and use an accessor function to silence this
warning, which may have caused other issues with stability.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-26 09:22:11 +08:00
Sean Cross
ba310ab8e2
hw: rtl: add missing files
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-25 23:35:51 +08:00
Sean Cross
d147af1e6a
hw: add some vexriscv experiments
...
We're trying to improve performance and reduce core size.
This uses a newer version of the vexriscv core. It has a shorter
pipeline, with better exception handling. It also properly initializes
registers.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-25 23:23:54 +08:00
Sean Cross
ee640fdb57
hw: foboot-bitstream: fix csr offsets
...
These offsets can shift. Ensure they stay the same during subsequent
rebuilds.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-25 17:40:37 +08:00
Sean Cross
b8145bde36
sw: use correct abi
...
The CPU we're using has no div/mul instructions, so use the rv32i ABI
instead of rv32im.
This saves about 15%.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-25 13:29:27 +08:00
Sean Cross
bee41ec891
hw: valentyusb: better buffer draining on reset
...
Pull in improved support for draining the buffers when going into reset.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-25 13:27:55 +08:00
Sean Cross
cd6151b009
sw: add -flto to cflags
...
This reduces codesize by 15% (~1 kB).
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-25 12:07:13 +08:00
Sean Cross
c4f95748a6
deps: valentyusb: change url to im-tomu organization
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-24 13:38:46 +08:00
Sean Cross
ace0d2c22f
hw: valentyusb: sync wishbone ep1 fixes
...
This fixes EP1+ so that interleved accesses work.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-23 17:25:06 +08:00
Sean Cross
f94da96db4
hw: foboot-bitstream: properly hook up cpu reset override
...
It turns out that just assigning a value isn't enough in Python to
assign the signal. You need to override the dictionary entry.
With this patch, it is now possible to dynamically adjust the CPU reset
entrypoint, which is handy for debugging.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-23 17:21:16 +08:00
Sean Cross
646388fcb7
sw: dfu: fix calculation for address offset
...
We were using the wrong offset for address calculation. Use the block
size, rather than the program size. This wasn't an issue before, because
the block size and the program size were both 256 bytes. Now the block
size can be 1024 bytes.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-22 15:51:57 +08:00
Sean Cross
1a5867c5e5
hw: foboot-bitstream: invert logic on pll selection
...
The pll is necessary to get consistent performance, but disabling it can
sometimes help meet synthesis timing. Ensure the pll is enabled, unless
explicitly disabled with this switch.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-22 15:09:48 +08:00
Sean Cross
b3050ae299
sw: spi: comment out dead code
...
This code emitted a warning. It's not used, so leave it commented for now.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-22 15:08:49 +08:00
Sean Cross
b8151d46a4
sw: ld: limit bootloader to 4096 bytes
...
It doesn't need any more, and we can use the rest of RAM to load a
temporary program.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-22 14:49:20 +08:00
Sean Cross
6e653b98d6
sw: support loading directly to RAM
...
If a sentinal is present, allow dfu-util to load a program directly to
RAM. This saves us the step of writing to flash.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-22 14:42:14 +08:00
Sean Cross
85bb787536
sw: support 1024-byte DFU writes
...
This increases performance of DFU write commands.
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-22 14:19:09 +08:00
Sean Cross
26a327486f
sw: minor shrink of sw code size
...
Signed-off-by: Sean Cross <sean@xobs.io>
2019-04-22 12:03:01 +08:00