Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/projects.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,9 @@ use_ssh = true
cargo_build = true
auto_update = true
unless_env = "OXIDE_STAFF"

[project.dmar-report]
github = "oxidecomputer/dmar-report"
use_ssh = true
cargo_build = true
auto_update = true
5 changes: 5 additions & 0 deletions image/amd/turin-cosmo-1.0.0.6-mbist-noaggr.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
base = 'turin-cosmo-1.0.0.6.toml'

[patch]
base = 'turin-cosmo-a.efs.json5'
diff = 'turin-cosmo-a-mbist-noaggr.patch'
5 changes: 5 additions & 0 deletions image/amd/turin-cosmo-1.0.0.6-mbist.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
base = 'turin-cosmo-1.0.0.6.toml'

[patch]
base = 'turin-cosmo-a.efs.json5'
diff = 'turin-cosmo-a-mbist.patch'
56 changes: 56 additions & 0 deletions image/amd/turin-cosmo-a-mbist-noaggr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
--- turin-cosmo-1.0.0.6.efs.json5 Sat Oct 4 20:42:22 2025
+++ turin-cosmo-1.0.0.6.mbist-mfg-v0-dext-len3.efs.json5 Wed Oct 15 20:06:13 2025
@@ -10481,7 +10481,7 @@
},
{
Byte: {
- MemMbistAggressorsChannelDdrMode: "All"
+ MemMbistAggressorsChannelDdrMode: "SubChannel"
}
},
{
@@ -10546,7 +10546,7 @@
},
{
Byte: {
- MemMbistPatternLengthDdr: 6
+ MemMbistPatternLengthDdr: 3
}
},
{
@@ -10763,7 +10763,7 @@
},
{
Byte: {
- MemMbistPatternSelectDdr: "Auto"
+ MemMbistPatternSelectDdr: "Prbs"
}
},
{
@@ -10843,7 +10843,7 @@
},
{
Byte: {
- MemMbistDataEyeSilentExecutionDdr: "Disabled"
+ MemMbistDataEyeSilentExecutionDdr: "Enabled"
}
},
{
@@ -10933,7 +10933,7 @@
},
{
Byte: {
- MemMbistTestModeDdr: "Both"
+ MemMbistTestModeDdr: "DataEye"
}
},
{
@@ -11057,7 +11057,7 @@
},
{
Byte: {
- MemMbistAggressorsDdr: "Auto"
+ MemMbistAggressorsDdr: "Disabled"
}
},
{
56 changes: 56 additions & 0 deletions image/amd/turin-cosmo-a-mbist.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
--- turin-cosmo-1.0.0.6.efs.json5 Sat Oct 4 20:42:22 2025
+++ turin-cosmo-1.0.0.6.mbist-mfg-v0-dext-len3.efs.json5 Wed Oct 15 20:06:13 2025
@@ -10481,7 +10481,7 @@
},
{
Byte: {
- MemMbistAggressorsChannelDdrMode: "All"
+ MemMbistAggressorsChannelDdrMode: "SubChannel"
}
},
{
@@ -10546,7 +10546,7 @@
},
{
Byte: {
- MemMbistPatternLengthDdr: 6
+ MemMbistPatternLengthDdr: 3
}
},
{
@@ -10763,7 +10763,7 @@
},
{
Byte: {
- MemMbistPatternSelectDdr: "Auto"
+ MemMbistPatternSelectDdr: "Prbs"
}
},
{
@@ -10843,7 +10843,7 @@
},
{
Byte: {
- MemMbistDataEyeSilentExecutionDdr: "Disabled"
+ MemMbistDataEyeSilentExecutionDdr: "Enabled"
}
},
{
@@ -10933,7 +10933,7 @@
},
{
Byte: {
- MemMbistTestModeDdr: "Both"
+ MemMbistTestModeDdr: "DataEye"
}
},
{
@@ -11057,7 +11057,7 @@
},
{
Byte: {
- MemMbistAggressorsDdr: "Auto"
+ MemMbistAggressorsDdr: "Enabled"
}
},
{
4 changes: 4 additions & 0 deletions image/templates/sled/ramdisk-01-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@
"/driver/network/opte@${optever}"
] },

{ "t": "pkg_install", "with": "mbist", "pkgs": [
"/driver/developer/amd/zen"
] },

