From: tao zeng Date: Thu, 26 Apr 2018 03:14:25 +0000 (+0800) Subject: ddr: fix wrong bandwidth result on g12 platform X-Git-Tag: khadas-vims-v0.9.6-release~2088 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c2c8fb684c49ad41da035949940feb66203e48b;p=platform%2Fkernel%2Flinux-amlogic.git ddr: fix wrong bandwidth result on g12 platform 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 --- diff --git a/drivers/amlogic/ddr_tool/ddr_band_op_g12.c b/drivers/amlogic/ddr_tool/ddr_band_op_g12.c index 1fb00001..b791ec5 100644 --- a/drivers/amlogic/ddr_tool/ddr_band_op_g12.c +++ b/drivers/amlogic/ddr_tool/ddr_band_op_g12.c @@ -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 diff --git a/drivers/amlogic/ddr_tool/ddr_band_op_gx.c b/drivers/amlogic/ddr_tool/ddr_band_op_gx.c index 1f206cc..69dbc4e 100644 --- a/drivers/amlogic/ddr_tool/ddr_band_op_gx.c +++ b/drivers/amlogic/ddr_tool/ddr_band_op_gx.c @@ -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 diff --git a/drivers/amlogic/ddr_tool/ddr_band_op_gxl.c b/drivers/amlogic/ddr_tool/ddr_band_op_gxl.c index 01dea7c..52ee4c2 100644 --- a/drivers/amlogic/ddr_tool/ddr_band_op_gxl.c +++ b/drivers/amlogic/ddr_tool/ddr_band_op_gxl.c @@ -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