Skip to content

Commit

Permalink
Rename UartSend and UartRecv to ConsoleSend and ConsoleRecv
Browse files Browse the repository at this point in the history
This change reflects the expanded functionality beyond UART devices. The
new names are more generic, indicating their use for console
communication regardless of the underlying peripheral.

Signed-off-by: Anthony Chen <antchen@google.com>
  • Loading branch information
anthonychen1251 authored and timothytrippel committed Aug 26, 2024
1 parent 9095751 commit 4674f62
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion sw/host/opentitanlib/src/test_utils/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::time::Duration;

use crate::io::uart::Uart;
use crate::test_utils::e2e_command::TestCommand;
use crate::test_utils::rpc::{UartRecv, UartSend};
use crate::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use crate::test_utils::status::Status;

// Bring in the auto-generated sources.
Expand Down
2 changes: 1 addition & 1 deletion sw/host/opentitanlib/src/test_utils/i2c_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::time::Duration;

use crate::io::uart::Uart;
use crate::test_utils::e2e_command::TestCommand;
use crate::test_utils::rpc::{UartRecv, UartSend};
use crate::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use crate::test_utils::status::Status;

// Bring in the auto-generated sources.
Expand Down
2 changes: 1 addition & 1 deletion sw/host/opentitanlib/src/test_utils/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::time::Duration;

use crate::io::uart::Uart;
use crate::test_utils::e2e_command::TestCommand;
use crate::test_utils::rpc::{UartRecv, UartSend};
use crate::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use crate::test_utils::status::Status;

// Bring in the auto-generated sources.
Expand Down
2 changes: 1 addition & 1 deletion sw/host/opentitanlib/src/test_utils/pinmux_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::time::Duration;
use crate::chip::autogen::earlgrey::{PinmuxInsel, PinmuxMioOut, PinmuxOutsel, PinmuxPeripheralIn};
use crate::io::uart::Uart;
use crate::test_utils::e2e_command::TestCommand;
use crate::test_utils::rpc::{UartRecv, UartSend};
use crate::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use crate::test_utils::status::Status;

// Bring in the auto-generated sources.
Expand Down
8 changes: 4 additions & 4 deletions sw/host/opentitanlib/src/test_utils/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ use crate::uart::console::{ExitStatus, UartConsole};
// Bring in the auto-generated sources.
include!(env!("ottf"));

pub trait UartSend<T>
pub trait ConsoleSend<T>
where
T: ConsoleDevice + ?Sized,
{
fn send(&self, device: &T) -> Result<()>;
fn send_with_crc(&self, device: &T) -> Result<()>;
}

impl<T, U> UartSend<T> for U
impl<T, U> ConsoleSend<T> for U
where
T: ConsoleDevice + ?Sized,
U: Serialize,
Expand All @@ -47,7 +47,7 @@ where
}
}

pub trait UartRecv<T>
pub trait ConsoleRecv<T>
where
T: ConsoleDevice + ?Sized,
{
Expand All @@ -56,7 +56,7 @@ where
Self: Sized;
}

impl<T, U> UartRecv<T> for U
impl<T, U> ConsoleRecv<T> for U
where
T: ConsoleDevice + ?Sized,
U: DeserializeOwned,
Expand Down
2 changes: 1 addition & 1 deletion sw/host/opentitanlib/src/test_utils/spi_passthru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::time::Duration;

use crate::io::uart::Uart;
use crate::test_utils::e2e_command::TestCommand;
use crate::test_utils::rpc::{UartRecv, UartSend};
use crate::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use crate::test_utils::status::Status;

// Bring in the auto-generated sources.
Expand Down
2 changes: 1 addition & 1 deletion sw/host/provisioning/cp_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use opentitanlib::test_utils::lc_transition::trigger_lc_transition;
use opentitanlib::test_utils::load_sram_program::{
ExecutionMode, ExecutionResult, SramProgramParams,
};
use opentitanlib::test_utils::rpc::UartSend;
use opentitanlib::test_utils::rpc::ConsoleSend;
use opentitanlib::uart::console::UartConsole;
use ujson_lib::provisioning_data::ManufCpProvisioningData;

