码迷,mamicode.com
首页 > 其他好文 > 详细

I.MX6 各模块 clock 查询

时间:2016-08-01 17:15:44      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:

/*********************************************************************
 *                   I.MX6 各模块 clock 查询
 * 说明:
 *     今天在查资料的时候无意中发现了查看内核时钟频率的方法,这东西
 * 我一直以为不能查,只能通过查看源代码来看。
 * 
 *                                   2016-8-1 深圳 南山平山村 曾剑锋
 ********************************************************************/

一、参考文档:
    How to use & access iMX6 peripherals (Examples)
        http://www.imx6rex.com/software/imx6-rex-basic-hw-verification-tests/#dump_clocks

二、参考代码:
    #!/system/bin/sh
     
    if ! mount|grep -sq /sys/kernel/debug; then
        mount -t debugfs none /sys/kernel/debug
    fi
     
    saved_path=$PWD
     
    busybox printf "%-24s %-24s %3s %9s\n" "clock" "parent" "use" "rate"
     
    for foo in $(busybox find /sys/kernel/debug/clock -type d); do
        if [ "$foo" = /sys/kernel/debug/clock ]; then
            continue
        fi
     
        cd $foo
     
        use="$(cat usecount)"
        rate="$(cat rate)"
     
        clk="$(busybox basename $foo)"
        cd ..
        parent="$(busybox basename $PWD)"
     
        if [ "$parent" = clock ]; then
            parent="   ---"
        fi
     
        busybox printf "%-24s %-24s %2d %10d\n" "$clk" "$parent" "$use" "$rate"
     
        cd $saved_path
    done

