From 70a78b89e320722dbdefa93bddd3a3c2a7787d67 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 19 Oct 2024 18:41:04 +0800 Subject: [PATCH 1/7] uefi-help: Add missing options They were recently added or forgotten earlier. Signed-off-by: Daniel Schaefer --- framework_lib/src/commandline/mod.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/framework_lib/src/commandline/mod.rs b/framework_lib/src/commandline/mod.rs index 4ca9af45..aaf1f7c5 100644 --- a/framework_lib/src/commandline/mod.rs +++ b/framework_lib/src/commandline/mod.rs @@ -1826,7 +1826,11 @@ Options: --autofanctrl []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 [] Show Intel ME information (from SMBIOS type 0xDB) --pd-info Show details about the PD controllers + --pd-reset Reset a specific PD controller (for debugging only) + --pd-disable Disable all ports on a specific PD controller (for debugging only) + --pd-enable Enable all ports on a specific PD controller (for debugging only) --privacy Show privacy switch statuses (camera and microphone) --pd-bin Parse versions from PD firmware binary file --ec-bin Parse versions from EC firmware binary file @@ -1838,6 +1842,9 @@ Options: --flash-ro-ec Flash EC with new firmware from file --flash-rw-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 [] 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) @@ -1845,17 +1852,32 @@ Options: --nvidia Show NVIDIA GPU information (Framework 16 only) --charge-limit [] Get or set battery charge limit (Percentage number as arg, e.g. '100') --charge-current-limit [] Get or set battery current charge limit (Percentage number as arg, e.g. '100') + --charge-rate-limit [] Set max charge rate limit --get-gpio Get GPIO value by name or all, if no name provided --fp-led-level [] Get or set fingerprint LED brightness level [possible values: high, medium, low] --fp-brightness []Get or set fingerprint LED brightness percentage --kblight [] Set keyboard backlight percentage or get, if no value provided + --rgbkbd [ ...] + Set the color of a key to RGB. Multiple colors for adjacent keys can be set at once + --tablet-mode Set tablet mode override [possible values: auto, tablet, laptop] --console Get EC console, choose whether recent or to follow the output [possible values: recent, follow] --hash Hash a file of arbitrary data --flash-gpu-descriptor <18 DIGIT SN> Overwrite the GPU bay descriptor SN and type. --flash-gpu-descriptor-file Write the GPU bay descriptor with a descriptor file. + --dump-gpu-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 + Specify I2C addresses of the PD chips (Advanced) + --pd-ports + Specify I2C ports of the PD chips (Advanced) + --has-mec + Specify the type of EC chip (MEC/MCHP or other) [possible values: true, false] + --host-command [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 "# From 4a5f4ed0f455718c6e337995640d1112c16efdc1 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 14 Mar 2026 21:02:37 +0800 Subject: [PATCH 2/7] --remap-key: Implement in UEFI Signed-off-by: Daniel Schaefer --- framework_lib/src/commandline/mod.rs | 2 ++ framework_lib/src/commandline/uefi.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/framework_lib/src/commandline/mod.rs b/framework_lib/src/commandline/mod.rs index aaf1f7c5..e006d27b 100644 --- a/framework_lib/src/commandline/mod.rs +++ b/framework_lib/src/commandline/mod.rs @@ -1857,6 +1857,8 @@ Options: --fp-led-level [] Get or set fingerprint LED brightness level [possible values: high, medium, low] --fp-brightness []Get or set fingerprint LED brightness percentage --kblight [] Set keyboard backlight percentage or get, if no value provided + --remap-key + Remap a key by changing the scancode --rgbkbd [ ...] Set the color of a key to RGB. Multiple colors for adjacent keys can be set at once --tablet-mode Set tablet mode override [possible values: auto, tablet, laptop] diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index d08e6ddd..8ecfe023 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -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: "); + } + } else { + println!("--remap-key requires 3 arguments: "); + } + found_an_option = true; } else if arg == "--rgbkbd" { cli.rgbkbd = if args.len() > i + 2 { let mut colors = Vec::::new(); From 432febdc217f89e9c5b787a0f9892dd3a14c4b3f Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 14 Mar 2026 21:03:29 +0800 Subject: [PATCH 3/7] --autofanctrl: Fix uefi parsing Signed-off-by: Daniel Schaefer --- framework_lib/src/commandline/uefi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index 8ecfe023..6b06ba99 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -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::() { Some(Some(fan_id)) From 19eb2774f6c2d7bf2fe93171685bab8571c017b5 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 14 Mar 2026 21:04:05 +0800 Subject: [PATCH 4/7] --pd-disable: fix in uefi Signed-off-by: Daniel Schaefer --- framework_lib/src/commandline/uefi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index 6b06ba99..c53a9e46 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -571,7 +571,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::() { Some(pd) } else { From 30119be18748fd5f3b121f74211dc960a347fe19 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 14 Mar 2026 21:10:40 +0800 Subject: [PATCH 5/7] uefi: Add missing found_an_option It's used to print help if no valid option was found Signed-off-by: Daniel Schaefer --- framework_lib/src/commandline/uefi.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index c53a9e46..2b41e79d 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -388,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]; @@ -795,6 +796,7 @@ pub fn parse(args: &[String]) -> Cli { println!("Need to provide a value for --console. 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(); From 6d010240cc9452a42261302aba3bc124fb380bfd Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 14 Mar 2026 21:11:38 +0800 Subject: [PATCH 6/7] uefi: Fix incorrect error messages Signed-off-by: Daniel Schaefer --- framework_lib/src/commandline/uefi.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index 2b41e79d..0229b361 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -406,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; @@ -521,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 { @@ -724,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; @@ -793,7 +793,7 @@ 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; From f0a6882df8bb1850044300146631e684ffd1abdd Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sat, 14 Mar 2026 21:11:50 +0800 Subject: [PATCH 7/7] --test-retimer: Remove shorthand -t in uefi used already for --test -t Signed-off-by: Daniel Schaefer --- framework_lib/src/commandline/uefi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index 0229b361..faf34b10 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -537,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" {