Skip to content

Commit 57c1da8

Browse files
Chuan Liusuperna9999
authored andcommitted
soc: amlogic: clk-measure: Add support for C3
Add the clk-measurer clocks IDs for the Amlogic C3 SoC family. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Chuan Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
1 parent fb80ff2 commit 57c1da8

File tree

1 file changed

+157
-0
lines changed

1 file changed

+157
-0
lines changed

drivers/soc/amlogic/meson-clk-measure.c

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,146 @@ static const struct meson_msr_id clk_msr_sm1[] = {
494494
CLK_MSR_ID(127, "csi2_data"),
495495
};
496496

497+
static const struct meson_msr_id clk_msr_c3[] = {
498+
CLK_MSR_ID(0, "sys_clk"),
499+
CLK_MSR_ID(1, "axi_clk"),
500+
CLK_MSR_ID(2, "rtc_clk"),
501+
CLK_MSR_ID(3, "p20_usb2_ckout"),
502+
CLK_MSR_ID(4, "eth_mpll_test"),
503+
CLK_MSR_ID(5, "sys_pll"),
504+
CLK_MSR_ID(6, "cpu_clk_div16"),
505+
CLK_MSR_ID(7, "ts_pll"),
506+
CLK_MSR_ID(8, "fclk_div2"),
507+
CLK_MSR_ID(9, "fclk_div2p5"),
508+
CLK_MSR_ID(10, "fclk_div3"),
509+
CLK_MSR_ID(11, "fclk_div4"),
510+
CLK_MSR_ID(12, "fclk_div5"),
511+
CLK_MSR_ID(13, "fclk_div7"),
512+
CLK_MSR_ID(15, "fclk_50m"),
513+
CLK_MSR_ID(16, "sys_oscin32k_i"),
514+
CLK_MSR_ID(17, "mclk_pll"),
515+
CLK_MSR_ID(19, "hifi_pll"),
516+
CLK_MSR_ID(20, "gp0_pll"),
517+
CLK_MSR_ID(21, "gp1_pll"),
518+
CLK_MSR_ID(22, "eth_mppll_50m_ckout"),
519+
CLK_MSR_ID(23, "sys_pll_div16"),
520+
CLK_MSR_ID(24, "ddr_dpll_pt_clk"),
521+
CLK_MSR_ID(26, "nna_core"),
522+
CLK_MSR_ID(27, "rtc_sec_pulse_out"),
523+
CLK_MSR_ID(28, "rtc_osc_clk_out"),
524+
CLK_MSR_ID(29, "debug_in_clk"),
525+
CLK_MSR_ID(30, "mod_eth_phy_ref_clk"),
526+
CLK_MSR_ID(31, "mod_eth_tx_clk"),
527+
CLK_MSR_ID(32, "eth_125m"),
528+
CLK_MSR_ID(33, "eth_rmii"),
529+
CLK_MSR_ID(34, "co_clkin_to_mac"),
530+
CLK_MSR_ID(36, "co_rx_clk"),
531+
CLK_MSR_ID(37, "co_tx_clk"),
532+
CLK_MSR_ID(38, "eth_phy_rxclk"),
533+
CLK_MSR_ID(39, "eth_phy_plltxclk"),
534+
CLK_MSR_ID(40, "ephy_test_clk"),
535+
CLK_MSR_ID(66, "vapb"),
536+
CLK_MSR_ID(67, "ge2d"),
537+
CLK_MSR_ID(68, "dewarpa"),
538+
CLK_MSR_ID(70, "mipi_dsi_meas"),
539+
CLK_MSR_ID(71, "dsi_phy"),
540+
CLK_MSR_ID(79, "rama"),
541+
CLK_MSR_ID(94, "vc9000e_core"),
542+
CLK_MSR_ID(95, "vc9000e_sys"),
543+
CLK_MSR_ID(96, "vc9000e_aclk"),
544+
CLK_MSR_ID(97, "hcodec"),
545+
CLK_MSR_ID(106, "deskew_pll_clk_div32_out"),
546+
CLK_MSR_ID(107, "mipi_csi_phy_clk_out[0]"),
547+
CLK_MSR_ID(108, "mipi_csi_phy_clk_out[1]"),
548+
CLK_MSR_ID(110, "spifc"),
549+
CLK_MSR_ID(111, "saradc"),
550+
CLK_MSR_ID(112, "ts"),
551+
CLK_MSR_ID(113, "sd_emmc_c"),
552+
CLK_MSR_ID(114, "sd_emmc_b"),
553+
CLK_MSR_ID(115, "sd_emmc_a"),
554+
CLK_MSR_ID(116, "gpio_msr_clk"),
555+
CLK_MSR_ID(117, "spicc_b"),
556+
CLK_MSR_ID(118, "spicc_a"),
557+
CLK_MSR_ID(122, "mod_audio_pdm_dclk_o"),
558+
CLK_MSR_ID(124, "o_earcrx_dmac_clk"),
559+
CLK_MSR_ID(125, "o_earcrx_cmdc_clk"),
560+
CLK_MSR_ID(126, "o_earctx_dmac_clk"),
561+
CLK_MSR_ID(127, "o_earctx_cmdc_clk"),
562+
CLK_MSR_ID(128, "o_tohdmitx_bclk"),
563+
CLK_MSR_ID(129, "o_tohdmitx_mclk"),
564+
CLK_MSR_ID(130, "o_tohdmitx_spdif_clk"),
565+
CLK_MSR_ID(131, "o_toacodec_bclk"),
566+
CLK_MSR_ID(132, "o_toacodec_mclk"),
567+
CLK_MSR_ID(133, "o_spdifout_b_mst_clk"),
568+
CLK_MSR_ID(134, "o_spdifout_mst_clk"),
569+
CLK_MSR_ID(135, "o_spdifin_mst_clk"),
570+
CLK_MSR_ID(136, "o_audio_mclk"),
571+
CLK_MSR_ID(137, "o_vad_clk"),
572+
CLK_MSR_ID(138, "o_tdmout_d_sclk"),
573+
CLK_MSR_ID(139, "o_tdmout_c_sclk"),
574+
CLK_MSR_ID(140, "o_tdmout_b_sclk"),
575+
CLK_MSR_ID(141, "o_tdmout_a_sclk"),
576+
CLK_MSR_ID(142, "o_tdminb_1b_sclk"),
577+
CLK_MSR_ID(143, "o_tdmin_1b_sclk"),
578+
CLK_MSR_ID(144, "o_tdmin_d_sclk"),
579+
CLK_MSR_ID(145, "o_tdmin_c_sclk"),
580+
CLK_MSR_ID(146, "o_tdmin_b_sclk"),
581+
CLK_MSR_ID(147, "o_tdmin_a_sclk"),
582+
CLK_MSR_ID(148, "o_resampleb_clk"),
583+
CLK_MSR_ID(149, "o_resamplea_clk"),
584+
CLK_MSR_ID(150, "o_pdmb_sysclk"),
585+
CLK_MSR_ID(151, "o_pdmb_dclk"),
586+
CLK_MSR_ID(152, "o_pdm_sysclk"),
587+
CLK_MSR_ID(153, "o_pdm_dclk"),
588+
CLK_MSR_ID(154, "c_alockerb_out_clk"),
589+
CLK_MSR_ID(155, "c_alockerb_in_clk"),
590+
CLK_MSR_ID(156, "c_alocker_out_clk"),
591+
CLK_MSR_ID(157, "c_alocker_in_clk"),
592+
CLK_MSR_ID(158, "audio_mst_clk[34]"),
593+
CLK_MSR_ID(159, "audio_mst_clk[35]"),
594+
CLK_MSR_ID(160, "pwm_n"),
595+
CLK_MSR_ID(161, "pwm_m"),
596+
CLK_MSR_ID(162, "pwm_l"),
597+
CLK_MSR_ID(163, "pwm_k"),
598+
CLK_MSR_ID(164, "pwm_j"),
599+
CLK_MSR_ID(165, "pwm_i"),
600+
CLK_MSR_ID(166, "pwm_h"),
601+
CLK_MSR_ID(167, "pwm_g"),
602+
CLK_MSR_ID(168, "pwm_f"),
603+
CLK_MSR_ID(169, "pwm_e"),
604+
CLK_MSR_ID(170, "pwm_d"),
605+
CLK_MSR_ID(171, "pwm_c"),
606+
CLK_MSR_ID(172, "pwm_b"),
607+
CLK_MSR_ID(173, "pwm_a"),
608+
CLK_MSR_ID(174, "AU_DAC1_CLK_TO_GPIO"),
609+
CLK_MSR_ID(175, "AU_ADC_CLK_TO_GPIO"),
610+
CLK_MSR_ID(176, "rng_ring_osc_clk[0]"),
611+
CLK_MSR_ID(177, "rng_ring_osc_clk[1]"),
612+
CLK_MSR_ID(178, "rng_ring_osc_clk[2]"),
613+
CLK_MSR_ID(179, "rng_ring_osc_clk[3]"),
614+
CLK_MSR_ID(180, "sys_cpu_ring_osc_clk[0]"),
615+
CLK_MSR_ID(181, "sys_cpu_ring_osc_clk[1]"),
616+
CLK_MSR_ID(182, "sys_cpu_ring_osc_clk[2]"),
617+
CLK_MSR_ID(183, "sys_cpu_ring_osc_clk[3]"),
618+
CLK_MSR_ID(184, "sys_cpu_ring_osc_clk[4]"),
619+
CLK_MSR_ID(185, "sys_cpu_ring_osc_clk[5]"),
620+
CLK_MSR_ID(186, "sys_cpu_ring_osc_clk[6]"),
621+
CLK_MSR_ID(187, "sys_cpu_ring_osc_clk[7]"),
622+
CLK_MSR_ID(188, "sys_cpu_ring_osc_clk[8]"),
623+
CLK_MSR_ID(189, "sys_cpu_ring_osc_clk[9]"),
624+
CLK_MSR_ID(190, "sys_cpu_ring_osc_clk[10]"),
625+
CLK_MSR_ID(191, "sys_cpu_ring_osc_clk[11]"),
626+
CLK_MSR_ID(192, "am_ring_osc_clk_out[12](dmc)"),
627+
CLK_MSR_ID(193, "am_ring_osc_clk_out[13](rama)"),
628+
CLK_MSR_ID(194, "am_ring_osc_clk_out[14](nna)"),
629+
CLK_MSR_ID(195, "am_ring_osc_clk_out[15](nna)"),
630+
CLK_MSR_ID(200, "rng_ring_osc_clk_1[0]"),
631+
CLK_MSR_ID(201, "rng_ring_osc_clk_1[1]"),
632+
CLK_MSR_ID(202, "rng_ring_osc_clk_1[2]"),
633+
CLK_MSR_ID(203, "rng_ring_osc_clk_1[3]"),
634+
635+
};
636+
497637
static int meson_measure_id(struct meson_msr_id *clk_msr_id,
498638
unsigned int duration)
499639
{
@@ -714,6 +854,19 @@ static const struct meson_msr_data clk_msr_sm1_data = {
714854
.reg = &msr_reg_offset,
715855
};
716856

857+
static const struct msr_reg_offset msr_reg_offset_v2 = {
858+
.freq_ctrl = 0x0,
859+
.duty_ctrl = 0x4,
860+
.freq_val = 0x8,
861+
.duty_val = 0x18,
862+
};
863+
864+
static const struct meson_msr_data clk_msr_c3_data = {
865+
.msr_table = (void *)clk_msr_c3,
866+
.msr_count = ARRAY_SIZE(clk_msr_c3),
867+
.reg = &msr_reg_offset_v2,
868+
};
869+
717870
static const struct of_device_id meson_msr_match_table[] = {
718871
{
719872
.compatible = "amlogic,meson-gx-clk-measure",
@@ -739,6 +892,10 @@ static const struct of_device_id meson_msr_match_table[] = {
739892
.compatible = "amlogic,meson-sm1-clk-measure",
740893
.data = &clk_msr_sm1_data,
741894
},
895+
{
896+
.compatible = "amlogic,c3-clk-measure",
897+
.data = &clk_msr_c3_data,
898+
},
742899
{ /* sentinel */ }
743900
};
744901
MODULE_DEVICE_TABLE(of, meson_msr_match_table);

0 commit comments

Comments
 (0)