Lines Matching +full:sun50i +full:- +full:h6 +full:- +full:iommu

1 // SPDX-License-Identifier: GPL-2.0
4 * Based on the H6 CCU driver, which is:
8 #include <linux/clk-provider.h>
25 #include "ccu-sun50i-h616.h"
44 .hw.init = CLK_HW_INIT("pll-cpux", "osc24M",
60 .hw.init = CLK_HW_INIT("pll-ddr0", "osc24M",
75 .hw.init = CLK_HW_INIT("pll-ddr1", "osc24M",
92 .hw.init = CLK_HW_INIT("pll-periph0", "osc24M",
109 .hw.init = CLK_HW_INIT("pll-periph1", "osc24M",
124 .hw.init = CLK_HW_INIT("pll-gpu", "osc24M",
146 .hw.init = CLK_HW_INIT("pll-video0", "osc24M",
164 .hw.init = CLK_HW_INIT("pll-video1", "osc24M",
182 .hw.init = CLK_HW_INIT("pll-video2", "osc24M",
197 .hw.init = CLK_HW_INIT("pll-ve", "osc24M",
212 .hw.init = CLK_HW_INIT("pll-de", "osc24M",
219 * Sigma-delta modulation settings table obtained from the vendor SDK driver.
221 * fixed values in the probe routine. Sigma-delta modulation allows providing a
222 * fractional-N divider in the PLL, to help reaching those specific
243 .hw.init = CLK_HW_INIT("pll-audio-hs", "osc24M",
250 "iosc", "pll-cpux", "pll-periph0" };
254 static SUNXI_CCU_M(cpux_apb_clk, "cpux-apb", "cpux", 0x500, 8, 2, 0);
257 "iosc", "pll-periph0" };
258 static SUNXI_CCU_MP_WITH_MUX(psi_ahb1_ahb2_clk, "psi-ahb1-ahb2",
267 "psi-ahb1-ahb2",
268 "pll-periph0" };
287 static const char * const mbus_parents[] = { "osc24M", "pll-periph0-2x",
288 "pll-ddr0", "pll-ddr1" };
295 static const char * const de_parents[] = { "pll-de", "pll-periph0-2x" };
302 static SUNXI_CCU_GATE(bus_de_clk, "bus-de", "psi-ahb1-ahb2",
313 static SUNXI_CCU_GATE(bus_deinterlace_clk, "bus-deinterlace", "psi-ahb1-ahb2",
322 static SUNXI_CCU_GATE(bus_g2d_clk, "bus-g2d", "psi-ahb1-ahb2",
325 static const char * const gpu0_parents[] = { "pll-gpu", "gpu1" };
331 static SUNXI_CCU_M_WITH_GATE(gpu1_clk, "gpu1", "pll-periph0-2x", 0x674,
336 static SUNXI_CCU_GATE(bus_gpu_clk, "bus-gpu", "psi-ahb1-ahb2",
339 static const char * const ce_parents[] = { "osc24M", "pll-periph0-2x" };
347 static SUNXI_CCU_GATE(bus_ce_clk, "bus-ce", "psi-ahb1-ahb2",
350 static const char * const ve_parents[] = { "pll-ve" };
357 static SUNXI_CCU_GATE(bus_ve_clk, "bus-ve", "psi-ahb1-ahb2",
360 static SUNXI_CCU_GATE(bus_dma_clk, "bus-dma", "psi-ahb1-ahb2",
363 static SUNXI_CCU_GATE(bus_hstimer_clk, "bus-hstimer", "psi-ahb1-ahb2",
368 static SUNXI_CCU_GATE(bus_dbg_clk, "bus-dbg", "psi-ahb1-ahb2",
371 static SUNXI_CCU_GATE(bus_psi_clk, "bus-psi", "psi-ahb1-ahb2",
374 static SUNXI_CCU_GATE(bus_pwm_clk, "bus-pwm", "apb1", 0x7ac, BIT(0), 0);
376 static SUNXI_CCU_GATE(bus_iommu_clk, "bus-iommu", "apb1", 0x7bc, BIT(0), 0);
378 static const char * const dram_parents[] = { "pll-ddr0", "pll-ddr1" };
391 static SUNXI_CCU_GATE(mbus_dma_clk, "mbus-dma", "mbus",
393 static SUNXI_CCU_GATE(mbus_ve_clk, "mbus-ve", "mbus",
395 static SUNXI_CCU_GATE(mbus_ce_clk, "mbus-ce", "mbus",
397 static SUNXI_CCU_GATE(mbus_ts_clk, "mbus-ts", "mbus",
399 static SUNXI_CCU_GATE(mbus_nand_clk, "mbus-nand", "mbus",
401 static SUNXI_CCU_GATE(mbus_g2d_clk, "mbus-g2d", "mbus",
404 static SUNXI_CCU_GATE(bus_dram_clk, "bus-dram", "psi-ahb1-ahb2",
407 static const char * const nand_spi_parents[] = { "osc24M", "pll-periph0",
408 "pll-periph1", "pll-periph0-2x",
409 "pll-periph1-2x" };
424 static SUNXI_CCU_GATE(bus_nand_clk, "bus-nand", "ahb3", 0x82c, BIT(0), 0);
426 static const char * const mmc_parents[] = { "osc24M", "pll-periph0-2x",
427 "pll-periph1-2x" };
433 2, /* post-div */
441 2, /* post-div */
449 2, /* post-div */
452 static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb3", 0x84c, BIT(0), 0);
453 static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb3", 0x84c, BIT(1), 0);
454 static SUNXI_CCU_GATE(bus_mmc2_clk, "bus-mmc2", "ahb3", 0x84c, BIT(2), 0);
456 static SUNXI_CCU_GATE(bus_uart0_clk, "bus-uart0", "apb2", 0x90c, BIT(0), 0);
457 static SUNXI_CCU_GATE(bus_uart1_clk, "bus-uart1", "apb2", 0x90c, BIT(1), 0);
458 static SUNXI_CCU_GATE(bus_uart2_clk, "bus-uart2", "apb2", 0x90c, BIT(2), 0);
459 static SUNXI_CCU_GATE(bus_uart3_clk, "bus-uart3", "apb2", 0x90c, BIT(3), 0);
460 static SUNXI_CCU_GATE(bus_uart4_clk, "bus-uart4", "apb2", 0x90c, BIT(4), 0);
461 static SUNXI_CCU_GATE(bus_uart5_clk, "bus-uart5", "apb2", 0x90c, BIT(5), 0);
463 static SUNXI_CCU_GATE(bus_i2c0_clk, "bus-i2c0", "apb2", 0x91c, BIT(0), 0);
464 static SUNXI_CCU_GATE(bus_i2c1_clk, "bus-i2c1", "apb2", 0x91c, BIT(1), 0);
465 static SUNXI_CCU_GATE(bus_i2c2_clk, "bus-i2c2", "apb2", 0x91c, BIT(2), 0);
466 static SUNXI_CCU_GATE(bus_i2c3_clk, "bus-i2c3", "apb2", 0x91c, BIT(3), 0);
467 static SUNXI_CCU_GATE(bus_i2c4_clk, "bus-i2c4", "apb2", 0x91c, BIT(4), 0);
483 static SUNXI_CCU_GATE(bus_spi0_clk, "bus-spi0", "ahb3", 0x96c, BIT(0), 0);
484 static SUNXI_CCU_GATE(bus_spi1_clk, "bus-spi1", "ahb3", 0x96c, BIT(1), 0);
486 static SUNXI_CCU_GATE(emac_25m_clk, "emac-25m", "ahb3", 0x970,
489 static SUNXI_CCU_GATE(bus_emac0_clk, "bus-emac0", "ahb3", 0x97c, BIT(0), 0);
490 static SUNXI_CCU_GATE(bus_emac1_clk, "bus-emac1", "ahb3", 0x97c, BIT(1), 0);
492 static const char * const ts_parents[] = { "osc24M", "pll-periph0" };
500 static SUNXI_CCU_GATE(bus_ts_clk, "bus-ts", "ahb3", 0x9bc, BIT(0), 0);
502 static SUNXI_CCU_GATE(bus_gpadc_clk, "bus-gpadc", "apb1", 0x9ec, BIT(0), 0);
504 static SUNXI_CCU_GATE(bus_ths_clk, "bus-ths", "apb1", 0x9fc, BIT(0), 0);
506 static const char * const audio_parents[] = { "pll-audio-1x", "pll-audio-2x",
507 "pll-audio-4x", "pll-audio-hs" };
521 static SUNXI_CCU_GATE(bus_spdif_clk, "bus-spdif", "apb1", 0xa2c, BIT(0), 0);
536 static SUNXI_CCU_GATE(bus_dmic_clk, "bus-dmic", "apb1", 0xa4c, BIT(0), 0);
538 static SUNXI_CCU_M_WITH_MUX_GATE(audio_codec_1x_clk, "audio-codec-1x",
544 static SUNXI_CCU_M_WITH_MUX_GATE(audio_codec_4x_clk, "audio-codec-4x",
551 static SUNXI_CCU_GATE(bus_audio_codec_clk, "bus-audio-codec", "apb1", 0xa5c,
560 .hw.init = CLK_HW_INIT_PARENTS("audio-hub",
567 static SUNXI_CCU_GATE(bus_audio_hub_clk, "bus-audio-hub", "apb1", 0xa6c, BIT(0), 0);
578 static SUNXI_CCU_GATE(usb_ohci0_clk, "usb-ohci0", "osc12M", 0xa70, BIT(31), 0);
579 static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M", 0xa70, BIT(29), 0);
581 static SUNXI_CCU_GATE(usb_ohci1_clk, "usb-ohci1", "osc12M", 0xa74, BIT(31), 0);
582 static SUNXI_CCU_GATE(usb_phy1_clk, "usb-phy1", "osc24M", 0xa74, BIT(29), 0);
584 static SUNXI_CCU_GATE(usb_ohci2_clk, "usb-ohci2", "osc12M", 0xa78, BIT(31), 0);
585 static SUNXI_CCU_GATE(usb_phy2_clk, "usb-phy2", "osc24M", 0xa78, BIT(29), 0);
587 static SUNXI_CCU_GATE(usb_ohci3_clk, "usb-ohci3", "osc12M", 0xa7c, BIT(31), 0);
588 static SUNXI_CCU_GATE(usb_phy3_clk, "usb-phy3", "osc24M", 0xa7c, BIT(29), 0);
590 static SUNXI_CCU_GATE(bus_ohci0_clk, "bus-ohci0", "ahb3", 0xa8c, BIT(0), 0);
591 static SUNXI_CCU_GATE(bus_ohci1_clk, "bus-ohci1", "ahb3", 0xa8c, BIT(1), 0);
592 static SUNXI_CCU_GATE(bus_ohci2_clk, "bus-ohci2", "ahb3", 0xa8c, BIT(2), 0);
593 static SUNXI_CCU_GATE(bus_ohci3_clk, "bus-ohci3", "ahb3", 0xa8c, BIT(3), 0);
594 static SUNXI_CCU_GATE(bus_ehci0_clk, "bus-ehci0", "ahb3", 0xa8c, BIT(4), 0);
595 static SUNXI_CCU_GATE(bus_ehci1_clk, "bus-ehci1", "ahb3", 0xa8c, BIT(5), 0);
596 static SUNXI_CCU_GATE(bus_ehci2_clk, "bus-ehci2", "ahb3", 0xa8c, BIT(6), 0);
597 static SUNXI_CCU_GATE(bus_ehci3_clk, "bus-ehci3", "ahb3", 0xa8c, BIT(7), 0);
598 static SUNXI_CCU_GATE(bus_otg_clk, "bus-otg", "ahb3", 0xa8c, BIT(8), 0);
600 static SUNXI_CCU_GATE(bus_keyadc_clk, "bus-keyadc", "apb1", 0xa9c, BIT(0), 0);
602 static const char * const hdmi_parents[] = { "pll-video0", "pll-video0-4x",
603 "pll-video2", "pll-video2-4x" };
610 static SUNXI_CCU_GATE(hdmi_slow_clk, "hdmi-slow", "osc24M", 0xb04, BIT(31), 0);
612 static const char * const hdmi_cec_parents[] = { "osc32k", "pll-periph0-2x" };
632 .hw.init = CLK_HW_INIT_PARENTS("hdmi-cec",
639 static SUNXI_CCU_GATE(bus_hdmi_clk, "bus-hdmi", "ahb3", 0xb1c, BIT(0), 0);
641 static SUNXI_CCU_GATE(bus_tcon_top_clk, "bus-tcon-top", "ahb3",
644 static const char * const tcon_tv_parents[] = { "pll-video0",
645 "pll-video0-4x",
646 "pll-video1",
647 "pll-video1-4x" };
648 static SUNXI_CCU_MP_WITH_MUX_GATE(tcon_tv0_clk, "tcon-tv0",
655 static SUNXI_CCU_MP_WITH_MUX_GATE(tcon_tv1_clk, "tcon-tv1",
663 static SUNXI_CCU_GATE(bus_tcon_tv0_clk, "bus-tcon-tv0", "ahb3",
665 static SUNXI_CCU_GATE(bus_tcon_tv1_clk, "bus-tcon-tv1", "ahb3",
676 static SUNXI_CCU_GATE(bus_tve_top_clk, "bus-tve-top", "ahb3",
678 static SUNXI_CCU_GATE(bus_tve0_clk, "bus-tve0", "ahb3",
681 static const char * const hdcp_parents[] = { "pll-periph0", "pll-periph1" };
688 static SUNXI_CCU_GATE(bus_hdcp_clk, "bus-hdcp", "ahb3", 0xc4c, BIT(0), 0);
703 static CLK_FIXED_FACTOR_HWS(pll_audio_1x_clk, "pll-audio-1x",
706 static CLK_FIXED_FACTOR_HWS(pll_audio_2x_clk, "pll-audio-2x",
709 static CLK_FIXED_FACTOR_HWS(pll_audio_4x_clk, "pll-audio-4x",
717 static CLK_FIXED_FACTOR_HWS(pll_periph0_2x_clk, "pll-periph0-2x",
725 static CLK_FIXED_FACTOR_HWS(pll_system_32k_clk, "pll-system-32k",
732 static CLK_FIXED_FACTOR_HWS(pll_periph1_2x_clk, "pll-periph1-2x",
736 static CLK_FIXED_FACTOR_HW(pll_video0_4x_clk, "pll-video0-4x",
739 static CLK_FIXED_FACTOR_HW(pll_video1_4x_clk, "pll-video1-4x",
742 static CLK_FIXED_FACTOR_HW(pll_video2_4x_clk, "pll-video2-4x",
1130 * See the comment before pll-video0 definition for the reason. in sun50i_h616_ccu_probe()
1151 * Set the output-divider for the pll-audio clocks (M0) to 2 and the in sun50i_h616_ccu_probe()
1169 return devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_h616_ccu_desc); in sun50i_h616_ccu_probe()
1173 { .compatible = "allwinner,sun50i-h616-ccu" },
1181 .name = "sun50i-h616-ccu",