Skip to content

Commit

Permalink
Add rev E Gimlet (#1486)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter authored Aug 10, 2023
1 parent c151d6d commit 4176179
Show file tree
Hide file tree
Showing 23 changed files with 137 additions and 90 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
build: [stm32f3, stm32f4, lpc55, stm32h743, stm32h753, gemini, rot-carrier, gimletlet, gimlet-b, gimlet-b-lab, gimlet-b-dev, gimlet-c, gimlet-c-lab, gimlet-c-dev, gimlet-d, gimlet-d-lab, gimlet-d-dev, sidecar-b, sidecar-b-lab, sidecar-b-dev, sidecar-c, sidecar-c-lab, sidecar-c-dev, psc-b, psc-b-dev, psc-c, psc-c-dev, stm32g0, oxide-rot-1, oxide-rot-1-dev, donglet-g031]
build: [stm32f3, stm32f4, lpc55, stm32h743, stm32h753, gemini, rot-carrier, gimletlet, gimlet-b, gimlet-b-lab, gimlet-b-dev, gimlet-c, gimlet-c-lab, gimlet-c-dev, gimlet-d, gimlet-d-lab, gimlet-d-dev, gimlet-e, gimlet-e-lab, gimlet-e-dev, sidecar-b, sidecar-b-lab, sidecar-b-dev, sidecar-c, sidecar-c-lab, sidecar-c-dev, psc-b, psc-b-dev, psc-c, psc-c-dev, stm32g0, oxide-rot-1, oxide-rot-1-dev, donglet-g031]
include:
- build: stm32g0
app_name: demo-stm32g070-nucleo
Expand Down Expand Up @@ -102,6 +102,21 @@ jobs:
app_toml: app/gimlet/rev-d-dev.toml
target: thumbv7em-none-eabihf
image: default
- build: gimlet-e
app_name: gimlet-e
app_toml: app/gimlet/rev-e.toml
target: thumbv7em-none-eabihf
image: default
- build: gimlet-e-lab
app_name: gimlet-e-lab
app_toml: app/gimlet/rev-e-lab.toml
target: thumbv7em-none-eabihf
image: default
- build: gimlet-e-dev
app_name: gimlet-e-dev
app_toml: app/gimlet/rev-e-dev.toml
target: thumbv7em-none-eabihf
image: default
- build: sidecar-b
app_name: sidecar-b
app_toml: app/sidecar/rev-b.toml
Expand Down
70 changes: 0 additions & 70 deletions app/gimlet/base-bc.toml

This file was deleted.

70 changes: 69 additions & 1 deletion app/gimlet/rev-b.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
name = "gimlet-b"
board = "gimlet-b"
inherit = "base-bc.toml"
inherit = "base.toml"

#
# I2C2: Front/M.2 bus
#
[[config.i2c.controllers]]
controller = 2

#
# SMBUS_SP_TO_M2_SMCLK_A2_V3P3
# SMBUS_SP_TO_M2_SMDAT_A2_V3P3
#
[config.i2c.controllers.ports.B]
name = "m2"
description = "M.2 bus"
scl.pin = 10
sda.pin = 11
af = 4
[[config.i2c.controllers.ports.B.muxes]]
driver = "pca9548"
address = 0x73

#
# SMBUS_SP_TO_LVL_FRONT_SMDAT
# SMBUS_SP_TO_LVL_FRONT_SMCLK
#
[config.i2c.controllers.ports.F]
name = "front"
description = "Front bus"
scl.pin = 1
sda.pin = 0
af = 4

#
# Shark fin muxes
#
[[config.i2c.controllers.ports.F.muxes]]
driver = "pca9548"
address = 0x70

[[config.i2c.controllers.ports.F.muxes]]
driver = "pca9548"
address = 0x71

[[config.i2c.controllers.ports.F.muxes]]
driver = "pca9548"
address = 0x72

[[config.i2c.devices]]
bus = "m2"
mux = 1
segment = 1
address = 0b110_1010
device = "m2_hp_only"
description = "M.2 A NVMe Basic Management Command"
name = "M2_A"
sensors = { temperature = 1 }
removable = true

[[config.i2c.devices]]
bus = "m2"
mux = 1
segment = 2
address = 0b110_1010
device = "m2_hp_only"
description = "M.2 B NVMe Basic Management Command"
name = "M2_B"
sensors = { temperature = 1 }
removable = true
4 changes: 3 additions & 1 deletion app/gimlet/rev-c.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name = "gimlet-c"
board = "gimlet-c"
inherit = "base-bc.toml"

# Rev C is mostly identical to Rev B, but with a new name and board
inherit = "rev-b.toml"
2 changes: 2 additions & 0 deletions app/gimlet/rev-e-dev.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name = "gimlet-e-dev"
inherit = ["rev-e.toml", "dev.toml"]
2 changes: 2 additions & 0 deletions app/gimlet/rev-e-lab.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name = "gimlet-e-lab"
inherit = ["rev-e-dev.toml", "lab.toml"]
5 changes: 5 additions & 0 deletions app/gimlet/rev-e.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name = "gimlet-e"
board = "gimlet-e"

# Rev E is mostly identical to Rev D, but with a new name and board
inherit = "rev-d.toml"
2 changes: 2 additions & 0 deletions app/gimlet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ fn system_init() {
let expected_rev = 0b010;
} else if #[cfg(target_board = "gimlet-d")] {
let expected_rev = 0b011;
} else if #[cfg(target_board = "gimlet-e")] {
let expected_rev = 0b111; // hardware-gimlet#1952
} else {
compile_error!("not a recognized gimlet board")
}
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions drv/gimlet-hf-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
any(
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d"
target_board = "gimlet-d",
target_board = "gimlet-e",
),
path = "bsp/gimlet_bcd.rs"
path = "bsp/gimlet_bcde.rs"
)]
#[cfg_attr(target_board = "gemini-bu-1", path = "bsp/gemini_bu_1.rs")]
#[cfg_attr(target_board = "gimletlet-2", path = "bsp/gimletlet_2.rs")]
Expand Down
10 changes: 8 additions & 2 deletions drv/gimlet-seq-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ include!(concat!(env!("OUT_DIR"), "/i2c_config.rs"));