三、输出结果:
    root@android:/data/local # ./clock.sh                                          
    clock                    parent                   use      rate
    ckih_clk                    ---                    0          0
    ckih2_clk                   ---                    0          0
    ckil_clk                    ---                    0      32768
    caam_mem_clk                ---                    0          0
    anaclk_1                    ---                    0          0
    anaclk_2                    ---                    0          0
    osc_clk                     ---                    6   24000000
    pll6_mlb150_main_clk     osc_clk                   0   24000000
    pll7_usb_host_main_clk   osc_clk                   0  480000000
    pll1_sys_main_clk        osc_clk                   1  996000000
    pll1_sw_clk              pll1_sys_main_clk         1  996000000
    cpu_clk                  pll1_sw_clk               1  996000000
    twd_clk                  cpu_clk                   0  498000000
    pll5_video_main_clk      osc_clk                   1  266539998
    ipu1_di_clk_0            pll5_video_main_clk       1   66634999
    ipu1_di_clk_1            pll5_video_main_clk       0   88846666
    ipu2_di_clk_0            pll5_video_main_clk       0   88846666
    pll4_audio_main_clk      osc_clk                   0  175999998
    asrc_clk                 pll4_audio_main_clk       0  175999998
    gpt_clk                  osc_clk                   1    3000000
    pll8_enet_main_clk       osc_clk                   0   24000000
    enet_clk                 pll8_enet_main_clk        0   50000000
    sata_clk                 pll8_enet_main_clk        0   24000000
    clko2_clk                osc_clk                   1   24000000
    clko_clk                 clko2_clk                 0   24000000
    pll2_528_bus_main_clk    osc_clk                   1  528000000
    pll2_pfd_352M            pll2_528_bus_main_clk     0  452571428
    ldb_di0_clk              pll2_pfd_352M             0   64653061
    ldb_di1_clk              pll2_pfd_352M             0   64653061
    pll2_pfd_594M            pll2_528_bus_main_clk     0  528000000
    gpu3d_core_clk           pll2_pfd_594M             0  528000000
    gpu3d_shader_clk         pll2_pfd_594M             0  528000000
    gpu2d_core_clk           gpu3d_shader_clk          0  528000000
    pll2_pfd_400M            pll2_528_bus_main_clk     2  396000000
    pll2_200M                pll2_pfd_400M             0  198000000
    mmdc_ch1_axi_clk         pll2_pfd_400M             0  396000000
    usdhc1_clk               pll2_pfd_400M             0  198000000
    usdhc2_clk               pll2_pfd_400M             0  198000000
    emi_clk                  pll2_pfd_400M             0  198000000
    hsi_tx_clk               pll2_pfd_400M             0  198000000
    enfc_clk                 pll2_pfd_400M             0   19800000
    gpmi_io_clk              enfc_clk                  0   19800000
    usdhc4_clk               pll2_pfd_400M             0  198000000
    gpmi_bch_clk             usdhc4_clk                0  198000000
    usdhc3_clk               pll2_pfd_400M             0  198000000
    apbh_dma_clk             usdhc3_clk                0  198000000
    gpmi_apb_clk             usdhc3_clk                0  198000000
    gpmi_bch_apb_clk         usdhc3_clk                0  198000000
    ipu2_clk                 pll2_pfd_400M             0  198000000
    periph_clk               pll2_pfd_400M             3  396000000
    ahb_clk                  periph_clk                4  132000000
    sdma_clk                 ahb_clk                   0  132000000
    mx6per1_clk              ahb_clk                   1  132000000
    pl301_mx6qperl_bch       mx6per1_clk               0  132000000
    ipg_clk                  ahb_clk                   4   66000000
    spba_clk                 ipg_clk                   0   66000000
    iim_clk                  ipg_clk                   1   66000000
    ipg_perclk               ipg_clk                   1   16500000
    i2c_clk_0                ipg_perclk                0   16500000
    i2c_clk_1                ipg_perclk                0   16500000
    i2c_clk_2                ipg_perclk                0   16500000
    pwm_clk_0                ipg_perclk                1   16500000
    pwm_clk_1                ipg_perclk                0   16500000
    pwm_clk_2                ipg_perclk                0   16500000
    pwm_clk_3                ipg_perclk                0   16500000
    usboh3_clk               ahb_clk                   1  132000000
    hdmi_iahb_clk            ahb_clk                   0  132000000
    aips_tz2_clk             ahb_clk                   0  132000000
    aips_tz1_clk             ahb_clk                   0  132000000
    mmdc_ch0_axi_clk         periph_clk                2  396000000
    gpu3d_axi_clk            mmdc_ch0_axi_clk          0  396000000
    gpu2d_axi_clk            mmdc_ch0_axi_clk          0  396000000
    openvg_axi_clk           gpu2d_axi_clk             0  396000000
    perfmon0_clk             mmdc_ch0_axi_clk          0  396000000
    perfmon2_clk             mmdc_ch0_axi_clk          0  396000000
    pll3_usb_otg_main_clk    osc_clk                   4  480000000
    pll3_pfd_720M            pll3_usb_otg_main_clk     0  720000000
    pll3_pfd_508M            pll3_usb_otg_main_clk     0  508235294
    ssi1_clk                 pll3_pfd_508M             0   63529411
    ssi2_clk                 pll3_pfd_508M             0   63529411
    ssi3_clk                 pll3_pfd_508M             0   63529411
    pll3_pfd_454M            pll3_usb_otg_main_clk     0  454736842
    spdif0_clk_0             pll3_pfd_454M             0   28421052
    usb_phy1_clk             pll3_usb_otg_main_clk     1 1010065408
    usb_phy3_clk             pll3_usb_otg_main_clk     0 1010065408
    usb_phy4_clk             pll3_usb_otg_main_clk     0 1010065408
    pll3_sw_clk              pll3_usb_otg_main_clk     1  480000000
    pll3_120M                pll3_sw_clk               0  120000000
    esai_clk                 pll3_sw_clk               0   30000000
    pll3_60M                 pll3_sw_clk               0   60000000
    can_clk_root             pll3_60M                  0   30000000
    can1_module_clk          can_clk_root              0   30000000
    can2_module_clk          can_clk_root              0   30000000
    ecspi0_clk               pll3_60M                  0   60000000
    ecspi1_clk               pll3_60M                  0   60000000
    ecspi2_clk               pll3_60M                  0   60000000
    ecspi3_clk               pll3_60M                  0   60000000
    ecspi4_clk               pll3_60M                  0   60000000
    pll3_80M                 pll3_sw_clk               1   80000000
    uart_clk                 pll3_80M                  1   80000000
    asrc_serial_clk          pll3_sw_clk               0    7500000
    mlb150_clk               pll3_sw_clk               0  480000000
    pll3_pfd_540M            pll3_usb_otg_main_clk     3  270000000
    hdmi_isfr_clk            pll3_pfd_540M             0  270000000
    mipi_pllref_clk          pll3_pfd_540M             1  270000000
    axi_clk                  pll3_pfd_540M             1  135000000
    vpu_clk                  axi_clk                   0  135000000
    emi_slow_clk             axi_clk                   0   67500000
    pcie_axi_clk             axi_clk                   0  135000000
    pcie_clk                 pcie_axi_clk              0  135000000
    vdo_axi_clk              axi_clk                   0  135000000
    vdoa_clk                 vdo_axi_clk               0  135000000
    ipu2_di_clk_1            pll3_pfd_540M             0  135000000
    ipu1_clk                 pll3_pfd_540M             1  135000000
    perfmon1_clk             ipu1_clk                  0  135000000
    ipu1_pixel_clk_0         ipu1_clk                  1   66634999
    ipu1_pixel_clk_1         ipu1_clk                  0  135000000
    root@android:/data/local # 

 

I.MX6 各模块 clock 查询

标签:

原文地址:http://www.cnblogs.com/zengjfgit/p/5726160.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!