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