#[cfg_attr(target_board = "gimlet-b", path = "payload_b.rs")]
#[cfg_attr(
any(target_board = "gimlet-c", target_board = "gimlet-d"),
path = "payload_cd.rs"
any(
target_board = "gimlet-c",
target_board = "gimlet-d",
target_board = "gimlet-e",
),
path = "payload_cde.rs"
)]
mod payload;

Expand Down Expand Up @@ -415,6 +419,7 @@ fn read_spd_data_and_load_packrat(packrat: &Packrat, i2c_task: TaskId) {
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d",
target_board = "gimlet-e",
))] {
//
// On Gimlet, we have two banks of up to 8 DIMMs apiece:
Expand Down Expand Up @@ -1034,6 +1039,7 @@ cfg_if::cfg_if! {
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d",
target_board = "gimlet-e",
))] {
const A0_TIMEOUT_MILLIS: u64 = 2000;

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions drv/stm32h7-sprot-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ cfg_if::cfg_if! {
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d",
target_board = "gimlet-e",
target_board = "sidecar-b",
target_board = "sidecar-c",
target_board = "psc-a",
Expand Down
2 changes: 2 additions & 0 deletions drv/user-leds/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ cfg_if::cfg_if! {
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d",
target_board = "gimlet-e",
target_board = "psc-a",
target_board = "psc-b",
target_board = "psc-c",
Expand Down Expand Up @@ -471,6 +472,7 @@ cfg_if::cfg_if! {
} else if #[cfg(any(target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d",
target_board = "gimlet-e",
target_board = "psc-a",
target_board = "psc-b",
target_board = "psc-c",
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions task/host-sp-comms/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ use inventory::INVENTORY_API_VERSION;
any(
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d"
target_board = "gimlet-d",
target_board = "gimlet-e",
),
path = "bsp/gimlet_bcd.rs"
path = "bsp/gimlet_bcde.rs"
)]
#[cfg_attr(target_board = "gimletlet-2", path = "bsp/gimletlet.rs")]
mod bsp;
Expand Down Expand Up @@ -1132,6 +1133,7 @@ cfg_if::cfg_if! {
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d",
target_board = "gimlet-e",
))] {
const SP_TO_SP3_INT_L: sys_api::PinSet = sys_api::Port::I.pin(7);
} else if #[cfg(target_board = "gimletlet-2")] {
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions task/net/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ mod server;
any(
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d"
target_board = "gimlet-d",
target_board = "gimlet-e",
),
path = "bsp/gimlet_bcd.rs"
path = "bsp/gimlet_bcde.rs"
)]
#[cfg_attr(target_board = "psc-a", path = "bsp/psc_a.rs")]
#[cfg_attr(
Expand Down
6 changes: 6 additions & 0 deletions task/power/src/bsp.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

