Skip to content

Commit f105963

Browse files
masahir0ygregkh
authored andcommitted
mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally
commit 3f6e698 upstream. Since commit 1bb8866 ("mtd: nand: denali: handle timing parameters by setup_data_interface()"), denali_dt.c gets the clock rate from the clock driver. The driver expects the frequency of the bus interface clock, whereas the clock driver of SOCFPGA provides the core clock. Thus, the setup_data_interface() hook calculates timing parameters based on a wrong frequency. To make it work without relying on the clock driver, hard-code the clock frequency, 200MHz. This is fine for existing DT of UniPhier, and also fixes the issue of SOCFPGA because both platforms use 200 MHz for the bus interface clock. Fixes: 1bb8866 ("mtd: nand: denali: handle timing parameters by setup_data_interface()") Cc: linux-stable <[email protected]> #4.14+ Reported-by: Philipp Rosenberger <[email protected]> Suggested-by: Boris Brezillon <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Richard Weinberger <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c4bfed8 commit f105963

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/mtd/nand/denali_dt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ static int denali_dt_probe(struct platform_device *pdev)
122122
if (ret)
123123
return ret;
124124

125-
denali->clk_x_rate = clk_get_rate(dt->clk);
125+
/*
126+
* Hardcode the clock rate for the backward compatibility.
127+
* This works for both SOCFPGA and UniPhier.
128+
*/
129+
denali->clk_x_rate = 200000000;
126130

127131
ret = denali_init(denali);
128132
if (ret)

0 commit comments

Comments
 (0)