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