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 boolean;
8pub mod boot_log;
9pub mod boot_svc;
10pub mod device_id;
11pub mod helper;
12pub mod rom_error;
13
14#[derive(Debug, Error)]
15pub enum ChipDataError {
16    #[error(transparent)]
17    Io(#[from] std::io::Error),
18    #[error(transparent)]
19    Anyhow(#[from] anyhow::Error),
20    #[error("bad size: expected {0} bytes, but found {1}")]
21    BadSize(usize, usize),
22    #[error("bad slot: {0:x}")]
23    BadSlot(boot_svc::BootSlot),
24    #[error("invalid digest")]
25    InvalidDigest,
26}