Hi On Mon, Feb 17, 2020 at 5:33 PM Masahiro Yamada wrote: > > Hi, > > > > On Thu, Feb 13, 2020 at 2:45 AM Marek Vasut wrote: > > > > On 2/12/20 5:56 PM, Masahiro Yamada wrote: > > > Hi. > > > > Hi, > > > > [...] > > > > >>>>>>>>>>> On SoCFPGA, denali->clk_rate = 31.25 MHz and denali->clk_x_rate = 125 MHz, > > >>>>>>>>>>> hence the driver sets NAND_KEEP_TIMINGS flag. > > >>> > > >>> > > >>> Interesting. > > >>> I have never seen such clock rates before. > > >>> > > >>> > > >>> For all known upstream platforms > > >>> (Altera SOCFPGA, Socionext UniPhier, Intel MRST), > > >>> the NAND controller core clock is 50 MHz, > > >>> the NAND bus clock is 200MHz. > > >> > > >> You can configure whatever rate you want in the QSys HPS component. > > > > > > OK. > > > > > > The SOCFPGA maintainer, Dinh Nguyen, said this: > > > "From the clock controller, it provides a single 200MHz clock to the NAND > > > IP. Inside the NAND IP, there is a /4 for the clk. The 200MHz clock is > > > used for the clk_x and ecc_clk." > > > > That sounds like some root clock. You can read the entire documentation > > for the SoCFPGA CV/AV here: > > http://www.altera.com/literature/hb/cyclone-v/cv_5v4.pdf > > See section 3 , look for 'nand' there. Note that NAND can be supplied > > from at least two different PLLs -- main and peripheral. > > > > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-July/592702.html > > > > > > > > > > > > Maybe, you are using a brand-new, > > > different type of SOCFPGA? > > > > Cyclone V and Arria V , so no. > > > > >>> What would happen if you hard-code: > > >>> denali->clk_rate = 50000000; > > >>> denali->clk_x_rate = 200000000; > > >> > > >> It will not work, because the IP would be using incorrect clock. > > > > > > I wanted to see the past tense here instead of > > > future tense + subjunctive mood. > > > > > > I wanted you to try it. > > > > > > > > > > > >> > > >>> like I had already suggested to Tim Sander: > > >>> https://lore.kernel.org/lkml/CAK7LNAQOCoJC0RzOhTEofHdR+zU5sQTxV-t4nERBExW1ddW5hw@mail.gmail.com/ > > >>> > > >>> Unfortunately, he did not want to do it, but > > >>> I am still interested in this experiment because > > >>> I suspect this might be a bug of drivers/clk/socfpga/. > > >> > > >> No, this is a feature of the platform, you can configure any clock you > > >> want pretty much. > > > > > > > > > OK, but if you agree the 4.19.10 is working, > > > > > > denali->clk_rate = 50000000; denali->clk_x_rate = 200000000; > > > > > > is worth trying. > > > > Why would misconfiguring the IP be worth trying ? > > > > There is no change around the ->setup_data_interface() hook > after v4.19 > The only difference I could think of is the clock frequency. > > But, it is OK if you do not want to test it. > > And you are confident. > > So, let's suspect the ->setup_data_interface() hook. > > > If possible, can you provide the dump of > the attached debug code? > I attached two experimental patches. I cannot test them because the mainline code works fine for my boards. Does either of them improve something on your settings? -- Best Regards Masahiro Yamada