2 |
#define BUS_PCI_H |
#define BUS_PCI_H |
3 |
|
|
4 |
/* |
/* |
5 |
* Copyright (C) 2004-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2007 Anders Gavare. All rights reserved. |
6 |
* |
* |
7 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
8 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: bus_pci.h,v 1.30 2006/08/12 19:32:20 debug Exp $ |
* $Id: bus_pci.h,v 1.33 2006/12/30 13:31:00 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include "misc.h" |
#include "misc.h" |
47 |
#else |
#else |
48 |
|
|
49 |
struct pci_data { |
struct pci_data { |
50 |
/* IRQ nr of the controller itself. */ |
/* |
51 |
int irq_nr; |
* IRQ paths: |
52 |
|
* |
53 |
|
* irq_path Path of the controller itself. |
54 |
|
* irq_path_isa Path base of ISA interrupts. |
55 |
|
* irq_path_pci Path base of PCI interrupts. |
56 |
|
*/ |
57 |
|
char *irq_path; |
58 |
|
char *irq_path_isa; |
59 |
|
char *irq_path_pci; |
60 |
|
|
61 |
/* |
/* |
62 |
* Default I/O port, memory, and irq bases for PCI and legacy ISA |
* Default I/O port, memory, and irq bases for PCI and legacy ISA |
71 |
|
|
72 |
uint64_t pci_portbase; |
uint64_t pci_portbase; |
73 |
uint64_t pci_membase; |
uint64_t pci_membase; |
|
int pci_irqbase; |
|
74 |
|
|
75 |
uint64_t isa_portbase; |
uint64_t isa_portbase; |
76 |
uint64_t isa_membase; |
uint64_t isa_membase; |
|
int isa_irqbase; |
|
77 |
|
|
78 |
/* Current base when allocating space for PCI devices: */ |
/* Current base when allocating space for PCI devices: */ |
79 |
uint64_t cur_pci_portbase; |
uint64_t cur_pci_portbase; |
150 |
uint64_t *data, int len, int writeflag); |
uint64_t *data, int len, int writeflag); |
151 |
|
|
152 |
/* Initialization: */ |
/* Initialization: */ |
153 |
struct pci_data *bus_pci_init(struct machine *machine, int irq_nr, |
struct pci_data *bus_pci_init(struct machine *machine, char *irq_path, |
154 |
uint64_t pci_actual_io_offset, uint64_t pci_actual_mem_offset, |
uint64_t pci_actual_io_offset, uint64_t pci_actual_mem_offset, |
155 |
uint64_t pci_portbase, uint64_t pci_membase, int pci_irqbase, |
uint64_t pci_portbase, uint64_t pci_membase, char *pci_irqbase, |
156 |
uint64_t isa_portbase, uint64_t isa_membase, int isa_irqbase); |
uint64_t isa_portbase, uint64_t isa_membase, char *isa_irqbase); |
157 |
|
|
158 |
/* Add a PCI device to a PCI bus: */ |
/* Add a PCI device to a PCI bus: */ |
159 |
void bus_pci_add(struct machine *machine, struct pci_data *pci_data, |
void bus_pci_add(struct machine *machine, struct pci_data *pci_data, |