blob: 8052b29e082bc99caabbc4b1b6ae4ffa385f59ee [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google Inc.
Lee Leahy32471722015-04-20 15:20:28 -07005 * Copyright (C) 2015 Intel Corp.
Lee Leahy77ff0b12015-05-05 15:07:29 -07006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Lee Leahy77ff0b12015-05-05 15:07:29 -070015 */
16
17#include <arch/io.h>
18#include <soc/pci_devs.h>
19#include <soc/ramstage.h>
20#include <soc/sata.h>
21#include <console/console.h>
22#include <delay.h>
23#include <device/device.h>
24#include <device/pci.h>
25#include <device/pci_ids.h>
26
27#include "chip.h"
28
Lee Leahy32471722015-04-20 15:20:28 -070029typedef struct soc_intel_braswell_config config_t;
Lee Leahy77ff0b12015-05-05 15:07:29 -070030
31static void sata_init(struct device *dev)
32{
Lee Leahy32471722015-04-20 15:20:28 -070033 printk(BIOS_SPEW, "%s/%s ( %s )\n",
34 __FILE__, __func__, dev_name(dev));
Lee Leahy77ff0b12015-05-05 15:07:29 -070035}
36
Elyes HAOUASb13fac32018-05-24 22:29:44 +020037static void sata_enable(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070038{
Lee Leahy77ff0b12015-05-05 15:07:29 -070039 southcluster_enable_dev(dev);
Lee Leahy77ff0b12015-05-05 15:07:29 -070040}
41
42static struct device_operations sata_ops = {
43 .read_resources = pci_dev_read_resources,
44 .set_resources = pci_dev_set_resources,
45 .enable_resources = pci_dev_enable_resources,
46 .init = sata_init,
47 .enable = sata_enable,
Lee Leahy77ff0b12015-05-05 15:07:29 -070048 .ops_pci = &soc_pci_ops,
49};
50
51static const unsigned short pci_device_ids[] = {
Lee Leahy32471722015-04-20 15:20:28 -070052 AHCI1_DEVID, /* AHCI */
Lee Leahy77ff0b12015-05-05 15:07:29 -070053 0,
54};
55
Lee Leahy32471722015-04-20 15:20:28 -070056static const struct pci_driver soc_sata __pci_driver = {
Lee Leahy77ff0b12015-05-05 15:07:29 -070057 .ops = &sata_ops,
58 .vendor = PCI_VENDOR_ID_INTEL,
59 .devices = pci_device_ids,
60};