Commit Graph

15 Commits

Author SHA1 Message Date
Sylvain Munaut 2c33f6d5bb icE1usb fw: Add support for the ICE1USB_DEV_GET_FW_BUILD control request
This was already defined but not implemented

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Id65734153c92ef87bc9ecf967447e9bf11804f24
2022-01-13 13:21:29 +01:00
Sylvain Munaut caf8cf94e1 icE1usb fw: Move handling of device-wide request in usb_dev.c
We have upcoming ones not related to the E1 interface, so really
it make more sense to not have those in usb_e1.c

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I686916bb2b2cb90e94ac9c595deab19f189fcd49
2022-01-13 13:21:29 +01:00
Sylvain Munaut c9c22a62cd icE1usb fw: Have usb_e1 handle the E1 polling and multi port
The init already takes care of both port and also calling
e1_init, so it makes sense to have a usb_e1_poll() that
encapsulate both the actual e1 hardware poll and running
the usb stuff for both port.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Icf81efcdc5c8f13480ba2652bc6e7c1ca226ae4d
2022-01-13 13:19:06 +01:00
Sylvain Munaut 0cc1613f39 icE1usb fw: Update E1 core start/stop procedure
Previously we were just doing a hard reset, calling init again.
And to stop, it was a bit harsh as well, just calling init with
0 as argument, not cleaning pending descriptors and such.

Now, the HW is initialized once and there is proper startup and
shutdown procedure, leaving things in the proper state.

Init of e1 hardware (call to e1_init) is also delegated to usb_e1
since it's that module that handles all state changes and config
so it makes sense it handles init too rather than calling it from
fw_app.c

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I639f90ce3488a1a08e87854e74e0586010264f5d
2022-01-10 14:48:56 +01:00
Sylvain Munaut b4d25799ff icE1usb fw: Update list of debug commands
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I25c3d1db5d9ffae1cf4de83aed89b6394d032dd8
2022-01-09 19:27:55 +01:00
Sylvain Munaut 41c98b6b67 icE1usb fw: Add multi-port support in USB code
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I134410b542461c34339baa8d9120a5c86fc35d46
2022-01-09 19:18:08 +01:00
Sylvain Munaut 3da5151569 icE1usb fw: Add multi-port support for e1.{c,h}
Currently all the users of those function just statically use port 0
only.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I17671be65543f5a2bf3d16ba2b5a5081eb38ebdf
2022-01-09 17:21:04 +01:00
Sylvain Munaut 0749d576d3 icE1usb fw: Remove useless variable in main loop
Left over from early testing code ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I242bbcd42ba96f56bf12bbe57537f3a72a44767b
2022-01-09 17:21:04 +01:00
Harald Welte 9469e046f1 icE1usb fw: USB control request handling
This introduces a number of vendor-specific control requests for
configuration of the icE1usb from the host software.

Closes: OS#4675
Change-Id: I9d28566ba21a2a78def5e4a0ba07ecbc4a583aa9
2021-01-05 23:24:32 +01:00
Sylvain Munaut 9067392724 firmware/ice40-riscv/icE1usb: Remove a obsolete debug command
This doesn't even do anything on this SoC ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ia57674dcfb578b3a68845a9719aaad7ee285dc76
2020-10-29 13:26:38 +01:00
Sylvain Munaut 632a3008b3 firmware/ice40-riscv: Add usb_e1.h
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ica42b00d3f6ae910e2b4711b7eade2492b3cebfb
2020-10-29 13:25:45 +01:00
Sylvain Munaut 46d6b412f5 firmware/ice40-riscv: Create a reboot() function
instead of direct access to registers.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Iaee092c5ef651f0350b3f46386ed79fdbe06afcb
2020-10-29 13:19:05 +01:00
Sylvain Munaut 5e86047024 fw/icE1usb: Update to support production hardware
Also default build to it since very few people would want to build
firmware targetted to the prototypes ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-09-15 22:20:21 +02:00
Sylvain Munaut 035e247bf0 fw/ice40-riscv: Fix reboot to bootloader
Address was from previous gateware ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-09-15 22:09:53 +02:00
Sylvain Munaut bc9f5c4219 fw/icE1usb: Import firmware for the icE1usb and icE1usb-proto boards
Currently only the icE1usb-proto is supported. Adaptation for the
final production hardware is yet to be done.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-09-14 10:56:49 +02:00