Nut/OS  5.0.5
API Reference
sdram.h
Go to the documentation of this file.
00001 #ifndef _SDRAM_H_
00002 #define _SDRAM_H_
00003 
00004 /*
00005  * Copyright (C) 2012 by Ole Reinhardt (ole.reinhardt@embedded-it.de)
00006  *
00007  * All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions
00011  * are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in the
00017  *    documentation and/or other materials provided with the distribution.
00018  * 3. Neither the name of the copyright holders nor the names of
00019  *    contributors may be used to endorse or promote products derived
00020  *    from this software without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00026  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00029  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00030  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00032  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00033  * SUCH DAMAGE.
00034  *
00035  * For additional information see http://www.ethernut.de/
00036  */
00037 
00038 /*
00039  * \file dev/sdram.h
00040  * \brief Datastructs to specify SDRAM timings for several sdrams
00041  *
00042  *
00043  * \verbatim
00044  * $Id: $
00045  * \endverbatim
00046  */
00047 
00048 typedef struct _sdram_params {
00049     uint32_t    base_addr;
00050     uint32_t    size;
00051     uint32_t    bus_width;
00052 
00053     uint8_t     rows;
00054     uint8_t     cols;
00055 
00056     uint8_t     ras_latency;    /* row address strobe latency (cycles)        */
00057     uint8_t     cas_latency;    /* collumn address strobe latency (cycles)    */
00058 
00059     uint8_t     tRP;            /* precharge to activate time (ns)            */
00060     uint8_t     tRAS;           /* active to precharge time (ns)              */
00061     uint8_t     tSREX;          /* self refresh exit time. (ns) for devices
00062                                    without this parameter use the same value
00063                                    as tXSR                                    */
00064     uint8_t     tAPR;           /* last active data out to active (cycles)    */
00065     uint8_t     tDAL;           /* data-in to active time (cycles)            */
00066 
00067     uint8_t     tWR;            /* write recovery time (cycles)               */
00068     uint8_t     tRC;            /* active to active time (ns)                 */
00069     uint8_t     tRFC;           /* auto-refresh, and auto-refresh to active time (ns) */
00070     uint8_t     tXSR;           /* exit self-refresh to active time (ns)      */
00071     uint8_t     tRRD;           /* active bank A to active bank B latency (ns)*/
00072     uint8_t     tMRD;           /* load mode register to active time (cycles) */
00073 
00074     uint16_t    refresh;        /* refresh time for array (us)                */
00075 } SDRAM;
00076 
00077 #endif
00078