Re: [U-Boot] [PATCH 1/2] powerpc/8xxx: Replace fsl_ddr_get_mem_data_rate with get_ddr_freq()

2011-02-09 Thread Kumar Gala

On Jan 31, 2011, at 10:54 PM, Kumar Gala wrote:

 Every 85xx board implements fsl_ddr_get_mem_data_rate via get_ddr_freq()
 and every 86xx board uses get_bus_freq().  If implement get_ddr_freq()
 as a static inline to call get_bus_freq() we can remove
 fsl_ddr_get_mem_data_rate altogether and just call get_ddr_freq()
 directly.
 
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 arch/powerpc/cpu/mpc8xxx/ddr/util.c |6 ++
 board/freescale/corenet_ds/ddr.c|5 -
 board/freescale/mpc8536ds/ddr.c |5 -
 board/freescale/mpc8540ads/ddr.c|8 
 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|8 
 board/freescale/mpc8568mds/ddr.c|6 --
 board/freescale/mpc8569mds/ddr.c|6 --
 board/freescale/mpc8572ds/ddr.c |5 -
 board/freescale/mpc8610hpcd/ddr.c   |5 -
 board/freescale/mpc8641hpcn/ddr.c   |7 +--
 board/freescale/p1022ds/ddr.c   |5 -
 board/freescale/p2020ds/ddr.c   |5 -
 board/sbc8548/ddr.c |5 -
 board/sbc8560/ddr.c |8 
 board/sbc8641d/ddr.c|5 -
 board/socrates/ddr.c|5 -
 board/stx/stxgp3/ddr.c  |8 
 board/stx/stxssa/ddr.c  |8 
 board/xes/xpedite517x/ddr.c |7 +--
 board/xes/xpedite520x/ddr.c |5 -
 board/xes/xpedite537x/ddr.c |5 -
 board/xes/xpedite550x/ddr.c |5 -
 include/common.h|4 
 27 files changed, 8 insertions(+), 148 deletions(-)

applied to 85xx next

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] powerpc/8xxx: Replace fsl_ddr_get_mem_data_rate with get_ddr_freq()

2011-01-31 Thread Kumar Gala
Every 85xx board implements fsl_ddr_get_mem_data_rate via get_ddr_freq()
and every 86xx board uses get_bus_freq().  If implement get_ddr_freq()
as a static inline to call get_bus_freq() we can remove
fsl_ddr_get_mem_data_rate altogether and just call get_ddr_freq()
directly.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 arch/powerpc/cpu/mpc8xxx/ddr/util.c |6 ++
 board/freescale/corenet_ds/ddr.c|5 -
 board/freescale/mpc8536ds/ddr.c |5 -
 board/freescale/mpc8540ads/ddr.c|8 
 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|8 
 board/freescale/mpc8568mds/ddr.c|6 --
 board/freescale/mpc8569mds/ddr.c|6 --
 board/freescale/mpc8572ds/ddr.c |5 -
 board/freescale/mpc8610hpcd/ddr.c   |5 -
 board/freescale/mpc8641hpcn/ddr.c   |7 +--
 board/freescale/p1022ds/ddr.c   |5 -
 board/freescale/p2020ds/ddr.c   |5 -
 board/sbc8548/ddr.c |5 -
 board/sbc8560/ddr.c |8 
 board/sbc8641d/ddr.c|5 -
 board/socrates/ddr.c|5 -
 board/stx/stxgp3/ddr.c  |8 
 board/stx/stxssa/ddr.c  |8 
 board/xes/xpedite517x/ddr.c |7 +--
 board/xes/xpedite520x/ddr.c |5 -
 board/xes/xpedite537x/ddr.c |5 -
 board/xes/xpedite550x/ddr.c |5 -
 include/common.h|4 
 27 files changed, 8 insertions(+), 148 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/util.c 
b/arch/powerpc/cpu/mpc8xxx/ddr/util.c
index 1e2d921..815c5e3 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/util.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/util.c
@@ -11,8 +11,6 @@
 
 #include ddr.h
 
-unsigned int fsl_ddr_get_mem_data_rate(void);
-
 /*
  * Round mclk_ps to nearest 10 ps in memory controller code.
  *
@@ -24,7 +22,7 @@ unsigned int get_memory_clk_period_ps(void)
 {
unsigned int mclk_ps;
 
-   mclk_ps = 2ULL / fsl_ddr_get_mem_data_rate();
+   mclk_ps = 2ULL / get_ddr_freq(0);
/* round to nearest 10 ps */
return 10 * ((mclk_ps + 5) / 10);
 }
@@ -40,7 +38,7 @@ unsigned int picos_to_mclk(unsigned int picos)
if (!picos)
return 0;
 
-   clks = fsl_ddr_get_mem_data_rate() * (unsigned long long) picos;
+   clks = get_ddr_freq(0) * (unsigned long long) picos;
clks_temp = clks;
clks = clks / ULL_2e12;
if (clks_temp % ULL_2e12) {
diff --git a/board/freescale/corenet_ds/ddr.c b/board/freescale/corenet_ds/ddr.c
index fb53946..252c738 100644
--- a/board/freescale/corenet_ds/ddr.c
+++ b/board/freescale/corenet_ds/ddr.c
@@ -118,11 +118,6 @@ static void get_spd(ddr3_spd_eeprom_t *spd, unsigned char 
i2c_address)
}
 }
 
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-   return get_ddr_freq(0);
-}
-
 void fsl_ddr_get_spd(ddr3_spd_eeprom_t *ctrl_dimms_spd,
  unsigned int ctrl_num)
 {
diff --git a/board/freescale/mpc8536ds/ddr.c b/board/freescale/mpc8536ds/ddr.c
index 2bad787..565e213 100644
--- a/board/freescale/mpc8536ds/ddr.c
+++ b/board/freescale/mpc8536ds/ddr.c
@@ -17,11 +17,6 @@ static void get_spd(ddr2_spd_eeprom_t *spd, unsigned char 
i2c_address)
i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr2_spd_eeprom_t));
 }
 
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-   return get_ddr_freq(0);
-}
-
 void fsl_ddr_get_spd(ddr2_spd_eeprom_t *ctrl_dimms_spd,
  unsigned int ctrl_num)
 {
diff --git a/board/freescale/mpc8540ads/ddr.c b/board/freescale/mpc8540ads/ddr.c
index 93d1100..64a3ee1 100644
--- a/board/freescale/mpc8540ads/ddr.c
+++ b/board/freescale/mpc8540ads/ddr.c
@@ -18,14 +18,6 @@ get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
 }
 
-
-unsigned int
-fsl_ddr_get_mem_data_rate(void)
-{
-   return get_ddr_freq(0);
-}
-
-
 void
 fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
  unsigned int ctrl_num)
diff --git a/board/freescale/mpc8541cds/ddr.c b/board/freescale/mpc8541cds/ddr.c
index c84a6cb..ce08af1 100644
--- a/board/freescale/mpc8541cds/ddr.c
+++ b/board/freescale/mpc8541cds/ddr.c
@@ -18,11 +18,6 @@ get_spd(ddr1_spd_eeprom_t *spd, unsigned char i2c_address)
i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr1_spd_eeprom_t));
 }
 
-unsigned int fsl_ddr_get_mem_data_rate(void)
-{
-   return get_ddr_freq(0);
-}
-
 void fsl_ddr_get_spd(ddr1_spd_eeprom_t *ctrl_dimms_spd,
  unsigned int ctrl_num)
 {
diff --git a/board/freescale/mpc8544ds/ddr.c b/board/freescale/mpc8544ds/ddr.c
index b8330eb..87f0a22 100644
---