Angel Pons | 3bd1e3d | 2020-04-05 15:47:17 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Subrata Banik | b51f54b | 2017-08-14 16:15:33 +0530 | [diff] [blame] | 2 | |
Kyösti Mälkki | 13f6650 | 2019-03-03 08:01:05 +0200 | [diff] [blame] | 3 | #include <device/mmio.h> |
Kyösti Mälkki | 32d47eb | 2019-09-28 00:00:30 +0300 | [diff] [blame] | 4 | #include <intelblocks/cfg.h> |
Michael Niewöhner | 43d2527 | 2019-09-17 18:48:00 +0200 | [diff] [blame] | 5 | #include <intelblocks/pmclib.h> |
Subrata Banik | 9cd99a1 | 2018-05-28 16:12:03 +0530 | [diff] [blame] | 6 | #include <intelpch/lockdown.h> |
Subrata Banik | 639bf8a | 2017-08-25 12:08:59 +0530 | [diff] [blame] | 7 | #include <soc/pm.h> |
Subrata Banik | b51f54b | 2017-08-14 16:15:33 +0530 | [diff] [blame] | 8 | |
Subrata Banik | 639bf8a | 2017-08-25 12:08:59 +0530 | [diff] [blame] | 9 | static void pmc_lockdown_config(void) |
| 10 | { |
| 11 | uint8_t *pmcbase; |
| 12 | u32 pmsyncreg; |
| 13 | |
| 14 | /* PMSYNC */ |
| 15 | pmcbase = pmc_mmio_regs(); |
| 16 | pmsyncreg = read32(pmcbase + PMSYNC_TPR_CFG); |
| 17 | pmsyncreg |= PMSYNC_LOCK; |
| 18 | write32(pmcbase + PMSYNC_TPR_CFG, pmsyncreg); |
Michael Niewöhner | 43d2527 | 2019-09-17 18:48:00 +0200 | [diff] [blame] | 19 | |
| 20 | /* Make sure payload/OS can't trigger global reset */ |
| 21 | pmc_global_reset_disable_and_lock(); |
Subrata Banik | 639bf8a | 2017-08-25 12:08:59 +0530 | [diff] [blame] | 22 | } |
| 23 | |
Subrata Banik | 9cd99a1 | 2018-05-28 16:12:03 +0530 | [diff] [blame] | 24 | void soc_lockdown_config(int chipset_lockdown) |
Subrata Banik | 97a0945 | 2017-08-16 18:38:54 +0530 | [diff] [blame] | 25 | { |
Subrata Banik | 639bf8a | 2017-08-25 12:08:59 +0530 | [diff] [blame] | 26 | /* PMC lock down configuration */ |
| 27 | pmc_lockdown_config(); |
Subrata Banik | b51f54b | 2017-08-14 16:15:33 +0530 | [diff] [blame] | 28 | } |