]> git.sur5r.net Git - u-boot/commitdiff
Pass dimm parameters to populate populate controller options
authorHaiying Wang <Haiying.Wang@freescale.com>
Fri, 3 Oct 2008 16:36:55 +0000 (12:36 -0400)
committerWolfgang Denk <wd@denx.de>
Sat, 18 Oct 2008 19:54:04 +0000 (21:54 +0200)
Because some dimm parameters like n_ranks needs to be used with the board
frequency to choose the board parameters like clk_adjust etc. in the
board_specific_paramesters table of the board ddr file, we need to pass
the dimm parameters to the board file.

* move ddr dimm parameters header file from /cpu to /include directory.
* add ddr dimm parameters to populate board specific options.
* Fix fsl_ddr_board_options() for all the 8xxx boards which call this function.

Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
26 files changed:
board/atum8548/ddr.c
board/freescale/mpc8536ds/ddr.c
board/freescale/mpc8540ads/ddr.c
board/freescale/mpc8541cds/ddr.c
board/freescale/mpc8544ds/ddr.c
board/freescale/mpc8548cds/ddr.c
board/freescale/mpc8555cds/ddr.c
board/freescale/mpc8560ads/ddr.c
board/freescale/mpc8568mds/ddr.c
board/freescale/mpc8572ds/ddr.c
board/freescale/mpc8610hpcd/ddr.c
board/freescale/mpc8641hpcn/ddr.c
board/mpc8540eval/ddr.c
board/pm854/ddr.c
board/pm856/ddr.c
board/sbc8548/ddr.c
board/sbc8560/ddr.c
board/sbc8641d/ddr.c
board/socrates/ddr.c
board/stxgp3/ddr.c
board/stxssa/ddr.c
cpu/mpc8xxx/ddr/ddr.h
cpu/mpc8xxx/ddr/ddr1_2_dimm_params.h [deleted file]
cpu/mpc8xxx/ddr/main.c
cpu/mpc8xxx/ddr/options.c
include/asm-ppc/fsl_ddr_dimm_params.h [new file with mode: 0644]

index f07d746c2054bf1c17ce68b7ec382dea198816dd..ab64fa88f2655916348963351f08d0e277fbc3f1 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -37,7 +38,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 2e88c793317f063f5e27a5abfc780ef28e072c3b..3135d6dfe4bdd27c303c6d486c53a7794106b216 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
 {
@@ -36,7 +37,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index 11ce57d3621918644bcb8d9360fcd191bfc74e0b..c84a6cbe1c7715fcfd1b7ec11aecef5a32339da7 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -36,7 +37,9 @@ void fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index bbb5ee2c4ab16cb2aef31b067d0555c193e616d2..34f84a2656212e6655465e0289d2b9a897866fee 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -37,7 +38,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index f07d746c2054bf1c17ce68b7ec382dea198816dd..ab64fa88f2655916348963351f08d0e277fbc3f1 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -37,7 +38,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 11ce57d3621918644bcb8d9360fcd191bfc74e0b..c84a6cbe1c7715fcfd1b7ec11aecef5a32339da7 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -36,7 +37,9 @@ void fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index 1b8ecec5a98fc7dfe5cf27ebf5206131dd9dd896..482fd919f5428ad60cdbfb19dda4c57402d1e3ee 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -38,7 +39,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 5f8c55504c03c4a73106f0b417f0d95d85391971..435893a4ec9bbcdea20fd2d895a08599296b1032 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
 {
@@ -38,7 +39,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 2d22da17770bd5dd8dc99e01cde02bd02298de5a..414ac243a5b77c9818522b346d09a21c3be0e372 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -36,7 +37,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 5163abf0522de6fbc2e6cd1b9309001aefcdcd45..23497f982587748d872b8b6ce2da4c7c69b67756 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -45,7 +46,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index f07d746c2054bf1c17ce68b7ec382dea198816dd..ab64fa88f2655916348963351f08d0e277fbc3f1 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -37,7 +38,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index 5163abf0522de6fbc2e6cd1b9309001aefcdcd45..23497f982587748d872b8b6ce2da4c7c69b67756 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -45,7 +46,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 62a5951831f79c977560a78ef992a0538cd6ac5d..2b62b847054accf192d5fa77513cf3e9c70e98ec 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr2_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -37,7 +38,9 @@ void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for clock adjust:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index 45372f42713cafad729a03924cfe5bb87e96b7b8..7850794d64ff0f6339bc07c3bd4097e73421f73e 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
 static void
 get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
@@ -40,7 +41,9 @@ fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
        }
 }
 
