Project

General

Profile

IcE1usb » History » Version 11

laforge, 08/22/2020 07:25 AM

1 1 tnt
h1. iCE40 E1 USB interface
2
3 7 laforge
This page is the main entry point for the (completed!) "Software defined" E1 USB interface using the iCE40 FPGA at its core.
4 1 tnt
5
h2. Architecture
6
7 2 laforge
This approach tries to implement as much as possible inside an iCE40 FPGA
8 1 tnt
9
Particularly, the iCE40 FPGA
10 2 laforge
* contains the E1 PHY. There is no external LIU*, reducing the BOM cost significantly.  Instead, the comparators of the FPGA are used.  In practice, this has shown to work on short E1 links of a few meters.  We'd expect some problems in terms of long-haul E1 links, but those are not really the target use case here.
11 7 laforge
* contains the E1 framer, including frame alignment, CRC4 verification/generation, ...
12 2 laforge
* contains a USB softcore (no external USB PHY needed)
13
* contains a PicoRISCV softcore to implement USB protocol handling and to connect the E1 softcore with the USB softcore
14
15
So all-in-all, we can build a USB-E1 interface from little more than an iCE40 FPGA and an E1 line transformer!
16
17 11 laforge
{{graphviz_link()
18
digraph G {
19
  rankdir = LR;
20 1 tnt
21 11 laforge
  BTS -> XFMR [label="E1"];
22
  Linux [label="Linux\nOsmoBSC"];
23
  subgraph cluster_A {
24
    label = "iCE40 E1 USB Interface";
25
    XFMR [label="Magnetics"];
26
27
    subgraph cluster_B {
28
      label = "iCE40 FPGA";
29
      Comparators;
30
      Framer [label="E1 Framer\nSoftcore"];
31
      RISCV [label="RISCV\nSoftcore"];
32
      USB [label="USB\nSoftcore"];
33
      XFMR -> Comparators [label="E1 (HDB3)"];
34
      Comparators -> Framer [label="E1 (Serial Bits)"];
35
      Framer -> RISCV;
36
      RISCV -> USB;
37
    }
38
  }
39
  USB -> Linux [label="Frame-aligned raw\nbits over USB"];
40
}
41
}}
42 10 laforge
43 1 tnt
h2. Current stack
44
45 9 laforge
* The hardware is currently not documented, only few prototypes exists and have been half hand-wired. They are currently based off iCEBreaker and iCEBreaker-bitsy iCE40 dev boards. ( https://github.com/icebreaker-fpga/icebreaker ) as well as iCEpick by @tnt
46 1 tnt
* The gateware is temporarily hosted in the 'e1' branch of this repo : https://github.com/smunaut/ice40-playground/tree/e1/projects/riscv_usb
47
* The embedded software is in the same repository as above, in the 'fw' sub-directory : https://github.com/smunaut/ice40-playground/tree/e1/projects/riscv_usb/fw
48 2 laforge
* The userspace daemon that handles the USB communication is hosted at: https://git.osmocom.org/osmo-e1d
49 5 laforge
* The support for this daemon interface to the rest of the cellular stack is merged in mainline [[libosmo-abis:]]. Make sure you build it with @--enable-e1d@, though.
50 1 tnt
51
h2. Presentations
52
53
* Talk from OsmoCon 2018 about the Software Defined E1 project as a whole : attachment:osmocon_2018_e1.pdf
54
* Talk from OsmoDevCon 2019 about the iCE40 based solution specifically: attachment:osmodevcon_2019_e1.pdf
55 7 laforge
* "video recording of the iC40 based approach / OsmoDevCon 2019":https://media.ccc.de/v/osmodevcon2019-97-software-defined-e1
56 1 tnt
57
h2. Status
58
59 7 laforge
h3. Hardware
60
61
* Several hand-wired pre-production prototypes based on iCEbreaker and iCEbreaker-bitsy or iCEpick have been assembled and used successfully in 2019 and early 2020
62
* A fully integrated single-board design with two E1 lines and a GPS-DO for E1 clock stability has been created by @tnt in August 2020; prototype boards exist, and we expect a first production run is imminent.
63 1 tnt
64 10 laforge
h4. Early Prototype
65
66
!{width:50%}ice40-e1.jpg!
67
68
h4. Pre-production Prototype
69
70
!{width:50%}osmo-e1-ice40.jpg!
71 7 laforge
72
h3. Software
73
74
The full stack from gateware through firmware and host software has been tested and used in a variety of scenarios.
75
76
* gateware for the FPGA and firmware for the RISC-V softcore is available from the @e1@ branch of @ice40-playground.git@, see https://github.com/smunaut/ice40-playground/tree/e1
77 1 tnt
* The host software/driver is part of [[osmo-e1d:]], see the proejct page for related details.  [[libosmo-abis:]] has been extended with [[osmo-e1d:]] support.
78 8 laforge
79
h2. Credits
80
81
The development of FPGA softcores, firmware, PCB schematics, PCB layout and osmo-e1d was done by Sylvain Munat (@tnt).
Add picture from clipboard (Maximum size: 48.8 MB)