OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [powerpc/] [score603e/] [PCI_bus/] [flash.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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
 
25
unsigned 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
 
38
unsigned 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
 
66
unsigned 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
 */
90
unsigned 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.