Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:52

0001 /*
0002  * RTEMS generic MPC5200 BSP
0003  *
0004  * This file contains the nvram declarations.
0005  *
0006  * M93C46 is a serial microwire EEPROM which contains
0007  * 1Kbit (128 bytes/64 words) of non-volatile memory.
0008  * The device can be configured for byte- or word-
0009  * access. The driver provides a file-like interface
0010  * to this memory.
0011  *
0012  * MPC5x00 PIN settings:
0013  *
0014  * PSC3_6 (output) -> MC93C46 serial data in    (D)
0015  * PSC3_7 (input)  -> MC93C46 serial data out   (Q)
0016  * PSC3_8 (output) -> MC93C46 chip select input (S)
0017  * PSC3_9 (output) -> MC93C46 serial clock      (C)
0018  *
0019  * References: DS1307-based Non-Volatile memory device driver
0020  * by Victor V. Vengerov.
0021  */
0022 
0023 /*
0024  * Author: Victor V. Vengerov
0025  * Copyright (c) 2000 OKTET Ltd.,St.-Petersburg,Russia
0026  *
0027  * Copyright (c) 2003 IPR Engineering
0028  *
0029  * Copyright (c) 2005 embedded brains GmbH & Co. KG
0030  *
0031  * The license and distribution terms for this file may be
0032  * found in the file LICENSE in this distribution or at
0033  * http://www.rtems.org/license/LICENSE.
0034  */
0035 
0036 #ifndef __NVRAM_H__
0037 #define __NVRAM_H__
0038 
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042 
0043 /* include <bsp.h> */
0044 #include <bsp.h>
0045 
0046 /* Macros for TBL read access */
0047 #define TBL_READ(count)    __asm__ volatile ("mftb %0\n" : "=r" (count) : "0" (count))
0048 #define TMBASE_CLOCK       (G2_CLOCK/4)
0049 
0050 /* Simple usec delay function prototype */
0051 void wait_usec(unsigned long);
0052 
0053 /* nvram_driver_initialize --
0054  *     Non-volatile memory device driver initialization.
0055  */
0056 rtems_device_driver
0057 nvram_driver_initialize(rtems_device_major_number major,
0058                         rtems_device_minor_number minor,
0059                         void *arg);
0060 
0061 /* nvram_driver_open --
0062  *     Non-volatile memory device driver open primitive.
0063  */
0064 rtems_device_driver
0065 nvram_driver_open(rtems_device_major_number major,
0066                   rtems_device_minor_number minor,
0067                   void *arg);
0068 
0069 /* nvram_driver_close --
0070  *     Non-volatile memory device driver close primitive.
0071  */
0072 rtems_device_driver
0073 nvram_driver_close(rtems_device_major_number major,
0074                    rtems_device_minor_number minor,
0075                    void *arg);
0076 
0077 /* nvram_driver_read --
0078  *     Non-volatile memory device driver read primitive.
0079  */
0080 rtems_device_driver
0081 nvram_driver_read(rtems_device_major_number major,
0082                   rtems_device_minor_number minor,
0083                   void *arg);
0084 
0085 /* nvram_driver_write --
0086  *     Non-volatile memory device driver write primitive.
0087  */
0088 rtems_device_driver
0089 nvram_driver_write(rtems_device_major_number major,
0090                    rtems_device_minor_number minor,
0091                    void *arg);
0092 
0093 #ifdef __cplusplus
0094 }
0095 #endif
0096 
0097 #endif /* __NVRAM_H__ */