annotate packages/hal/powerpc/vads/current/src/hal_aux.c @ 461:aae52574f8c5

Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
author gthomas
date Thu, 12 Dec 2002 21:15:24 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
461
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
1 //=============================================================================
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
2 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
3 // hal_aux.c
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
4 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
5 // HAL auxiliary objects and code; per platform
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
6 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
7 //=============================================================================
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
8 //####ECOSGPLCOPYRIGHTBEGIN####
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
9 // -------------------------------------------
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
10 // This file is part of eCos, the Embedded Configurable Operating System.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
12 // Copyright (C) 2002 Gary Thomas
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
13 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
14 // eCos is free software; you can redistribute it and/or modify it under
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
15 // the terms of the GNU General Public License as published by the Free
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
16 // Software Foundation; either version 2 or (at your option) any later version.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
17 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
18 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
19 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
21 // for more details.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
22 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
23 // You should have received a copy of the GNU General Public License along
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
24 // with eCos; if not, write to the Free Software Foundation, Inc.,
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
25 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
26 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
27 // As a special exception, if other files instantiate templates or use macros
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
28 // or inline functions from this file, or you compile this file and link it
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
29 // with other works to produce a work based on this file, this file does not
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
30 // by itself cause the resulting work to be covered by the GNU General Public
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
31 // License. However the source code for this file must still be made available
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
32 // in accordance with section (3) of the GNU General Public License.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
33 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
34 // This exception does not invalidate any other reasons why a work based on
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
35 // this file might be covered by the GNU General Public License.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
36 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
37 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
38 // at http://sources.redhat.com/ecos/ecos-license/
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
39 // -------------------------------------------
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
40 //####ECOSGPLCOPYRIGHTEND####
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
41 //=============================================================================
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
42 //#####DESCRIPTIONBEGIN####
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
43 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
44 // Author(s): hmt
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
45 // Contributors:hmt
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
46 // Date: 1999-06-08
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
47 // Purpose: HAL aux objects: startup tables.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
48 // Description: Tables for per-platform initialization
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
49 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
50 //####DESCRIPTIONEND####
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
51 //
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
52 //=============================================================================
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
53
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
54 #include <pkgconf/hal.h>
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
55 #include <cyg/hal/hal_mem.h> // HAL memory definitions
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
56 #include <cyg/infra/cyg_type.h>
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
57
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
58 // The memory map is weakly defined, allowing the application to redefine
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
59 // it if necessary. The regions defined below are the minimum requirements.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
60 CYGARC_MEMDESC_TABLE CYGBLD_ATTRIB_WEAK = {
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
61 // Mapping for the Motorola MPC8260 development board
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
62 CYGARC_MEMDESC_CACHE( 0x00000000, 0x01000000 ), // Main memory 60x SDRAM
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
63 CYGARC_MEMDESC_NOCACHEGUARD( 0x04000000, 0x00400000 ), // Local Bus SDRAM
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
64 // The BCSR are actually only 8 registers, but they repeatedly map
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
65 // into the 1 MB space described here.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
66 // The BAT register uses a Block Length of 4MB so that both the BCSRs
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
67 // and the IMMR space is Managed thru the MMU. In fact, the ATM UNI
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
68 // Proc. Control is also mapped into this block.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
69 // See MPC8260 PowerQUICC II ADS User's Manual, p. 3-35, note 2
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
70 CYGARC_MEMDESC_NOCACHE( 0x04500000, 0x00400000 ), // BCSR registers
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
71 CYGARC_MEMDESC_NOCACHE( 0xff800000, 0x00800000 ), // ROM region
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
72
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
73 CYGARC_MEMDESC_TABLE_END
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
74 };
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
75
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
76 static volatile CYG_WORD *BCSR0 = (CYG_WORD *)0x04500000;
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
77 static volatile CYG_WORD *BCSR1 = (CYG_WORD *)0x04500004;
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
78 static volatile CYG_WORD *BCSR2 = (CYG_WORD *)0x04500008;
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
79
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
80 // Some macros used for debugging
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
81 #define GREEN_LED_ON (*BCSR0 &= 0xFDFFFFFF)
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
82 #define RED_LED_OFF (*BCSR0 |= 0x01000000)
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
83 #define GREEN_LED_OFF (*BCSR0 |= 0x02000000)
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
84 #define RED_LED_ON (*BCSR0 &= 0xFEFFFFFF)
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
85
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
86 //--------------------------------------------------------------------------
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
87 // Platform init code.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
88 void
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
89 hal_platform_init(void)
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
90 {
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
91 /*----------------------------------------------------------------------*/
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
92 /* Enable RS232 interface on the VADS board via BCSR1. BCSR1 is a Board */
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
93 /* Control and Status Register that resides in a programmable logic */
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
94 /* device. */
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
95 /*----------------------------------------------------------------------*/
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
96
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
97 //*BCSR1 &= 0xFFFFFFFD; /* Assert the RS232EN_1/ bit */
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
98 /* The Pilot revision of the MPC8260ADS board has moved the 8 bits
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
99 * in the 32 bit BCSR0 and BCSR1 from D24-D31 to D0-D7.
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
100 */
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
101 *BCSR1 &= 0xFDFFFFFF; /* Assert the RS232EN_1/ bit */
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
102
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
103 hal_if_init();
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
104 }
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
105
aae52574f8c5 Add support for PowerPC/8260 based platforms. Contributed by Patrick Doyle <wpd@delcomsys.com>
gthomas
parents:
diff changeset
106 // EOF hal_aux.c