clock_imx8mq: Added 66 MHz support for QSPI
Subsystems (3)
PATCH 1/1 clock_imx8mq: Added 66 MHz support for QSPI
At the current clock setting, the maximum clock for QSPI is 25 MHz. In my case I use M-RAM which supports up to 100 MHz for QSPI, and with this change the QSPI can be clocked up to 66 MHz.
--- arch/arm/mach-imx/imx8m/clock_imx8mq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-imx/imx8m/clock_imx8mq.c +2 -2
@@ -473,11 +473,11 @@ int set_clk_qspi(void) {/* * set qspi root -* sys pll1 100M +* sys pll1 266M */ clock_enable (CCGR_QSPI ,0 );clock_set_target_val (QSPI_CLK_ROOT ,CLK_ROOT_ON | -CLK_ROOT_SOURCE_SEL (7 )); +CLK_ROOT_SOURCE_SEL (5 ));clock_enable (CCGR_QSPI ,1 );return 0 ;
Signature · 1 line
2.17.1
Fabio Estevam
reviewerHi Kwon,
Quoted 15 lines · Kwon Tae-young
At the current clock setting, the maximum clock for QSPI is 25 MHz. In my case I use M-RAM which supports up to 100 MHz for QSPI, and with this change the QSPI can be clocked up to 66 MHz.
Signed-off-by Kwon Tae-young <[email protected]>--- arch/arm/mach-imx/imx8m/clock_imx8mq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-imx/imx8m/clock_imx8mq.c +0
-0
arch/arm/mach-imx/imx8m/clock_imx8mq.c int set_clk_qspi(void) · line 480
Quoted 10 lines
arch/arm/mach-imx/imx8m/clock_imx8mq.c +2
-2@@ -473,11 +473,11 @@ int set_clk_qspi(void) {/* * set qspi root -* sys pll1 100M +* sys pll1 266M */ clock_enable (CCGR_QSPI ,0 );clock_set_target_val (QSPI_CLK_ROOT ,CLK_ROOT_ON | -CLK_ROOT_SOURCE_SEL (7 )); +CLK_ROOT_SOURCE_SEL (5 ));
It seems there is 'divide-by 4' being set somewhere.
What if you use CLK_ROOT_SOURCE_SEL(1) instead?
This selects SYS_PLL1_400MHz as the QSPI parent clock and should give you the 100MHz QSPI clock
that you need.
Quoted 31 lines
Hi Kwon,
Quoted 16 lines · Kwon Tae-young
At the current clock setting, the maximum clock for QSPI is 25 MHz. In my case I use M-RAM which supports up to 100 MHz for QSPI, and with this change the QSPI can be clocked up to 66 MHz.
Signed-off-by Kwon Tae-young <[email protected]>--- arch/arm/mach-imx/imx8m/clock_imx8mq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-imx/imx8m/clock_imx8mq.c +0
-0arch/arm/mach-imx/imx8m/clock_imx8mq.c int set_clk_qspi(void) { · line 479
Quoted 9 lines
arch/arm/mach-imx/imx8m/clock_imx8mq.c +2
-2@@ -473,11 +473,11 @@ int set_clk_qspi(void) {/* * set qspi root -* sys pll1 100M +* sys pll1 266M */ clock_enable (CCGR_QSPI ,0 );clock_set_target_val (QSPI_CLK_ROOT ,CLK_ROOT_ON | -CLK_ROOT_SOURCE_SEL (7 )); +CLK_ROOT_SOURCE_SEL (5 ));It seems there is 'divide-by 4' being set somewhere.
Quoted 3 lines
What if you use
CLK_ROOT_SOURCE_SEL(1)instead?This selects
SYS_PLL1_400MHzas the QSPI parent clock and should give you the 100MHz QSPI clock that you need.
The clocks I tested are as follows.CLK_ROOT_SOURCE_SEL(0): 6.25 MhzCLK_ROOT_SOURCE_SEL(1): 100 MhzCLK_ROOT_SOURCE_SEL(2): 100 MhzCLK_ROOT_SOURCE_SEL(3): 125 MhzCLK_ROOT_SOURCE_SEL(4): 90.36 MhzCLK_ROOT_SOURCE_SEL(5): 66.69 MhzCLK_ROOT_SOURCE_SEL(6): 6.25 MhzCLK_ROOT_SOURCE_SEL(7): 25 Mhz
However, my board only passed the load test up to 66MHz. Should I change it to CLK_ROOT_SOURCE_SEL(1) and submit the patch?
Fabio Estevam
reviewerQuoted 10 lines · 권태영
The clocks I tested are as follows.
CLK_ROOT_SOURCE_SEL(0): 6.25 MhzCLK_ROOT_SOURCE_SEL(1): 100 MhzCLK_ROOT_SOURCE_SEL(2): 100 MhzCLK_ROOT_SOURCE_SEL(3): 125 MhzCLK_ROOT_SOURCE_SEL(4): 90.36 MhzCLK_ROOT_SOURCE_SEL(5): 66.69 MhzCLK_ROOT_SOURCE_SEL(6): 6.25 MhzCLK_ROOT_SOURCE_SEL(7): 25 Mhz
Quoted 2 lines
However, my board only passed the load test up to 66MHz. Should I change it to
CLK_ROOT_SOURCE_SEL(1)and submit the patch?
Ok, thanks for confirming.
Your original patch looks good.