xref: /rk3399_rockchip-uboot/include/ddr_spd.h (revision c7fd27ccfb3225ffaf2ad88c44a89eeccc1008ac)
10f2cbe3fSJames Yang /*
20f2cbe3fSJames Yang  * Copyright 2008 Freescale Semiconductor, Inc.
30f2cbe3fSJames Yang  *
40f2cbe3fSJames Yang  * This program is free software; you can redistribute it and/or
50f2cbe3fSJames Yang  * modify it under the terms of the GNU General Public License
60f2cbe3fSJames Yang  * Version 2 as published by the Free Software Foundation.
70f2cbe3fSJames Yang  */
80f2cbe3fSJames Yang 
90f2cbe3fSJames Yang #ifndef _DDR_SPD_H_
100f2cbe3fSJames Yang #define _DDR_SPD_H_
110f2cbe3fSJames Yang 
120f2cbe3fSJames Yang /*
130f2cbe3fSJames Yang  * Format from "JEDEC Standard No. 21-C,
140f2cbe3fSJames Yang  * Appendix D: Rev 1.0: SPD's for DDR SDRAM
150f2cbe3fSJames Yang  */
160f2cbe3fSJames Yang typedef struct ddr1_spd_eeprom_s {
170f2cbe3fSJames Yang 	unsigned char info_size;   /*  0 # bytes written into serial memory */
180f2cbe3fSJames Yang 	unsigned char chip_size;   /*  1 Total # bytes of SPD memory device */
190f2cbe3fSJames Yang 	unsigned char mem_type;    /*  2 Fundamental memory type */
200f2cbe3fSJames Yang 	unsigned char nrow_addr;   /*  3 # of Row Addresses on this assembly */
210f2cbe3fSJames Yang 	unsigned char ncol_addr;   /*  4 # of Column Addrs on this assembly */
220f2cbe3fSJames Yang 	unsigned char nrows;       /*  5 Number of DIMM Banks */
230f2cbe3fSJames Yang 	unsigned char dataw_lsb;   /*  6 Data Width of this assembly */
240f2cbe3fSJames Yang 	unsigned char dataw_msb;   /*  7 ... Data Width continuation */
250f2cbe3fSJames Yang 	unsigned char voltage;     /*  8 Voltage intf std of this assembly */
260f2cbe3fSJames Yang 	unsigned char clk_cycle;   /*  9 SDRAM Cycle time @ CL=X */
270f2cbe3fSJames Yang 	unsigned char clk_access;  /* 10 SDRAM Access from Clk @ CL=X (tAC) */
280f2cbe3fSJames Yang 	unsigned char config;      /* 11 DIMM Configuration type */
290f2cbe3fSJames Yang 	unsigned char refresh;     /* 12 Refresh Rate/Type */
300f2cbe3fSJames Yang 	unsigned char primw;       /* 13 Primary SDRAM Width */
310f2cbe3fSJames Yang 	unsigned char ecw;         /* 14 Error Checking SDRAM width */
320f2cbe3fSJames Yang 	unsigned char min_delay;   /* 15 for Back to Back Random Address */
330f2cbe3fSJames Yang 	unsigned char burstl;      /* 16 Burst Lengths Supported */
340f2cbe3fSJames Yang 	unsigned char nbanks;      /* 17 # of Banks on SDRAM Device */
350f2cbe3fSJames Yang 	unsigned char cas_lat;     /* 18 CAS# Latencies Supported */
360f2cbe3fSJames Yang 	unsigned char cs_lat;      /* 19 CS# Latency */
370f2cbe3fSJames Yang 	unsigned char write_lat;   /* 20 Write Latency (aka Write Recovery) */
380f2cbe3fSJames Yang 	unsigned char mod_attr;    /* 21 SDRAM Module Attributes */
390f2cbe3fSJames Yang 	unsigned char dev_attr;    /* 22 SDRAM Device Attributes */
400f2cbe3fSJames Yang 	unsigned char clk_cycle2;  /* 23 Min SDRAM Cycle time @ CL=X-0.5 */
410f2cbe3fSJames Yang 	unsigned char clk_access2; /* 24 SDRAM Access from
420f2cbe3fSJames Yang 				         Clk @ CL=X-0.5 (tAC) */
430f2cbe3fSJames Yang 	unsigned char clk_cycle3;  /* 25 Min SDRAM Cycle time @ CL=X-1 */
440f2cbe3fSJames Yang 	unsigned char clk_access3; /* 26 Max Access from Clk @ CL=X-1 (tAC) */
450f2cbe3fSJames Yang 	unsigned char trp;         /* 27 Min Row Precharge Time (tRP)*/
460f2cbe3fSJames Yang 	unsigned char trrd;        /* 28 Min Row Active to Row Active (tRRD) */
470f2cbe3fSJames Yang 	unsigned char trcd;        /* 29 Min RAS to CAS Delay (tRCD) */
480f2cbe3fSJames Yang 	unsigned char tras;        /* 30 Minimum RAS Pulse Width (tRAS) */
490f2cbe3fSJames Yang 	unsigned char bank_dens;   /* 31 Density of each bank on module */
500f2cbe3fSJames Yang 	unsigned char ca_setup;    /* 32 Addr + Cmd Setup Time Before Clk */
510f2cbe3fSJames Yang 	unsigned char ca_hold;     /* 33 Addr + Cmd Hold Time After Clk */
520f2cbe3fSJames Yang 	unsigned char data_setup;  /* 34 Data Input Setup Time Before Strobe */
530f2cbe3fSJames Yang 	unsigned char data_hold;   /* 35 Data Input Hold Time After Strobe */
540f2cbe3fSJames Yang 	unsigned char res_36_40[5];/* 36-40 reserved for VCSDRAM */
550f2cbe3fSJames Yang 	unsigned char trc;         /* 41 Min Active to Auto refresh time tRC */
560f2cbe3fSJames Yang 	unsigned char trfc;        /* 42 Min Auto to Active period tRFC */
570f2cbe3fSJames Yang 	unsigned char tckmax;      /* 43 Max device cycle time tCKmax */
580f2cbe3fSJames Yang 	unsigned char tdqsq;       /* 44 Max DQS to DQ skew (tDQSQ max) */
590f2cbe3fSJames Yang 	unsigned char tqhs;        /* 45 Max Read DataHold skew (tQHS) */
600f2cbe3fSJames Yang 	unsigned char res_46;      /* 46 Reserved */
610f2cbe3fSJames Yang 	unsigned char dimm_height; /* 47 DDR SDRAM DIMM Height */
620f2cbe3fSJames Yang 	unsigned char res_48_61[14]; /* 48-61 Reserved */
630f2cbe3fSJames Yang 	unsigned char spd_rev;     /* 62 SPD Data Revision Code */
640f2cbe3fSJames Yang 	unsigned char cksum;       /* 63 Checksum for bytes 0-62 */
650f2cbe3fSJames Yang 	unsigned char mid[8];      /* 64-71 Mfr's JEDEC ID code per JEP-106 */
660f2cbe3fSJames Yang 	unsigned char mloc;        /* 72 Manufacturing Location */
670f2cbe3fSJames Yang 	unsigned char mpart[18];   /* 73 Manufacturer's Part Number */
680f2cbe3fSJames Yang 	unsigned char rev[2];      /* 91 Revision Code */
690f2cbe3fSJames Yang 	unsigned char mdate[2];    /* 93 Manufacturing Date */
700f2cbe3fSJames Yang 	unsigned char sernum[4];   /* 95 Assembly Serial Number */
710f2cbe3fSJames Yang 	unsigned char mspec[27];   /* 99-127 Manufacturer Specific Data */
720f2cbe3fSJames Yang 
730f2cbe3fSJames Yang } ddr1_spd_eeprom_t;
740f2cbe3fSJames Yang 
750f2cbe3fSJames Yang /*
760f2cbe3fSJames Yang  * Format from "JEDEC Appendix X: Serial Presence Detects for DDR2 SDRAM",
770f2cbe3fSJames Yang  * SPD Revision 1.2
780f2cbe3fSJames Yang  */
790f2cbe3fSJames Yang typedef struct ddr2_spd_eeprom_s {
800f2cbe3fSJames Yang 	unsigned char info_size;   /*  0 # bytes written into serial memory */
810f2cbe3fSJames Yang 	unsigned char chip_size;   /*  1 Total # bytes of SPD memory device */
820f2cbe3fSJames Yang 	unsigned char mem_type;    /*  2 Fundamental memory type */
830f2cbe3fSJames Yang 	unsigned char nrow_addr;   /*  3 # of Row Addresses on this assembly */
840f2cbe3fSJames Yang 	unsigned char ncol_addr;   /*  4 # of Column Addrs on this assembly */
850f2cbe3fSJames Yang 	unsigned char mod_ranks;   /*  5 Number of DIMM Ranks */
860f2cbe3fSJames Yang 	unsigned char dataw;       /*  6 Module Data Width */
870f2cbe3fSJames Yang 	unsigned char res_7;       /*  7 Reserved */
880f2cbe3fSJames Yang 	unsigned char voltage;     /*  8 Voltage intf std of this assembly */
890f2cbe3fSJames Yang 	unsigned char clk_cycle;   /*  9 SDRAM Cycle time @ CL=X */
900f2cbe3fSJames Yang 	unsigned char clk_access;  /* 10 SDRAM Access from Clk @ CL=X (tAC) */
910f2cbe3fSJames Yang 	unsigned char config;      /* 11 DIMM Configuration type */
920f2cbe3fSJames Yang 	unsigned char refresh;     /* 12 Refresh Rate/Type */
930f2cbe3fSJames Yang 	unsigned char primw;       /* 13 Primary SDRAM Width */
940f2cbe3fSJames Yang 	unsigned char ecw;         /* 14 Error Checking SDRAM width */
950f2cbe3fSJames Yang 	unsigned char res_15;      /* 15 Reserved */
960f2cbe3fSJames Yang 	unsigned char burstl;      /* 16 Burst Lengths Supported */
970f2cbe3fSJames Yang 	unsigned char nbanks;      /* 17 # of Banks on Each SDRAM Device */
980f2cbe3fSJames Yang 	unsigned char cas_lat;     /* 18 CAS# Latencies Supported */
990f2cbe3fSJames Yang 	unsigned char mech_char;   /* 19 DIMM Mechanical Characteristics */
1000f2cbe3fSJames Yang 	unsigned char dimm_type;   /* 20 DIMM type information */
1010f2cbe3fSJames Yang 	unsigned char mod_attr;    /* 21 SDRAM Module Attributes */
1020f2cbe3fSJames Yang 	unsigned char dev_attr;    /* 22 SDRAM Device Attributes */
1030f2cbe3fSJames Yang 	unsigned char clk_cycle2;  /* 23 Min SDRAM Cycle time @ CL=X-1 */
1040f2cbe3fSJames Yang 	unsigned char clk_access2; /* 24 SDRAM Access from Clk @ CL=X-1 (tAC) */
1050f2cbe3fSJames Yang 	unsigned char clk_cycle3;  /* 25 Min SDRAM Cycle time @ CL=X-2 */
1060f2cbe3fSJames Yang 	unsigned char clk_access3; /* 26 Max Access from Clk @ CL=X-2 (tAC) */
1070f2cbe3fSJames Yang 	unsigned char trp;         /* 27 Min Row Precharge Time (tRP)*/
1080f2cbe3fSJames Yang 	unsigned char trrd;        /* 28 Min Row Active to Row Active (tRRD) */
1090f2cbe3fSJames Yang 	unsigned char trcd;        /* 29 Min RAS to CAS Delay (tRCD) */
1100f2cbe3fSJames Yang 	unsigned char tras;        /* 30 Minimum RAS Pulse Width (tRAS) */
1110f2cbe3fSJames Yang 	unsigned char rank_dens;   /* 31 Density of each rank on module */
1120f2cbe3fSJames Yang 	unsigned char ca_setup;    /* 32 Addr+Cmd Setup Time Before Clk (tIS) */
1130f2cbe3fSJames Yang 	unsigned char ca_hold;     /* 33 Addr+Cmd Hold Time After Clk (tIH) */
1140f2cbe3fSJames Yang 	unsigned char data_setup;  /* 34 Data Input Setup Time
1150f2cbe3fSJames Yang 				         Before Strobe (tDS) */
1160f2cbe3fSJames Yang 	unsigned char data_hold;   /* 35 Data Input Hold Time
1170f2cbe3fSJames Yang 				         After Strobe (tDH) */
1180f2cbe3fSJames Yang 	unsigned char twr;         /* 36 Write Recovery time tWR */
1190f2cbe3fSJames Yang 	unsigned char twtr;        /* 37 Int write to read delay tWTR */
1200f2cbe3fSJames Yang 	unsigned char trtp;        /* 38 Int read to precharge delay tRTP */
1210f2cbe3fSJames Yang 	unsigned char mem_probe;   /* 39 Mem analysis probe characteristics */
1220f2cbe3fSJames Yang 	unsigned char trctrfc_ext; /* 40 Extensions to trc and trfc */
1230f2cbe3fSJames Yang 	unsigned char trc;         /* 41 Min Active to Auto refresh time tRC */
1240f2cbe3fSJames Yang 	unsigned char trfc;        /* 42 Min Auto to Active period tRFC */
1250f2cbe3fSJames Yang 	unsigned char tckmax;      /* 43 Max device cycle time tCKmax */
1260f2cbe3fSJames Yang 	unsigned char tdqsq;       /* 44 Max DQS to DQ skew (tDQSQ max) */
1270f2cbe3fSJames Yang 	unsigned char tqhs;        /* 45 Max Read DataHold skew (tQHS) */
1280f2cbe3fSJames Yang 	unsigned char pll_relock;  /* 46 PLL Relock time */
1290f2cbe3fSJames Yang 	unsigned char Tcasemax;    /* 47 Tcasemax */
1300f2cbe3fSJames Yang 	unsigned char psiTAdram;   /* 48 Thermal Resistance of DRAM Package from
1310f2cbe3fSJames Yang 				         Top (Case) to Ambient (Psi T-A DRAM) */
1320f2cbe3fSJames Yang 	unsigned char dt0_mode;    /* 49 DRAM Case Temperature Rise from Ambient
1330f2cbe3fSJames Yang 				         due to Activate-Precharge/Mode Bits
1340f2cbe3fSJames Yang 					 (DT0/Mode Bits) */
1350f2cbe3fSJames Yang 	unsigned char dt2n_dt2q;   /* 50 DRAM Case Temperature Rise from Ambient
1360f2cbe3fSJames Yang 				         due to Precharge/Quiet Standby
1370f2cbe3fSJames Yang 					 (DT2N/DT2Q) */
1380f2cbe3fSJames Yang 	unsigned char dt2p;        /* 51 DRAM Case Temperature Rise from Ambient
1390f2cbe3fSJames Yang 				         due to Precharge Power-Down (DT2P) */
1400f2cbe3fSJames Yang 	unsigned char dt3n;        /* 52 DRAM Case Temperature Rise from Ambient
1410f2cbe3fSJames Yang 				         due to Active Standby (DT3N) */
1420f2cbe3fSJames Yang 	unsigned char dt3pfast;    /* 53 DRAM Case Temperature Rise from Ambient
1430f2cbe3fSJames Yang 				         due to Active Power-Down with
1440f2cbe3fSJames Yang 					 Fast PDN Exit (DT3Pfast) */
1450f2cbe3fSJames Yang 	unsigned char dt3pslow;    /* 54 DRAM Case Temperature Rise from Ambient
1460f2cbe3fSJames Yang 				         due to Active Power-Down with Slow
1470f2cbe3fSJames Yang 					 PDN Exit (DT3Pslow) */
1480f2cbe3fSJames Yang 	unsigned char dt4r_dt4r4w; /* 55 DRAM Case Temperature Rise from Ambient
1490f2cbe3fSJames Yang 				         due to Page Open Burst Read/DT4R4W
1500f2cbe3fSJames Yang 					 Mode Bit (DT4R/DT4R4W Mode Bit) */
1510f2cbe3fSJames Yang 	unsigned char dt5b;        /* 56 DRAM Case Temperature Rise from Ambient
1520f2cbe3fSJames Yang 				         due to Burst Refresh (DT5B) */
1530f2cbe3fSJames Yang 	unsigned char dt7;         /* 57 DRAM Case Temperature Rise from Ambient
1540f2cbe3fSJames Yang 				         due to Bank Interleave Reads with
1550f2cbe3fSJames Yang 					 Auto-Precharge (DT7) */
1560f2cbe3fSJames Yang 	unsigned char psiTApll;    /* 58 Thermal Resistance of PLL Package form
1570f2cbe3fSJames Yang 				         Top (Case) to Ambient (Psi T-A PLL) */
1580f2cbe3fSJames Yang 	unsigned char psiTAreg;    /* 59 Thermal Reisitance of Register Package
1590f2cbe3fSJames Yang 				         from Top (Case) to Ambient
1600f2cbe3fSJames Yang 					 (Psi T-A Register) */
1610f2cbe3fSJames Yang 	unsigned char dtpllactive; /* 60 PLL Case Temperature Rise from Ambient
1620f2cbe3fSJames Yang 				         due to PLL Active (DT PLL Active) */
1630f2cbe3fSJames Yang 	unsigned char dtregact;    /* 61 Register Case Temperature Rise from
1640f2cbe3fSJames Yang 				         Ambient due to Register Active/Mode Bit
1650f2cbe3fSJames Yang 					 (DT Register Active/Mode Bit) */
1660f2cbe3fSJames Yang 	unsigned char spd_rev;     /* 62 SPD Data Revision Code */
1670f2cbe3fSJames Yang 	unsigned char cksum;       /* 63 Checksum for bytes 0-62 */
1680f2cbe3fSJames Yang 	unsigned char mid[8];      /* 64 Mfr's JEDEC ID code per JEP-106 */
1690f2cbe3fSJames Yang 	unsigned char mloc;        /* 72 Manufacturing Location */
1700f2cbe3fSJames Yang 	unsigned char mpart[18];   /* 73 Manufacturer's Part Number */
1710f2cbe3fSJames Yang 	unsigned char rev[2];      /* 91 Revision Code */
1720f2cbe3fSJames Yang 	unsigned char mdate[2];    /* 93 Manufacturing Date */
1730f2cbe3fSJames Yang 	unsigned char sernum[4];   /* 95 Assembly Serial Number */
1740f2cbe3fSJames Yang 	unsigned char mspec[27];   /* 99-127 Manufacturer Specific Data */
1750f2cbe3fSJames Yang 
1760f2cbe3fSJames Yang } ddr2_spd_eeprom_t;
1770f2cbe3fSJames Yang 
1780f2cbe3fSJames Yang typedef struct ddr3_spd_eeprom_s {
1790f2cbe3fSJames Yang 	/* General Section: Bytes 0-59 */
1800f2cbe3fSJames Yang 	unsigned char info_size_crc;   /*  0 # bytes written into serial memory,
1810f2cbe3fSJames Yang 					     CRC coverage */
1820f2cbe3fSJames Yang 	unsigned char spd_rev;         /*  1 Total # bytes of SPD mem device */
1830f2cbe3fSJames Yang 	unsigned char mem_type;        /*  2 Key Byte / Fundamental mem type */
1840f2cbe3fSJames Yang 	unsigned char module_type;     /*  3 Key Byte / Module Type */
1850f2cbe3fSJames Yang 	unsigned char density_banks;   /*  4 SDRAM Density and Banks */
1860f2cbe3fSJames Yang 	unsigned char addressing;      /*  5 SDRAM Addressing */
187c360ceacSDave Liu 	unsigned char module_vdd;      /*  6 Module nominal voltage, VDD */
1880f2cbe3fSJames Yang 	unsigned char organization;    /*  7 Module Organization */
1890f2cbe3fSJames Yang 	unsigned char bus_width;       /*  8 Module Memory Bus Width */
1900f2cbe3fSJames Yang 	unsigned char ftb_div;         /*  9 Fine Timebase (FTB)
1910f2cbe3fSJames Yang 					     Dividend / Divisor */
1920f2cbe3fSJames Yang 	unsigned char mtb_dividend;    /* 10 Medium Timebase (MTB) Dividend */
1930f2cbe3fSJames Yang 	unsigned char mtb_divisor;     /* 11 Medium Timebase (MTB) Divisor */
1940f2cbe3fSJames Yang 	unsigned char tCK_min;         /* 12 SDRAM Minimum Cycle Time */
1950f2cbe3fSJames Yang 	unsigned char res_13;          /* 13 Reserved */
1960f2cbe3fSJames Yang 	unsigned char caslat_lsb;      /* 14 CAS Latencies Supported,
1970f2cbe3fSJames Yang 					     Least Significant Byte */
1980f2cbe3fSJames Yang 	unsigned char caslat_msb;      /* 15 CAS Latencies Supported,
1990f2cbe3fSJames Yang 					     Most Significant Byte */
2000f2cbe3fSJames Yang 	unsigned char tAA_min;         /* 16 Min CAS Latency Time */
2010f2cbe3fSJames Yang 	unsigned char tWR_min;         /* 17 Min Write REcovery Time */
2020f2cbe3fSJames Yang 	unsigned char tRCD_min;        /* 18 Min RAS# to CAS# Delay Time */
2030f2cbe3fSJames Yang 	unsigned char tRRD_min;        /* 19 Min Row Active to
2040f2cbe3fSJames Yang 					     Row Active Delay Time */
2050f2cbe3fSJames Yang 	unsigned char tRP_min;         /* 20 Min Row Precharge Delay Time */
2060f2cbe3fSJames Yang 	unsigned char tRAS_tRC_ext;    /* 21 Upper Nibbles for tRAS and tRC */
2070f2cbe3fSJames Yang 	unsigned char tRAS_min_lsb;    /* 22 Min Active to Precharge
2080f2cbe3fSJames Yang 					     Delay Time */
2090f2cbe3fSJames Yang 	unsigned char tRC_min_lsb;     /* 23 Min Active to Active/Refresh
2100f2cbe3fSJames Yang 					     Delay Time, LSB */
2110f2cbe3fSJames Yang 	unsigned char tRFC_min_lsb;    /* 24 Min Refresh Recovery Delay Time */
2120f2cbe3fSJames Yang 	unsigned char tRFC_min_msb;    /* 25 Min Refresh Recovery Delay Time */
2130f2cbe3fSJames Yang 	unsigned char tWTR_min;        /* 26 Min Internal Write to
2140f2cbe3fSJames Yang 					     Read Command Delay Time */
2150f2cbe3fSJames Yang 	unsigned char tRTP_min;        /* 27 Min Internal Read to Precharge
2160f2cbe3fSJames Yang 					     Command Delay Time */
2170f2cbe3fSJames Yang 	unsigned char tFAW_msb;        /* 28 Upper Nibble for tFAW */
2180f2cbe3fSJames Yang 	unsigned char tFAW_min;        /* 29 Min Four Activate Window
2190f2cbe3fSJames Yang 					     Delay Time*/
2200f2cbe3fSJames Yang 	unsigned char opt_features;    /* 30 SDRAM Optional Features */
2210f2cbe3fSJames Yang 	unsigned char therm_ref_opt;   /* 31 SDRAM Thermal and Refresh Opts */
2220f2cbe3fSJames Yang 	unsigned char res_32_59[28];   /* 32-59 Reserved, General Section */
2230f2cbe3fSJames Yang 
2240f2cbe3fSJames Yang 	/* Module-Specific Section: Bytes 60-116 */
2250f2cbe3fSJames Yang 	union {
2260f2cbe3fSJames Yang 		struct {
2270f2cbe3fSJames Yang 			/* 60 (Unbuffered) Module Nominal Height */
2280f2cbe3fSJames Yang 			unsigned char mod_height;
2290f2cbe3fSJames Yang 			/* 61 (Unbuffered) Module Maximum Thickness */
2300f2cbe3fSJames Yang 			unsigned char mod_thickness;
2310f2cbe3fSJames Yang 			/* 62 (Unbuffered) Reference Raw Card Used */
2320f2cbe3fSJames Yang 			unsigned char ref_raw_card;
2330f2cbe3fSJames Yang 			/* 63 (Unbuffered) Address Mapping from
2340f2cbe3fSJames Yang 			      Edge Connector to DRAM */
2350f2cbe3fSJames Yang 			unsigned char addr_mapping;
2360f2cbe3fSJames Yang 			/* 64-116 (Unbuffered) Reserved */
2370f2cbe3fSJames Yang 			unsigned char res_64_116[53];
2380f2cbe3fSJames Yang 		} unbuffered;
2390f2cbe3fSJames Yang 		struct {
2400f2cbe3fSJames Yang 			/* 60 (Registered) Module Nominal Height */
2410f2cbe3fSJames Yang 			unsigned char mod_height;
2420f2cbe3fSJames Yang 			/* 61 (Registered) Module Maximum Thickness */
2430f2cbe3fSJames Yang 			unsigned char mod_thickness;
2440f2cbe3fSJames Yang 			/* 62 (Registered) Reference Raw Card Used */
2450f2cbe3fSJames Yang 			unsigned char ref_raw_card;
2469490ff48Syork 			/* 63 DIMM Module Attributes */
2479490ff48Syork 			unsigned char modu_attr;
2489490ff48Syork 			/* 64 RDIMM Thermal Heat Spreader Solution */
2499490ff48Syork 			unsigned char thermal;
2509490ff48Syork 			/* 65 Register Manufacturer ID Code, Least Significant Byte */
2519490ff48Syork 			unsigned char reg_id_lo;
2529490ff48Syork 			/* 66 Register Manufacturer ID Code, Most Significant Byte */
2539490ff48Syork 			unsigned char reg_id_hi;
2549490ff48Syork 			/* 67 Register Revision Number */
2559490ff48Syork 			unsigned char reg_rev;
2569490ff48Syork 			/* 68 Register Type */
2579490ff48Syork 			unsigned char reg_type;
2589490ff48Syork 			/* 69-76 RC1,3,5...15 (MS Nibble) / RC0,2,4...14 (LS Nibble) */
2599490ff48Syork 			unsigned char rcw[8];
2600f2cbe3fSJames Yang 		} registered;
2610f2cbe3fSJames Yang 		unsigned char uc[57]; /* 60-116 Module-Specific Section */
2620f2cbe3fSJames Yang 	} mod_section;
2630f2cbe3fSJames Yang 
2640f2cbe3fSJames Yang 	/* Unique Module ID: Bytes 117-125 */
2650f2cbe3fSJames Yang 	unsigned char mmid_lsb;        /* 117 Module MfgID Code LSB - JEP-106 */
2660f2cbe3fSJames Yang 	unsigned char mmid_msb;        /* 118 Module MfgID Code MSB - JEP-106 */
2670f2cbe3fSJames Yang 	unsigned char mloc;            /* 119 Mfg Location */
2680f2cbe3fSJames Yang 	unsigned char mdate[2];        /* 120-121 Mfg Date */
2690f2cbe3fSJames Yang 	unsigned char sernum[4];       /* 122-125 Module Serial Number */
2700f2cbe3fSJames Yang 
2710f2cbe3fSJames Yang 	/* CRC: Bytes 126-127 */
2720f2cbe3fSJames Yang 	unsigned char crc[2];          /* 126-127 SPD CRC */
2730f2cbe3fSJames Yang 
2740f2cbe3fSJames Yang 	/* Other Manufacturer Fields and User Space: Bytes 128-255 */
2750f2cbe3fSJames Yang 	unsigned char mpart[18];       /* 128-145 Mfg's Module Part Number */
2760f2cbe3fSJames Yang 	unsigned char mrev[2];         /* 146-147 Module Revision Code */
2770f2cbe3fSJames Yang 
2780f2cbe3fSJames Yang 	unsigned char dmid_lsb;        /* 148 DRAM MfgID Code LSB - JEP-106 */
2790f2cbe3fSJames Yang 	unsigned char dmid_msb;        /* 149 DRAM MfgID Code MSB - JEP-106 */
2800f2cbe3fSJames Yang 
2810f2cbe3fSJames Yang 	unsigned char msd[26];         /* 150-175 Mfg's Specific Data */
2820f2cbe3fSJames Yang 	unsigned char cust[80];        /* 176-255 Open for Customer Use */
2830f2cbe3fSJames Yang 
2840f2cbe3fSJames Yang } ddr3_spd_eeprom_t;
2850f2cbe3fSJames Yang 
2860f2cbe3fSJames Yang extern unsigned int ddr1_spd_check(const ddr1_spd_eeprom_t *spd);
2870f2cbe3fSJames Yang extern void ddr1_spd_dump(const ddr1_spd_eeprom_t *spd);
2880f2cbe3fSJames Yang extern unsigned int ddr2_spd_check(const ddr2_spd_eeprom_t *spd);
2890f2cbe3fSJames Yang extern void ddr2_spd_dump(const ddr2_spd_eeprom_t *spd);
290c360ceacSDave Liu extern unsigned int ddr3_spd_check(const ddr3_spd_eeprom_t *spd);
2910f2cbe3fSJames Yang 
2920f2cbe3fSJames Yang /*
2930f2cbe3fSJames Yang  * Byte 2 Fundamental Memory Types.
2940f2cbe3fSJames Yang  */
2950f2cbe3fSJames Yang #define SPD_MEMTYPE_FPM		(0x01)
2960f2cbe3fSJames Yang #define SPD_MEMTYPE_EDO		(0x02)
2970f2cbe3fSJames Yang #define SPD_MEMTYPE_PIPE_NIBBLE	(0x03)
2980f2cbe3fSJames Yang #define SPD_MEMTYPE_SDRAM	(0x04)
2990f2cbe3fSJames Yang #define SPD_MEMTYPE_ROM		(0x05)
3000f2cbe3fSJames Yang #define SPD_MEMTYPE_SGRAM	(0x06)
3010f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR		(0x07)
3020f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR2	(0x08)
3030f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR2_FBDIMM	(0x09)
3040f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR2_FBDIMM_PROBE	(0x0A)
3050f2cbe3fSJames Yang #define SPD_MEMTYPE_DDR3	(0x0B)
3060f2cbe3fSJames Yang 
307*c7fd27ccSKyle Moffett /* DIMM Type for DDR2 SPD (according to v1.3) */
308*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_UNDEFINED	(0x00)
309*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_RDIMM		(0x01)
310*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_UDIMM		(0x02)
311*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_SO_DIMM	(0x04)
312*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_72B_SO_CDIMM	(0x06)
313*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_72B_SO_RDIMM	(0x07)
314*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_MICRO_DIMM	(0x08)
315*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_MINI_RDIMM	(0x10)
316*c7fd27ccSKyle Moffett #define DDR2_SPD_DIMMTYPE_MINI_UDIMM	(0x20)
317*c7fd27ccSKyle Moffett 
318*c7fd27ccSKyle Moffett /* Byte 3 Key Byte / Module Type for DDR3 SPD */
319*c7fd27ccSKyle Moffett #define DDR3_SPD_MODULETYPE_MASK	(0x0f)
320*c7fd27ccSKyle Moffett #define DDR3_SPD_MODULETYPE_RDIMM	(0x01)
321*c7fd27ccSKyle Moffett #define DDR3_SPD_MODULETYPE_UDIMM	(0x02)
322*c7fd27ccSKyle Moffett #define DDR3_SPD_MODULETYPE_SO_DIMM	(0x03)
323*c7fd27ccSKyle Moffett #define DDR3_SPD_MODULETYPE_MICRO_DIMM	(0x04)
324*c7fd27ccSKyle Moffett #define DDR3_SPD_MODULETYPE_MINI_RDIMM	(0x05)
325*c7fd27ccSKyle Moffett #define DDR3_SPD_MODULETYPE_MINI_UDIMM	(0x06)
326c360ceacSDave Liu 
3270f2cbe3fSJames Yang #endif /* _DDR_SPD_H_ */
328