tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26906 )
Change subject: icE1usb fw: Add function to enable/disable E1 led runner ......................................................................
icE1usb fw: Add function to enable/disable E1 led runner
Also don't force enable the runner in the e1_platform_led_set callback.
Due to GPIO shortage, the E1 leds control are multiplexed with SPI so this adds a method to temporarely stop the runner so SPI can be used.
Signed-off-by: Sylvain Munaut tnt@246tNt.com Change-Id: Ie671daab5ee5e0b5f58de9d4fef1f0ca7d6d02b6 --- M firmware/ice40-riscv/icE1usb/misc.c M firmware/ice40-riscv/icE1usb/misc.h 2 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/06/26906/1
diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index 4b32fcd..bd9198a 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c @@ -47,6 +47,18 @@
void +e1_led_run(void) +{ + misc_regs->e1_led |= 0x100; +} + +void +e1_led_pause(void) +{ + misc_regs->e1_led &= 0xff; +} + +void e1_led_set(bool enable, uint8_t cfg) { misc_regs->e1_led = (enable ? 0x100 : 0x000) | cfg; @@ -66,10 +78,11 @@
tmp = misc_regs->e1_led; tmp &= ~(3 << shift); - tmp |= 0x100 | ((state & 3) << shift); + tmp |= ((state & 3) << shift); misc_regs->e1_led = tmp; }
+ uint16_t e1_tick_read(int port) { diff --git a/firmware/ice40-riscv/icE1usb/misc.h b/firmware/ice40-riscv/icE1usb/misc.h index dac5730..b4baef1 100644 --- a/firmware/ice40-riscv/icE1usb/misc.h +++ b/firmware/ice40-riscv/icE1usb/misc.h @@ -26,7 +26,10 @@
void pdm_set(int chan, bool enable, unsigned value, bool normalize);
+void e1_led_run(void); +void e1_led_pause(void); void e1_led_set(bool enable, uint8_t cfg); + uint16_t e1_tick_read(int port);
void reboot(int fw);
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26906
to look at the new patch set (#2).
Change subject: icE1usb fw: Add function to enable/disable E1 led runner ......................................................................
icE1usb fw: Add function to enable/disable E1 led runner
Also don't force enable the runner in the e1_platform_led_set callback.
Due to GPIO shortage, the E1 leds control are multiplexed with SPI so this adds a method to temporarely stop the runner so SPI can be used.
Signed-off-by: Sylvain Munaut tnt@246tNt.com Change-Id: Ie671daab5ee5e0b5f58de9d4fef1f0ca7d6d02b6 --- M firmware/ice40-riscv/icE1usb/misc.c M firmware/ice40-riscv/icE1usb/misc.h 2 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/06/26906/2
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26906 )
Change subject: icE1usb fw: Add function to enable/disable E1 led runner ......................................................................
Patch Set 2: Code-Review+2
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26906 )
Change subject: icE1usb fw: Add function to enable/disable E1 led runner ......................................................................
icE1usb fw: Add function to enable/disable E1 led runner
Also don't force enable the runner in the e1_platform_led_set callback.
Due to GPIO shortage, the E1 leds control are multiplexed with SPI so this adds a method to temporarely stop the runner so SPI can be used.
Signed-off-by: Sylvain Munaut tnt@246tNt.com Change-Id: Ie671daab5ee5e0b5f58de9d4fef1f0ca7d6d02b6 --- M firmware/ice40-riscv/icE1usb/misc.c M firmware/ice40-riscv/icE1usb/misc.h 2 files changed, 17 insertions(+), 1 deletion(-)
Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index 4b32fcd..bd9198a 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c @@ -47,6 +47,18 @@
void +e1_led_run(void) +{ + misc_regs->e1_led |= 0x100; +} + +void +e1_led_pause(void) +{ + misc_regs->e1_led &= 0xff; +} + +void e1_led_set(bool enable, uint8_t cfg) { misc_regs->e1_led = (enable ? 0x100 : 0x000) | cfg; @@ -66,10 +78,11 @@
tmp = misc_regs->e1_led; tmp &= ~(3 << shift); - tmp |= 0x100 | ((state & 3) << shift); + tmp |= ((state & 3) << shift); misc_regs->e1_led = tmp; }
+ uint16_t e1_tick_read(int port) { diff --git a/firmware/ice40-riscv/icE1usb/misc.h b/firmware/ice40-riscv/icE1usb/misc.h index dac5730..b4baef1 100644 --- a/firmware/ice40-riscv/icE1usb/misc.h +++ b/firmware/ice40-riscv/icE1usb/misc.h @@ -26,7 +26,10 @@
void pdm_set(int chan, bool enable, unsigned value, bool normalize);
+void e1_led_run(void); +void e1_led_pause(void); void e1_led_set(bool enable, uint8_t cfg); + uint16_t e1_tick_read(int port);
void reboot(int fw);