// This file should never be included; if it is, the build configuration is bad
compile_error!("no BSP for the given target board");
File renamed without changes.
5 changes: 3 additions & 2 deletions task/power/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@ macro_rules! mwocp68_controller {
any(
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d"
target_board = "gimlet-d",
target_board = "gimlet-e",
),
path = "bsp/gimlet_bcd.rs"
path = "bsp/gimlet_bcde.rs"
)]
#[cfg_attr(
any(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ task_slot!(SEQ, gimlet_seq);
// the control loop.
const NUM_TEMPERATURE_SENSORS: usize = sensors::NUM_TMP117_TEMPERATURE_SENSORS;

// BMC sensors vary depending on hardware revision
#[cfg(any(target_board = "gimlet-b", target_board = "gimlet-c"))]
const NUM_NVME_BMC_TEMPERATURE_SENSORS: usize =
sensors::NUM_NVME_BMC_TEMPERATURE_SENSORS
+ sensors::NUM_M2_HP_ONLY_TEMPERATURE_SENSORS;

#[cfg(target_board = "gimlet-d")]
#[cfg(any(target_board = "gimlet-d", target_board = "gimlet-e"))]
const NUM_NVME_BMC_TEMPERATURE_SENSORS: usize =
sensors::NUM_NVME_BMC_TEMPERATURE_SENSORS;

Expand Down Expand Up @@ -253,16 +254,15 @@ const INPUTS: [InputChannel; NUM_TEMPERATURE_INPUTS] = [
// powered, and we want to minimize the TOCTOU window between asking the
// MAX5970 "is it powered?" and actually reading data.
//
// See hardware-gimlet#1804 for details; this will hopefully be fixed in
// later Gimlet revisions.
// See hardware-gimlet#1804 for details; this is fixed in later revisions.
InputChannel::new(
#[cfg(any(target_board = "gimlet-b", target_board = "gimlet-c"))]
TemperatureSensor::new(
Device::M2,
devices::m2_hp_only_m2_a,
sensors::M2_HP_ONLY_M2_A_TEMPERATURE_SENSOR,
),
#[cfg(target_board = "gimlet-d")]
#[cfg(any(target_board = "gimlet-d", target_board = "gimlet-e"))]
TemperatureSensor::new(
Device::M2,
devices::nvme_bmc_m2_a,
Expand All @@ -279,7 +279,7 @@ const INPUTS: [InputChannel; NUM_TEMPERATURE_INPUTS] = [
devices::m2_hp_only_m2_b,
sensors::M2_HP_ONLY_M2_B_TEMPERATURE_SENSOR,
),
#[cfg(target_board = "gimlet-d")]
#[cfg(any(target_board = "gimlet-d", target_board = "gimlet-e"))]
TemperatureSensor::new(
Device::M2,
devices::nvme_bmc_m2_b,
Expand Down
5 changes: 3 additions & 2 deletions task/thermal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
any(
target_board = "gimlet-b",
target_board = "gimlet-c",
target_board = "gimlet-d"
target_board = "gimlet-d",
target_board = "gimlet-e",
),
path = "bsp/gimlet_bcd.rs"
path = "bsp/gimlet_bcde.rs"
)]
#[cfg_attr(
any(target_board = "sidecar-b", target_board = "sidecar-c"),
Expand Down

0 comments on commit 4176179

Please sign in to comment.