laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21878 )

Change subject: icE1usb fw: Don't store E1_*_CR_*_CLR in variables
......................................................................

icE1usb fw: Don't store E1_*_CR_*_CLR in variables

Those clear bits are only set once at start-up and then later
explicitly.  They shouldn't be stored with the user configuration
in state variables.

Change-Id: If38e86aefea7f1be4e1ff5a88860f8be593eeedc
---
M firmware/ice40-riscv/icE1usb/e1.c
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  tnt: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/firmware/ice40-riscv/icE1usb/e1.c 
b/firmware/ice40-riscv/icE1usb/e1.c
index 7682ce0..b1771f5 100644
--- a/firmware/ice40-riscv/icE1usb/e1.c
+++ b/firmware/ice40-riscv/icE1usb/e1.c
@@ -248,17 +248,15 @@
        e1f_reset(&g_e1.tx.fifo, 128, 128);

        /* Enable Rx */
-       g_e1.rx.cr = E1_RX_CR_OVFL_CLR |
-                    E1_RX_CR_MODE_MFA |
+       g_e1.rx.cr = E1_RX_CR_MODE_MFA |
                     E1_RX_CR_ENABLE;
-       e1_regs->rx.csr = g_e1.rx.cr;
+       e1_regs->rx.csr = E1_RX_CR_OVFL_CLR | g_e1.rx.cr;

        /* Enable Tx */
-       g_e1.tx.cr = E1_TX_CR_UNFL_CLR |
-                    (clk_mode ? E1_TX_CR_TICK_REMOTE : E1_TX_CR_TICK_LOCAL) |
+       g_e1.tx.cr = (clk_mode ? E1_TX_CR_TICK_REMOTE : E1_TX_CR_TICK_LOCAL) |
                     E1_TX_CR_MODE_TS0_CRC_E |
                     E1_TX_CR_ENABLE;
-       e1_regs->tx.csr = g_e1.tx.cr;
+       e1_regs->tx.csr = E1_TX_CR_UNFL_CLR | g_e1.tx.cr;

        /* State */
        g_e1.rx.state = BOOT;

--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21878
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: If38e86aefea7f1be4e1ff5a88860f8be593eeedc
Gerrit-Change-Number: 21878
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: tnt <[email protected]>
Gerrit-MessageType: merged

Reply via email to