From 29a3a09f9155e5de69d6d2a4bf582a9e09b8e0a4 Mon Sep 17 00:00:00 2001 From: Nikolai Artemiev Date: Mon, 21 Nov 2022 19:29:57 +1100 Subject: writeprotect: Add function to get register values and WP bit masks Add a new wp_cfg_to_reg_values() function that takes a generic wp_cfg instance and returns the chip-specific values that need to be written to the chip's registers to enable the specified protection range/mode. The function returns three values for each chip register: - reg_values[reg] - Value writeprotect will write to reg - bit_masks[reg] - Bit mask for WP-related bits in reg - write_masks[reg] - Bit mask for writable WP-related bits in reg (i.e. the ones writeprotect will try to write) BUG=b:260019525,b:259013033,260020006 BRANCH=none TEST=ninja test Change-Id: Ib2a47153b230c9f82bb4eca357c335f2abbacc20 Signed-off-by: Nikolai Artemiev Reviewed-on: https://review.coreboot.org/c/flashrom/+/69847 Reviewed-by: Edward O'Callaghan Tested-by: build bot (Jenkins) Reviewed-by: Sergii Dmytruk --- tests/tests.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/tests.h') diff --git a/tests/tests.h b/tests/tests.h index 8f63f91ba..e273e1dbf 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -92,6 +92,7 @@ void switch_wp_mode_dummyflasher_test_success(void **state); void wp_init_from_status_dummyflasher_test_success(void **state); void full_chip_erase_with_wp_dummyflasher_test_success(void **state); void partial_chip_erase_with_wp_dummyflasher_test_success(void **state); +void wp_get_register_values_and_masks(void **state); /* selfcheck.c */ void selfcheck_programmer_table(void **state); -- cgit v1.2.3