ddr: fix wrong bandwidth result on g12 platform
authortao zeng <tao.zeng@amlogic.com>
Thu, 26 Apr 2018 03:14:25 +0000 (11:14 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Wed, 9 May 2018 06:38:14 +0000 (23:38 -0700)
PD#161475: ddr: fix wrong bandwidth result on g12 platform

Correct function name get_ddr_freq to get_dmc_freq in order
to avoid misunderstanding.

Change-Id: I9000970f100394cf63468149d431d05ece2aaa1d
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
drivers/amlogic/ddr_tool/ddr_band_op_g12.c
drivers/amlogic/ddr_tool/ddr_band_op_gx.c
drivers/amlogic/ddr_tool/ddr_band_op_gxl.c

index 1fb0000..b791ec5 100644 (file)
@@ -60,7 +60,7 @@ static void g12_dmc_port_config(struct ddr_bandwidth *db, int channel, int port)
        }
 }
 
-static unsigned long g12_get_ddr_freq_quick(struct ddr_bandwidth *db)
+static unsigned long g12_get_dmc_freq_quick(struct ddr_bandwidth *db)
 {
        unsigned int val;
        unsigned int n, m, od1;
@@ -98,7 +98,7 @@ static unsigned long g12_get_ddr_freq_quick(struct ddr_bandwidth *db)
        n = ((val >> 10) & 0x1f);
        od1 = (((val >> 19) & 0x1)) == 1 ? 2 : 1;
        if (n)
-               freq = 2 * (((DEFAULT_XTAL_FREQ * m) / n) >> od1) / od_div;
+               freq = (((DEFAULT_XTAL_FREQ * m) / n) >> od1) / od_div;
 
        return freq;
 }
@@ -185,7 +185,7 @@ static int g12_dump_reg(struct ddr_bandwidth *db, char *buf)
 struct ddr_bandwidth_ops g12_ddr_bw_ops = {
        .init             = g12_dmc_bandwidth_init,
        .config_port      = g12_dmc_port_config,
-       .get_freq         = g12_get_ddr_freq_quick,
+       .get_freq         = g12_get_dmc_freq_quick,
        .handle_irq       = g12_handle_irq,
        .bandwidth_enable = g12_dmc_bandwidth_enable,
 #if DDR_BANDWIDTH_DEBUG
index 1f206cc..69dbc4e 100644 (file)
@@ -55,7 +55,7 @@ static void gx_dmc_port_config(struct ddr_bandwidth *db, int channel, int port)
 }
 
 
-static unsigned long gx_get_ddr_freq_quick(struct ddr_bandwidth *db)
+static unsigned long gx_get_dmc_freq_quick(struct ddr_bandwidth *db)
 {
        unsigned int val;
        unsigned int od, n, m, od1;
@@ -137,7 +137,7 @@ static int gx_dump_reg(struct ddr_bandwidth *db, char *buf)
 struct ddr_bandwidth_ops gx_ddr_bw_ops = {
        .init             = gx_dmc_bandwidth_init,
        .config_port      = gx_dmc_port_config,
-       .get_freq         = gx_get_ddr_freq_quick,
+       .get_freq         = gx_get_dmc_freq_quick,
        .handle_irq       = gx_handle_irq,
        .bandwidth_enable = gx_dmc_bandwidth_enable,
 #if DDR_BANDWIDTH_DEBUG
index 01dea7c..52ee4c2 100644 (file)
@@ -52,7 +52,7 @@ static void gxl_dmc_port_config(struct ddr_bandwidth *db, int channel, int port)
        writel(val, db->ddr_reg + port_reg[channel]);
 }
 
-static unsigned long gxl_get_ddr_freq_quick(struct ddr_bandwidth *db)
+static unsigned long gxl_get_dmc_freq_quick(struct ddr_bandwidth *db)
 {
        unsigned int val;
        unsigned int od, n, m, od1;
@@ -155,7 +155,7 @@ static int gxl_dump_reg(struct ddr_bandwidth *db, char *buf)
 struct ddr_bandwidth_ops gxl_ddr_bw_ops = {
        .init             = gxl_dmc_bandwidth_init,
        .config_port      = gxl_dmc_port_config,
-       .get_freq         = gxl_get_ddr_freq_quick,
+       .get_freq         = gxl_get_dmc_freq_quick,
        .handle_irq       = gxl_handle_irq,
        .bandwidth_enable = gxl_dmc_bandwidth_enable,
 #if DDR_BANDWIDTH_DEBUG