RTEMS: bsps/powerpc/gen5200/include/bsp/nvram.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
nvram.h
1/*===============================================================*\
2| Project: RTEMS generic MPC5200 BSP |
3+-----------------------------------------------------------------+
4| Partially based on the code references which are named below. |
5| Adaptions, modifications, enhancements and any recent parts of |
6| the code are: |
7| Copyright (c) 2005 |
8| Embedded Brains GmbH |
9| Obere Lagerstr. 30 |
10| D-82178 Puchheim |
11| Germany |
12| rtems@embedded-brains.de |
13+-----------------------------------------------------------------+
14| The license and distribution terms for this file may be |
15| found in the file LICENSE in this distribution or at |
16| |
17| http://www.rtems.org/license/LICENSE. |
18| |
19+-----------------------------------------------------------------+
20| this file contains the nvram declarations |
21\*===============================================================*/
22/***********************************************************************/
23/* */
24/* Module: nvram.h */
25/* Date: 07/17/2003 */
26/* Purpose: RTEMS M93C64-based header file */
27/* */
28/*---------------------------------------------------------------------*/
29/* */
30/* Description: M93C46 is a serial microwire EEPROM which contains */
31/* 1Kbit (128 bytes/64 words) of non-volatile memory. */
32/* The device can be configured for byte- or word- */
33/* access. The driver provides a file-like interface */
34/* to this memory. */
35/* */
36/* MPC5x00 PIN settings: */
37/* */
38/* PSC3_6 (output) -> MC93C46 serial data in (D) */
39/* PSC3_7 (input) -> MC93C46 serial data out (Q) */
40/* PSC3_8 (output) -> MC93C46 chip select input (S) */
41/* PSC3_9 (output) -> MC93C46 serial clock (C) */
42/* */
43/*---------------------------------------------------------------------*/
44/* */
45/* Code */
46/* References: DS1307-based Non-Volatile memory device driver */
47/* Module: nvram.h */
48/* Project: RTEMS 4.6.0pre1 / MCF5206Elite BSP */
49/* Version 1.1 */
50/* Date: 10/26/2001 */
51/* Author: Victor V. Vengerov */
52/* Copyright: Copyright (C) 2000 OKTET Ltd.,St.-Petersburg,Russia */
53/* */
54/* The license and distribution terms for this file may be */
55/* found in the file LICENSE in this distribution or at */
56/* http://www.rtems.org/license/LICENSE. */
57/* */
58/*---------------------------------------------------------------------*/
59/* */
60/* Partially based on the code references which are named above. */
61/* Adaptions, modifications, enhancements and any recent parts of */
62/* the code are under the right of */
63/* */
64/* IPR Engineering, Dachauer Straße 38, D-80335 München */
65/* Copyright(C) 2003 */
66/* */
67/*---------------------------------------------------------------------*/
68/* */
69/* IPR Engineering makes no representation or warranties with */
70/* respect to the performance of this computer program, and */
71/* specifically disclaims any responsibility for any damages, */
72/* special or consequential, connected with the use of this program. */
73/* */
74/*---------------------------------------------------------------------*/
75/* */
76/* Version history: 1.0 */
77/* */
78/***********************************************************************/
79
80#ifndef __NVRAM_H__
81#define __NVRAM_H__
82
83#ifdef __cplusplus
84extern "C" {
85#endif
86
87/* include <bsp.h> */
88#include <bsp.h>
89
90/* Macros for TBL read access */
91#define TBL_READ(count) __asm__ volatile ("mftb %0\n" : "=r" (count) : "0" (count))
92#define TMBASE_CLOCK (G2_CLOCK/4)
93
94/* Simple usec delay function prototype */
95void wait_usec(unsigned long);
96
97/* nvram_driver_initialize --
98 * Non-volatile memory device driver initialization.
99 */
100 rtems_device_driver
101nvram_driver_initialize(rtems_device_major_number major,
102 rtems_device_minor_number minor,
103 void *arg);
104
105/* nvram_driver_open --
106 * Non-volatile memory device driver open primitive.
107 */
108 rtems_device_driver
109nvram_driver_open(rtems_device_major_number major,
110 rtems_device_minor_number minor,
111 void *arg);
112
113/* nvram_driver_close --
114 * Non-volatile memory device driver close primitive.
115 */
116 rtems_device_driver
117nvram_driver_close(rtems_device_major_number major,
118 rtems_device_minor_number minor,
119 void *arg);
120
121/* nvram_driver_read --
122 * Non-volatile memory device driver read primitive.
123 */
124 rtems_device_driver
125nvram_driver_read(rtems_device_major_number major,
126 rtems_device_minor_number minor,
127 void *arg);
128
129/* nvram_driver_write --
130 * Non-volatile memory device driver write primitive.
131 */
132 rtems_device_driver
133nvram_driver_write(rtems_device_major_number major,
134 rtems_device_minor_number minor,
135 void *arg);
136
137#ifdef __cplusplus
138}
139#endif
140
141#endif /* __NVRAM_H__ */
rtems_status_code
rtems_status_code
Classic API Status.
Definition: status.h:43