Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ hashes are given where a change is easiest to understand by reading the commit.
volume buttons, NetBSD and the PROM).
- Tezro: `[tezro] audio = true` adds an ICE1724 audio controller (off by
default); `[audio] channels` sets its speakers. [Guide](docs/tezro-ip53.md)
- Fuel, Origin 3200 and Onyx 3000: `[machine] audio_card = true` fits the same
ICE1724 audio card (IRIX's "MAD"), so these machines have sound.
- Tezro, Fuel, Origin 3200 and Onyx 3000: IRIX's flushed PIO reads through the
PIC no longer hang the machine; on a Tezro with audio, amesh and other sound
programs froze it with their sound repeating.
Expand Down
5 changes: 3 additions & 2 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,9 @@ The keys in the sections below, down to `[onyx3000]`, and those of
machine has beyond the shared keys. Write them in `[machine]`; a key the
profile does not have is refused. Two are named differently there: `nodes`
(also accepted as `c_bricks`) is the node boards of an Origin 2000 or Onyx2 and
the C-bricks of an Origin 3200 or Onyx 3000, and `audio_card` is the Tezro's
`audio`. The tables named for a machine are the older spelling. They are
the C-bricks of an Origin 3200 or Onyx 3000, and `audio_card` is the `audio`
key of the Tezro, Fuel, Origin 3200 and Onyx 3000 tables, which fits the
ICE1724 audio card. The tables named for a machine are the older spelling. They are
still read, a `[machine]` key wins over the same key there, and a config saved
by iris-gui writes `[machine]`.

Expand Down
3 changes: 2 additions & 1 deletion HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@ prebuf_ms = 20 # sound held before playing: the margin against a la

# What one machine has beyond these keys also goes in [machine] and is described in
# its guide in docs/: for example nodes = 2 (C-bricks or node boards), flash, console,
# usb_input = true (the Fuel's USB keyboard and mouse) and audio_card = true (the Tezro).
# usb_input = true (the Fuel's USB keyboard and mouse) and audio_card = true (the ICE1724
# audio card of the Tezro, Fuel, Origin 3200 and Onyx 3000).
# The older tables named for a machine ([o2], [octane], [origin200], [origin2000],
# [onyx2], [fuel], [tezro], [origin3200], [onyx3000]) are still read.
# [graphics] node and widget say where the graphics board plugs in on the Onyx 3000
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ boots to a usable system: shell, networking, X11, the works.
ISP1040 SCSI, RAD audio
- **Origin 200/2000, Onyx2 IP27:** SN0 NUMA machines; Onyx2 supports InfiniteReality graphics
- **Fuel IP34:** IP35 platform, R14000, IOC3, ISP12160, L1 console, VPro optional,
PS/2 or USB (`[machine] usb_input`) keyboard and mouse
PS/2 or USB (`[machine] usb_input`) keyboard and mouse, optional ICE1724 audio
(`[machine] audio_card`)
- **Tezro IP53:** IP35 platform, up to 4 R16000 CPUs, PIC/PXBOW, IOC4, ISP12160, VPro optional,
ICE1724 audio (`[machine] audio_card`)
- **Origin 3200 / Onyx 3000 IP35:** R12000 C-bricks and Fibre Channel storage;
Onyx 3000 adds InfiniteReality3 or VPro V12 graphics
Onyx 3000 adds InfiniteReality3 or VPro V12 graphics; optional ICE1724 audio
(`[machine] audio_card`)
- R4400, R5000, R10000, R12000, R14000, R16000 CPUs, selected per machine at runtime
- A built-in PROM for every machine (the stock SGI images, packed into the
binary); `prom` names a file to run instead
Expand Down
2 changes: 1 addition & 1 deletion debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ devices are [listed below](#sgi-o2-ip32).
| `rtc debug <on\|off>` | RTC trace **[DEV]** |
| `pit status` / `pit debug <on\|off>` | 8254 timer state / trace **[DEV]** |
| `audio status` | Every sound card's frames moved and skipped (stale, dry, ring full) and its host stream, or `No audio device.` |
| `ice1724 [status]` | Tezro audio (`[tezro] audio`): the interrupt line (high or low, for how long, rises), the interrupt status and mask registers, the engine start, pause and FIFO-error bits, the pending timer, per engine whether it runs, its buffer address, size, position, interrupt interval, frames moved, times its interrupt fired and latched, and when the guest last read its position; frame and converter counts, PCI command and status |
| `ice1724 [status]` | The ICE1724 audio card (`[machine] audio_card`; Tezro, Fuel, Origin 3200, Onyx 3000): the interrupt line (high or low, for how long, rises), the interrupt status and mask registers, the engine start, pause and FIFO-error bits, the pending timer, per engine whether it runs, its buffer address, size, position, interrupt interval, frames moved, times its interrupt fired and latched, and when the guest last read its position; frame and converter counts, PCI command and status |
| `ice1724 regs` | Hex dump of the controller (CCS, BAR0) and multi-channel (MT, BAR1) registers |
| `ice1724 log [n]` | The guest's last 64 (or n) register accesses, oldest first, with their age on the card clock; a run of the same access with the same value is one line with a count |
| `ice1724 clear` | Start the counts and the access log again |
Expand Down
8 changes: 8 additions & 0 deletions docs/fuel-ip34.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ selects the boot-flash backing file, the console (`l1`, `ioc3_a` or
`ioc3_b`) and the L1's TCP port and log; [FEATURES.md](../FEATURES.md#fuel)
lists its keys.

`[machine] audio_card = true` fits an audio card: the IC Ensemble ICE1724 with
the DMediaPro DM8's converters, the same model as the
[Tezro's](tezro-ip53.md). It sits at device 2 of head F, beside the base I/O;
which device a real Fuel's option slots are is not established, so the slot is
the model's choice. IRIX 6.5.30 lists it as `Iris Audio Processor: version MAD
revision 1` and plays through it. It plays to the host as `[audio]` sets, or
silently with `no_audio`.

`prom` overrides the built-in PROM; a file it names must load, and
`prom = "(embedded)"` selects the built-in one outright. The PROM decoder
accepts a raw payload or a supported version-six, single-segment stored or
Expand Down
4 changes: 4 additions & 0 deletions docs/onyx3000-ip35.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ shipped; the Onyx 3000 takes `ir3`. The shared keys, the `[machine]` keys of the
adapter and the console. `[machine] cpus` fits 1, 2 or 4 processors on each
C-brick, so a two-brick machine runs up to eight.

`[machine] audio_card = true` fits the ICE1724 audio card in the I-brick, as
[on the Origin 3200](origin3200-ip35.md#the-i-brick). IRIX 6.5.30 lists it as
`Iris Audio Processor: version MAD revision 1` and plays through it.

`[graphics] node` and `widget` override the placement. `node` is the C-brick
(0 or 1) whose XIO link reaches the board. On node 0, whose connector has the
I-brick, the board is at the I-brick's port B, widget 11. On node 1 the board
Expand Down
8 changes: 8 additions & 0 deletions docs/origin3200-ip35.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ disks, and its slot runs 64-bit data phases (inferred from the PROM's behaviour:
the control block and rings it builds are right only if the bridge reverses
each doubleword of the adapter's DMA). A `[scsi.N]` table is refused.

`[machine] audio_card = true` fits an audio card at device 2 of head F: the IC
Ensemble ICE1724 with the DMediaPro DM8's converters, the same model as the
[Tezro's](tezro-ip53.md). The device number is the model's choice; which
devices the I-brick's option slots are is not established. On an Onyx 3000,
IRIX 6.5.30 lists it as `Iris Audio Processor: version MAD revision 1` and
plays through it; it has not been run in an Origin 3200 guest. It plays to the
host as `[audio]` sets, or silently with `no_audio`.

## Nodes and the link

Address bits 39:33 name a node. Each node's local block holds the number the PROM
Expand Down
3 changes: 3 additions & 0 deletions fuel.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ cpu = "r14000"
flash = "ignore/fuel/flash.bin"
console = "l1"
l1_port = 18882
# Fit the ICE1724 audio card in a PCI slot (default false). It plays as [audio]
# sets; unset no_audio for sound.
# audio_card = true
# Send the host's keyboard and mouse (from the window or VNC) to a USB keyboard
# and mouse on the OHCI controller instead of the PS/2 pair (docs/fuel-ip34.md).
# usb_input = true
Expand Down
3 changes: 3 additions & 0 deletions iris-gui/src/extra_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ fn platform(ui: &mut Ui, cfg: &mut MachineConfig) {
text(ui, &t!("extra-l1-log"), &mut s.l1_log);
text(ui, &t!("extra-l1-revision"), &mut s.l1_revision);
text(ui, &t!("extra-brick-serial"), &mut s.brick_serial);
ui.checkbox(&mut s.audio, t!("extra-tezro-audio"));
ui.checkbox(&mut s.ps2_input, t!("extra-ps2"));
ui.checkbox(&mut s.usb_input, t!("extra-usb-input"));
}
Expand Down Expand Up @@ -381,6 +382,7 @@ fn platform(ui: &mut Ui, cfg: &mut MachineConfig) {
text(ui, &t!("extra-l1-log"), &mut s.l1_log);
text(ui, &t!("extra-l1-revision"), &mut s.l1_revision);
text(ui, &t!("extra-brick-serial"), &mut s.brick_serial);
ui.checkbox(&mut s.audio, t!("extra-tezro-audio"));
}
MachineProfile::Onyx3000Ip35 => {
let mut count = cfg.c_bricks() as u8;
Expand All @@ -407,6 +409,7 @@ fn platform(ui: &mut Ui, cfg: &mut MachineConfig) {
text(ui, &t!("extra-l1-log"), &mut s.l1_log);
text(ui, &t!("extra-l1-revision"), &mut s.l1_revision);
text(ui, &t!("extra-brick-serial"), &mut s.brick_serial);
ui.checkbox(&mut s.audio, t!("extra-tezro-audio"));
}
_ => (),
}
Expand Down
3 changes: 3 additions & 0 deletions origin3200.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ profile = "origin3200_ip35"
nodes = 2
console = "l1"
l1_port = 18882
# Fit the ICE1724 audio card in an I-brick PCI slot (default false). It plays as [audio]
# sets; unset no_audio for sound.
# audio_card = true

[graphics]
board = "none"
Expand Down
45 changes: 42 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ pub struct MachineSection {
pub serial_port_c: Option<u16>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub serial_port_d: Option<u16>,
/// Tezro: fit the audio card (`[tezro] audio`).
/// Tezro, Fuel, Origin 3200, Onyx 3000: fit the ICE1724 audio card.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub audio_card: Option<bool>,
/// Fuel: which keyboard and mouse the host's reach.
Expand Down Expand Up @@ -2357,6 +2357,9 @@ pub struct FuelSection {
/// the marked synthetic `EMUN00`.
#[serde(default)]
pub brick_serial: Option<String>,
/// Fit the audio card (IC Ensemble ICE1724) in a PCI slot. Off by default.
#[serde(default)]
pub audio: bool,
}

fn default_fuel_input() -> bool { true }
Expand All @@ -2372,6 +2375,7 @@ impl Default for FuelSection {
usb_input: false,
l1_revision: None,
brick_serial: None,
audio: false,
}
}
}
Expand All @@ -2387,6 +2391,7 @@ impl FuelSection {
&& !self.usb_input
&& self.l1_revision.is_none()
&& self.brick_serial.is_none()
&& !self.audio
}
}

Expand Down Expand Up @@ -2439,6 +2444,10 @@ pub struct Ip35Section {
/// bytes. Unset: the marked synthetic `EMUN00`.
#[serde(default)]
pub brick_serial: Option<String>,
/// Fit the audio card (IC Ensemble ICE1724) in an I-brick PCI slot. Off
/// by default.
#[serde(default)]
pub audio: bool,
}

impl Default for Ip35Section {
Expand All @@ -2451,6 +2460,7 @@ impl Default for Ip35Section {
l1_log: None,
l1_revision: None,
brick_serial: None,
audio: false,
}
}
}
Expand All @@ -2465,6 +2475,7 @@ impl Ip35Section {
&& self.l1_log.is_none()
&& self.l1_revision.is_none()
&& self.brick_serial.is_none()
&& !self.audio
}
}

Expand Down Expand Up @@ -3473,8 +3484,14 @@ impl MachineConfig {
self.tezro.serial_port_d = Some(port);
}
if let Some(card) = self.machine.audio_card.take() {
if !tezro { return Err(not_here("audio_card")); }
self.tezro.audio = card;
let slot = match p {
P::TezroIp53 => &mut self.tezro.audio,
P::FuelIp34 => &mut self.fuel.audio,
P::Origin3200Ip35 => &mut self.origin3200.audio,
P::Onyx3000Ip35 => &mut self.onyx3000.audio,
_ => return Err(not_here("audio_card")),
};
*slot = card;
}
let fuel = p == P::FuelIp34;
if let Some(on) = self.machine.ps2_input.take() {
Expand Down Expand Up @@ -3557,6 +3574,7 @@ impl MachineConfig {
m.usb_input = fuel.usb_input.then_some(true);
m.l1_revision = fuel.l1_revision;
m.brick_serial = fuel.brick_serial;
m.audio_card = fuel.audio.then_some(true);
}
P::TezroIp53 => {
let tezro = std::mem::take(&mut out.tezro);
Expand All @@ -3577,6 +3595,7 @@ impl MachineConfig {
m.l1_log = section.l1_log;
m.l1_revision = section.l1_revision;
m.brick_serial = section.brick_serial;
m.audio_card = section.audio.then_some(true);
}
_ => {}
}
Expand Down Expand Up @@ -3795,6 +3814,17 @@ impl MachineConfig {
}

/// The section that configures an IP35 brick machine: `[origin3200]` or `[onyx3000]`.
/// Whether the ICE1724 audio card is fitted (`[machine] audio_card`), on
/// the machines that take one.
pub fn audio_card(&self) -> bool {
match self.machine.profile {
MachineProfile::TezroIp53 => self.tezro.audio,
MachineProfile::FuelIp34 => self.fuel.audio,
MachineProfile::Origin3200Ip35 | MachineProfile::Onyx3000Ip35 => self.ip35_section().audio,
_ => false,
}
}

pub fn ip35_section(&self) -> &Ip35Section {
if self.machine.profile == MachineProfile::Onyx3000Ip35 { &self.onyx3000 } else { &self.origin3200 }
}
Expand Down Expand Up @@ -5654,6 +5684,15 @@ mod export_tests {
assert_eq!((tezro.tezro.console, tezro.tezro.serial_port_c, tezro.tezro.audio), (TezroConsole::Ioc4C, Some(9003), true));
let text = toml::to_string_pretty(&tezro.for_writing()).unwrap();
assert!(text.contains("audio_card = true") && !text.contains("[tezro]"), "{text}");
// The Fuel, Origin 3200 and Onyx 3000 take the same card; no other machine does.
for (profile, cpu) in [("fuel_ip34", "r14000"), ("origin3200_ip35", "r12000"), ("onyx3000_ip35", "r12000")] {
let cfg = load(&format!("[machine]\nprofile = \"{profile}\"\ncpu = \"{cpu}\"\naudio_card = true\n")).unwrap();
assert!(cfg.audio_card(), "{profile}");
let text = toml::to_string_pretty(&cfg.for_writing()).unwrap();
assert!(text.contains("audio_card = true"), "{profile}: {text}");
assert!(MachineConfig::parse_toml(&text).unwrap().audio_card(), "{profile}");
}
assert!(load("[machine]\nprofile = \"octane_ip30\"\naudio_card = true\n").unwrap_err().contains("machine.audio_card is not a key"));

let onyx2 = load("[machine]\nprofile = \"onyx2_ip27\"\nnodes = 2\nio_prom = \"io6prom.img\"\n").unwrap();
assert_eq!((onyx2.node_boards(), onyx2.onyx2.io_prom.as_deref()), (2, Some("io6prom.img")));
Expand Down
5 changes: 3 additions & 2 deletions src/ip34_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::dev::odyssey::Odyssey;
use crate::dev::timekeeper::Timekeeper;
use crate::dev::xbridge::{XBridge, HEAD_F};
use crate::hptimer::TimerManager;
use crate::ip35::{attach_ioc3, attach_usb, attach_vpro, xbridge_on};
use crate::ip35::{attach_ioc3, attach_usb, attach_vpro, fit_audio_card, xbridge_on};
use crate::ip35::node::NodeSpec;
use crate::ip35::serial::connect_serial_ports;
use crate::sn::BoardIo;
Expand Down Expand Up @@ -60,7 +60,7 @@ pub(crate) fn node_specs(cfg: &MachineConfig) -> Result<Vec<NodeSpec>, String> {
}

/// The Fuel's I/O around its node: the XBridge, the VPro in the graphics slot, and the base I/O.
pub(crate) fn build_io(cfg: &MachineConfig, nodes: &[NodeBoard<Bedrock, Flash>], l1s: &[Arc<L1>], _: &Arc<TimerManager>, clock: &Clock) -> Result<BoardIo, String> {
pub(crate) fn build_io(cfg: &MachineConfig, nodes: &[NodeBoard<Bedrock, Flash>], l1s: &[Arc<L1>], timers: &Arc<TimerManager>, clock: &Clock) -> Result<BoardIo, String> {
let bedrock = &nodes[0].chip;
let xbridge = xbridge_on(bedrock);
// The status bar's activity bits, shared with the base I/O's devices.
Expand All @@ -75,6 +75,7 @@ pub(crate) fn build_io(cfg: &MachineConfig, nodes: &[NodeBoard<Bedrock, Flash>],
let mut io = build_baseio(cfg, &l1s[0], &xbridge, clock, heartbeat, vpro.clone())?;
io.status = Some(status);
io.fasttick = Some(fasttick);
fit_audio_card(cfg, xbridge.bus(HEAD_F), timers, &mut io);
if let Some(vpro) = vpro {
io.display = Some(vpro.display());
io.monitor.push(vpro.clone());
Expand Down
19 changes: 19 additions & 0 deletions src/ip34_machine/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,25 @@ fn the_fuel_plugs_a_usb_keyboard_and_mouse_only_when_configured_on() {
assert_eq!(status.map(|s| s & 1), [0, 0], "nothing plugged in");
assert!(mouse, "without the USB pair the PS/2 mouse does");
}
/// `[machine] audio_card` fits the ICE1724 at device 2 of head F, its two I/O BARs reachable once
/// placed; without it the slot is empty.
#[test]
fn the_fuel_takes_the_audio_card_at_device_2() {
let dir = TempPath::dir("fuel-audio");
let slot = |audio| {
let mut cfg = fuel_config(&dir);
cfg.fuel.audio = audio;
cfg.no_audio = true;
with_machine(cfg, |m| {
let read = m.nodes[0].chip.pio().read32(pio_widget(15, 0x2_0000 + (u64::from(crate::ip35::AUDIO_CARD_DEVICE) << 12)));
((read.status == BUS_OK).then_some(read.data), m.io.monitor.iter().any(|d| d.audio_report().is_some()))
})
};
assert_eq!(slot(true), (Some(0x1724_1412), true));
let (id, report) = slot(false);
assert!(id.is_none_or(|id| id == u32::MAX) && !report, "empty without the key");
}

/// A Fuel with `graphics` in its graphics slot.
fn fuel_with_graphics(dir: &TempPath, graphics: crate::config::GraphicsBoard) -> crate::config::MachineConfig {
let mut cfg = fuel_config(dir);
Expand Down
43 changes: 43 additions & 0 deletions src/ip35.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

use crate::dev::bedrock::{Bedrock, RamExtent};
use crate::dev::heart::Clock;
use crate::dev::ice1724::{Ice1724, Variant};
use crate::dev::ioc3::{ByteBus, Ioc3, Ioc3Board};
use crate::dev::odyssey::Odyssey;
use crate::dev::ohci::hid::{HidFunction, UsbHidInput};
Expand Down Expand Up @@ -153,6 +154,48 @@ pub(crate) fn attach_usb(pci: &PciBus, ioc3: &Ioc3, clock: &Clock, input: bool)
Ok(usb)
}

/// Said at startup and by `--validate` when the audio card is added with
/// `no_audio` set: the guest sees the card and nothing is played.
pub(crate) const AUDIO_WITH_NO_AUDIO: &str =
"machine.audio_card is set but no_audio is too: the audio card is added and plays to nowhere";

/// The audio card's device on head F of a Fuel's or an I-brick's XBridge. A model choice: the
/// base I/O holds 1, 4, 5 and (unmodelled, I-brick) 6, and which devices the option slots are
/// is not established.
pub(crate) const AUDIO_CARD_DEVICE: u8 = 2;

/// The ICE1724 audio card as `[machine] audio_card` fits it, playing to the host as `[audio]`
/// sets unless `no_audio`. The board attaches it to a bus.
pub(crate) fn audio_card(cfg: &MachineConfig, timers: &Arc<TimerManager>) -> Arc<Ice1724> {
let card = Arc::new(Ice1724::new(Variant::Dm8));
if cfg.no_audio {
eprintln!("iris: {AUDIO_WITH_NO_AUDIO}");
} else {
card.enable_output(cfg.audio.clone());
}
card.set_timer_manager(timers.clone());
card
}

/// The audio card in its slot of `pci` (head F of the base I/O's XBridge) when `[machine]
/// audio_card` asks for it, added to the board's devices, monitor and reset.
pub(crate) fn fit_audio_card(cfg: &MachineConfig, pci: &PciBus, timers: &Arc<TimerManager>, io: &mut BoardIo) {
if !cfg.audio_card() {
return;
}
let card = audio_card(cfg, timers);
pci.attach(DevFn { device: AUDIO_CARD_DEVICE, function: 0 }, card.clone());
card.register_locks();
eprintln!("iris: ICE1724 audio card at PCI device {AUDIO_CARD_DEVICE} of the base I/O");
io.monitor.push(card.clone());
io.devices.push(card.clone());
let base_reset = std::mem::replace(&mut io.reset, Box::new(|| {}));
io.reset = Box::new(move || {
base_reset();
card.reset();
});
}

/// A VPro at crossbar `widget` of `bedrock`'s node: its DMA enters Bedrock as that widget's inbound
/// traffic and its interrupt packets leave by `packets`. `attach` puts it behind the board's crossbar and returns what the
/// node's I/O space reaches it by.
Expand Down
Loading