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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [mips/] [vrc437x/] [current/] [include/] [plf_z8530.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_HAL_PLF_Z8530_H
2
#define CYGONCE_HAL_PLF_Z8530_H
3
 
4
//=============================================================================
5
//
6
//      plf_z8530.h
7
//
8
//      Platform header for Z8530 support.
9
//
10
//=============================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
12
// -------------------------------------------                              
13
// This file is part of eCos, the Embedded Configurable Operating System.   
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under    
17
// the terms of the GNU General Public License as published by the Free     
18
// Software Foundation; either version 2 or (at your option) any later      
19
// version.                                                                 
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT      
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
24
// for more details.                                                        
25
//
26
// You should have received a copy of the GNU General Public License        
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
29
//
30
// As a special exception, if other files instantiate templates or use      
31
// macros or inline functions from this file, or you compile this file      
32
// and link it with other works to produce a work based on this file,       
33
// this file does not by itself cause the resulting work to be covered by   
34
// the GNU General Public License. However the source code for this file    
35
// must still be made available in accordance with section (3) of the GNU   
36
// General Public License v2.                                               
37
//
38
// This exception does not invalidate any other reasons why a work based    
39
// on this file might be covered by the GNU General Public License.         
40
// -------------------------------------------                              
41
// ####ECOSGPLCOPYRIGHTEND####                                              
42
//=============================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):   nickg
46
// Contributors:nickg
47
// Date:        1999-05-21
48
// Purpose:     Platform HAL Z8530 support.
49
// Usage:       #include <cyg/hal/plf_z8530.h>
50
//              
51
//####DESCRIPTIONEND####
52
//
53
//=============================================================================
54
 
55
#include <pkgconf/hal.h>
56
 
57
/*---------------------------------------------------------------------------*/
58
/* Zilog Z8530 access macros.                                                */
59
 
60
#if defined(CYGPKG_HAL_MIPS_LSBFIRST)
61
# define DUART_BASE      0xc1000000
62
#elif defined(CYGPKG_HAL_MIPS_MSBFIRST)
63
# define DUART_BASE      0xc1000003
64
#else
65
#error MIPS endianness not defined by configuration
66
#endif
67
 
68
// Address offsets for DUART channels
69
#define DUART_A         4
70
#define DUART_B         0
71
 
72
/* Require Delay between Zilog chip (Z8530 and Z8536) register access */
73
 
74
//#define ZDEL    66              /* 66 Instructions for 66Mhz */
75
#define ZDEL    200              /* 200 Instructions for 133Mhz */
76
 
77
#define DELAY_ZACC\
78
        { register int N = ZDEL; while (--N > 0); }
79
 
80
 
81
#define HAL_DUART_READ_CR( _chan_, _reg_, _val_)        \
82
CYG_MACRO_START                                         \
83
    if( (_reg_) != 0 )                                  \
84
    {                                                   \
85
        DELAY_ZACC;                                     \
86
        HAL_WRITE_UINT8( DUART_BASE+(_chan_), _reg_);   \
87
    }                                                   \
88
    DELAY_ZACC;                                         \
89
    HAL_READ_UINT8( DUART_BASE+(_chan_), _val_ );       \
90
CYG_MACRO_END
91
 
92
#define HAL_DUART_WRITE_CR( _chan_, _reg_, _val_ )      \
93
CYG_MACRO_START                                         \
94
    if( (_reg_) != 0 )                                  \
95
    {                                                   \
96
        DELAY_ZACC;                                     \
97
        HAL_WRITE_UINT8( DUART_BASE+(_chan_), _reg_);   \
98
    }                                                   \
99
    DELAY_ZACC;                                         \
100
    HAL_WRITE_UINT8( DUART_BASE+(_chan_), _val_ );      \
101
CYG_MACRO_END
102
 
103
#define HAL_DUART_WRITE_TR( _chan_, _val_ )             \
104
CYG_MACRO_START                                         \
105
    DELAY_ZACC;                                         \
106
    HAL_WRITE_UINT8( DUART_BASE+(_chan_)+8, _val_ );    \
107
CYG_MACRO_END
108
 
109
#define HAL_DUART_READ_RR( _chan_, _val_ )              \
110
CYG_MACRO_START                                         \
111
    DELAY_ZACC;                                         \
112
    HAL_READ_UINT8( DUART_BASE+(_chan_)+8, _val_ );     \
113
CYG_MACRO_END
114
 
115
//-----------------------------------------------------------------------------
116
#endif // CYGONCE_HAL_PLF_Z8530_H
117
// End of plf_z8530.h

powered by: WebSVN 2.1.0

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