Commit Graph

165 Commits

Author SHA1 Message Date
Harald Welte 90c6d87b46 icE1usb fw: Disable reporting of 'loss of timing' for now
This works half way decent enough to make the LED status change visibly
in case the physical link is disconnected.  However, we will generate a
storm of USB interrupt endpoint messages if we leave this on

Change-Id: I9d0ddb2d404880c4a85e30de1b4bf4204d468ab7
2020-12-27 19:51:51 +01:00
Harald Welte b410b09043 icE1usb fw: Turn green LED off completely if no E1 signal is received
We don't really have an idea of the analog signal level and hence
no true LOS detection.  However, we can check the Rx clock tick counter
to detect if there is at least still any kind of signal at all or not.

Change-Id: Ibd23cbf1d044b46d8fed48fb97622e6ef980b99f
2020-12-27 19:51:51 +01:00
Harald Welte b2376370c4 icE1usb fw: e1_tick_read() for rx and tx
Change-Id: I8dd6765f27cdf5ab21ccb8290002c44eef67f96f
2020-12-27 19:51:51 +01:00
Harald Welte 47fda28a8f icE1usb fw: add port number argument to e1_tick_read()
Change-Id: I0f4548b5623a7eaf74af3076c301e029bb3933da
2020-12-27 19:51:51 +01:00
Harald Welte b754dd60cb osmo_e1f: Allow to transmit AIS
AIS is an all-1 bit-pattern which is used by intermediate equipment
to indicate that the link somewhere upstream is lost.

Change-Id: Icc5a16ee44ecebe802c4cca0b6cc763a88b6cc05
2020-12-27 19:51:51 +01:00
Harald Welte fea3a48414 icE1usb fw: un-configure E1 when altsetting 0 is selected.
So far we started on altsetting 0->1 transition, but we didn't stop
on the inverse 1->0 which typically happens when the host software
(osmo-e1d) stops.

Closes: OS#4676
Change-Id: I8e4817f68d8893ab2dc98fe93ce9a673e209ca63
2020-12-27 19:51:51 +01:00
Harald Welte a073ffed79 icE1usb fw: Expose error conditions from E1 driver
This will allow the USB interface code to report the errors to the
host PC.

Related: OS#4674
Change-Id: Iba3e00a2b28a2fef6dbd986bfc706c1619c3a3ed
2020-12-27 19:51:51 +01:00
Harald Welte 53f19474c8 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
2020-12-27 19:51:51 +01:00
Harald Welte 06fbf6b3ff icE1usb fw: Internal API for configuring E1 rx/tx config register
Related: OS#4675
Change-Id: Ib23f9b99f169ab18d730bcf67b97a7b6bf863e98
2020-12-27 15:17:21 +01:00
Harald Welte 7f74fe6e48 icE1usb fw: Don't store E1_*_CR_*_CLR in variables
Those clear bits are only set once at start-up and then later
explicitly.  They shouldn't be stored with the user configuration
in state variables.

Change-Id: If38e86aefea7f1be4e1ff5a88860f8be593eeedc
2020-12-27 15:16:19 +01:00
Harald Welte f74dad7b60 icE1usb fw: Put E1 IP core register related #defines in e1_hw.h
Related: OS#4675
Change-Id: I6783f473e6bb7dd08a5b5714bdd9b5aac0f28f0d
2020-12-27 14:09:02 +01:00
Martin Schramm 1e204b738c e1-tracer: update BOM attributes to 1st v2 prod run parts
* L2, L3 now 0805
* R6, R7 now 0402
* IC4 now ASEMB-12.000MHZ-LC-T
* RoHS state enabled again in scraper, not yet used in BOM

Change-Id: I4f1a82476ca84552efd71a47231e8b6ac02a3358
2020-12-27 13:01:44 +00:00
Harald Welte 5276567b24 icE1usb fw: Use green per-port LED to indicate alignment status
Whenever Rx is aligned, the green LED is permanently on.
Whenever Rx is not aligned, the green LED is blinking.

What's missing is to check for E1 clock ticks and turn the LED off
completely if there are no clock ticks.

Change-Id: I42d53544858dbbbae5206d9a62b08672966c9ebf
2020-12-20 23:20:21 +00:00
Harald Welte 2df1f805a6 icE1usb fw: Include E1 frame number in Rx USB header
This should enable the host to detect discontinuities, and also know
when a multiframe starts.

Related: OS#4674
Change-Id: Ie0688647c56ebfc2e08de44f8ec569e1c2cd6a28
2020-12-20 23:20:21 +00:00
Harald Welte daff4f6463 icE1usb fw: Have e1_rx_need_data() optionally return FIFO position
The position indicates where we are in terms of frame and multiframe.

The related code was ported over from e1-tracer.

Related: OS#4674
Change-Id: I9e59d86a2e8f4e85ca84c592438ad79966b49448
2020-12-20 23:20:21 +00:00
Harald Welte 175b37c42f icE1usb fw: Use register bit #define instead of magic number
Change-Id: Ic824ce5a6605c96989fefbf92f365bff618dccb2
2020-12-20 23:20:21 +00:00
Harald Welte a59ef2bb3f icE1usb fw: define e1_data_ptr() using e1_data_ofs()
It's best to compute the offset only at one place and use that
computation elsewhere.

Change-Id: I9a6cce07ea8b6eff1527215de00621da960b0472
2020-12-20 23:20:21 +00:00
Harald Welte 30fc560017 icE1usb fw: cosmetic: more comments in the code
Change-Id: I445bb2f92b6dcfe29ac20109ea2e63efb31051a1
2020-12-20 23:20:21 +00:00
Harald Welte 6360c07d91 osmo_e1f: Fix inverted logic of E bits
A value of '1' means _no_ CRC4 error observed. We got that right
in the receive side, but not in the transmit side so far

