Dave Frodin | 2093c4f | 2014-06-13 08:12:48 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Sage Electronic Engineering, LLC. |
| 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; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Dave Frodin | 2093c4f | 2014-06-13 08:12:48 -0600 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef AMD_PCI_UTIL_H |
| 17 | #define AMD_PCI_UTIL_H |
| 18 | |
| 19 | #include <stdint.h> |
| 20 | #include "amd_pci_int_defs.h" |
| 21 | |
| 22 | /* FCH index/data registers */ |
| 23 | #define PCI_INTR_INDEX 0xc00 |
| 24 | #define PCI_INTR_DATA 0xc01 |
| 25 | |
| 26 | #ifndef __PRE_RAM__ |
| 27 | |
| 28 | struct pirq_struct { |
| 29 | u8 devfn; |
| 30 | u8 PIN[4]; /* PINA/B/C/D are index 0/1/2/3 */ |
| 31 | }; |
| 32 | |
| 33 | extern const struct pirq_struct * pirq_data_ptr; |
| 34 | extern u32 pirq_data_size; |
| 35 | extern const u8 * intr_data_ptr; |
| 36 | extern const u8 * picr_data_ptr; |
| 37 | |
| 38 | u8 read_pci_int_idx(u8 index, int mode); |
| 39 | void write_pci_int_idx(u8 index, int mode, u8 data); |
| 40 | void write_pci_cfg_irqs(void); |
| 41 | void write_pci_int_table (void); |
| 42 | #endif /* __PRE_RAM */ |
| 43 | |
| 44 | #endif /* AMD_PCI_UTIL_H */ |