-void fsl_ddr_board_options(memctl_options_t *popts, unsigned int ctrl_num)
+void fsl_ddr_board_options(memctl_options_t *popts,
+                               dimm_params_t *pdimm,
+                               unsigned int ctrl_num)
 {
        /*
         * Factors to consider for CPO:
index 0d79be32219c26826a40314e4b287eb208409530..9ffd5485cdca5d2d155606e19d1a12f0e5b74e06 100644 (file)
@@ -10,8 +10,8 @@
 #define FSL_DDR_MAIN_H
 
 #include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_ddr_dimm_params.h>
 
-#include "ddr1_2_dimm_params.h"
 #include "common_timing_params.h"
 
 /*
@@ -71,6 +71,7 @@ compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params,
                                      unsigned int number_of_dimms);
 extern unsigned int populate_memctl_options(int all_DIMMs_registered,
                                memctl_options_t *popts,
+                               dimm_params_t *pdimm,
                                unsigned int ctrl_num);
 
 extern unsigned int mclk_to_picos(unsigned int mclk);
diff --git a/cpu/mpc8xxx/ddr/ddr1_2_dimm_params.h b/cpu/mpc8xxx/ddr/ddr1_2_dimm_params.h
deleted file mode 100644 (file)
index c794eed..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2008 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
- */
-
-#ifndef DDR2_DIMM_PARAMS_H
-#define DDR2_DIMM_PARAMS_H
-
-/* Parameters for a DDR2 dimm computed from the SPD */
-typedef struct dimm_params_s {
-
-       /* DIMM organization parameters */
-       char mpart[19];         /* guaranteed null terminated */
-
-       unsigned int n_ranks;
-       unsigned long long rank_density;
-       unsigned long long capacity;
-       unsigned int data_width;
-       unsigned int primary_sdram_width;
-       unsigned int ec_sdram_width;
-       unsigned int registered_dimm;
-
-       /* SDRAM device parameters */
-       unsigned int n_row_addr;
-       unsigned int n_col_addr;
-       unsigned int edc_config;        /* 0 = none, 1 = parity, 2 = ECC */
-       unsigned int n_banks_per_sdram_device;
-       unsigned int burst_lengths_bitmask;     /* BL=4 bit 2, BL=8 = bit 3 */
-       unsigned int row_density;
-
-       /* used in computing base address of DIMMs */
-       unsigned long long base_address;
-
-       /* DIMM timing parameters */
-
-       /*
-        * SDRAM clock periods
-        * The range for these are 1000-10000 so a short should be sufficient
-        */
-       unsigned int tCKmin_X_ps;
-       unsigned int tCKmin_X_minus_1_ps;
-       unsigned int tCKmin_X_minus_2_ps;
-       unsigned int tCKmax_ps;
-
-       /* SPD-defined CAS latencies */
-       unsigned int caslat_X;
-       unsigned int caslat_X_minus_1;
-       unsigned int caslat_X_minus_2;
-
-       unsigned int caslat_lowest_derated;     /* Derated CAS latency */
-
-       /* basic timing parameters */
-       unsigned int tRCD_ps;
-       unsigned int tRP_ps;
-       unsigned int tRAS_ps;
-
-       unsigned int tWR_ps;    /* maximum = 63750 ps */
-       unsigned int tWTR_ps;   /* maximum = 63750 ps */
-       unsigned int tRFC_ps;   /* max = 255 ns + 256 ns + .75 ns
-                                      = 511750 ps */
-
-       unsigned int tRRD_ps;   /* maximum = 63750 ps */
-       unsigned int tRC_ps;    /* maximum = 254 ns + .75 ns = 254750 ps */
-
-       unsigned int refresh_rate_ps;
-
-       unsigned int tIS_ps;    /* byte 32, spd->ca_setup */
-       unsigned int tIH_ps;    /* byte 33, spd->ca_hold */
-       unsigned int tDS_ps;    /* byte 34, spd->data_setup */
-       unsigned int tDH_ps;    /* byte 35, spd->data_hold */
-       unsigned int tRTP_ps;   /* byte 38, spd->trtp */
-       unsigned int tDQSQ_max_ps;      /* byte 44, spd->tdqsq */
-       unsigned int tQHS_ps;   /* byte 45, spd->tqhs */
-} dimm_params_t;
-
-extern unsigned int ddr_compute_dimm_parameters(
-                                        const generic_spd_eeprom_t *spd,
-                                        dimm_params_t *pdimm,
-                                        unsigned int dimm_number);
-
-#endif
index d26c5c5c29ae08ac84665c448f44c8c2e9f1bba3..700b8971729f84dccced25b04306bc682d7f59d5 100644 (file)
@@ -319,7 +319,8 @@ fsl_ddr_compute(fsl_ddr_info_t *pinfo, unsigned int start_step)
                         */
                        populate_memctl_options(
                                        timing_params[i].all_DIMMs_registered,
-                                       &pinfo->memctl_opts[i], i);
+                                       &pinfo->memctl_opts[i],
+                                       pinfo->dimm_params[i], i);
                }
 
        case STEP_ASSIGN_ADDRESSES:
