Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions framework_lib/src/commandline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,11 @@ Options:
--autofanctrl [<FANID>]Turn on automatic fan speed control (optionally provide fan index)
--pdports Show information about USB-C PD ports
--info Show info from SMBIOS (Only on UEFI)
--meinfo [<DUMPFILE>] Show Intel ME information (from SMBIOS type 0xDB)
--pd-info Show details about the PD controllers
--pd-reset <PD_NUM> Reset a specific PD controller (for debugging only)
--pd-disable <PD_NUM> Disable all ports on a specific PD controller (for debugging only)
--pd-enable <PD_NUM> Enable all ports on a specific PD controller (for debugging only)
--privacy Show privacy switch statuses (camera and microphone)
--pd-bin <PD_BIN> Parse versions from PD firmware binary file
--ec-bin <EC_BIN> Parse versions from EC firmware binary file
Expand All @@ -1838,24 +1842,44 @@ Options:
--flash-ro-ec <FLASH_EC> Flash EC with new firmware from file
--flash-rw-ec <FLASH_EC> Flash EC with new firmware from file
--reboot-ec Control EC RO/RW jump [possible values: reboot, jump-ro, jump-rw, cancel-jump, disable-jump]
--ec-hib-delay [<SECONDS>] Get or set EC hibernate delay (S5 to G3)
--uptimeinfo Show EC uptime information
--s0ix-counter Show S0ix counter
--intrusion Show status of intrusion switch
--inputdeck Show status of the input deck
--inputdeck-mode Set input deck power mode [possible values: auto, off, on] (Framework 16 only)
--expansion-bay Show status of the expansion bay (Framework 16 only)
--nvidia Show NVIDIA GPU information (Framework 16 only)
--charge-limit [<VAL>] Get or set battery charge limit (Percentage number as arg, e.g. '100')
--charge-current-limit [<VAL>] Get or set battery current charge limit (Percentage number as arg, e.g. '100')
--charge-rate-limit [<VAL>] Set max charge rate limit
--get-gpio <GET_GPIO> Get GPIO value by name or all, if no name provided
--fp-led-level [<VAL>] Get or set fingerprint LED brightness level [possible values: high, medium, low]
--fp-brightness [<VAL>]Get or set fingerprint LED brightness percentage
--kblight [<KBLIGHT>] Set keyboard backlight percentage or get, if no value provided
--remap-key <ROW> <COL> <SCANCODE>
Remap a key by changing the scancode
--rgbkbd <START> <HEXCOLOR> [<HEXCOLOR> ...]
Set the color of a key to RGB. Multiple colors for adjacent keys can be set at once
--tablet-mode <MODE> Set tablet mode override [possible values: auto, tablet, laptop]
--console <CONSOLE> Get EC console, choose whether recent or to follow the output [possible values: recent, follow]
--hash <HASH> Hash a file of arbitrary data
--flash-gpu-descriptor <MAGIC> <18 DIGIT SN> Overwrite the GPU bay descriptor SN and type.
--flash-gpu-descriptor-file <DESCRIPTOR_FILE> Write the GPU bay descriptor with a descriptor file.
--dump-gpu-descriptor-file <DESCRIPTOR_FILE> Dump the GPU bay descriptor to a file
-f, --force Force execution of an unsafe command - may render your hardware unbootable!
--dry-run Simulate execution of a command (e.g. --flash-ec)
--pd-addrs <PD_ADDR_LEFT> <PD_ADDR_RIGHT> <PD_ADDR_BACK>
Specify I2C addresses of the PD chips (Advanced)
--pd-ports <PD_PORT_LEFT> <PD_PORT_RIGHT> <PD_PORT_BACK>
Specify I2C ports of the PD chips (Advanced)
--has-mec <HAS_MEC>
Specify the type of EC chip (MEC/MCHP or other) [possible values: true, false]
--host-command <CMD_ID> <VERSION> [DATA...]
Send an EC host command
-t, --test Run self-test to check if interaction with EC is possible
--test-retimer Run self-test to check if interaction with retimers is possible
--boardid Print all board IDs
-h, --help Print help information
-b Print output one screen at a time
"#
Expand Down
32 changes: 24 additions & 8 deletions framework_lib/src/commandline/uefi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pub fn parse(args: &[String]) -> Cli {
None
};
found_an_option = true;
} else if arg == "--autofanctrol" {
} else if arg == "--autofanctrl" {
cli.autofanctrl = if args.len() > i + 1 {
if let Ok(fan_id) = args[i + 1].parse::<u8>() {
Some(Some(fan_id))
Expand Down Expand Up @@ -363,6 +363,20 @@ pub fn parse(args: &[String]) -> Cli {
Some(None)
};
found_an_option = true;
} else if arg == "--remap-key" {
if args.len() > i + 3 {
let row = parse_hex_or_dec_u8(&args[i + 1]);
let col = parse_hex_or_dec_u8(&args[i + 2]);
let scancode = parse_hex_or_dec_u16(&args[i + 3]);
if let (Some(row), Some(col), Some(scancode)) = (row, col, scancode) {
cli.remap_key = Some((row, col, scancode));
} else {
println!("Invalid values for --remap-key. Must be: <ROW> <COL> <SCANCODE>");
}
} else {
println!("--remap-key requires 3 arguments: <ROW> <COL> <SCANCODE>");
}
found_an_option = true;
} else if arg == "--rgbkbd" {
cli.rgbkbd = if args.len() > i + 2 {
let mut colors = Vec::<u64>::new();
Expand All @@ -374,7 +388,8 @@ pub fn parse(args: &[String]) -> Cli {
} else {
println!("--rgbkbd requires at least 2 arguments, the start key and an RGB value");
vec![]
}
};
found_an_option = true;
} else if arg == "--ps2-enable" {
cli.ps2_enable = if args.len() > i + 1 {
let enable_arg = &args[i + 1];
Expand All @@ -391,7 +406,7 @@ pub fn parse(args: &[String]) -> Cli {
None
}
} else {
println!("Need to provide a value for --tablet-mode. One of: `auto`, `tablet` or `laptop`");
println!("Need to provide a value for --ps2-enable. Must be `true` or `false`");
None
};
found_an_option = true;
Expand Down Expand Up @@ -506,7 +521,7 @@ pub fn parse(args: &[String]) -> Cli {
Some(Some(delay))
}
} else {
println!("Invalid value for --fp-brightness. Must be amount in seconds >0");
println!("Invalid value for --ec-hib-delay. Must be amount in seconds >0");
None
}
} else {
Expand All @@ -522,7 +537,7 @@ pub fn parse(args: &[String]) -> Cli {
} else if arg == "-t" || arg == "--test" {
cli.test = true;
found_an_option = true;
} else if arg == "-t" || arg == "--test-retimer" {
} else if arg == "--test-retimer" {
cli.test_retimer = true;
found_an_option = true;
} else if arg == "--boardid" {
Expand Down Expand Up @@ -557,7 +572,7 @@ pub fn parse(args: &[String]) -> Cli {
};
found_an_option = true;
} else if arg == "--pd-disable" {
cli.pd_reset = if args.len() > i + 1 {
cli.pd_disable = if args.len() > i + 1 {
if let Ok(pd) = args[i + 1].parse::<u8>() {
Some(pd)
} else {
Expand Down Expand Up @@ -709,7 +724,7 @@ pub fn parse(args: &[String]) -> Cli {
None
}
} else {
println!("--pd-ports requires two arguments, one for each port");
println!("--pd-ports requires three arguments, one for each port");
None
};
found_an_option = true;
Expand Down Expand Up @@ -778,9 +793,10 @@ pub fn parse(args: &[String]) -> Cli {
None
}
} else {
println!("Need to provide a value for --console. Possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right");
println!("Need to provide a value for --device. Possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right");
None
};
found_an_option = true;
} else if arg == "--flash-gpu-descriptor" {
cli.flash_gpu_descriptor = if args.len() > i + 2 {
let sn = args[i + 2].to_string();
Expand Down
Loading