lowrisc/registers/
rom_ctrl_regs.rs

1// Licensed under the Apache License, Version 2.0 or the MIT License.
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3// Copyright lowRISC contributors 2023.
4
5// Generated register constants for rom_ctrl.
6// Built for Earlgrey-M2.5.1-RC1-493-gedf5e35f5d
7// https://github.com/lowRISC/opentitan/tree/edf5e35f5d50a5377641c90a315109a351de7635
8// Tree status: clean
9// Build date: 2023-10-18T10:11:37
10
11// Original reference file: hw/ip/rom_ctrl/data/rom_ctrl.hjson
12use kernel::utilities::registers::ReadWrite;
13use kernel::utilities::registers::{register_bitfields, register_structs};
14/// Number of alerts
15pub const ROM_CTRL_PARAM_NUM_ALERTS: u32 = 1;
16/// Register width
17pub const ROM_CTRL_PARAM_REG_WIDTH: u32 = 32;
18
19register_structs! {
20    pub RomCtrlRegisters {
21        /// Alert Test Register
22        (0x0000 => pub(crate) alert_test: ReadWrite<u32, ALERT_TEST::Register>),
23        /// The cause of a fatal alert.
24        (0x0004 => pub(crate) fatal_alert_cause: ReadWrite<u32, FATAL_ALERT_CAUSE::Register>),
25        /// The digest computed from the contents of ROM
26        (0x0008 => pub(crate) digest: [ReadWrite<u32, DIGEST::Register>; 8]),
27        /// The expected digest, stored in the top words of ROM
28        (0x0028 => pub(crate) exp_digest: [ReadWrite<u32, EXP_DIGEST::Register>; 8]),
29        (0x0048 => @END),
30    }
31}
32
33register_bitfields![u32,
34    pub(crate) ALERT_TEST [
35        FATAL OFFSET(0) NUMBITS(1) [],
36    ],
37    pub(crate) FATAL_ALERT_CAUSE [
38        CHECKER_ERROR OFFSET(0) NUMBITS(1) [],
39        INTEGRITY_ERROR OFFSET(1) NUMBITS(1) [],
40    ],
41    pub(crate) DIGEST [
42        DIGEST_0 OFFSET(0) NUMBITS(32) [],
43    ],
44    pub(crate) EXP_DIGEST [
45        DIGEST_0 OFFSET(0) NUMBITS(32) [],
46    ],
47];
48
49// End generated register constants for rom_ctrl