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: Remove useless variable in main loop
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26833 ) Change subject: icE1usb fw: Remove useless variable in main loop ...................................................................... icE1usb fw: Remove useless variable in main loop Left over from early testing code ... Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I242bbcd42ba96f56bf12bbe57537f3a72a44767b --- M firmware/ice40-riscv/icE1usb/fw_app.c 1 file changed, 2 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/33/26833/1 diff --git a/firmware/ice40-riscv/icE1usb/fw_app.c b/firmware/ice40-riscv/icE1usb/fw_app.c index eebc21f..39173f2 100644 --- a/firmware/ice40-riscv/icE1usb/fw_app.c +++ b/firmware/ice40-riscv/icE1usb/fw_app.c @@ -64,7 +64,6 @@ void main() { - bool e1_active = false; int cmd = 0; /* Init console IO */ @@ -103,7 +102,6 @@ /* Start */ e1_init(0, 0); - e1_active = true; led_state(true); usb_connect(); @@ -153,9 +151,7 @@ usb_poll(); /* E1 poll */ - if (e1_active) { - e1_poll(); - usb_e1_run(); - } + e1_poll(); + usb_e1_run(); } } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26833 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: I242bbcd42ba96f56bf12bbe57537f3a72a44767b Gerrit-Change-Number: 26833 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: Misc cosmetic cleanup in e1.{c,h} / usb_e1.c
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26832 ) Change subject: icE1usb fw: Misc cosmetic cleanup in e1.{c,h} / usb_e1.c ...................................................................... icE1usb fw: Misc cosmetic cleanup in e1.{c,h} / usb_e1.c Moving things around, comments, spacing, ... nothing functional. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Icc2a6ef6b03c89dd92e661a01d219e42dbf7067d --- M firmware/ice40-riscv/icE1usb/e1.c M firmware/ice40-riscv/icE1usb/e1.h M firmware/ice40-riscv/icE1usb/usb_e1.c 3 files changed, 26 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/32/26832/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index 59be063..6a4c73c 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -18,9 +18,16 @@ #include "led.h" // FIXME +// HW access +// --------- + static volatile struct e1_core * const e1_regs = (void *)(E1_CORE_BASE); static volatile uint8_t * const e1_data = (void *)(E1_DATA_BASE); + +// Helpers +// ------- + static unsigned int e1_data_ofs(int mf, int frame, int ts) { @@ -33,6 +40,7 @@ return &e1_data[e1_data_ofs(mf, frame, ts)]; } + // FIFOs // ----- /* Note: FIFO works at 'frame' level (i.e. 32 bytes) */ @@ -98,7 +106,6 @@ return (ofs >> 4); } - /* Debug */ static void e1f_debug(struct e1_fifo *fifo, const char *name) @@ -207,7 +214,6 @@ } - // Main logic // ---------- @@ -232,12 +238,11 @@ int in_flight; enum e1_pipe_state state; } tx; + struct e1_error_count errors; } g_e1; - - void e1_init(uint16_t rx_cr, uint16_t tx_cr) { @@ -285,8 +290,6 @@ e1_regs->rx.csr = g_e1.rx.cr; } -#include "dma.h" - unsigned int e1_rx_need_data(unsigned int usb_addr, unsigned int max_frames, unsigned int *pos) { diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index 4cbb6e5..9ceffdd 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -7,6 +7,9 @@ #pragma once + +/* control */ + void e1_init(uint16_t rx_cr, uint16_t tx_cr); void e1_poll(void); void e1_debug_print(bool data); @@ -14,6 +17,17 @@ void e1_tx_config(uint16_t cr); void e1_rx_config(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); + + +/* error reporting */ + #define E1_ERR_F_ALIGN_ERR 0x01 #define E1_ERR_F_LOS 0x02 #define E1_ERR_F_RAI 0x04 @@ -28,6 +42,9 @@ const struct e1_error_count *e1_get_error_count(void); + +/* external function provided by the platform; used by E1 driver to control LEDs */ + enum e1_platform_led { E1P_LED_GREEN = 0, E1P_LED_YELLOW = 1, @@ -40,6 +57,5 @@ E1P_LED_ST_BLINK_FAST = 3 }; -/* external function provided by the platform; used by E1 driver to control LEDs */ extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led, enum e1_platform_led_state state); diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index b4d8839..34ade71 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -15,7 +15,6 @@ #include "console.h" #include "misc.h" #include "e1.h" -#include "e1_hw.h" #include "ice1usb_proto.h" @@ -41,13 +40,6 @@ }; -/* Hack */ -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); -/* ---- */ - static void _usb_fill_feedback_ep(void) { -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26832 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: Icc2a6ef6b03c89dd92e661a01d219e42dbf7067d Gerrit-Change-Number: 26832 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Vendor requests to other interface than 0 are not errors
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26834 ) Change subject: icE1usb fw: Vendor requests to other interface than 0 are not errors ...................................................................... icE1usb fw: Vendor requests to other interface than 0 are not errors They might be used somewhere else ... just don't handle them, but let someone else potentially do it. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Ie1bce4565d14d6635d4a32c2a08f64728132a75e --- M firmware/ice40-riscv/icE1usb/usb_e1.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/34/26834/1 diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index 34ade71..09b428c 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -375,7 +375,7 @@ return _e1_ctrl_req_dev(req, xfer); case USB_REQ_RCPT_INTF: if (req->wIndex != 0) - return USB_FND_ERROR; + return USB_FND_CONTINUE; return _e1_ctrl_req_intf(req, xfer); case USB_REQ_RCPT_EP: case USB_REQ_RCPT_OTHER: -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26834 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: Ie1bce4565d14d6635d4a32c2a08f64728132a75e Gerrit-Change-Number: 26834 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Use #define's in descriptors for interface/endpoints ID
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26830 ) Change subject: icE1usb fw: Use #define's in descriptors for interface/endpoints ID ...................................................................... icE1usb fw: Use #define's in descriptors for interface/endpoints ID This way they can be used in other parts of the code more easily. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I565d9a43bc26b99bc385b46522e7da6a207b2412 --- M firmware/ice40-riscv/icE1usb/Makefile M firmware/ice40-riscv/icE1usb/usb_desc_app.c A firmware/ice40-riscv/icE1usb/usb_desc_ids.h 3 files changed, 34 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/30/26830/1 diff --git a/firmware/ice40-riscv/icE1usb/Makefile b/firmware/ice40-riscv/icE1usb/Makefile index 1c92edb..a8d18c9 100644 --- a/firmware/ice40-riscv/icE1usb/Makefile +++ b/firmware/ice40-riscv/icE1usb/Makefile @@ -48,6 +48,7 @@ config.h \ e1.h \ misc.h \ + usb_desc_ids.h \ usb_str_app.gen.h \ $(NULL) diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_app.c b/firmware/ice40-riscv/icE1usb/usb_desc_app.c index 246e70f..ec01854 100644 --- a/firmware/ice40-riscv/icE1usb/usb_desc_app.c +++ b/firmware/ice40-riscv/icE1usb/usb_desc_app.c @@ -10,6 +10,8 @@ #include <no2usb/usb_dfu_proto.h> #include <no2usb/usb.h> +#include "usb_desc_ids.h" + #define NULL ((void*)0) #define num_elem(a) (sizeof(a) / sizeof(a[0])) @@ -63,11 +65,7 @@ .bLength = sizeof(struct usb_conf_desc), .bDescriptorType = USB_DT_CONF, .wTotalLength = sizeof(_app_conf_desc), -#if 0 - .bNumInterfaces = 4, -#else - .bNumInterfaces = 2, -#endif + .bNumInterfaces = USB_INTF_NUM, .bConfigurationValue = 1, .iConfiguration = 4, .bmAttributes = 0x80, @@ -78,7 +76,7 @@ .intf = { .bLength = sizeof(struct usb_intf_desc), .bDescriptorType = USB_DT_INTF, - .bInterfaceNumber = 0, + .bInterfaceNumber = USB_INTF_E1(0), .bAlternateSetting = 0, .bNumEndpoints = 1, .bInterfaceClass = 0xff, @@ -89,7 +87,7 @@ .ep_interrupt = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x83, + .bEndpointAddress = USB_EP_E1_INT(0), .bmAttributes = 0x03, .wMaxPacketSize = 10, .bInterval = 3, @@ -99,7 +97,7 @@ .intf = { .bLength = sizeof(struct usb_intf_desc), .bDescriptorType = USB_DT_INTF, - .bInterfaceNumber = 0, + .bInterfaceNumber = USB_INTF_E1(0), .bAlternateSetting = 1, .bNumEndpoints = 4, .bInterfaceClass = 0xff, @@ -110,7 +108,7 @@ .ep_data_in = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x82, + .bEndpointAddress = USB_EP_E1_IN(0), .bmAttributes = 0x05, .wMaxPacketSize = 388, .bInterval = 1, @@ -118,7 +116,7 @@ .ep_data_out = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x01, + .bEndpointAddress = USB_EP_E1_OUT(0), .bmAttributes = 0x05, .wMaxPacketSize = 388, .bInterval = 1, @@ -126,7 +124,7 @@ .ep_fb = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x81, + .bEndpointAddress = USB_EP_E1_FB(0), .bmAttributes = 0x11, .wMaxPacketSize = 8, .bInterval = 3, @@ -134,7 +132,7 @@ .ep_interrupt = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x83, + .bEndpointAddress = USB_EP_E1_INT(0), .bmAttributes = 0x03, .wMaxPacketSize = 10, .bInterval = 3, @@ -146,7 +144,7 @@ .intf_ctl = { .bLength = sizeof(struct usb_intf_desc), .bDescriptorType = USB_DT_INTF, - .bInterfaceNumber = 1, + .bInterfaceNumber = USB_INTF_GPS_CDC_CTL, .bAlternateSetting = 0, .bNumEndpoints = 1, .bInterfaceClass = USB_CLS_CDC_CONTROL, @@ -176,7 +174,7 @@ .ep_ctl = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x84, + .bEndpointAddress = USB_EP_GPS_CDC_CTL, .bmAttributes = 0x03, .wMaxPacketSize = 64, .bInterval = 0x40, @@ -184,7 +182,7 @@ .intf_data = { .bLength = sizeof(struct usb_intf_desc), .bDescriptorType = USB_DT_INTF, - .bInterfaceNumber = 2, + .bInterfaceNumber = USB_INTF_GPS_CDC_DATA, .bAlternateSetting = 0, .bNumEndpoints = 2, .bInterfaceClass = USB_CLS_CDC_DATA, @@ -195,7 +193,7 @@ .ep_data_out = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x05, + .bEndpointAddress = USB_EP_GPS_CDC_OUT, .bmAttributes = 0x02, .wMaxPacketSize = 64, .bInterval = 0x00, @@ -203,7 +201,7 @@ .ep_data_in = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x85, + .bEndpointAddress = USB_EP_GPS_CDC_IN, .bmAttributes = 0x02, .wMaxPacketSize = 64, .bInterval = 0x00, @@ -214,11 +212,7 @@ .intf = { .bLength = sizeof(struct usb_intf_desc), .bDescriptorType = USB_DT_INTF, -#if 0 - .bInterfaceNumber = 3, -#else - .bInterfaceNumber = 1, -#endif + .bInterfaceNumber = USB_INTF_DFU, .bAlternateSetting = 0, .bNumEndpoints = 0, .bInterfaceClass = 0xfe, diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_ids.h b/firmware/ice40-riscv/icE1usb/usb_desc_ids.h new file mode 100644 index 0000000..2247f84 --- /dev/null +++ b/firmware/ice40-riscv/icE1usb/usb_desc_ids.h @@ -0,0 +1,17 @@ +/* + * usb_desc_ids.h + * + * Copyright (C) 2022 Sylvain Munaut <tnt(a)246tNt.com> + * SPDX-License-Identifier: LGPL-3.0-or-later + */ + +#pragma once + +#define USB_INTF_E1(p) (0 + (p)) +#define USB_INTF_DFU 1 +#define USB_INTF_NUM 2 + +#define USB_EP_E1_IN(p) (0x82 + (3 * (p))) +#define USB_EP_E1_OUT(p) (0x01 + (3 * (p))) +#define USB_EP_E1_FB(p) (0x81 + (3 * (p))) +#define USB_EP_E1_INT(p) (0x83 + (3 * (p))) -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26830 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: I565d9a43bc26b99bc385b46522e7da6a207b2412 Gerrit-Change-Number: 26830 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: gateware/cores: Update USB core
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26826 ) Change subject: gateware/cores: Update USB core ...................................................................... gateware/cores: Update USB core Mostly to get firmware code improvement and fixes Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Ifacacd15f989aa51c04433cfb0bdaee7f848b658 --- M gateware/cores/no2usb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/26/26826/1 diff --git a/gateware/cores/no2usb b/gateware/cores/no2usb index 0e940d4..e9d1fbb 160000 --- a/gateware/cores/no2usb +++ b/gateware/cores/no2usb @@ -1 +1 @@ -Subproject commit 0e940d4da592cd27c351de2a4c5639f391d86b4d +Subproject commit e9d1fbb8a1796444091cd8a39e2a4318530b4daf -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26826 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: Ifacacd15f989aa51c04433cfb0bdaee7f848b658 Gerrit-Change-Number: 26826 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: common fw: Add a 'panic' handler
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26827 ) Change subject: common fw: Add a 'panic' handler ...................................................................... common fw: Add a 'panic' handler Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Ice3f338abfe3d361da875c3233b8a052bd6aa2c2 --- M firmware/ice40-riscv/common/utils.c M firmware/ice40-riscv/common/utils.h 2 files changed, 53 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/27/26827/1 diff --git a/firmware/ice40-riscv/common/utils.c b/firmware/ice40-riscv/common/utils.c index 67b292f..1ac111b 100644 --- a/firmware/ice40-riscv/common/utils.c +++ b/firmware/ice40-riscv/common/utils.c @@ -5,9 +5,15 @@ * SPDX-License-Identifier: LGPL-3.0-or-later */ +#include <stdarg.h> #include <stdint.h> #include <stdbool.h> +#include "console.h" +#include "led.h" +#include "mini-printf.h" +#include "misc.h" + char * hexstr(void *d, int n, bool space) { @@ -29,3 +35,47 @@ return buf; } + + +void +_panic(const char *file, int lineno, const char *fmt, ...) +{ + char buf[256]; + va_list va; + int l; + + /* Fast hard red blinking led */ + led_state(true); + led_color(255, 0, 8); + led_breathe(false, 0, 0); + led_blink(true, 75, 75); + + /* Prepare buffer */ + l = mini_snprintf(buf, 255, "PANIC @ %s:%d = ", file, lineno); + + va_start(va, fmt); + l += mini_vsnprintf(buf+l, 255-l, fmt, va); + va_end(va); + + buf[l] = '\n'; + buf[l+1] = '\0'; + + /* Print once */ + puts(buf); + + /* Loop waiting for commands */ + while (1) { + int cmd = getchar_nowait(); + + switch (cmd) { + case 'b': + /* Reboot */ + reboot(2); + break; + case ' ': + /* Print error again */ + puts(buf); + break; + } + } +} diff --git a/firmware/ice40-riscv/common/utils.h b/firmware/ice40-riscv/common/utils.h index fc898f8..03359ae 100644 --- a/firmware/ice40-riscv/common/utils.h +++ b/firmware/ice40-riscv/common/utils.h @@ -10,3 +10,6 @@ #include <stdbool.h> char *hexstr(void *d, int n, bool space); + +void _panic(const char *file, int lineno, const char *fmt, ...); +#define panic(fmt, ...) _panic(__FILE__, __LINE__, fmt, ##__VA_ARGS__) -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26827 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: Ice3f338abfe3d361da875c3233b8a052bd6aa2c2 Gerrit-Change-Number: 26827 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: Set wDetachTimeout to 0 in DFU descriptor
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26829 ) Change subject: icE1usb fw: Set wDetachTimeout to 0 in DFU descriptor ...................................................................... icE1usb fw: Set wDetachTimeout to 0 in DFU descriptor It was pointed out that this should be 0 since we trigger detach ourselves, we don't need a bus reset. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Id7051ce00863c03e3498f4bab0a7124938e197c0 --- M firmware/ice40-riscv/icE1usb/usb_desc_app.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/29/26829/1 diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_app.c b/firmware/ice40-riscv/icE1usb/usb_desc_app.c index 886181c..246e70f 100644 --- a/firmware/ice40-riscv/icE1usb/usb_desc_app.c +++ b/firmware/ice40-riscv/icE1usb/usb_desc_app.c @@ -230,7 +230,7 @@ .bLength = sizeof(struct usb_dfu_func_desc), .bDescriptorType = USB_DFU_DT_FUNC, .bmAttributes = 0x0d, - .wDetachTimeOut = 1000, + .wDetachTimeOut = 0, .wTransferSize = 4096, .bcdDFUVersion = 0x0101, }, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26829 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: Id7051ce00863c03e3498f4bab0a7124938e197c0 Gerrit-Change-Number: 26829 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: Cleanup USB code a bit
by tnt 10 Jan '22

