162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 262306a36Sopenharmony_ci// Copyright (C) 2014 Broadcom Corporation 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#include <linux/kernel.h> 562306a36Sopenharmony_ci#include <linux/err.h> 662306a36Sopenharmony_ci#include <linux/clk-provider.h> 762306a36Sopenharmony_ci#include <linux/io.h> 862306a36Sopenharmony_ci#include <linux/of.h> 962306a36Sopenharmony_ci#include <linux/clkdev.h> 1062306a36Sopenharmony_ci#include <linux/of_address.h> 1162306a36Sopenharmony_ci#include <linux/delay.h> 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <dt-bindings/clock/bcm-cygnus.h> 1462306a36Sopenharmony_ci#include "clk-iproc.h" 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#define REG_VAL(o, s, w) { .offset = o, .shift = s, .width = w, } 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci#define AON_VAL(o, pw, ps, is) { .offset = o, .pwr_width = pw, \ 1962306a36Sopenharmony_ci .pwr_shift = ps, .iso_shift = is } 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci#define SW_CTRL_VAL(o, s) { .offset = o, .shift = s, } 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci#define ASIU_DIV_VAL(o, es, hs, hw, ls, lw) \ 2462306a36Sopenharmony_ci { .offset = o, .en_shift = es, .high_shift = hs, \ 2562306a36Sopenharmony_ci .high_width = hw, .low_shift = ls, .low_width = lw } 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define RESET_VAL(o, rs, prs) { .offset = o, .reset_shift = rs, \ 2862306a36Sopenharmony_ci .p_reset_shift = prs } 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#define DF_VAL(o, kis, kiw, kps, kpw, kas, kaw) { .offset = o, .ki_shift = kis,\ 3162306a36Sopenharmony_ci .ki_width = kiw, .kp_shift = kps, .kp_width = kpw, .ka_shift = kas, \ 3262306a36Sopenharmony_ci .ka_width = kaw } 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#define VCO_CTRL_VAL(uo, lo) { .u_offset = uo, .l_offset = lo } 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci#define ENABLE_VAL(o, es, hs, bs) { .offset = o, .enable_shift = es, \ 3762306a36Sopenharmony_ci .hold_shift = hs, .bypass_shift = bs } 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci#define ASIU_GATE_VAL(o, es) { .offset = o, .en_shift = es } 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_cistatic void __init cygnus_armpll_init(struct device_node *node) 4262306a36Sopenharmony_ci{ 4362306a36Sopenharmony_ci iproc_armpll_setup(node); 4462306a36Sopenharmony_ci} 4562306a36Sopenharmony_ciCLK_OF_DECLARE(cygnus_armpll, "brcm,cygnus-armpll", cygnus_armpll_init); 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_cistatic const struct iproc_pll_ctrl genpll = { 4862306a36Sopenharmony_ci .flags = IPROC_CLK_AON | IPROC_CLK_PLL_HAS_NDIV_FRAC | 4962306a36Sopenharmony_ci IPROC_CLK_PLL_NEEDS_SW_CFG, 5062306a36Sopenharmony_ci .aon = AON_VAL(0x0, 2, 1, 0), 5162306a36Sopenharmony_ci .reset = RESET_VAL(0x0, 11, 10), 5262306a36Sopenharmony_ci .dig_filter = DF_VAL(0x0, 4, 3, 0, 4, 7, 3), 5362306a36Sopenharmony_ci .sw_ctrl = SW_CTRL_VAL(0x10, 31), 5462306a36Sopenharmony_ci .ndiv_int = REG_VAL(0x10, 20, 10), 5562306a36Sopenharmony_ci .ndiv_frac = REG_VAL(0x10, 0, 20), 5662306a36Sopenharmony_ci .pdiv = REG_VAL(0x14, 0, 4), 5762306a36Sopenharmony_ci .vco_ctrl = VCO_CTRL_VAL(0x18, 0x1c), 5862306a36Sopenharmony_ci .status = REG_VAL(0x28, 12, 1), 5962306a36Sopenharmony_ci}; 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_cistatic const struct iproc_clk_ctrl genpll_clk[] = { 6262306a36Sopenharmony_ci [BCM_CYGNUS_GENPLL_AXI21_CLK] = { 6362306a36Sopenharmony_ci .channel = BCM_CYGNUS_GENPLL_AXI21_CLK, 6462306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 6562306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 6, 0, 12), 6662306a36Sopenharmony_ci .mdiv = REG_VAL(0x20, 0, 8), 6762306a36Sopenharmony_ci }, 6862306a36Sopenharmony_ci [BCM_CYGNUS_GENPLL_250MHZ_CLK] = { 6962306a36Sopenharmony_ci .channel = BCM_CYGNUS_GENPLL_250MHZ_CLK, 7062306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 7162306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 7, 1, 13), 7262306a36Sopenharmony_ci .mdiv = REG_VAL(0x20, 10, 8), 7362306a36Sopenharmony_ci }, 7462306a36Sopenharmony_ci [BCM_CYGNUS_GENPLL_IHOST_SYS_CLK] = { 7562306a36Sopenharmony_ci .channel = BCM_CYGNUS_GENPLL_IHOST_SYS_CLK, 7662306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 7762306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 8, 2, 14), 7862306a36Sopenharmony_ci .mdiv = REG_VAL(0x20, 20, 8), 7962306a36Sopenharmony_ci }, 8062306a36Sopenharmony_ci [BCM_CYGNUS_GENPLL_ENET_SW_CLK] = { 8162306a36Sopenharmony_ci .channel = BCM_CYGNUS_GENPLL_ENET_SW_CLK, 8262306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 8362306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 9, 3, 15), 8462306a36Sopenharmony_ci .mdiv = REG_VAL(0x24, 0, 8), 8562306a36Sopenharmony_ci }, 8662306a36Sopenharmony_ci [BCM_CYGNUS_GENPLL_AUDIO_125_CLK] = { 8762306a36Sopenharmony_ci .channel = BCM_CYGNUS_GENPLL_AUDIO_125_CLK, 8862306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 8962306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 10, 4, 16), 9062306a36Sopenharmony_ci .mdiv = REG_VAL(0x24, 10, 8), 9162306a36Sopenharmony_ci }, 9262306a36Sopenharmony_ci [BCM_CYGNUS_GENPLL_CAN_CLK] = { 9362306a36Sopenharmony_ci .channel = BCM_CYGNUS_GENPLL_CAN_CLK, 9462306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 9562306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 11, 5, 17), 9662306a36Sopenharmony_ci .mdiv = REG_VAL(0x24, 20, 8), 9762306a36Sopenharmony_ci }, 9862306a36Sopenharmony_ci}; 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_cistatic void __init cygnus_genpll_clk_init(struct device_node *node) 10162306a36Sopenharmony_ci{ 10262306a36Sopenharmony_ci iproc_pll_clk_setup(node, &genpll, NULL, 0, genpll_clk, 10362306a36Sopenharmony_ci ARRAY_SIZE(genpll_clk)); 10462306a36Sopenharmony_ci} 10562306a36Sopenharmony_ciCLK_OF_DECLARE(cygnus_genpll, "brcm,cygnus-genpll", cygnus_genpll_clk_init); 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_cistatic const struct iproc_pll_ctrl lcpll0 = { 10862306a36Sopenharmony_ci .flags = IPROC_CLK_AON | IPROC_CLK_PLL_NEEDS_SW_CFG, 10962306a36Sopenharmony_ci .aon = AON_VAL(0x0, 2, 5, 4), 11062306a36Sopenharmony_ci .reset = RESET_VAL(0x0, 31, 30), 11162306a36Sopenharmony_ci .dig_filter = DF_VAL(0x0, 27, 3, 23, 4, 19, 4), 11262306a36Sopenharmony_ci .sw_ctrl = SW_CTRL_VAL(0x4, 31), 11362306a36Sopenharmony_ci .ndiv_int = REG_VAL(0x4, 16, 10), 11462306a36Sopenharmony_ci .pdiv = REG_VAL(0x4, 26, 4), 11562306a36Sopenharmony_ci .vco_ctrl = VCO_CTRL_VAL(0x10, 0x14), 11662306a36Sopenharmony_ci .status = REG_VAL(0x18, 12, 1), 11762306a36Sopenharmony_ci}; 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_cistatic const struct iproc_clk_ctrl lcpll0_clk[] = { 12062306a36Sopenharmony_ci [BCM_CYGNUS_LCPLL0_PCIE_PHY_REF_CLK] = { 12162306a36Sopenharmony_ci .channel = BCM_CYGNUS_LCPLL0_PCIE_PHY_REF_CLK, 12262306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 12362306a36Sopenharmony_ci .enable = ENABLE_VAL(0x0, 7, 1, 13), 12462306a36Sopenharmony_ci .mdiv = REG_VAL(0x8, 0, 8), 12562306a36Sopenharmony_ci }, 12662306a36Sopenharmony_ci [BCM_CYGNUS_LCPLL0_DDR_PHY_CLK] = { 12762306a36Sopenharmony_ci .channel = BCM_CYGNUS_LCPLL0_DDR_PHY_CLK, 12862306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 12962306a36Sopenharmony_ci .enable = ENABLE_VAL(0x0, 8, 2, 14), 13062306a36Sopenharmony_ci .mdiv = REG_VAL(0x8, 10, 8), 13162306a36Sopenharmony_ci }, 13262306a36Sopenharmony_ci [BCM_CYGNUS_LCPLL0_SDIO_CLK] = { 13362306a36Sopenharmony_ci .channel = BCM_CYGNUS_LCPLL0_SDIO_CLK, 13462306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 13562306a36Sopenharmony_ci .enable = ENABLE_VAL(0x0, 9, 3, 15), 13662306a36Sopenharmony_ci .mdiv = REG_VAL(0x8, 20, 8), 13762306a36Sopenharmony_ci }, 13862306a36Sopenharmony_ci [BCM_CYGNUS_LCPLL0_USB_PHY_REF_CLK] = { 13962306a36Sopenharmony_ci .channel = BCM_CYGNUS_LCPLL0_USB_PHY_REF_CLK, 14062306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 14162306a36Sopenharmony_ci .enable = ENABLE_VAL(0x0, 10, 4, 16), 14262306a36Sopenharmony_ci .mdiv = REG_VAL(0xc, 0, 8), 14362306a36Sopenharmony_ci }, 14462306a36Sopenharmony_ci [BCM_CYGNUS_LCPLL0_SMART_CARD_CLK] = { 14562306a36Sopenharmony_ci .channel = BCM_CYGNUS_LCPLL0_SMART_CARD_CLK, 14662306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 14762306a36Sopenharmony_ci .enable = ENABLE_VAL(0x0, 11, 5, 17), 14862306a36Sopenharmony_ci .mdiv = REG_VAL(0xc, 10, 8), 14962306a36Sopenharmony_ci }, 15062306a36Sopenharmony_ci [BCM_CYGNUS_LCPLL0_CH5_UNUSED] = { 15162306a36Sopenharmony_ci .channel = BCM_CYGNUS_LCPLL0_CH5_UNUSED, 15262306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 15362306a36Sopenharmony_ci .enable = ENABLE_VAL(0x0, 12, 6, 18), 15462306a36Sopenharmony_ci .mdiv = REG_VAL(0xc, 20, 8), 15562306a36Sopenharmony_ci }, 15662306a36Sopenharmony_ci}; 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_cistatic void __init cygnus_lcpll0_clk_init(struct device_node *node) 15962306a36Sopenharmony_ci{ 16062306a36Sopenharmony_ci iproc_pll_clk_setup(node, &lcpll0, NULL, 0, lcpll0_clk, 16162306a36Sopenharmony_ci ARRAY_SIZE(lcpll0_clk)); 16262306a36Sopenharmony_ci} 16362306a36Sopenharmony_ciCLK_OF_DECLARE(cygnus_lcpll0, "brcm,cygnus-lcpll0", cygnus_lcpll0_clk_init); 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci/* 16662306a36Sopenharmony_ci * MIPI PLL VCO frequency parameter table 16762306a36Sopenharmony_ci */ 16862306a36Sopenharmony_cistatic const struct iproc_pll_vco_param mipipll_vco_params[] = { 16962306a36Sopenharmony_ci /* rate (Hz) ndiv_int ndiv_frac pdiv */ 17062306a36Sopenharmony_ci { 750000000UL, 30, 0, 1 }, 17162306a36Sopenharmony_ci { 1000000000UL, 40, 0, 1 }, 17262306a36Sopenharmony_ci { 1350000000ul, 54, 0, 1 }, 17362306a36Sopenharmony_ci { 2000000000UL, 80, 0, 1 }, 17462306a36Sopenharmony_ci { 2100000000UL, 84, 0, 1 }, 17562306a36Sopenharmony_ci { 2250000000UL, 90, 0, 1 }, 17662306a36Sopenharmony_ci { 2500000000UL, 100, 0, 1 }, 17762306a36Sopenharmony_ci { 2700000000UL, 54, 0, 0 }, 17862306a36Sopenharmony_ci { 2975000000UL, 119, 0, 1 }, 17962306a36Sopenharmony_ci { 3100000000UL, 124, 0, 1 }, 18062306a36Sopenharmony_ci { 3150000000UL, 126, 0, 1 }, 18162306a36Sopenharmony_ci}; 18262306a36Sopenharmony_ci 18362306a36Sopenharmony_cistatic const struct iproc_pll_ctrl mipipll = { 18462306a36Sopenharmony_ci .flags = IPROC_CLK_PLL_ASIU | IPROC_CLK_PLL_HAS_NDIV_FRAC | 18562306a36Sopenharmony_ci IPROC_CLK_NEEDS_READ_BACK, 18662306a36Sopenharmony_ci .aon = AON_VAL(0x0, 4, 17, 16), 18762306a36Sopenharmony_ci .asiu = ASIU_GATE_VAL(0x0, 3), 18862306a36Sopenharmony_ci .reset = RESET_VAL(0x0, 11, 10), 18962306a36Sopenharmony_ci .dig_filter = DF_VAL(0x0, 4, 3, 0, 4, 7, 4), 19062306a36Sopenharmony_ci .ndiv_int = REG_VAL(0x10, 20, 10), 19162306a36Sopenharmony_ci .ndiv_frac = REG_VAL(0x10, 0, 20), 19262306a36Sopenharmony_ci .pdiv = REG_VAL(0x14, 0, 4), 19362306a36Sopenharmony_ci .vco_ctrl = VCO_CTRL_VAL(0x18, 0x1c), 19462306a36Sopenharmony_ci .status = REG_VAL(0x28, 12, 1), 19562306a36Sopenharmony_ci}; 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_cistatic const struct iproc_clk_ctrl mipipll_clk[] = { 19862306a36Sopenharmony_ci [BCM_CYGNUS_MIPIPLL_CH0_UNUSED] = { 19962306a36Sopenharmony_ci .channel = BCM_CYGNUS_MIPIPLL_CH0_UNUSED, 20062306a36Sopenharmony_ci .flags = IPROC_CLK_NEEDS_READ_BACK, 20162306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 12, 6, 18), 20262306a36Sopenharmony_ci .mdiv = REG_VAL(0x20, 0, 8), 20362306a36Sopenharmony_ci }, 20462306a36Sopenharmony_ci [BCM_CYGNUS_MIPIPLL_CH1_LCD] = { 20562306a36Sopenharmony_ci .channel = BCM_CYGNUS_MIPIPLL_CH1_LCD, 20662306a36Sopenharmony_ci .flags = IPROC_CLK_NEEDS_READ_BACK, 20762306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 13, 7, 19), 20862306a36Sopenharmony_ci .mdiv = REG_VAL(0x20, 10, 8), 20962306a36Sopenharmony_ci }, 21062306a36Sopenharmony_ci [BCM_CYGNUS_MIPIPLL_CH2_V3D] = { 21162306a36Sopenharmony_ci .channel = BCM_CYGNUS_MIPIPLL_CH2_V3D, 21262306a36Sopenharmony_ci .flags = IPROC_CLK_NEEDS_READ_BACK, 21362306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 14, 8, 20), 21462306a36Sopenharmony_ci .mdiv = REG_VAL(0x20, 20, 8), 21562306a36Sopenharmony_ci }, 21662306a36Sopenharmony_ci [BCM_CYGNUS_MIPIPLL_CH3_UNUSED] = { 21762306a36Sopenharmony_ci .channel = BCM_CYGNUS_MIPIPLL_CH3_UNUSED, 21862306a36Sopenharmony_ci .flags = IPROC_CLK_NEEDS_READ_BACK, 21962306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 15, 9, 21), 22062306a36Sopenharmony_ci .mdiv = REG_VAL(0x24, 0, 8), 22162306a36Sopenharmony_ci }, 22262306a36Sopenharmony_ci [BCM_CYGNUS_MIPIPLL_CH4_UNUSED] = { 22362306a36Sopenharmony_ci .channel = BCM_CYGNUS_MIPIPLL_CH4_UNUSED, 22462306a36Sopenharmony_ci .flags = IPROC_CLK_NEEDS_READ_BACK, 22562306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 16, 10, 22), 22662306a36Sopenharmony_ci .mdiv = REG_VAL(0x24, 10, 8), 22762306a36Sopenharmony_ci }, 22862306a36Sopenharmony_ci [BCM_CYGNUS_MIPIPLL_CH5_UNUSED] = { 22962306a36Sopenharmony_ci .channel = BCM_CYGNUS_MIPIPLL_CH5_UNUSED, 23062306a36Sopenharmony_ci .flags = IPROC_CLK_NEEDS_READ_BACK, 23162306a36Sopenharmony_ci .enable = ENABLE_VAL(0x4, 17, 11, 23), 23262306a36Sopenharmony_ci .mdiv = REG_VAL(0x24, 20, 8), 23362306a36Sopenharmony_ci }, 23462306a36Sopenharmony_ci}; 23562306a36Sopenharmony_ci 23662306a36Sopenharmony_cistatic void __init cygnus_mipipll_clk_init(struct device_node *node) 23762306a36Sopenharmony_ci{ 23862306a36Sopenharmony_ci iproc_pll_clk_setup(node, &mipipll, mipipll_vco_params, 23962306a36Sopenharmony_ci ARRAY_SIZE(mipipll_vco_params), mipipll_clk, 24062306a36Sopenharmony_ci ARRAY_SIZE(mipipll_clk)); 24162306a36Sopenharmony_ci} 24262306a36Sopenharmony_ciCLK_OF_DECLARE(cygnus_mipipll, "brcm,cygnus-mipipll", cygnus_mipipll_clk_init); 24362306a36Sopenharmony_ci 24462306a36Sopenharmony_cistatic const struct iproc_asiu_div asiu_div[] = { 24562306a36Sopenharmony_ci [BCM_CYGNUS_ASIU_KEYPAD_CLK] = ASIU_DIV_VAL(0x0, 31, 16, 10, 0, 10), 24662306a36Sopenharmony_ci [BCM_CYGNUS_ASIU_ADC_CLK] = ASIU_DIV_VAL(0x4, 31, 16, 10, 0, 10), 24762306a36Sopenharmony_ci [BCM_CYGNUS_ASIU_PWM_CLK] = ASIU_DIV_VAL(0x8, 31, 16, 10, 0, 10), 24862306a36Sopenharmony_ci}; 24962306a36Sopenharmony_ci 25062306a36Sopenharmony_cistatic const struct iproc_asiu_gate asiu_gate[] = { 25162306a36Sopenharmony_ci [BCM_CYGNUS_ASIU_KEYPAD_CLK] = ASIU_GATE_VAL(0x0, 7), 25262306a36Sopenharmony_ci [BCM_CYGNUS_ASIU_ADC_CLK] = ASIU_GATE_VAL(0x0, 9), 25362306a36Sopenharmony_ci [BCM_CYGNUS_ASIU_PWM_CLK] = ASIU_GATE_VAL(IPROC_CLK_INVALID_OFFSET, 0), 25462306a36Sopenharmony_ci}; 25562306a36Sopenharmony_ci 25662306a36Sopenharmony_cistatic void __init cygnus_asiu_init(struct device_node *node) 25762306a36Sopenharmony_ci{ 25862306a36Sopenharmony_ci iproc_asiu_setup(node, asiu_div, asiu_gate, ARRAY_SIZE(asiu_div)); 25962306a36Sopenharmony_ci} 26062306a36Sopenharmony_ciCLK_OF_DECLARE(cygnus_asiu_clk, "brcm,cygnus-asiu-clk", cygnus_asiu_init); 26162306a36Sopenharmony_ci 26262306a36Sopenharmony_cistatic const struct iproc_pll_ctrl audiopll = { 26362306a36Sopenharmony_ci .flags = IPROC_CLK_PLL_NEEDS_SW_CFG | IPROC_CLK_PLL_HAS_NDIV_FRAC | 26462306a36Sopenharmony_ci IPROC_CLK_PLL_USER_MODE_ON | IPROC_CLK_PLL_RESET_ACTIVE_LOW | 26562306a36Sopenharmony_ci IPROC_CLK_PLL_CALC_PARAM, 26662306a36Sopenharmony_ci .reset = RESET_VAL(0x5c, 0, 1), 26762306a36Sopenharmony_ci .dig_filter = DF_VAL(0x48, 0, 3, 6, 4, 3, 3), 26862306a36Sopenharmony_ci .sw_ctrl = SW_CTRL_VAL(0x4, 0), 26962306a36Sopenharmony_ci .ndiv_int = REG_VAL(0x8, 0, 10), 27062306a36Sopenharmony_ci .ndiv_frac = REG_VAL(0x8, 10, 20), 27162306a36Sopenharmony_ci .pdiv = REG_VAL(0x44, 0, 4), 27262306a36Sopenharmony_ci .vco_ctrl = VCO_CTRL_VAL(0x0c, 0x10), 27362306a36Sopenharmony_ci .status = REG_VAL(0x54, 0, 1), 27462306a36Sopenharmony_ci .macro_mode = REG_VAL(0x0, 0, 3), 27562306a36Sopenharmony_ci}; 27662306a36Sopenharmony_ci 27762306a36Sopenharmony_cistatic const struct iproc_clk_ctrl audiopll_clk[] = { 27862306a36Sopenharmony_ci [BCM_CYGNUS_AUDIOPLL_CH0] = { 27962306a36Sopenharmony_ci .channel = BCM_CYGNUS_AUDIOPLL_CH0, 28062306a36Sopenharmony_ci .flags = IPROC_CLK_AON | IPROC_CLK_MCLK_DIV_BY_2, 28162306a36Sopenharmony_ci .enable = ENABLE_VAL(0x14, 8, 10, 9), 28262306a36Sopenharmony_ci .mdiv = REG_VAL(0x14, 0, 8), 28362306a36Sopenharmony_ci }, 28462306a36Sopenharmony_ci [BCM_CYGNUS_AUDIOPLL_CH1] = { 28562306a36Sopenharmony_ci .channel = BCM_CYGNUS_AUDIOPLL_CH1, 28662306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 28762306a36Sopenharmony_ci .enable = ENABLE_VAL(0x18, 8, 10, 9), 28862306a36Sopenharmony_ci .mdiv = REG_VAL(0x18, 0, 8), 28962306a36Sopenharmony_ci }, 29062306a36Sopenharmony_ci [BCM_CYGNUS_AUDIOPLL_CH2] = { 29162306a36Sopenharmony_ci .channel = BCM_CYGNUS_AUDIOPLL_CH2, 29262306a36Sopenharmony_ci .flags = IPROC_CLK_AON, 29362306a36Sopenharmony_ci .enable = ENABLE_VAL(0x1c, 8, 10, 9), 29462306a36Sopenharmony_ci .mdiv = REG_VAL(0x1c, 0, 8), 29562306a36Sopenharmony_ci }, 29662306a36Sopenharmony_ci}; 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_cistatic void __init cygnus_audiopll_clk_init(struct device_node *node) 29962306a36Sopenharmony_ci{ 30062306a36Sopenharmony_ci iproc_pll_clk_setup(node, &audiopll, NULL, 0, 30162306a36Sopenharmony_ci audiopll_clk, ARRAY_SIZE(audiopll_clk)); 30262306a36Sopenharmony_ci} 30362306a36Sopenharmony_ciCLK_OF_DECLARE(cygnus_audiopll, "brcm,cygnus-audiopll", 30462306a36Sopenharmony_ci cygnus_audiopll_clk_init); 305