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-bsc[master]: fix gscon clear 3/n: separate state for SCCP RLSD
by fixeria 12 Jan '22

12 Jan '22
fixeria has uploaded a new patch set (#3) to the change originally created by neels. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26614 ) Change subject: fix gscon clear 3/n: separate state for SCCP RLSD ...................................................................... fix gscon clear 3/n: separate state for SCCP RLSD Properly implement the separate conn release stages in separate FSM states: x) sent Clear Request, wait for a Clear Command from the MSC. Timeout after a configurable 60s. y) after a Clear Command and sending a Clear Complete, wait for the SCCP RLSD. Timeout after a configurable 60s. z) terminate after the RLSD is received / after timeout. handover_test.c needs a little tweak to make the MGCP release work with its fake MGCP client, because cleanup now ensures to invoke gscon_forget_mgw_endpoint() in all cases. Related: I680ec4ed866aa5f0b1ff29e7e98322615cfb288d (osmo-ttcn3-hacks) Related: OS#5337 Change-Id: Ie975117d37f38ba853589dc7f8d3e94f8f9586b2 --- M src/osmo-bsc/bsc_subscr_conn_fsm.c M tests/handover/handover_test.c 2 files changed, 75 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/26614/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/26614 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ie975117d37f38ba853589dc7f8d3e94f8f9586b2 Gerrit-Change-Number: 26614 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-hnbgw[master]: osmo-hnbgw.cfg: update example configuration
by dexter 12 Jan '22

12 Jan '22
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/26798 ) Change subject: osmo-hnbgw.cfg: update example configuration ...................................................................... osmo-hnbgw.cfg: update example configuration The shipped example configuration lacks the configuration of the co-located MGW. Lets update the sample configu file. Change-Id: I1e2e4cf6f44cf0934123ca213acc3d98d0d463b3 Related: OS#5152 --- M doc/examples/osmo-hnbgw/osmo-hnbgw.cfg 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/98/26798/1 diff --git a/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg b/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg index 9286b2a..3a1c670 100644 --- a/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg +++ b/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg @@ -23,3 +23,7 @@ iuh local-ip 0.0.0.0 hnbap-allow-tmsi 1 + mgcp + mgw remote-ip 127.0.0.1 + mgw remote-port 2427 + mgw reset-endpoint rtpbridge/* -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/26798 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I1e2e4cf6f44cf0934123ca213acc3d98d0d463b3 Gerrit-Change-Number: 26798 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
3 4
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: E1 core config update depending on state
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26853 ) Change subject: icE1usb fw: E1 core config update depending on state ...................................................................... icE1usb fw: E1 core config update depending on state Store Rx/Tx config separately so we can change some of the config bit depending on current state while still keeping what the user asked for. Not really used ATM since state is never IDLE, but for future use. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I0b4cbf88abc4af801054ba5d6779dede5649852a --- M firmware/ice40-riscv/icE1usb/e1.c 1 file changed, 50 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/53/26853/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index 09bc6d2..964b0bc 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -234,14 +234,20 @@ struct e1_state { struct { - uint32_t cr; + struct { + uint32_t cfg; + uint32_t val; + } cr; struct e1_fifo fifo; int in_flight; enum e1_pipe_state state; } rx; struct { - uint32_t cr; + struct { + uint32_t cfg; + uint32_t val; + } cr; struct e1_fifo fifo; int in_flight; enum e1_pipe_state state; @@ -280,6 +286,30 @@ E1_TX_CR_LOOPBACK | \ E1_TX_CR_LOOPBACK_CROSS ) +static void +_e1_update_cr_val(int port) +{ + struct e1_state *e1 = _get_state(port); + + /* RX */ + if (e1->rx.state == IDLE) { + /* "Off" state: Force MFA mode to detect remote side */ + e1->rx.cr.val = (e1->rx.cr.cfg & ~E1_RX_CR_MODE_MASK) | E1_RX_CR_ENABLE | E1_RX_CR_MODE_MFA; + } else { + /* "On state: Enabled + User config */ + e1->rx.cr.val = e1->rx.cr.cfg | E1_RX_CR_ENABLE; + } + + /* TX */ + if (e1->tx.state == IDLE) { + /* "Off" state: We TX only OIS */ + e1->tx.cr.val = (e1->tx.cr.cfg & ~(E1_TX_CR_MODE_MASK | E1_TX_CR_ALARM)) | E1_TX_CR_ENABLE | E1_TX_CR_MODE_TRSP; + } else { + /* "On state: Enabled + User config */ + e1->tx.cr.val = e1->tx.cr.cfg | E1_TX_CR_ENABLE; + } +} + void e1_init(int port, uint16_t rx_cr, uint16_t tx_cr) { @@ -293,17 +323,18 @@ e1f_init(&e1->rx.fifo, (512 * port) + 0, 256); e1f_init(&e1->tx.fifo, (512 * port) + 256, 256); - /* Enable Rx */ - e1->rx.cr = E1_RX_CR_ENABLE | (rx_cr & RXCR_PERMITTED); - e1_regs->rx.csr = E1_RX_CR_OVFL_CLR | e1->rx.cr; - - /* Enable Tx */ - e1->tx.cr = E1_TX_CR_ENABLE | (tx_cr & TXCR_PERMITTED); - e1_regs->tx.csr = E1_TX_CR_UNFL_CLR | e1->tx.cr; - - /* State */ + /* Flow state */ e1->rx.state = BOOT; e1->tx.state = BOOT; + + /* Set config registers */ + e1->rx.cr.cfg = rx_cr & RXCR_PERMITTED; + e1->tx.cr.cfg = tx_cr & TXCR_PERMITTED; + + _e1_update_cr_val(port); + + e1_regs->rx.csr = e1->rx.cr.val; + e1_regs->tx.csr = e1->tx.cr.val; } void @@ -311,8 +342,9 @@ { 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; + e1->rx.cr.cfg = cr & RXCR_PERMITTED; + _e1_update_cr_val(port); + e1_regs->rx.csr = e1->rx.cr.val; } void @@ -320,8 +352,9 @@ { 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; + e1->tx.cr.cfg = cr & TXCR_PERMITTED; + _e1_update_cr_val(port); + e1_regs->tx.csr = e1->tx.cr.val; } unsigned int @@ -523,7 +556,7 @@ /* Clear overflow if needed */ if (e1->rx.state != RUN) { - e1_regs->rx.csr = e1->rx.cr | E1_RX_CR_OVFL_CLR; + e1_regs->rx.csr = e1->rx.cr.val | E1_RX_CR_OVFL_CLR; e1->rx.state = RUN; } done_rx: @@ -554,7 +587,7 @@ /* Clear underflow if needed */ if (e1->tx.state != RUN) { - e1_regs->tx.csr = e1->tx.cr | E1_TX_CR_UNFL_CLR; + e1_regs->tx.csr = e1->tx.cr.val | E1_TX_CR_UNFL_CLR; e1->tx.state = RUN; } } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26853 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: I0b4cbf88abc4af801054ba5d6779dede5649852a Gerrit-Change-Number: 26853 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Update E1 core start/stop procedure
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26854 ) Change subject: icE1usb fw: Update E1 core start/stop procedure ...................................................................... icE1usb fw: Update E1 core start/stop procedure Previously we were just doing a hard reset, calling init again. And to stop, it was a bit harsh as well, just calling init with 0 as argument, not cleaning pending descriptors and such. Now, the HW is initialized once and there is proper startup and shutdown procedure, leaving things in the proper state. Init of e1 hardware (call to e1_init) is also delegated to usb_e1 since it's that module that handles all state changes and config so it makes sense it handles init too rather than calling it from fw_app.c Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I639f90ce3488a1a08e87854e74e0586010264f5d --- 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, 87 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/54/26854/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index 964b0bc..d7b1577 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -226,10 +226,11 @@ // ---------- enum e1_pipe_state { - IDLE = 0, /* not yet initialized */ - BOOT = 1, /* after e1_init(), regiters are programmed */ - RUN = 2, /* normal operation */ - RECOVER = 3, /* after underflow, overflow or alignment error */ + IDLE = 0, /* not running */ + STARTING = 1, /* after e1_start(), waiting for priming */ + RUN = 2, /* normal operation */ + RECOVER = 3, /* after underflow, overflow or alignment error */ + SHUTDOWN = 4, /* after e1_stop(), waiting for shutdown */ }; struct e1_state { @@ -324,8 +325,8 @@ e1f_init(&e1->tx.fifo, (512 * port) + 256, 256); /* Flow state */ - e1->rx.state = BOOT; - e1->tx.state = BOOT; + e1->rx.state = IDLE; + e1->tx.state = IDLE; /* Set config registers */ e1->rx.cr.cfg = rx_cr & RXCR_PERMITTED; @@ -357,6 +358,48 @@ e1_regs->tx.csr = e1->tx.cr.val; } +void +e1_start(int port) +{ + volatile struct e1_core *e1_regs = _get_regs(port); + struct e1_state *e1 = _get_state(port); + + /* Checks */ + while ((e1->rx.state == SHUTDOWN) || (e1->tx.state == SHUTDOWN)) + e1_poll(port); + + if ((e1->rx.state != IDLE) || (e1->tx.state != IDLE)) + panic("Invalid E1 hardware state (port=%d, rxs=%d, txs=%d)", + port, e1->rx.state, e1->tx.state); + + /* Clear FIFOs */ + e1f_reset(&e1->rx.fifo); + e1f_reset(&e1->tx.fifo); + + /* Flow state */ + e1->rx.state = STARTING; + e1->tx.state = STARTING; + + /* Update CRs */ + _e1_update_cr_val(port); + + e1_regs->rx.csr = e1->rx.cr.val | E1_RX_CR_OVFL_CLR ; + e1_regs->tx.csr = e1->tx.cr.val | E1_TX_CR_UNFL_CLR ; +} + +void +e1_stop(int port) +{ + struct e1_state *e1 = _get_state(port); + + /* Flow state */ + e1->rx.state = SHUTDOWN; + e1->tx.state = SHUTDOWN; + + /* Nothing else to do, e1_poll will stop submitting data and + * transition to IDLE when everything in-flight is done */ +} + unsigned int e1_rx_need_data(int port, unsigned int usb_addr, unsigned int max_frames, unsigned int *pos) { @@ -512,7 +555,7 @@ } /* Boot procedure */ - if (e1->tx.state == BOOT) { + if (e1->tx.state == STARTING) { if (e1f_unseen_frames(&e1->tx.fifo) < (16 * 5)) return; /* HACK: LED flow status */ @@ -521,6 +564,20 @@ } /* Handle RX */ + /* Bypass if OFF */ + if (e1->rx.state == IDLE) + goto done_rx; + + /* Shutdown */ + if (e1->rx.state == SHUTDOWN) { + if (e1->rx.in_flight == 0) { + e1->rx.state = IDLE; + _e1_update_cr_val(port); + e1_regs->rx.csr = e1->rx.cr.val; + } + goto done_rx; + } + /* Misalign ? */ if (e1->rx.state == RUN) { if (!(e1_regs->rx.csr & E1_RX_SR_ALIGNED)) { @@ -562,6 +619,20 @@ done_rx: /* Handle TX */ + /* Bypass if OFF */ + if (e1->tx.state == IDLE) + return; + + /* Shutdown */ + if (e1->tx.state == SHUTDOWN) { + if (e1->tx.in_flight == 0) { + e1->tx.state = IDLE; + _e1_update_cr_val(port); + e1_regs->tx.csr = e1->tx.cr.val; + } + return; + } + /* Underflow ? */ if (e1->tx.state == RUN) { if (e1_regs->tx.csr & E1_TX_SR_UNFL) { diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index a44c319..0ed43c4 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -11,6 +11,9 @@ /* control */ void e1_init(int port, uint16_t rx_cr, uint16_t tx_cr); +void e1_start(int port); +void e1_stop(int port); + void e1_poll(int port); void e1_debug_print(int port, bool data); diff --git a/firmware/ice40-riscv/icE1usb/fw_app.c b/firmware/ice40-riscv/icE1usb/fw_app.c index f531d08..5e9812c 100644 --- a/firmware/ice40-riscv/icE1usb/fw_app.c +++ b/firmware/ice40-riscv/icE1usb/fw_app.c @@ -101,8 +101,6 @@ usb_e1_init(); /* Start */ - e1_init(0, 0, 0); - e1_init(1, 0, 0); led_state(true); usb_connect(); diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index 9dc6f1d..96ca72a 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -289,15 +289,12 @@ switch (usb_e1->running) { case false: /* Disable E1 rx/tx */ - e1_init(port, 0, 0); + e1_stop(port); break; case true: /* Reset and Re-Enable E1 */ - e1_init(port, - _rx_config_reg(&rx_cfg_default), - _tx_config_reg(&tx_cfg_default) - ); + e1_start(port); /* Reset BDI */ usb_e1->in_bdi = 0; @@ -464,11 +461,15 @@ void usb_e1_init(void) { + uint32_t rx_cr = _rx_config_reg(&rx_cfg_default); + uint32_t tx_cr = _tx_config_reg(&tx_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; + e1_init(i, rx_cr, tx_cr); } usb_register_function_driver(&_e1_drv); -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26854 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: I639f90ce3488a1a08e87854e74e0586010264f5d Gerrit-Change-Number: 26854 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newchange
2 5
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Add _MASK version for multibit fields in config regs
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26847 ) Change subject: icE1usb fw: Add _MASK version for multibit fields in config regs ...................................................................... icE1usb fw: Add _MASK version for multibit fields in config regs This is a bit cleaner when masking in/out those rather than using the specific vaue that has all bits set. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: If2ca8efff37cb8fd1f1841656537ea8ad11ef55c --- M firmware/ice40-riscv/icE1usb/e1.c M firmware/ice40-riscv/icE1usb/e1_hw.h 2 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/47/26847/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index af59f14..a9feea0 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -290,11 +290,11 @@ } #define TXCR_PERMITTED ( \ - E1_TX_CR_MODE_TS0_CRC_E | \ - E1_TX_CR_TICK_REMOTE | \ - E1_TX_CR_ALARM | \ + E1_TX_CR_MODE_MASK | \ + E1_TX_CR_TICK_MASK | \ + E1_TX_CR_ALARM | \ E1_TX_CR_LOOPBACK | \ - E1_TX_CR_LOOPBACK_CROSS ) + E1_TX_CR_LOOPBACK_CROSS ) void e1_tx_config(int port, uint16_t cr) @@ -306,7 +306,7 @@ } #define RXCR_PERMITTED ( \ - E1_RX_CR_MODE_MFA ) + E1_RX_CR_MODE_MASK ) void e1_rx_config(int port, uint16_t cr) diff --git a/firmware/ice40-riscv/icE1usb/e1_hw.h b/firmware/ice40-riscv/icE1usb/e1_hw.h index 9227cc7..73cbd88 100644 --- a/firmware/ice40-riscv/icE1usb/e1_hw.h +++ b/firmware/ice40-riscv/icE1usb/e1_hw.h @@ -27,6 +27,7 @@ #define E1_RX_CR_MODE_BYTE (1 << 1) /* Request byte-level alignment */ #define E1_RX_CR_MODE_BFA (2 << 1) /* Request Basic Frame Alignment */ #define E1_RX_CR_MODE_MFA (3 << 1) /* Request Multi-Frame Alignment */ +#define E1_RX_CR_MODE_MASK (3 << 1) #define E1_RX_CR_OVFL_CLR (1 << 12) /* Clear Rx overflow condition */ /* E1 receiver status register */ @@ -44,8 +45,10 @@ #define E1_TX_CR_MODE_TS0 (1 << 1) /* Generate TS0 in framer */ #define E1_TX_CR_MODE_TS0_CRC (2 << 1) /* Generate TS0 + CRC4 in framer */ #define E1_TX_CR_MODE_TS0_CRC_E (3 << 1) /* Generate TS0 + CRC4 + E-bits (based on Rx) in framer */ +#define E1_TX_CR_MODE_MASK (3 << 1) #define E1_TX_CR_TICK_LOCAL (0 << 3) /* use local clock for Tx */ #define E1_TX_CR_TICK_REMOTE (1 << 3) /* use recovered remote clock for Tx */ +#define E1_TX_CR_TICK_MASK (1 << 3) #define E1_TX_CR_ALARM (1 << 4) /* indicate ALARM to remote */ #define E1_TX_CR_LOOPBACK (1 << 5) /* external loopback enable/diasble */ #define E1_TX_CR_LOOPBACK_CROSS (1 << 6) /* source of loopback: local (0) or other (1) port */ -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26847 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: If2ca8efff37cb8fd1f1841656537ea8ad11ef55c Gerrit-Change-Number: 26847 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 4
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Apply config reg field filter to e1_init call
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26848 ) Change subject: icE1usb fw: Apply config reg field filter to e1_init call ...................................................................... icE1usb fw: Apply config reg field filter to e1_init call Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Id45688fed0533f8d7dbbfd993c93f9ffc4e2d53e --- M firmware/ice40-riscv/icE1usb/e1.c 1 file changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/48/26848/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index a9feea0..f6a41c9 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -263,6 +263,16 @@ } +#define RXCR_PERMITTED ( \ + E1_RX_CR_MODE_MASK ) + +#define TXCR_PERMITTED ( \ + E1_TX_CR_MODE_MASK | \ + E1_TX_CR_TICK_MASK | \ + E1_TX_CR_ALARM | \ + E1_TX_CR_LOOPBACK | \ + E1_TX_CR_LOOPBACK_CROSS ) + void e1_init(int port, uint16_t rx_cr, uint16_t tx_cr) { @@ -277,11 +287,11 @@ e1f_reset(&e1->tx.fifo, (512 * port) + 256, 256); /* Enable Rx */ - e1->rx.cr = E1_RX_CR_ENABLE | rx_cr; + e1->rx.cr = E1_RX_CR_ENABLE | (rx_cr & RXCR_PERMITTED); e1_regs->rx.csr = E1_RX_CR_OVFL_CLR | e1->rx.cr; /* Enable Tx */ - e1->tx.cr = E1_TX_CR_ENABLE | tx_cr; + e1->tx.cr = E1_TX_CR_ENABLE | (tx_cr & TXCR_PERMITTED); e1_regs->tx.csr = E1_TX_CR_UNFL_CLR | e1->tx.cr; /* State */ @@ -289,13 +299,6 @@ e1->tx.state = BOOT; } -#define TXCR_PERMITTED ( \ - E1_TX_CR_MODE_MASK | \ - E1_TX_CR_TICK_MASK | \ - E1_TX_CR_ALARM | \ - E1_TX_CR_LOOPBACK | \ - E1_TX_CR_LOOPBACK_CROSS ) - void e1_tx_config(int port, uint16_t cr) { @@ -305,9 +308,6 @@ e1_regs->tx.csr = e1->tx.cr; } -#define RXCR_PERMITTED ( \ - E1_RX_CR_MODE_MASK ) - void e1_rx_config(int port, uint16_t cr) { -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26848 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: Id45688fed0533f8d7dbbfd993c93f9ffc4e2d53e Gerrit-Change-Number: 26848 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newchange
2 4
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Reorganize functions in 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/+/26849 ) Change subject: icE1usb fw: Reorganize functions in e1.{c,h} ...................................................................... icE1usb fw: Reorganize functions in e1.{c,h} RX before TX for consistency ... Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Idcb1890a3a3f4fd2129f73585c4ce9f8475f1e21 --- M firmware/ice40-riscv/icE1usb/e1.c M firmware/ice40-riscv/icE1usb/e1.h 2 files changed, 18 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/49/26849/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index f6a41c9..ed3e13f 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -300,15 +300,6 @@ } void -e1_tx_config(int port, uint16_t 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; -} - -void e1_rx_config(int port, uint16_t cr) { volatile struct e1_core *e1_regs = _get_regs(port); @@ -317,6 +308,15 @@ e1_regs->rx.csr = e1->rx.cr; } +void +e1_tx_config(int port, uint16_t 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; +} + unsigned int e1_rx_need_data(int port, unsigned int usb_addr, unsigned int max_frames, unsigned int *pos) { @@ -409,19 +409,19 @@ } unsigned int -e1_tx_level(int port) -{ - struct e1_state *e1 = _get_state(port); - return e1f_valid_frames(&e1->tx.fifo); -} - -unsigned int e1_rx_level(int port) { struct e1_state *e1 = _get_state(port); return e1f_valid_frames(&e1->rx.fifo); } +unsigned int +e1_tx_level(int port) +{ + struct e1_state *e1 = _get_state(port); + return e1f_valid_frames(&e1->tx.fifo); +} + const struct e1_error_count * e1_get_error_count(int port) { diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index a93a881..a44c319 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -14,16 +14,16 @@ void e1_poll(int port); void e1_debug_print(int port, bool data); -void e1_tx_config(int port, uint16_t cr); void e1_rx_config(int port, uint16_t cr); +void e1_tx_config(int port, uint16_t cr); /* data flow */ 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); +unsigned int e1_tx_level(int port); /* error reporting */ -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26849 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: Idcb1890a3a3f4fd2129f73585c4ce9f8475f1e21 Gerrit-Change-Number: 26849 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Use helper functions to derive config value from struct
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26850 ) Change subject: icE1usb fw: Use helper functions to derive config value from struct ...................................................................... icE1usb fw: Use helper functions to derive config value from struct Just from this patch, it's not clear why this is better, but it makes things a bit cleaner in upcoming patches Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I4c75bb4eb20c1d1aaa1695e95bdf0417bbf3bf76 --- M firmware/ice40-riscv/icE1usb/usb_e1.c 1 file changed, 13 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/50/26850/1 diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c index 08b192b..9dc6f1d 100644 --- a/firmware/ice40-riscv/icE1usb/usb_e1.c +++ b/firmware/ice40-riscv/icE1usb/usb_e1.c @@ -236,25 +236,19 @@ return USB_FND_SUCCESS; } -static void _perform_tx_config(int port) +static uint32_t +_tx_config_reg(const struct ice1usb_tx_config *cfg) { - 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) | + return ((cfg->mode & 3) << 1) | ((cfg->timing & 1) << 3) | ((cfg->alarm & 1) << 4) | - ((cfg->ext_loopback & 3) << 5) - ); + ((cfg->ext_loopback & 3) << 5); } -static void _perform_rx_config(int port) +static uint32_t +_rx_config_reg(const struct ice1usb_rx_config *cfg) { - 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) - ); + return (cfg->mode << 1); } static enum usb_fnd_resp @@ -300,9 +294,10 @@ case true: /* Reset and Re-Enable E1 */ - e1_init(port, 0, 0); - _perform_rx_config(port); - _perform_tx_config(port); + e1_init(port, + _rx_config_reg(&rx_cfg_default), + _tx_config_reg(&tx_cfg_default) + ); /* Reset BDI */ usb_e1->in_bdi = 0; @@ -352,7 +347,7 @@ printf("set_tx_mode[%d] %02x%02x%02x%02x\r\n", port, xfer->data[0], xfer->data[1], xfer->data[2], xfer->data[3]); usb_e1->tx_cfg = *cfg; - _perform_tx_config(port); + e1_tx_config(port, _tx_config_reg(cfg)); return true; } @@ -365,7 +360,7 @@ 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); + e1_rx_config(port, _rx_config_reg(cfg)); return true; } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26850 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: I4c75bb4eb20c1d1aaa1695e95bdf0417bbf3bf76 Gerrit-Change-Number: 26850 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Distinguish between E1 FIFO init and reset
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26851 ) Change subject: icE1usb fw: Distinguish between E1 FIFO init and reset ...................................................................... icE1usb fw: Distinguish between E1 FIFO init and reset Currently it's called 'reset' but really it's the init because it sets up the memory allocation and such. We rename that to e1f_init and introduce a true e1f_reset that only clears the fifo and resets the pointers Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I425c38e93fb235d5c5fc6f3a5027ac49cf3466d9 --- M firmware/ice40-riscv/icE1usb/e1.c 1 file changed, 11 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/51/26851/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index ed3e13f..1b6d978 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -58,13 +58,20 @@ /* Utils */ static void -e1f_reset(struct e1_fifo *fifo, unsigned int base, unsigned int len) +e1f_init(struct e1_fifo *fifo, unsigned int base, unsigned int len) { memset(fifo, 0x00, sizeof(struct e1_fifo)); fifo->base = base; fifo->mask = len - 1; } +static void +e1f_reset(struct e1_fifo *fifo) +{ + fifo->wptr[0] = fifo->wptr[1] = 0; + fifo->rptr[0] = fifo->rptr[1] = 0; +} + static unsigned int e1f_allocd_frames(struct e1_fifo *fifo) { @@ -282,9 +289,9 @@ /* Global state init */ memset(e1, 0x00, sizeof(struct e1_state)); - /* Reset FIFOs */ - e1f_reset(&e1->rx.fifo, (512 * port) + 0, 256); - e1f_reset(&e1->tx.fifo, (512 * port) + 256, 256); + /* Initialize FIFOs */ + e1f_init(&e1->rx.fifo, (512 * port) + 0, 256); + e1f_init(&e1->tx.fifo, (512 * port) + 256, 256); /* Enable Rx */ e1->rx.cr = E1_RX_CR_ENABLE | (rx_cr & RXCR_PERMITTED); -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26851 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: I425c38e93fb235d5c5fc6f3a5027ac49cf3466d9 Gerrit-Change-Number: 26851 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Update LED status even in E1 FSM is in IDLE state
by tnt 12 Jan '22

12 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26852 ) Change subject: icE1usb fw: Update LED status even in E1 FSM is in IDLE state ...................................................................... icE1usb fw: Update LED status even in E1 FSM is in IDLE state Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I82b867c4886c9f34ff685764424d3db9a8303789 --- M firmware/ice40-riscv/icE1usb/e1.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/52/26852/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index 1b6d978..09bc6d2 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -444,10 +444,6 @@ uint32_t bd; unsigned int ofs; - /* Active ? */ - 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(port, E1P_LED_GREEN, E1P_LED_ST_ON); @@ -461,6 +457,10 @@ /* TODO: completely off if rx tick counter not incrementing */ } + /* Active ? */ + if ((e1->rx.state == IDLE) && (e1->tx.state == IDLE)) + return; + /* Recover any done TX BD */ while ( (bd = e1_regs->tx.bd) & E1_BD_VALID ) { e1f_multiframe_read_discard(&e1->tx.fifo); -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26852 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: I82b867c4886c9f34ff685764424d3db9a8303789 Gerrit-Change-Number: 26852 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newchange
2 2
0 0
  • ← Newer
  • 1
  • ...
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • ...
  • 79
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.