/************************************************************************ * * Copyright (c) 2013-2015 Intel Corporation. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License * which accompanies this distribution. The full text of the license may be found at * http://opensource.org/licenses/bsd-license.php * * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. * ************************************************************************/ #ifndef _MRC_H_ #define _MRC_H_ #include "core_types.h" // define the MRC Version #define MRC_VERSION 0x0112 // architectural definitions #define NUM_CHANNELS 1 // number of channels #define NUM_RANKS 2 // number of ranks per channel #define NUM_BYTE_LANES 4 // number of byte lanes per channel // software limitations #define MAX_CHANNELS 1 #define MAX_RANKS 2 #define MAX_BYTE_LANES 4 // only to mock MrcWrapper #define MAX_SOCKETS 1 #define MAX_SIDES 1 #define MAX_ROWS (MAX_SIDES * MAX_SOCKETS) // end // Specify DRAM of nenory channel width enum { x8, // DRAM width x16, // DRAM width & Channel Width x32 // Channel Width }; // Specify DRAM speed enum { DDRFREQ_800, DDRFREQ_1066 }; // Specify DRAM type enum { DDR3, DDR3L }; // Delay configuration for individual signals // Vref setting // Scrambler seed typedef struct MrcTimings_s { uint32_t rcvn[NUM_CHANNELS][NUM_RANKS][NUM_BYTE_LANES]; uint32_t rdqs[NUM_CHANNELS][NUM_RANKS][NUM_BYTE_LANES]; uint32_t wdqs[NUM_CHANNELS][NUM_RANKS][NUM_BYTE_LANES]; uint32_t wdq [NUM_CHANNELS][NUM_RANKS][NUM_BYTE_LANES]; uint32_t vref[NUM_CHANNELS][NUM_BYTE_LANES]; uint32_t wctl[NUM_CHANNELS][NUM_RANKS]; uint32_t wcmd[NUM_CHANNELS]; uint32_t scrambler_seed; uint8_t ddr_speed; // need to save for the case of frequency change } MrcTimings_t; // DENSITY: 0=512Mb, 1=Gb, 2=2Gb, 3=4Gb // tCL is DRAM CAS Latency in clocks. // All other timings are in picoseconds. // Refer to JEDEC spec (or DRAM datasheet) when changing these values. typedef struct DRAMParams_s { uint8_t DENSITY; uint8_t tCL; // CAS latency in clocks uint32_t tRAS; // ACT to PRE command period uint32_t tWTR; // Delay from start of internal write transaction to internal read command uint32_t tRRD; // ACT to ACT command period (JESD79 specific to page size 1K/2K) uint32_t tFAW; // Four activate window (JESD79 specific to page size 1K/2K) } DRAMParams_t; // Boot mode defined as bit mask (1<