2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
17 #include <console/console.h>
18 #include <device/device.h>
19 #include <device/pci.h>
22 #include <soc/ramstage.h>
24 void scc_enable_acpi_mode(struct device
*dev
, int iosf_reg
, int nvs_index
)
29 printk(BIOS_SPEW
, "%s/%s (%s, 0x%08x, 0x%08x)\n",
30 __FILE__
, __func__
, dev_name(dev
), iosf_reg
, nvs_index
);
32 /* Find ACPI NVS to update BARs */
33 gnvs
= cbmem_find(CBMEM_ID_ACPI_GNVS
);
35 printk(BIOS_ERR
, "Unable to locate Global NVS\n");
39 /* Save BAR0 and BAR1 to ACPI NVS */
40 bar
= find_resource(dev
, PCI_BASE_ADDRESS_0
);
42 gnvs
->dev
.scc_bar0
[nvs_index
] = bar
->base
;
43 bar
= find_resource(dev
, PCI_BASE_ADDRESS_2
);
45 gnvs
->dev
.scc_bar1
[nvs_index
] = bar
->base
;
47 /* Device is enabled in ACPI mode */
48 gnvs
->dev
.scc_en
[nvs_index
] = 1;