kasli_soc: add SFP0..3 LED indication #237

Closed
den512 wants to merge 1 commits from den512/artiq-zynq:master into master

io_expander preserves his state between calls.
kasli_soc has additional module for SFP channels state indication.
async task added for LEDs control.

io_expander preserves his state between calls. kasli_soc has additional module for SFP channels state indication. async task added for LEDs control.
sb10q reviewed 2023-06-09 11:56:06 +08:00
@ -23,1 +33,4 @@
pub fn new(i2c: &'a mut i2c::I2c, index: u8) -> Result<Self, &'static str> {
const VIRTUAL_LED_MAPPING0: [(u8, u8, u8); 2] = [(0, 0, 6), (1, 1, 6)];
#[cfg(not (all(soc_platform = "target_kasli_soc", hw_rev = "v1.1")))]

wrong

wrong
den512 marked this conversation as resolved
sb10q reviewed 2023-06-09 11:58:16 +08:00
@ -149,6 +180,7 @@ pub fn main_core0() {
rtio_clocking::init(&mut timer, &cfg);
task::spawn(report_async_rtio_errors());
task::spawn(async_rtio_led());

You may not want to spawn this task e.g on zc706...

You may not want to spawn this task e.g on zc706...
den512 marked this conversation as resolved
sb10q reviewed 2023-06-09 11:59:07 +08:00
@ -102,6 +102,32 @@ async fn report_async_rtio_errors() {
}
}
static mut SEEN_RTIO_LED: u8 = 13;

13?

13?

I forgot to fix it after debugging.

I forgot to fix it after debugging.
den512 marked this conversation as resolved
mwojcik reviewed 2023-06-09 12:58:57 +08:00
@ -24,0 +35,4 @@
#[cfg(hw_rev = "v1.0")]
const VIRTUAL_LED_MAPPING1: [(u8, u8, u8); 2] = [(2, 0, 6), (3, 1, 6)];
#[cfg(hw_rev = "v1.0.1")]

for all intents and purposes, 1.0.1 counts as 1.0 - we won't be keeping track of it in firmware or descriptions, can be removed

for all intents and purposes, 1.0.1 counts as 1.0 - we won't be keeping track of it in firmware or descriptions, can be removed
den512 marked this conversation as resolved
den512 force-pushed master from 8a5d31d2ab to 300a231735 2023-06-09 15:03:47 +08:00 Compare

Would be great to also add it to satman, if possible - although the code in there is not async at all, so a part of the main loop, I think.

Would be great to also add it to satman, if possible - although the code in there is not ``async`` at all, so a part of the main loop, I think.

Yes, generally follow what is already done on Kasli.

Yes, generally follow what is already done on Kasli.

Will this PR close the #231? Please mention it in the description with Closes #XXX syntax

Will this PR close the #231? Please mention it in the description with `Closes #XXX` syntax

It have not close yet.
There is not support in satman. I am working on it now.

It have not close yet. There is not support in satman. I am working on it now.
esavkin reviewed 2023-06-12 12:53:19 +08:00
@ -343,2 +356,4 @@
self.bootstrap.cd_bootstrap.clk, self.sys_crg.cd_sys.clk)
self.csr_devices.append("sys_crg")
self.submodules.virtual_leds = virtual_leds.VirtualLeds()

For what are they needed here and above?

For what are they needed here and above?

This is register with rx channels status indication.

This is register with rx channels status indication.

I removed this additional module.

I removed this additional module.
den512 marked this conversation as resolved
@ -593,1 +593,4 @@
#[cfg(feature = "target_kasli_soc")]
fn sfp_leds_update() {
let virtual_leds;

Shouldn't the runtime code and satellite code be similar?

Shouldn't the runtime code and satellite code be similar?
den512 force-pushed master from ef817a4a92 to 8bba04b921 2023-06-20 14:53:35 +08:00 Compare
mwojcik reviewed 2023-06-27 10:59:26 +08:00
@ -103,6 +103,7 @@ fn init_drtio(timer: &mut GlobalTimer) {
panic!("SYS CLK did not switch");
}
unsafe {
pl::csr::drtio_transceiver::stable_clkin_write(1); //renable input clock buffer after reset of sys clock domain

not a part of SFP LEDs - please make a new PR for this

not a part of SFP LEDs - please make a new PR for this

I think in this PR should be a link to that PR with its relation - depends, related etc.

I think in this PR should be a link to that PR with its relation - depends, related etc.
den512 marked this conversation as resolved
den512 force-pushed master from adff99a6ef to ccfe15ee8d 2023-06-27 11:07:07 +08:00 Compare
den512 force-pushed master from ccfe15ee8d to c6acc499b1 2023-06-27 11:29:32 +08:00 Compare
den512 force-pushed master from c6acc499b1 to 8bba04b921 2023-06-27 12:11:38 +08:00 Compare
sb10q closed this pull request 2023-07-24 16:31:29 +08:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#237
There is no content yet.