RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
powerpc
gen5200
include
bsp
nvram.h
1
/*
2
* RTEMS generic MPC5200 BSP
3
*
4
* This file contains the nvram declarations.
5
*
6
* M93C46 is a serial microwire EEPROM which contains
7
* 1Kbit (128 bytes/64 words) of non-volatile memory.
8
* The device can be configured for byte- or word-
9
* access. The driver provides a file-like interface
10
* to this memory.
11
*
12
* MPC5x00 PIN settings:
13
*
14
* PSC3_6 (output) -> MC93C46 serial data in (D)
15
* PSC3_7 (input) -> MC93C46 serial data out (Q)
16
* PSC3_8 (output) -> MC93C46 chip select input (S)
17
* PSC3_9 (output) -> MC93C46 serial clock (C)
18
*
19
* References: DS1307-based Non-Volatile memory device driver
20
* by Victor V. Vengerov.
21
*/
22
23
/*
24
* Author: Victor V. Vengerov
25
* Copyright (c) 2000 OKTET Ltd.,St.-Petersburg,Russia
26
*
27
* Copyright (c) 2003 IPR Engineering
28
*
29
* Copyright (c) 2005 embedded brains GmbH & Co. KG
30
*
31
* The license and distribution terms for this file may be
32
* found in the file LICENSE in this distribution or at
33
* http://www.rtems.org/license/LICENSE.
34
*/
35
36
#ifndef __NVRAM_H__
37
#define __NVRAM_H__
38
39
#ifdef __cplusplus
40
extern
"C"
{
41
#endif
42
43
/* include <bsp.h> */
44
#include <bsp.h>
45
46
/* Macros for TBL read access */
47
#define TBL_READ(count) __asm__ volatile ("mftb %0\n" : "=r" (count) : "0" (count))
48
#define TMBASE_CLOCK (G2_CLOCK/4)
49
50
/* Simple usec delay function prototype */
51
void
wait_usec(
unsigned
long
);
52
53
/* nvram_driver_initialize --
54
* Non-volatile memory device driver initialization.
55
*/
56
rtems_device_driver
57
nvram_driver_initialize(
rtems_device_major_number
major,
58
rtems_device_minor_number
minor,
59
void
*arg);
60
61
/* nvram_driver_open --
62
* Non-volatile memory device driver open primitive.
63
*/
64
rtems_device_driver
65
nvram_driver_open(
rtems_device_major_number
major,
66
rtems_device_minor_number
minor,
67
void
*arg);
68
69
/* nvram_driver_close --
70
* Non-volatile memory device driver close primitive.
71
*/
72
rtems_device_driver
73
nvram_driver_close(
rtems_device_major_number
major,
74
rtems_device_minor_number
minor,
75
void
*arg);
76
77
/* nvram_driver_read --
78
* Non-volatile memory device driver read primitive.
79
*/
80
rtems_device_driver
81
nvram_driver_read(
rtems_device_major_number
major,
82
rtems_device_minor_number
minor,
83
void
*arg);
84
85
/* nvram_driver_write --
86
* Non-volatile memory device driver write primitive.
87
*/
88
rtems_device_driver
89
nvram_driver_write(
rtems_device_major_number
major,
90
rtems_device_minor_number
minor,
91
void
*arg);
92
93
#ifdef __cplusplus
94
}
95
#endif
96
97
#endif
/* __NVRAM_H__ */
rtems_device_driver
rtems_status_code rtems_device_driver
This type shall be used in device driver entry declarations and definitions.
Definition
io.h:90
rtems_device_major_number
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition
io.h:103
rtems_device_minor_number
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition
io.h:115
Generated by
1.18.0