All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haiying Wang <Haiying.Wang@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] (no subject)
Date: Fri,  3 Oct 2008 12:32:18 -0400	[thread overview]
Message-ID: <1223051538-22445-1-git-send-email-Haiying.Wang@freescale.com> (raw)

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>
---
 board/atum8548/ddr.c                  |    5 ++-
 board/freescale/mpc8536ds/ddr.c       |    5 ++-
 board/freescale/mpc8540ads/ddr.c      |    5 ++-
 board/freescale/mpc8541cds/ddr.c      |    5 ++-
 board/freescale/mpc8544ds/ddr.c       |    5 ++-
 board/freescale/mpc8548cds/ddr.c      |    5 ++-
 board/freescale/mpc8555cds/ddr.c      |    5 ++-
 board/freescale/mpc8560ads/ddr.c      |    5 ++-
 board/freescale/mpc8568mds/ddr.c      |    5 ++-
 board/freescale/mpc8572ds/ddr.c       |    5 ++-
 board/freescale/mpc8610hpcd/ddr.c     |    5 ++-
 board/freescale/mpc8641hpcn/ddr.c     |    5 ++-
 board/mpc8540eval/ddr.c               |    5 ++-
 board/pm854/ddr.c                     |    5 ++-
 board/pm856/ddr.c                     |    5 ++-
 board/sbc8548/ddr.c                   |    5 ++-
 board/sbc8560/ddr.c                   |    5 ++-
 board/sbc8641d/ddr.c                  |    5 ++-
 board/socrates/ddr.c                  |    5 ++-
 board/stxgp3/ddr.c                    |    5 ++-
 board/stxssa/ddr.c                    |    5 ++-
 cpu/mpc8xxx/ddr/ddr.h                 |    3 +-
 cpu/mpc8xxx/ddr/ddr1_2_dimm_params.h  |   84 ---------------------------------
 cpu/mpc8xxx/ddr/main.c                |    3 +-
 cpu/mpc8xxx/ddr/options.c             |    4 +-
 include/asm-ppc/fsl_ddr_dimm_params.h |   84 +++++++++++++++++++++++++++++++++
 26 files changed, 175 insertions(+), 108 deletions(-)
 delete mode 100644 cpu/mpc8xxx/ddr/ddr1_2_dimm_params.h
 create mode 100644 include/asm-ppc/fsl_ddr_dimm_params.h

