1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/pci_ops.h>
4 #include <console/console.h>
5 #include <device/device.h>
6 #include <device/pci.h>
7 #include <device/pci_ids.h>
9 #include <soc/device_nvs.h>
11 #include <soc/pci_devs.h>
12 #include <soc/ramstage.h>
15 #define CAP_OVERRIDE_LOW 0xa0
16 #define CAP_OVERRIDE_HIGH 0xa4
17 #define USE_CAP_OVERRIDES (1 << 31)
19 static void sd_init(struct device
*dev
)
21 struct soc_intel_baytrail_config
*config
= config_of(dev
);
23 if (config
->sdcard_cap_low
!= 0 || config
->sdcard_cap_high
!= 0) {
24 printk(BIOS_DEBUG
, "Overriding SD Card controller caps.\n");
25 pci_write_config32(dev
, CAP_OVERRIDE_LOW
, config
->sdcard_cap_low
);
26 pci_write_config32(dev
, CAP_OVERRIDE_HIGH
, config
->sdcard_cap_high
|
30 if (config
->scc_acpi_mode
)
31 scc_enable_acpi_mode(dev
, SCC_SD_CTL
, SCC_NVS_SD
);
34 static const struct device_operations device_ops
= {
35 .read_resources
= pci_dev_read_resources
,
36 .set_resources
= pci_dev_set_resources
,
37 .enable_resources
= pci_dev_enable_resources
,
39 .ops_pci
= &soc_pci_ops
,
42 static const struct pci_driver southcluster __pci_driver
= {
44 .vendor
= PCI_VID_INTEL
,