00001 /* ************************************************************************ 00002 00003 Copyright (c) 2006, Atmel Corporation All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are met: 00007 00008 1. Redistributions of source code must retain the above copyright notice, 00009 this list of conditions and the 00010 following disclaimer. 00011 00012 2. Redistributions in binary form must reproduce the above copyright notice, 00013 this list of conditions and the following disclaimer in the documentation 00014 and/or other materials provided with the distribution. 00015 00016 3. The name of ATMEL may not be used to endorse or promote products 00017 derived from this software without specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS 00020 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00022 PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY 00023 DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 00024 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00025 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00026 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00027 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00028 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00029 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 00030 WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00031 00032 POSSIBILITY OF SUCH DAMAGE. 00033 00034 ************************************************************************ */ 00035 00036 #ifndef _SDRAM_H_ 00037 #define _SDRAM_H_ 00038 00039 #include <avr32/io.h> 00040 #include "errno.h" 00041 00045 #define MODE_NORMAL 0 00046 00050 #define MODE_NOP 1 00051 00055 #define MODE_PRECHARGE 2 00056 00060 #define MODE_LOAD_MR 3 00061 00065 #define MODE_AUTOREFRESH 4 00066 00070 #define MODE_EXT_LOAD_MR 5 00071 00075 #define MODE_POWER_DOWN 6 00076 00077 typedef struct sdram_info 00078 { 00080 unsigned int phys_addr; 00081 00083 unsigned char bus_width; 00084 00086 unsigned int rows; 00087 00089 int cols; 00090 00092 int banks; 00093 00095 unsigned int cas; 00096 00098 unsigned int twr; 00099 00101 unsigned int trc; 00102 00104 unsigned int trp; 00105 00107 unsigned int trcd; 00108 00110 unsigned int tras; 00111 00113 unsigned int txsr; 00114 00115 }sdram_info; 00116 00117 00123 int sdram_init(const sdram_info *info); 00124 00125 #endif
1.5.3-20071008