Marc Jones | 81ef9c2 | 2021-01-21 10:53:47 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Shuo Liu | 7843911 | 2024-04-25 05:41:16 +0800 | [diff] [blame^] | 3 | #include <intelblocks/cfg.h> |
Jonathan Zhang | fb2ebbc | 2022-10-26 16:19:40 -0700 | [diff] [blame] | 4 | #include <intelblocks/lpc_lib.h> |
Marc Jones | 81ef9c2 | 2021-01-21 10:53:47 -0700 | [diff] [blame] | 5 | #include <intelpch/lockdown.h> |
Jonathan Zhang | 43277976 | 2023-01-23 10:55:09 -0800 | [diff] [blame] | 6 | #include <soc/lockdown.h> |
Marc Jones | 81ef9c2 | 2021-01-21 10:53:47 -0700 | [diff] [blame] | 7 | #include <soc/pm.h> |
| 8 | |
Jonathan Zhang | fb2ebbc | 2022-10-26 16:19:40 -0700 | [diff] [blame] | 9 | static void lpc_lockdown_config(void) |
| 10 | { |
| 11 | /* Set BIOS Interface Lock, BIOS Lock */ |
| 12 | lpc_set_bios_interface_lock_down(); |
| 13 | |
| 14 | /* Only allow writes in SMM */ |
| 15 | if (CONFIG(BOOTMEDIA_SMM_BWP)) { |
| 16 | lpc_set_eiss(); |
| 17 | lpc_enable_wp(); |
| 18 | } |
| 19 | lpc_set_lock_enable(); |
| 20 | } |
| 21 | |
Marc Jones | 81ef9c2 | 2021-01-21 10:53:47 -0700 | [diff] [blame] | 22 | void soc_lockdown_config(int chipset_lockdown) |
| 23 | { |
Shuo Liu | 7843911 | 2024-04-25 05:41:16 +0800 | [diff] [blame^] | 24 | if (chipset_lockdown == CHIPSET_LOCKDOWN_FSP) |
| 25 | return; |
| 26 | |
Jonathan Zhang | fb2ebbc | 2022-10-26 16:19:40 -0700 | [diff] [blame] | 27 | lpc_lockdown_config(); |
Jonathan Zhang | 43277976 | 2023-01-23 10:55:09 -0800 | [diff] [blame] | 28 | pmc_lockdown_config(); |
Marc Jones | 4681b27 | 2021-04-06 14:29:37 -0600 | [diff] [blame] | 29 | sata_lockdown_config(chipset_lockdown); |
Jonathan Zhang | 43277976 | 2023-01-23 10:55:09 -0800 | [diff] [blame] | 30 | spi_lockdown_config(chipset_lockdown); |
Marc Jones | 81ef9c2 | 2021-01-21 10:53:47 -0700 | [diff] [blame] | 31 | } |