source: rtems/c/src/lib/libbsp/powerpc/score603e/startup/Hwr_init.c @ d59e9b9

4.104.115
Last change on this file since d59e9b9 was d59e9b9, checked in by Joel Sherrill <joel.sherrill@…>, on 10/01/08 at 16:09:23

2008-10-01 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, preinstall.am, PCI_bus/PCI.c, PCI_bus/PCI.h, PCI_bus/universe.c, console/85c30.c, console/85c30.h, console/consolebsp.h, console/tbl85c30.c, include/gen2.h, startup/Hwr_init.c, startup/bspstart.c, startup/genpvec.c, startup/setvec.c, startup/vmeintr.c, timer/timer.c, tod/tod.c, vme/VMEConfig.h: Some clean up.
  • include/coverhd.h: Removed.
  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#include <bsp.h>
13
14#define PPC603e_SPR_HID0        1008
15#define PPC603e_SPR_HID1        1009
16#define PPC603e_SPR_IBAT0U       528
17#define PPC603e_SPR_IBAT0L       529
18#define PPC603e_SPR_DBAT0U       536
19#define PPC603e_SPR_DBAT0L       537
20#define PPC603e_SPR_IBAT1U       530
21#define PPC603e_SPR_IBAT1L       531
22#define PPC603e_SPR_DBAT1U       538
23#define PPC603e_SPR_DBAT1L       539
24#define PPC603e_SPR_IBAT2U       532
25#define PPC603e_SPR_IBAT2L       533
26#define PPC603e_SPR_DBAT2U       540
27#define PPC603e_SPR_DBAT2L       541
28#define PPC603e_SPR_IBAT3U       534
29#define PPC603e_SPR_IBAT3L       535
30#define PPC603e_SPR_DBAT3U       542
31#define PPC603e_SPR_DBAT3L       543
32#define PPC603e_SPR_DMISS        976
33#define PPC603e_SPR_DCMP         977
34#define PPC603e_SPR_HASH1        978
35#define PPC603e_SPR_HASH2        979
36#define PPC603e_SPR_IMISS        980
37#define PPC603e_SPR_ICMP         981
38#define PPC603e_SPR_RPA          982
39#define PPC603e_SPR_SDR1          25
40#define PPC603e_SPR_PVR          287
41#define PPC603e_SPR_DAR           19
42#define PPC603e_SPR_SPRG0        272
43#define PPC603e_SPR_SPRG1        273
44#define PPC603e_SPR_SPRG2        274
45#define PPC603e_SPR_SPRG3        275
46#define PPC603e_SPR_DSISR         18
47#define PPC603e_SPR_SRR0          26
48#define PPC603e_SPR_SRR1          27
49#define PPC603e_SPR_TBL_WRITE    284
50#define PPC603e_SPR_TBU_WRITE    285
51#define PPC603e_SPR_DEC           22
52#define PPC603e_SPR_IABR        1010
53#define PPC603e_SPR_EAR          282
54
55#define PCI_MEM_CMD   (SCORE603E_PCI_MEM_BASE >> 16)
56
57typedef struct {
58  uint32_t          counter_1_100;
59  uint32_t          counter_hours;
60  uint32_t          counter_min;
61  uint32_t          counter_sec;
62  uint32_t          counter_month;
63  uint32_t          counter_date;
64  uint32_t          counter_year;
65  uint32_t          counter_day_of_week;
66
67  uint32_t          RAM_1_100;
68  uint32_t          RAM_hours;
69  uint32_t          RAM_month;
70  uint32_t          RAM_date;
71  uint32_t          RAM_year;
72  uint32_t          RAM_day_of_week;
73
74  uint32_t          interupt_status_mask;
75  uint32_t          command_register;
76}Harris_RTC;
77
78void init_RTC(void)
79{
80  volatile Harris_RTC *the_RTC;
81
82  the_RTC = (volatile Harris_RTC *)BSP_RTC_ADDRESS;
83
84  the_RTC->command_register = 0x0;
85}
86
87void init_PCI(void)
88{
89  /* DINK Monitor setsup and uses all 4 BAT registers.  */
90  /* The fourth BAT register can be modified to access this area */
91
92  printk("init_PCI:\n");
93}
94
95#define PPC_Get_HID0( _value ) \
96  do { \
97      _value = 0;        /* to avoid warnings */ \
98      asm volatile( \
99          "mfspr %0, 0x3f0;"     /* get HID0 */ \
100          "isync" \
101          : "=r" (_value) \
102          : "0" (_value) \
103      ); \
104  } while (0)
105
106#define PPC_Set_HID0( _value ) \
107  do { \
108      asm volatile( \
109          "isync;" \
110          "mtspr 0x3f0, %0;"     /* load HID0 */ \
111          "isync" \
112          : "=r" (_value) \
113          : "0" (_value) \
114      ); \
115  } while (0)
116
117void instruction_cache_enable ()
118{
119  uint32_t         value;
120
121  /*
122   * Enable the instruction cache
123   */
124
125  PPC_Get_HID0( value );
126
127  value |= 0x00008000;       /* Set ICE bit */
128
129  PPC_Set_HID0( value );
130}
131
132void data_cache_enable ()
133{
134  uint32_t         value;
135
136  /*
137   * enable data cache
138   */
139
140  PPC_Get_HID0( value );
141
142  value |= 0x00004000;        /* set DCE bit */
143
144  PPC_Set_HID0( value );
145}
Note: See TracBrowser for help on using the repository browser.