2 * This file is part of the coreboot project.
4 * Copyright (C) 2009-2010 iWave Systems
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <console/console.h>
21 #include <device/device.h>
22 #include <device/pci.h>
23 #include <device/pci_ids.h>
26 static void sch_mmc_init(struct device *dev)
30 printk(BIOS_DEBUG, "MMC: Setting up controller.. ");
31 reg32 = pci_read_config32(dev, PCI_COMMAND);
32 reg32 |= PCI_COMMAND_MASTER;
33 reg32 |= PCI_COMMAND_MEMORY;
34 pci_write_config32(dev, PCI_COMMAND, reg32);
35 printk(BIOS_DEBUG, "done.\n");
38 static void sch_mmc_set_subsystem(device_t dev, unsigned vendor,
41 if (!vendor || !device) {
42 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
43 pci_read_config32(dev, PCI_VENDOR_ID));
45 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
46 ((device & 0xffff) << 16) | (vendor & 0xffff));
50 static struct pci_operations lops_pci = {
51 .set_subsystem = &sch_mmc_set_subsystem,
54 static struct device_operations sch_mmc_ops = {
55 .read_resources = pci_dev_read_resources,
56 .set_resources = pci_dev_set_resources,
57 .enable_resources = pci_dev_enable_resources,
63 static const struct pci_driver sch_mmc1 __pci_driver = {
65 .vendor = PCI_VENDOR_ID_INTEL,
69 static const struct pci_driver sch_mmc2 __pci_driver = {
71 .vendor = PCI_VENDOR_ID_INTEL,
75 static const struct pci_driver sch_mmc3 __pci_driver = {
77 .vendor = PCI_VENDOR_ID_INTEL,