soc/intel/denverton_ns: Remove unused memcpy_s function
[coreboot.git] / src / soc / intel / apollolake / pnpconfig.c
blob0c7286573edd6115c0460b0f81ff6f957ed0a699
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <bootstate.h>
4 #include <console/console.h>
5 #include <intelblocks/pcr.h>
6 #include <soc/pci_devs.h>
7 #include <soc/pnpconfig.h>
8 #include <static.h>
9 #include "chip.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)
25 int index;
26 size_t arrsize;
27 const struct pnpconfig *pnpconfigarr;
28 struct soc_intel_apollolake_config *config;
30 config = config_of_soc();
32 switch (config->pnp_settings) {
33 case PNP_PERF:
34 pnpconfigarr = perf;
35 arrsize = ARRAY_SIZE(perf);
36 break;
37 case PNP_POWER:
38 pnpconfigarr = power;
39 arrsize = ARRAY_SIZE(power);
40 break;
41 case PNP_PERF_POWER:
42 pnpconfigarr = power_perf;
43 arrsize = ARRAY_SIZE(power_perf);
44 break;
45 default:
46 printk(BIOS_NOTICE, "Invalid PNP settings selected");
47 return;
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);