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
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <console/console.h>
22 #include <device/device.h>
23 #include <device/pci.h>
24 #include <device/pci_ids.h>
27 static void sch_mmc_init(struct device *dev)
31 printk(BIOS_DEBUG, "MMC: Setting up controller.. ");
32 reg32 = pci_read_config32(dev, PCI_COMMAND);
33 reg32 |= PCI_COMMAND_MASTER;
34 reg32 |= PCI_COMMAND_MEMORY;
35 pci_write_config32(dev, PCI_COMMAND, reg32);
36 printk(BIOS_DEBUG, "done.\n");
39 static void sch_mmc_set_subsystem(device_t dev, unsigned vendor, unsigned device)
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));
51 static struct pci_operations lops_pci = {
52 .set_subsystem = &sch_mmc_set_subsystem,
55 static struct device_operations sch_mmc_ops = {
56 .read_resources = pci_dev_read_resources,
57 .set_resources = pci_dev_set_resources,
58 .enable_resources = pci_dev_enable_resources,
64 static const struct pci_driver sch_mmc1 __pci_driver = {
66 .vendor = PCI_VENDOR_ID_INTEL,
70 static const struct pci_driver sch_mmc2 __pci_driver = {
72 .vendor = PCI_VENDOR_ID_INTEL,
76 static const struct pci_driver sch_mmc3 __pci_driver = {
78 .vendor = PCI_VENDOR_ID_INTEL,