Move MMCONF resource into the domain for fam10 for the resource allocator.
[coreboot.git] / src / southbridge / via / vt8237r / vt8237r_pirq.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 Nikolay Petukhov <nikolay.petukhov@gmail.com>
5  * Copyright (C) 2010 Tobias Diedrich <ranma+coreboot@tdiedrich.de>
6  *
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; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
20  */
21
22 #include <arch/pirq_routing.h>
23 #include <console/console.h>
24 #include <device/pci.h>
25 #include <device/pci_ids.h>
26 #include <pc80/i8259.h>
27
28 #if (CONFIG_PIRQ_ROUTE==1 && CONFIG_GENERATE_PIRQ_TABLE==1)
29 void pirq_assign_irqs(const unsigned char route[4])
30 {
31         device_t pdev;
32
33         pdev = dev_find_device(PCI_VENDOR_ID_VIA,
34                                 PCI_DEVICE_ID_VIA_VT8237R_LPC, 0);
35         if (!pdev)
36                 pdev = dev_find_device(PCI_VENDOR_ID_VIA,
37                                 PCI_DEVICE_ID_VIA_VT8237S_LPC, 0);
38         if (!pdev)
39                 pdev = dev_find_device(PCI_VENDOR_ID_VIA,
40                                 PCI_DEVICE_ID_VIA_VT8237A_LPC, 0);
41         if (!pdev)
42                 return;
43
44         pci_write_config8(pdev, 0x55,  route[0] << 4);
45         pci_write_config8(pdev, 0x56, (route[2] << 4) | route[1]);
46         pci_write_config8(pdev, 0x57,  route[3] << 4);
47
48         /* Enable INT[E-H] mapped to INT[A-D] for simplicity */
49         pci_write_config8(pdev, 0x46,  0x00);
50 }
51 #endif