]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/fr30/mb91301/v2_0/include/hal_diag.h
Initial revision
[karo-tx-redboot.git] / packages / hal / fr30 / mb91301 / v2_0 / include / hal_diag.h
1 /*=============================================================================
2 //
3 //      hal_diag.h
4 //
5 //      HAL Support for Kernel Diagnostic Routines
6 //
7 //=============================================================================
8 //####ECOSGPLCOPYRIGHTBEGIN####
9 // -------------------------------------------
10 // This file is part of eCos, the Embedded Configurable Operating System.
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12 //
13 // eCos is free software; you can redistribute it and/or modify it under
14 // the terms of the GNU General Public License as published by the Free
15 // Software Foundation; either version 2 or (at your option) any later version.
16 //
17 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20 // for more details.
21 //
22 // You should have received a copy of the GNU General Public License along
23 // with eCos; if not, write to the Free Software Foundation, Inc.,
24 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 //
26 // As a special exception, if other files instantiate templates or use macros
27 // or inline functions from this file, or you compile this file and link it
28 // with other works to produce a work based on this file, this file does not
29 // by itself cause the resulting work to be covered by the GNU General Public
30 // License. However the source code for this file must still be made available
31 // in accordance with section (3) of the GNU General Public License.
32 //
33 // This exception does not invalidate any other reasons why a work based on
34 // this file might be covered by the GNU General Public License.
35 //
36 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 // at http://sources.redhat.com/ecos/ecos-license/
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 //=============================================================================
41 //#####DESCRIPTIONBEGIN####
42 //
43 // Author(s):   larsi
44 // Contributors:
45 // Date:        2007-07-09
46 // Purpose:     HAL Support for Kernel Diagnostic Routines
47 // Description: Diagnostic routines for use during kernel development.
48 // Usage:       #include <cyg/hal/hal_diag.h>
49 //
50 //####DESCRIPTIONEND####
51 //
52 //===========================================================================*/
53
54 #ifndef CYGONCE_HAL_DIAG_H
55 #define CYGONCE_HAL_DIAG_H
56
57 #include <pkgconf/hal.h>
58 #include <cyg/infra/cyg_type.h>
59
60 #if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
61
62 #include <cyg/hal/hal_if.h>
63
64 #define HAL_DIAG_INIT() hal_if_diag_init()
65 #define HAL_DIAG_WRITE_CHAR(_c_) hal_if_diag_write_char(_c_)
66 #define HAL_DIAG_READ_CHAR(_c_) hal_if_diag_read_char(&_c_)
67
68
69 #else // old way of doing diagnostic I/O
70
71 /*---------------------------------------------------------------------------*/
72 /* functions implemented in hal_diag.c (old way without virtual vectors)     */
73
74 externC void hal_diag_init(void);
75 externC void hal_diag_write_char(char c);
76 externC void hal_diag_read_char(char *c);
77
78 /*---------------------------------------------------------------------------*/
79
80 #define HAL_DIAG_INIT() hal_diag_init()
81 #define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_)
82 #define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_)
83
84 #endif  /* CYGSEM_HAL_VIRTUAL_VECTOR_DIAG */
85
86 /*---------------------------------------------------------------------------*/
87 // serial port0 defines
88 #define CYG_HAL_FR30_MB91301_SMR0     0x63
89 #define CYG_HAL_FR30_MB91301_SCR0     0x62
90 #define CYG_HAL_FR30_MB91301_SIDR0    0x61
91 #define CYG_HAL_FR30_MB91301_SODR0    0x61
92 #define CYG_HAL_FR30_MB91301_SSR0     0x60
93 #define CYG_HAL_FR30_MB91301_UTIM0    0x64
94 #define CYG_HAL_FR30_MB91301_UTIMR0   0x64
95 #define CYG_HAL_FR30_MB91301_DRCL0    0x66
96 #define CYG_HAL_FR30_MB91301_UTIMC0   0x67
97
98 /*---------------------------------------------------------------------------*/
99 // serial port1 defines
100 #define CYG_HAL_FR30_MB91301_SMR1     0x6b
101 #define CYG_HAL_FR30_MB91301_SCR1     0x6a
102 #define CYG_HAL_FR30_MB91301_SIDR1    0x69
103 #define CYG_HAL_FR30_MB91301_SODR1    0x69
104 #define CYG_HAL_FR30_MB91301_SSR1     0x68
105 #define CYG_HAL_FR30_MB91301_UTIM1    0x6c
106 #define CYG_HAL_FR30_MB91301_UTIMR1   0x6c
107 #define CYG_HAL_FR30_MB91301_DRCL1    0x6e
108 #define CYG_HAL_FR30_MB91301_UTIMC1   0x6f
109
110 #define CYG_HAL_FR30_MB91301_PDRJ 0x13
111 #define CYG_HAL_FR30_MB91301_DDRJ 0x403
112 #define CYG_HAL_FR30_MB91301_PFRJ 0x413
113
114 /*---------------------------------------------------------------------------*/
115 // LED
116 #define CYG_HAL_FR30_MB91301_PDRG 0x10
117 #define CYG_HAL_FR30_MB91301_DDRG 0x400
118 #define CYG_HAL_FR30_MB91301_PFRG 0x410
119 // our MB91302A does not have PCRG (pull up resistor register G)
120 // but it is here anyway
121 #define CYG_HAL_FR30_MB91301_PCRG 0x420
122
123 // externC void hal_diag_init_led(void);
124 externC void hal_diag_led(cyg_uint8);
125
126 /*---------------------------------------------------------------------------*/
127 /* end of hal_diag.h                                                         */
128 #endif /* CYGONCE_HAL_DIAG_H */