lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2022

  • 3 participants
  • 781 discussions
Change in osmo-e1-hardware[master]: icE1usb fw: Don't prefill feedback
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26842 ) Change subject: icE1usb fw: Don't prefill feedback ...................................................................... icE1usb fw: Don't prefill feedback This prevents inlining of the code, and is completely unecessary. (1) It will be filled a bit later (2) We don't have any meaningful feedback to provide anyway Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I6e97bc79d1fe50950bb1f7cd71d8c428e928d4ae --- M firmware/ice40-riscv/icE1usb/usb_e1.c 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/42/26842/1 diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index a18ebe4..032eec8 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -323,9 +323,6 @@ ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(292); ep_regs->bd[1].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(292); - /* EP Feedback: Pre-fill */ - _usb_fill_feedback_ep(port); - break; } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26842 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I6e97bc79d1fe50950bb1f7cd71d8c428e928d4ae Gerrit-Change-Number: 26842 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 3
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Better flow regulation mechanism
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26843 ) Change subject: icE1usb fw: Better flow regulation mechanism ...................................................................... icE1usb fw: Better flow regulation mechanism * FIFO target level : - The '8 * 16' makes no sense as the FIFO was 128 so this is the "full" case and could never be that high. - We tighten up the margin around 5 * 16 which is the "target" level for the FIFO * FIFO size : We also increase the FIFO size to 256 frames. This doesn't actually affect latency since the target level is the same, but it allows more leeway to recover without data loss in case something goes wrong. * Ticks : We don't bother using ticks ... the current algo wasn't working (or rather not doing anything all that useful), because the difference between USB clock and E1 clock is tiny and measured over 1 ms, it's not meaningful. So for the time being we just sent the nominal rate biased with the FIFO level to keep it on target and this seems to work fine. It'd be nice to have a good long term estimate of the rate to minimize the jitter, but it doesn't seem to be strictly required for operation for now. * Misc cleanup : Just do all in one function instead of splitting the check if BD needs refill and the actual refill. This gets rid of sporadic 'TX FIFO Overflow' conditions by properly handling the case where we have a bit too much data. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Ibd3bc9080961cc56093e43ab9a824840e84c24d2 --- M firmware/ice40-riscv/icE1usb/e1.c M firmware/ice40-riscv/icE1usb/usb_e1.c 2 files changed, 19 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/43/26843/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index 6a87c12..f25e7c1 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -273,8 +273,8 @@ memset(e1, 0x00, sizeof(struct e1_state)); /* Reset FIFOs */ - e1f_reset(&e1->rx.fifo, (256 * port) + 0, 128); - e1f_reset(&e1->tx.fifo, (256 * port) + 128, 128); + e1f_reset(&e1->rx.fifo, (512 * port) + 0, 256); + e1f_reset(&e1->tx.fifo, (512 * port) + 256, 256); /* Enable Rx */ e1->rx.cr = E1_RX_CR_ENABLE | rx_cr; diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index 032eec8..08b192b 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -74,30 +74,25 @@ static void _usb_fill_feedback_ep(int port) { - static uint16_t ticks_prev = 0; - uint16_t ticks; - uint32_t val = 8192; - unsigned int level; - volatile struct usb_ep *ep_regs; + volatile struct usb_ep *ep_regs = _get_ep_regs(USB_EP_E1_FB(port)); - /* Compute real E1 tick count (with safety against bad values) */ - ticks = e1_tick_read(port); - val = (ticks - ticks_prev) & 0xffff; - ticks_prev = ticks; - if ((val < 7168) | (val > 9216)) - val = 8192; + /* Always ensure we're ready to send */ + if ((ep_regs->bd[0].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA) + { + uint32_t val = 8192; - /* Bias depending on TX fifo level */ - level = e1_tx_level(port); - if (level < (3 * 16)) - val += 256; - else if (level > (8 * 16)) - val -= 256; + /* Add instant bias depending on TX fifo level */ + unsigned int level = e1_tx_level(port); - /* Prepare buffer */ - ep_regs = _get_ep_regs(USB_EP_E1_FB(port)); - usb_data_write(ep_regs->bd[0].ptr, &val, 4); - ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(3); + if (level < (4 * 16)) + val += 256; + else if (level > (6 * 16)) + val -= 256; + + /* Fill buffer and submit it */ + usb_data_write(ep_regs->bd[0].ptr, &val, 4); + ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(3); + } } @@ -212,12 +207,7 @@ } /* Feedback endpoint */ - ep_regs = _get_ep_regs(USB_EP_E1_FB(port)); - - if ((ep_regs->bd[0].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA) - { - _usb_fill_feedback_ep(port); - } + _usb_fill_feedback_ep(port); } static enum usb_fnd_resp -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26843 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: Ibd3bc9080961cc56093e43ab9a824840e84c24d2 Gerrit-Change-Number: 26843 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 5
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Disable the yellow led if LOS
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26844 ) Change subject: icE1usb fw: Disable the yellow led if LOS ...................................................................... icE1usb fw: Disable the yellow led if LOS There is no remote side alarm if there is no remote-side ... Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I78f43eded5ed6ffde9d86726ccee2b776a3f4675 --- M firmware/ice40-riscv/icE1usb/e1.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/44/26844/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index f25e7c1..af59f14 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -448,6 +448,7 @@ e1->errors.flags &= ~(E1_ERR_F_LOS|E1_ERR_F_ALIGN_ERR); } else { e1_platform_led_set(port, E1P_LED_GREEN, E1P_LED_ST_BLINK); + e1_platform_led_set(port, E1P_LED_YELLOW, E1P_LED_ST_OFF); led_color(48, 0, 0); e1->errors.flags |= E1_ERR_F_ALIGN_ERR; /* TODO: completely off if rx tick counter not incrementing */ -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I78f43eded5ed6ffde9d86726ccee2b776a3f4675 Gerrit-Change-Number: 26844 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Update list of debug commands
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26845 ) Change subject: icE1usb fw: Update list of debug commands ...................................................................... icE1usb fw: Update list of debug commands Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I25c3d1db5d9ffae1cf4de83aed89b6394d032dd8 --- M firmware/ice40-riscv/icE1usb/fw_app.c 1 file changed, 17 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/45/26845/1 diff --git a/firmware/ice40-riscv/icE1usb/fw_app.c b/firmware/ice40-riscv/icE1usb/fw_app.c index 55218b8..f531d08 100644 --- a/firmware/ice40-riscv/icE1usb/fw_app.c +++ b/firmware/ice40-riscv/icE1usb/fw_app.c @@ -117,32 +117,40 @@ cmd = getchar_nowait(); if (cmd >= 0) { - if (cmd > 32 && cmd < 127) { + if (cmd > 32 && cmd < 127) putchar(cmd); - putchar('\r'); - putchar('\n'); - } + putchar('\r'); + putchar('\n'); switch (cmd) { - case 'p': - usb_debug_print(); - break; case 'b': boot_dfu(); break; - case 'o': + case 'p': + panic("Test panic"); + break; + case 'q': e1_debug_print(0, false); break; - case 'O': + case 'Q': e1_debug_print(0, true); break; + case 'w': + e1_debug_print(1, false); + break; + case 'W': + e1_debug_print(1, true); + break; case 'c': usb_connect(); break; case 'd': usb_disconnect(); break; + case 'u': + usb_debug_print(); + break; default: break; } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26845 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I25c3d1db5d9ffae1cf4de83aed89b6394d032dd8 Gerrit-Change-Number: 26845 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Warn in case of unused variables
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26846 ) Change subject: icE1usb fw: Warn in case of unused variables ...................................................................... icE1usb fw: Warn in case of unused variables Helps spot left overs from cleanups Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Ib5a0b24bace3b9566d974382c90f4153734fc3f3 --- M firmware/ice40-riscv/icE1usb/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/46/26846/1 diff --git a/firmware/ice40-riscv/icE1usb/Makefile b/firmware/ice40-riscv/icE1usb/Makefile index a8d18c9..b2f85d1 100644 --- a/firmware/ice40-riscv/icE1usb/Makefile +++ b/firmware/ice40-riscv/icE1usb/Makefile @@ -14,7 +14,7 @@ TARGET = $(GITVER) BOARD_DEFINE=BOARD_$(shell echo $(BOARD) | tr a-z\- A-Z_) -CFLAGS=-Wall -Wextra -Wno-unused -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section --specs=nano.specs -D$(BOARD_DEFINE) -I. -I../common +CFLAGS=-Wall -Wextra -Wno-unused-parameter -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section --specs=nano.specs -D$(BOARD_DEFINE) -I. -I../common NO2USB_FW_VERSION=0 include ../../../gateware/cores/no2usb/fw/fw.mk -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26846 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: Ib5a0b24bace3b9566d974382c90f4153734fc3f3 Gerrit-Change-Number: 26846 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Tweak descriptors in preparation for dual port support
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26840 ) Change subject: icE1usb fw: Tweak descriptors in preparation for dual port support ...................................................................... icE1usb fw: Tweak descriptors in preparation for dual port support In dual port mode we can't have 388 bytes wMaxPacket size, that's too much reserved bandwidth. So we dial that back to 292 which is the minimum we can use. We need 4 bytes for header, then 256 byte of nominal transfer size then 32 more byte for potentially one more frame than nominal to compensate differences between E1 clock and USB clock. We obviously need to adapt the code filling up the packets to respect that more restricted size ... Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I700adeb909e7955db0d15c6e2beade3d38b21e01 --- M firmware/ice40-riscv/icE1usb/usb_desc_app.c M firmware/ice40-riscv/icE1usb/usb_e1.c 2 files changed, 11 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/40/26840/1 diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_app.c b/firmware/ice40-riscv/icE1usb/usb_desc_app.c index ec01854..663be0b 100644 --- a/firmware/ice40-riscv/icE1usb/usb_desc_app.c +++ b/firmware/ice40-riscv/icE1usb/usb_desc_app.c @@ -90,7 +90,7 @@ .bEndpointAddress = USB_EP_E1_INT(0), .bmAttributes = 0x03, .wMaxPacketSize = 10, - .bInterval = 3, + .bInterval = 4, /* every 4 ms */ }, }, .on = { @@ -110,7 +110,7 @@ .bDescriptorType = USB_DT_EP, .bEndpointAddress = USB_EP_E1_IN(0), .bmAttributes = 0x05, - .wMaxPacketSize = 388, + .wMaxPacketSize = 292, .bInterval = 1, }, .ep_data_out = { @@ -118,7 +118,7 @@ .bDescriptorType = USB_DT_EP, .bEndpointAddress = USB_EP_E1_OUT(0), .bmAttributes = 0x05, - .wMaxPacketSize = 388, + .wMaxPacketSize = 292, .bInterval = 1, }, .ep_fb = { @@ -126,8 +126,8 @@ .bDescriptorType = USB_DT_EP, .bEndpointAddress = USB_EP_E1_FB(0), .bmAttributes = 0x11, - .wMaxPacketSize = 8, - .bInterval = 3, + .wMaxPacketSize = 3, + .bInterval = 3, /* every 2^(3-1) = 4 ms */ }, .ep_interrupt = { .bLength = sizeof(struct usb_ep_desc), @@ -135,7 +135,7 @@ .bEndpointAddress = USB_EP_E1_INT(0), .bmAttributes = 0x03, .wMaxPacketSize = 10, - .bInterval = 3, + .bInterval = 4, /* every 4 ms */ }, }, }, diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index 8e78ffa..75811c2 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -128,10 +128,8 @@ /* Get some data from E1 */ int n = e1_rx_level(0); - if (n > 64) - n = 12; - else if (n > 32) - n = 10; + if (n > 32) + n = 9; else if (n > 8) n = 8; else if (!n) @@ -177,7 +175,7 @@ refill: /* Refill it */ - ep_regs->bd[bdi].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(388); + ep_regs->bd[bdi].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(292); /* Next BDI */ bdi ^= 1; @@ -282,8 +280,8 @@ /* EP OUT: Queue two buffers */ ep_regs = _get_ep_regs(USB_EP_E1_FB(0)); - ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(388); - ep_regs->bd[1].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(388); + ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(292); + ep_regs->bd[1].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(292); /* EP Feedback: Pre-fill */ _usb_fill_feedback_ep(); -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26840 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I700adeb909e7955db0d15c6e2beade3d38b21e01 Gerrit-Change-Number: 26840 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 3
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Add multi-port support in USB code
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26841 ) Change subject: icE1usb fw: Add multi-port support in USB code ...................................................................... icE1usb fw: Add multi-port support in USB code Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I134410b542461c34339baa8d9120a5c86fc35d46 --- M firmware/ice40-riscv/icE1usb/fw_app.c M firmware/ice40-riscv/icE1usb/usb_desc_app.c M firmware/ice40-riscv/icE1usb/usb_desc_ids.h M firmware/ice40-riscv/icE1usb/usb_e1.c M firmware/ice40-riscv/icE1usb/usb_e1.h M firmware/ice40-riscv/icE1usb/usb_str_app.txt 6 files changed, 225 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/41/26841/1 diff --git a/firmware/ice40-riscv/icE1usb/fw_app.c b/firmware/ice40-riscv/icE1usb/fw_app.c index 3340f4a..55218b8 100644 --- a/firmware/ice40-riscv/icE1usb/fw_app.c +++ b/firmware/ice40-riscv/icE1usb/fw_app.c @@ -102,6 +102,7 @@ /* Start */ e1_init(0, 0, 0); + e1_init(1, 0, 0); led_state(true); usb_connect(); @@ -151,7 +152,9 @@ usb_poll(); /* E1 poll */ - e1_poll(0); - usb_e1_run(); + for (int port=0; port<2; port++) { + e1_poll(port); + usb_e1_run(port); + } } } diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_app.c b/firmware/ice40-riscv/icE1usb/usb_desc_app.c index 663be0b..22a81d3 100644 --- a/firmware/ice40-riscv/icE1usb/usb_desc_app.c +++ b/firmware/ice40-riscv/icE1usb/usb_desc_app.c @@ -39,7 +39,7 @@ struct usb_ep_desc ep_fb; struct usb_ep_desc ep_interrupt; } __attribute__ ((packed)) on; - } __attribute__ ((packed)) e1; + } __attribute__ ((packed)) e1[2]; /* CDC */ #if 0 @@ -71,7 +71,7 @@ .bmAttributes = 0x80, .bMaxPower = 0x32, /* 100 mA */ }, - .e1 = { + .e1[0] = { .off = { .intf = { .bLength = sizeof(struct usb_intf_desc), @@ -103,7 +103,7 @@ .bInterfaceClass = 0xff, .bInterfaceSubClass = 0xe1, .bInterfaceProtocol = 0x00, - .iInterface = 5, + .iInterface = 6, }, .ep_data_in = { .bLength = sizeof(struct usb_ep_desc), @@ -139,6 +139,74 @@ }, }, }, + .e1[1] = { + .off = { + .intf = { + .bLength = sizeof(struct usb_intf_desc), + .bDescriptorType = USB_DT_INTF, + .bInterfaceNumber = USB_INTF_E1(1), + .bAlternateSetting = 0, + .bNumEndpoints = 1, + .bInterfaceClass = 0xff, + .bInterfaceSubClass = 0xe1, + .bInterfaceProtocol = 0x00, + .iInterface = 7, + }, + .ep_interrupt = { + .bLength = sizeof(struct usb_ep_desc), + .bDescriptorType = USB_DT_EP, + .bEndpointAddress = USB_EP_E1_INT(1), + .bmAttributes = 0x03, + .wMaxPacketSize = 10, + .bInterval = 4, /* every 4 ms */ + }, + }, + .on = { + .intf = { + .bLength = sizeof(struct usb_intf_desc), + .bDescriptorType = USB_DT_INTF, + .bInterfaceNumber = USB_INTF_E1(1), + .bAlternateSetting = 1, + .bNumEndpoints = 4, + .bInterfaceClass = 0xff, + .bInterfaceSubClass = 0xe1, + .bInterfaceProtocol = 0x00, + .iInterface = 8, + }, + .ep_data_in = { + .bLength = sizeof(struct usb_ep_desc), + .bDescriptorType = USB_DT_EP, + .bEndpointAddress = USB_EP_E1_IN(1), + .bmAttributes = 0x05, + .wMaxPacketSize = 292, + .bInterval = 1, + }, + .ep_data_out = { + .bLength = sizeof(struct usb_ep_desc), + .bDescriptorType = USB_DT_EP, + .bEndpointAddress = USB_EP_E1_OUT(1), + .bmAttributes = 0x05, + .wMaxPacketSize = 292, + .bInterval = 1, + }, + .ep_fb = { + .bLength = sizeof(struct usb_ep_desc), + .bDescriptorType = USB_DT_EP, + .bEndpointAddress = USB_EP_E1_FB(1), + .bmAttributes = 0x11, + .wMaxPacketSize = 3, + .bInterval = 3, /* every 2^(3-1) = 4 ms */ + }, + .ep_interrupt = { + .bLength = sizeof(struct usb_ep_desc), + .bDescriptorType = USB_DT_EP, + .bEndpointAddress = USB_EP_E1_INT(1), + .bmAttributes = 0x03, + .wMaxPacketSize = 10, + .bInterval = 4, /* every 4 ms */ + }, + }, + }, #if 0 .cdc = { .intf_ctl = { @@ -150,7 +218,7 @@ .bInterfaceClass = USB_CLS_CDC_CONTROL, .bInterfaceSubClass = USB_CDC_SCLS_ACM, .bInterfaceProtocol = 0x00, - .iInterface = 6, + .iInterface = 9, }, .cdc_hdr = { .bLength = sizeof(struct usb_cdc_hdr_desc), @@ -188,7 +256,7 @@ .bInterfaceClass = USB_CLS_CDC_DATA, .bInterfaceSubClass = 0x00, .bInterfaceProtocol = 0x00, - .iInterface = 7, + .iInterface = 10, }, .ep_data_out = { .bLength = sizeof(struct usb_ep_desc), @@ -218,7 +286,7 @@ .bInterfaceClass = 0xfe, .bInterfaceSubClass = 0x01, .bInterfaceProtocol = 0x01, - .iInterface = 8, + .iInterface = 11, }, .func = { .bLength = sizeof(struct usb_dfu_func_desc), diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_ids.h b/firmware/ice40-riscv/icE1usb/usb_desc_ids.h index 2247f84..00dbb34 100644 --- a/firmware/ice40-riscv/icE1usb/usb_desc_ids.h +++ b/firmware/ice40-riscv/icE1usb/usb_desc_ids.h @@ -8,8 +8,8 @@ #pragma once #define USB_INTF_E1(p) (0 + (p)) -#define USB_INTF_DFU 1 -#define USB_INTF_NUM 2 +#define USB_INTF_DFU 2 +#define USB_INTF_NUM 3 #define USB_EP_E1_IN(p) (0x82 + (3 * (p))) #define USB_EP_E1_OUT(p) (0x01 + (3 * (p))) diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index 75811c2..a18ebe4 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -16,17 +16,20 @@ #include "e1.h" #include "misc.h" #include "usb_desc_ids.h" +#include "utils.h" #include "ice1usb_proto.h" -struct { +struct usb_e1_state { bool running; /* are we running (transceiving USB data)? */ int out_bdi; /* buffer descriptor index for OUT EP */ int in_bdi; /* buffer descriptor index for IN EP */ struct ice1usb_tx_config tx_cfg; struct ice1usb_rx_config rx_cfg; struct e1_error_count last_err; -} g_usb_e1; +}; + +static struct usb_e1_state g_usb_e1[2]; /* default configuration at power-up */ static const struct ice1usb_tx_config tx_cfg_default = { @@ -47,8 +50,29 @@ return (ep & 0x80) ? &usb_ep_regs[ep & 0x1f].in : &usb_ep_regs[ep & 0x1f].out; } +static struct usb_e1_state * +_get_state(int port) +{ + if ((port < 0) || (port > 1)) + panic("_get_state invalid port %d", port); + return &g_usb_e1[port]; +} + +static int +_ifnum2port(uint8_t bInterfaceNumber) +{ + switch (bInterfaceNumber) { + case USB_INTF_E1(0): return 0; + case USB_INTF_E1(1): return 1; + default: + /* Don't panic since this will be handled as USB STALL */ + return -1; + } +} + + static void -_usb_fill_feedback_ep(void) +_usb_fill_feedback_ep(int port) { static uint16_t ticks_prev = 0; uint16_t ticks; @@ -57,41 +81,42 @@ volatile struct usb_ep *ep_regs; /* Compute real E1 tick count (with safety against bad values) */ - ticks = e1_tick_read(0); + ticks = e1_tick_read(port); val = (ticks - ticks_prev) & 0xffff; ticks_prev = ticks; if ((val < 7168) | (val > 9216)) val = 8192; /* Bias depending on TX fifo level */ - level = e1_tx_level(0); + level = e1_tx_level(port); if (level < (3 * 16)) val += 256; else if (level > (8 * 16)) val -= 256; /* Prepare buffer */ - ep_regs = _get_ep_regs(USB_EP_E1_FB(0)); + ep_regs = _get_ep_regs(USB_EP_E1_FB(port)); usb_data_write(ep_regs->bd[0].ptr, &val, 4); ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(3); } void -usb_e1_run(void) +usb_e1_run(int port) { + struct usb_e1_state *usb_e1 = _get_state(port); volatile struct usb_ep *ep_regs; int bdi; - if (!g_usb_e1.running) + if (!usb_e1->running) return; /* Interrupt endpoint */ - ep_regs = _get_ep_regs(USB_EP_E1_INT(0)); + ep_regs = _get_ep_regs(USB_EP_E1_INT(port)); if ((ep_regs->bd[0].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA) { - const struct e1_error_count *cur_err = e1_get_error_count(0); - if (memcmp(cur_err, &g_usb_e1.last_err, sizeof(*cur_err))) { + const struct e1_error_count *cur_err = e1_get_error_count(port); + if (memcmp(cur_err, &usb_e1->last_err, sizeof(*cur_err))) { struct ice1usb_irq errmsg = { .type = ICE1USB_IRQ_T_ERRCNT, .u = { @@ -107,13 +132,13 @@ printf("E"); usb_data_write(ep_regs->bd[0].ptr, &errmsg, sizeof(errmsg)); ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(sizeof(errmsg)); - g_usb_e1.last_err = *cur_err; + usb_e1->last_err = *cur_err; } } /* Data IN endpoint */ - ep_regs = _get_ep_regs(USB_EP_E1_IN(0)); - bdi = g_usb_e1.in_bdi; + ep_regs = _get_ep_regs(USB_EP_E1_IN(port)); + bdi = usb_e1->in_bdi; while ((ep_regs->bd[bdi].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA) { @@ -126,7 +151,7 @@ puts("Err EP IN\n"); /* Get some data from E1 */ - int n = e1_rx_level(0); + int n = e1_rx_level(port); if (n > 32) n = 9; @@ -135,7 +160,7 @@ else if (!n) break; - n = e1_rx_need_data(0, (ptr >> 2) + 1, n, &pos); + n = e1_rx_need_data(port, (ptr >> 2) + 1, n, &pos); /* Write header: currently version and pos (mfr/fr number) */ hdr = (0 << 28) | (pos & 0xff); @@ -146,12 +171,12 @@ /* Next BDI */ bdi ^= 1; - g_usb_e1.in_bdi = bdi; + usb_e1->in_bdi = bdi; } /* Data OUT endpoint */ - ep_regs = _get_ep_regs(USB_EP_E1_OUT(0)); - bdi = g_usb_e1.out_bdi; + ep_regs = _get_ep_regs(USB_EP_E1_OUT(port)); + bdi = usb_e1->out_bdi; while ((ep_regs->bd[bdi].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA) { @@ -171,7 +196,7 @@ /* Empty data into the FIFO */ int n = ((int)(csr & USB_BD_LEN_MSK) - 6) / 32; if (n > 0) - e1_tx_feed_data(0, (ptr >> 2) + 1, n); + e1_tx_feed_data(port, (ptr >> 2) + 1, n); refill: /* Refill it */ @@ -179,7 +204,7 @@ /* Next BDI */ bdi ^= 1; - g_usb_e1.out_bdi = bdi; + usb_e1->out_bdi = bdi; static int x = 0; if ((x++ & 0xff) == 0xff) @@ -187,11 +212,11 @@ } /* Feedback endpoint */ - ep_regs = _get_ep_regs(USB_EP_E1_FB(0)); + ep_regs = _get_ep_regs(USB_EP_E1_FB(port)); if ((ep_regs->bd[0].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA) { - _usb_fill_feedback_ep(); + _usb_fill_feedback_ep(port); } } @@ -204,24 +229,28 @@ if (!conf) return USB_FND_SUCCESS; - intf = usb_desc_find_intf(conf, USB_INTF_E1(0), 0, NULL); - if (!intf) - return USB_FND_ERROR; + for (int port=0; port<2; port++) + { + intf = usb_desc_find_intf(conf, USB_INTF_E1(port), 0, NULL); + if (!intf) + return USB_FND_ERROR; - printf("e1 set_conf %08x\n", intf); + printf("e1 set_conf[%d] %08x\n", port, intf); - usb_ep_boot(intf, USB_EP_E1_IN(0), true); - usb_ep_boot(intf, USB_EP_E1_OUT(0), true); - usb_ep_boot(intf, USB_EP_E1_FB(0), false); - usb_ep_boot(intf, USB_EP_E1_INT(0), false); + usb_ep_boot(intf, USB_EP_E1_IN(port), true); + usb_ep_boot(intf, USB_EP_E1_OUT(port), true); + usb_ep_boot(intf, USB_EP_E1_FB(port), false); + usb_ep_boot(intf, USB_EP_E1_INT(port), false); + } return USB_FND_SUCCESS; } -static void _perform_tx_config(void) +static void _perform_tx_config(int port) { - const struct ice1usb_tx_config *cfg = &g_usb_e1.tx_cfg; - e1_tx_config(0, + struct usb_e1_state *usb_e1 = _get_state(port); + const struct ice1usb_tx_config *cfg = &usb_e1->tx_cfg; + e1_tx_config(port, ((cfg->mode & 3) << 1) | ((cfg->timing & 1) << 3) | ((cfg->alarm & 1) << 4) | @@ -229,10 +258,11 @@ ); } -static void _perform_rx_config(void) +static void _perform_rx_config(int port) { - const struct ice1usb_rx_config *cfg = &g_usb_e1.rx_cfg; - e1_rx_config(0, + struct usb_e1_state *usb_e1 = _get_state(port); + const struct ice1usb_rx_config *cfg = &usb_e1->rx_cfg; + e1_rx_config(port, (cfg->mode << 1) ); } @@ -241,50 +271,60 @@ _e1_set_intf(const struct usb_intf_desc *base, const struct usb_intf_desc *sel) { volatile struct usb_ep *ep_regs; + struct usb_e1_state *usb_e1; + int port; - /* Validity checks */ + /* Is it for E1 interface ? */ if ((base->bInterfaceClass != 0xff) || (base->bInterfaceSubClass != 0xe1)) return USB_FND_CONTINUE; + /* Get matching port (if any) */ + port = _ifnum2port(base->bInterfaceNumber); + if (port < 0) + return USB_FND_ERROR; + + usb_e1 = _get_state(port); + + /* Valid setting ? */ if (sel->bAlternateSetting > 1) return USB_FND_ERROR; /* Don't do anything if no change */ - if (g_usb_e1.running == (sel->bAlternateSetting != 0)) + if (usb_e1->running == (sel->bAlternateSetting != 0)) return USB_FND_SUCCESS; - g_usb_e1.running = (sel->bAlternateSetting != 0); + usb_e1->running = (sel->bAlternateSetting != 0); /* Reconfigure the endpoints */ - usb_ep_reconf(sel, USB_EP_E1_IN(0)); - usb_ep_reconf(sel, USB_EP_E1_OUT(0)); - usb_ep_reconf(sel, USB_EP_E1_FB(0)); - usb_ep_reconf(sel, USB_EP_E1_INT(0)); + usb_ep_reconf(sel, USB_EP_E1_IN(port)); + usb_ep_reconf(sel, USB_EP_E1_OUT(port)); + usb_ep_reconf(sel, USB_EP_E1_FB(port)); + usb_ep_reconf(sel, USB_EP_E1_INT(port)); /* Update E1 and USB state */ - switch (g_usb_e1.running) { + switch (usb_e1->running) { case false: /* Disable E1 rx/tx */ - e1_init(0, 0, 0); + e1_init(port, 0, 0); break; case true: /* Reset and Re-Enable E1 */ - e1_init(0, 0, 0); - _perform_rx_config(); - _perform_tx_config(); + e1_init(port, 0, 0); + _perform_rx_config(port); + _perform_tx_config(port); /* Reset BDI */ - g_usb_e1.in_bdi = 0; - g_usb_e1.out_bdi = 0; + usb_e1->in_bdi = 0; + usb_e1->out_bdi = 0; /* EP OUT: Queue two buffers */ - ep_regs = _get_ep_regs(USB_EP_E1_FB(0)); + ep_regs = _get_ep_regs(USB_EP_E1_OUT(port)); ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(292); ep_regs->bd[1].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(292); /* EP Feedback: Pre-fill */ - _usb_fill_feedback_ep(); + _usb_fill_feedback_ep(port); break; } @@ -295,10 +335,22 @@ static enum usb_fnd_resp _e1_get_intf(const struct usb_intf_desc *base, uint8_t *alt) { + struct usb_e1_state *usb_e1; + int port; + + /* Is it for E1 interface ? */ if ((base->bInterfaceClass != 0xff) || (base->bInterfaceSubClass != 0xe1)) return USB_FND_CONTINUE; - *alt = g_usb_e1.running ? 1 : 0; + /* Get matching port (if any) */ + port = _ifnum2port(base->bInterfaceNumber); + if (port < 0) + return USB_FND_ERROR; + + usb_e1 = _get_state(port); + + /* Return current alt-setting */ + *alt = usb_e1->running ? 1 : 0; return USB_FND_SUCCESS; } @@ -307,10 +359,13 @@ _set_tx_mode_done(struct usb_xfer *xfer) { const struct ice1usb_tx_config *cfg = (const struct ice1usb_tx_config *) xfer->data; - printf("set_tx_mode %02x%02x%02x%02x\r\n", + struct usb_ctrl_req *req = xfer->cb_ctx; + int port = _ifnum2port(req->wIndex); + struct usb_e1_state *usb_e1 = _get_state(port); + printf("set_tx_mode[%d] %02x%02x%02x%02x\r\n", port, xfer->data[0], xfer->data[1], xfer->data[2], xfer->data[3]); - g_usb_e1.tx_cfg = *cfg; - _perform_tx_config(); + usb_e1->tx_cfg = *cfg; + _perform_tx_config(port); return true; } @@ -318,9 +373,12 @@ _set_rx_mode_done(struct usb_xfer *xfer) { const struct ice1usb_rx_config *cfg = (const struct ice1usb_rx_config *) xfer->data; - printf("set_rx_mode %02x\r\n", xfer->data[0]); - g_usb_e1.rx_cfg = *cfg; - _perform_rx_config(); + struct usb_ctrl_req *req = xfer->cb_ctx; + int port = _ifnum2port(req->wIndex); + struct usb_e1_state *usb_e1 = _get_state(port); + printf("set_rx_mode[%d] %02x\r\n", port, xfer->data[0]); + usb_e1->rx_cfg = *cfg; + _perform_rx_config(port); return true; } @@ -328,8 +386,17 @@ static enum usb_fnd_resp _e1_ctrl_req_intf(struct usb_ctrl_req *req, struct usb_xfer *xfer) { - unsigned int i; + struct usb_e1_state *usb_e1; + int port; + /* Get matching port (if any) */ + port = _ifnum2port(req->wIndex); + if (port < 0) + return USB_FND_CONTINUE; + + usb_e1 = _get_state(port); + + /* Process request */ switch (req->bRequest) { case ICE1USB_INTF_GET_CAPABILITIES: /* no optional capabilities yet */ @@ -345,7 +412,7 @@ case ICE1USB_INTF_GET_TX_CFG: if (req->wLength < sizeof(struct ice1usb_tx_config)) return USB_FND_ERROR; - memcpy(xfer->data, &g_usb_e1.tx_cfg, sizeof(struct ice1usb_tx_config)); + memcpy(xfer->data, &usb_e1->tx_cfg, sizeof(struct ice1usb_tx_config)); xfer->len = sizeof(struct ice1usb_tx_config); break; case ICE1USB_INTF_SET_RX_CFG: @@ -358,7 +425,7 @@ case ICE1USB_INTF_GET_RX_CFG: if (req->wLength < sizeof(struct ice1usb_rx_config)) return USB_FND_ERROR; - memcpy(xfer->data, &g_usb_e1.rx_cfg, sizeof(struct ice1usb_rx_config)); + memcpy(xfer->data, &usb_e1->rx_cfg, sizeof(struct ice1usb_rx_config)); xfer->len = sizeof(struct ice1usb_rx_config); break; default: @@ -396,8 +463,6 @@ case USB_REQ_RCPT_DEV: return _e1_ctrl_req_dev(req, xfer); case USB_REQ_RCPT_INTF: - if (req->wIndex != USB_INTF_E1(0)) - return USB_FND_CONTINUE; return _e1_ctrl_req_intf(req, xfer); case USB_REQ_RCPT_EP: case USB_REQ_RCPT_OTHER: @@ -417,8 +482,12 @@ void usb_e1_init(void) { - memset(&g_usb_e1, 0x00, sizeof(g_usb_e1)); - g_usb_e1.tx_cfg = tx_cfg_default; - g_usb_e1.rx_cfg = rx_cfg_default; + for (int i=0; i<2; i++) { + struct usb_e1_state *usb_e1 = _get_state(i); + memset(usb_e1, 0x00, sizeof(struct usb_e1_state)); + usb_e1->tx_cfg = tx_cfg_default; + usb_e1->rx_cfg = rx_cfg_default; + } + usb_register_function_driver(&_e1_drv); } diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.h b/firmware/ice40-riscv/icE1usb/usb_e1.h index a573b38..06723ea 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.h +++ b/firmware/ice40-riscv/icE1usb/usb_e1.h @@ -7,5 +7,5 @@ #pragma once -void usb_e1_run(void); +void usb_e1_run(int port); void usb_e1_init(void); diff --git a/firmware/ice40-riscv/icE1usb/usb_str_app.txt b/firmware/ice40-riscv/icE1usb/usb_str_app.txt index 10887d3..3aa6b4a 100644 --- a/firmware/ice40-riscv/icE1usb/usb_str_app.txt +++ b/firmware/ice40-riscv/icE1usb/usb_str_app.txt @@ -2,7 +2,10 @@ osmocom icE1usb Main -E1 -Console (control) -Console (data) +E1 port 0 (disabled) +E1 port 0 +E1 port 1 (disabled) +E1 port 1 +GPS (CDC control) +GPS (CDC data) DFU runtime -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26841 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I134410b542461c34339baa8d9120a5c86fc35d46 Gerrit-Change-Number: 26841 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 6
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Use 'int' as the default type for port index
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 ) Change subject: icE1usb fw: Use 'int' as the default type for port index ...................................................................... icE1usb fw: Use 'int' as the default type for port index No benefit to use uint8_t and for consistency with later patches, use 'int' here too. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I50a76476af844acf20436b9d410cb917b723590d --- M firmware/ice40-riscv/icE1usb/e1.h M firmware/ice40-riscv/icE1usb/misc.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/37/26837/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index 9ceffdd..862d568 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -57,5 +57,5 @@ E1P_LED_ST_BLINK_FAST = 3 }; -extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led, +extern void e1_platform_led_set(int port, enum e1_platform_led led, enum e1_platform_led_state state); diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index 3117be9..a25bcc5 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c @@ -53,7 +53,7 @@ } void -e1_platform_led_set(uint8_t port, enum e1_platform_led led, +e1_platform_led_set(int port, enum e1_platform_led led, enum e1_platform_led_state state) { uint32_t tmp; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I50a76476af844acf20436b9d410cb917b723590d Gerrit-Change-Number: 26837 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 5
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Expose the ticks from multiple E1 ports in misc.{c,h}
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26838 ) Change subject: icE1usb fw: Expose the ticks from multiple E1 ports in misc.{c,h} ...................................................................... icE1usb fw: Expose the ticks from multiple E1 ports in misc.{c,h} Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I4dfdeecb6d3a25025095cd017ebbf74aee41c8b2 --- M firmware/ice40-riscv/icE1usb/misc.c M firmware/ice40-riscv/icE1usb/misc.h M firmware/ice40-riscv/icE1usb/usb_e1.c 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/38/26838/1 diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index a25bcc5..4b32fcd 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c @@ -71,9 +71,9 @@ } uint16_t -e1_tick_read(void) +e1_tick_read(int port) { - return misc_regs->e1_tick[0].tx; + return misc_regs->e1_tick[port].tx; } void diff --git a/firmware/ice40-riscv/icE1usb/misc.h b/firmware/ice40-riscv/icE1usb/misc.h index 69c0da7..dac5730 100644 --- a/firmware/ice40-riscv/icE1usb/misc.h +++ b/firmware/ice40-riscv/icE1usb/misc.h @@ -27,6 +27,6 @@ void pdm_set(int chan, bool enable, unsigned value, bool normalize); void e1_led_set(bool enable, uint8_t cfg); -uint16_t e1_tick_read(void); +uint16_t e1_tick_read(int port); void reboot(int fw); diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index ed4826f..fe94698 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -57,7 +57,7 @@ volatile struct usb_ep *ep_regs; /* Compute real E1 tick count (with safety against bad values) */ - ticks = e1_tick_read(); + ticks = e1_tick_read(0); val = (ticks - ticks_prev) & 0xffff; ticks_prev = ticks; if ((val < 7168) | (val > 9216)) -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26838 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I4dfdeecb6d3a25025095cd017ebbf74aee41c8b2 Gerrit-Change-Number: 26838 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 3
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Add multi-port support for e1.{c,h}
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26839 ) Change subject: icE1usb fw: Add multi-port support for e1.{c,h} ...................................................................... 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(a)246tNt.com> Change-Id: I17671be65543f5a2bf3d16ba2b5a5081eb38ebdf --- M firmware/ice40-riscv/icE1usb/e1.c M firmware/ice40-riscv/icE1usb/e1.h M firmware/ice40-riscv/icE1usb/fw_app.c M firmware/ice40-riscv/icE1usb/usb_e1.c 4 files changed, 151 insertions(+), 110 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/39/26839/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index 6a4c73c..6a87c12 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -16,12 +16,13 @@ #include "dma.h" #include "led.h" // FIXME +#include "utils.h" // HW access // --------- -static volatile struct e1_core * const e1_regs = (void *)(E1_CORE_BASE); +static volatile struct e1_core * const e1_regs_base = (void *)(E1_CORE_BASE); static volatile uint8_t * const e1_data = (void *)(E1_DATA_BASE); @@ -224,7 +225,7 @@ RECOVER = 3, /* after underflow, overflow or alignment error */ }; -static struct { +struct e1_state { struct { uint32_t cr; struct e1_fifo fifo; @@ -240,30 +241,52 @@ } tx; struct e1_error_count errors; -} g_e1; +}; + +static struct e1_state g_e1[2]; + + +static volatile struct e1_core * +_get_regs(int port) +{ + if ((port < 0) || (port > 1)) + panic("_get_regs invalid port %d", port); + return &e1_regs_base[port]; +} + +static struct e1_state * +_get_state(int port) +{ + if ((port < 0) || (port > 1)) + panic("_get_state invalid port %d", port); + return &g_e1[port]; +} void -e1_init(uint16_t rx_cr, uint16_t tx_cr) +e1_init(int port, uint16_t rx_cr, uint16_t tx_cr) { + volatile struct e1_core *e1_regs = _get_regs(port); + struct e1_state *e1 = _get_state(port); + /* Global state init */ - memset(&g_e1, 0x00, sizeof(g_e1)); + memset(e1, 0x00, sizeof(struct e1_state)); /* Reset FIFOs */ - e1f_reset(&g_e1.rx.fifo, 0, 128); - e1f_reset(&g_e1.tx.fifo, 128, 128); + e1f_reset(&e1->rx.fifo, (256 * port) + 0, 128); + e1f_reset(&e1->tx.fifo, (256 * port) + 128, 128); /* Enable Rx */ - g_e1.rx.cr = E1_RX_CR_ENABLE | rx_cr; - e1_regs->rx.csr = E1_RX_CR_OVFL_CLR | g_e1.rx.cr; + e1->rx.cr = E1_RX_CR_ENABLE | rx_cr; + e1_regs->rx.csr = E1_RX_CR_OVFL_CLR | e1->rx.cr; /* Enable Tx */ - g_e1.tx.cr = E1_TX_CR_ENABLE | tx_cr; - e1_regs->tx.csr = E1_TX_CR_UNFL_CLR | g_e1.tx.cr; + e1->tx.cr = E1_TX_CR_ENABLE | tx_cr; + e1_regs->tx.csr = E1_TX_CR_UNFL_CLR | e1->tx.cr; /* State */ - g_e1.rx.state = BOOT; - g_e1.tx.state = BOOT; + e1->rx.state = BOOT; + e1->tx.state = BOOT; } #define TXCR_PERMITTED ( \ @@ -274,25 +297,30 @@ E1_TX_CR_LOOPBACK_CROSS ) void -e1_tx_config(uint16_t cr) +e1_tx_config(int port, uint16_t cr) { - g_e1.tx.cr = (g_e1.tx.cr & ~TXCR_PERMITTED) | (cr & TXCR_PERMITTED); - e1_regs->tx.csr = g_e1.tx.cr; + volatile struct e1_core *e1_regs = _get_regs(port); + struct e1_state *e1 = _get_state(port); + e1->tx.cr = (e1->tx.cr & ~TXCR_PERMITTED) | (cr & TXCR_PERMITTED); + e1_regs->tx.csr = e1->tx.cr; } #define RXCR_PERMITTED ( \ E1_RX_CR_MODE_MFA ) void -e1_rx_config(uint16_t cr) +e1_rx_config(int port, uint16_t cr) { - g_e1.rx.cr = (g_e1.rx.cr & ~RXCR_PERMITTED) | (cr & RXCR_PERMITTED); - e1_regs->rx.csr = g_e1.rx.cr; + volatile struct e1_core *e1_regs = _get_regs(port); + struct e1_state *e1 = _get_state(port); + e1->rx.cr = (e1->rx.cr & ~RXCR_PERMITTED) | (cr & RXCR_PERMITTED); + e1_regs->rx.csr = e1->rx.cr; } unsigned int -e1_rx_need_data(unsigned int usb_addr, unsigned int max_frames, unsigned int *pos) +e1_rx_need_data(int port, unsigned int usb_addr, unsigned int max_frames, unsigned int *pos) { + struct e1_state *e1 = _get_state(port); bool rai_received = false; bool rai_possible = false; unsigned int ofs; @@ -301,13 +329,13 @@ while (max_frames) { /* Get some data from the FIFO */ - n_frames = e1f_frame_read(&g_e1.rx.fifo, &ofs, max_frames); + n_frames = e1f_frame_read(&e1->rx.fifo, &ofs, max_frames); if (!n_frames) break; /* Give pos */ if (pos) { - *pos = ofs & g_e1.rx.fifo.mask; + *pos = ofs & e1->rx.fifo.mask; pos = NULL; } @@ -339,11 +367,11 @@ if (rai_possible) { if (rai_received) { - g_e1.errors.flags |= E1_ERR_F_RAI; - e1_platform_led_set(0, E1P_LED_YELLOW, E1P_LED_ST_ON); + e1->errors.flags |= E1_ERR_F_RAI; + e1_platform_led_set(port, E1P_LED_YELLOW, E1P_LED_ST_ON); } else { - g_e1.errors.flags &= ~E1_ERR_F_RAI; - e1_platform_led_set(0, E1P_LED_YELLOW, E1P_LED_ST_OFF); + e1->errors.flags &= ~E1_ERR_F_RAI; + e1_platform_led_set(port, E1P_LED_YELLOW, E1P_LED_ST_OFF); } } @@ -351,16 +379,18 @@ } unsigned int -e1_tx_feed_data(unsigned int usb_addr, unsigned int frames) +e1_tx_feed_data(int port, unsigned int usb_addr, unsigned int frames) { + struct e1_state *e1 = _get_state(port); unsigned int ofs; int n_frames; while (frames) { /* Get some space in FIFO */ - n_frames = e1f_frame_write(&g_e1.tx.fifo, &ofs, frames); + n_frames = e1f_frame_write(&e1->tx.fifo, &ofs, frames); if (!n_frames) { - printf("[!] TX FIFO Overflow %d %d\n", frames, n_frames); + printf("[!] TX FIFO Overflow (port=%d, req=%d, done=%d)\n", port, frames, n_frames); + e1f_debug(&e1->tx.fifo, "TX"); break; } @@ -379,65 +409,70 @@ } unsigned int -e1_tx_level(void) +e1_tx_level(int port) { - return e1f_valid_frames(&g_e1.tx.fifo); + struct e1_state *e1 = _get_state(port); + return e1f_valid_frames(&e1->tx.fifo); } unsigned int -e1_rx_level(void) +e1_rx_level(int port) { - return e1f_valid_frames(&g_e1.rx.fifo); + struct e1_state *e1 = _get_state(port); + return e1f_valid_frames(&e1->rx.fifo); } const struct e1_error_count * -e1_get_error_count(void) +e1_get_error_count(int port) { - return &g_e1.errors; + struct e1_state *e1 = _get_state(port); + return &e1->errors; } void -e1_poll(void) +e1_poll(int port) { + volatile struct e1_core *e1_regs = _get_regs(port); + struct e1_state *e1 = _get_state(port); uint32_t bd; unsigned int ofs; /* Active ? */ - if ((g_e1.rx.state == IDLE) && (g_e1.tx.state == IDLE)) + if ((e1->rx.state == IDLE) && (e1->tx.state == IDLE)) return; /* HACK: LED link status */ if (e1_regs->rx.csr & E1_RX_SR_ALIGNED) { - e1_platform_led_set(0, E1P_LED_GREEN, E1P_LED_ST_ON); + e1_platform_led_set(port, E1P_LED_GREEN, E1P_LED_ST_ON); led_color(0, 48, 0); - g_e1.errors.flags &= ~(E1_ERR_F_LOS|E1_ERR_F_ALIGN_ERR); + e1->errors.flags &= ~(E1_ERR_F_LOS|E1_ERR_F_ALIGN_ERR); } else { - e1_platform_led_set(0, E1P_LED_GREEN, E1P_LED_ST_BLINK); + e1_platform_led_set(port, E1P_LED_GREEN, E1P_LED_ST_BLINK); led_color(48, 0, 0); - g_e1.errors.flags |= E1_ERR_F_ALIGN_ERR; + e1->errors.flags |= E1_ERR_F_ALIGN_ERR; /* TODO: completely off if rx tick counter not incrementing */ } /* Recover any done TX BD */ while ( (bd = e1_regs->tx.bd) & E1_BD_VALID ) { - e1f_multiframe_read_discard(&g_e1.tx.fifo); - g_e1.tx.in_flight--; + e1f_multiframe_read_discard(&e1->tx.fifo); + e1->tx.in_flight--; } /* Recover any done RX BD */ while ( (bd = e1_regs->rx.bd) & E1_BD_VALID ) { /* FIXME: CRC status ? */ - e1f_multiframe_write_commit(&g_e1.rx.fifo); + e1f_multiframe_write_commit(&e1->rx.fifo); if ((bd & (E1_BD_CRC0 | E1_BD_CRC1)) != (E1_BD_CRC0 | E1_BD_CRC1)) { - printf("b: %03x\n", bd); - g_e1.errors.crc++; + printf("[!] E1 crc err (port=%d, bd=%03x)\n", port, bd); + e1->errors.crc++; } - g_e1.rx.in_flight--; + e1->rx.in_flight--; } /* Boot procedure */ - if (g_e1.tx.state == BOOT) { - if (e1f_unseen_frames(&g_e1.tx.fifo) < (16 * 5)) + if (e1->tx.state == BOOT) { + if (e1f_unseen_frames(&e1->tx.fifo) < (16 * 5)) return; /* HACK: LED flow status */ led_blink(true, 200, 1000); @@ -446,88 +481,90 @@ /* Handle RX */ /* Misalign ? */ - if (g_e1.rx.state == RUN) { + if (e1->rx.state == RUN) { if (!(e1_regs->rx.csr & E1_RX_SR_ALIGNED)) { - printf("[!] E1 rx misalign\n"); - g_e1.rx.state = RECOVER; - g_e1.errors.align++; + printf("[!] E1 rx misalign (port=%d)\n", port); + e1->rx.state = RECOVER; + e1->errors.align++; } } /* Overflow ? */ - if (g_e1.rx.state == RUN) { + if (e1->rx.state == RUN) { if (e1_regs->rx.csr & E1_RX_SR_OVFL) { - printf("[!] E1 overflow %d\n", g_e1.rx.in_flight); - g_e1.rx.state = RECOVER; - g_e1.errors.ovfl++; + printf("[!] E1 overflow (port=%d, inf=%d)\n", port, e1->rx.in_flight); + e1->rx.state = RECOVER; + e1->errors.ovfl++; } } /* Recover ready ? */ - if (g_e1.rx.state == RECOVER) { - if (g_e1.rx.in_flight != 0) + if (e1->rx.state == RECOVER) { + if (e1->rx.in_flight != 0) goto done_rx; - e1f_multiframe_empty(&g_e1.rx.fifo); + e1f_multiframe_empty(&e1->rx.fifo); } /* Fill new RX BD */ - while (g_e1.rx.in_flight < 4) { - if (!e1f_multiframe_write_prepare(&g_e1.rx.fifo, &ofs)) + while (e1->rx.in_flight < 4) { + if (!e1f_multiframe_write_prepare(&e1->rx.fifo, &ofs)) break; e1_regs->rx.bd = e1f_ofs_to_mf(ofs); - g_e1.rx.in_flight++; + e1->rx.in_flight++; } /* Clear overflow if needed */ - if (g_e1.rx.state != RUN) { - e1_regs->rx.csr = g_e1.rx.cr | E1_RX_CR_OVFL_CLR; - g_e1.rx.state = RUN; + if (e1->rx.state != RUN) { + e1_regs->rx.csr = e1->rx.cr | E1_RX_CR_OVFL_CLR; + e1->rx.state = RUN; } done_rx: /* Handle TX */ /* Underflow ? */ - if (g_e1.tx.state == RUN) { + if (e1->tx.state == RUN) { if (e1_regs->tx.csr & E1_TX_SR_UNFL) { - printf("[!] E1 underflow %d\n", g_e1.tx.in_flight); - g_e1.tx.state = RECOVER; - g_e1.errors.unfl++; + printf("[!] E1 underflow (port=%d, inf=%d)\n", port, e1->tx.in_flight); + e1->tx.state = RECOVER; + e1->errors.unfl++; } } /* Recover ready ? */ - if (g_e1.tx.state == RECOVER) { - if (e1f_unseen_frames(&g_e1.tx.fifo) < (16 * 5)) + if (e1->tx.state == RECOVER) { + if (e1f_unseen_frames(&e1->tx.fifo) < (16 * 5)) return; } /* Fill new TX BD */ - while (g_e1.tx.in_flight < 4) { - if (!e1f_multiframe_read_peek(&g_e1.tx.fifo, &ofs)) + while (e1->tx.in_flight < 4) { + if (!e1f_multiframe_read_peek(&e1->tx.fifo, &ofs)) break; e1_regs->tx.bd = e1f_ofs_to_mf(ofs); - g_e1.tx.in_flight++; + e1->tx.in_flight++; } /* Clear underflow if needed */ - if (g_e1.tx.state != RUN) { - e1_regs->tx.csr = g_e1.tx.cr | E1_TX_CR_UNFL_CLR; - g_e1.tx.state = RUN; + if (e1->tx.state != RUN) { + e1_regs->tx.csr = e1->tx.cr | E1_TX_CR_UNFL_CLR; + e1->tx.state = RUN; } } void -e1_debug_print(bool data) +e1_debug_print(int port, bool data) { + volatile struct e1_core *e1_regs = _get_regs(port); + struct e1_state *e1 = _get_state(port); volatile uint8_t *p; - puts("E1\n"); + printf("E1 port %d\n", port); printf("CSR: Rx %04x / Tx %04x\n", e1_regs->rx.csr, e1_regs->tx.csr); - printf("InF: Rx %d / Tx %d\n", g_e1.rx.in_flight, g_e1.tx.in_flight); - printf("Sta: Rx %d / Tx %d\n", g_e1.rx.state, g_e1.tx.state); + printf("InF: Rx %d / Tx %d\n", e1->rx.in_flight, e1->tx.in_flight); + printf("Sta: Rx %d / Tx %d\n", e1->rx.state, e1->tx.state); - e1f_debug(&g_e1.rx.fifo, "Rx FIFO"); - e1f_debug(&g_e1.tx.fifo, "Tx FIFO"); + e1f_debug(&e1->rx.fifo, "Rx FIFO"); + e1f_debug(&e1->tx.fifo, "Tx FIFO"); if (data) { puts("\nE1 Data\n"); diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index 862d568..a93a881 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -10,20 +10,20 @@ /* control */ -void e1_init(uint16_t rx_cr, uint16_t tx_cr); -void e1_poll(void); -void e1_debug_print(bool data); +void e1_init(int port, uint16_t rx_cr, uint16_t tx_cr); +void e1_poll(int port); +void e1_debug_print(int port, bool data); -void e1_tx_config(uint16_t cr); -void e1_rx_config(uint16_t cr); +void e1_tx_config(int port, uint16_t cr); +void e1_rx_config(int port, uint16_t cr); /* data flow */ -unsigned int e1_rx_need_data(unsigned int usb_addr, unsigned int max_len, unsigned int *pos); -unsigned int e1_tx_feed_data(unsigned int usb_addr, unsigned int len); -unsigned int e1_tx_level(void); -unsigned int e1_rx_level(void); +unsigned int e1_rx_need_data(int port, unsigned int usb_addr, unsigned int max_len, unsigned int *pos); +unsigned int e1_tx_feed_data(int port, unsigned int usb_addr, unsigned int len); +unsigned int e1_tx_level(int port); +unsigned int e1_rx_level(int port); /* error reporting */ @@ -40,7 +40,7 @@ uint8_t flags; }; -const struct e1_error_count *e1_get_error_count(void); +const struct e1_error_count *e1_get_error_count(int port); /* external function provided by the platform; used by E1 driver to control LEDs */ diff --git a/firmware/ice40-riscv/icE1usb/fw_app.c b/firmware/ice40-riscv/icE1usb/fw_app.c index 39173f2..3340f4a 100644 --- a/firmware/ice40-riscv/icE1usb/fw_app.c +++ b/firmware/ice40-riscv/icE1usb/fw_app.c @@ -101,7 +101,7 @@ usb_e1_init(); /* Start */ - e1_init(0, 0); + e1_init(0, 0, 0); led_state(true); usb_connect(); @@ -131,10 +131,10 @@ boot_dfu(); break; case 'o': - e1_debug_print(false); + e1_debug_print(0, false); break; case 'O': - e1_debug_print(true); + e1_debug_print(0, true); break; case 'c': usb_connect(); @@ -151,7 +151,7 @@ usb_poll(); /* E1 poll */ - e1_poll(); + e1_poll(0); usb_e1_run(); } } diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index fe94698..8e78ffa 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -64,7 +64,7 @@ val = 8192; /* Bias depending on TX fifo level */ - level = e1_tx_level(); + level = e1_tx_level(0); if (level < (3 * 16)) val += 256; else if (level > (8 * 16)) @@ -90,7 +90,7 @@ ep_regs = _get_ep_regs(USB_EP_E1_INT(0)); if ((ep_regs->bd[0].csr & USB_BD_STATE_MSK) != USB_BD_STATE_RDY_DATA) { - const struct e1_error_count *cur_err = e1_get_error_count(); + const struct e1_error_count *cur_err = e1_get_error_count(0); if (memcmp(cur_err, &g_usb_e1.last_err, sizeof(*cur_err))) { struct ice1usb_irq errmsg = { .type = ICE1USB_IRQ_T_ERRCNT, @@ -126,7 +126,7 @@ puts("Err EP IN\n"); /* Get some data from E1 */ - int n = e1_rx_level(); + int n = e1_rx_level(0); if (n > 64) n = 12; @@ -137,7 +137,7 @@ else if (!n) break; - n = e1_rx_need_data((ptr >> 2) + 1, n, &pos); + n = e1_rx_need_data(0, (ptr >> 2) + 1, n, &pos); /* Write header: currently version and pos (mfr/fr number) */ hdr = (0 << 28) | (pos & 0xff); @@ -173,7 +173,7 @@ /* Empty data into the FIFO */ int n = ((int)(csr & USB_BD_LEN_MSK) - 6) / 32; if (n > 0) - e1_tx_feed_data((ptr >> 2) + 1, n); + e1_tx_feed_data(0, (ptr >> 2) + 1, n); refill: /* Refill it */ @@ -223,16 +223,20 @@ static void _perform_tx_config(void) { const struct ice1usb_tx_config *cfg = &g_usb_e1.tx_cfg; - e1_tx_config( ((cfg->mode & 3) << 1) | - ((cfg->timing & 1) << 3) | - ((cfg->alarm & 1) << 4) | - ((cfg->ext_loopback & 3) << 5) ); + e1_tx_config(0, + ((cfg->mode & 3) << 1) | + ((cfg->timing & 1) << 3) | + ((cfg->alarm & 1) << 4) | + ((cfg->ext_loopback & 3) << 5) + ); } static void _perform_rx_config(void) { const struct ice1usb_rx_config *cfg = &g_usb_e1.rx_cfg; - e1_rx_config((cfg->mode << 1)); + e1_rx_config(0, + (cfg->mode << 1) + ); } static enum usb_fnd_resp @@ -263,12 +267,12 @@ switch (g_usb_e1.running) { case false: /* Disable E1 rx/tx */ - e1_init(0, 0); + e1_init(0, 0, 0); break; case true: /* Reset and Re-Enable E1 */ - e1_init(0, 0); + e1_init(0, 0, 0); _perform_rx_config(); _perform_tx_config(); -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26839 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I17671be65543f5a2bf3d16ba2b5a5081eb38ebdf Gerrit-Change-Number: 26839 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 3
0 0
  • ← Newer
  • 1
  • ...
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • ...
  • 79
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.