index 6c2b43c0c59925f0c4d88ad15d639d7a875b0729..99b56856641c6305f3256b0c4e3429c68cc84460 100644 (file)
 
 /* Board-specific functions defined in each board's ddr.c */
 extern void fsl_ddr_board_options(memctl_options_t *popts,
+               dimm_params_t *pdimm,
                unsigned int ctrl_num);
 
 unsigned int populate_memctl_options(int all_DIMMs_registered,
                        memctl_options_t *popts,
+                       dimm_params_t *pdimm,
                        unsigned int ctrl_num)
 {
        unsigned int i;
@@ -191,7 +193,7 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
         * controllers.
         */
 
-       fsl_ddr_board_options(popts, ctrl_num);
+       fsl_ddr_board_options(popts, pdimm, ctrl_num);
 
        return 0;
 }
diff --git a/include/asm-ppc/fsl_ddr_dimm_params.h b/include/asm-ppc/fsl_ddr_dimm_params.h
new file mode 100644 (file)
index 0000000..c794eed
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ */
+
+#ifndef DDR2_DIMM_PARAMS_H
+#define DDR2_DIMM_PARAMS_H
+
+/* Parameters for a DDR2 dimm computed from the SPD */
+typedef struct dimm_params_s {
+
+       /* DIMM organization parameters */
+       char mpart[19];         /* guaranteed null terminated */
+
+       unsigned int n_ranks;
+       unsigned long long rank_density;
+       unsigned long long capacity;
+       unsigned int data_width;
+       unsigned int primary_sdram_width;
+       unsigned int ec_sdram_width;
+       unsigned int registered_dimm;
+
+       /* SDRAM device parameters */
+       unsigned int n_row_addr;
+       unsigned int n_col_addr;
+       unsigned int edc_config;        /* 0 = none, 1 = parity, 2 = ECC */
+       unsigned int n_banks_per_sdram_device;
+       unsigned int burst_lengths_bitmask;     /* BL=4 bit 2, BL=8 = bit 3 */
+       unsigned int row_density;
+
+       /* used in computing base address of DIMMs */
+       unsigned long long base_address;
+
+       /* DIMM timing parameters */
+
+       /*
+        * SDRAM clock periods
+        * The range for these are 1000-10000 so a short should be sufficient
+        */
+       unsigned int tCKmin_X_ps;
+       unsigned int tCKmin_X_minus_1_ps;
+       unsigned int tCKmin_X_minus_2_ps;
+       unsigned int tCKmax_ps;
+
+       /* SPD-defined CAS latencies */
+       unsigned int caslat_X;
+       unsigned int caslat_X_minus_1;
+       unsigned int caslat_X_minus_2;
+
+       unsigned int caslat_lowest_derated;     /* Derated CAS latency */
+
+       /* basic timing parameters */
+       unsigned int tRCD_ps;
+       unsigned int tRP_ps;
+       unsigned int tRAS_ps;
+
+       unsigned int tWR_ps;    /* maximum = 63750 ps */
+       unsigned int tWTR_ps;   /* maximum = 63750 ps */
+       unsigned int tRFC_ps;   /* max = 255 ns + 256 ns + .75 ns
+                                      = 511750 ps */
+
+       unsigned int tRRD_ps;   /* maximum = 63750 ps */
+       unsigned int tRC_ps;    /* maximum = 254 ns + .75 ns = 254750 ps */
+
+       unsigned int refresh_rate_ps;
+
+       unsigned int tIS_ps;    /* byte 32, spd->ca_setup */
+       unsigned int tIH_ps;    /* byte 33, spd->ca_hold */
+       unsigned int tDS_ps;    /* byte 34, spd->data_setup */
+       unsigned int tDH_ps;    /* byte 35, spd->data_hold */
+       unsigned int tRTP_ps;   /* byte 38, spd->trtp */
+       unsigned int tDQSQ_max_ps;      /* byte 44, spd->tdqsq */
+       unsigned int tQHS_ps;   /* byte 45, spd->tqhs */
+} dimm_params_t;
+
+extern unsigned int ddr_compute_dimm_parameters(
+                                        const generic_spd_eeprom_t *spd,
+                                        dimm_params_t *pdimm,
+                                        unsigned int dimm_number);
+
+#endif