10 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26828 ) Change subject: icE1usb fw: Cleanup USB code a bit ...................................................................... icE1usb fw: Cleanup USB code a bit Some of it was written before some of the helpers were provided by the no2usb code and was never update. So instead of manually setting up a bunch of stuff we make proper use of some of the provided helpers. Side effects: - We recall e1_init(0,0) when enabling which happens to work around a bug ... proper fix coming later. - The 'dual BD' config for EP 0x81 and 0x83 is fixed. It didn't matter before since we overwrote it anyway, but now it's used and so needs to be correct. - The descriptors don't have the isoc endpoints at all in the "OFF" alt setting. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I33c92896acfba023abe0152d63dff3afe43b53cd --- M firmware/ice40-riscv/icE1usb/usb_desc_app.c M firmware/ice40-riscv/icE1usb/usb_e1.c 2 files changed, 31 insertions(+), 112 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/28/26828/1 diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_app.c b/firmware/ice40-riscv/icE1usb/usb_desc_app.c index 544ac23..886181c 100644 --- a/firmware/ice40-riscv/icE1usb/usb_desc_app.c +++ b/firmware/ice40-riscv/icE1usb/usb_desc_app.c @@ -24,13 +24,10 @@ struct { /* Two altsettings are required, as isochronous * interfaces must have a setting where they don't - * transceive any data. wMaxPacketSize is 0 for - * all endpoints in the 'off' altsetting */ + * transceive any data. We just remove the isochronous + * endpoints in the 'off' altsetting */ struct { struct usb_intf_desc intf; - struct usb_ep_desc ep_data_in; - struct usb_ep_desc ep_data_out; - struct usb_ep_desc ep_fb; struct usb_ep_desc ep_interrupt; } __attribute__ ((packed)) off; struct { @@ -83,36 +80,12 @@ .bDescriptorType = USB_DT_INTF, .bInterfaceNumber = 0, .bAlternateSetting = 0, - .bNumEndpoints = 4, + .bNumEndpoints = 1, .bInterfaceClass = 0xff, .bInterfaceSubClass = 0xe1, .bInterfaceProtocol = 0x00, .iInterface = 5, }, - .ep_data_in = { - .bLength = sizeof(struct usb_ep_desc), - .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x82, - .bmAttributes = 0x05, - .wMaxPacketSize = 0, - .bInterval = 1, - }, - .ep_data_out = { - .bLength = sizeof(struct usb_ep_desc), - .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x01, - .bmAttributes = 0x05, - .wMaxPacketSize = 0, - .bInterval = 1, - }, - .ep_fb = { - .bLength = sizeof(struct usb_ep_desc), - .bDescriptorType = USB_DT_EP, - .bEndpointAddress = 0x81, - .bmAttributes = 0x11, - .wMaxPacketSize = 0, - .bInterval = 3, - }, .ep_interrupt = { .bLength = sizeof(struct usb_ep_desc), .bDescriptorType = USB_DT_EP, diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index e180fec..b4d8839 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -71,8 +71,7 @@ val -= 256; /* Prepare buffer */ - usb_data_write(64, &val, 4); - usb_ep_regs[1].in.bd[0].ptr = 64; + usb_data_write(usb_ep_regs[1].in.bd[0].ptr, &val, 4); usb_ep_regs[1].in.bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(3); } @@ -189,33 +188,6 @@ } } -static const struct usb_intf_desc * -_find_intf(const struct usb_conf_desc *conf, uint8_t idx) -{ - const struct usb_intf_desc *intf = NULL; - const void *sod, *eod; - - if (!conf) - return NULL; - - sod = conf; - eod = sod + conf->wTotalLength; - - while (1) { - sod = usb_desc_find(sod, eod, USB_DT_INTF); - if (!sod) - break; - - intf = (void*)sod; - if (intf->bInterfaceNumber == idx) - return intf; - - sod = usb_desc_next(sod); - } - - return NULL; -} - static enum usb_fnd_resp _e1_set_conf(const struct usb_conf_desc *conf) { @@ -225,16 +197,16 @@ if (!conf) return USB_FND_SUCCESS; - intf = _find_intf(conf, 0); + intf = usb_desc_find_intf(conf, 0, 0, NULL); if (!intf) return USB_FND_ERROR; printf("e1 set_conf %08x\n", intf); usb_ep_boot(intf, 0x01, true); - usb_ep_boot(intf, 0x81, true); + usb_ep_boot(intf, 0x81, false); usb_ep_boot(intf, 0x82, true); - usb_ep_boot(intf, 0x83, true); + usb_ep_boot(intf, 0x83, false); return USB_FND_SUCCESS; } @@ -257,76 +229,50 @@ static enum usb_fnd_resp _e1_set_intf(const struct usb_intf_desc *base, const struct usb_intf_desc *sel) { + /* Validity checks */ if (base->bInterfaceNumber != 0) return USB_FND_CONTINUE; - switch (sel->bAlternateSetting) { - case 0: - if (!g_usb_e1.running) - return USB_FND_SUCCESS; + if (sel->bAlternateSetting > 1) + return USB_FND_ERROR; - /* disable E1 rx/tx */ + /* Don't do anything if no change */ + if (g_usb_e1.running == (sel->bAlternateSetting != 0)) + return USB_FND_SUCCESS; + + g_usb_e1.running = (sel->bAlternateSetting != 0); + + /* Reconfigure the endpoints */ + usb_ep_reconf(sel, 0x01); + usb_ep_reconf(sel, 0x81); + usb_ep_reconf(sel, 0x82); + usb_ep_reconf(sel, 0x83); + + /* Update E1 and USB state */ + switch (g_usb_e1.running) { + case false: + /* Disable E1 rx/tx */ e1_init(0, 0); - - /* EP1 OUT */ - usb_ep_regs[1].out.bd[0].csr = 0; - usb_ep_regs[1].out.bd[1].csr = 0; - - /* EP1 IN (feedback) */ - usb_ep_regs[1].in.bd[0].csr = 0; - - /* EP2 IN (data) */ - usb_ep_regs[2].in.bd[0].csr = 0; - usb_ep_regs[2].in.bd[1].csr = 0; - - /* EP3 IN: Interrupt */ - usb_ep_regs[3].in.bd[0].csr = 0; - - g_usb_e1.running = false; break; - case 1: - /* Hack to avoid re-setting while running ... avoid BD desync */ - if (g_usb_e1.running) - return USB_FND_SUCCESS; + case true: + /* Reset and Re-Enable E1 */ + e1_init(0, 0); _perform_rx_config(); _perform_tx_config(); - g_usb_e1.running = true; - - /* Configure EP1 OUT / EP2 IN */ - usb_ep_regs[1].out.status = USB_EP_TYPE_ISOC | USB_EP_BD_DUAL; /* Type=Isochronous, dual buffered */ - usb_ep_regs[2].in.status = USB_EP_TYPE_ISOC | USB_EP_BD_DUAL; /* Type=Isochronous, dual buffered */ - - /* Configure EP1 IN (feedback) */ - usb_ep_regs[1].in.status = USB_EP_TYPE_ISOC; /* Type=Isochronous, single buffered */ - - /* EP2 IN: Prepare two buffers */ + /* Reset BDI */ g_usb_e1.in_bdi = 0; - usb_ep_regs[2].in.bd[0].ptr = 1024; - usb_ep_regs[2].in.bd[0].csr = 0; - - usb_ep_regs[2].in.bd[1].ptr = 1536; - usb_ep_regs[2].in.bd[1].csr = 0; + g_usb_e1.out_bdi = 0; /* EP1 OUT: Queue two buffers */ - g_usb_e1.out_bdi = 0; - usb_ep_regs[1].out.bd[0].ptr = 1024; usb_ep_regs[1].out.bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(388); - - usb_ep_regs[1].out.bd[1].ptr = 1536; usb_ep_regs[1].out.bd[1].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(388); /* EP1 IN: Queue buffer */ _usb_fill_feedback_ep(); - /* EP3 IN: Interrupt */ - usb_ep_regs[3].in.status = USB_EP_TYPE_INT; - usb_ep_regs[3].in.bd[0].ptr = 68; - usb_ep_regs[3].in.bd[0].csr = 0; break; - default: - return USB_FND_ERROR; } return USB_FND_SUCCESS; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26828 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: I33c92896acfba023abe0152d63dff3afe43b53cd Gerrit-Change-Number: 26828 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 libosmocore[master]: contrib/libosmocore.spec.in: mention osmo-config-merge in utils
by laforge 10 Jan '22

10 Jan '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26687 ) Change subject: contrib/libosmocore.spec.in: mention osmo-config-merge in utils ...................................................................... contrib/libosmocore.spec.in: mention osmo-config-merge in utils Change-Id: I4d3d06b2f27ded60f9408e326202c5c6bf6d35d1 --- M contrib/libosmocore.spec.in 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/contrib/libosmocore.spec.in b/contrib/libosmocore.spec.in index 3018280..c2fe738 100644 --- a/contrib/libosmocore.spec.in +++ b/contrib/libosmocore.spec.in @@ -54,7 +54,8 @@ This package contains a program for frequency calculation for GSM called "osmo-arfcn", and a program called "osmo-auc-gen" that is used -for testing GSM authentication. +for testing GSM authentication, as well as "osmo-config-merge", a tool +for merging Osmocom configuration files. %package -n libosmocodec0 Summary: GSM 06.10, 06.20, 06.60, 06.90 codec library -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4d3d06b2f27ded60f9408e326202c5c6bf6d35d1 Gerrit-Change-Number: 26687 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmocore[master]: contrib/libosmocore.spec.in: mention osmo-config-merge in utils
by laforge 10 Jan '22

10 Jan '22
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26687 ) Change subject: contrib/libosmocore.spec.in: mention osmo-config-merge in utils ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4d3d06b2f27ded60f9408e326202c5c6bf6d35d1 Gerrit-Change-Number: 26687 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 10 Jan 2022 14:40:17 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • ...
  • 79
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.