Expand Down
2 changes: 1 addition & 1 deletion sw/host/provisioning/ft_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use opentitanlib::test_utils::lc_transition::trigger_lc_transition;
use opentitanlib::test_utils::load_sram_program::{
ExecutionMode, ExecutionResult, SramProgramParams,
};
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;
use ot_certs::x509::parse_certificate;
use perso_tlv_lib::perso_tlv_get_field;
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/chip/i2c_target/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use opentitanlib::test_utils;
use opentitanlib::test_utils::e2e_command::TestCommand;
use opentitanlib::test_utils::i2c_target::{I2cTargetAddress, I2cTestConfig, I2cTransferStart};
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::test_utils::status::Status;
use opentitanlib::uart::console::UartConsole;
use std::borrow::Borrow;
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/aes_nist_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use cryptotest_commands::commands::CryptotestCommand;
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;

#[derive(Debug, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/drbg_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use cryptotest_commands::drbg_commands::{CryptotestDrbgInput, CryptotestDrbgOutp
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;

#[derive(Debug, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/ecdh_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use cryptotest_commands::ecdh_commands::{
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;
use p256::elliptic_curve::scalar::ScalarPrimitive as ScalarPrimitiveP256;
use p256::U256;
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/ecdsa_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use cryptotest_commands::ecdsa_commands::{
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;

#[derive(Debug, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/hash_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use cryptotest_commands::hash_commands::{
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;

#[derive(Debug, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/hmac_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use cryptotest_commands::hmac_commands::{
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;

#[derive(Debug, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/kmac_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use cryptotest_commands::kmac_commands::{
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;

#[derive(Debug, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/crypto/sphincsplus_kat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use cryptotest_commands::sphincsplus_commands::{
use opentitanlib::app::TransportWrapper;
use opentitanlib::execute_test;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;

#[derive(Debug, Parser)]
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/manuf/cp_provision_functest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use opentitanlib::test_utils::lc_transition;
use opentitanlib::test_utils::load_sram_program::{
ExecutionMode, ExecutionResult, SramProgramParams,
};
use opentitanlib::test_utils::rpc::UartSend;
use opentitanlib::test_utils::rpc::ConsoleSend;
use opentitanlib::uart::console::UartConsole;
use ujson_lib::provisioning_data::ManufCpProvisioningData;
use util_lib::hash_lc_token;
Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/manuf/personalize_functest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use opentitanlib::io::jtag::JtagTap;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::lc::read_lc_state;
use opentitanlib::test_utils::lc_transition::trigger_lc_transition;
use opentitanlib::test_utils::rpc::UartSend;
use opentitanlib::test_utils::rpc::ConsoleSend;
use opentitanlib::uart::console::UartConsole;
use util_lib::hash_lc_token;

Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/rom/e2e_chip_specific_startup/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use opentitanlib::test_utils::e2e_command::TestCommand;
use opentitanlib::test_utils::epmp::constants::*;
use opentitanlib::test_utils::epmp::{Epmp, EpmpAddressRange, EpmpEntry, EpmpRegionKind};
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::uart::console::UartConsole;
use std::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion sw/host/tests/rom/sw_strap_value/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use opentitanlib::execute_test;
use opentitanlib::io::gpio::{PinMode, PullMode};
use opentitanlib::test_utils::e2e_command::TestCommand;
use opentitanlib::test_utils::init::InitializeTest;
use opentitanlib::test_utils::rpc::{UartRecv, UartSend};
use opentitanlib::test_utils::rpc::{ConsoleRecv, ConsoleSend};
use opentitanlib::test_utils::status::Status;
use opentitanlib::uart::console::UartConsole;
use std::time::Duration;
Expand Down

0 comments on commit 4674f62

Please sign in to comment.