This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21774 )
Change subject: icE1usb fw: Internal API for configuring E1 rx/tx config register
......................................................................
icE1usb fw: Internal API for configuring E1 rx/tx config register
Related: OS#4675
Change-Id: Ib23f9b99f169ab18d730bcf67b97a7b6bf863e98
---
M firmware/ice40-riscv/icE1usb/e1.c
M firmware/ice40-riscv/icE1usb/e1.h
2 files changed, 26 insertions(+), 0 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 b1771f5..1d8fd30 100644
--- a/firmware/ice40-riscv/icE1usb/e1.c
+++ b/firmware/ice40-riscv/icE1usb/e1.c
@@ -263,6 +263,29 @@
g_e1.tx.state = BOOT;
}
+#define TXCR_PERMITTED ( \
+ E1_TX_CR_MODE_TS0_CRC_E | \
+ E1_TX_CR_TICK_REMOTE | \
+ E1_TX_CR_ALARM | \
+ E1_TX_CR_LOOPBACK | \
+ E1_TX_CR_LOOPBACK_CROSS )
+
+void
+e1_tx_config(uint16_t cr)
+{
+ g_e1.tx.cr = (g_e1.tx.cr & ~TXCR_PERMITTED) | (cr & TXCR_PERMITTED);
+ e1_regs->tx.csr = g_e1.tx.cr;
+}
+
+#define RXCR_PERMITTED ( \
+ E1_RX_CR_MODE_MFA )
+
+void
+e1_rx_config(uint16_t cr)
+{
+ g_e1.rx.cr = (g_e1.rx.cr & ~RXCR_PERMITTED) | (cr & RXCR_PERMITTED);
+ e1_regs->rx.csr = g_e1.rx.cr;
+}
#include "dma.h"
diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h
index c438cb9..05ce19a 100644
--- a/firmware/ice40-riscv/icE1usb/e1.h
+++ b/firmware/ice40-riscv/icE1usb/e1.h
@@ -11,6 +11,9 @@
void e1_poll(void);
void e1_debug_print(bool data);
+void e1_tx_config(uint16_t cr);
+void e1_rx_config(uint16_t cr);
+
volatile uint8_t *e1_data_ptr(int mf, int frame, int ts);
unsigned int e1_data_ofs(int mf, int frame, int ts);
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21774
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: Ib23f9b99f169ab18d730bcf67b97a7b6bf863e98
Gerrit-Change-Number: 21774
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210105/daaac878/attachment.htm>