Lines Matching +full:n +full:- +full:factor
1 // SPDX-License-Identifier: GPL-2.0
9 #include <linux/clk-provider.h>
13 #include "clk-cpumux.h"
14 #include "clk-gate.h"
15 #include "clk-mtk.h"
16 #include "clk-pll.h"
18 #include <dt-bindings/clock/mt7629-clk.h>
363 FACTOR(CLK_TOP_TO_USB3_SYS, "to_usb3_sys", "eth1pll", 1, 4),
364 FACTOR(CLK_TOP_P1_1MHZ, "p1_1mhz", "eth1pll", 1, 500),
365 FACTOR(CLK_TOP_4MHZ, "free_run_4mhz", "eth1pll", 1, 125),
366 FACTOR(CLK_TOP_P0_1MHZ, "p0_1mhz", "eth1pll", 1, 500),
367 FACTOR(CLK_TOP_ETH_500M, "eth_500m", "eth1pll", 1, 1),
368 FACTOR(CLK_TOP_TXCLK_SRC_PRE, "txclk_src_pre", "sgmiipll_d2", 1, 1),
369 FACTOR(CLK_TOP_RTC, "rtc", "clkxtal", 1, 1024),
370 FACTOR(CLK_TOP_PWM_QTR_26M, "pwm_qtr_26m", "clkxtal", 1, 1),
371 FACTOR(CLK_TOP_CPUM_TCK_IN, "cpum_tck_in", "cpum_tck", 1, 1),
372 FACTOR(CLK_TOP_TO_USB3_DA_TOP, "to_usb3_da_top", "clkxtal", 1, 1),
373 FACTOR(CLK_TOP_MEMPLL, "mempll", "clkxtal", 32, 1),
374 FACTOR(CLK_TOP_DMPLL, "dmpll_ck", "mempll", 1, 1),
375 FACTOR(CLK_TOP_DMPLL_D4, "dmpll_d4", "mempll", 1, 4),
376 FACTOR(CLK_TOP_DMPLL_D8, "dmpll_d8", "mempll", 1, 8),
377 FACTOR(CLK_TOP_SYSPLL_D2, "syspll_d2", "mainpll", 1, 2),
378 FACTOR(CLK_TOP_SYSPLL1_D2, "syspll1_d2", "mainpll", 1, 4),
379 FACTOR(CLK_TOP_SYSPLL1_D4, "syspll1_d4", "mainpll", 1, 8),
380 FACTOR(CLK_TOP_SYSPLL1_D8, "syspll1_d8", "mainpll", 1, 16),
381 FACTOR(CLK_TOP_SYSPLL1_D16, "syspll1_d16", "mainpll", 1, 32),
382 FACTOR(CLK_TOP_SYSPLL2_D2, "syspll2_d2", "mainpll", 1, 6),
383 FACTOR(CLK_TOP_SYSPLL2_D4, "syspll2_d4", "mainpll", 1, 12),
384 FACTOR(CLK_TOP_SYSPLL2_D8, "syspll2_d8", "mainpll", 1, 24),
385 FACTOR(CLK_TOP_SYSPLL_D5, "syspll_d5", "mainpll", 1, 5),
386 FACTOR(CLK_TOP_SYSPLL3_D2, "syspll3_d2", "mainpll", 1, 10),
387 FACTOR(CLK_TOP_SYSPLL3_D4, "syspll3_d4", "mainpll", 1, 20),
388 FACTOR(CLK_TOP_SYSPLL_D7, "syspll_d7", "mainpll", 1, 7),
389 FACTOR(CLK_TOP_SYSPLL4_D2, "syspll4_d2", "mainpll", 1, 14),
390 FACTOR(CLK_TOP_SYSPLL4_D4, "syspll4_d4", "mainpll", 1, 28),
391 FACTOR(CLK_TOP_SYSPLL4_D16, "syspll4_d16", "mainpll", 1, 112),
392 FACTOR(CLK_TOP_UNIVPLL, "univpll", "univ2pll", 1, 2),
393 FACTOR(CLK_TOP_UNIVPLL1_D2, "univpll1_d2", "univpll", 1, 4),
394 FACTOR(CLK_TOP_UNIVPLL1_D4, "univpll1_d4", "univpll", 1, 8),
395 FACTOR(CLK_TOP_UNIVPLL1_D8, "univpll1_d8", "univpll", 1, 16),
396 FACTOR(CLK_TOP_UNIVPLL_D3, "univpll_d3", "univpll", 1, 3),
397 FACTOR(CLK_TOP_UNIVPLL2_D2, "univpll2_d2", "univpll", 1, 6),
398 FACTOR(CLK_TOP_UNIVPLL2_D4, "univpll2_d4", "univpll", 1, 12),
399 FACTOR(CLK_TOP_UNIVPLL2_D8, "univpll2_d8", "univpll", 1, 24),
400 FACTOR(CLK_TOP_UNIVPLL2_D16, "univpll2_d16", "univpll", 1, 48),
401 FACTOR(CLK_TOP_UNIVPLL_D5, "univpll_d5", "univpll", 1, 5),
402 FACTOR(CLK_TOP_UNIVPLL3_D2, "univpll3_d2", "univpll", 1, 10),
403 FACTOR(CLK_TOP_UNIVPLL3_D4, "univpll3_d4", "univpll", 1, 20),
404 FACTOR(CLK_TOP_UNIVPLL3_D16, "univpll3_d16", "univpll", 1, 80),
405 FACTOR(CLK_TOP_UNIVPLL_D7, "univpll_d7", "univpll", 1, 7),
406 FACTOR(CLK_TOP_UNIVPLL_D80_D4, "univpll_d80_d4", "univpll", 1, 320),
407 FACTOR(CLK_TOP_UNIV48M, "univ48m", "univpll", 1, 25),
408 FACTOR(CLK_TOP_SGMIIPLL_D2, "sgmiipll_d2", "sgmipll", 1, 2),
409 FACTOR(CLK_TOP_CLKXTAL_D4, "clkxtal_d4", "clkxtal", 1, 4),
410 FACTOR(CLK_TOP_HD_FAXI, "hd_faxi", "axi_sel", 1, 1),
411 FACTOR(CLK_TOP_FAXI, "faxi", "axi_sel", 1, 1),
412 FACTOR(CLK_TOP_F_FAUD_INTBUS, "f_faud_intbus", "aud_intbus_sel", 1, 1),
413 FACTOR(CLK_TOP_AP2WBHIF_HCLK, "ap2wbhif_hclk", "syspll1_d8", 1, 1),
414 FACTOR(CLK_TOP_10M_INFRAO, "infrao_10m", "gpt10m_sel", 1, 1),
415 FACTOR(CLK_TOP_MSDC30_1, "msdc30_1", "msdc30_1_sel", 1, 1),
416 FACTOR(CLK_TOP_SPI, "spi", "spi0_sel", 1, 1),
417 FACTOR(CLK_TOP_SF, "sf", "nfi_infra_sel", 1, 1),
418 FACTOR(CLK_TOP_FLASH, "flash", "flash_sel", 1, 1),
419 FACTOR(CLK_TOP_TO_USB3_REF, "to_usb3_ref", "sata_sel", 1, 4),
420 FACTOR(CLK_TOP_TO_USB3_MCU, "to_usb3_mcu", "axi_sel", 1, 1),
421 FACTOR(CLK_TOP_TO_USB3_DMA, "to_usb3_dma", "hif_sel", 1, 1),
422 FACTOR(CLK_TOP_FROM_TOP_AHB, "from_top_ahb", "axi_sel", 1, 1),
423 FACTOR(CLK_TOP_FROM_TOP_AXI, "from_top_axi", "hif_sel", 1, 1),
424 FACTOR(CLK_TOP_PCIE1_MAC_EN, "pcie1_mac_en", "sata_sel", 1, 1),
425 FACTOR(CLK_TOP_PCIE0_MAC_EN, "pcie0_mac_en", "sata_sel", 1, 1),
551 struct device_node *node = pdev->dev.of_node; in mtk_topckgen_init()
559 return -ENOMEM; in mtk_topckgen_init()
567 mtk_clk_register_composites(&pdev->dev, top_muxes, in mtk_topckgen_init()
571 clk_prepare_enable(clk_data->hws[CLK_TOP_AXI_SEL]->clk); in mtk_topckgen_init()
572 clk_prepare_enable(clk_data->hws[CLK_TOP_MEM_SEL]->clk); in mtk_topckgen_init()
573 clk_prepare_enable(clk_data->hws[CLK_TOP_DDRPHYCFG_SEL]->clk); in mtk_topckgen_init()
580 struct device_node *node = pdev->dev.of_node; in mtk_infrasys_init()
585 return -ENOMEM; in mtk_infrasys_init()
587 mtk_clk_register_gates(&pdev->dev, node, infra_clks, in mtk_infrasys_init()
590 mtk_clk_register_cpumuxes(&pdev->dev, node, infra_muxes, in mtk_infrasys_init()
602 struct device_node *node = pdev->dev.of_node; in mtk_pericfg_init()
610 return -ENOMEM; in mtk_pericfg_init()
612 mtk_clk_register_gates(&pdev->dev, node, peri_clks, in mtk_pericfg_init()
615 mtk_clk_register_composites(&pdev->dev, peri_muxes, in mtk_pericfg_init()
623 clk_prepare_enable(clk_data->hws[CLK_PERI_UART0_PD]->clk); in mtk_pericfg_init()
631 struct device_node *node = pdev->dev.of_node; in mtk_apmixedsys_init()
635 return -ENOMEM; in mtk_apmixedsys_init()
640 mtk_clk_register_gates(&pdev->dev, node, apmixed_clks, in mtk_apmixedsys_init()
643 clk_prepare_enable(clk_data->hws[CLK_APMIXED_ARMPLL]->clk); in mtk_apmixedsys_init()
644 clk_prepare_enable(clk_data->hws[CLK_APMIXED_MAIN_CORE_EN]->clk); in mtk_apmixedsys_init()
652 .compatible = "mediatek,mt7629-apmixedsys",
655 .compatible = "mediatek,mt7629-infracfg",
658 .compatible = "mediatek,mt7629-topckgen",
661 .compatible = "mediatek,mt7629-pericfg",
674 clk_init = of_device_get_match_data(&pdev->dev); in clk_mt7629_probe()
676 return -EINVAL; in clk_mt7629_probe()
680 dev_err(&pdev->dev, in clk_mt7629_probe()
681 "could not register clock provider: %s: %d\n", in clk_mt7629_probe()
682 pdev->name, r); in clk_mt7629_probe()
690 .name = "clk-mt7629",