]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx: imx8mq: add init_nand_clk
authorPeng Fan <peng.fan@nxp.com>
Wed, 16 Oct 2019 10:24:22 +0000 (10:24 +0000)
committerStefano Babic <sbabic@denx.de>
Sun, 3 Nov 2019 16:04:16 +0000 (17:04 +0100)
Add init_nand_clk to enable gpmi nand clock. Since i.MX8MQ not use CCF,
so we still use legacy mode to configure the clock.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/include/asm/arch-imx8m/clock_imx8mq.h
arch/arm/mach-imx/imx8m/clock_imx8mq.c

index 9fa9eb26877717f55d823f84aec1b65be70e88d9..38a6f5966b684d60adf5ea9bb55a99b8ae66e473 100644 (file)
@@ -421,4 +421,6 @@ enum frac_pll_out_val {
        FRAC_PLL_OUT_1000M,
        FRAC_PLL_OUT_1600M,
 };
+
+void init_nand_clk(void);
 #endif
index 04903510f07e0d5e7e903ab741c1362f7c001c49..2db5bde2116d7eb383134b69dccd390d2546f528 100644 (file)
@@ -393,6 +393,15 @@ void init_usb_clk(void)
        }
 }
 
+void init_nand_clk(void)
+{
+       clock_enable(CCGR_RAWNAND, 0);
+       clock_set_target_val(NAND_CLK_ROOT,
+                            CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(3) |
+                            CLK_ROOT_POST_DIV(CLK_ROOT_POST_DIV4));
+       clock_enable(CCGR_RAWNAND, 1);
+}
+
 void init_uart_clk(u32 index)
 {
        /* Set uart clock root 25M OSC */