Marc Bertens | 2ad8ab8 | 2010-06-04 19:53:55 +0000 | [diff] [blame] | 1 | /* |
| 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 Bertens | 2ad8ab8 | 2010-06-04 19:53:55 +0000 | [diff] [blame] | 15 | */ |
| 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'Callaghan | 2c9d2cf | 2014-10-27 23:29:29 +1100 | [diff] [blame] | 23 | static void dec_21143_enable(struct device *dev) |
Marc Bertens | 2ad8ab8 | 2010-06-04 19:53:55 +0000 | [diff] [blame] | 24 | { |
Uwe Hermann | 2d1d9ceb | 2010-12-26 14:12:38 +0000 | [diff] [blame] | 25 | printk(BIOS_DEBUG, "Initializing DECchip 21143\n"); |
| 26 | |
Stefan Reinauer | a35eb2c | 2010-12-26 16:49:57 +0000 | [diff] [blame] | 27 | // The resource allocator should do this. If not, it needs to be fixed |
| 28 | // differently. |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 29 | #if 0 |
Uwe Hermann | 2d1d9ceb | 2010-12-26 14:12:38 +0000 | [diff] [blame] | 30 | /* Command and status configuration (offset 0x04) */ |
Stefan Reinauer | a35eb2c | 2010-12-26 16:49:57 +0000 | [diff] [blame] | 31 | pci_write_config32(dev, 0x04, 0x02800107); |
Uwe Hermann | 2d1d9ceb | 2010-12-26 14:12:38 +0000 | [diff] [blame] | 32 | printk(BIOS_DEBUG, "0x04 = %08x (07 01 80 02)\n", |
| 33 | pci_read_config32(dev, 0x04)); |
| 34 | |
| 35 | /* Cache line size (offset 0x0C) */ |
Stefan Reinauer | a35eb2c | 2010-12-26 16:49:57 +0000 | [diff] [blame] | 36 | pci_write_config8(dev, 0x0C, 0x00); |
| 37 | printk(BIOS_DEBUG, "0x0c = %08x (00)\n", |
| 38 | pci_read_config8(dev, 0x0C)); |
| 39 | #endif |
Marc Bertens | 2ad8ab8 | 2010-06-04 19:53:55 +0000 | [diff] [blame] | 40 | } |
| 41 | |
Uwe Hermann | 2d1d9ceb | 2010-12-26 14:12:38 +0000 | [diff] [blame] | 42 | static 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 Bertens | 2ad8ab8 | 2010-06-04 19:53:55 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
Myles Watson | 356f848 | 2010-06-07 20:15:54 +0000 | [diff] [blame] | 50 | static const struct pci_driver dec_21143_driver __pci_driver = { |
Uwe Hermann | 2d1d9ceb | 2010-12-26 14:12:38 +0000 | [diff] [blame] | 51 | .ops = &dec_21143_ops, |
| 52 | .vendor = PCI_VENDOR_ID_DEC, |
Stefan Reinauer | a35eb2c | 2010-12-26 16:49:57 +0000 | [diff] [blame] | 53 | .device = PCI_DEVICE_ID_DEC_21142, // FIXME wrong ID? |
Marc Bertens | 2ad8ab8 | 2010-06-04 19:53:55 +0000 | [diff] [blame] | 54 | }; |