xref: /rk3399_rockchip-uboot/include/ddr_spd.h (revision 0f2cbe3f5eddbdf3848265f35e4f714434929cff)
1*0f2cbe3fSJames Yang /*
2*0f2cbe3fSJames Yang  * Copyright 2008 Freescale Semiconductor, Inc.
3*0f2cbe3fSJames Yang  *
4*0f2cbe3fSJames Yang  * This program is free software; you can redistribute it and/or
5*0f2cbe3fSJames Yang  * modify it under the terms of the GNU General Public License
6*0f2cbe3fSJames Yang  * Version 2 as published by the Free Software Foundation.
7*0f2cbe3fSJames Yang  */
8*0f2cbe3fSJames Yang 
9*0f2cbe3fSJames Yang #ifndef _DDR_SPD_H_
10*0f2cbe3fSJames Yang #define _DDR_SPD_H_
11*0f2cbe3fSJames Yang 
12*0f2cbe3fSJames Yang /*
13*0f2cbe3fSJames Yang  * Format from "JEDEC Standard No. 21-C,
14*0f2cbe3fSJames Yang  * Appendix D: Rev 1.0: SPD's for DDR SDRAM
15*0f2cbe3fSJames Yang  */
16*0f2cbe3fSJames Yang typedef struct ddr1_spd_eeprom_s {
17*0f2cbe3fSJames Yang 	unsigned char info_size;   /*  0 # bytes written into serial memory */
18*0f2cbe3fSJames Yang 	unsigned char chip_size;   /*  1 Total # bytes of SPD memory device */
19*0f2cbe3fSJames Yang 	unsigned char mem_type;    /*  2 Fundamental memory type */
20*0f2cbe3fSJames Yang 	unsigned char nrow_addr;   /*  3 # of Row Addresses on this assembly */
21*0f2cbe3fSJames Yang 	unsigned char ncol_addr;   /*  4 # of Column Addrs on this assembly */
22*0f2cbe3fSJames Yang 	unsigned char nrows;       /*  5 Number of DIMM Banks */
23*0f2cbe3fSJames Yang 	unsigned char dataw_lsb;   /*  6 Data Width of this assembly */
24*0f2cbe3fSJames Yang 	unsigned char dataw_msb;   /*  7 ... Data Width continuation */
25*0f2cbe3fSJames Yang 	unsigned char voltage;     /*  8 Voltage intf std of this assembly */
26*0f2cbe3fSJames Yang 	unsigned char clk_cycle;   /*  9 SDRAM Cycle time @ CL=X */
27*0f2cbe3fSJames Yang 	unsigned char clk_access;  /* 10 SDRAM Access from Clk @ CL=X (tAC) */
28*0f2cbe3fSJames Yang 	unsigned char config;      /* 11 DIMM Configuration type */
29*0f2cbe3fSJames Yang 	unsigned char refresh;     /* 12 Refresh Rate/Type */
30*0f2cbe3fSJames Yang 	unsigned char primw;       /* 13 Primary SDRAM Width */
31*0f2cbe3fSJames Yang 	unsigned char ecw;         /* 14 Error Checking SDRAM width */
32*0f2cbe3fSJames Yang 	unsigned char min_delay;   /* 15 for Back to Back Random Address */
33*0f2cbe3fSJames Yang 	unsigned char burstl;      /* 16 Burst Lengths Supported */
34*0f2cbe3fSJames Yang 	unsigned char nbanks;      /* 17 # of Banks on SDRAM Device */
35*0f2cbe3fSJames Yang 	unsigned char cas_lat;     /* 18 CAS# Latencies Supported */
36*0f2cbe3fSJames Yang 	unsigned char cs_lat;      /* 19 CS# Latency */
37*0f2cbe3fSJames Yang 	unsigned char write_lat;   /* 20 Write Latency (aka Write Recovery) */
38*0f2cbe3fSJames Yang 	unsigned char mod_attr;    /* 21 SDRAM Module Attributes */
39*0f2cbe3fSJames Yang 	unsigned char dev_attr;    /* 22 SDRAM Device Attributes */
40*0f2cbe3fSJames Yang 	unsigned char clk_cycle2;  /* 23 Min SDRAM Cycle time @ CL=X-0.5 */
41*0f2cbe3fSJames Yang 	unsigned char clk_access2; /* 24 SDRAM Access from
42*0f2cbe3fSJames Yang 				         Clk @ CL=X-0.5 (tAC) */
43*0f2cbe3fSJames Yang 	unsigned char clk_cycle3;  /* 25 Min SDRAM Cycle time @ CL=X-1 */
44*0f2cbe3fSJames Yang 	unsigned char clk_access3; /* 26 Max Access from Clk @ CL=X-1 (tAC) */
45*0f2cbe3fSJames Yang 	unsigned char trp;         /* 27 Min Row Precharge Time (tRP)*/
46*0f2cbe3fSJames Yang 	unsigned char trrd;        /* 28 Min Row Active to Row Active (tRRD) */
47*0f2cbe3fSJames Yang 	unsigned char trcd;        /* 29 Min RAS to CAS Delay (tRCD) */
48*0f2cbe3fSJames Yang 	unsigned char tras;        /* 30 Minimum RAS Pulse Width (tRAS) */
49*0f2cbe3fSJames Yang 	unsigned char bank_dens;   /* 31 Density of each bank on module */
50*0f2cbe3fSJames Yang 	unsigned char ca_setup;    /* 32 Addr + Cmd Setup Time Before Clk */
51*0f2cbe3fSJames Yang 	unsigned char ca_hold;     /* 33 Addr + Cmd Hold Time After Clk */
52*0f2cbe3fSJames Yang 	unsigned char data_setup;  /* 34 Data Input Setup Time Before Strobe */
53*0f2cbe3fSJames Yang 	unsigned char data_hold;   /* 35 Data Input Hold Time After Strobe */
54*0f2cbe3fSJames Yang 	unsigned char res_36_40[5];/* 36-40 reserved for VCSDRAM */
55*0f2cbe3fSJames Yang 	unsigned char trc;         /* 41 Min Active to Auto refresh time tRC */
56*0f2cbe3fSJames Yang 	unsigned char trfc;        /* 42 Min Auto to Active period tRFC */
57*0f2cbe3fSJames Yang 	unsigned char tckmax;      /* 43 Max device cycle time tCKmax */
58*0f2cbe3fSJames Yang 	unsigned char tdqsq;       /* 44 Max DQS to DQ skew (tDQSQ max) */
59*0f2cbe3fSJames Yang 	unsigned char tqhs;        /* 45 Max Read DataHold skew (tQHS) */
60*0f2cbe3fSJames Yang 	unsigned char res_46;      /* 46 Reserved */
61*0f2cbe3fSJames Yang 	unsigned char dimm_height; /* 47 DDR SDRAM DIMM Height */
62*0f2cbe3fSJames Yang 	unsigned char res_48_61[14]; /* 48-61 Reserved */
63*0f2cbe3fSJames Yang 	unsigned char spd_rev;     /* 62 SPD Data Revision Code */
64*0f2cbe3fSJames Yang 	unsigned char cksum;       /* 63 Checksum for bytes 0-62 */
65*0f2cbe3fSJames Yang 	unsigned char mid[8];      /* 64-71 Mfr's JEDEC ID code per JEP-106 */
66*0f2cbe3fSJames Yang 	unsigned char mloc;        /* 72 Manufacturing Location */
67*0f2cbe3fSJames Yang 	unsigned char mpart[18];   /* 73 Manufacturer's Part Number */
68*0f2cbe3fSJames Yang 	unsigned char rev[2];      /* 91 Revision Code */
69*0f2cbe3fSJames Yang 	unsigned char mdate[2];    /* 93 Manufacturing Date */
70*0f2cbe3fSJames Yang 	unsigned char sernum[4];   /* 95 Assembly Serial Number */
71*0f2cbe3fSJames Yang 	unsigned char mspec[27];   /* 99-127 Manufacturer Specific Data */
72*0f2cbe3fSJames Yang 
73*0f2cbe3fSJames Yang } ddr1_spd_eeprom_t;
74*0f2cbe3fSJames Yang 
75*0f2cbe3fSJames Yang /*
76*0f2cbe3fSJames Yang  * Format from "JEDEC Appendix X: Serial Presence Detects for DDR2 SDRAM",
77*0f2cbe3fSJames Yang  * SPD Revision 1.2
78*0f2cbe3fSJames Yang  */
79*0f2cbe3fSJames Yang typedef struct ddr2_spd_eeprom_s {
80*0f2cbe3fSJames Yang 	unsigned char info_size;   /*  0 # bytes written into serial memory */
81*0f2cbe3fSJames Yang 	unsigned char chip_size;   /*  1 Total # bytes of SPD memory device */
82*0f2cbe3fSJames Yang 	unsigned char mem_type;    /*  2 Fundamental memory type */
83*0f2cbe3fSJames Yang 	unsigned char nrow_addr;   /*  3 # of Row Addresses on this assembly */
84*0f2cbe3fSJames Yang 	unsigned char ncol_addr;   /*  4 # of Column Addrs on this assembly */
85*0f2cbe3fSJames Yang 	unsigned char mod_ranks;   /*  5 Number of DIMM Ranks */
86*0f2cbe3fSJames Yang 	unsigned char dataw;       /*  6 Module Data Width */
87*0f2cbe3fSJames Yang 	unsigned char res_7;       /*  7 Reserved */
88*0f2cbe3fSJames Yang 	unsigned char voltage;     /*  8 Voltage intf std of this assembly */
89*0f2cbe3fSJames Yang 	unsigned char clk_cycle;   /*  9 SDRAM Cycle time @ CL=X */
90*0f2cbe3fSJames Yang 	unsigned char clk_access;  /* 10 SDRAM Access from Clk @ CL=X (tAC) */
91*0f2cbe3fSJames Yang 	unsigned char config;      /* 11 DIMM Configuration type */
92*0f2cbe3fSJames Yang 	unsigned char refresh;     /* 12 Refresh Rate/Type */
93*0f2cbe3fSJames Yang 	unsigned char primw;       /* 13 Primary SDRAM Width */
94*0f2cbe3fSJames Yang 	unsigned char ecw;         /* 14 Error Checking SDRAM width */
95*0f2cbe3fSJames Yang 	unsigned char res_15;      /* 15 Reserved */
96*0f2cbe3fSJames Yang 	unsigned char burstl;      /* 16 Burst Lengths Supported */
97*0f2cbe3fSJames Yang 	unsigned char nbanks;      /* 17 # of Banks on Each SDRAM Device */
98*0f2cbe3fSJames Yang 	unsigned char cas_lat;     /* 18 CAS# Latencies Supported */
99*0f2cbe3fSJames Yang 	unsigned char mech_char;   /* 19 DIMM Mechanical Characteristics */
100*0f2cbe3fSJames Yang 	unsigned char dimm_type;   /* 20 DIMM type information */
101*0f2cbe3fSJames Yang 	unsigned char mod_attr;    /* 21 SDRAM Module Attributes */
102*0f2cbe3fSJames Yang 	unsigned char dev_attr;    /* 22 SDRAM Device Attributes */
103*0f2cbe3fSJames Yang 	unsigned char clk_cycle2;  /* 23 Min SDRAM Cycle time @ CL=X-1 */
104*0f2cbe3fSJames Yang 	unsigned char clk_access2; /* 24 SDRAM Access from Clk @ CL=X-1 (tAC) */
105*0f2cbe3fSJames Yang 	unsigned char clk_cycle3;  /* 25 Min SDRAM Cycle time @ CL=X-2 */
106*0f2cbe3fSJames Yang 	unsigned char clk_access3; /* 26 Max Access from Clk @ CL=X-2 (tAC) */
107*0f2cbe3fSJames Yang 	unsigned char trp;         /* 27 Min Row Precharge Time (tRP)*/
108*0f2cbe3fSJames Yang 	unsigned char trrd;        /* 28 Min Row Active to Row Active (tRRD) */
109*0f2cbe3fSJames Yang 	unsigned char trcd;        /* 29 Min RAS to CAS Delay (tRCD) */
110*0f2cbe3fSJames Yang 	unsigned char tras;        /* 30 Minimum RAS Pulse Width (tRAS) */
111*0f2cbe3fSJames Yang 	unsigned char rank_dens;   /* 31 Density of each rank on module */
112*0f2cbe3fSJames Yang 	unsigned char ca_setup;    /* 32 Addr+Cmd Setup Time Before Clk (tIS) */
113*0f2cbe3fSJames Yang 	unsigned char ca_hold;     /* 33 Addr+Cmd Hold Time After Clk (tIH) */
114*0f2cbe3fSJames Yang 	unsigned char data_setup;  /* 34 Data Input Setup Time
115*0f2cbe3fSJames Yang 				         Before Strobe (tDS) */
116*0f2cbe3fSJames Yang 	unsigned char data_hold;   /* 35 Data Input Hold Time
117*0f2cbe3fSJames Yang 				         After Strobe (tDH) */
118*0f2cbe3fSJames Yang 	unsigned char twr;         /* 36 Write Recovery time tWR */
119*0f2cbe3fSJames Yang 	unsigned char twtr;        /* 37 Int write to read delay tWTR */
120*0f2cbe3fSJames Yang 	unsigned char trtp;        /* 38 Int read to precharge delay tRTP */
121*0f2cbe3fSJames Yang 	unsigned char mem_probe;   /* 39 Mem analysis probe characteristics */
122*0f2cbe3fSJames Yang 	unsigned char trctrfc_ext; /* 40 Extensions to trc and trfc */
123*0f2cbe3fSJames Yang 	unsigned char trc;         /* 41 Min Active to Auto refresh time tRC */
124*0f2cbe3fSJames Yang 	unsigned char trfc;        /* 42 Min Auto to Active period tRFC */
125*0f2cbe3fSJames Yang 	unsigned char tckmax;      /* 43 Max device cycle time tCKmax */
126*0f2cbe3fSJames Yang 	unsigned char tdqsq;       /* 44 Max DQS to DQ skew (tDQSQ max) */
127*0f2cbe3fSJames Yang 	unsigned char tqhs;        /* 45 Max Read DataHold skew (tQHS) */
128*0f2cbe3fSJames Yang 	unsigned char pll_relock;  /* 46 PLL Relock time */
129*0f2cbe3fSJames Yang 	unsigned char Tcasemax;    /* 47 Tcasemax */
130*0f2cbe3fSJames Yang 	unsigned char psiTAdram;   /* 48 Thermal Resistance of DRAM Package from
131*0f2cbe3fSJames Yang 				         Top (Case) to Ambient (Psi T-A DRAM) */
132*0f2cbe3fSJames Yang 	unsigned char dt0_mode;    /* 49 DRAM Case Temperature Rise from Ambient
133*0f2cbe3fSJames Yang 				         due to Activate-Precharge/Mode Bits
134*0f2cbe3fSJames Yang 					 (DT0/Mode Bits) */
135*0f2cbe3fSJames Yang 	unsigned char dt2n_dt2q;   /* 50 DRAM Case Temperature Rise from Ambient
136*0f2cbe3fSJames Yang 				         due to Precharge/Quiet Standby
137*0f2cbe3fSJames Yang 					 (DT2N/DT2Q) */
138*0f2cbe3fSJames Yang 	unsigned char dt2p;        /* 51 DRAM Case Temperature Rise from Ambient
139*0f2cbe3fSJames Yang 				         due to Precharge Power-Down (DT2P) */
140*0f2cbe3fSJames Yang 	unsigned char dt3n;        /* 52 DRAM Case Temperature Rise from Ambient
141*0f2cbe3fSJames Yang 				         due to Active Standby (DT3N) */
142*0f2cbe3fSJames Yang 	unsigned char dt3pfast;    /* 53 DRAM Case Temperature Rise from Ambient
143*0f2cbe3fSJames Yang 				         due to Active Power-Down with
144*0f2cbe3fSJames Yang 					 Fast PDN Exit (DT3Pfast) */
145*0f2cbe3fSJames Yang 	unsigned char dt3pslow;    /* 54 DRAM Case Temperature Rise from Ambient
146*0f2cbe3fSJames Yang 				         due to Active Power-Down with Slow
147*0f2cbe3fSJames Yang 					 PDN Exit (DT3Pslow) */
148*0f2cbe3fSJames Yang 	unsigned char dt4r_dt4r4w; /* 55 DRAM Case Temperature Rise from Ambient
149*0f2cbe3fSJames Yang 				         due to Page Open Burst Read/DT4R4W
150*0f2cbe3fSJames Yang 					 Mode Bit (DT4R/DT4R4W Mode Bit) */
151*0f2cbe3fSJames Yang 	unsigned char dt5b;        /* 56 DRAM Case Temperature Rise from Ambient
152*0f2cbe3fSJames Yang 				         due to Burst Refresh (DT5B) */
153*0f2cbe3fSJames Yang 	unsigned char dt7;         /* 57 DRAM Case Temperature Rise from Ambient
154*0f2cbe3fSJames Yang 				         due to Bank Interleave Reads with
155*0f2cbe3fSJames Yang 					 Auto-Precharge (DT7) */
156*0f2cbe3fSJames Yang 	unsigned char psiTApll;    /* 58 Thermal Resistance of PLL Package form
157*0f2cbe3fSJames Yang 				         Top (Case) to Ambient (Psi T-A PLL) */
158*0f2cbe3fSJames Yang 	unsigned char psiTAreg;    /* 59 Thermal Reisitance of Register Package
159*0f2cbe3fSJames Yang 				         from Top (Case) to Ambient
160*0f2cbe3fSJames Yang 					 (Psi T-A Register) */
161*0f2cbe3fSJames Yang 	unsigned char dtpllactive; /* 60 PLL Case Temperature Rise from Ambient
162*0f2cbe3fSJames Yang 				         due to PLL Active (DT PLL Active) */
163*0f2cbe3fSJames Yang 	unsigned char dtregact;    /* 61 Register Case Temperature Rise from
164*0f2cbe3fSJames Yang 				         Ambient due to Register Active/Mode Bit
165*0f2cbe3fSJames Yang 					 (DT Register Active/Mode Bit) */
166*0f2cbe3fSJames Yang 	unsigned char spd_rev;     /* 62 SPD Data Revision Code */
167*0f2cbe3fSJames Yang 	unsigned char cksum;       /* 63 Checksum for bytes 0-62 */
168*0f2cbe3fSJames Yang 	unsigned char mid[8];      /* 64 Mfr's JEDEC ID code per JEP-106 */
169*0f2cbe3fSJames Yang 	unsigned char mloc;        /* 72 Manufacturing Location */
170*0f2cbe3fSJames Yang 	unsigned char mpart[18];   /* 73 Manufacturer's Part Number */
171*0f2cbe3fSJames Yang 	unsigned char rev[2];      /* 91 Revision Code */
172*0f2cbe3fSJames Yang 	unsigned char mdate[2];    /* 93 Manufacturing Date */
173*0f2cbe3fSJames Yang 	unsigned char sernum[4];   /* 95 Assembly Serial Number */
174*0f2cbe3fSJames Yang 	unsigned char mspec[27];   /* 99-127 Manufacturer Specific Data */
175*0f2cbe3fSJames Yang 
176*0f2cbe3fSJames Yang } ddr2_spd_eeprom_t;
177*0f2cbe3fSJames Yang 
178*0f2cbe3fSJames Yang typedef struct ddr3_spd_eeprom_s {
179*0f2cbe3fSJames Yang 	/* General Section: Bytes 0-59 */
180*0f2cbe3fSJames Yang 	unsigned char info_size_crc;   /*  0 # bytes written into serial memory,
181*0f2cbe3fSJames Yang 					     CRC coverage */
182*0f2cbe3fSJames Yang 	unsigned char spd_rev;         /*  1 Total # bytes of SPD mem device */
183*0f2cbe3fSJames Yang 	unsigned char mem_type;        /*  2 Key Byte / Fundamental mem type */
184*0f2cbe3fSJames Yang 	unsigned char module_type;     /*  3 Key Byte / Module Type */
185*0f2cbe3fSJames Yang 	unsigned char density_banks;   /*  4 SDRAM Density and Banks */
186*0f2cbe3fSJames Yang 	unsigned char addressing;      /*  5 SDRAM Addressing */
187*0f2cbe3fSJames Yang 	unsigned char res_6;           /*  6 Reserved */
188*0f2cbe3fSJames Yang 	unsigned char organization;    /*  7 Module Organization */
189*0f2cbe3fSJames Yang 	unsigned char bus_width;       /*  8 Module Memory Bus Width */
190*0f2cbe3fSJames Yang 	unsigned char ftb_div;         /*  9 Fine Timebase (FTB)
191*0f2cbe3fSJames Yang 					     Dividend / Divisor */
192*0f2cbe3fSJames Yang 	unsigned char mtb_dividend;    /* 10 Medium Timebase (MTB) Dividend */
193*0f2cbe3fSJames Yang 	unsigned char mtb_divisor;     /* 11 Medium Timebase (MTB) Divisor */
194*0f2cbe3fSJames Yang 	unsigned char tCK_min;         /* 12 SDRAM Minimum Cycle Time */
195*0f2cbe3fSJames Yang 	unsigned char res_13;          /* 13 Reserved */
196*0f2cbe3fSJames Yang 	unsigned char caslat_lsb;      /* 14 CAS Latencies Supported,
197*0f2cbe3fSJames Yang 					     Least Significant Byte */
198*0f2cbe3fSJames Yang 	unsigned char caslat_msb;      /* 15 CAS Latencies Supported,
199*0f2cbe3fSJames Yang 					     Most Significant Byte */
200*0f2cbe3fSJames Yang 	unsigned char tAA_min;         /* 16 Min CAS Latency Time */
201*0f2cbe3fSJames Yang 	unsigned char tWR_min;         /* 17 Min Write REcovery Time */
202*0f2cbe3fSJames Yang 	unsigned char tRCD_min;        /* 18 Min RAS# to CAS# Delay Time */
203*0f2cbe3fSJames Yang 	unsigned char tRRD_min;        /* 19 Min Row Active to
204*0f2cbe3fSJames Yang 					     Row Active Delay Time */
205*0f2cbe3fSJames Yang 	unsigned char tRP_min;         /* 20 Min Row Precharge Delay Time */
206*0f2cbe3fSJames Yang 	unsigned char tRAS_tRC_ext;    /* 21 Upper Nibbles for tRAS and tRC */
207*0f2cbe3fSJames Yang 	unsigned char tRAS_min_lsb;    /* 22 Min Active to Precharge
208*0f2cbe3fSJames Yang 					     Delay Time */
209*0f2cbe3fSJames Yang 	unsigned char tRC_min_lsb;     /* 23 Min Active to Active/Refresh
210*0f2cbe3fSJames Yang 					     Delay Time, LSB */
211*0f2cbe3fSJames Yang 	unsigned char tRFC_min_lsb;    /* 24 Min Refresh Recovery Delay Time */
212*0f2cbe3fSJames Yang 	unsigned char tRFC_min_msb;    /* 25 Min Refresh Recovery Delay Time */
213*0f2cbe3fSJames Yang 	unsigned char tWTR_min;        /* 26 Min Internal Write to
214*0f2cbe3fSJames Yang 					     Read Command Delay Time */
215*0f2cbe3fSJames Yang 	unsigned char tRTP_min;        /* 27 Min Internal Read to Precharge
216*0f2cbe3fSJames Yang 					     Command Delay Time */
217*0f2cbe3fSJames Yang 	unsigned char tFAW_msb;        /* 28 Upper Nibble for tFAW */
218*0f2cbe3fSJames Yang 	unsigned char tFAW_min;        /* 29 Min Four Activate Window
219*0f2cbe3fSJames Yang 					     Delay Time*/
220*0f2cbe3fSJames Yang 	unsigned char opt_features;    /* 30 SDRAM Optional Features */
221*0f2cbe3fSJames Yang 	unsigned char therm_ref_opt;   /* 31 SDRAM Thermal and Refresh Opts */
222*0f2cbe3fSJames Yang 	unsigned char res_32_59[28];   /* 32-59 Reserved, General Section */
223*0f2cbe3fSJames Yang 
224*0f2cbe3fSJames Yang 	/* Module-Specific Section: Bytes 60-116 */
225*0f2cbe3fSJames Yang 	union {
226*0f2cbe3fSJames Yang 		struct {
227*0f2cbe3fSJames Yang 			/* 60 (Unbuffered) Module Nominal Height */
228*0f2cbe3fSJames Yang 			unsigned char mod_height;
229*0f2cbe3fSJames Yang 			/* 61 (Unbuffered) Module Maximum Thickness */
230*0f2cbe3fSJames Yang 			unsigned char mod_thickness;
231*0f2cbe3fSJames Yang 			/* 62 (Unbuffered) Reference Raw Card Used */
232*0f2cbe3fSJames Yang 			unsigned char ref_raw_card;
233*0f2cbe3fSJames Yang 			/* 63 (Unbuffered) Address Mapping from
234*0f2cbe3fSJames Yang 			      Edge Connector to DRAM */
235*0f2cbe3fSJames Yang 			unsigned char addr_mapping;
236*0f2cbe3fSJames Yang 			/* 64-116 (Unbuffered) Reserved */
237*0f2cbe3fSJames Yang 			unsigned char res_64_116[53];
238*0f2cbe3fSJames Yang 		} unbuffered;
239*0f2cbe3fSJames Yang 		struct {
240*0f2cbe3fSJames Yang 			/* 60 (Registered) Module Nominal Height */
241*0f2cbe3fSJames Yang 			unsigned char mod_height;
242*0f2cbe3fSJames Yang 			/* 61 (Registered) Module Maximum Thickness */
243*0f2cbe3fSJames Yang 			unsigned char mod_thickness;
244*0f2cbe3fSJames Yang 			/* 62 (Registered) Reference Raw Card Used */
245*0f2cbe3fSJames Yang 			unsigned char ref_raw_card;
246*0f2cbe3fSJames Yang 		} registered;
247*0f2cbe3fSJames Yang 		unsigned char uc[57]; /* 60-116 Module-Specific Section */
248*0f2cbe3fSJames Yang 	} mod_section;
249*0f2cbe3fSJames Yang 
250*0f2cbe3fSJames Yang 	/* Unique Module ID: Bytes 117-125 */
251*0f2cbe3fSJames Yang 	unsigned char mmid_lsb;        /* 117 Module MfgID Code LSB - JEP-106 */
252*0f2cbe3fSJames Yang 	unsigned char mmid_msb;        /* 118 Module MfgID Code MSB - JEP-106 */
253*0f2cbe3fSJames Yang 	unsigned char mloc;            /* 119 Mfg Location */
254*0f2cbe3fSJames Yang 	unsigned char mdate[2];        /* 120-121 Mfg Date */
255*0f2cbe3fSJames Yang 	unsigned char sernum[4];       /* 122-125 Module Serial Number */
256*0f2cbe3fSJames Yang 
257*0f2cbe3fSJames Yang 	/* CRC: Bytes 126-127 */
258*0f2cbe3fSJames Yang 	unsigned char crc[2];          /* 126-127 SPD CRC */
259*0f2cbe3fSJames Yang 
260*0f2cbe3fSJames Yang 	/* Other Manufacturer Fields and User Space: Bytes 128-255 */
261*0f2cbe3fSJames Yang 	unsigned char mpart[18];       /* 128-145 Mfg's Module Part Number */
262*0f2cbe3fSJames Yang 	unsigned char mrev[2];         /* 146-147 Module Revision Code */
263*0f2cbe3fSJames Yang 
264*0f2cbe3fSJames Yang 	unsigned char dmid_lsb;        /* 148 DRAM MfgID Code LSB - JEP-106 */
265*0f2cbe3fSJames Yang 	unsigned char dmid_msb;        /* 149 DRAM MfgID Code MSB - JEP-106 */
266*0f2cbe3fSJames Yang 
267*0f2cbe3fSJames Yang 	unsigned char msd[26];         /* 150-175 Mfg's Specific Data */
268*0f2cbe3fSJames Yang 	unsigned char cust[80];        /* 176-255 Open for Customer Use */
269*0f2cbe3fSJames Yang 
270*0f2cbe3fSJames Yang } ddr3_spd_eeprom_t;
271*0f2cbe3fSJames Yang 
272*0f2cbe3fSJames Yang extern unsigned int ddr1_spd_check(const ddr1_spd_eeprom_t *spd);
273*0f2cbe3fSJames Yang extern void ddr1_spd_dump(const ddr1_spd_eeprom_t *spd);
274*0f2cbe3fSJames Yang extern unsigned int ddr2_spd_check(const ddr2_spd_eeprom_t *spd);
275*0f2cbe3fSJames Yang extern void ddr2_spd_dump(const ddr2_spd_eeprom_t *spd);
276*0f2cbe3fSJames Yang 
277*0f2cbe3fSJames Yang /*
278*0f2cbe3fSJames Yang  * Byte 2 Fundamental Memory Types.
279*0f2cbe3fSJames Yang  */
280*0f2cbe3fSJames Yang #define SPD_MEMTYPE_FPM		(0x01)
281*0f2cbe3fSJames Yang #define SPD_MEMTYPE_EDO		(0x02)
282*0f2cbe3fSJames Yang #define SPD_MEMTYPE_PIPE_NIBBLE	(0x03)
283*0f2cbe3fSJames Yang #define SPD_MEMTYPE_SDRAM	(0x04)
284*0f2cbe3fSJames Yang #define SPD_MEMTYPE_ROM		(0x05)
285*0f2cbe3fSJames Yang #define SPD_MEMTYPE_SGRAM	(0x06)
286*0f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR		(0x07)
287*0f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR2	(0x08)
288*0f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR2_FBDIMM	(0x09)
289*0f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR2_FBDIMM_PROBE	(0x0A)
290*0f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR3	(0x0B)
291*0f2cbe3fSJames Yang 
292*0f2cbe3fSJames Yang #endif /* _DDR_SPD_H_ */
293