blob: 36f86f1ee7dd2907df8556919c2c74d51bd060fc [file] [log] [blame]
Marc Bertens2ad8ab82010-06-04 19:53:55 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2010 Marc Bertens <mbertens@xs4all.nl>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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.
Marc Bertens2ad8ab82010-06-04 19:53:55 +000015 */
16
17#include <device/device.h>
18#include <device/pci_def.h>
19#include <device/pci.h>
20#include <device/pci_ids.h>
21#include <console/console.h>
22
Edward O'Callaghan2c9d2cf2014-10-27 23:29:29 +110023static void dec_21143_enable(struct device *dev)
Marc Bertens2ad8ab82010-06-04 19:53:55 +000024{
Uwe Hermann2d1d9ceb2010-12-26 14:12:38 +000025 printk(BIOS_DEBUG, "Initializing DECchip 21143\n");
26
Stefan Reinauera35eb2c2010-12-26 16:49:57 +000027 // The resource allocator should do this. If not, it needs to be fixed
28 // differently.
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070029#if 0
Uwe Hermann2d1d9ceb2010-12-26 14:12:38 +000030 /* Command and status configuration (offset 0x04) */
Stefan Reinauera35eb2c2010-12-26 16:49:57 +000031 pci_write_config32(dev, 0x04, 0x02800107);
Uwe Hermann2d1d9ceb2010-12-26 14:12:38 +000032 printk(BIOS_DEBUG, "0x04 = %08x (07 01 80 02)\n",
33 pci_read_config32(dev, 0x04));
34
35 /* Cache line size (offset 0x0C) */
Stefan Reinauera35eb2c2010-12-26 16:49:57 +000036 pci_write_config8(dev, 0x0C, 0x00);
37 printk(BIOS_DEBUG, "0x0c = %08x (00)\n",
38 pci_read_config8(dev, 0x0C));
39#endif
Marc Bertens2ad8ab82010-06-04 19:53:55 +000040}
41
Uwe Hermann2d1d9ceb2010-12-26 14:12:38 +000042static struct device_operations dec_21143_ops = {
43 .read_resources = pci_dev_read_resources,
44 .set_resources = pci_dev_set_resources,
45 .enable_resources = pci_dev_enable_resources,
46 .init = dec_21143_enable,
47 .scan_bus = 0,
Marc Bertens2ad8ab82010-06-04 19:53:55 +000048};
49
Myles Watson356f8482010-06-07 20:15:54 +000050static const struct pci_driver dec_21143_driver __pci_driver = {
Uwe Hermann2d1d9ceb2010-12-26 14:12:38 +000051 .ops = &dec_21143_ops,
52 .vendor = PCI_VENDOR_ID_DEC,
Stefan Reinauera35eb2c2010-12-26 16:49:57 +000053 .device = PCI_DEVICE_ID_DEC_21142, // FIXME wrong ID?
Marc Bertens2ad8ab82010-06-04 19:53:55 +000054};