diff --git a/scripts/ectool.sh b/scripts/ectool.sh index d3692ff..270fb64 100755 --- a/scripts/ectool.sh +++ b/scripts/ectool.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: GPL-3.0-only set -e cargo build --release --manifest-path tool/Cargo.toml diff --git a/scripts/power.sh b/scripts/power.sh index db54a2f..970d588 100755 --- a/scripts/power.sh +++ b/scripts/power.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: GPL-3.0-only set -e diff --git a/src/board/system76/common/keymap.c b/src/board/system76/common/keymap.c index 0111d63..91196df 100644 --- a/src/board/system76/common/keymap.c +++ b/src/board/system76/common/keymap.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-3.0-only + #include #include diff --git a/tool/src/access/hid.rs b/tool/src/access/hid.rs index cdacd99..f48944b 100644 --- a/tool/src/access/hid.rs +++ b/tool/src/access/hid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use hidapi::HidDevice; use crate::{ diff --git a/tool/src/access/lpc/direct.rs b/tool/src/access/lpc/direct.rs index c474bdc..363f172 100644 --- a/tool/src/access/lpc/direct.rs +++ b/tool/src/access/lpc/direct.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use hwio::{Io, Pio}; use crate::{ diff --git a/tool/src/access/lpc/linux.rs b/tool/src/access/lpc/linux.rs index 18ea379..ce01302 100644 --- a/tool/src/access/lpc/linux.rs +++ b/tool/src/access/lpc/linux.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use std::{ fs, io::{ diff --git a/tool/src/access/lpc/mod.rs b/tool/src/access/lpc/mod.rs index 6668de8..dd7eed5 100644 --- a/tool/src/access/lpc/mod.rs +++ b/tool/src/access/lpc/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + const SMFI_CMD_BASE: u16 = 0xE00; const SMFI_CMD_SIZE: usize = 0x100; diff --git a/tool/src/access/lpc/sim.rs b/tool/src/access/lpc/sim.rs index 307b93f..4998ba4 100644 --- a/tool/src/access/lpc/sim.rs +++ b/tool/src/access/lpc/sim.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use std::{ io, net::UdpSocket, @@ -40,7 +42,7 @@ impl AccessLpcSim { "Socket request incorrect size" )); } - + let mut response = [0]; if self.socket.recv(&mut response)? != response.len() { return Err(io::Error::new( @@ -48,14 +50,14 @@ impl AccessLpcSim { "Socket response incorrect size" )); } - + Ok(response[0]) } - + pub fn inb(&mut self, addr: u16) -> Result { Ok(self.transaction(0x01, addr, 0)?) } - + pub fn outb(&mut self, addr: u16, value: u8) -> Result<(), Error> { self.transaction(0x02, addr, value)?; Ok(()) diff --git a/tool/src/access/mod.rs b/tool/src/access/mod.rs index be12207..cf5b583 100644 --- a/tool/src/access/mod.rs +++ b/tool/src/access/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use crate::Error; use downcast_rs::Downcast; diff --git a/tool/src/ec.rs b/tool/src/ec.rs index f22a2f4..ab82d0b 100644 --- a/tool/src/ec.rs +++ b/tool/src/ec.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + #[cfg(not(feature = "std"))] use alloc::{ boxed::Box, diff --git a/tool/src/error.rs b/tool/src/error.rs index 2b03e25..1a63836 100644 --- a/tool/src/error.rs +++ b/tool/src/error.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + /// Errors returned by operations #[derive(Debug)] pub enum Error { diff --git a/tool/src/firmware.rs b/tool/src/firmware.rs index ba5c28c..e0e674f 100644 --- a/tool/src/firmware.rs +++ b/tool/src/firmware.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + /// Parses firmware information from a firmware ROM pub struct Firmware<'a> { pub board: &'a [u8], diff --git a/tool/src/legacy.rs b/tool/src/legacy.rs index ed6cb8c..bc698bc 100644 --- a/tool/src/legacy.rs +++ b/tool/src/legacy.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use crate::{ Error, Pmc, diff --git a/tool/src/lib.rs b/tool/src/lib.rs index 1761c7e..a3794cd 100644 --- a/tool/src/lib.rs +++ b/tool/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + //! Library for accessing System76 ECs //! First, construct an access method, using an object implementing the `Access` trait. Next, an Ec //! object can be contructed, which exposes the command interface. diff --git a/tool/src/main.rs b/tool/src/main.rs index 16cf62c..4e7b9c2 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use clap::{Arg, App, AppSettings, SubCommand}; use ectool::{ Access, diff --git a/tool/src/pmc.rs b/tool/src/pmc.rs index 880e401..6ebbc63 100644 --- a/tool/src/pmc.rs +++ b/tool/src/pmc.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use hwio::{Io, Pio}; use crate::{ diff --git a/tool/src/spi.rs b/tool/src/spi.rs index 5dfa15a..c109e8b 100644 --- a/tool/src/spi.rs +++ b/tool/src/spi.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use crate::{ Error, Timeout, diff --git a/tool/src/super_io.rs b/tool/src/super_io.rs index aa441be..56e333d 100644 --- a/tool/src/super_io.rs +++ b/tool/src/super_io.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + use hwio::{Io, Pio}; /// Super I/O interface provided by LPC ECs diff --git a/tool/src/timeout.rs b/tool/src/timeout.rs index 48e8663..5ee7919 100644 --- a/tool/src/timeout.rs +++ b/tool/src/timeout.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + #[cfg(feature = "std")] use std::time::{Duration, Instant};