GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / cfe / pci / pci_internal.h
blob7fb88839f2197095d3702c4bb280854815ed6a68
1 /*
2 * Copyright (c) 1994 Charles Hannum. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. All advertising materials mentioning features or use of this software
13 * must display the following acknowledgement:
14 * This product includes software developed by Charles Hannum.
15 * 4. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef _PCI_INTERNAL_H_
31 #define _PCI_INTERNAL_H_
34 * Definitions for PCI autoconfiguration.
36 * This file describes types and functions which are used only for
37 * communication among the PCI modules implementing autoconfiguration.
40 /* Build options. Debug levels >1 are for helping to bring up new
41 LDT hardware and will be annoyingly verbose otherwise. */
43 /* PCI_DEBUG enables general checking and tracing. */
44 #ifndef PCI_DEBUG
45 #define PCI_DEBUG 0
46 #endif
48 /* LDT_DEBUG enables progress/error reports for LDT fabric initialization. */
49 #ifndef LDT_DEBUG
50 #define LDT_DEBUG 0
51 #endif
53 #ifndef CLOCK_GEARING /* Temporarily here, should be CONFIG option */
54 #define CLOCK_GEARING 1
55 #endif
57 /* From <cpu>_pci_machdep.c */
59 int pci_hwinit(int port, pci_flags_t flags);
60 void pci_hwreinit(int port, pci_flags_t flags);
61 void pci_businit (int port, int bus, int probe_limit, pci_flags_t flags);
62 void pci_businit_hostbridge (pcitag_t tag, pci_flags_t flags);
63 int pci_device_preset (pcitag_t tag);
64 void pci_device_setup(pcitag_t tag);
65 void pci_bridge_setup(pcitag_t tag, pci_flags_t flags);
66 void pci_flush(void);
68 void pci_break_tag(pcitag_t, int *, int *, int *, int *);
70 int pci_canscan(pcitag_t);
71 int pci_probe_tag(pcitag_t tag);
73 pcireg_t pci_conf_read8(pcitag_t, int);
74 void pci_conf_write8(pcitag_t, int, pcireg_t);
75 pcireg_t pci_conf_read16(pcitag_t, int);
76 void pci_conf_write16(pcitag_t, int, pcireg_t);
77 pcireg_t pci_conf_read(pcitag_t, int);
78 void pci_conf_write(pcitag_t, int, pcireg_t);
79 #define pci_conf_read32 pci_conf_read
80 #define pci_conf_write32 pci_conf_write
81 int pci_conf_write_acked(pcitag_t, int, pcireg_t);
83 uint8_t pci_int_line(uint8_t);
85 unsigned pci_msi_index(void);
86 void pci_msi_encode(unsigned, uint64_t *, uint16_t *);
89 /* From <board>_pci.c */
91 uint8_t pci_int_shift_0(pcitag_t);
92 uint8_t pci_int_map_0(pcitag_t);
94 /* The following are needed only for boards with chips supporting PCI-X. */
96 void pci_clock_reset(void);
97 void pci_clock_enable(int);
98 unsigned int pci_clock_select(unsigned int);
101 /* From ldtinit.c */
103 #define LDT_PRIMARY 0
104 #define LDT_SECONDARY 1
105 unsigned pci_find_ldt_cap (pcitag_t tag, int secondary);
107 void ldt_link_reset (pcitag_t tag, int delay);
108 int ldt_chain_init (pcitag_t tag, int port, int bus, pci_flags_t flags);
110 /* From <cpu>_pci_machdep.c */
112 int pci_maxport(void);
113 int pci_nextbus(int port);
114 int pci_maxbus(int port);
115 struct pci_bus *pci_businfo(int port, int bus);
117 pcireg_t pci_minmemaddr(int port);
118 pcireg_t pci_maxmemaddr(int port);
119 pcireg_t pci_minioaddr(int port);
120 pcireg_t pci_maxioaddr(int port);
122 #endif /* _PCI_INTERNAL_H_ */