18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+ 28c2ecf20Sopenharmony_ci// 38c2ecf20Sopenharmony_ci// OWL S900 SoC clock driver 48c2ecf20Sopenharmony_ci// 58c2ecf20Sopenharmony_ci// Copyright (c) 2014 Actions Semi Inc. 68c2ecf20Sopenharmony_ci// Author: David Liu <liuwei@actions-semi.com> 78c2ecf20Sopenharmony_ci// 88c2ecf20Sopenharmony_ci// Copyright (c) 2018 Linaro Ltd. 98c2ecf20Sopenharmony_ci// Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include <linux/clk-provider.h> 128c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include "owl-common.h" 158c2ecf20Sopenharmony_ci#include "owl-composite.h" 168c2ecf20Sopenharmony_ci#include "owl-divider.h" 178c2ecf20Sopenharmony_ci#include "owl-factor.h" 188c2ecf20Sopenharmony_ci#include "owl-fixed-factor.h" 198c2ecf20Sopenharmony_ci#include "owl-gate.h" 208c2ecf20Sopenharmony_ci#include "owl-mux.h" 218c2ecf20Sopenharmony_ci#include "owl-pll.h" 228c2ecf20Sopenharmony_ci#include "owl-reset.h" 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#include <dt-bindings/clock/actions,s900-cmu.h> 258c2ecf20Sopenharmony_ci#include <dt-bindings/reset/actions,s900-reset.h> 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define CMU_COREPLL (0x0000) 288c2ecf20Sopenharmony_ci#define CMU_DEVPLL (0x0004) 298c2ecf20Sopenharmony_ci#define CMU_DDRPLL (0x0008) 308c2ecf20Sopenharmony_ci#define CMU_NANDPLL (0x000C) 318c2ecf20Sopenharmony_ci#define CMU_DISPLAYPLL (0x0010) 328c2ecf20Sopenharmony_ci#define CMU_AUDIOPLL (0x0014) 338c2ecf20Sopenharmony_ci#define CMU_TVOUTPLL (0x0018) 348c2ecf20Sopenharmony_ci#define CMU_BUSCLK (0x001C) 358c2ecf20Sopenharmony_ci#define CMU_SENSORCLK (0x0020) 368c2ecf20Sopenharmony_ci#define CMU_LCDCLK (0x0024) 378c2ecf20Sopenharmony_ci#define CMU_DSICLK (0x0028) 388c2ecf20Sopenharmony_ci#define CMU_CSICLK (0x002C) 398c2ecf20Sopenharmony_ci#define CMU_DECLK (0x0030) 408c2ecf20Sopenharmony_ci#define CMU_BISPCLK (0x0034) 418c2ecf20Sopenharmony_ci#define CMU_IMXCLK (0x0038) 428c2ecf20Sopenharmony_ci#define CMU_HDECLK (0x003C) 438c2ecf20Sopenharmony_ci#define CMU_VDECLK (0x0040) 448c2ecf20Sopenharmony_ci#define CMU_VCECLK (0x0044) 458c2ecf20Sopenharmony_ci#define CMU_NANDCCLK (0x004C) 468c2ecf20Sopenharmony_ci#define CMU_SD0CLK (0x0050) 478c2ecf20Sopenharmony_ci#define CMU_SD1CLK (0x0054) 488c2ecf20Sopenharmony_ci#define CMU_SD2CLK (0x0058) 498c2ecf20Sopenharmony_ci#define CMU_UART0CLK (0x005C) 508c2ecf20Sopenharmony_ci#define CMU_UART1CLK (0x0060) 518c2ecf20Sopenharmony_ci#define CMU_UART2CLK (0x0064) 528c2ecf20Sopenharmony_ci#define CMU_PWM0CLK (0x0070) 538c2ecf20Sopenharmony_ci#define CMU_PWM1CLK (0x0074) 548c2ecf20Sopenharmony_ci#define CMU_PWM2CLK (0x0078) 558c2ecf20Sopenharmony_ci#define CMU_PWM3CLK (0x007C) 568c2ecf20Sopenharmony_ci#define CMU_USBPLL (0x0080) 578c2ecf20Sopenharmony_ci#define CMU_ASSISTPLL (0x0084) 588c2ecf20Sopenharmony_ci#define CMU_EDPCLK (0x0088) 598c2ecf20Sopenharmony_ci#define CMU_GPU3DCLK (0x0090) 608c2ecf20Sopenharmony_ci#define CMU_CORECTL (0x009C) 618c2ecf20Sopenharmony_ci#define CMU_DEVCLKEN0 (0x00A0) 628c2ecf20Sopenharmony_ci#define CMU_DEVCLKEN1 (0x00A4) 638c2ecf20Sopenharmony_ci#define CMU_DEVRST0 (0x00A8) 648c2ecf20Sopenharmony_ci#define CMU_DEVRST1 (0x00AC) 658c2ecf20Sopenharmony_ci#define CMU_UART3CLK (0x00B0) 668c2ecf20Sopenharmony_ci#define CMU_UART4CLK (0x00B4) 678c2ecf20Sopenharmony_ci#define CMU_UART5CLK (0x00B8) 688c2ecf20Sopenharmony_ci#define CMU_UART6CLK (0x00BC) 698c2ecf20Sopenharmony_ci#define CMU_TLSCLK (0x00C0) 708c2ecf20Sopenharmony_ci#define CMU_SD3CLK (0x00C4) 718c2ecf20Sopenharmony_ci#define CMU_PWM4CLK (0x00C8) 728c2ecf20Sopenharmony_ci#define CMU_PWM5CLK (0x00CC) 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_cistatic struct clk_pll_table clk_audio_pll_table[] = { 758c2ecf20Sopenharmony_ci { 0, 45158400 }, { 1, 49152000 }, 768c2ecf20Sopenharmony_ci { 0, 0 }, 778c2ecf20Sopenharmony_ci}; 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_cistatic struct clk_pll_table clk_edp_pll_table[] = { 808c2ecf20Sopenharmony_ci { 0, 810000000 }, { 1, 135000000 }, { 2, 270000000 }, 818c2ecf20Sopenharmony_ci { 0, 0 }, 828c2ecf20Sopenharmony_ci}; 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci/* pll clocks */ 858c2ecf20Sopenharmony_cistatic OWL_PLL_NO_PARENT(core_pll_clk, "core_pll_clk", CMU_COREPLL, 24000000, 9, 0, 8, 5, 107, NULL, CLK_IGNORE_UNUSED); 868c2ecf20Sopenharmony_cistatic OWL_PLL_NO_PARENT(dev_pll_clk, "dev_pll_clk", CMU_DEVPLL, 6000000, 8, 0, 8, 20, 180, NULL, CLK_IGNORE_UNUSED); 878c2ecf20Sopenharmony_cistatic OWL_PLL_NO_PARENT(ddr_pll_clk, "ddr_pll_clk", CMU_DDRPLL, 24000000, 8, 0, 8, 5, 45, NULL, CLK_IGNORE_UNUSED); 888c2ecf20Sopenharmony_cistatic OWL_PLL_NO_PARENT(nand_pll_clk, "nand_pll_clk", CMU_NANDPLL, 6000000, 8, 0, 8, 4, 100, NULL, CLK_IGNORE_UNUSED); 898c2ecf20Sopenharmony_cistatic OWL_PLL_NO_PARENT(display_pll_clk, "display_pll_clk", CMU_DISPLAYPLL, 6000000, 8, 0, 8, 20, 180, NULL, CLK_IGNORE_UNUSED); 908c2ecf20Sopenharmony_cistatic OWL_PLL_NO_PARENT(assist_pll_clk, "assist_pll_clk", CMU_ASSISTPLL, 500000000, 0, 0, 0, 0, 0, NULL, CLK_IGNORE_UNUSED); 918c2ecf20Sopenharmony_cistatic OWL_PLL_NO_PARENT(audio_pll_clk, "audio_pll_clk", CMU_AUDIOPLL, 0, 4, 0, 1, 0, 0, clk_audio_pll_table, CLK_IGNORE_UNUSED); 928c2ecf20Sopenharmony_cistatic OWL_PLL(edp_pll_clk, "edp_pll_clk", "edp24M_clk", CMU_EDPCLK, 0, 9, 0, 2, 0, 0, clk_edp_pll_table, CLK_IGNORE_UNUSED); 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_cistatic const char *cpu_clk_mux_p[] = { "losc", "hosc", "core_pll_clk", }; 958c2ecf20Sopenharmony_cistatic const char *dev_clk_p[] = { "hosc", "dev_pll_clk", }; 968c2ecf20Sopenharmony_cistatic const char *noc_clk_mux_p[] = { "dev_clk", "assist_pll_clk", }; 978c2ecf20Sopenharmony_cistatic const char *dmm_clk_mux_p[] = { "dev_clk", "nand_pll_clk", "assist_pll_clk", "ddr_clk_src", }; 988c2ecf20Sopenharmony_cistatic const char *bisp_clk_mux_p[] = { "assist_pll_clk", "dev_clk", }; 998c2ecf20Sopenharmony_cistatic const char *csi_clk_mux_p[] = { "display_pll_clk", "dev_clk", }; 1008c2ecf20Sopenharmony_cistatic const char *de_clk_mux_p[] = { "assist_pll_clk", "dev_clk", }; 1018c2ecf20Sopenharmony_cistatic const char *gpu_clk_mux_p[] = { "dev_clk", "display_pll_clk", "ddr_clk_src", }; 1028c2ecf20Sopenharmony_cistatic const char *hde_clk_mux_p[] = { "dev_clk", "display_pll_clk", "ddr_clk_src", }; 1038c2ecf20Sopenharmony_cistatic const char *imx_clk_mux_p[] = { "assist_pll_clk", "dev_clk", }; 1048c2ecf20Sopenharmony_cistatic const char *lcd_clk_mux_p[] = { "display_pll_clk", "nand_pll_clk", }; 1058c2ecf20Sopenharmony_cistatic const char *nand_clk_mux_p[] = { "dev_clk", "nand_pll_clk", }; 1068c2ecf20Sopenharmony_cistatic const char *sd_clk_mux_p[] = { "dev_clk", "nand_pll_clk", }; 1078c2ecf20Sopenharmony_cistatic const char *sensor_clk_mux_p[] = { "hosc", "bisp_clk", }; 1088c2ecf20Sopenharmony_cistatic const char *uart_clk_mux_p[] = { "hosc", "dev_pll_clk", }; 1098c2ecf20Sopenharmony_cistatic const char *vce_clk_mux_p[] = { "dev_clk", "display_pll_clk", "assist_pll_clk", "ddr_clk_src", }; 1108c2ecf20Sopenharmony_cistatic const char *i2s_clk_mux_p[] = { "audio_pll_clk", }; 1118c2ecf20Sopenharmony_cistatic const char *edp_clk_mux_p[] = { "assist_pll_clk", "display_pll_clk", }; 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci/* mux clocks */ 1148c2ecf20Sopenharmony_cistatic OWL_MUX(cpu_clk, "cpu_clk", cpu_clk_mux_p, CMU_BUSCLK, 0, 2, CLK_SET_RATE_PARENT); 1158c2ecf20Sopenharmony_cistatic OWL_MUX(dev_clk, "dev_clk", dev_clk_p, CMU_DEVPLL, 12, 1, CLK_SET_RATE_PARENT); 1168c2ecf20Sopenharmony_cistatic OWL_MUX(noc_clk_mux, "noc_clk_mux", noc_clk_mux_p, CMU_BUSCLK, 7, 1, CLK_SET_RATE_PARENT); 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_cistatic struct clk_div_table nand_div_table[] = { 1198c2ecf20Sopenharmony_ci { 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 6 }, 1208c2ecf20Sopenharmony_ci { 4, 8 }, { 5, 10 }, { 6, 12 }, { 7, 14 }, 1218c2ecf20Sopenharmony_ci { 8, 16 }, { 9, 18 }, { 10, 20 }, { 11, 22 }, 1228c2ecf20Sopenharmony_ci { 12, 24 }, { 13, 26 }, { 14, 28 }, { 15, 30 }, 1238c2ecf20Sopenharmony_ci { 0, 0 }, 1248c2ecf20Sopenharmony_ci}; 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_cistatic struct clk_div_table apb_div_table[] = { 1278c2ecf20Sopenharmony_ci { 1, 2 }, { 2, 3 }, { 3, 4 }, 1288c2ecf20Sopenharmony_ci { 0, 0 }, 1298c2ecf20Sopenharmony_ci}; 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_cistatic struct clk_div_table eth_mac_div_table[] = { 1328c2ecf20Sopenharmony_ci { 0, 2 }, { 1, 4 }, 1338c2ecf20Sopenharmony_ci { 0, 0 }, 1348c2ecf20Sopenharmony_ci}; 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_cistatic struct clk_div_table rmii_ref_div_table[] = { 1378c2ecf20Sopenharmony_ci { 0, 4 }, { 1, 10 }, 1388c2ecf20Sopenharmony_ci { 0, 0 }, 1398c2ecf20Sopenharmony_ci}; 1408c2ecf20Sopenharmony_ci 1418c2ecf20Sopenharmony_cistatic struct clk_div_table usb3_mac_div_table[] = { 1428c2ecf20Sopenharmony_ci { 1, 2 }, { 2, 3 }, { 3, 4 }, 1438c2ecf20Sopenharmony_ci { 0, 0 } 1448c2ecf20Sopenharmony_ci}; 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_cistatic struct clk_div_table i2s_div_table[] = { 1478c2ecf20Sopenharmony_ci { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, 1488c2ecf20Sopenharmony_ci { 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 }, 1498c2ecf20Sopenharmony_ci { 8, 24 }, 1508c2ecf20Sopenharmony_ci { 0, 0 }, 1518c2ecf20Sopenharmony_ci}; 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_cistatic struct clk_div_table hdmia_div_table[] = { 1548c2ecf20Sopenharmony_ci { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, 1558c2ecf20Sopenharmony_ci { 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 }, 1568c2ecf20Sopenharmony_ci { 8, 24 }, 1578c2ecf20Sopenharmony_ci { 0, 0 }, 1588c2ecf20Sopenharmony_ci}; 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci/* divider clocks */ 1618c2ecf20Sopenharmony_cistatic OWL_DIVIDER(noc_clk_div, "noc_clk_div", "noc_clk", CMU_BUSCLK, 19, 1, NULL, 0, 0); 1628c2ecf20Sopenharmony_cistatic OWL_DIVIDER(ahb_clk, "ahb_clk", "noc_clk_div", CMU_BUSCLK, 4, 1, NULL, 0, 0); 1638c2ecf20Sopenharmony_cistatic OWL_DIVIDER(apb_clk, "apb_clk", "ahb_clk", CMU_BUSCLK, 8, 2, apb_div_table, 0, 0); 1648c2ecf20Sopenharmony_cistatic OWL_DIVIDER(usb3_mac_clk, "usb3_mac_clk", "assist_pll_clk", CMU_ASSISTPLL, 12, 2, usb3_mac_div_table, 0, 0); 1658c2ecf20Sopenharmony_cistatic OWL_DIVIDER(rmii_ref_clk, "rmii_ref_clk", "assist_pll_clk", CMU_ASSISTPLL, 8, 1, rmii_ref_div_table, 0, 0); 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_cistatic struct clk_factor_table sd_factor_table[] = { 1688c2ecf20Sopenharmony_ci /* bit0 ~ 4 */ 1698c2ecf20Sopenharmony_ci { 0, 1, 1 }, { 1, 1, 2 }, { 2, 1, 3 }, { 3, 1, 4 }, 1708c2ecf20Sopenharmony_ci { 4, 1, 5 }, { 5, 1, 6 }, { 6, 1, 7 }, { 7, 1, 8 }, 1718c2ecf20Sopenharmony_ci { 8, 1, 9 }, { 9, 1, 10 }, { 10, 1, 11 }, { 11, 1, 12 }, 1728c2ecf20Sopenharmony_ci { 12, 1, 13 }, { 13, 1, 14 }, { 14, 1, 15 }, { 15, 1, 16 }, 1738c2ecf20Sopenharmony_ci { 16, 1, 17 }, { 17, 1, 18 }, { 18, 1, 19 }, { 19, 1, 20 }, 1748c2ecf20Sopenharmony_ci { 20, 1, 21 }, { 21, 1, 22 }, { 22, 1, 23 }, { 23, 1, 24 }, 1758c2ecf20Sopenharmony_ci { 24, 1, 25 }, { 25, 1, 26 }, { 26, 1, 27 }, { 27, 1, 28 }, 1768c2ecf20Sopenharmony_ci { 28, 1, 29 }, { 29, 1, 30 }, { 30, 1, 31 }, { 31, 1, 32 }, 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci /* bit8: /128 */ 1798c2ecf20Sopenharmony_ci { 256, 1, 1 * 128 }, { 257, 1, 2 * 128 }, { 258, 1, 3 * 128 }, { 259, 1, 4 * 128 }, 1808c2ecf20Sopenharmony_ci { 260, 1, 5 * 128 }, { 261, 1, 6 * 128 }, { 262, 1, 7 * 128 }, { 263, 1, 8 * 128 }, 1818c2ecf20Sopenharmony_ci { 264, 1, 9 * 128 }, { 265, 1, 10 * 128 }, { 266, 1, 11 * 128 }, { 267, 1, 12 * 128 }, 1828c2ecf20Sopenharmony_ci { 268, 1, 13 * 128 }, { 269, 1, 14 * 128 }, { 270, 1, 15 * 128 }, { 271, 1, 16 * 128 }, 1838c2ecf20Sopenharmony_ci { 272, 1, 17 * 128 }, { 273, 1, 18 * 128 }, { 274, 1, 19 * 128 }, { 275, 1, 20 * 128 }, 1848c2ecf20Sopenharmony_ci { 276, 1, 21 * 128 }, { 277, 1, 22 * 128 }, { 278, 1, 23 * 128 }, { 279, 1, 24 * 128 }, 1858c2ecf20Sopenharmony_ci { 280, 1, 25 * 128 }, { 281, 1, 26 * 128 }, { 282, 1, 27 * 128 }, { 283, 1, 28 * 128 }, 1868c2ecf20Sopenharmony_ci { 284, 1, 29 * 128 }, { 285, 1, 30 * 128 }, { 286, 1, 31 * 128 }, { 287, 1, 32 * 128 }, 1878c2ecf20Sopenharmony_ci 1888c2ecf20Sopenharmony_ci { 0, 0 }, 1898c2ecf20Sopenharmony_ci}; 1908c2ecf20Sopenharmony_ci 1918c2ecf20Sopenharmony_cistatic struct clk_factor_table dmm_factor_table[] = { 1928c2ecf20Sopenharmony_ci { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 1, 3 }, 1938c2ecf20Sopenharmony_ci { 4, 1, 4 }, 1948c2ecf20Sopenharmony_ci { 0, 0, 0 }, 1958c2ecf20Sopenharmony_ci}; 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_cistatic struct clk_factor_table noc_factor_table[] = { 1988c2ecf20Sopenharmony_ci { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 1, 3 }, { 4, 1, 4 }, 1998c2ecf20Sopenharmony_ci { 0, 0, 0 }, 2008c2ecf20Sopenharmony_ci}; 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_cistatic struct clk_factor_table bisp_factor_table[] = { 2038c2ecf20Sopenharmony_ci { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 }, 2048c2ecf20Sopenharmony_ci { 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 }, 2058c2ecf20Sopenharmony_ci { 0, 0, 0 }, 2068c2ecf20Sopenharmony_ci}; 2078c2ecf20Sopenharmony_ci 2088c2ecf20Sopenharmony_ci/* factor clocks */ 2098c2ecf20Sopenharmony_cistatic OWL_FACTOR(noc_clk, "noc_clk", "noc_clk_mux", CMU_BUSCLK, 16, 3, noc_factor_table, 0, 0); 2108c2ecf20Sopenharmony_cistatic OWL_FACTOR(de_clk1, "de_clk1", "de_clk", CMU_DECLK, 0, 3, bisp_factor_table, 0, 0); 2118c2ecf20Sopenharmony_cistatic OWL_FACTOR(de_clk2, "de_clk2", "de_clk", CMU_DECLK, 4, 3, bisp_factor_table, 0, 0); 2128c2ecf20Sopenharmony_cistatic OWL_FACTOR(de_clk3, "de_clk3", "de_clk", CMU_DECLK, 8, 3, bisp_factor_table, 0, 0); 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci/* gate clocks */ 2158c2ecf20Sopenharmony_cistatic OWL_GATE(gpio_clk, "gpio_clk", "apb_clk", CMU_DEVCLKEN0, 18, 0, 0); 2168c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(gpu_clk, "gpu_clk", CMU_DEVCLKEN0, 30, 0, 0); 2178c2ecf20Sopenharmony_cistatic OWL_GATE(dmac_clk, "dmac_clk", "noc_clk_div", CMU_DEVCLKEN0, 1, 0, 0); 2188c2ecf20Sopenharmony_cistatic OWL_GATE(timer_clk, "timer_clk", "hosc", CMU_DEVCLKEN1, 27, 0, 0); 2198c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(dsi_clk, "dsi_clk", CMU_DEVCLKEN0, 12, 0, 0); 2208c2ecf20Sopenharmony_cistatic OWL_GATE(ddr0_clk, "ddr0_clk", "ddr_pll_clk", CMU_DEVCLKEN0, 31, 0, CLK_IGNORE_UNUSED); 2218c2ecf20Sopenharmony_cistatic OWL_GATE(ddr1_clk, "ddr1_clk", "ddr_pll_clk", CMU_DEVCLKEN0, 29, 0, CLK_IGNORE_UNUSED); 2228c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usb3_480mpll0_clk, "usb3_480mpll0_clk", CMU_USBPLL, 3, 0, 0); 2238c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usb3_480mphy0_clk, "usb3_480mphy0_clk", CMU_USBPLL, 2, 0, 0); 2248c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usb3_5gphy_clk, "usb3_5gphy_clk", CMU_USBPLL, 1, 0, 0); 2258c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usb3_cce_clk, "usb3_cce_clk", CMU_USBPLL, 0, 0, 0); 2268c2ecf20Sopenharmony_cistatic OWL_GATE(edp24M_clk, "edp24M_clk", "diff24M", CMU_EDPCLK, 8, 0, 0); 2278c2ecf20Sopenharmony_cistatic OWL_GATE(edp_link_clk, "edp_link_clk", "edp_pll_clk", CMU_DEVCLKEN0, 10, 0, 0); 2288c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usbh0_pllen_clk, "usbh0_pllen_clk", CMU_USBPLL, 12, 0, 0); 2298c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usbh0_phy_clk, "usbh0_phy_clk", CMU_USBPLL, 10, 0, 0); 2308c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usbh0_cce_clk, "usbh0_cce_clk", CMU_USBPLL, 8, 0, 0); 2318c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usbh1_pllen_clk, "usbh1_pllen_clk", CMU_USBPLL, 13, 0, 0); 2328c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usbh1_phy_clk, "usbh1_phy_clk", CMU_USBPLL, 11, 0, 0); 2338c2ecf20Sopenharmony_cistatic OWL_GATE_NO_PARENT(usbh1_cce_clk, "usbh1_cce_clk", CMU_USBPLL, 9, 0, 0); 2348c2ecf20Sopenharmony_cistatic OWL_GATE(spi0_clk, "spi0_clk", "ahb_clk", CMU_DEVCLKEN1, 10, 0, CLK_IGNORE_UNUSED); 2358c2ecf20Sopenharmony_cistatic OWL_GATE(spi1_clk, "spi1_clk", "ahb_clk", CMU_DEVCLKEN1, 11, 0, CLK_IGNORE_UNUSED); 2368c2ecf20Sopenharmony_cistatic OWL_GATE(spi2_clk, "spi2_clk", "ahb_clk", CMU_DEVCLKEN1, 12, 0, CLK_IGNORE_UNUSED); 2378c2ecf20Sopenharmony_cistatic OWL_GATE(spi3_clk, "spi3_clk", "ahb_clk", CMU_DEVCLKEN1, 13, 0, CLK_IGNORE_UNUSED); 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_ci/* composite clocks */ 2408c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(bisp_clk, "bisp_clk", bisp_clk_mux_p, 2418c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_BISPCLK, 4, 1), 2428c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 14, 0), 2438c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_BISPCLK, 0, 3, 0, bisp_factor_table), 2448c2ecf20Sopenharmony_ci 0); 2458c2ecf20Sopenharmony_ci 2468c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(csi0_clk, "csi0_clk", csi_clk_mux_p, 2478c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_CSICLK, 4, 1), 2488c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 13, 0), 2498c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_CSICLK, 0, 4, 0, NULL), 2508c2ecf20Sopenharmony_ci 0); 2518c2ecf20Sopenharmony_ci 2528c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(csi1_clk, "csi1_clk", csi_clk_mux_p, 2538c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_CSICLK, 20, 1), 2548c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 15, 0), 2558c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_CSICLK, 16, 4, 0, NULL), 2568c2ecf20Sopenharmony_ci 0); 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_cistatic OWL_COMP_PASS(de_clk, "de_clk", de_clk_mux_p, 2598c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_DECLK, 12, 1), 2608c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 8, 0), 2618c2ecf20Sopenharmony_ci 0); 2628c2ecf20Sopenharmony_ci 2638c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(dmm_clk, "dmm_clk", dmm_clk_mux_p, 2648c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_BUSCLK, 10, 2), 2658c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 19, 0), 2668c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_BUSCLK, 12, 3, 0, dmm_factor_table), 2678c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(edp_clk, "edp_clk", edp_clk_mux_p, 2708c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_EDPCLK, 19, 1), 2718c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 10, 0), 2728c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_EDPCLK, 16, 3, 0, bisp_factor_table), 2738c2ecf20Sopenharmony_ci 0); 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(eth_mac_clk, "eth_mac_clk", "assist_pll_clk", 2768c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 22, 0), 2778c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_ASSISTPLL, 10, 1, 0, eth_mac_div_table), 2788c2ecf20Sopenharmony_ci 0); 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(gpu_core_clk, "gpu_core_clk", gpu_clk_mux_p, 2818c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_GPU3DCLK, 4, 2), 2828c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_GPU3DCLK, 15, 0), 2838c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_GPU3DCLK, 0, 3, 0, bisp_factor_table), 2848c2ecf20Sopenharmony_ci 0); 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(gpu_mem_clk, "gpu_mem_clk", gpu_clk_mux_p, 2878c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_GPU3DCLK, 20, 2), 2888c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_GPU3DCLK, 14, 0), 2898c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_GPU3DCLK, 16, 3, 0, bisp_factor_table), 2908c2ecf20Sopenharmony_ci 0); 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(gpu_sys_clk, "gpu_sys_clk", gpu_clk_mux_p, 2938c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_GPU3DCLK, 28, 2), 2948c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_GPU3DCLK, 13, 0), 2958c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_GPU3DCLK, 24, 3, 0, bisp_factor_table), 2968c2ecf20Sopenharmony_ci 0); 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(hde_clk, "hde_clk", hde_clk_mux_p, 2998c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_HDECLK, 4, 2), 3008c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 27, 0), 3018c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_HDECLK, 0, 3, 0, bisp_factor_table), 3028c2ecf20Sopenharmony_ci 0); 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(hdmia_clk, "hdmia_clk", i2s_clk_mux_p, 3058c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_AUDIOPLL, 24, 1), 3068c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 22, 0), 3078c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_AUDIOPLL, 24, 4, 0, hdmia_div_table), 3088c2ecf20Sopenharmony_ci 0); 3098c2ecf20Sopenharmony_ci 3108c2ecf20Sopenharmony_cistatic OWL_COMP_FIXED_FACTOR(i2c0_clk, "i2c0_clk", "assist_pll_clk", 3118c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 14, 0), 3128c2ecf20Sopenharmony_ci 1, 5, 0); 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_cistatic OWL_COMP_FIXED_FACTOR(i2c1_clk, "i2c1_clk", "assist_pll_clk", 3158c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 15, 0), 3168c2ecf20Sopenharmony_ci 1, 5, 0); 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_cistatic OWL_COMP_FIXED_FACTOR(i2c2_clk, "i2c2_clk", "assist_pll_clk", 3198c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 30, 0), 3208c2ecf20Sopenharmony_ci 1, 5, 0); 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_cistatic OWL_COMP_FIXED_FACTOR(i2c3_clk, "i2c3_clk", "assist_pll_clk", 3238c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 31, 0), 3248c2ecf20Sopenharmony_ci 1, 5, 0); 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_cistatic OWL_COMP_FIXED_FACTOR(i2c4_clk, "i2c4_clk", "assist_pll_clk", 3278c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 17, 0), 3288c2ecf20Sopenharmony_ci 1, 5, 0); 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_cistatic OWL_COMP_FIXED_FACTOR(i2c5_clk, "i2c5_clk", "assist_pll_clk", 3318c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 1, 0), 3328c2ecf20Sopenharmony_ci 1, 5, 0); 3338c2ecf20Sopenharmony_ci 3348c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(i2srx_clk, "i2srx_clk", i2s_clk_mux_p, 3358c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_AUDIOPLL, 24, 1), 3368c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 21, 0), 3378c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_AUDIOPLL, 20, 4, 0, i2s_div_table), 3388c2ecf20Sopenharmony_ci 0); 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(i2stx_clk, "i2stx_clk", i2s_clk_mux_p, 3418c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_AUDIOPLL, 24, 1), 3428c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 20, 0), 3438c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_AUDIOPLL, 16, 4, 0, i2s_div_table), 3448c2ecf20Sopenharmony_ci 0); 3458c2ecf20Sopenharmony_ci 3468c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(imx_clk, "imx_clk", imx_clk_mux_p, 3478c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_IMXCLK, 4, 1), 3488c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 17, 0), 3498c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_IMXCLK, 0, 3, 0, bisp_factor_table), 3508c2ecf20Sopenharmony_ci 0); 3518c2ecf20Sopenharmony_ci 3528c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(lcd_clk, "lcd_clk", lcd_clk_mux_p, 3538c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_LCDCLK, 12, 2), 3548c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 9, 0), 3558c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_LCDCLK, 0, 5, 0, NULL), 3568c2ecf20Sopenharmony_ci 0); 3578c2ecf20Sopenharmony_ci 3588c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(nand0_clk, "nand0_clk", nand_clk_mux_p, 3598c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_NANDCCLK, 8, 1), 3608c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 4, 0), 3618c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_NANDCCLK, 0, 4, 0, nand_div_table), 3628c2ecf20Sopenharmony_ci CLK_SET_RATE_PARENT); 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(nand1_clk, "nand1_clk", nand_clk_mux_p, 3658c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_NANDCCLK, 24, 1), 3668c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 11, 0), 3678c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_NANDCCLK, 16, 4, 0, nand_div_table), 3688c2ecf20Sopenharmony_ci CLK_SET_RATE_PARENT); 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(pwm0_clk, "pwm0_clk", "hosc", 3718c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 23, 0), 3728c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_PWM0CLK, 0, 6, 0, NULL), 3738c2ecf20Sopenharmony_ci 0); 3748c2ecf20Sopenharmony_ci 3758c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(pwm1_clk, "pwm1_clk", "hosc", 3768c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 24, 0), 3778c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_PWM1CLK, 0, 6, 0, NULL), 3788c2ecf20Sopenharmony_ci 0); 3798c2ecf20Sopenharmony_ci/* 3808c2ecf20Sopenharmony_ci * pwm2 may be for backlight, do not gate it 3818c2ecf20Sopenharmony_ci * even it is "unused", because it may be 3828c2ecf20Sopenharmony_ci * enabled at boot stage, and in kernel, driver 3838c2ecf20Sopenharmony_ci * has no effective method to know the real status, 3848c2ecf20Sopenharmony_ci * so, the best way is keeping it as what it was. 3858c2ecf20Sopenharmony_ci */ 3868c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(pwm2_clk, "pwm2_clk", "hosc", 3878c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 25, 0), 3888c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_PWM2CLK, 0, 6, 0, NULL), 3898c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 3908c2ecf20Sopenharmony_ci 3918c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(pwm3_clk, "pwm3_clk", "hosc", 3928c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 26, 0), 3938c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_PWM3CLK, 0, 6, 0, NULL), 3948c2ecf20Sopenharmony_ci 0); 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(pwm4_clk, "pwm4_clk", "hosc", 3978c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 4, 0), 3988c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_PWM4CLK, 0, 6, 0, NULL), 3998c2ecf20Sopenharmony_ci 0); 4008c2ecf20Sopenharmony_ci 4018c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(pwm5_clk, "pwm5_clk", "hosc", 4028c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 5, 0), 4038c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_PWM5CLK, 0, 6, 0, NULL), 4048c2ecf20Sopenharmony_ci 0); 4058c2ecf20Sopenharmony_ci 4068c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(sd0_clk, "sd0_clk", sd_clk_mux_p, 4078c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_SD0CLK, 9, 1), 4088c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 5, 0), 4098c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_SD0CLK, 0, 9, 0, sd_factor_table), 4108c2ecf20Sopenharmony_ci 0); 4118c2ecf20Sopenharmony_ci 4128c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(sd1_clk, "sd1_clk", sd_clk_mux_p, 4138c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_SD1CLK, 9, 1), 4148c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 6, 0), 4158c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_SD1CLK, 0, 9, 0, sd_factor_table), 4168c2ecf20Sopenharmony_ci 0); 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(sd2_clk, "sd2_clk", sd_clk_mux_p, 4198c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_SD2CLK, 9, 1), 4208c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 7, 0), 4218c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_SD2CLK, 0, 9, 0, sd_factor_table), 4228c2ecf20Sopenharmony_ci 0); 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(sd3_clk, "sd3_clk", sd_clk_mux_p, 4258c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_SD3CLK, 9, 1), 4268c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 16, 0), 4278c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_SD3CLK, 0, 9, 0, sd_factor_table), 4288c2ecf20Sopenharmony_ci 0); 4298c2ecf20Sopenharmony_ci 4308c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(sensor_clk, "sensor_clk", sensor_clk_mux_p, 4318c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_SENSORCLK, 4, 1), 4328c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 14, 0), 4338c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_SENSORCLK, 0, 4, 0, NULL), 4348c2ecf20Sopenharmony_ci 0); 4358c2ecf20Sopenharmony_ci 4368c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(speed_sensor_clk, "speed_sensor_clk", 4378c2ecf20Sopenharmony_ci "hosc", 4388c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 0, 0), 4398c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_TLSCLK, 0, 4, CLK_DIVIDER_POWER_OF_TWO, NULL), 4408c2ecf20Sopenharmony_ci 0); 4418c2ecf20Sopenharmony_ci 4428c2ecf20Sopenharmony_cistatic OWL_COMP_DIV_FIXED(thermal_sensor_clk, "thermal_sensor_clk", 4438c2ecf20Sopenharmony_ci "hosc", 4448c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 2, 0), 4458c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_TLSCLK, 8, 4, CLK_DIVIDER_POWER_OF_TWO, NULL), 4468c2ecf20Sopenharmony_ci 0); 4478c2ecf20Sopenharmony_ci 4488c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(uart0_clk, "uart0_clk", uart_clk_mux_p, 4498c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_UART0CLK, 16, 1), 4508c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 6, 0), 4518c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_UART0CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), 4528c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 4538c2ecf20Sopenharmony_ci 4548c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(uart1_clk, "uart1_clk", uart_clk_mux_p, 4558c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_UART1CLK, 16, 1), 4568c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 7, 0), 4578c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_UART1CLK, 1, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), 4588c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 4598c2ecf20Sopenharmony_ci 4608c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(uart2_clk, "uart2_clk", uart_clk_mux_p, 4618c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_UART2CLK, 16, 1), 4628c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 8, 0), 4638c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_UART2CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), 4648c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 4658c2ecf20Sopenharmony_ci 4668c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(uart3_clk, "uart3_clk", uart_clk_mux_p, 4678c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_UART3CLK, 16, 1), 4688c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 19, 0), 4698c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_UART3CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), 4708c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 4718c2ecf20Sopenharmony_ci 4728c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(uart4_clk, "uart4_clk", uart_clk_mux_p, 4738c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_UART4CLK, 16, 1), 4748c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 20, 0), 4758c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_UART4CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), 4768c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 4778c2ecf20Sopenharmony_ci 4788c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(uart5_clk, "uart5_clk", uart_clk_mux_p, 4798c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_UART5CLK, 16, 1), 4808c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 21, 0), 4818c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_UART5CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), 4828c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_cistatic OWL_COMP_DIV(uart6_clk, "uart6_clk", uart_clk_mux_p, 4858c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_UART6CLK, 16, 1), 4868c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN1, 18, 0), 4878c2ecf20Sopenharmony_ci OWL_DIVIDER_HW(CMU_UART6CLK, 0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL), 4888c2ecf20Sopenharmony_ci CLK_IGNORE_UNUSED); 4898c2ecf20Sopenharmony_ci 4908c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(vce_clk, "vce_clk", vce_clk_mux_p, 4918c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_VCECLK, 4, 2), 4928c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 26, 0), 4938c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_VCECLK, 0, 3, 0, bisp_factor_table), 4948c2ecf20Sopenharmony_ci 0); 4958c2ecf20Sopenharmony_ci 4968c2ecf20Sopenharmony_cistatic OWL_COMP_FACTOR(vde_clk, "vde_clk", hde_clk_mux_p, 4978c2ecf20Sopenharmony_ci OWL_MUX_HW(CMU_VDECLK, 4, 2), 4988c2ecf20Sopenharmony_ci OWL_GATE_HW(CMU_DEVCLKEN0, 25, 0), 4998c2ecf20Sopenharmony_ci OWL_FACTOR_HW(CMU_VDECLK, 0, 3, 0, bisp_factor_table), 5008c2ecf20Sopenharmony_ci 0); 5018c2ecf20Sopenharmony_ci 5028c2ecf20Sopenharmony_cistatic struct owl_clk_common *s900_clks[] = { 5038c2ecf20Sopenharmony_ci &core_pll_clk.common, 5048c2ecf20Sopenharmony_ci &dev_pll_clk.common, 5058c2ecf20Sopenharmony_ci &ddr_pll_clk.common, 5068c2ecf20Sopenharmony_ci &nand_pll_clk.common, 5078c2ecf20Sopenharmony_ci &display_pll_clk.common, 5088c2ecf20Sopenharmony_ci &assist_pll_clk.common, 5098c2ecf20Sopenharmony_ci &audio_pll_clk.common, 5108c2ecf20Sopenharmony_ci &edp_pll_clk.common, 5118c2ecf20Sopenharmony_ci &cpu_clk.common, 5128c2ecf20Sopenharmony_ci &dev_clk.common, 5138c2ecf20Sopenharmony_ci &noc_clk_mux.common, 5148c2ecf20Sopenharmony_ci &noc_clk_div.common, 5158c2ecf20Sopenharmony_ci &ahb_clk.common, 5168c2ecf20Sopenharmony_ci &apb_clk.common, 5178c2ecf20Sopenharmony_ci &usb3_mac_clk.common, 5188c2ecf20Sopenharmony_ci &rmii_ref_clk.common, 5198c2ecf20Sopenharmony_ci &noc_clk.common, 5208c2ecf20Sopenharmony_ci &de_clk1.common, 5218c2ecf20Sopenharmony_ci &de_clk2.common, 5228c2ecf20Sopenharmony_ci &de_clk3.common, 5238c2ecf20Sopenharmony_ci &gpio_clk.common, 5248c2ecf20Sopenharmony_ci &gpu_clk.common, 5258c2ecf20Sopenharmony_ci &dmac_clk.common, 5268c2ecf20Sopenharmony_ci &timer_clk.common, 5278c2ecf20Sopenharmony_ci &dsi_clk.common, 5288c2ecf20Sopenharmony_ci &ddr0_clk.common, 5298c2ecf20Sopenharmony_ci &ddr1_clk.common, 5308c2ecf20Sopenharmony_ci &usb3_480mpll0_clk.common, 5318c2ecf20Sopenharmony_ci &usb3_480mphy0_clk.common, 5328c2ecf20Sopenharmony_ci &usb3_5gphy_clk.common, 5338c2ecf20Sopenharmony_ci &usb3_cce_clk.common, 5348c2ecf20Sopenharmony_ci &edp24M_clk.common, 5358c2ecf20Sopenharmony_ci &edp_link_clk.common, 5368c2ecf20Sopenharmony_ci &usbh0_pllen_clk.common, 5378c2ecf20Sopenharmony_ci &usbh0_phy_clk.common, 5388c2ecf20Sopenharmony_ci &usbh0_cce_clk.common, 5398c2ecf20Sopenharmony_ci &usbh1_pllen_clk.common, 5408c2ecf20Sopenharmony_ci &usbh1_phy_clk.common, 5418c2ecf20Sopenharmony_ci &usbh1_cce_clk.common, 5428c2ecf20Sopenharmony_ci &i2c0_clk.common, 5438c2ecf20Sopenharmony_ci &i2c1_clk.common, 5448c2ecf20Sopenharmony_ci &i2c2_clk.common, 5458c2ecf20Sopenharmony_ci &i2c3_clk.common, 5468c2ecf20Sopenharmony_ci &i2c4_clk.common, 5478c2ecf20Sopenharmony_ci &i2c5_clk.common, 5488c2ecf20Sopenharmony_ci &spi0_clk.common, 5498c2ecf20Sopenharmony_ci &spi1_clk.common, 5508c2ecf20Sopenharmony_ci &spi2_clk.common, 5518c2ecf20Sopenharmony_ci &spi3_clk.common, 5528c2ecf20Sopenharmony_ci &bisp_clk.common, 5538c2ecf20Sopenharmony_ci &csi0_clk.common, 5548c2ecf20Sopenharmony_ci &csi1_clk.common, 5558c2ecf20Sopenharmony_ci &de_clk.common, 5568c2ecf20Sopenharmony_ci &dmm_clk.common, 5578c2ecf20Sopenharmony_ci &edp_clk.common, 5588c2ecf20Sopenharmony_ci ð_mac_clk.common, 5598c2ecf20Sopenharmony_ci &gpu_core_clk.common, 5608c2ecf20Sopenharmony_ci &gpu_mem_clk.common, 5618c2ecf20Sopenharmony_ci &gpu_sys_clk.common, 5628c2ecf20Sopenharmony_ci &hde_clk.common, 5638c2ecf20Sopenharmony_ci &hdmia_clk.common, 5648c2ecf20Sopenharmony_ci &i2srx_clk.common, 5658c2ecf20Sopenharmony_ci &i2stx_clk.common, 5668c2ecf20Sopenharmony_ci &imx_clk.common, 5678c2ecf20Sopenharmony_ci &lcd_clk.common, 5688c2ecf20Sopenharmony_ci &nand0_clk.common, 5698c2ecf20Sopenharmony_ci &nand1_clk.common, 5708c2ecf20Sopenharmony_ci &pwm0_clk.common, 5718c2ecf20Sopenharmony_ci &pwm1_clk.common, 5728c2ecf20Sopenharmony_ci &pwm2_clk.common, 5738c2ecf20Sopenharmony_ci &pwm3_clk.common, 5748c2ecf20Sopenharmony_ci &pwm4_clk.common, 5758c2ecf20Sopenharmony_ci &pwm5_clk.common, 5768c2ecf20Sopenharmony_ci &sd0_clk.common, 5778c2ecf20Sopenharmony_ci &sd1_clk.common, 5788c2ecf20Sopenharmony_ci &sd2_clk.common, 5798c2ecf20Sopenharmony_ci &sd3_clk.common, 5808c2ecf20Sopenharmony_ci &sensor_clk.common, 5818c2ecf20Sopenharmony_ci &speed_sensor_clk.common, 5828c2ecf20Sopenharmony_ci &thermal_sensor_clk.common, 5838c2ecf20Sopenharmony_ci &uart0_clk.common, 5848c2ecf20Sopenharmony_ci &uart1_clk.common, 5858c2ecf20Sopenharmony_ci &uart2_clk.common, 5868c2ecf20Sopenharmony_ci &uart3_clk.common, 5878c2ecf20Sopenharmony_ci &uart4_clk.common, 5888c2ecf20Sopenharmony_ci &uart5_clk.common, 5898c2ecf20Sopenharmony_ci &uart6_clk.common, 5908c2ecf20Sopenharmony_ci &vce_clk.common, 5918c2ecf20Sopenharmony_ci &vde_clk.common, 5928c2ecf20Sopenharmony_ci}; 5938c2ecf20Sopenharmony_ci 5948c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data s900_hw_clks = { 5958c2ecf20Sopenharmony_ci .hws = { 5968c2ecf20Sopenharmony_ci [CLK_CORE_PLL] = &core_pll_clk.common.hw, 5978c2ecf20Sopenharmony_ci [CLK_DEV_PLL] = &dev_pll_clk.common.hw, 5988c2ecf20Sopenharmony_ci [CLK_DDR_PLL] = &ddr_pll_clk.common.hw, 5998c2ecf20Sopenharmony_ci [CLK_NAND_PLL] = &nand_pll_clk.common.hw, 6008c2ecf20Sopenharmony_ci [CLK_DISPLAY_PLL] = &display_pll_clk.common.hw, 6018c2ecf20Sopenharmony_ci [CLK_ASSIST_PLL] = &assist_pll_clk.common.hw, 6028c2ecf20Sopenharmony_ci [CLK_AUDIO_PLL] = &audio_pll_clk.common.hw, 6038c2ecf20Sopenharmony_ci [CLK_EDP_PLL] = &edp_pll_clk.common.hw, 6048c2ecf20Sopenharmony_ci [CLK_CPU] = &cpu_clk.common.hw, 6058c2ecf20Sopenharmony_ci [CLK_DEV] = &dev_clk.common.hw, 6068c2ecf20Sopenharmony_ci [CLK_NOC_MUX] = &noc_clk_mux.common.hw, 6078c2ecf20Sopenharmony_ci [CLK_NOC_DIV] = &noc_clk_div.common.hw, 6088c2ecf20Sopenharmony_ci [CLK_AHB] = &ahb_clk.common.hw, 6098c2ecf20Sopenharmony_ci [CLK_APB] = &apb_clk.common.hw, 6108c2ecf20Sopenharmony_ci [CLK_USB3_MAC] = &usb3_mac_clk.common.hw, 6118c2ecf20Sopenharmony_ci [CLK_RMII_REF] = &rmii_ref_clk.common.hw, 6128c2ecf20Sopenharmony_ci [CLK_NOC] = &noc_clk.common.hw, 6138c2ecf20Sopenharmony_ci [CLK_DE1] = &de_clk1.common.hw, 6148c2ecf20Sopenharmony_ci [CLK_DE2] = &de_clk2.common.hw, 6158c2ecf20Sopenharmony_ci [CLK_DE3] = &de_clk3.common.hw, 6168c2ecf20Sopenharmony_ci [CLK_GPIO] = &gpio_clk.common.hw, 6178c2ecf20Sopenharmony_ci [CLK_GPU] = &gpu_clk.common.hw, 6188c2ecf20Sopenharmony_ci [CLK_DMAC] = &dmac_clk.common.hw, 6198c2ecf20Sopenharmony_ci [CLK_TIMER] = &timer_clk.common.hw, 6208c2ecf20Sopenharmony_ci [CLK_DSI] = &dsi_clk.common.hw, 6218c2ecf20Sopenharmony_ci [CLK_DDR0] = &ddr0_clk.common.hw, 6228c2ecf20Sopenharmony_ci [CLK_DDR1] = &ddr1_clk.common.hw, 6238c2ecf20Sopenharmony_ci [CLK_USB3_480MPLL0] = &usb3_480mpll0_clk.common.hw, 6248c2ecf20Sopenharmony_ci [CLK_USB3_480MPHY0] = &usb3_480mphy0_clk.common.hw, 6258c2ecf20Sopenharmony_ci [CLK_USB3_5GPHY] = &usb3_5gphy_clk.common.hw, 6268c2ecf20Sopenharmony_ci [CLK_USB3_CCE] = &usb3_cce_clk.common.hw, 6278c2ecf20Sopenharmony_ci [CLK_24M_EDP] = &edp24M_clk.common.hw, 6288c2ecf20Sopenharmony_ci [CLK_EDP_LINK] = &edp_link_clk.common.hw, 6298c2ecf20Sopenharmony_ci [CLK_USB2H0_PLLEN] = &usbh0_pllen_clk.common.hw, 6308c2ecf20Sopenharmony_ci [CLK_USB2H0_PHY] = &usbh0_phy_clk.common.hw, 6318c2ecf20Sopenharmony_ci [CLK_USB2H0_CCE] = &usbh0_cce_clk.common.hw, 6328c2ecf20Sopenharmony_ci [CLK_USB2H1_PLLEN] = &usbh1_pllen_clk.common.hw, 6338c2ecf20Sopenharmony_ci [CLK_USB2H1_PHY] = &usbh1_phy_clk.common.hw, 6348c2ecf20Sopenharmony_ci [CLK_USB2H1_CCE] = &usbh1_cce_clk.common.hw, 6358c2ecf20Sopenharmony_ci [CLK_I2C0] = &i2c0_clk.common.hw, 6368c2ecf20Sopenharmony_ci [CLK_I2C1] = &i2c1_clk.common.hw, 6378c2ecf20Sopenharmony_ci [CLK_I2C2] = &i2c2_clk.common.hw, 6388c2ecf20Sopenharmony_ci [CLK_I2C3] = &i2c3_clk.common.hw, 6398c2ecf20Sopenharmony_ci [CLK_I2C4] = &i2c4_clk.common.hw, 6408c2ecf20Sopenharmony_ci [CLK_I2C5] = &i2c5_clk.common.hw, 6418c2ecf20Sopenharmony_ci [CLK_SPI0] = &spi0_clk.common.hw, 6428c2ecf20Sopenharmony_ci [CLK_SPI1] = &spi1_clk.common.hw, 6438c2ecf20Sopenharmony_ci [CLK_SPI2] = &spi2_clk.common.hw, 6448c2ecf20Sopenharmony_ci [CLK_SPI3] = &spi3_clk.common.hw, 6458c2ecf20Sopenharmony_ci [CLK_BISP] = &bisp_clk.common.hw, 6468c2ecf20Sopenharmony_ci [CLK_CSI0] = &csi0_clk.common.hw, 6478c2ecf20Sopenharmony_ci [CLK_CSI1] = &csi1_clk.common.hw, 6488c2ecf20Sopenharmony_ci [CLK_DE0] = &de_clk.common.hw, 6498c2ecf20Sopenharmony_ci [CLK_DMM] = &dmm_clk.common.hw, 6508c2ecf20Sopenharmony_ci [CLK_EDP] = &edp_clk.common.hw, 6518c2ecf20Sopenharmony_ci [CLK_ETH_MAC] = ð_mac_clk.common.hw, 6528c2ecf20Sopenharmony_ci [CLK_GPU_CORE] = &gpu_core_clk.common.hw, 6538c2ecf20Sopenharmony_ci [CLK_GPU_MEM] = &gpu_mem_clk.common.hw, 6548c2ecf20Sopenharmony_ci [CLK_GPU_SYS] = &gpu_sys_clk.common.hw, 6558c2ecf20Sopenharmony_ci [CLK_HDE] = &hde_clk.common.hw, 6568c2ecf20Sopenharmony_ci [CLK_HDMI_AUDIO] = &hdmia_clk.common.hw, 6578c2ecf20Sopenharmony_ci [CLK_I2SRX] = &i2srx_clk.common.hw, 6588c2ecf20Sopenharmony_ci [CLK_I2STX] = &i2stx_clk.common.hw, 6598c2ecf20Sopenharmony_ci [CLK_IMX] = &imx_clk.common.hw, 6608c2ecf20Sopenharmony_ci [CLK_LCD] = &lcd_clk.common.hw, 6618c2ecf20Sopenharmony_ci [CLK_NAND0] = &nand0_clk.common.hw, 6628c2ecf20Sopenharmony_ci [CLK_NAND1] = &nand1_clk.common.hw, 6638c2ecf20Sopenharmony_ci [CLK_PWM0] = &pwm0_clk.common.hw, 6648c2ecf20Sopenharmony_ci [CLK_PWM1] = &pwm1_clk.common.hw, 6658c2ecf20Sopenharmony_ci [CLK_PWM2] = &pwm2_clk.common.hw, 6668c2ecf20Sopenharmony_ci [CLK_PWM3] = &pwm3_clk.common.hw, 6678c2ecf20Sopenharmony_ci [CLK_PWM4] = &pwm4_clk.common.hw, 6688c2ecf20Sopenharmony_ci [CLK_PWM5] = &pwm5_clk.common.hw, 6698c2ecf20Sopenharmony_ci [CLK_SD0] = &sd0_clk.common.hw, 6708c2ecf20Sopenharmony_ci [CLK_SD1] = &sd1_clk.common.hw, 6718c2ecf20Sopenharmony_ci [CLK_SD2] = &sd2_clk.common.hw, 6728c2ecf20Sopenharmony_ci [CLK_SD3] = &sd3_clk.common.hw, 6738c2ecf20Sopenharmony_ci [CLK_SENSOR] = &sensor_clk.common.hw, 6748c2ecf20Sopenharmony_ci [CLK_SPEED_SENSOR] = &speed_sensor_clk.common.hw, 6758c2ecf20Sopenharmony_ci [CLK_THERMAL_SENSOR] = &thermal_sensor_clk.common.hw, 6768c2ecf20Sopenharmony_ci [CLK_UART0] = &uart0_clk.common.hw, 6778c2ecf20Sopenharmony_ci [CLK_UART1] = &uart1_clk.common.hw, 6788c2ecf20Sopenharmony_ci [CLK_UART2] = &uart2_clk.common.hw, 6798c2ecf20Sopenharmony_ci [CLK_UART3] = &uart3_clk.common.hw, 6808c2ecf20Sopenharmony_ci [CLK_UART4] = &uart4_clk.common.hw, 6818c2ecf20Sopenharmony_ci [CLK_UART5] = &uart5_clk.common.hw, 6828c2ecf20Sopenharmony_ci [CLK_UART6] = &uart6_clk.common.hw, 6838c2ecf20Sopenharmony_ci [CLK_VCE] = &vce_clk.common.hw, 6848c2ecf20Sopenharmony_ci [CLK_VDE] = &vde_clk.common.hw, 6858c2ecf20Sopenharmony_ci }, 6868c2ecf20Sopenharmony_ci .num = CLK_NR_CLKS, 6878c2ecf20Sopenharmony_ci}; 6888c2ecf20Sopenharmony_ci 6898c2ecf20Sopenharmony_cistatic const struct owl_reset_map s900_resets[] = { 6908c2ecf20Sopenharmony_ci [RESET_DMAC] = { CMU_DEVRST0, BIT(0) }, 6918c2ecf20Sopenharmony_ci [RESET_SRAMI] = { CMU_DEVRST0, BIT(1) }, 6928c2ecf20Sopenharmony_ci [RESET_DDR_CTL_PHY] = { CMU_DEVRST0, BIT(2) }, 6938c2ecf20Sopenharmony_ci [RESET_NANDC0] = { CMU_DEVRST0, BIT(3) }, 6948c2ecf20Sopenharmony_ci [RESET_SD0] = { CMU_DEVRST0, BIT(4) }, 6958c2ecf20Sopenharmony_ci [RESET_SD1] = { CMU_DEVRST0, BIT(5) }, 6968c2ecf20Sopenharmony_ci [RESET_PCM1] = { CMU_DEVRST0, BIT(6) }, 6978c2ecf20Sopenharmony_ci [RESET_DE] = { CMU_DEVRST0, BIT(7) }, 6988c2ecf20Sopenharmony_ci [RESET_LVDS] = { CMU_DEVRST0, BIT(8) }, 6998c2ecf20Sopenharmony_ci [RESET_SD2] = { CMU_DEVRST0, BIT(9) }, 7008c2ecf20Sopenharmony_ci [RESET_DSI] = { CMU_DEVRST0, BIT(10) }, 7018c2ecf20Sopenharmony_ci [RESET_CSI0] = { CMU_DEVRST0, BIT(11) }, 7028c2ecf20Sopenharmony_ci [RESET_BISP_AXI] = { CMU_DEVRST0, BIT(12) }, 7038c2ecf20Sopenharmony_ci [RESET_CSI1] = { CMU_DEVRST0, BIT(13) }, 7048c2ecf20Sopenharmony_ci [RESET_GPIO] = { CMU_DEVRST0, BIT(15) }, 7058c2ecf20Sopenharmony_ci [RESET_EDP] = { CMU_DEVRST0, BIT(16) }, 7068c2ecf20Sopenharmony_ci [RESET_AUDIO] = { CMU_DEVRST0, BIT(17) }, 7078c2ecf20Sopenharmony_ci [RESET_PCM0] = { CMU_DEVRST0, BIT(18) }, 7088c2ecf20Sopenharmony_ci [RESET_HDE] = { CMU_DEVRST0, BIT(21) }, 7098c2ecf20Sopenharmony_ci [RESET_GPU3D_PA] = { CMU_DEVRST0, BIT(22) }, 7108c2ecf20Sopenharmony_ci [RESET_IMX] = { CMU_DEVRST0, BIT(23) }, 7118c2ecf20Sopenharmony_ci [RESET_SE] = { CMU_DEVRST0, BIT(24) }, 7128c2ecf20Sopenharmony_ci [RESET_NANDC1] = { CMU_DEVRST0, BIT(25) }, 7138c2ecf20Sopenharmony_ci [RESET_SD3] = { CMU_DEVRST0, BIT(26) }, 7148c2ecf20Sopenharmony_ci [RESET_GIC] = { CMU_DEVRST0, BIT(27) }, 7158c2ecf20Sopenharmony_ci [RESET_GPU3D_PB] = { CMU_DEVRST0, BIT(28) }, 7168c2ecf20Sopenharmony_ci [RESET_DDR_CTL_PHY_AXI] = { CMU_DEVRST0, BIT(29) }, 7178c2ecf20Sopenharmony_ci [RESET_CMU_DDR] = { CMU_DEVRST0, BIT(30) }, 7188c2ecf20Sopenharmony_ci [RESET_DMM] = { CMU_DEVRST0, BIT(31) }, 7198c2ecf20Sopenharmony_ci [RESET_USB2HUB] = { CMU_DEVRST1, BIT(0) }, 7208c2ecf20Sopenharmony_ci [RESET_USB2HSIC] = { CMU_DEVRST1, BIT(1) }, 7218c2ecf20Sopenharmony_ci [RESET_HDMI] = { CMU_DEVRST1, BIT(2) }, 7228c2ecf20Sopenharmony_ci [RESET_HDCP2TX] = { CMU_DEVRST1, BIT(3) }, 7238c2ecf20Sopenharmony_ci [RESET_UART6] = { CMU_DEVRST1, BIT(4) }, 7248c2ecf20Sopenharmony_ci [RESET_UART0] = { CMU_DEVRST1, BIT(5) }, 7258c2ecf20Sopenharmony_ci [RESET_UART1] = { CMU_DEVRST1, BIT(6) }, 7268c2ecf20Sopenharmony_ci [RESET_UART2] = { CMU_DEVRST1, BIT(7) }, 7278c2ecf20Sopenharmony_ci [RESET_SPI0] = { CMU_DEVRST1, BIT(8) }, 7288c2ecf20Sopenharmony_ci [RESET_SPI1] = { CMU_DEVRST1, BIT(9) }, 7298c2ecf20Sopenharmony_ci [RESET_SPI2] = { CMU_DEVRST1, BIT(10) }, 7308c2ecf20Sopenharmony_ci [RESET_SPI3] = { CMU_DEVRST1, BIT(11) }, 7318c2ecf20Sopenharmony_ci [RESET_I2C0] = { CMU_DEVRST1, BIT(12) }, 7328c2ecf20Sopenharmony_ci [RESET_I2C1] = { CMU_DEVRST1, BIT(13) }, 7338c2ecf20Sopenharmony_ci [RESET_USB3] = { CMU_DEVRST1, BIT(14) }, 7348c2ecf20Sopenharmony_ci [RESET_UART3] = { CMU_DEVRST1, BIT(15) }, 7358c2ecf20Sopenharmony_ci [RESET_UART4] = { CMU_DEVRST1, BIT(16) }, 7368c2ecf20Sopenharmony_ci [RESET_UART5] = { CMU_DEVRST1, BIT(17) }, 7378c2ecf20Sopenharmony_ci [RESET_I2C2] = { CMU_DEVRST1, BIT(18) }, 7388c2ecf20Sopenharmony_ci [RESET_I2C3] = { CMU_DEVRST1, BIT(19) }, 7398c2ecf20Sopenharmony_ci [RESET_ETHERNET] = { CMU_DEVRST1, BIT(20) }, 7408c2ecf20Sopenharmony_ci [RESET_CHIPID] = { CMU_DEVRST1, BIT(21) }, 7418c2ecf20Sopenharmony_ci [RESET_I2C4] = { CMU_DEVRST1, BIT(22) }, 7428c2ecf20Sopenharmony_ci [RESET_I2C5] = { CMU_DEVRST1, BIT(23) }, 7438c2ecf20Sopenharmony_ci [RESET_CPU_SCNT] = { CMU_DEVRST1, BIT(30) } 7448c2ecf20Sopenharmony_ci}; 7458c2ecf20Sopenharmony_ci 7468c2ecf20Sopenharmony_cistatic struct owl_clk_desc s900_clk_desc = { 7478c2ecf20Sopenharmony_ci .clks = s900_clks, 7488c2ecf20Sopenharmony_ci .num_clks = ARRAY_SIZE(s900_clks), 7498c2ecf20Sopenharmony_ci 7508c2ecf20Sopenharmony_ci .hw_clks = &s900_hw_clks, 7518c2ecf20Sopenharmony_ci 7528c2ecf20Sopenharmony_ci .resets = s900_resets, 7538c2ecf20Sopenharmony_ci .num_resets = ARRAY_SIZE(s900_resets), 7548c2ecf20Sopenharmony_ci}; 7558c2ecf20Sopenharmony_ci 7568c2ecf20Sopenharmony_cistatic int s900_clk_probe(struct platform_device *pdev) 7578c2ecf20Sopenharmony_ci{ 7588c2ecf20Sopenharmony_ci struct owl_clk_desc *desc; 7598c2ecf20Sopenharmony_ci struct owl_reset *reset; 7608c2ecf20Sopenharmony_ci int ret; 7618c2ecf20Sopenharmony_ci 7628c2ecf20Sopenharmony_ci desc = &s900_clk_desc; 7638c2ecf20Sopenharmony_ci owl_clk_regmap_init(pdev, desc); 7648c2ecf20Sopenharmony_ci 7658c2ecf20Sopenharmony_ci /* 7668c2ecf20Sopenharmony_ci * FIXME: Reset controller registration should be moved to 7678c2ecf20Sopenharmony_ci * common code, once all SoCs of Owl family supports it. 7688c2ecf20Sopenharmony_ci */ 7698c2ecf20Sopenharmony_ci reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL); 7708c2ecf20Sopenharmony_ci if (!reset) 7718c2ecf20Sopenharmony_ci return -ENOMEM; 7728c2ecf20Sopenharmony_ci 7738c2ecf20Sopenharmony_ci reset->rcdev.of_node = pdev->dev.of_node; 7748c2ecf20Sopenharmony_ci reset->rcdev.ops = &owl_reset_ops; 7758c2ecf20Sopenharmony_ci reset->rcdev.nr_resets = desc->num_resets; 7768c2ecf20Sopenharmony_ci reset->reset_map = desc->resets; 7778c2ecf20Sopenharmony_ci reset->regmap = desc->regmap; 7788c2ecf20Sopenharmony_ci 7798c2ecf20Sopenharmony_ci ret = devm_reset_controller_register(&pdev->dev, &reset->rcdev); 7808c2ecf20Sopenharmony_ci if (ret) 7818c2ecf20Sopenharmony_ci dev_err(&pdev->dev, "Failed to register reset controller\n"); 7828c2ecf20Sopenharmony_ci 7838c2ecf20Sopenharmony_ci return owl_clk_probe(&pdev->dev, desc->hw_clks); 7848c2ecf20Sopenharmony_ci} 7858c2ecf20Sopenharmony_ci 7868c2ecf20Sopenharmony_cistatic const struct of_device_id s900_clk_of_match[] = { 7878c2ecf20Sopenharmony_ci { .compatible = "actions,s900-cmu", }, 7888c2ecf20Sopenharmony_ci { /* sentinel */ } 7898c2ecf20Sopenharmony_ci}; 7908c2ecf20Sopenharmony_ci 7918c2ecf20Sopenharmony_cistatic struct platform_driver s900_clk_driver = { 7928c2ecf20Sopenharmony_ci .probe = s900_clk_probe, 7938c2ecf20Sopenharmony_ci .driver = { 7948c2ecf20Sopenharmony_ci .name = "s900-cmu", 7958c2ecf20Sopenharmony_ci .of_match_table = s900_clk_of_match, 7968c2ecf20Sopenharmony_ci }, 7978c2ecf20Sopenharmony_ci}; 7988c2ecf20Sopenharmony_ci 7998c2ecf20Sopenharmony_cistatic int __init s900_clk_init(void) 8008c2ecf20Sopenharmony_ci{ 8018c2ecf20Sopenharmony_ci return platform_driver_register(&s900_clk_driver); 8028c2ecf20Sopenharmony_ci} 8038c2ecf20Sopenharmony_cicore_initcall(s900_clk_init); 804