Skip to content

Commit dd6beb1

Browse files
authored
Add enable/disable_console_redirect functions to sequencer (#2433)
Closes #2279 (you'll be able to hit a well-defined `hiffy` interfrace)
1 parent df19262 commit dd6beb1

5 files changed

Lines changed: 84 additions & 2 deletions

File tree

drv/cosmo-seq-server/src/main.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,28 @@ impl idl::InOrderSequencerImpl for ServerImpl {
11121112
) -> Result<u32, RequestError<core::convert::Infallible>> {
11131113
Ok(self.debug.sp5_dbg2_toggle_timer.cnts())
11141114
}
1115+
1116+
fn enable_console_redirect(
1117+
&mut self,
1118+
_: &RecvMessage,
1119+
) -> Result<(), RequestError<core::convert::Infallible>> {
1120+
self.debug.uart_control.modify(|b| {
1121+
b.set_sp5_to_header(true);
1122+
b.set_use_debug_header(true);
1123+
});
1124+
Ok(())
1125+
}
1126+
1127+
fn disable_console_redirect(
1128+
&mut self,
1129+
_: &RecvMessage,
1130+
) -> Result<(), RequestError<core::convert::Infallible>> {
1131+
self.debug.uart_control.modify(|b| {
1132+
b.set_sp5_to_header(false);
1133+
b.set_use_debug_header(false);
1134+
});
1135+
Ok(())
1136+
}
11151137
}
11161138

11171139
impl NotificationHandler for ServerImpl {

drv/gimlet-seq-server/src/main.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,24 @@ impl<S: SpiServer> idl::InOrderSequencerImpl for ServerImpl<S> {
12891289
.unwrap_lite();
12901290
Ok(out.get())
12911291
}
1292+
1293+
fn enable_console_redirect(
1294+
&mut self,
1295+
_: &RecvMessage,
1296+
) -> Result<(), RequestError<core::convert::Infallible>> {
1297+
Err(RequestError::Fail(
1298+
idol_runtime::ClientError::BadMessageContents,
1299+
))
1300+
}
1301+
1302+
fn disable_console_redirect(
1303+
&mut self,
1304+
_: &RecvMessage,
1305+
) -> Result<(), RequestError<core::convert::Infallible>> {
1306+
Err(RequestError::Fail(
1307+
idol_runtime::ClientError::BadMessageContents,
1308+
))
1309+
}
12921310
}
12931311

12941312
fn read_spd_data_and_load_packrat(

drv/grapefruit-seq-server/src/main.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,24 @@ impl idl::InOrderSequencerImpl for ServerImpl {
233233
idol_runtime::ClientError::BadMessageContents,
234234
))
235235
}
236+
237+
fn enable_console_redirect(
238+
&mut self,
239+
_: &RecvMessage,
240+
) -> Result<(), RequestError<core::convert::Infallible>> {
241+
Err(RequestError::Fail(
242+
idol_runtime::ClientError::BadMessageContents,
243+
))
244+
}
245+
246+
fn disable_console_redirect(
247+
&mut self,
248+
_: &RecvMessage,
249+
) -> Result<(), RequestError<core::convert::Infallible>> {
250+
Err(RequestError::Fail(
251+
idol_runtime::ClientError::BadMessageContents,
252+
))
253+
}
236254
}
237255

238256
impl NotificationHandler for ServerImpl {

drv/mock-gimlet-seq-server/src/main.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,20 @@ impl idl::InOrderSequencerImpl for ServerImpl {
145145
) -> Result<u32, RequestError<core::convert::Infallible>> {
146146
Ok(0)
147147
}
148+
149+
fn enable_console_redirect(
150+
&mut self,
151+
_: &RecvMessage,
152+
) -> Result<(), RequestError<core::convert::Infallible>> {
153+
Ok(())
154+
}
155+
156+
fn disable_console_redirect(
157+
&mut self,
158+
_: &RecvMessage,
159+
) -> Result<(), RequestError<core::convert::Infallible>> {
160+
Ok(())
161+
}
148162
}
149163

150164
impl NotificationHandler for ServerImpl {

idl/cpu-seq.idol

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,26 @@ Interface(
8383
idempotent: true,
8484
),
8585
"gpio_edge_count": (
86-
doc: "Read the GPIO edge count from the sequencer FPGA (Gimlet only)",
86+
doc: "Read the GPIO edge count from the sequencer FPGA",
8787
args: {},
8888
reply: Simple("u32"),
8989
idempotent: true,
9090
),
9191
"gpio_cycle_count": (
92-
doc: "Read the GPIO cycle count from the sequencer FPGA (Gimlet only)",
92+
doc: "Read the GPIO cycle count from the sequencer FPGA",
9393
args: {},
9494
reply: Simple("u32"),
9595
idempotent: true,
9696
),
97+
"enable_console_redirect": (
98+
doc: "Sends the host console to UART breakout pins instead of the FPGA (Cosmo only)",
99+
reply: Simple("()"),
100+
idempotent: true,
101+
),
102+
"disable_console_redirect": (
103+
doc: "Sends the host console to the FPGA instead of UART breakout pins (Cosmo only)",
104+
reply: Simple("()"),
105+
idempotent: true,
106+
),
97107
},
98108
)

0 commit comments

Comments
 (0)