1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <device/pci.h>
6 #include <device/pci_ops.h>
8 static void si_sata_init(struct device
*dev
)
11 /* enable change device id and class id */
12 dword
= pci_read_config32(dev
,0x40);
14 pci_write_config32(dev
, 0x40, dword
);
15 /* Set IDE Class, Native mode, two drives per channel */
17 pci_write_config32(dev
, 0x08, dword
);
18 /* disable change device id and class id*/
19 dword
= pci_read_config32(dev
,0x40);
21 pci_write_config32(dev
, 0x40, dword
);
22 printk(BIOS_INFO
, "SIL3114 set to IDE compatible mode\n");
25 static struct device_operations si_sata_ops
= {
26 .read_resources
= pci_dev_read_resources
,
27 .set_resources
= pci_dev_set_resources
,
28 .enable_resources
= pci_dev_enable_resources
,
32 static const struct pci_driver si_sata_driver __pci_driver
= {
38 static const struct pci_driver si_sata_driver_2 __pci_driver
= {