0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef __SIFIVE_CLK_FU540_PRCI_H
0020 #define __SIFIVE_CLK_FU540_PRCI_H
0021
0022
0023 #include <linux/module.h>
0024
0025 #include <dt-bindings/clock/sifive-fu540-prci.h>
0026
0027 #include "sifive-prci.h"
0028
0029
0030
0031 static struct __prci_wrpll_data sifive_fu540_prci_corepll_data = {
0032 .cfg0_offs = PRCI_COREPLLCFG0_OFFSET,
0033 .cfg1_offs = PRCI_COREPLLCFG1_OFFSET,
0034 .enable_bypass = sifive_prci_coreclksel_use_hfclk,
0035 .disable_bypass = sifive_prci_coreclksel_use_corepll,
0036 };
0037
0038 static struct __prci_wrpll_data sifive_fu540_prci_ddrpll_data = {
0039 .cfg0_offs = PRCI_DDRPLLCFG0_OFFSET,
0040 .cfg1_offs = PRCI_DDRPLLCFG1_OFFSET,
0041 };
0042
0043 static struct __prci_wrpll_data sifive_fu540_prci_gemgxlpll_data = {
0044 .cfg0_offs = PRCI_GEMGXLPLLCFG0_OFFSET,
0045 .cfg1_offs = PRCI_GEMGXLPLLCFG1_OFFSET,
0046 };
0047
0048
0049
0050 static const struct clk_ops sifive_fu540_prci_wrpll_clk_ops = {
0051 .set_rate = sifive_prci_wrpll_set_rate,
0052 .round_rate = sifive_prci_wrpll_round_rate,
0053 .recalc_rate = sifive_prci_wrpll_recalc_rate,
0054 .enable = sifive_prci_clock_enable,
0055 .disable = sifive_prci_clock_disable,
0056 .is_enabled = sifive_clk_is_enabled,
0057 };
0058
0059 static const struct clk_ops sifive_fu540_prci_wrpll_ro_clk_ops = {
0060 .recalc_rate = sifive_prci_wrpll_recalc_rate,
0061 };
0062
0063 static const struct clk_ops sifive_fu540_prci_tlclksel_clk_ops = {
0064 .recalc_rate = sifive_prci_tlclksel_recalc_rate,
0065 };
0066
0067
0068 static struct __prci_clock __prci_init_clocks_fu540[] = {
0069 [FU540_PRCI_CLK_COREPLL] = {
0070 .name = "corepll",
0071 .parent_name = "hfclk",
0072 .ops = &sifive_fu540_prci_wrpll_clk_ops,
0073 .pwd = &sifive_fu540_prci_corepll_data,
0074 },
0075 [FU540_PRCI_CLK_DDRPLL] = {
0076 .name = "ddrpll",
0077 .parent_name = "hfclk",
0078 .ops = &sifive_fu540_prci_wrpll_ro_clk_ops,
0079 .pwd = &sifive_fu540_prci_ddrpll_data,
0080 },
0081 [FU540_PRCI_CLK_GEMGXLPLL] = {
0082 .name = "gemgxlpll",
0083 .parent_name = "hfclk",
0084 .ops = &sifive_fu540_prci_wrpll_clk_ops,
0085 .pwd = &sifive_fu540_prci_gemgxlpll_data,
0086 },
0087 [FU540_PRCI_CLK_TLCLK] = {
0088 .name = "tlclk",
0089 .parent_name = "corepll",
0090 .ops = &sifive_fu540_prci_tlclksel_clk_ops,
0091 },
0092 };
0093
0094 static const struct prci_clk_desc prci_clk_fu540 = {
0095 .clks = __prci_init_clocks_fu540,
0096 .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540),
0097 };
0098
0099 #endif