1 |
27 |
unneback |
##=============================================================================
|
2 |
|
|
##
|
3 |
|
|
## variant.S
|
4 |
|
|
##
|
5 |
|
|
## POWERPC MPC8xx variant code
|
6 |
|
|
##
|
7 |
|
|
##=============================================================================
|
8 |
|
|
#####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 2003 Bart Veer
|
12 |
|
|
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
13 |
|
|
## Copyright (C) 2002, 2003 Gary Thomas
|
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 version.
|
18 |
|
|
##
|
19 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
20 |
|
|
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
21 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
22 |
|
|
## for more details.
|
23 |
|
|
##
|
24 |
|
|
## You should have received a copy of the GNU General Public License along
|
25 |
|
|
## with eCos; if not, write to the Free Software Foundation, Inc.,
|
26 |
|
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
27 |
|
|
##
|
28 |
|
|
## As a special exception, if other files instantiate templates or use macros
|
29 |
|
|
## or inline functions from this file, or you compile this file and link it
|
30 |
|
|
## with other works to produce a work based on this file, this file does not
|
31 |
|
|
## by itself cause the resulting work to be covered by the GNU General Public
|
32 |
|
|
## License. However the source code for this file must still be made available
|
33 |
|
|
## in accordance with section (3) of the GNU General Public License.
|
34 |
|
|
##
|
35 |
|
|
## This exception does not invalidate any other reasons why a work based on
|
36 |
|
|
## this file might be covered by the GNU General Public License.
|
37 |
|
|
##
|
38 |
|
|
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
39 |
|
|
## at http://sources.redhat.com/ecos/ecos-license/
|
40 |
|
|
## -------------------------------------------
|
41 |
|
|
#####ECOSGPLCOPYRIGHTEND####
|
42 |
|
|
##=============================================================================
|
43 |
|
|
#######DESCRIPTIONBEGIN####
|
44 |
|
|
##
|
45 |
|
|
## Author(s): jskov
|
46 |
|
|
## Contributors:jskov, gthomas
|
47 |
|
|
## Date: 2000-02-04
|
48 |
|
|
## Purpose: PowerPC MPC8xx variant code
|
49 |
|
|
## Description: Variant specific code for PowerPC MPC8xx CPUs.
|
50 |
|
|
##
|
51 |
|
|
######DESCRIPTIONEND####
|
52 |
|
|
##
|
53 |
|
|
##=============================================================================
|
54 |
|
|
|
55 |
|
|
#include
|
56 |
|
|
#include /* on-chip resource layout, special */
|
57 |
|
|
/* registers, IMM layout... */
|
58 |
|
|
|
59 |
|
|
#ifdef CYGPKG_HAL_QUICC
|
60 |
|
|
#include /* more of the same */
|
61 |
|
|
#endif
|
62 |
|
|
|
63 |
|
|
#---------------------------------------------------------------------------
|
64 |
|
|
# Interrupt vector tables.
|
65 |
|
|
# These tables contain the isr, data and object pointers used to deliver
|
66 |
|
|
# interrupts to user code.
|
67 |
|
|
|
68 |
|
|
.data
|
69 |
|
|
|
70 |
|
|
.extern hal_default_decrementer_isr
|
71 |
|
|
.extern hal_default_isr
|
72 |
|
|
|
73 |
|
|
.globl hal_interrupt_handlers
|
74 |
|
|
hal_interrupt_handlers:
|
75 |
|
|
.long hal_default_decrementer_isr
|
76 |
|
|
.rept CYGNUM_HAL_ISR_COUNT-1
|
77 |
|
|
.long hal_default_isr
|
78 |
|
|
.endr
|
79 |
|
|
|
80 |
|
|
.globl hal_interrupt_data
|
81 |
|
|
hal_interrupt_data:
|
82 |
|
|
.rept CYGNUM_HAL_ISR_COUNT
|
83 |
|
|
.long 0
|
84 |
|
|
.endr
|
85 |
|
|
|
86 |
|
|
.globl hal_interrupt_objects
|
87 |
|
|
hal_interrupt_objects:
|
88 |
|
|
.rept CYGNUM_HAL_ISR_COUNT
|
89 |
|
|
.long 0
|
90 |
|
|
.endr
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
#---------------------------------------------------------------------------
|
94 |
|
|
# Hard reset support
|
95 |
|
|
#
|
96 |
|
|
|
97 |
|
|
.text
|
98 |
|
|
.globl _mpc8xx_reset
|
99 |
|
|
_mpc8xx_reset:
|
100 |
|
|
#ifdef CYGPKG_HAL_QUICC
|
101 |
|
|
lwi r4,CYGARC_REG_IMM_BASE # base address of control registers
|
102 |
|
|
|
103 |
|
|
// Enable checkstop reset
|
104 |
|
|
lwz r3,PLPRCR(r4)
|
105 |
|
|
ori r3,r3,0x0080 // Bit 24
|
106 |
|
|
stw r3,PLPRCR(r4)
|
107 |
|
|
mfmsr r3
|
108 |
|
|
lwi r5,~CYGARC_REG_MSR_ME
|
109 |
|
|
and r3,r3,r5
|
110 |
|
|
mtmsr r3
|
111 |
|
|
|
112 |
|
|
// Pull the plug by disabling CS0 & CS1. This will cause a checkstop.
|
113 |
|
|
li r0,0
|
114 |
|
|
stw r0,BR0(r4)
|
115 |
|
|
stw r0,BR1(r4)
|
116 |
|
|
lwi r3,_end
|
117 |
|
|
10: nop
|
118 |
|
|
lwzu r3,4(r2) // Force a memory access
|
119 |
|
|
b 10b
|
120 |
|
|
#else
|
121 |
|
|
10: nop
|
122 |
|
|
b 10b
|
123 |
|
|
#endif
|
124 |
|
|
|
125 |
|
|
##-----------------------------------------------------------------------------
|
126 |
|
|
## end of variant.S
|