source: rtems/c/src/lib/libbsp/powerpc/score603e/PCI_bus/flash.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: 2.7 KB
Line 
1/*
2 *
3 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
4 *  On-Line Applications Research Corporation (OAR).
5 *  All rights assigned to U.S. Government, 1994.
6 *
7 *  This material may be reproduced by or for the U.S. Government pursuant
8 *  to the copyright license under the clause at DFARS 252.227-7013.  This
9 *  notice must appear in all copies of this file and its derivatives.
10 *
11 * $ld:
12 */
13
14#include <rtems.h>
15#include <assert.h>
16#include <stdio.h>
17
18#include <bsp.h>
19#include "PCI.h"
20/*PAGE
21 *
22 *  SCORE603e_FLASH_Disable
23 */
24
25unsigned int SCORE603e_FLASH_Disable(
26  rtems_unsigned32               area                           /* IN  */
27)
28{
29  rtems_unsigned8 value;
30 
31  value = *SCORE603E_BOARD_CTRL_REG;
32  value = value | (~SCORE603E_BRD_FLASH_DISABLE_MASK);
33  *SCORE603E_BOARD_CTRL_REG = value;
34
35  return RTEMS_SUCCESSFUL;
36}
37
38unsigned int SCORE603e_FLASH_verify_enable()
39{
40  volatile rtems_unsigned8 *Ctrl_Status_Register =
41           (void *)SCORE603E_BOARD_CTRL_REG;
42  rtems_unsigned8  ctrl_value;
43  rtems_unsigned32 pci_value;
44
45  ctrl_value = *Ctrl_Status_Register;
46  if ( ctrl_value & SCORE603E_BRD_FLASH_DISABLE_MASK ) {
47    printf ("Flash Writes Disabled by board control register %x\n",
48            ctrl_value );
49    assert( 0x0 );
50  }
51
52  pci_value = Read_pci_device_register( 0x800000A8 );
53  if (( pci_value & 0x00001000 ) == 0) {
54    printf("Error PCI A8 \n");
55    assert( 0x0 );
56  }
57
58  pci_value = Read_pci_device_register( 0x800000AC );
59  if ( pci_value & 0x02000000) {
60    printf("Error PCI AC \n");
61    assert( 0x0 );
62  }
63  return RTEMS_SUCCESSFUL;
64}
65
66unsigned int SCORE603e_FLASH_pci_reset_reg(
67  rtems_unsigned8  reg,
68  rtems_unsigned32 cmask,
69  rtems_unsigned32 mask
70)
71{
72  rtems_unsigned32 pci_value;
73  rtems_unsigned32 value;
74
75  pci_value = Read_pci_device_register( reg );
76  pci_value &= cmask;
77  pci_value |= mask;
78  Write_pci_device_register( reg, pci_value );
79  value = Read_pci_device_register(  reg );
80  if (value != pci_value) {
81    printf("Error PCI %x wrote %x read %x\n", reg, pci_value, value);
82  }
83  return RTEMS_SUCCESSFUL;
84}
85
86/*PAGE
87 *
88 *  SCORE603e_FLASH_Enable_writes
89 */
90unsigned int SCORE603e_FLASH_Enable_writes(
91  rtems_unsigned32               area                           /* IN  */
92)
93{
94  rtems_unsigned8  ctrl_value;
95  rtems_unsigned32 pci_value;
96
97  ctrl_value = *SCORE603E_BOARD_CTRL_REG;
98  ctrl_value = ctrl_value & 0xbf;
99  *SCORE603E_BOARD_CTRL_REG = ctrl_value;
100
101  pci_value = Read_pci_device_register( 0x800000A8 );
102  pci_value |= 0x00001000;
103  Write_pci_device_register( 0x800000A8, pci_value );
104
105  pci_value = Read_pci_device_register( 0x800000AC );
106  pci_value &=  (~0x02000000);
107  Write_pci_device_register( 0x000000AC, pci_value );
108
109  return RTEMS_SUCCESSFUL;
110}
111
112
113
114
115
Note: See TracBrowser for help on using the repository browser.