source: rtems/c/src/lib/libbsp/powerpc/score603e/startup/82378zb.c @ 9c448e1

4.104.114.84.95
Last change on this file since 9c448e1 was 9c448e1, checked in by Joel Sherrill <joel.sherrill@…>, on 02/19/99 at 00:22:33

BSP for Vista Score603e added.

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*  82378zb.c
2 *
3 *  COPYRIGHT (c) 1989-1997.
4 *  On-Line Applications Research Corporation (OAR).
5 *  Copyright assigned to U.S. Government, 1994.
6 *
7 *  The license and distribution terms for this file may in
8 *  the file LICENSE in this distribution or at
9 *  http://www.OARcorp.com/rtems/license.html.
10 *
11 *  $Id:
12 */
13#include <bsp.h>
14#include <rtems/libio.h>
15
16#include <libcsupport.h>
17
18#include <string.h>
19#include <fcntl.h>
20#include <assert.h>
21/*
22 * initialize 82378zb
23 */
24void initialize_PCI_bridge ()
25{
26
27  /*
28   * INT CNTRL-1 ICW1
29   *            LTIM and ICW4
30   */
31  Write_82378ZB( 0x20, 0x19);
32 
33  /*
34   * INT CNTRL-1 ICW 2
35   *     Sets 5 msbs of the base address in the interrupt vector table
36   *     for the vector  routines to  0100 0 ??
37   */
38  Write_82378ZB( 0x21, 0x40 );
39 
40  /*
41   * INT CNTRL-1 ICW 3
42   *     Cascade CNTRL-2 INT output to IRQ[2] input of CNTRL-1
43   */
44  Write_82378ZB( 0x21, 0x04 );
45 
46  /*
47   * INT CNTRL-1 ICW 4
48   *     Set Microprocessor mode for 80x86 system.
49   */
50  Write_82378ZB( 0x21, 0x01 );
51 
52  /*
53   * INT CNTRL-1 OCW 2 
54   *     Set Non-specific EOI command
55   */
56  Write_82378ZB( 0x20, 0x20 );
57 
58  /*
59   * INT CNTRL-1 OCW 3 
60   *     Interrupt controller in normal mask mode.
61   *     Disable Poll mode command
62   *     Read IRQ register.
63   */
64  Write_82378ZB( 0x20, 0x2a );
65 
66  /*
67   * INT CNTRL-1 OCW 1
68   *     Write Interrupt Request mask for IRQ[7:0].  An interrupt request for
69   *     a masked IRQ will not set the interrupt request register (IRR) bit for
70   *     that channel.
71   *
72   *     XXXX - Was 0xfd Only allowing Timer interrupt through changed to
73   *            0xe1.
74   */
75  Write_82378ZB( 0x21, 0xe1 );
76 
77  /*
78   * INT CNTRL-2 ICW 1
79   *            LTIM and ICW4
80   */
81  Write_82378ZB( 0xa0, 0x19 );
82 
83  /*
84   * INT CNTRL-2 ICW 2
85   *     Sets 5 msbs of the base address in the interrupt vector table
86   *     for the vector  routines to  0100 1 ??
87   */
88  Write_82378ZB( 0xa1, 0x48 );
89 
90  /*
91   * INT CNTRL-1 ICW 3
92   *     Slave Identification Code (Must be intialized to 2).
93   */
94  Write_82378ZB( 0xa1, 0x02 );
95 
96  /*
97   * INT CNTRL-1 ICW 4
98   *     Set Microprocessor mode for 80x86 system.
99   */
100  Write_82378ZB( 0xa1, 0x01 );
101 
102  /*
103   * INT CNTRL-1 OCW 2 
104   *     Set Non-specific EOI command
105   */
106  Write_82378ZB( 0xa0, 0x20 );
107 
108  /*
109   * INT CNTRL-1 OCW 3 
110   *     Interrupt controller in normal mask mode.
111   *     Disable Poll mode command
112   *     Read IRQ register.
113   */
114  Write_82378ZB( 0xa0, 0x2a );
115 
116  /*
117   * INT CNTRL-1 OCW 1
118   *     Write Interrupt Request mask for IRQ[7:0].  An interrupt request for
119   *     a masked IRQ will not set the interrupt request register (IRR) bit for
120   *     that channel.
121   *
122   *     XXXX - All interrupts masked.
123   */
124  Write_82378ZB( 0xa1, 0xff );
125}
126
127
128rtems_unsigned16 read_and_clear_irq ()
129{
130  rtems_unsigned16 irq;
131
132  /*
133   * XXX - Fix this for all interrupts later
134   */
135
136  Write_82378ZB( 0x20, 0x0c);
137  Read_82378ZB( 0x20, irq );
138  irq &= 0x7; 
139  Write_82378ZB( 0x20, 0x20 );
140 
141  return irq;
142}
143
144void init_irq_data_register()
145{
146  assert (0);
147}
148rtems_unsigned16 get_irq_mask()
149{
150  assert (0);
151  return 0;
152}
153void set_irq_mask(
154  rtems_unsigned16 value
155)
156{
157  assert (0);
158}
Note: See TracBrowser for help on using the repository browser.