Nikolay Petukhov | 9c2255c | 2008-03-29 16:59:27 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007 Nikolay Petukhov <nikolay.petukhov@gmail.com> |
| 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. |
Nikolay Petukhov | 9c2255c | 2008-03-29 16:59:27 +0000 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include <arch/pirq_routing.h> |
| 18 | #include <console/console.h> |
| 19 | #include <device/pci.h> |
| 20 | #include <device/pci_ids.h> |
| 21 | |
Myles Watson | b8e2027 | 2009-10-15 13:35:47 +0000 | [diff] [blame] | 22 | #if (CONFIG_PIRQ_ROUTE==1 && CONFIG_GENERATE_PIRQ_TABLE==1) |
Nikolay Petukhov | 9c2255c | 2008-03-29 16:59:27 +0000 | [diff] [blame] | 23 | void pirq_assign_irqs(const unsigned char pIntAtoD[4]) |
| 24 | { |
| 25 | device_t pdev; |
| 26 | |
| 27 | pdev = dev_find_device(PCI_VENDOR_ID_AMD, |
| 28 | PCI_DEVICE_ID_AMD_CS5536_ISA, 0); |
| 29 | |
| 30 | if (pdev) { |
| 31 | pci_write_config16(pdev, 0x5c, (pIntAtoD[3] << 12 |
| 32 | | pIntAtoD[2] << 8 | pIntAtoD[1] << 4 | pIntAtoD[0])); |
| 33 | } |
| 34 | } |
| 35 | #endif |