Statistics
| Branch: | Revision:

root / hw / pcie_host.h @ 8ca209ad

History | View | Annotate | Download (1.5 kB)

1 a9f49946 Isaku Yamahata
/*
2 a9f49946 Isaku Yamahata
 * pcie_host.h
3 a9f49946 Isaku Yamahata
 *
4 a9f49946 Isaku Yamahata
 * Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
5 a9f49946 Isaku Yamahata
 *                    VA Linux Systems Japan K.K.
6 a9f49946 Isaku Yamahata
 *
7 a9f49946 Isaku Yamahata
 * This program is free software; you can redistribute it and/or modify
8 a9f49946 Isaku Yamahata
 * it under the terms of the GNU General Public License as published by
9 a9f49946 Isaku Yamahata
 * the Free Software Foundation; either version 2 of the License, or
10 a9f49946 Isaku Yamahata
 * (at your option) any later version.
11 a9f49946 Isaku Yamahata

12 a9f49946 Isaku Yamahata
 * This program is distributed in the hope that it will be useful,
13 a9f49946 Isaku Yamahata
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 a9f49946 Isaku Yamahata
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 a9f49946 Isaku Yamahata
 * GNU General Public License for more details.
16 a9f49946 Isaku Yamahata

17 a9f49946 Isaku Yamahata
 * You should have received a copy of the GNU General Public License along
18 70539e18 Blue Swirl
 * with this program; if not, see <http://www.gnu.org/licenses/>.
19 a9f49946 Isaku Yamahata
 */
20 a9f49946 Isaku Yamahata
21 a9f49946 Isaku Yamahata
#ifndef PCIE_HOST_H
22 a9f49946 Isaku Yamahata
#define PCIE_HOST_H
23 a9f49946 Isaku Yamahata
24 a9f49946 Isaku Yamahata
#include "pci_host.h"
25 a9f49946 Isaku Yamahata
26 fb47a2e9 Isaku Yamahata
struct PCIExpressHost {
27 a9f49946 Isaku Yamahata
    PCIHostState pci;
28 a9f49946 Isaku Yamahata
29 a9f49946 Isaku Yamahata
    /* express part */
30 a9f49946 Isaku Yamahata
31 a9f49946 Isaku Yamahata
    /* base address where MMCONFIG area is mapped. */
32 a9f49946 Isaku Yamahata
    target_phys_addr_t  base_addr;
33 a9f49946 Isaku Yamahata
34 a9f49946 Isaku Yamahata
    /* the size of MMCONFIG area. It's host bridge dependent */
35 a9f49946 Isaku Yamahata
    target_phys_addr_t  size;
36 a9f49946 Isaku Yamahata
37 a9f49946 Isaku Yamahata
    /* result of cpu_register_io_memory() to map MMCONFIG area */
38 a9f49946 Isaku Yamahata
    int mmio_index;
39 fb47a2e9 Isaku Yamahata
};
40 a9f49946 Isaku Yamahata
41 a9f49946 Isaku Yamahata
int pcie_host_init(PCIExpressHost *e);
42 a9f49946 Isaku Yamahata
void pcie_host_mmcfg_unmap(PCIExpressHost *e);
43 a9f49946 Isaku Yamahata
void pcie_host_mmcfg_map(PCIExpressHost *e,
44 a9f49946 Isaku Yamahata
                         target_phys_addr_t addr, uint32_t size);
45 a9f49946 Isaku Yamahata
void pcie_host_mmcfg_update(PCIExpressHost *e,
46 a9f49946 Isaku Yamahata
                            int enable,
47 a9f49946 Isaku Yamahata
                            target_phys_addr_t addr, uint32_t size);
48 a9f49946 Isaku Yamahata
49 a9f49946 Isaku Yamahata
#endif /* PCIE_HOST_H */