1 //==========================================================================
5 // HAL misc board support definitions for Fujitsu FR-V chips
7 //==========================================================================
8 //####ECOSGPLCOPYRIGHTBEGIN####
9 // -------------------------------------------
10 // This file is part of eCos, the Embedded Configurable Operating System.
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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####
44 // Contributors: gthomas
46 // Purpose: Platform register definitions
49 //####DESCRIPTIONEND####
51 //========================================================================*/
54 #define __HAL_FRV_H__ 1
59 // Processor status register
60 #define _PSR_PIVL_SHIFT 3
61 #define _PSR_PIVL_MASK (0xF<<(_PSR_PIVL_SHIFT)) // Interrupt mask level
62 #define _PSR_S (1<<2) // Supervisor state
63 #define _PSR_PS (1<<1) // Previous supervisor state
64 #define _PSR_ET (1<<0) // Enable interrupts
65 #define _PSR_CM (1<<12) // Enable conditionals
67 // Hardware status register
68 #define _HSR0_ICE (1<<31) // Instruction cache enable
69 #define _HSR0_DCE (1<<30) // Data cache enable
70 #define _HSR0_IMMU (1<<26) // Instruction MMU enable
71 #define _HSR0_DMMU (1<<25) // Data MMU enable
73 // Debug Control Register
74 #define _DCR_EBE (1 << 30) // Exception break enable bit
75 #define _DCR_SE (1 << 29) // Single-step break enable bit
76 #define _DCR_IBM (1 << 28) // Instruction Break Mask (disable bit)
77 #define _DCR_DRBE0 (1 << 19) // READ dbar0
78 #define _DCR_DWBE0 (1 << 18) // WRITE dbar0
79 #define _DCR_DDBE0 (1 << 17) // Data-match for access to dbar0
80 #define _DCR_DBASE0 (1 << 17) // offset
81 #define _DCR_DRBE1 (1 << 16)
82 #define _DCR_DWBE1 (1 << 15)
83 #define _DCR_DDBE1 (1 << 14)
84 #define _DCR_DBASE1 (1 << 14)
85 //#define _DCR_DRBE2 (1 << 13) // 2 and 3 not supported in real hardware
86 //#define _DCR_DWBE2 (1 << 12)
87 //#define _DCR_DDBE2 (1 << 11)
88 //#define _DCR_DRBE3 (1 << 10)
89 //#define _DCR_DWBE3 (1 << 9)
90 //#define _DCR_DDBE3 (1 << 8)
91 #define _DCR_IBE0 (1 << 7)
92 #define _DCR_IBCE0 (1 << 6)
93 #define _DCR_IBE1 (1 << 5)
94 #define _DCR_IBCE1 (1 << 4)
95 #define _DCR_IBE2 (1 << 3)
96 #define _DCR_IBCE2 (1 << 2)
97 #define _DCR_IBE3 (1 << 1)
98 #define _DCR_IBCE3 (1 << 0)
100 // Break PSR Save Register
101 #define _BPSR_BS (1 << 12)
102 #define _BPSR_BET (1 << 0)
104 // Break Request Register
105 #define _BRR_EB (1 << 30)
106 #define _BRR_CB (1 << 29)
107 #define _BRR_TB (1 << 28)
108 #define _BRR_DB0 (1 << 11)
109 #define _BRR_DB1 (1 << 10)
110 #define _BRR_IB0 (1 << 7)
111 #define _BRR_IB1 (1 << 6)
112 #define _BRR_IB2 (1 << 5)
113 #define _BRR_IB3 (1 << 4)
114 #define _BRR_CBB (1 << 3)
115 #define _BRR_BB (1 << 2)
116 #define _BRR_SB (1 << 1)
117 #define _BRR_ST (1 << 0)
119 // Programmable timers
120 #define _FRVGEN_TCSR0 0xFEFF9400 // Timer 0 control/status
121 #define _FRVGEN_TCSR1 0xFEFF9408 // Timer 1 control/status
122 #define _FRVGEN_TCSR2 0xFEFF9410 // Timer 2 control/status
123 #define _FRVGEN_TCxSR_TOUT 0x80 // Status - TOUT signal
124 #define _FRVGEN_TCTR 0xFEFF9418 // Timer control
125 #define _FRVGEN_TCTR_SEL0 (0<<6) // Select timer 0
126 #define _FRVGEN_TCTR_SEL1 (1<<6) // Select timer 1
127 #define _FRVGEN_TCTR_SEL2 (2<<6) // Select timer 2
128 #define _FRVGEN_TCTR_RB (3<<6) // Timer read back
129 #define _FRVGEN_TCTR_RB_NCOUNT (1<<5) // Count data suppress
130 #define _FRVGEN_TCTR_RB_NSTATUS (1<<4) // Status data suppress
131 #define _FRVGEN_TCTR_RB_CTR2 (1<<3) // Read data for counter #2
132 #define _FRVGEN_TCTR_RB_CTR1 (1<<2) // Read data for counter #1
133 #define _FRVGEN_TCTR_RB_CTR0 (1<<1) // Read data for counter #0
134 #define _FRVGEN_TCTR_LATCH (0<<4) // Counter latch command
135 #define _FRVGEN_TCTR_R8LO (1<<4) // Read low 8 bits
136 #define _FRVGEN_TCTR_R8HI (2<<4) // Read high 8 bits
137 #define _FRVGEN_TCTR_RLOHI (3<<4) // Read/write 8 lo then 8 hi
138 #define _FRVGEN_TCTR_MODE0 (0<<1) // Mode 0 - terminal interrupt count
139 #define _FRVGEN_TCTR_MODE2 (2<<1) // Mode 2 - rate generator
140 #define _FRVGEN_TCTR_MODE4 (4<<1) // Mode 4 - software trigger strobe
141 #define _FRVGEN_TCTR_MODE5 (5<<1) // Mode 5 - hardware trigger strobe
142 #define _FRVGEN_TPRV 0xFEFF9420 // Timer prescale
143 #define _FRVGEN_TPRCKSL 0xFEFF9428 // Prescale clock
144 #define _FRVGEN_TCKSL0 0xFEFF9430 // Timer 0 clock select
145 #define _FRVGEN_TCKSL1 0xFEFF9438 // Timer 1 clock select
146 #define _FRVGEN_TCKSL2 0xFEFF9440 // Timer 2 clock select
148 // Interrupt & clock control
149 #define _FRVGEN_CLK_CTRL 0xFEFF9A00 // Clock control
150 #define _FRVGEN_CLK_CTRL_P0 (1<<8) // division rate of bus and resource clocks
151 #define _FRVGEN_IRC_TM0 0xFEFF9800 // Trigger mode 0 register (unused)
152 #define _FRVGEN_IRC_TM1 0xFEFF9808 // Trigger mode 1 register
153 #define _FRVGEN_IRC_RS 0xFEFF9810 // Request sense
154 #define _FRVGEN_IRC_RC 0xFEFF9818 // Request clear
155 #define _FRVGEN_IRC_MASK 0xFEFF9820 // Mask
156 #define _FRVGEN_IRC_IRL 0xFEFF9828 // Interrupt level read (encoded)
157 #define _FRVGEN_IRC_IRR0 0xFEFF9840 // Interrupt routing #0 (unused)
158 #define _FRVGEN_IRC_IRR1 0xFEFF9848 // Interrupt routing #1 (unused)
159 #define _FRVGEN_IRC_IRR2 0xFEFF9850 // Interrupt routing #2 (unused)
160 #define _FRVGEN_IRC_IRR3 0xFEFF9858 // Interrupt routing #3
161 #define _FRVGEN_IRC_IRR4 0xFEFF9860 // Interrupt routing #4
162 #define _FRVGEN_IRC_IRR5 0xFEFF9868 // Interrupt routing #5
163 #define _FRVGEN_IRC_IRR6 0xFEFF9870 // Interrupt routing #6
164 #define _FRVGEN_IRC_IRR7 0xFEFF9878 // Interrupt routing #7
165 #define _FRVGEN_IRC_ITM0 0xFEFF9880 // Internal trigger mode #0
166 #define _FRVGEN_IRC_ITM1 0xFEFF9888 // Internal trigger mode #1
168 // Serial ports - 16550 compatible
169 #define _FRVGEN_UART0 0xFEFF9C00
170 #define _FRVGEN_UART1 0xFEFF9C40
172 // Serial port prescaler
173 #define _FRVGEN_UCPSR 0xFEFF9C90
174 #define _FRVGEN_UCPVR 0xFEFF9C98
177 #define _FRVGEN_HW_RESET_STAT_P (1<<10) // Last reset was power-on
178 #define _FRVGEN_HW_RESET_STAT_H (1<<9) // Last reset was hard reset
179 #define _FRVGEN_HW_RESET_STAT_S (1<<8) // Last reset was soft reset
180 #define _FRVGEN_HW_RESET_HR (1<<1) // Force hard reset
181 #define _FRVGEN_HW_RESET_SR (1<<0) // Force soft reset
183 #endif // __HAL_FRV_H__