182b0f4b7SLee Jones /* 282b0f4b7SLee Jones * Clock definitions for u8500 platform. 382b0f4b7SLee Jones * 482b0f4b7SLee Jones * Copyright (C) 2012 ST-Ericsson SA 582b0f4b7SLee Jones * Author: Ulf Hansson <ulf.hansson@linaro.org> 682b0f4b7SLee Jones * 782b0f4b7SLee Jones * License terms: GNU General Public License (GPL) version 2 882b0f4b7SLee Jones */ 982b0f4b7SLee Jones 10dec759d8SLee Jones #include <linux/of.h> 1182b0f4b7SLee Jones #include <linux/clk.h> 1282b0f4b7SLee Jones #include <linux/clkdev.h> 1382b0f4b7SLee Jones #include <linux/clk-provider.h> 1482b0f4b7SLee Jones #include <linux/mfd/dbx500-prcmu.h> 1582b0f4b7SLee Jones #include <linux/platform_data/clk-ux500.h> 1682b0f4b7SLee Jones #include "clk.h" 1782b0f4b7SLee Jones 18*b4bdc81bSLee Jones #define PRCC_SHOW(clk, base, bit) \ 19*b4bdc81bSLee Jones clk[(base * PRCC_PERIPHS_PER_CLUSTER) + bit] 20*b4bdc81bSLee Jones 21*b4bdc81bSLee Jones struct clk *ux500_twocell_get(struct of_phandle_args *clkspec, void *data) 22*b4bdc81bSLee Jones { 23*b4bdc81bSLee Jones struct clk **clk_data = data; 24*b4bdc81bSLee Jones unsigned int base, bit; 25*b4bdc81bSLee Jones 26*b4bdc81bSLee Jones if (clkspec->args_count != 2) 27*b4bdc81bSLee Jones return ERR_PTR(-EINVAL); 28*b4bdc81bSLee Jones 29*b4bdc81bSLee Jones base = clkspec->args[0]; 30*b4bdc81bSLee Jones bit = clkspec->args[1]; 31*b4bdc81bSLee Jones 32*b4bdc81bSLee Jones if (base != 1 && base != 2 && base != 3 && base != 5 && base != 6) { 33*b4bdc81bSLee Jones pr_err("%s: invalid PRCC base %d\n", __func__, base); 34*b4bdc81bSLee Jones return ERR_PTR(-EINVAL); 35*b4bdc81bSLee Jones } 36*b4bdc81bSLee Jones 37*b4bdc81bSLee Jones return PRCC_SHOW(clk_data, base, bit); 38*b4bdc81bSLee Jones } 39*b4bdc81bSLee Jones 40dec759d8SLee Jones static const struct of_device_id u8500_clk_of_match[] = { 41dec759d8SLee Jones { .compatible = "stericsson,u8500-clks", }, 42dec759d8SLee Jones { }, 43dec759d8SLee Jones }; 44dec759d8SLee Jones 4582b0f4b7SLee Jones void u8500_of_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, 4682b0f4b7SLee Jones u32 clkrst5_base, u32 clkrst6_base) 4782b0f4b7SLee Jones { 4882b0f4b7SLee Jones struct prcmu_fw_version *fw_version; 49dec759d8SLee Jones struct device_node *np = NULL; 50dec759d8SLee Jones struct device_node *child = NULL; 5182b0f4b7SLee Jones const char *sgaclk_parent = NULL; 5282b0f4b7SLee Jones struct clk *clk; 5382b0f4b7SLee Jones 54dec759d8SLee Jones if (of_have_populated_dt()) 55dec759d8SLee Jones np = of_find_matching_node(NULL, u8500_clk_of_match); 56dec759d8SLee Jones if (!np) { 57dec759d8SLee Jones pr_err("Either DT or U8500 Clock node not found\n"); 58dec759d8SLee Jones return; 59dec759d8SLee Jones } 60dec759d8SLee Jones 6182b0f4b7SLee Jones /* Clock sources */ 6282b0f4b7SLee Jones clk = clk_reg_prcmu_gate("soc0_pll", NULL, PRCMU_PLLSOC0, 6382b0f4b7SLee Jones CLK_IS_ROOT|CLK_IGNORE_UNUSED); 6482b0f4b7SLee Jones 6582b0f4b7SLee Jones clk = clk_reg_prcmu_gate("soc1_pll", NULL, PRCMU_PLLSOC1, 6682b0f4b7SLee Jones CLK_IS_ROOT|CLK_IGNORE_UNUSED); 6782b0f4b7SLee Jones 6882b0f4b7SLee Jones clk = clk_reg_prcmu_gate("ddr_pll", NULL, PRCMU_PLLDDR, 6982b0f4b7SLee Jones CLK_IS_ROOT|CLK_IGNORE_UNUSED); 7082b0f4b7SLee Jones 7182b0f4b7SLee Jones /* FIXME: Add sys, ulp and int clocks here. */ 7282b0f4b7SLee Jones 7382b0f4b7SLee Jones clk = clk_register_fixed_rate(NULL, "rtc32k", "NULL", 7482b0f4b7SLee Jones CLK_IS_ROOT|CLK_IGNORE_UNUSED, 7582b0f4b7SLee Jones 32768); 7682b0f4b7SLee Jones 7782b0f4b7SLee Jones /* PRCMU clocks */ 7882b0f4b7SLee Jones fw_version = prcmu_get_fw_version(); 7982b0f4b7SLee Jones if (fw_version != NULL) { 8082b0f4b7SLee Jones switch (fw_version->project) { 8182b0f4b7SLee Jones case PRCMU_FW_PROJECT_U8500_C2: 8282b0f4b7SLee Jones case PRCMU_FW_PROJECT_U8520: 8382b0f4b7SLee Jones case PRCMU_FW_PROJECT_U8420: 8482b0f4b7SLee Jones sgaclk_parent = "soc0_pll"; 8582b0f4b7SLee Jones break; 8682b0f4b7SLee Jones default: 8782b0f4b7SLee Jones break; 8882b0f4b7SLee Jones } 8982b0f4b7SLee Jones } 9082b0f4b7SLee Jones 9182b0f4b7SLee Jones if (sgaclk_parent) 9282b0f4b7SLee Jones clk = clk_reg_prcmu_gate("sgclk", sgaclk_parent, 9382b0f4b7SLee Jones PRCMU_SGACLK, 0); 9482b0f4b7SLee Jones else 9582b0f4b7SLee Jones clk = clk_reg_prcmu_gate("sgclk", NULL, 9682b0f4b7SLee Jones PRCMU_SGACLK, CLK_IS_ROOT); 9782b0f4b7SLee Jones 9882b0f4b7SLee Jones clk = clk_reg_prcmu_gate("uartclk", NULL, PRCMU_UARTCLK, CLK_IS_ROOT); 9982b0f4b7SLee Jones 10082b0f4b7SLee Jones clk = clk_reg_prcmu_gate("msp02clk", NULL, PRCMU_MSP02CLK, CLK_IS_ROOT); 10182b0f4b7SLee Jones 10282b0f4b7SLee Jones clk = clk_reg_prcmu_gate("msp1clk", NULL, PRCMU_MSP1CLK, CLK_IS_ROOT); 10382b0f4b7SLee Jones 10482b0f4b7SLee Jones clk = clk_reg_prcmu_gate("i2cclk", NULL, PRCMU_I2CCLK, CLK_IS_ROOT); 10582b0f4b7SLee Jones 10682b0f4b7SLee Jones clk = clk_reg_prcmu_gate("slimclk", NULL, PRCMU_SLIMCLK, CLK_IS_ROOT); 10782b0f4b7SLee Jones 10882b0f4b7SLee Jones clk = clk_reg_prcmu_gate("per1clk", NULL, PRCMU_PER1CLK, CLK_IS_ROOT); 10982b0f4b7SLee Jones 11082b0f4b7SLee Jones clk = clk_reg_prcmu_gate("per2clk", NULL, PRCMU_PER2CLK, CLK_IS_ROOT); 11182b0f4b7SLee Jones 11282b0f4b7SLee Jones clk = clk_reg_prcmu_gate("per3clk", NULL, PRCMU_PER3CLK, CLK_IS_ROOT); 11382b0f4b7SLee Jones 11482b0f4b7SLee Jones clk = clk_reg_prcmu_gate("per5clk", NULL, PRCMU_PER5CLK, CLK_IS_ROOT); 11582b0f4b7SLee Jones 11682b0f4b7SLee Jones clk = clk_reg_prcmu_gate("per6clk", NULL, PRCMU_PER6CLK, CLK_IS_ROOT); 11782b0f4b7SLee Jones 11882b0f4b7SLee Jones clk = clk_reg_prcmu_gate("per7clk", NULL, PRCMU_PER7CLK, CLK_IS_ROOT); 11982b0f4b7SLee Jones 12082b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("lcdclk", NULL, PRCMU_LCDCLK, 0, 12182b0f4b7SLee Jones CLK_IS_ROOT|CLK_SET_RATE_GATE); 12282b0f4b7SLee Jones 12382b0f4b7SLee Jones clk = clk_reg_prcmu_opp_gate("bmlclk", NULL, PRCMU_BMLCLK, CLK_IS_ROOT); 12482b0f4b7SLee Jones 12582b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("hsitxclk", NULL, PRCMU_HSITXCLK, 0, 12682b0f4b7SLee Jones CLK_IS_ROOT|CLK_SET_RATE_GATE); 12782b0f4b7SLee Jones 12882b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("hsirxclk", NULL, PRCMU_HSIRXCLK, 0, 12982b0f4b7SLee Jones CLK_IS_ROOT|CLK_SET_RATE_GATE); 13082b0f4b7SLee Jones 13182b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("hdmiclk", NULL, PRCMU_HDMICLK, 0, 13282b0f4b7SLee Jones CLK_IS_ROOT|CLK_SET_RATE_GATE); 13382b0f4b7SLee Jones 13482b0f4b7SLee Jones clk = clk_reg_prcmu_gate("apeatclk", NULL, PRCMU_APEATCLK, CLK_IS_ROOT); 13582b0f4b7SLee Jones 13682b0f4b7SLee Jones clk = clk_reg_prcmu_gate("apetraceclk", NULL, PRCMU_APETRACECLK, 13782b0f4b7SLee Jones CLK_IS_ROOT); 13882b0f4b7SLee Jones 13982b0f4b7SLee Jones clk = clk_reg_prcmu_gate("mcdeclk", NULL, PRCMU_MCDECLK, CLK_IS_ROOT); 14082b0f4b7SLee Jones 14182b0f4b7SLee Jones clk = clk_reg_prcmu_opp_gate("ipi2cclk", NULL, PRCMU_IPI2CCLK, 14282b0f4b7SLee Jones CLK_IS_ROOT); 14382b0f4b7SLee Jones 14482b0f4b7SLee Jones clk = clk_reg_prcmu_gate("dsialtclk", NULL, PRCMU_DSIALTCLK, 14582b0f4b7SLee Jones CLK_IS_ROOT); 14682b0f4b7SLee Jones 14782b0f4b7SLee Jones clk = clk_reg_prcmu_gate("dmaclk", NULL, PRCMU_DMACLK, CLK_IS_ROOT); 14882b0f4b7SLee Jones 14982b0f4b7SLee Jones clk = clk_reg_prcmu_gate("b2r2clk", NULL, PRCMU_B2R2CLK, CLK_IS_ROOT); 15082b0f4b7SLee Jones 15182b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("tvclk", NULL, PRCMU_TVCLK, 0, 15282b0f4b7SLee Jones CLK_IS_ROOT|CLK_SET_RATE_GATE); 15382b0f4b7SLee Jones 15482b0f4b7SLee Jones clk = clk_reg_prcmu_gate("sspclk", NULL, PRCMU_SSPCLK, CLK_IS_ROOT); 15582b0f4b7SLee Jones 15682b0f4b7SLee Jones clk = clk_reg_prcmu_gate("rngclk", NULL, PRCMU_RNGCLK, CLK_IS_ROOT); 15782b0f4b7SLee Jones 15882b0f4b7SLee Jones clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT); 15982b0f4b7SLee Jones 16082b0f4b7SLee Jones clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT); 16182b0f4b7SLee Jones 16282b0f4b7SLee Jones clk = clk_reg_prcmu_opp_volt_scalable("sdmmcclk", NULL, PRCMU_SDMMCCLK, 16382b0f4b7SLee Jones 100000000, 16482b0f4b7SLee Jones CLK_IS_ROOT|CLK_SET_RATE_GATE); 16582b0f4b7SLee Jones 16682b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("dsi_pll", "hdmiclk", 16782b0f4b7SLee Jones PRCMU_PLLDSI, 0, CLK_SET_RATE_GATE); 16882b0f4b7SLee Jones 16982b0f4b7SLee Jones 17082b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("dsi0clk", "dsi_pll", 17182b0f4b7SLee Jones PRCMU_DSI0CLK, 0, CLK_SET_RATE_GATE); 17282b0f4b7SLee Jones 17382b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("dsi1clk", "dsi_pll", 17482b0f4b7SLee Jones PRCMU_DSI1CLK, 0, CLK_SET_RATE_GATE); 17582b0f4b7SLee Jones 17682b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("dsi0escclk", "tvclk", 17782b0f4b7SLee Jones PRCMU_DSI0ESCCLK, 0, CLK_SET_RATE_GATE); 17882b0f4b7SLee Jones 17982b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("dsi1escclk", "tvclk", 18082b0f4b7SLee Jones PRCMU_DSI1ESCCLK, 0, CLK_SET_RATE_GATE); 18182b0f4b7SLee Jones 18282b0f4b7SLee Jones clk = clk_reg_prcmu_scalable("dsi2escclk", "tvclk", 18382b0f4b7SLee Jones PRCMU_DSI2ESCCLK, 0, CLK_SET_RATE_GATE); 18482b0f4b7SLee Jones 18582b0f4b7SLee Jones clk = clk_reg_prcmu_scalable_rate("armss", NULL, 18682b0f4b7SLee Jones PRCMU_ARMSS, 0, CLK_IS_ROOT|CLK_IGNORE_UNUSED); 18782b0f4b7SLee Jones 18882b0f4b7SLee Jones clk = clk_register_fixed_factor(NULL, "smp_twd", "armss", 18982b0f4b7SLee Jones CLK_IGNORE_UNUSED, 1, 2); 19082b0f4b7SLee Jones 19182b0f4b7SLee Jones /* 19282b0f4b7SLee Jones * FIXME: Add special handled PRCMU clocks here: 19382b0f4b7SLee Jones * 1. clkout0yuv, use PRCMU as parent + need regulator + pinctrl. 19482b0f4b7SLee Jones * 2. ab9540_clkout1yuv, see clkout0yuv 19582b0f4b7SLee Jones */ 19682b0f4b7SLee Jones 19782b0f4b7SLee Jones /* PRCC P-clocks */ 19882b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk0", "per1clk", clkrst1_base, 19982b0f4b7SLee Jones BIT(0), 0); 20082b0f4b7SLee Jones 20182b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk1", "per1clk", clkrst1_base, 20282b0f4b7SLee Jones BIT(1), 0); 20382b0f4b7SLee Jones 20482b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", clkrst1_base, 20582b0f4b7SLee Jones BIT(2), 0); 20682b0f4b7SLee Jones 20782b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", clkrst1_base, 20882b0f4b7SLee Jones BIT(3), 0); 20982b0f4b7SLee Jones 21082b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", clkrst1_base, 21182b0f4b7SLee Jones BIT(4), 0); 21282b0f4b7SLee Jones 21382b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", clkrst1_base, 21482b0f4b7SLee Jones BIT(5), 0); 21582b0f4b7SLee Jones 21682b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", clkrst1_base, 21782b0f4b7SLee Jones BIT(6), 0); 21882b0f4b7SLee Jones 21982b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", clkrst1_base, 22082b0f4b7SLee Jones BIT(7), 0); 22182b0f4b7SLee Jones 22282b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", clkrst1_base, 22382b0f4b7SLee Jones BIT(8), 0); 22482b0f4b7SLee Jones 22582b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", clkrst1_base, 22682b0f4b7SLee Jones BIT(9), 0); 22782b0f4b7SLee Jones 22882b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", clkrst1_base, 22982b0f4b7SLee Jones BIT(10), 0); 23082b0f4b7SLee Jones 23182b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", clkrst1_base, 23282b0f4b7SLee Jones BIT(11), 0); 23382b0f4b7SLee Jones 23482b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", clkrst2_base, 23582b0f4b7SLee Jones BIT(0), 0); 23682b0f4b7SLee Jones 23782b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", clkrst2_base, 23882b0f4b7SLee Jones BIT(1), 0); 23982b0f4b7SLee Jones 24082b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk2", "per2clk", clkrst2_base, 24182b0f4b7SLee Jones BIT(2), 0); 24282b0f4b7SLee Jones 24382b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk3", "per2clk", clkrst2_base, 24482b0f4b7SLee Jones BIT(3), 0); 24582b0f4b7SLee Jones 24682b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk4", "per2clk", clkrst2_base, 24782b0f4b7SLee Jones BIT(4), 0); 24882b0f4b7SLee Jones 24982b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", clkrst2_base, 25082b0f4b7SLee Jones BIT(5), 0); 25182b0f4b7SLee Jones 25282b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", clkrst2_base, 25382b0f4b7SLee Jones BIT(6), 0); 25482b0f4b7SLee Jones 25582b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", clkrst2_base, 25682b0f4b7SLee Jones BIT(7), 0); 25782b0f4b7SLee Jones 25882b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk8", "per2clk", clkrst2_base, 25982b0f4b7SLee Jones BIT(8), 0); 26082b0f4b7SLee Jones 26182b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk9", "per2clk", clkrst2_base, 26282b0f4b7SLee Jones BIT(9), 0); 26382b0f4b7SLee Jones 26482b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk10", "per2clk", clkrst2_base, 26582b0f4b7SLee Jones BIT(10), 0); 26682b0f4b7SLee Jones 26782b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk11", "per2clk", clkrst2_base, 26882b0f4b7SLee Jones BIT(11), 0); 26982b0f4b7SLee Jones 27082b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", clkrst2_base, 27182b0f4b7SLee Jones BIT(12), 0); 27282b0f4b7SLee Jones 27382b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", clkrst3_base, 27482b0f4b7SLee Jones BIT(0), 0); 27582b0f4b7SLee Jones 27682b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", clkrst3_base, 27782b0f4b7SLee Jones BIT(1), 0); 27882b0f4b7SLee Jones 27982b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", clkrst3_base, 28082b0f4b7SLee Jones BIT(2), 0); 28182b0f4b7SLee Jones 28282b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", clkrst3_base, 28382b0f4b7SLee Jones BIT(3), 0); 28482b0f4b7SLee Jones 28582b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", clkrst3_base, 28682b0f4b7SLee Jones BIT(4), 0); 28782b0f4b7SLee Jones 28882b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk5", "per3clk", clkrst3_base, 28982b0f4b7SLee Jones BIT(5), 0); 29082b0f4b7SLee Jones 29182b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk6", "per3clk", clkrst3_base, 29282b0f4b7SLee Jones BIT(6), 0); 29382b0f4b7SLee Jones 29482b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk7", "per3clk", clkrst3_base, 29582b0f4b7SLee Jones BIT(7), 0); 29682b0f4b7SLee Jones 29782b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p3_pclk8", "per3clk", clkrst3_base, 29882b0f4b7SLee Jones BIT(8), 0); 29982b0f4b7SLee Jones 30082b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p5_pclk0", "per5clk", clkrst5_base, 30182b0f4b7SLee Jones BIT(0), 0); 30282b0f4b7SLee Jones 30382b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p5_pclk1", "per5clk", clkrst5_base, 30482b0f4b7SLee Jones BIT(1), 0); 30582b0f4b7SLee Jones 30682b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk0", "per6clk", clkrst6_base, 30782b0f4b7SLee Jones BIT(0), 0); 30882b0f4b7SLee Jones 30982b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk1", "per6clk", clkrst6_base, 31082b0f4b7SLee Jones BIT(1), 0); 31182b0f4b7SLee Jones 31282b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk2", "per6clk", clkrst6_base, 31382b0f4b7SLee Jones BIT(2), 0); 31482b0f4b7SLee Jones 31582b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk3", "per6clk", clkrst6_base, 31682b0f4b7SLee Jones BIT(3), 0); 31782b0f4b7SLee Jones 31882b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk4", "per6clk", clkrst6_base, 31982b0f4b7SLee Jones BIT(4), 0); 32082b0f4b7SLee Jones 32182b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk5", "per6clk", clkrst6_base, 32282b0f4b7SLee Jones BIT(5), 0); 32382b0f4b7SLee Jones 32482b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", clkrst6_base, 32582b0f4b7SLee Jones BIT(6), 0); 32682b0f4b7SLee Jones 32782b0f4b7SLee Jones clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", clkrst6_base, 32882b0f4b7SLee Jones BIT(7), 0); 32982b0f4b7SLee Jones 33082b0f4b7SLee Jones /* PRCC K-clocks 33182b0f4b7SLee Jones * 33282b0f4b7SLee Jones * FIXME: Some drivers requires PERPIH[n| to be automatically enabled 33382b0f4b7SLee Jones * by enabling just the K-clock, even if it is not a valid parent to 33482b0f4b7SLee Jones * the K-clock. Until drivers get fixed we might need some kind of 33582b0f4b7SLee Jones * "parent muxed join". 33682b0f4b7SLee Jones */ 33782b0f4b7SLee Jones 33882b0f4b7SLee Jones /* Periph1 */ 33982b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_uart0_kclk", "uartclk", 34082b0f4b7SLee Jones clkrst1_base, BIT(0), CLK_SET_RATE_GATE); 34182b0f4b7SLee Jones 34282b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_uart1_kclk", "uartclk", 34382b0f4b7SLee Jones clkrst1_base, BIT(1), CLK_SET_RATE_GATE); 34482b0f4b7SLee Jones 34582b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk", 34682b0f4b7SLee Jones clkrst1_base, BIT(2), CLK_SET_RATE_GATE); 34782b0f4b7SLee Jones 34882b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk", 34982b0f4b7SLee Jones clkrst1_base, BIT(3), CLK_SET_RATE_GATE); 35082b0f4b7SLee Jones 35182b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk", 35282b0f4b7SLee Jones clkrst1_base, BIT(4), CLK_SET_RATE_GATE); 35382b0f4b7SLee Jones 35482b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk", 35582b0f4b7SLee Jones clkrst1_base, BIT(5), CLK_SET_RATE_GATE); 35682b0f4b7SLee Jones 35782b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk", 35882b0f4b7SLee Jones clkrst1_base, BIT(6), CLK_SET_RATE_GATE); 35982b0f4b7SLee Jones 36082b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk", 36182b0f4b7SLee Jones clkrst1_base, BIT(8), CLK_SET_RATE_GATE); 36282b0f4b7SLee Jones 36382b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk", 36482b0f4b7SLee Jones clkrst1_base, BIT(9), CLK_SET_RATE_GATE); 36582b0f4b7SLee Jones 36682b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk", 36782b0f4b7SLee Jones clkrst1_base, BIT(10), CLK_SET_RATE_GATE); 36882b0f4b7SLee Jones 36982b0f4b7SLee Jones /* Periph2 */ 37082b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk", 37182b0f4b7SLee Jones clkrst2_base, BIT(0), CLK_SET_RATE_GATE); 37282b0f4b7SLee Jones 37382b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk", 37482b0f4b7SLee Jones clkrst2_base, BIT(2), CLK_SET_RATE_GATE); 37582b0f4b7SLee Jones 37682b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk", 37782b0f4b7SLee Jones clkrst2_base, BIT(3), CLK_SET_RATE_GATE); 37882b0f4b7SLee Jones 37982b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk", 38082b0f4b7SLee Jones clkrst2_base, BIT(4), CLK_SET_RATE_GATE); 38182b0f4b7SLee Jones 38282b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p2_sdi3_kclk", "sdmmcclk", 38382b0f4b7SLee Jones clkrst2_base, BIT(5), CLK_SET_RATE_GATE); 38482b0f4b7SLee Jones 38582b0f4b7SLee Jones /* Note that rate is received from parent. */ 38682b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p2_ssirx_kclk", "hsirxclk", 38782b0f4b7SLee Jones clkrst2_base, BIT(6), 38882b0f4b7SLee Jones CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT); 38982b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p2_ssitx_kclk", "hsitxclk", 39082b0f4b7SLee Jones clkrst2_base, BIT(7), 39182b0f4b7SLee Jones CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT); 39282b0f4b7SLee Jones 39382b0f4b7SLee Jones /* Periph3 */ 39482b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk", 39582b0f4b7SLee Jones clkrst3_base, BIT(1), CLK_SET_RATE_GATE); 39682b0f4b7SLee Jones 39782b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk", 39882b0f4b7SLee Jones clkrst3_base, BIT(2), CLK_SET_RATE_GATE); 39982b0f4b7SLee Jones 40082b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk", 40182b0f4b7SLee Jones clkrst3_base, BIT(3), CLK_SET_RATE_GATE); 40282b0f4b7SLee Jones 40382b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk", 40482b0f4b7SLee Jones clkrst3_base, BIT(4), CLK_SET_RATE_GATE); 40582b0f4b7SLee Jones 40682b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_ske_kclk", "rtc32k", 40782b0f4b7SLee Jones clkrst3_base, BIT(5), CLK_SET_RATE_GATE); 40882b0f4b7SLee Jones 40982b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_uart2_kclk", "uartclk", 41082b0f4b7SLee Jones clkrst3_base, BIT(6), CLK_SET_RATE_GATE); 41182b0f4b7SLee Jones 41282b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_sdi5_kclk", "sdmmcclk", 41382b0f4b7SLee Jones clkrst3_base, BIT(7), CLK_SET_RATE_GATE); 41482b0f4b7SLee Jones 41582b0f4b7SLee Jones /* Periph6 */ 41682b0f4b7SLee Jones clk = clk_reg_prcc_kclk("p3_rng_kclk", "rngclk", 41782b0f4b7SLee Jones clkrst6_base, BIT(0), CLK_SET_RATE_GATE); 418dec759d8SLee Jones 419dec759d8SLee Jones for_each_child_of_node(np, child) { 420dec759d8SLee Jones /* Place holder for supported nodes. */ 421dec759d8SLee Jones } 42282b0f4b7SLee Jones } 423