opentitanlib/chip/
mod.rs

1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5use thiserror::Error;
6
7pub mod alert;
8pub mod autogen;
9pub mod boolean;
10pub mod boot_log;
11pub mod boot_svc;
12pub mod device_id;
13pub mod helper;
14pub mod rom_error;
15
16#[derive(Debug, Error)]
17pub enum ChipDataError {
18    #[error(transparent)]
19    Io(#[from] std::io::Error),
20    #[error(transparent)]
21    Anyhow(#[from] anyhow::Error),
22    #[error("bad size: expected {0} bytes, but found {1}")]
23    BadSize(usize, usize),
24    #[error("bad slot: {0:x}")]
25    BadSlot(boot_svc::BootSlot),
26    #[error("invalid digest")]
27    InvalidDigest,
28}