Commit Graph

116 Commits

Author SHA1 Message Date
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
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
298aefed9f sw: don't ack the fifo reads
This is no longer required.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-25 14:09:33 +08:00
Sean Cross
3ee8482e35 sw: working commit
This commit represents a working build.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-20 20:16:26 +08:00
Sean Cross
6de5089821 sw: add cdc endpoint
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-12 10:23:40 +08:00
Sean Cross
eb8fc91527 sw: more usb support for multiple endpoints
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-12 10:23:15 +08:00
Sean Cross
868195254a sw: eptri: add uart test
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-12 10:21:04 +08:00
Sean Cross
c2bbd5c58f sw: main: init usb earlier
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-11 13:32:10 +08:00
Sean Cross
950a98ba8c sw: usb-dev: add address and eptri support
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-11 13:31:54 +08:00
Sean Cross
3ea66a7689 src: epfifo: add address support
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-11 13:30:32 +08:00
Sean Cross
a9a75fb02f sw: use latest csr.h file
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-11 13:29:27 +08:00
Sean Cross
cf8273d8c1 sw: usb: add set_address support
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-11 13:29:03 +08:00
Sean Cross
e4c43b74d9 sw: add initial eptri support
Signed-off-by: Sean Cross <sean@xobs.io>
2019-09-11 13:28:43 +08:00
Sean Cross
1664f3533c sw: apply nerve pinch to bootloader update
Use the same FBM nerve pinch to prevent entering the updater.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-07-26 10:31:57 +08:00
Sean Cross
3e2febb464 sw: initial addition of bootloader updater
Add the ability to boot from a bootloader if the right hook is found.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-07-24 20:58:45 +08:00
Sean Cross
49a7197f7c sw: generated: add latest csr.h file
Signed-off-by: Sean Cross <sean@xobs.io>
2019-07-21 13:01:37 +08:00
Sean Cross
a363e25b76 sw: time: rename SYSTEM_CLOCK_FREQUENCY to CONFIG_CLOCK_FREQUENCY
This changed in litex.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-07-21 12:29:20 +08:00
Sean Cross
10454fa0be sbled: fix mapping of r,g,b and add bit-bang mode
Fix the mapping of red, green, and blue.  Now the LEDDPWRR, LEDDPWRG,
and LEDDPWRB map to their correct values.

Additionally, a bit-banged mode for the LED has been added to enable
fine-grained control in a simpler manner.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-07-08 10:13:09 +08:00
Sean Cross
5468cb914a sw: spi: remove lots of dual/quad/qpi code
This is an effort to fix boards that go into RO mode on their own.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-07-05 15:23:04 +08:00
Tom Keddie
9be328ead9 sw : fix warning in dfu.h and usb-dev.c 2019-06-30 18:28:05 -07:00
Sean Cross
b41f4930cf csr: include generated macro for bitstream sync
The ICE40 bitstream sync byte is now available as a macro in csr.h.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-06-19 14:06:32 -07:00
Sean Cross
5fe9a814ea sw: support riscv64 on raspberry pi
The name of the compiler has changed on raspberry pi, so support the
previous name as well as the new one.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-06-19 08:20:43 -07:00
Sean Cross
4d40bb5f18 sw: update csr.h to release version
Signed-off-by: Sean Cross <sean@xobs.io>
2019-06-18 19:45:04 -07:00
Sean Cross
8354617950 Merge branch 'master' of github.com:im-tomu/foboot 2019-06-17 15:33:49 -07:00
Sean Cross
4057294332 sw: clean up underflows observed during updates
On some platforms, something overflows and puts the system in a state
where it cannot update.  By checking for underflow on various counters,
we can now update properly on these systems.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-06-17 14:48:08 -07:00
Tom Keddie
341db19f70 Move bitstream sync constants to CONFIG entries 2019-06-13 20:20:24 -07:00
Tom Keddie
c19d3d439c Add explicit include of csr.h 2019-06-05 13:21:41 -07:00
Tom Keddie
56e7fc09d9 Remove warnings 2019-06-05 13:18:57 -07:00
Tom Keddie
2770730c1a Merge branch 'master' into tomk_201090605_imagesize_override 2019-06-05 13:14:08 -07:00
Tom Keddie
268069e126 Add optional override of user flash image in dfu code 2019-06-05 13:08:05 -07:00
Sean Cross
8807edee24 usb-desc: use PID assigned to Fomu
Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-22 11:21:45 +08:00
Sean Cross
b6f3cc503d sw: main: fix "boot to main bootloader"
This gets the "main bootloader" support working.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-05-20 21:30:21 +08:00
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
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
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
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
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
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
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
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
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
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
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
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