diff --git a/board/atum8548/ddr.c b/board/atum8548/ddr.c
index f07d746..ab64fa8 100644
--- a/board/atum8548/ddr.c
+++ b/board/atum8548/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8536ds/ddr.c b/board/freescale/mpc8536ds/ddr.c
index 2e88c79..3135d6d 100644
--- a/board/freescale/mpc8536ds/ddr.c
+++ b/board/freescale/mpc8536ds/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8540ads/ddr.c b/board/freescale/mpc8540ads/ddr.c
index 45372f4..7850794 100644
--- a/board/freescale/mpc8540ads/ddr.c
+++ b/board/freescale/mpc8540ads/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8541cds/ddr.c b/board/freescale/mpc8541cds/ddr.c
index 11ce57d..c84a6cb 100644
--- a/board/freescale/mpc8541cds/ddr.c
+++ b/board/freescale/mpc8541cds/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8544ds/ddr.c b/board/freescale/mpc8544ds/ddr.c
index bbb5ee2..34f84a2 100644
--- a/board/freescale/mpc8544ds/ddr.c
+++ b/board/freescale/mpc8544ds/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8548cds/ddr.c b/board/freescale/mpc8548cds/ddr.c
index f07d746..ab64fa8 100644
--- a/board/freescale/mpc8548cds/ddr.c
+++ b/board/freescale/mpc8548cds/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8555cds/ddr.c b/board/freescale/mpc8555cds/ddr.c
index 11ce57d..c84a6cb 100644
--- a/board/freescale/mpc8555cds/ddr.c
+++ b/board/freescale/mpc8555cds/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8560ads/ddr.c b/board/freescale/mpc8560ads/ddr.c
index 45372f4..7850794 100644
--- a/board/freescale/mpc8560ads/ddr.c
+++ b/board/freescale/mpc8560ads/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8568mds/ddr.c b/board/freescale/mpc8568mds/ddr.c
index 1b8ecec..482fd91 100644
--- a/board/freescale/mpc8568mds/ddr.c
+++ b/board/freescale/mpc8568mds/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8572ds/ddr.c b/board/freescale/mpc8572ds/ddr.c
index 5f8c555..435893a 100644
--- a/board/freescale/mpc8572ds/ddr.c
+++ b/board/freescale/mpc8572ds/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8610hpcd/ddr.c b/board/freescale/mpc8610hpcd/ddr.c
index 2d22da1..414ac24 100644
--- a/board/freescale/mpc8610hpcd/ddr.c
+++ b/board/freescale/mpc8610hpcd/ddr.c
@@ -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:
diff --git a/board/freescale/mpc8641hpcn/ddr.c b/board/freescale/mpc8641hpcn/ddr.c
index 5163abf..23497f9 100644
--- a/board/freescale/mpc8641hpcn/ddr.c
+++ b/board/freescale/mpc8641hpcn/ddr.c
@@ -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:
diff --git a/board/mpc8540eval/ddr.c b/board/mpc8540eval/ddr.c
index 45372f4..7850794 100644
--- a/board/mpc8540eval/ddr.c
+++ b/board/mpc8540eval/ddr.c
@@ -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:
diff --git a/board/pm854/ddr.c b/board/pm854/ddr.c
index 45372f4..7850794 100644
--- a/board/pm854/ddr.c
+++ b/board/pm854/ddr.c
@@ -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:
diff --git a/board/pm856/ddr.c b/board/pm856/ddr.c
index 45372f4..7850794 100644
--- a/board/pm856/ddr.c
+++ b/board/pm856/ddr.c
@@ -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:
diff --git a/board/sbc8548/ddr.c b/board/sbc8548/ddr.c
index f07d746..ab64fa8 100644
--- a/board/sbc8548/ddr.c
+++ b/board/sbc8548/ddr.c
@@ -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:
diff --git a/board/sbc8560/ddr.c b/board/sbc8560/ddr.c
index 45372f4..7850794 100644
--- a/board/sbc8560/ddr.c
+++ b/board/sbc8560/ddr.c
@@ -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:
diff --git a/board/sbc8641d/ddr.c b/board/sbc8641d/ddr.c
index 5163abf..23497f9 100644
--- a/board/sbc8641d/ddr.c
+++ b/board/sbc8641d/ddr.c
@@ -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:
diff --git a/board/socrates/ddr.c b/board/socrates/ddr.c
index 62a5951..2b62b84 100644
--- a/board/socrates/ddr.c
+++ b/board/socrates/ddr.c
@@ -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:
diff --git a/board/stxgp3/ddr.c b/board/stxgp3/ddr.c
index 45372f4..7850794 100644
--- a/board/stxgp3/ddr.c
+++ b/board/stxgp3/ddr.c
@@ -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:
diff --git a/board/stxssa/ddr.c b/board/stxssa/ddr.c
index 45372f4..7850794 100644
--- a/board/stxssa/ddr.c
+++ b/board/stxssa/ddr.c
@@ -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:
diff --git a/cpu/mpc8xxx/ddr/ddr.h b/cpu/mpc8xxx/ddr/ddr.h
index f5dc40a..0372164 100644
--- a/cpu/mpc8xxx/ddr/ddr.h
+++ b/cpu/mpc8xxx/ddr/ddr.h
@@ -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
index c794eed..0000000
--- a/cpu/mpc8xxx/ddr/ddr1_2_dimm_params.h
+++ /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
diff --git a/cpu/mpc8xxx/ddr/main.c b/cpu/mpc8xxx/ddr/main.c
index d26c5c5..98a8651 100644
--- a/cpu/mpc8xxx/ddr/main.c
+++ b/cpu/mpc8xxx/ddr/main.c
@@ -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:
diff --git a/cpu/mpc8xxx/ddr/options.c b/cpu/mpc8xxx/ddr/options.c
index 6c2b43c..99b5685 100644
--- a/cpu/mpc8xxx/ddr/options.c
+++ b/cpu/mpc8xxx/ddr/options.c
@@ -13,10 +13,12 @@
 
 /* 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
index 0000000..c794eed
--- /dev/null
+++ b/include/asm-ppc/fsl_ddr_dimm_params.h
@@ -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
-- 
1.6.0.2

             reply	other threads:[~2008-10-03 16:32 UTC|newest]

Thread overview: 229+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03 16:32 Haiying Wang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-08-29 13:40 [U-Boot] (no subject) Thomas Schaefer
2019-08-29 13:53 ` Fabio Estevam
2019-08-29 15:12   ` Thomas Schaefer
2019-08-29 15:21     ` Fabio Estevam
2019-06-30  2:06 Thomas Chou
2019-06-30 10:31 ` Bin Meng
2019-07-01 13:19   ` Tom Rini
2019-07-04  2:00     ` Thomas Chou
2019-07-04  1:58   ` Thomas Chou
2019-07-01 13:20 ` Tom Rini
2019-07-04  2:11   ` Thomas Chou
2019-04-28 21:45 Adam Ford
2019-04-10 14:35 [U-Boot] [PATCH v2] imx: Extend PCL063 support for phyCORE-i.MX6ULL SOM Parthiban Nallathambi
2019-04-26  8:02 ` Parthiban Nallathambi
2019-04-26  8:27   ` [U-Boot] (no subject) Stefano Babic
2019-01-19  9:37 Angelo Dureghello
2018-11-22 20:08 sjg at google.com
2018-09-20 21:07 Angelo Dureghello
2018-09-18 21:49 Jeremy Gebben
2017-05-15  9:49 [U-Boot] [PATCH v2 0/7] Add basic support for Rockchip RK3368 SOC Andy Yan
2017-05-15  9:53 ` [U-Boot] (no subject) Andy Yan
2017-04-21  3:01 Zhikang Zhang
2016-11-25 18:16 Rick Bronson
2016-07-13 14:11 [U-Boot] [PATCH] arm: imx: Add support for Advantech DMS-BA16 board Akshay Bhat
2016-07-20 16:25 ` [U-Boot] (no subject) Stefano Babic
2016-07-12 17:16 Joe Hershberger
2016-07-12 17:16 Joe Hershberger
2016-07-12 17:16 Joe Hershberger
2016-07-12 17:16 Joe Hershberger
2016-07-12 17:16 Joe Hershberger
2016-06-17 10:00 [U-Boot] [RFC] omap3: single binary supporting all flash types Ladislav Michl
2016-06-17 10:07 ` [U-Boot] (no subject) Ladislav Michl
2016-06-17 10:09 ` Ladislav Michl
2016-02-03 12:42 Peter Robinson
2016-01-20 12:25 Wenbin Song
2015-12-09  7:15 Peter Robinson
2015-11-17 12:16 wd at denx.de
2015-07-10 13:16 Samuel Egli
2014-09-12 14:45 Mariusz Boguszewski
2014-09-12 20:00 ` Michael Trimarchi
2014-09-15  8:08   ` Michael Trimarchi
2014-06-03  0:04 rajshekar_py at yahoo.com
2014-02-11 19:20 John de la Garza
     [not found] <CAP8r_=BJdRNRisEgmFmPcGbyOtpta69DtveY6iFgOqdocDy+zg@mail.gmail.com>
     [not found] ` <528D649C.1030701@boundarydevices.com>
2013-11-21  8:09   ` Bojan Buić
2013-11-21  8:34     ` Stefano Babic
2013-11-21  9:23       ` Bojan Buić
2013-11-21 14:01       ` Bojan Buić
2013-11-21 14:40         ` Stefano Babic
2013-11-21 15:08           ` Bojan Buić
2013-11-21 15:20             ` Bojan Buić
2013-11-22  7:04               ` Wolfgang Denk
     [not found] <A3D1B805C7AF9343B5A0FF6EBB7E3D34915FBE@039-SN2MPN1-023.039d.mgd.msft.net>
2013-02-08 11:44 ` Marek Vasut
2012-09-19  0:02 Troy Kisky
2012-07-19 17:38 Gigin Jose
2012-06-22 20:08 apple pie
2012-06-21  1:37 Pascal Levesque
2012-06-03  9:27 Stijn Souffriau
     [not found] <http://lists.denx.de/pipermail/u-boot/2012-March/120899.html>
2012-03-25 23:00 ` Eric Nelson
2012-03-06 21:29 Wolfgang Denk
2012-03-06 22:02 ` Mike Frysinger
2012-03-07 11:25   ` Wolfgang Denk
2012-03-08  6:37     ` Simon Glass
2012-03-08  8:16       ` Wolfgang Denk
2012-03-09 13:59         ` Simon Glass
2012-03-09  3:28       ` Mike Frysinger
2012-03-09  3:29     ` Mike Frysinger
2012-02-16  2:59 [U-Boot] [PATCH 1/5] msm7x30: Add support for low speed uart on msm7x30 mohamed.haneef at lntinfotech.com
2012-04-23  9:24 ` [U-Boot] (no subject) mohamed.haneef at lntinfotech.com
2011-12-25 15:17 larrybizz at aol.com
2011-12-17 14:22 larrybizz at aol.com
2011-11-28  0:53 Sgt.Williams Moore.
2011-11-25 20:57 ALANTIC LOANS HAPPY OFFER
2011-11-25 14:59 UK End of Year Award Notice!
2011-11-25  8:48 Gift Ismaila
2011-11-25  3:41 EQUITY LOAN FINANCE
2011-11-20 13:27 Mrs Veronica James
2011-11-17  6:20 Kenoye Eke
2011-11-17  5:32 Western Union Office
2011-11-15  0:23 Western Union Office
2011-11-14  9:02 Nokia XMAS Bonanza
2011-11-13  4:50 Uk Lottery
2011-11-09  7:08 FeDEX Logistics
2011-11-07  9:44 COCA-COLA COMPANY
2011-11-04 16:07 Loan2Day
2011-11-02 18:35 jobhunts02 at aol.com
2011-10-31 21:21 Tahani Kalender
2011-10-31 14:34 vmujica at uc.edu.ve
2011-10-31  9:21 Bar Yasser
2011-10-30 11:37 Henry, Sherie
2011-10-29  5:49 MAY BANK INTERNATIONAL PLS
2011-10-23 23:12 E-Loan & Credit Home
2011-10-20  8:23 CHEVRON OIL & GAS ANNUAL EMAIL NOTIFICATIONS
2011-10-16 22:36 Tom Kaplan
2011-10-16 12:04 jobhunts02 at aol.com
2011-10-14 13:06 COCA-COLA COMPANY PROMOTION
2011-10-09  8:06 victor casunuran
2011-10-10 14:39 ` Detlev Zundel
2011-10-07 20:48 Mr. Wen Lee
2011-10-07 20:42 Mr. Wen Lee
2011-10-05 21:54 Mr.Abdulrahman Ibrahim
2011-10-05 20:49 Mr.Wen Lee
2011-10-04 22:11 jobhunts02 at aol.com
2011-09-29  1:54 Mr. Abdulrahman Ibrahim
2011-09-20  4:40 IRISH LOTTERY
2011-09-13 21:52 Mr. Song Lile Transfer Offer 2011
2011-09-12 22:45 Mr.Wen Lee
2011-09-12  2:10 Elo Petteri
2011-09-10 20:08 UK INTERNATIONAL LOTTERY
2011-09-09 22:29 Wen Lee
2011-09-08 21:48 Coca-Cola Great Britain
     [not found] <[PATCH 5/5] coldfire: Remove board with major build issues>
2011-08-31 11:33 ` Stany MARCEL
     [not found] <[PATCH 4/5] coldfire: Remove link files entries to prevent multiple definitions>
2011-08-31 11:32 ` Stany MARCEL
2011-08-31 11:55   ` Marek Vasut
     [not found] <[PATCH 3/5] coldfire: Permit build in a different directory>
2011-08-31 11:31 ` Stany MARCEL
     [not found] <[PATCH 2/5] coldfire: Add creation of include directories for _config rules>
2011-08-31 11:30 ` Stany MARCEL
     [not found] <[PATCH 1/5] coldfire: Change timer_init return type from void to int>
2011-08-31 11:28 ` Stany MARCEL
2011-08-31 11:55   ` Stany MARCEL
2011-08-31 12:11   ` Wolfgang Denk
2011-08-30 12:49 [U-Boot] [PATCH V2] console: Implement pre-console buffer Graeme Russ
2011-08-31 12:35 ` [U-Boot] (no subject) Graeme Russ
2011-08-31 12:38   ` Graeme Russ
2011-08-27 16:54 Ronny D
2011-08-26  0:07 Ronny D
2011-08-21  5:05 Ronny D
2011-08-21  0:39 Exxon Promo
2011-08-14  3:02 shawn Bai
2011-08-13 14:48 favour good
2011-08-13  7:18 UK INTERNATIONAL LOTTERY PRIZE AWARD DEPT
2011-08-12 14:29 Ronny D
2011-08-06 19:33 Bar Yasser
2011-08-04 18:53 Thomas Petazzoni
2011-07-29  3:52 SEUMAS MCCOMBE
2011-07-25 17:20 Western Union®
2011-07-19 19:52 SURESH FINANCE
2011-07-07 21:17 SEUMAS MCCOMBE
2011-07-06  7:55 Art of England Magazine
2011-07-03 20:37 Mr Cohen Emerson
2011-07-01  2:36 THE COCA COLA COMPANY
2011-06-30 10:55 kifkifads at yahoo.fr
2011-06-26  4:47 Mr. Allan Davis
2011-06-21  3:47 Ronny D
2011-06-17  0:16 FROM JORDAN GLOBAL LOANCORPORATION
2011-06-16  9:13 MRS STITI MONA
2011-06-03 14:19 Microsoft Inc
2011-06-03 12:53 Mr Wen Lee
2011-06-03 12:51 Mr Wen Lee
2011-05-26  8:02 Yuping Luo
2011-05-24 22:29 Mr. Mark Seumas
2011-05-24 15:48 buffetcampinas at sercomtel.com.br
2011-05-17  3:01 jobhunts02 at aol.com
2011-05-15 23:28 jobhunts02 at aol.com
2011-04-30  1:09 Western Union
2011-04-25  6:53 E-Mail Admin
2011-04-22  8:32 manohar kallutla
2011-04-21 15:11 terri nechwa
2011-04-20 18:05 jeffhemstreet at yahoo.com
2011-04-20 15:32 Norton Financial Loan Company Inc
2011-04-19 21:56 jeffhemstreet at yahoo.com
2011-04-16 21:44 jeffhemstreet at yahoo.com
2011-04-07 15:32 MONDAY LOTTERY BOARD
2011-04-07 14:23 MONDAY LOTTERY BOARD
2011-04-01 12:25 DARY HARTSON
2011-03-31 20:43 E-Mail Admin
2011-03-25 13:03 Robert Pasquantonio
2011-03-24  8:37 Erik Hansen
2011-03-23  7:34 ystradgynlais.sports.centre at powys.gov.uk
2011-03-22 15:55 Norton Financial Loan Company Inc
2011-03-21 12:39 ystradgynlais.sports.centre at powys.gov.uk
2011-03-19 22:09 EURO MILLION 2011
2011-03-19 17:47 xzxcv6 at cox.net
2011-03-13 11:07 Luz Nury Fajardo Ortiz
2011-03-05  1:32 L'ALTRA DIMENSIONE
2011-02-15  9:34 [U-Boot] [PATCH] [RFC] SF: Add "sf erase offset +len" command handler Mike Frysinger
2011-02-16 20:27 ` [U-Boot] (no subject) Richard Retanubun
2011-02-17  5:46   ` Mike Frysinger
2011-01-18  4:45 Kumar Gala
2011-01-13  8:36 MrGates
2011-01-13 11:25 ` Albert ARIBAUD
2010-11-28 20:14 Wolfgang Denk
2010-12-01  6:38 ` Minkyu Kang
2010-11-28 19:43 Wolfgang Denk
2010-11-17  9:00 Jinson Wang
2010-11-16  9:29 Money Gram Transfer
2010-10-15  9:34 WESTERN UNION TRANSFER
2010-10-10  8:35 Wolfgang Denk
2010-10-11  7:49 ` Stefan Roese
2010-10-11 13:19   ` Stefan Roese
2010-10-11 13:26     ` Wolfgang Denk
2010-10-06 20:55 [U-Boot] [PATCH] board_init_r: Removed unused cmdtp variable Wolfgang Denk
2010-10-19 14:29 ` [U-Boot] (no subject) Richard Retanubun
2010-10-04 21:35 Mrs.Turner Clarissa Ann
2010-06-19 23:48 Wolfgang Denk
2010-06-02 22:09 [U-Boot] (No subject) Mr Michael Smith
2010-06-02 22:09 Mr Michael Smith
2010-06-02  5:24 [U-Boot] (no subject) SuperStore Armenia
2010-05-24 10:59 David
2010-05-24 10:50 David
2010-05-12 23:25 Important Notice
2010-05-03 15:45 Irish Online Claim
2010-04-23  3:56 BARCLAYS BANK UK
2010-04-03  4:36 Irish Online Promo
2010-02-23 18:08 Eloan Finance International Loans
2010-02-16  0:12 The uknl
2010-02-15 13:13 SHELL INTERNATIONAL LOTTERY
2010-02-06 13:14 Global Springer Link Finance
2010-02-06 11:47 Global Springer Link Finance
2010-01-27 11:21 Lancaster Terrace
2009-12-09  4:42 星杨
2009-11-10  5:03 Helen Mathew
2009-10-28  5:51 HeLei
2009-09-15  8:38 Konrad Mattheis
2009-08-21  8:55 HONDA AWARD 2009
2009-06-29  7:18 Krishna, Mahith
2009-06-29  7:47 ` Nishanth Menon
2009-06-04 10:27 Daniel Mack
2009-05-30  3:59 UKL-DEPT
2009-05-25 13:57 xiaojing mao
2009-05-25 18:12 ` Wolfgang Denk
2009-05-02 18:23 JMC INVESTMENT
2009-04-24  6:55 John Tobias
2009-04-03 22:37 Neeraj Tandon
2009-04-01  2:44 卫 王
2009-02-26 10:24 POLETTE Simon
2009-02-26 11:36 ` Wolfgang Denk
2009-02-19 13:30 md ks
2009-02-19 13:42 ` Nishanth Menon
2009-02-24  6:24   ` md ks
2009-02-19 13:48 ` Wolfgang Denk
2009-02-03  7:58 abby.zhang at semgfab.cn
2008-12-16 21:42 Cote, Sylvain
2008-10-03 16:34 Haiying Wang
2008-10-03 16:33 Haiying Wang
2008-10-03 16:33 Haiying Wang
2008-10-03 16:33 Haiying Wang
2008-10-03 16:32 Haiying Wang
2008-10-03 23:35 ` Wolfgang Denk
2008-10-04  2:39   ` Haiying Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1223051538-22445-1-git-send-email-Haiying.Wang@freescale.com \
    --to=haiying.wang@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.