12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727 |
- /*
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
- * Copyright (c) BayLibre, SAS.
- * Author : Neil Armstrong <narmstrong@baylibre.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
- #include <linux/kernel.h>
- #include <linux/bitops.h>
- #include <linux/err.h>
- #include <linux/platform_device.h>
- #include <linux/module.h>
- #include <linux/of.h>
- #include <linux/of_device.h>
- #include <linux/clk-provider.h>
- #include <linux/regmap.h>
- #include <linux/reset-controller.h>
- #include <dt-bindings/clock/qcom,gcc-mdm9615.h>
- #include <dt-bindings/reset/qcom,gcc-mdm9615.h>
- #include "common.h"
- #include "clk-regmap.h"
- #include "clk-pll.h"
- #include "clk-rcg.h"
- #include "clk-branch.h"
- #include "reset.h"
- static struct clk_fixed_factor cxo = {
- .mult = 1,
- .div = 1,
- .hw.init = &(struct clk_init_data){
- .name = "cxo",
- .parent_names = (const char *[]){ "cxo_board" },
- .num_parents = 1,
- .ops = &clk_fixed_factor_ops,
- },
- };
- static struct clk_pll pll0 = {
- .l_reg = 0x30c4,
- .m_reg = 0x30c8,
- .n_reg = 0x30cc,
- .config_reg = 0x30d4,
- .mode_reg = 0x30c0,
- .status_reg = 0x30d8,
- .status_bit = 16,
- .clkr.hw.init = &(struct clk_init_data){
- .name = "pll0",
- .parent_names = (const char *[]){ "cxo" },
- .num_parents = 1,
- .ops = &clk_pll_ops,
- },
- };
- static struct clk_regmap pll0_vote = {
- .enable_reg = 0x34c0,
- .enable_mask = BIT(0),
- .hw.init = &(struct clk_init_data){
- .name = "pll0_vote",
- .parent_names = (const char *[]){ "pll8" },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- };
- static struct clk_regmap pll4_vote = {
- .enable_reg = 0x34c0,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "pll4_vote",
- .parent_names = (const char *[]){ "pll4" },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- };
- static struct clk_pll pll8 = {
- .l_reg = 0x3144,
- .m_reg = 0x3148,
- .n_reg = 0x314c,
- .config_reg = 0x3154,
- .mode_reg = 0x3140,
- .status_reg = 0x3158,
- .status_bit = 16,
- .clkr.hw.init = &(struct clk_init_data){
- .name = "pll8",
- .parent_names = (const char *[]){ "cxo" },
- .num_parents = 1,
- .ops = &clk_pll_ops,
- },
- };
- static struct clk_regmap pll8_vote = {
- .enable_reg = 0x34c0,
- .enable_mask = BIT(8),
- .hw.init = &(struct clk_init_data){
- .name = "pll8_vote",
- .parent_names = (const char *[]){ "pll8" },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- };
- static struct clk_pll pll14 = {
- .l_reg = 0x31c4,
- .m_reg = 0x31c8,
- .n_reg = 0x31cc,
- .config_reg = 0x31d4,
- .mode_reg = 0x31c0,
- .status_reg = 0x31d8,
- .status_bit = 16,
- .clkr.hw.init = &(struct clk_init_data){
- .name = "pll14",
- .parent_names = (const char *[]){ "cxo" },
- .num_parents = 1,
- .ops = &clk_pll_ops,
- },
- };
- static struct clk_regmap pll14_vote = {
- .enable_reg = 0x34c0,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "pll14_vote",
- .parent_names = (const char *[]){ "pll14" },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- };
- enum {
- P_CXO,
- P_PLL8,
- P_PLL14,
- };
- static const struct parent_map gcc_cxo_pll8_map[] = {
- { P_CXO, 0 },
- { P_PLL8, 3 }
- };
- static const char * const gcc_cxo_pll8[] = {
- "cxo",
- "pll8_vote",
- };
- static const struct parent_map gcc_cxo_pll14_map[] = {
- { P_CXO, 0 },
- { P_PLL14, 4 }
- };
- static const char * const gcc_cxo_pll14[] = {
- "cxo",
- "pll14_vote",
- };
- static const struct parent_map gcc_cxo_map[] = {
- { P_CXO, 0 },
- };
- static const char * const gcc_cxo[] = {
- "cxo",
- };
- static struct freq_tbl clk_tbl_gsbi_uart[] = {
- { 1843200, P_PLL8, 2, 6, 625 },
- { 3686400, P_PLL8, 2, 12, 625 },
- { 7372800, P_PLL8, 2, 24, 625 },
- { 14745600, P_PLL8, 2, 48, 625 },
- { 16000000, P_PLL8, 4, 1, 6 },
- { 24000000, P_PLL8, 4, 1, 4 },
- { 32000000, P_PLL8, 4, 1, 3 },
- { 40000000, P_PLL8, 1, 5, 48 },
- { 46400000, P_PLL8, 1, 29, 240 },
- { 48000000, P_PLL8, 4, 1, 2 },
- { 51200000, P_PLL8, 1, 2, 15 },
- { 56000000, P_PLL8, 1, 7, 48 },
- { 58982400, P_PLL8, 1, 96, 625 },
- { 64000000, P_PLL8, 2, 1, 3 },
- { }
- };
- static struct clk_rcg gsbi1_uart_src = {
- .ns_reg = 0x29d4,
- .md_reg = 0x29d0,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 16,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_uart,
- .clkr = {
- .enable_reg = 0x29d4,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi1_uart_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi1_uart_clk = {
- .halt_reg = 0x2fcc,
- .halt_bit = 10,
- .clkr = {
- .enable_reg = 0x29d4,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi1_uart_clk",
- .parent_names = (const char *[]){
- "gsbi1_uart_src",
- },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi2_uart_src = {
- .ns_reg = 0x29f4,
- .md_reg = 0x29f0,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 16,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_uart,
- .clkr = {
- .enable_reg = 0x29f4,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi2_uart_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi2_uart_clk = {
- .halt_reg = 0x2fcc,
- .halt_bit = 6,
- .clkr = {
- .enable_reg = 0x29f4,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi2_uart_clk",
- .parent_names = (const char *[]){
- "gsbi2_uart_src",
- },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi3_uart_src = {
- .ns_reg = 0x2a14,
- .md_reg = 0x2a10,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 16,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_uart,
- .clkr = {
- .enable_reg = 0x2a14,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi3_uart_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi3_uart_clk = {
- .halt_reg = 0x2fcc,
- .halt_bit = 2,
- .clkr = {
- .enable_reg = 0x2a14,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi3_uart_clk",
- .parent_names = (const char *[]){
- "gsbi3_uart_src",
- },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi4_uart_src = {
- .ns_reg = 0x2a34,
- .md_reg = 0x2a30,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 16,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_uart,
- .clkr = {
- .enable_reg = 0x2a34,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi4_uart_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi4_uart_clk = {
- .halt_reg = 0x2fd0,
- .halt_bit = 26,
- .clkr = {
- .enable_reg = 0x2a34,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi4_uart_clk",
- .parent_names = (const char *[]){
- "gsbi4_uart_src",
- },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi5_uart_src = {
- .ns_reg = 0x2a54,
- .md_reg = 0x2a50,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 16,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_uart,
- .clkr = {
- .enable_reg = 0x2a54,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi5_uart_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi5_uart_clk = {
- .halt_reg = 0x2fd0,
- .halt_bit = 22,
- .clkr = {
- .enable_reg = 0x2a54,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi5_uart_clk",
- .parent_names = (const char *[]){
- "gsbi5_uart_src",
- },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct freq_tbl clk_tbl_gsbi_qup[] = {
- { 960000, P_CXO, 4, 1, 5 },
- { 4800000, P_CXO, 4, 0, 1 },
- { 9600000, P_CXO, 2, 0, 1 },
- { 15060000, P_PLL8, 1, 2, 51 },
- { 24000000, P_PLL8, 4, 1, 4 },
- { 25600000, P_PLL8, 1, 1, 15 },
- { 48000000, P_PLL8, 4, 1, 2 },
- { 51200000, P_PLL8, 1, 2, 15 },
- { }
- };
- static struct clk_rcg gsbi1_qup_src = {
- .ns_reg = 0x29cc,
- .md_reg = 0x29c8,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_qup,
- .clkr = {
- .enable_reg = 0x29cc,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi1_qup_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi1_qup_clk = {
- .halt_reg = 0x2fcc,
- .halt_bit = 9,
- .clkr = {
- .enable_reg = 0x29cc,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi1_qup_clk",
- .parent_names = (const char *[]){ "gsbi1_qup_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi2_qup_src = {
- .ns_reg = 0x29ec,
- .md_reg = 0x29e8,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_qup,
- .clkr = {
- .enable_reg = 0x29ec,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi2_qup_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi2_qup_clk = {
- .halt_reg = 0x2fcc,
- .halt_bit = 4,
- .clkr = {
- .enable_reg = 0x29ec,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi2_qup_clk",
- .parent_names = (const char *[]){ "gsbi2_qup_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi3_qup_src = {
- .ns_reg = 0x2a0c,
- .md_reg = 0x2a08,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_qup,
- .clkr = {
- .enable_reg = 0x2a0c,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi3_qup_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi3_qup_clk = {
- .halt_reg = 0x2fcc,
- .halt_bit = 0,
- .clkr = {
- .enable_reg = 0x2a0c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi3_qup_clk",
- .parent_names = (const char *[]){ "gsbi3_qup_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi4_qup_src = {
- .ns_reg = 0x2a2c,
- .md_reg = 0x2a28,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_qup,
- .clkr = {
- .enable_reg = 0x2a2c,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi4_qup_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi4_qup_clk = {
- .halt_reg = 0x2fd0,
- .halt_bit = 24,
- .clkr = {
- .enable_reg = 0x2a2c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi4_qup_clk",
- .parent_names = (const char *[]){ "gsbi4_qup_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gsbi5_qup_src = {
- .ns_reg = 0x2a4c,
- .md_reg = 0x2a48,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_gsbi_qup,
- .clkr = {
- .enable_reg = 0x2a4c,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi5_qup_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- },
- };
- static struct clk_branch gsbi5_qup_clk = {
- .halt_reg = 0x2fd0,
- .halt_bit = 20,
- .clkr = {
- .enable_reg = 0x2a4c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi5_qup_clk",
- .parent_names = (const char *[]){ "gsbi5_qup_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static const struct freq_tbl clk_tbl_gp[] = {
- { 9600000, P_CXO, 2, 0, 0 },
- { 19200000, P_CXO, 1, 0, 0 },
- { }
- };
- static struct clk_rcg gp0_src = {
- .ns_reg = 0x2d24,
- .md_reg = 0x2d00,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_map,
- },
- .freq_tbl = clk_tbl_gp,
- .clkr = {
- .enable_reg = 0x2d24,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gp0_src",
- .parent_names = gcc_cxo,
- .num_parents = 1,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_PARENT_GATE,
- },
- }
- };
- static struct clk_branch gp0_clk = {
- .halt_reg = 0x2fd8,
- .halt_bit = 7,
- .clkr = {
- .enable_reg = 0x2d24,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gp0_clk",
- .parent_names = (const char *[]){ "gp0_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gp1_src = {
- .ns_reg = 0x2d44,
- .md_reg = 0x2d40,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_map,
- },
- .freq_tbl = clk_tbl_gp,
- .clkr = {
- .enable_reg = 0x2d44,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gp1_src",
- .parent_names = gcc_cxo,
- .num_parents = 1,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch gp1_clk = {
- .halt_reg = 0x2fd8,
- .halt_bit = 6,
- .clkr = {
- .enable_reg = 0x2d44,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gp1_clk",
- .parent_names = (const char *[]){ "gp1_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg gp2_src = {
- .ns_reg = 0x2d64,
- .md_reg = 0x2d60,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_map,
- },
- .freq_tbl = clk_tbl_gp,
- .clkr = {
- .enable_reg = 0x2d64,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "gp2_src",
- .parent_names = gcc_cxo,
- .num_parents = 1,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch gp2_clk = {
- .halt_reg = 0x2fd8,
- .halt_bit = 5,
- .clkr = {
- .enable_reg = 0x2d64,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "gp2_clk",
- .parent_names = (const char *[]){ "gp2_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_branch pmem_clk = {
- .hwcg_reg = 0x25a0,
- .hwcg_bit = 6,
- .halt_reg = 0x2fc8,
- .halt_bit = 20,
- .clkr = {
- .enable_reg = 0x25a0,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "pmem_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_rcg prng_src = {
- .ns_reg = 0x2e80,
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 4,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .clkr = {
- .hw.init = &(struct clk_init_data){
- .name = "prng_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_branch prng_clk = {
- .halt_reg = 0x2fd8,
- .halt_check = BRANCH_HALT_VOTED,
- .halt_bit = 10,
- .clkr = {
- .enable_reg = 0x3080,
- .enable_mask = BIT(10),
- .hw.init = &(struct clk_init_data){
- .name = "prng_clk",
- .parent_names = (const char *[]){ "prng_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- },
- },
- };
- static const struct freq_tbl clk_tbl_sdc[] = {
- { 144000, P_CXO, 1, 1, 133 },
- { 400000, P_PLL8, 4, 1, 240 },
- { 16000000, P_PLL8, 4, 1, 6 },
- { 17070000, P_PLL8, 1, 2, 45 },
- { 20210000, P_PLL8, 1, 1, 19 },
- { 24000000, P_PLL8, 4, 1, 4 },
- { 38400000, P_PLL8, 2, 1, 5 },
- { 48000000, P_PLL8, 4, 1, 2 },
- { 64000000, P_PLL8, 3, 1, 2 },
- { 76800000, P_PLL8, 1, 1, 5 },
- { }
- };
- static struct clk_rcg sdc1_src = {
- .ns_reg = 0x282c,
- .md_reg = 0x2828,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_sdc,
- .clkr = {
- .enable_reg = 0x282c,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "sdc1_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch sdc1_clk = {
- .halt_reg = 0x2fc8,
- .halt_bit = 6,
- .clkr = {
- .enable_reg = 0x282c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "sdc1_clk",
- .parent_names = (const char *[]){ "sdc1_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg sdc2_src = {
- .ns_reg = 0x284c,
- .md_reg = 0x2848,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_sdc,
- .clkr = {
- .enable_reg = 0x284c,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "sdc2_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch sdc2_clk = {
- .halt_reg = 0x2fc8,
- .halt_bit = 5,
- .clkr = {
- .enable_reg = 0x284c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "sdc2_clk",
- .parent_names = (const char *[]){ "sdc2_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static const struct freq_tbl clk_tbl_usb[] = {
- { 60000000, P_PLL8, 1, 5, 32 },
- { }
- };
- static struct clk_rcg usb_hs1_xcvr_src = {
- .ns_reg = 0x290c,
- .md_reg = 0x2908,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_usb,
- .clkr = {
- .enable_reg = 0x290c,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs1_xcvr_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch usb_hs1_xcvr_clk = {
- .halt_reg = 0x2fc8,
- .halt_bit = 0,
- .clkr = {
- .enable_reg = 0x290c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs1_xcvr_clk",
- .parent_names = (const char *[]){ "usb_hs1_xcvr_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_rcg usb_hsic_xcvr_fs_src = {
- .ns_reg = 0x2928,
- .md_reg = 0x2924,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_usb,
- .clkr = {
- .enable_reg = 0x2928,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hsic_xcvr_fs_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch usb_hsic_xcvr_fs_clk = {
- .halt_reg = 0x2fc8,
- .halt_bit = 9,
- .clkr = {
- .enable_reg = 0x2928,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hsic_xcvr_fs_clk",
- .parent_names =
- (const char *[]){ "usb_hsic_xcvr_fs_src" },
- .num_parents = 1,
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static const struct freq_tbl clk_tbl_usb_hs1_system[] = {
- { 60000000, P_PLL8, 1, 5, 32 },
- { }
- };
- static struct clk_rcg usb_hs1_system_src = {
- .ns_reg = 0x36a4,
- .md_reg = 0x36a0,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_usb_hs1_system,
- .clkr = {
- .enable_reg = 0x36a4,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs1_system_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch usb_hs1_system_clk = {
- .halt_reg = 0x2fc8,
- .halt_bit = 4,
- .clkr = {
- .enable_reg = 0x36a4,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .parent_names =
- (const char *[]){ "usb_hs1_system_src" },
- .num_parents = 1,
- .name = "usb_hs1_system_clk",
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
- },
- },
- };
- static const struct freq_tbl clk_tbl_usb_hsic_system[] = {
- { 64000000, P_PLL8, 1, 1, 6 },
- { }
- };
- static struct clk_rcg usb_hsic_system_src = {
- .ns_reg = 0x2b58,
- .md_reg = 0x2b54,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll8_map,
- },
- .freq_tbl = clk_tbl_usb_hsic_system,
- .clkr = {
- .enable_reg = 0x2b58,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hsic_system_src",
- .parent_names = gcc_cxo_pll8,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch usb_hsic_system_clk = {
- .halt_reg = 0x2fc8,
- .halt_bit = 7,
- .clkr = {
- .enable_reg = 0x2b58,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .parent_names =
- (const char *[]){ "usb_hsic_system_src" },
- .num_parents = 1,
- .name = "usb_hsic_system_clk",
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static const struct freq_tbl clk_tbl_usb_hsic_hsic[] = {
- { 48000000, P_PLL14, 1, 0, 0 },
- { }
- };
- static struct clk_rcg usb_hsic_hsic_src = {
- .ns_reg = 0x2b50,
- .md_reg = 0x2b4c,
- .mn = {
- .mnctr_en_bit = 8,
- .mnctr_reset_bit = 7,
- .mnctr_mode_shift = 5,
- .n_val_shift = 16,
- .m_val_shift = 16,
- .width = 8,
- },
- .p = {
- .pre_div_shift = 3,
- .pre_div_width = 2,
- },
- .s = {
- .src_sel_shift = 0,
- .parent_map = gcc_cxo_pll14_map,
- },
- .freq_tbl = clk_tbl_usb_hsic_hsic,
- .clkr = {
- .enable_reg = 0x2b50,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hsic_hsic_src",
- .parent_names = gcc_cxo_pll14,
- .num_parents = 2,
- .ops = &clk_rcg_ops,
- .flags = CLK_SET_RATE_GATE,
- },
- }
- };
- static struct clk_branch usb_hsic_hsic_clk = {
- .halt_check = BRANCH_HALT_DELAY,
- .clkr = {
- .enable_reg = 0x2b50,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .parent_names = (const char *[]){ "usb_hsic_hsic_src" },
- .num_parents = 1,
- .name = "usb_hsic_hsic_clk",
- .ops = &clk_branch_ops,
- .flags = CLK_SET_RATE_PARENT,
- },
- },
- };
- static struct clk_branch usb_hsic_hsio_cal_clk = {
- .halt_reg = 0x2fc8,
- .halt_bit = 8,
- .clkr = {
- .enable_reg = 0x2b48,
- .enable_mask = BIT(0),
- .hw.init = &(struct clk_init_data){
- .parent_names = (const char *[]){ "cxo" },
- .num_parents = 1,
- .name = "usb_hsic_hsio_cal_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch ce1_core_clk = {
- .hwcg_reg = 0x2724,
- .hwcg_bit = 6,
- .halt_reg = 0x2fd4,
- .halt_bit = 27,
- .clkr = {
- .enable_reg = 0x2724,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "ce1_core_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch ce1_h_clk = {
- .halt_reg = 0x2fd4,
- .halt_bit = 1,
- .clkr = {
- .enable_reg = 0x2720,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "ce1_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch dma_bam_h_clk = {
- .hwcg_reg = 0x25c0,
- .hwcg_bit = 6,
- .halt_reg = 0x2fc8,
- .halt_bit = 12,
- .clkr = {
- .enable_reg = 0x25c0,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "dma_bam_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch gsbi1_h_clk = {
- .hwcg_reg = 0x29c0,
- .hwcg_bit = 6,
- .halt_reg = 0x2fcc,
- .halt_bit = 11,
- .clkr = {
- .enable_reg = 0x29c0,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi1_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch gsbi2_h_clk = {
- .hwcg_reg = 0x29e0,
- .hwcg_bit = 6,
- .halt_reg = 0x2fcc,
- .halt_bit = 7,
- .clkr = {
- .enable_reg = 0x29e0,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi2_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch gsbi3_h_clk = {
- .hwcg_reg = 0x2a00,
- .hwcg_bit = 6,
- .halt_reg = 0x2fcc,
- .halt_bit = 3,
- .clkr = {
- .enable_reg = 0x2a00,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi3_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch gsbi4_h_clk = {
- .hwcg_reg = 0x2a20,
- .hwcg_bit = 6,
- .halt_reg = 0x2fd0,
- .halt_bit = 27,
- .clkr = {
- .enable_reg = 0x2a20,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi4_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch gsbi5_h_clk = {
- .hwcg_reg = 0x2a40,
- .hwcg_bit = 6,
- .halt_reg = 0x2fd0,
- .halt_bit = 23,
- .clkr = {
- .enable_reg = 0x2a40,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "gsbi5_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch usb_hs1_h_clk = {
- .hwcg_reg = 0x2900,
- .hwcg_bit = 6,
- .halt_reg = 0x2fc8,
- .halt_bit = 1,
- .clkr = {
- .enable_reg = 0x2900,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs1_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch usb_hsic_h_clk = {
- .halt_reg = 0x2fcc,
- .halt_bit = 28,
- .clkr = {
- .enable_reg = 0x2920,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hsic_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch sdc1_h_clk = {
- .hwcg_reg = 0x2820,
- .hwcg_bit = 6,
- .halt_reg = 0x2fc8,
- .halt_bit = 11,
- .clkr = {
- .enable_reg = 0x2820,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "sdc1_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch sdc2_h_clk = {
- .hwcg_reg = 0x2840,
- .hwcg_bit = 6,
- .halt_reg = 0x2fc8,
- .halt_bit = 10,
- .clkr = {
- .enable_reg = 0x2840,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "sdc2_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch adm0_clk = {
- .halt_reg = 0x2fdc,
- .halt_check = BRANCH_HALT_VOTED,
- .halt_bit = 14,
- .clkr = {
- .enable_reg = 0x3080,
- .enable_mask = BIT(2),
- .hw.init = &(struct clk_init_data){
- .name = "adm0_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch adm0_pbus_clk = {
- .hwcg_reg = 0x2208,
- .hwcg_bit = 6,
- .halt_reg = 0x2fdc,
- .halt_check = BRANCH_HALT_VOTED,
- .halt_bit = 13,
- .clkr = {
- .enable_reg = 0x3080,
- .enable_mask = BIT(3),
- .hw.init = &(struct clk_init_data){
- .name = "adm0_pbus_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch pmic_arb0_h_clk = {
- .halt_reg = 0x2fd8,
- .halt_check = BRANCH_HALT_VOTED,
- .halt_bit = 22,
- .clkr = {
- .enable_reg = 0x3080,
- .enable_mask = BIT(8),
- .hw.init = &(struct clk_init_data){
- .name = "pmic_arb0_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch pmic_arb1_h_clk = {
- .halt_reg = 0x2fd8,
- .halt_check = BRANCH_HALT_VOTED,
- .halt_bit = 21,
- .clkr = {
- .enable_reg = 0x3080,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "pmic_arb1_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch pmic_ssbi2_clk = {
- .halt_reg = 0x2fd8,
- .halt_check = BRANCH_HALT_VOTED,
- .halt_bit = 23,
- .clkr = {
- .enable_reg = 0x3080,
- .enable_mask = BIT(7),
- .hw.init = &(struct clk_init_data){
- .name = "pmic_ssbi2_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_branch rpm_msg_ram_h_clk = {
- .hwcg_reg = 0x27e0,
- .hwcg_bit = 6,
- .halt_reg = 0x2fd8,
- .halt_check = BRANCH_HALT_VOTED,
- .halt_bit = 12,
- .clkr = {
- .enable_reg = 0x3080,
- .enable_mask = BIT(6),
- .hw.init = &(struct clk_init_data){
- .name = "rpm_msg_ram_h_clk",
- .ops = &clk_branch_ops,
- },
- },
- };
- static struct clk_hw *gcc_mdm9615_hws[] = {
- &cxo.hw,
- };
- static struct clk_regmap *gcc_mdm9615_clks[] = {
- [PLL0] = &pll0.clkr,
- [PLL0_VOTE] = &pll0_vote,
- [PLL4_VOTE] = &pll4_vote,
- [PLL8] = &pll8.clkr,
- [PLL8_VOTE] = &pll8_vote,
- [PLL14] = &pll14.clkr,
- [PLL14_VOTE] = &pll14_vote,
- [GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
- [GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
- [GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
- [GSBI2_UART_CLK] = &gsbi2_uart_clk.clkr,
- [GSBI3_UART_SRC] = &gsbi3_uart_src.clkr,
- [GSBI3_UART_CLK] = &gsbi3_uart_clk.clkr,
- [GSBI4_UART_SRC] = &gsbi4_uart_src.clkr,
- [GSBI4_UART_CLK] = &gsbi4_uart_clk.clkr,
- [GSBI5_UART_SRC] = &gsbi5_uart_src.clkr,
- [GSBI5_UART_CLK] = &gsbi5_uart_clk.clkr,
- [GSBI1_QUP_SRC] = &gsbi1_qup_src.clkr,
- [GSBI1_QUP_CLK] = &gsbi1_qup_clk.clkr,
- [GSBI2_QUP_SRC] = &gsbi2_qup_src.clkr,
- [GSBI2_QUP_CLK] = &gsbi2_qup_clk.clkr,
- [GSBI3_QUP_SRC] = &gsbi3_qup_src.clkr,
- [GSBI3_QUP_CLK] = &gsbi3_qup_clk.clkr,
- [GSBI4_QUP_SRC] = &gsbi4_qup_src.clkr,
- [GSBI4_QUP_CLK] = &gsbi4_qup_clk.clkr,
- [GSBI5_QUP_SRC] = &gsbi5_qup_src.clkr,
- [GSBI5_QUP_CLK] = &gsbi5_qup_clk.clkr,
- [GP0_SRC] = &gp0_src.clkr,
- [GP0_CLK] = &gp0_clk.clkr,
- [GP1_SRC] = &gp1_src.clkr,
- [GP1_CLK] = &gp1_clk.clkr,
- [GP2_SRC] = &gp2_src.clkr,
- [GP2_CLK] = &gp2_clk.clkr,
- [PMEM_A_CLK] = &pmem_clk.clkr,
- [PRNG_SRC] = &prng_src.clkr,
- [PRNG_CLK] = &prng_clk.clkr,
- [SDC1_SRC] = &sdc1_src.clkr,
- [SDC1_CLK] = &sdc1_clk.clkr,
- [SDC2_SRC] = &sdc2_src.clkr,
- [SDC2_CLK] = &sdc2_clk.clkr,
- [USB_HS1_XCVR_SRC] = &usb_hs1_xcvr_src.clkr,
- [USB_HS1_XCVR_CLK] = &usb_hs1_xcvr_clk.clkr,
- [USB_HS1_SYSTEM_CLK_SRC] = &usb_hs1_system_src.clkr,
- [USB_HS1_SYSTEM_CLK] = &usb_hs1_system_clk.clkr,
- [USB_HSIC_XCVR_FS_SRC] = &usb_hsic_xcvr_fs_src.clkr,
- [USB_HSIC_XCVR_FS_CLK] = &usb_hsic_xcvr_fs_clk.clkr,
- [USB_HSIC_SYSTEM_CLK_SRC] = &usb_hsic_system_src.clkr,
- [USB_HSIC_SYSTEM_CLK] = &usb_hsic_system_clk.clkr,
- [USB_HSIC_HSIC_CLK_SRC] = &usb_hsic_hsic_src.clkr,
- [USB_HSIC_HSIC_CLK] = &usb_hsic_hsic_clk.clkr,
- [USB_HSIC_HSIO_CAL_CLK] = &usb_hsic_hsio_cal_clk.clkr,
- [CE1_CORE_CLK] = &ce1_core_clk.clkr,
- [CE1_H_CLK] = &ce1_h_clk.clkr,
- [DMA_BAM_H_CLK] = &dma_bam_h_clk.clkr,
- [GSBI1_H_CLK] = &gsbi1_h_clk.clkr,
- [GSBI2_H_CLK] = &gsbi2_h_clk.clkr,
- [GSBI3_H_CLK] = &gsbi3_h_clk.clkr,
- [GSBI4_H_CLK] = &gsbi4_h_clk.clkr,
- [GSBI5_H_CLK] = &gsbi5_h_clk.clkr,
- [USB_HS1_H_CLK] = &usb_hs1_h_clk.clkr,
- [USB_HSIC_H_CLK] = &usb_hsic_h_clk.clkr,
- [SDC1_H_CLK] = &sdc1_h_clk.clkr,
- [SDC2_H_CLK] = &sdc2_h_clk.clkr,
- [ADM0_CLK] = &adm0_clk.clkr,
- [ADM0_PBUS_CLK] = &adm0_pbus_clk.clkr,
- [PMIC_ARB0_H_CLK] = &pmic_arb0_h_clk.clkr,
- [PMIC_ARB1_H_CLK] = &pmic_arb1_h_clk.clkr,
- [PMIC_SSBI2_CLK] = &pmic_ssbi2_clk.clkr,
- [RPM_MSG_RAM_H_CLK] = &rpm_msg_ram_h_clk.clkr,
- };
- static const struct qcom_reset_map gcc_mdm9615_resets[] = {
- [DMA_BAM_RESET] = { 0x25c0, 7 },
- [CE1_H_RESET] = { 0x2720, 7 },
- [CE1_CORE_RESET] = { 0x2724, 7 },
- [SDC1_RESET] = { 0x2830 },
- [SDC2_RESET] = { 0x2850 },
- [ADM0_C2_RESET] = { 0x220c, 4 },
- [ADM0_C1_RESET] = { 0x220c, 3 },
- [ADM0_C0_RESET] = { 0x220c, 2 },
- [ADM0_PBUS_RESET] = { 0x220c, 1 },
- [ADM0_RESET] = { 0x220c },
- [USB_HS1_RESET] = { 0x2910 },
- [USB_HSIC_RESET] = { 0x2934 },
- [GSBI1_RESET] = { 0x29dc },
- [GSBI2_RESET] = { 0x29fc },
- [GSBI3_RESET] = { 0x2a1c },
- [GSBI4_RESET] = { 0x2a3c },
- [GSBI5_RESET] = { 0x2a5c },
- [PDM_RESET] = { 0x2CC0, 12 },
- };
- static const struct regmap_config gcc_mdm9615_regmap_config = {
- .reg_bits = 32,
- .reg_stride = 4,
- .val_bits = 32,
- .max_register = 0x3660,
- .fast_io = true,
- };
- static const struct qcom_cc_desc gcc_mdm9615_desc = {
- .config = &gcc_mdm9615_regmap_config,
- .clks = gcc_mdm9615_clks,
- .num_clks = ARRAY_SIZE(gcc_mdm9615_clks),
- .resets = gcc_mdm9615_resets,
- .num_resets = ARRAY_SIZE(gcc_mdm9615_resets),
- };
- static const struct of_device_id gcc_mdm9615_match_table[] = {
- { .compatible = "qcom,gcc-mdm9615" },
- { }
- };
- MODULE_DEVICE_TABLE(of, gcc_mdm9615_match_table);
- static int gcc_mdm9615_probe(struct platform_device *pdev)
- {
- struct device *dev = &pdev->dev;
- struct regmap *regmap;
- int ret;
- int i;
- regmap = qcom_cc_map(pdev, &gcc_mdm9615_desc);
- if (IS_ERR(regmap))
- return PTR_ERR(regmap);
- for (i = 0; i < ARRAY_SIZE(gcc_mdm9615_hws); i++) {
- ret = devm_clk_hw_register(dev, gcc_mdm9615_hws[i]);
- if (ret)
- return ret;
- }
- return qcom_cc_really_probe(pdev, &gcc_mdm9615_desc, regmap);
- }
- static struct platform_driver gcc_mdm9615_driver = {
- .probe = gcc_mdm9615_probe,
- .driver = {
- .name = "gcc-mdm9615",
- .of_match_table = gcc_mdm9615_match_table,
- },
- };
- static int __init gcc_mdm9615_init(void)
- {
- return platform_driver_register(&gcc_mdm9615_driver);
- }
- core_initcall(gcc_mdm9615_init);
- static void __exit gcc_mdm9615_exit(void)
- {
- platform_driver_unregister(&gcc_mdm9615_driver);
- }
- module_exit(gcc_mdm9615_exit);
- MODULE_DESCRIPTION("QCOM GCC MDM9615 Driver");
- MODULE_LICENSE("GPL v2");
- MODULE_ALIAS("platform:gcc-mdm9615");
|