Skip to content

Conversation

labbott
Copy link
Collaborator

@labbott labbott commented Sep 30, 2025

No description provided.

@labbott labbott marked this pull request as draft September 30, 2025 18:09
@labbott labbott requested review from hawkw and mkeeter September 30, 2025 18:09
Comment on lines +80 to +89
else if #[cfg(target_board = "cosmo-b")] {
let expected_rev = 0b001;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me:

Image

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nitpicks, but no concerns from me!

// Check that a valid bitstream is available for this board.
let board = build_util::env_var("HUBRIS_BOARD")?;
if board != "cosmo-a" {
if board != "cosmo-a" && board != "cosmo-b" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take it or leave it: could also do

Suggested change
if board != "cosmo-a" && board != "cosmo-b" {
if !matches!(board, "cosmo-a" | "cosmo-b") {

(or maybe if let would work too?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's str vs String nonsense here

 error[E0308]: mismatched types
  --> drv/cosmo-seq-server/build.rs:18:25
   |
18 |     if !matches!(board, "cosmo-a" | "cosmo-b") {
   |                  -----  ^^^^^^^^^ expected `String`, found `&str`
   |                  |
   |                  this expression has type `String`

error[E0308]: mismatched types
  --> drv/cosmo-seq-server/build.rs:18:37
   |
18 |     if !matches!(board, "cosmo-a" | "cosmo-b") {
   |                  -----              ^^^^^^^^^ expected `String`, found `&str`
   |                  |
   |                  this expression has type `String`

@labbott labbott marked this pull request as ready for review October 15, 2025 14:02
@labbott labbott changed the title WIP: cosmo b Add cosmo rev B Oct 15, 2025
self.log_pg_registers();
self.seq.power_ctrl.modify(|m| m.set_a0_en(false));

// XXX faulted isn't strictly a timeout, but this is the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is now out of date

// `A0Sm::ENABLE_GRP_A` time
// hardware-cosmo#658 prevents us from checking `CPU_PRESENT`
// at `A0Sm::ENABLE_GRP_A` time on rev-a boards
cfg_if::cfg_if! {
Copy link
Collaborator

@mkeeter mkeeter Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vibes: I would write this using a runtime conditional, i.e.

if cfg!(target_board = "cosmo-a") {
    // ...
} else {
    // ...
}

That way, all of the code is checked (and you can remove the #[allow(unused_mut)]), but the compiler will almost certainly optimize it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants