1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <console/console.h>
5 #include <intelblocks/pcr.h>
6 #include <soc/pci_devs.h>
7 #include <soc/pnpconfig.h>
11 static const struct pnpconfig perf
[] = {
12 VALUEFORPERF_MSG_VALUES_PLATFORM_DEFAULT
,
15 static const struct pnpconfig power
[] = {
16 VALUEFORPOWER_MSG_VALUES_PLATFORM_DEFAULT
,
19 static const struct pnpconfig power_perf
[] = {
20 VALUEFORPWRPERF_MSG_VALUES_PLATFORM_DEFAULT
,
23 static void pnp_settings(void *unused
)
27 const struct pnpconfig
*pnpconfigarr
;
28 struct soc_intel_apollolake_config
*config
;
30 config
= config_of_soc();
32 switch (config
->pnp_settings
) {
35 arrsize
= ARRAY_SIZE(perf
);
39 arrsize
= ARRAY_SIZE(power
);
42 pnpconfigarr
= power_perf
;
43 arrsize
= ARRAY_SIZE(power_perf
);
46 printk(BIOS_NOTICE
, "Invalid PNP settings selected");
50 for (index
= 0; index
< arrsize
; index
++)
51 pcr_rmw32(pnpconfigarr
[index
].msgport
,
52 pnpconfigarr
[index
].msgregaddr
,
53 pnpconfigarr
[index
].mask
,
54 pnpconfigarr
[index
].value
);
57 BOOT_STATE_INIT_ENTRY(BS_DEV_INIT
, BS_ON_EXIT
, pnp_settings
, NULL
);