1 /*=============================================================================
5 // HAL Support for Kernel Diagnostic Routines
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.
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.
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
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.
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.
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.
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####
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>
50 //####DESCRIPTIONEND####
52 //===========================================================================*/
54 #ifndef CYGONCE_HAL_DIAG_H
55 #define CYGONCE_HAL_DIAG_H
57 #include <pkgconf/hal.h>
58 #include <cyg/infra/cyg_type.h>
60 #if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG)
62 #include <cyg/hal/hal_if.h>
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_)
69 #else // old way of doing diagnostic I/O
71 /*---------------------------------------------------------------------------*/
72 /* functions implemented in hal_diag.c (old way without virtual vectors) */
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);
78 /*---------------------------------------------------------------------------*/
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_)
84 #endif /* CYGSEM_HAL_VIRTUAL_VECTOR_DIAG */
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
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
110 #define CYG_HAL_FR30_MB91301_PDRJ 0x13
111 #define CYG_HAL_FR30_MB91301_DDRJ 0x403
112 #define CYG_HAL_FR30_MB91301_PFRJ 0x413
114 /*---------------------------------------------------------------------------*/
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
123 // externC void hal_diag_init_led(void);
124 externC void hal_diag_led(cyg_uint8);
126 /*---------------------------------------------------------------------------*/
127 /* end of hal_diag.h */
128 #endif /* CYGONCE_HAL_DIAG_H */