Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 3 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 4 | #include <soc/pci_devs.h> |
| 5 | #include <soc/ramstage.h> |
| 6 | #include <soc/sata.h> |
| 7 | #include <console/console.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 8 | #include <device/device.h> |
| 9 | #include <device/pci.h> |
| 10 | #include <device/pci_ids.h> |
| 11 | |
| 12 | #include "chip.h" |
| 13 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 14 | typedef struct soc_intel_braswell_config config_t; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 15 | |
| 16 | static void sata_init(struct device *dev) |
| 17 | { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 18 | printk(BIOS_SPEW, "%s/%s (%s)\n", __FILE__, __func__, dev_name(dev)); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 19 | } |
| 20 | |
Elyes HAOUAS | b13fac3 | 2018-05-24 22:29:44 +0200 | [diff] [blame] | 21 | static void sata_enable(struct device *dev) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 22 | { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 23 | southcluster_enable_dev(dev); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | static struct device_operations sata_ops = { |
| 27 | .read_resources = pci_dev_read_resources, |
| 28 | .set_resources = pci_dev_set_resources, |
| 29 | .enable_resources = pci_dev_enable_resources, |
| 30 | .init = sata_init, |
| 31 | .enable = sata_enable, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 32 | .ops_pci = &soc_pci_ops, |
| 33 | }; |
| 34 | |
| 35 | static const unsigned short pci_device_ids[] = { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 36 | AHCI1_DEVID, /* AHCI */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 37 | 0, |
| 38 | }; |
| 39 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 40 | static const struct pci_driver soc_sata __pci_driver = { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 41 | .ops = &sata_ops, |
| 42 | .vendor = PCI_VENDOR_ID_INTEL, |
| 43 | .devices = pci_device_ids, |
| 44 | }; |