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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [sh/] [dreamcast/] [current/] [include/] [plf_io.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_PLF_IO_H
2
#define CYGONCE_PLF_IO_H
3
//=============================================================================
4
//
5
//      plf_io.h
6
//
7
//      Platform specific IO support
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 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):    t@keshi.org
45
// Contributors: t@keshi.org
46
// Date:         2001-07-30
47
// Purpose:      Dreamcast PCI IO support macros
48
// Description: 
49
// Usage:        #include <cyg/hal/plf_io.h>
50
//
51
//####DESCRIPTIONEND####
52
//
53
//=============================================================================
54
 
55
#include <cyg/hal/hal_io.h>
56
#include <cyg/hal/hal_intr.h>
57
 
58
extern cyg_uint32 cyg_hal_plf_pci_cfg_read_dword (cyg_uint32 bus,
59
                                                  cyg_uint32 devfn,
60
                                                  cyg_uint32 offset);
61
extern cyg_uint16 cyg_hal_plf_pci_cfg_read_word  (cyg_uint32 bus,
62
                                                  cyg_uint32 devfn,
63
                                                  cyg_uint32 offset);
64
extern cyg_uint8 cyg_hal_plf_pci_cfg_read_byte   (cyg_uint32 bus,
65
                                                  cyg_uint32 devfn,
66
                                                  cyg_uint32 offset);
67
extern void cyg_hal_plf_pci_cfg_write_dword (cyg_uint32 bus,
68
                                             cyg_uint32 devfn,
69
                                             cyg_uint32 offset,
70
                                             cyg_uint32 val);
71
extern void cyg_hal_plf_pci_cfg_write_word  (cyg_uint32 bus,
72
                                             cyg_uint32 devfn,
73
                                             cyg_uint32 offset,
74
                                             cyg_uint16 val);
75
extern void cyg_hal_plf_pci_cfg_write_byte   (cyg_uint32 bus,
76
                                              cyg_uint32 devfn,
77
                                              cyg_uint32 offset,
78
                                              cyg_uint8 val);
79
 
80
// Initialize the PCI bus.
81
externC void cyg_hal_plf_pci_init(void);
82
#define HAL_PCI_INIT() cyg_hal_plf_pci_init()
83
 
84
// Read a value from the PCI configuration space of the appropriate
85
// size at an address composed from the bus, devfn and offset.
86
#define HAL_PCI_CFG_READ_UINT8( __bus, __devfn, __offset, __val )  \
87
    __val = cyg_hal_plf_pci_cfg_read_byte((__bus),  (__devfn), (__offset))
88
 
89
#define HAL_PCI_CFG_READ_UINT16( __bus, __devfn, __offset, __val ) \
90
    __val = cyg_hal_plf_pci_cfg_read_word((__bus),  (__devfn), (__offset))
91
 
92
#define HAL_PCI_CFG_READ_UINT32( __bus, __devfn, __offset, __val ) \
93
    __val = cyg_hal_plf_pci_cfg_read_dword((__bus),  (__devfn), (__offset))
94
 
95
// Write a value to the PCI configuration space of the appropriate
96
// size at an address composed from the bus, devfn and offset.
97
#define HAL_PCI_CFG_WRITE_UINT8( __bus, __devfn, __offset, __val )  \
98
    cyg_hal_plf_pci_cfg_write_byte((__bus),  (__devfn), (__offset), (__val))
99
 
100
#define HAL_PCI_CFG_WRITE_UINT16( __bus, __devfn, __offset, __val ) \
101
    cyg_hal_plf_pci_cfg_write_word((__bus),  (__devfn), (__offset), (__val))
102
 
103
#define HAL_PCI_CFG_WRITE_UINT32( __bus, __devfn, __offset, __val ) \
104
    cyg_hal_plf_pci_cfg_write_dword((__bus),  (__devfn), (__offset), (__val))
105
 
106
 
107
#define HAL_PCI_TRANSLATE_INTERRUPT( __bus, __devfn, __vec, __valid) \
108
        CYG_MACRO_START \
109
        __valid = true; \
110
        __vec = CYGNUM_HAL_INTERRUPT_LVL11; \
111
        CYG_MACRO_END
112
 
113
#define HAL_PCI_ALLOC_BASE_MEMORY 0
114
#define HAL_PCI_ALLOC_BASE_IO     0
115
 
116
#define HAL_PCI_PHYSICAL_MEMORY_BASE    0x00000000
117
#define HAL_PCI_PHYSICAL_IO_BASE        0x00000000
118
 
119
#define CYGARC_PCI_DMA_ADDRESS(_x_) ((_x_) & 0x1fffffff)
120
 
121
//-----------------------------------------------------------------------------
122
#endif // ifndef CYGONCE_PLF_IO_H
123
// End of plf_io.h

powered by: WebSVN 2.1.0

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