blob: 452db65b91695a3faa298aaf90ab61a6ac8c67cf [file] [log] [blame]
Dave Frodin2093c4f2014-06-13 08:12:48 -06001/*
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 Frodin2093c4f2014-06-13 08:12:48 -060014 */
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
28struct pirq_struct {
29 u8 devfn;
30 u8 PIN[4]; /* PINA/B/C/D are index 0/1/2/3 */
31};
32
33extern const struct pirq_struct * pirq_data_ptr;
34extern u32 pirq_data_size;
35extern const u8 * intr_data_ptr;
36extern const u8 * picr_data_ptr;
37
38u8 read_pci_int_idx(u8 index, int mode);
39void write_pci_int_idx(u8 index, int mode, u8 data);
40void write_pci_cfg_irqs(void);
41void write_pci_int_table (void);
42#endif /* __PRE_RAM */
43
44#endif /* AMD_PCI_UTIL_H */