Commit Graph

21 Commits

Author SHA1 Message Date
Harald Welte 6fc0ad3c7e fw/e1-tracer: Fix bNumInterfaces in new configuration
This fixes the following Linux kernel error message on the host:
usb 1-1: config 2 has 2 interfaces, different from the descriptor's value: 3

Change-Id: Ideb816169a1e995907901c018e7bd2f963c1a831
2022-11-02 22:06:05 +01:00
Harald Welte 6cb6e6ec15 fw/e1-tracer: Initialize IDT82V2081 from within firmware in e1d mode
Initially it was a good choice to keep the LIU driver in the host
software (easier debugging/changes).  However, we never really needed it
to do anything but initialization of the LIU.

So in order to avoid having to teach osmo-e1d or other software the
details about the LIU initialization, let's do this from the firmware
*if* the e1d compatible USB configuration is used.

Closes: OS#5733
Change-Id: Id2217ff4573c4eebd816318128f256e85fb3c3bd
2022-11-01 22:01:38 +01:00
Harald Welte f9280b0de1 fw/e1-tracer: Additional USB configuration for "osmo-e1d compatible mode"
This adds a second USB configuration to the e1-tracer firmware.  This
configuration is closer to the USB configuration of an icE1usb and hence
paves the way for using osmo-e1d with the tracer.

The main conceptual difference between the existing "legacy"
configuration and this new "e1d compatible" configuration is to have two
USB interfaces, one for each direction of the traced E1 interface.  Each
interface has its own separate two altsettings, one for the disabled
and one for the enabled state.

Unmodified osmo-e1d will not work straight away with this, as it expects
ISO OUT and ISU Feedback endpoints, which a pure rx-only tracing device
of course doesn't have.

Related: OS#5733
Change-Id: I97062b9f12317b1b9b3855409c2380108cb921ff
2022-11-01 22:01:38 +01:00
Harald Welte 326a08fe63 fw/e1-tracer: e1_start/e1_stop of individual channel
Let's split the starting and stopping between the two channels.

This is a preparation for a future e1d-compatible mode where each
channel (direction) has its own USB interface and hence must be
individually started/stopped.

Related: OS#5733
Change-Id: I7492325352222269bf0ba1346511c7dfa99c4f64
2022-11-01 21:55:51 +01:00
Harald Welte e08adb0dff fw/e1-tracer: restrict dfu programming to e1-tracer devices
Let's explicitly specify the VID/PID of the e1-tracer in the dfu-util
invocation 'make dfuprog' to avoid accidentially programming other
attached dfu capable devices.

Change-Id: I6a17f01a621cd4af6827167427fafd2f9f277755
2022-11-01 09:37:29 +01:00
Sylvain Munaut aae4d3059d firmware: Remove a couple of questionable debug puts()
Those were low level debug meant to be temporary and somehow ended
up committed.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ie1b802f347b0de9ea82edb61faaba6094b8f4dfa
2022-05-03 14:00:35 +02:00
Sylvain Munaut d376b2e852 fw/ice40-riscv: Remove usb_ep_boot manual declaration
It's now properly declared in the stack header

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Id2fd50c04a8d8781ad8b94e12ba9f469777482d1
2021-05-31 19:22:22 +02:00
Harald Welte 3255b74187 firmware: Build firmware files with auto-generated version numbers
This resembles what we do for other firmware targets, such as simtrace2,
osmo-ccid-firmware, etc.

As we have multiple different firmware, hardware, gateware projects in
this repository, and they each may have separate tags, we now require
that there are project specific tags.  So for example, tags with a
prefix of icE1usb-fw for the firmware versions.

symlinks for easy use by scripts etc. are generated, always pointing to
the last-built versioned filename.

Change-Id: Ia308587e36a79c27fdb285e369a9c921ee65995f
2020-12-17 13:20:51 +01:00
Harald Welte ae2c89e19e firmware: Rename fw_app.bin to icE1usb-fw.bin / e1_tracer-fw.bin
This is clearly much more descriptive, and avoids mixing up firmware
files for different boards

Change-Id: I319edb76dd74be6904395692ab1599fb8f1f9065
2020-12-17 13:20:51 +01:00
Sylvain Munaut 4d9a04e265 firmware/ice40-riscv: Enable more build warnings
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I99fad45e3aa9accbacaf020b1f5f93aa4b1d4950
2020-10-29 13:27:19 +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 de20fb713d firmware/ice40-riscv: Fix a couple of 'mixed signedness' warnings
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I31343263d7dab88a25254258cef44c6c2ddc730a
2020-10-29 13:24:50 +01:00
Sylvain Munaut 5e0217ea72 firmware/ice40-riscv/e1-tracer: Fix e1_tick_read()
This was broken when moving the design to non-hacked multi channel
E1.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I5e7ce22935609bc64333e2d5c310eb7493555a93
2020-10-29 13:24:02 +01:00
Sylvain Munaut c704c0704e firmware/ice40-riscv/e1-tracer: Remove CDC descriptors
This was never used and doesn't really belong here, this was just
an example descriptor in the original firmware this is based on.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ic72c991eb7a566b227484c7cde2c305d58202219
2020-10-29 13:22:55 +01:00
Sylvain Munaut f0d1218403 firmware/ice40-riscv/e1-tracer: Remove unused declaration of vio_set
This is a remanence of old firmware of the icepick on which that
design is based on.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I0bc27da4faa91de983cd5f355553ecaa13754266
2020-10-29 13:20:16 +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 4ea7d27764 firmware/ice40-riscv: Update no2usb core and fixup for API changes
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ia6bda410e2529858cb86827e186bb099b9b87799
2020-10-29 13:17:11 +01: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 1ac458f5fa fw/icE1usb: Reorganize fields in misc peripheral
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-09-15 22:09:10 +02:00
Sylvain Munaut c1d117b6de gateware/firmware: Match rx/tx tick order in register with doc
The documentation always had the rRX tick in the LSB which
is consistent with having the RX units before TX.

They can be read as 16 bit value anyway so there isn't any
performance impact.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2020-09-15 21:57:52 +02:00
Sylvain Munaut f5d7bf2480 fw/e1-tracer: Import firmware for the E1 tracer board
Some more code could probably be unified with the "normal" usb E1 adapter
to both reduce code duplication but also offer 'sniff' function to the
E1 adapter.

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