OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [io/] [pci/] [current/] [include/] [pci_hw.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_PCI_HW_H
2
#define CYGONCE_PCI_HW_H
3
//=============================================================================
4
//
5
//      pci_hw.h
6
//
7
//      PCI hardware library
8
//
9
//=============================================================================
10
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
11
// -------------------------------------------                              
12
// This file is part of eCos, the Embedded Configurable Operating System.   
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under    
16
// the terms of the GNU General Public License as published by the Free     
17
// Software Foundation; either version 2 or (at your option) any later      
18
// version.                                                                 
19
//
20
// eCos is distributed in the hope that it will be useful, but WITHOUT      
21
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
22
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
23
// for more details.                                                        
24
//
25
// You should have received a copy of the GNU General Public License        
26
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
27
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
28
//
29
// As a special exception, if other files instantiate templates or use      
30
// macros or inline functions from this file, or you compile this file      
31
// and link it with other works to produce a work based on this file,       
32
// this file does not by itself cause the resulting work to be covered by   
33
// the GNU General Public License. However the source code for this file    
34
// must still be made available in accordance with section (3) of the GNU   
35
// General Public License v2.                                               
36
//
37
// This exception does not invalidate any other reasons why a work based    
38
// on this file might be covered by the GNU General Public License.         
39
// -------------------------------------------                              
40
// ####ECOSGPLCOPYRIGHTEND####                                              
41
//=============================================================================
42
//#####DESCRIPTIONBEGIN####
43
//
44
// Author(s):    jskov, from design by nickg 
45
// Contributors: jskov
46
// Date:         1999-08-09
47
// Purpose:      PCI hardware configuration access
48
// Usage:
49
//              #include <cyg/io/pci_hw.h>
50
// Description: 
51
//          This API is used by the PCI library to access the PCI bus
52
//          configuration space. Although this should not normally be
53
//          necessary, this API may also be used by device driver or 
54
//          application code to perform PCI bus operations not supported
55
//          by the PCI library.
56
//
57
//####DESCRIPTIONEND####
58
//
59
//=============================================================================
60
 
61
// Rely on hal_io.h to include plf_io.h if it exists for the selected target.
62
#include <cyg/hal/hal_io.h>             // HAL_PCI_ macros
63
 
64
#ifdef HAL_PCI_INIT
65
 
66
// This varible selects whether the PCI library gets built (requires
67
// HAL_PCI_INIT to be defined by the platform io header file)
68
#define CYG_PCI_PRESENT
69
 
70
#include <cyg/infra/cyg_type.h>
71
 
72
#include <cyg/io/pci_cfg.h>
73
 
74
 
75
// This is the lowest level where devfns are used.
76
#define CYG_PCI_DEV_MAKE_DEVFN(__dev, __fn) (((__dev)<<3)|(__fn))
77
#define CYG_PCI_DEV_GET_DEV(__devfn) ((__devfn>>3)&0x1f)
78
#define CYG_PCI_DEV_GET_FN(__devfn) (__devfn&0x7)
79
 
80
// Some buggy PCI chips force us to ignore certain devices so that
81
// they may be handled specially.
82
#ifdef HAL_PCI_IGNORE_DEVICE
83
#define CYG_PCI_IGNORE_DEVICE(__bus, __dev, __fn) \
84
            HAL_PCI_IGNORE_DEVICE((__bus), (__dev), (__fn))
85
#else
86
#define CYG_PCI_IGNORE_DEVICE(__bus, __dev, __fn) 0
87
#endif
88
 
89
// Ignore certain BARs at discretion of HAL
90
#ifdef HAL_PCI_IGNORE_BAR
91
#define CYG_PCI_IGNORE_BAR(__dinfo, __bar) \
92
            HAL_PCI_IGNORE_BAR((__dinfo), (__bar))
93
#else
94
#define CYG_PCI_IGNORE_BAR(__dinfo, __bar) 0
95
#endif
96
 
97
 
98
// Init
99
externC void cyg_pcihw_init(void);
100
 
101
// Read functions
102
externC void cyg_pcihw_read_config_uint8( cyg_uint8 bus, cyg_uint8 devfn,
103
                                          cyg_uint8 offset, cyg_uint8 *val);
104
externC void cyg_pcihw_read_config_uint16( cyg_uint8 bus, cyg_uint8 devfn,
105
                                           cyg_uint8 offset, cyg_uint16 *val);
106
externC void cyg_pcihw_read_config_uint32( cyg_uint8 bus, cyg_uint8 devfn,
107
                                           cyg_uint8 offset, cyg_uint32 *val);
108
 
109
// Write functions
110
externC void cyg_pcihw_write_config_uint8( cyg_uint8 bus, cyg_uint8 devfn,
111
                                           cyg_uint8 offset, cyg_uint8 val);
112
externC void cyg_pcihw_write_config_uint16( cyg_uint8 bus, cyg_uint8 devfn,
113
                                            cyg_uint8 offset, cyg_uint16 val);
114
externC void cyg_pcihw_write_config_uint32( cyg_uint8 bus, cyg_uint8 devfn,
115
                                            cyg_uint8 offset, cyg_uint32 val);
116
 
117
// Interrupt translation
118
externC cyg_bool cyg_pcihw_translate_interrupt( cyg_uint8 bus, cyg_uint8 devfn,
119
                                                CYG_ADDRWORD *vec);
120
 
121
#endif // ifdef HAL_PCI_INIT
122
 
123
//-----------------------------------------------------------------------------
124
#endif // ifndef CYGONCE_PCI_HW_H
125
// End of pci_hw.h
126
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.