Change-Id: I5ef9ef3b9781da2f53f54253d31cdbf81957ea67
2020-12-19 12:34:40 +01:00
Harald Welte d9a8f9a07c osmo_e1f.c: Fix CRC4 insertion
When encoding the CRC bit for Frame number 0 and 8 in the multiframe,
we must first move the CRC4 into those of the last SMF.

Change-Id: I088741fc4528f33b3b989ada0e21957456deedb6
2020-12-19 12:08:17 +01:00
Harald Welte 2e7284b5be osmo_e1f: Fix use of uninitized variable
Change-Id: I42024856a58f0bd4fcc1c767688de5334994a8a8
2020-12-19 12:08:17 +01:00
Harald Welte 61a23eaf5d osmo_e1f.c: sa4..sa8 bits should be all-1 by default
From ITU-T G.704 Table 5A Note 4:

> Bits S a4 to S a8 (where these are not used) should be set to 1 on
> links crossing an international border.

Change-Id: Id55599a7152a90f85076de810db2a03ac6f3aac1
2020-12-19 12:08:17 +01:00
Harald Welte 5a45005847 osmo-e1-hardware: Fix missing PKG_CONFIG_PATH directory
otherwise we'll get:

make: Entering directory '/build/doc/manuals'
Package osmo-gsm-manuals was not found in the pkg-config search path.
Perhaps you should add the directory containing `osmo-gsm-manuals.pc'
to the PKG_CONFIG_PATH environment variable
No package 'osmo-gsm-manuals' found

Change-Id: I9f3d6e74be9e0fe31a2ee7aad9869ed7568ff6dd
2020-12-17 17:53:31 +01:00
Harald Welte 5ab3bfdba4 contrib/jenkins.sh: ugly work-around for PATH problems
For details see https://osmocom.org/issues/4911

Related: OS#4911
Change-Id: I04e9c29813f6695d0d53f7cdede34f83d24ea3fd
2020-12-17 17:44:07 +01:00
Harald Welte a624ef80d7 contrib/jenkins.sh 'publish' fixes
* don't install icE1usb files to e1-tracer directory
* don't replicate symlinks but copy

Change-Id: I6dff99dcc2ab465558ad6344ebb9cba73005cf34
2020-12-17 17:19:09 +01:00
Harald Welte a878ac8c33 add missing icE1usb-usermanual-docinfo.xml
This was missing in commit Ia04890cf3b321f8cb01e3c513a730031e76376b9

Change-Id: I4b20c38bf6ad87307c86e594cc23330d11b6303f
2020-12-17 17:19:09 +01:00
Harald Welte e7bccbac8b add contrib/jenkins.sh for build verification + manual / firmware upload
Change-Id: I70d7de4299e773b38a014e4884641712edbd45c3
2020-12-17 13:41:15 +01: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
Harald Welte 7d4ba34552 add udev.rules files for icE1usb and e1-tracer
Change-Id: Ie1be28359def6fc181f88558834ac52a001312b7
2020-12-15 08:48:26 +01:00
Harald Welte 2b7dadf73e cosmetic: comment spelling
Change-Id: I89e2ae1478688929a42c94c8279ebff1b3a6cd88
2020-12-15 08:48:26 +01:00
Harald Welte d645d44eb4 First version of icE1usb user manual
Change-Id: Ia04890cf3b321f8cb01e3c513a730031e76376b9
2020-12-15 08:48:26 +01:00
Harald Welte 72865d866f move specifications to sub-directory
Change-Id: Ib310e9bea7391cf0af27cf560a393e8c8d7bb190
2020-12-15 08:48:26 +01:00
Harald Welte c827185cc9 icE1usb: Mark some private functions as 'static'
Change-Id: Ie9808bb2fe264e9a3fa09168bfde57837b77d291
2020-12-14 13:48:09 +01:00
Martin Schramm 99196e9f83 e1-tracer: solve everything towards v2
* retract light guides and RJ45 1.5mm inwards (solves SYS#5051)
* SPI MOSI/MISO mismatch fixed (solves SYS#5050)
* footpint mismatch to BOM for L3,L4 fixed (solves SYS#5053)
* PCB had to get 5mm slimmer (adresses SYS#5088)
* repaired silk on name bott side
* DRC

Change-Id: I97ab7240b9b1fb68347dc994885c926b8c192217
2020-12-03 21:55:51 +01:00
Harald Welte 5ab1c6e919 gateware/README.md: Fix typo (CERL->CERN)
Change-Id: Ic1d0cad46a37a00714fa9b0cec5aa98ec9805a47
2020-11-04 15:54:25 +01:00
Harald Welte eb1b8432a2 e1_xcvr: Give signals proper names
Change-Id: I04107430cab02e493bbabef60b1cc19b535caad6
2020-11-04 15:53:38 +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 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 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 bc59615ebc firmware/ice40-riscv: Minor cleanup in SPI xfer routine
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I2da662af8279746f0f3788a9a0a5cfdfe9dc9f99
2020-10-28 21:59:29 +01:00
Sylvain Munaut c5f3f77909 firmware/ice40-riscv: Use const data ptr for spi program fn
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I28b826b7a559ffccccdfa7c6e289a715ab1a4a01
2020-10-28 21:58:57 +01:00
Sylvain Munaut bbe3e28052 gateware/common: Fix whitespace formatting in wb_epbuf
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I4298b198ce02347de05d974458e98f44200adf63
2020-10-28 00:43:13 +01:00
Sylvain Munaut 25e57302bf hardware/icE1usb: Update ECN with rev 1.0 production
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I9996a076d2eef341211ba401ec0421bf9b11a78a
2020-10-28 00:42:31 +01:00