RTEMS 6.1-rc7
Loading...
Searching...
No Matches
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
40extern "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 */
51void wait_usec(unsigned long);
52
53/* nvram_driver_initialize --
54 * Non-volatile memory device driver initialization.
55 */
57nvram_driver_initialize(rtems_device_major_number major,
59 void *arg);
60
61/* nvram_driver_open --
62 * Non-volatile memory device driver open primitive.
63 */
65nvram_driver_open(rtems_device_major_number major,
67 void *arg);
68
69/* nvram_driver_close --
70 * Non-volatile memory device driver close primitive.
71 */
73nvram_driver_close(rtems_device_major_number major,
75 void *arg);
76
77/* nvram_driver_read --
78 * Non-volatile memory device driver read primitive.
79 */
81nvram_driver_read(rtems_device_major_number major,
83 void *arg);
84
85/* nvram_driver_write --
86 * Non-volatile memory device driver write primitive.
87 */
89nvram_driver_write(rtems_device_major_number major,
91 void *arg);
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* __NVRAM_H__ */
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition: io.h:103
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition: io.h:115
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85