source: rtems/c/src/lib/libbsp/powerpc/score603e/PCI_bus/flash.c @ 7a4de90f

4.104.114.84.95
Last change on this file since 7a4de90f was 7a4de90f, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 1:47:13 PM

2003-09-04 Joel Sherrill <joel@…>

  • PCI_bus/PCI.c, PCI_bus/flash.c, PCI_bus/universe.c: Removed incorrect statement about copyright assignment.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 *
3 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
4 *  On-Line Applications Research Corporation (OAR).
5 *
6 * $Id$
7 */
8
9#include <rtems.h>
10#include <assert.h>
11#include <stdio.h>
12
13#include <bsp.h>
14#include "PCI.h"
15/*PAGE
16 *
17 *  SCORE603e_FLASH_Disable
18 */
19
20unsigned int SCORE603e_FLASH_Disable(
21  rtems_unsigned32               area                           /* IN  */
22)
23{
24  rtems_unsigned8 value;
25 
26  value = *SCORE603E_BOARD_CTRL_REG;
27  value = value | (~SCORE603E_BRD_FLASH_DISABLE_MASK);
28  *SCORE603E_BOARD_CTRL_REG = value;
29
30  return RTEMS_SUCCESSFUL;
31}
32
33unsigned int SCORE603e_FLASH_verify_enable()
34{
35  volatile rtems_unsigned8 *Ctrl_Status_Register = 
36           (void *)SCORE603E_BOARD_CTRL_REG;
37  rtems_unsigned8  ctrl_value;
38  rtems_unsigned32 pci_value;
39
40  ctrl_value = *Ctrl_Status_Register;
41  if ( ctrl_value & SCORE603E_BRD_FLASH_DISABLE_MASK ) {
42    printf ("Flash Writes Disabled by board control register %x\n",
43            ctrl_value );
44    assert( 0x0 );
45  }
46
47  pci_value = Read_pci_device_register( 0x800000A8 );
48  if (( pci_value & 0x00001000 ) == 0) {
49    printf("Error PCI A8 \n");
50    assert( 0x0 );
51  }
52
53  pci_value = Read_pci_device_register( 0x800000AC );
54  if ( pci_value & 0x02000000) {
55    printf("Error PCI AC \n");
56    assert( 0x0 );
57  }
58  return RTEMS_SUCCESSFUL;
59}
60
61unsigned int SCORE603e_FLASH_pci_reset_reg(
62  rtems_unsigned8  reg,
63  rtems_unsigned32 cmask,
64  rtems_unsigned32 mask
65)
66{
67  rtems_unsigned32 pci_value;
68  rtems_unsigned32 value;
69
70  pci_value = Read_pci_device_register( reg );
71  pci_value &= cmask;
72  pci_value |= mask;
73  Write_pci_device_register( reg, pci_value );
74  value = Read_pci_device_register(  reg );
75  if (value != pci_value) {
76    printf("Error PCI %x wrote %x read %x\n", reg, pci_value, value);
77  }
78  return RTEMS_SUCCESSFUL;
79}
80
81/*PAGE
82 *
83 *  SCORE603e_FLASH_Enable_writes
84 */
85unsigned int SCORE603e_FLASH_Enable_writes(
86  rtems_unsigned32               area                           /* IN  */
87)
88{
89  rtems_unsigned8  ctrl_value;
90  rtems_unsigned32 pci_value;
91
92  ctrl_value = *SCORE603E_BOARD_CTRL_REG;
93  ctrl_value = ctrl_value & 0xbf;
94  *SCORE603E_BOARD_CTRL_REG = ctrl_value;
95
96  pci_value = Read_pci_device_register( 0x800000A8 );
97  pci_value |= 0x00001000;
98  Write_pci_device_register( 0x800000A8, pci_value );
99
100  pci_value = Read_pci_device_register( 0x800000AC );
101  pci_value &=  (~0x02000000);
102  Write_pci_device_register( 0x000000AC, pci_value );
103
104  return RTEMS_SUCCESSFUL;
105}
106
107
108
109
110
Note: See TracBrowser for help on using the repository browser.