{ "t": "pkg_install", "with": "mfg", "pkgs": [
"/driver/developer/amd/zen",
"/driver/cpu/amd/psp",
Expand Down
7 changes: 7 additions & 0 deletions image/templates/sled/targets.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ app = "milan-gimlet-b-1.0.0.a.toml"
efs = "turin-cosmo-a.efs.json5"
app = "turin-cosmo-1.0.0.6.toml"

[cosmo-mbist]
app = "turin-cosmo-1.0.0.6-mbist.toml"
feature = "mbist"

[cosmo-mbist-noaggr]
app = "turin-cosmo-1.0.0.6-mbist-noaggr.toml"
feature = "mbist"
5 changes: 5 additions & 0 deletions image/templates/sled/zfs.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
"owner": "root", "group": "bin", "mode": "0755" },
{ "t": "include", "without": "no-pilot", "name": "compliance-common" },

{ "t": "ensure_file", "with": "mbist",
"file": "/usr/bin/dmar-report",
"extsrc": "dmar-report/target/release/dmar-report",
"owner": "root", "group": "bin", "mode": "0755" },

{ "t": "include", "with": "genproto",
"name": "genproto", "file": "${genproto}" },

Expand Down
85 changes: 53 additions & 32 deletions tools/helios-build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use helios_build_utils::metadata::{self, ArchiveType};
use helios_build_utils::tree;
use serde::Deserialize;
use slog::Logger;
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use std::fs::File;
use std::io::{BufReader, Read, Write};
use std::os::unix::fs::PermissionsExt;
Expand Down Expand Up @@ -1312,18 +1312,22 @@ impl Publishers {

#[derive(Clone, Debug, Deserialize)]
struct Board {
efs: String,
efs: Option<String>,
app: String,
feature: Option<String>,
}

impl Board {
fn efs_path(&self) -> Result<PathBuf> {
if self.efs.starts_with("/") {
let p = PathBuf::from(self.efs.clone());
fn efs_path(&self) -> Option<Result<PathBuf>> {
let Some(efs) = &self.efs else {
return None;
};
if efs.starts_with("/") {
let p = PathBuf::from(efs.clone());
assert!(p.is_absolute());
Ok(p)
Some(Ok(p))
} else {
top_path(&["image", "amd", &self.efs])
Some(top_path(&["image", "amd", efs]))
}
}

Expand Down Expand Up @@ -1442,10 +1446,12 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {

for (name, board) in target_boards.iter() {
info!(log, "Checking files for board '{name}'");
let efsfile = board.efs_path()?;
info!(log, " {efsfile:?}");
if !efsfile.is_file() {
bail!("Missing AMD configuration file {efsfile:?} for {name}");
if let Some(efsfile) = board.efs_path() {
let efsfile = efsfile?;
info!(log, " {efsfile:?}");
if !efsfile.is_file() {
bail!("Missing AMD configuration file {efsfile:?} for {name}");
}
}
let appfile = board.app_path()?;
info!(log, " {appfile:?}");
Expand Down Expand Up @@ -1594,6 +1600,7 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {
let templates = top_path(&["image", "templates"])?;
let brand_extras = rel_path(Some(&tempdir), &["omicron1"])?;
let projects_extras = top_path(&["projects"])?;
let features = res.opt_strs("F").into_iter().collect::<HashSet<_>>();
std::fs::create_dir_all(&brand_extras)?;
let basecmd = || -> Command {
let mut cmd = Command::new("pfexec");
Expand Down Expand Up @@ -1628,7 +1635,7 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {
if recovery {
cmd.arg("-F").arg("recovery");
}
for farg in res.opt_strs("F") {
for farg in &features {
cmd.arg("-F").arg(farg);
}
cmd
Expand Down Expand Up @@ -1963,30 +1970,44 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {
* Go through and create the per-board ROM images.
*/
for (name, board) in target_boards.iter() {
if let Some(feat) = &board.feature {
if !features.contains(feat) {
info!(
log,
"skipping building ROM for {name} ('{feat}' disabled)"
);
continue;
}
}
info!(log, "building ROM for {name}");

let romname = format!("{name}.rom");
let rom = rel_path(Some(&outdir), &[&romname])?;

ensure::run_in(
log,
&ahib_path,
&[
"cargo",
"xtask",
"gen",
"--amd-firmware",
fw_path.to_str().unwrap(),
"--payload",
reset.to_str().unwrap(),
"--config",
board.efs_path()?.to_str().unwrap(),
"--app",
board.app_path()?.to_str().unwrap(),
"--image",
rom.to_str().unwrap(),
],
)?;
let efs_path;
let app_path = board.app_path()?;
let root_path = top_path(&["image", "amd"])?;
let mut args = vec![
"cargo",
"xtask",
"gen",
"--amd-firmware",
fw_path.to_str().unwrap(),
"--payload",
reset.to_str().unwrap(),
"--app",
app_path.to_str().unwrap(),
"--image",
rom.to_str().unwrap(),
"--root",
root_path.to_str().unwrap(),
];
if let Some(efs) = board.efs_path() {
efs_path = efs?;
args.push("--config");
args.push(efs_path.to_str().unwrap());
}
ensure::run_in(log, &ahib_path, &args)?;

tar.add_file(&rom, &romname)?;

Expand All @@ -2004,7 +2025,7 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {
* The configuration for amd-host-image-builder is stored in JSON5
* format. Read the file as a generic JSON object:
*/
let f = std::fs::read_to_string(board.efs_path()?)?;
let f = std::fs::read_to_string(board.efs_path().unwrap()?)?;
let inputcfg: serde_json::Value = json5::from_str(&f)?;

for limit in [1600, 1866, 2133, 2400, 2667, 2933, 3200] {
Expand Down