강좌 & 팁
글 수 2,412
2015.04.10 23:05:15 (*.134.169.166)
41370
cpu 는 내부적으로 다양한 클럭들을 만들어 사용 합니다.
그런 클럭들을 한번에 확인하는 좋은 스크립트가 있어 소개 합니다.
------------------------------------------------------------------
#!/bin/bash
if ! mount|grep -sq '/sys/kernel/debug'; then
mount -t debugfs none /sys/kernel/debug
fi
saved_path=$PWD
printf "%-24s %-24s %3s %9s\n" "clock" "parent" "use" "rate"
for foo in $(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="$(basename $foo)"
cd ..
parent="$(basename $PWD)"
if [ "$parent" = 'clock' ]; then
parent=" ---"
fi
printf "%-24s %-24s %2d %10d\n" "$clk" "$parent" "$use" "$rate"
cd $saved_path
done
---------------------------------------------------------------------
여기 까지를 clk_dump.sh 이라는 이름으로 저장 하고
em-imx6dq 모듈에서 실행해 봅시다.
아래와 같이 나옵니다.
root@primero-s:/mnt/nfs/r2adve# ./clkd_ump.sh
clock parent use rate
ckih_clk --- 0 0
ckih2_clk --- 0 0
ckil_clk --- 0 32768
caam_mem_clk --- 0 0
mlb150_clk --- 0 0
anaclk_1 --- 0 0
anaclk_2 --- 0 0
osc_clk --- 7 24000000
pll6_mlb150_main_clk osc_clk 0 24000000
pll7_usb_host_main_clk osc_clk 0 480000000
pll1_sys_main_clk osc_clk 0 24000000
pll1_sw_clk pll1_sys_main_clk 1 352000000
cpu_clk pll1_sw_clk 1 352000000
twd_clk cpu_clk 0 176000000
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 1 24000000
enet_clk pll8_enet_main_clk 1 50000000
sata_clk pll8_enet_main_clk 0 24000000
clko2_clk osc_clk 1 24000000
clko_clk clko2_clk 0 24000000
pll3_usb_otg_main_clk osc_clk 3 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
gpu2d_core_clk pll3_usb_otg_main_clk 0 480000000
usb_phy1_clk pll3_usb_otg_main_clk 0 1010065408
usb_phy3_clk pll3_usb_otg_main_clk 0 1010065408
usb_phy4_clk pll3_usb_otg_main_clk 0 1010065408
pll3_pfd_540M pll3_usb_otg_main_clk 1 540000000
hdmi_isfr_clk pll3_pfd_540M 1 540000000
mipi_pllref_clk pll3_pfd_540M 0 540000000
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_80M pll3_sw_clk 1 80000000
uart_clk pll3_80M 1 80000000
asrc_serial_clk pll3_sw_clk 0 7500000
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
pll5_video_main_clk osc_clk 1 297000000
ipu1_di_clk_1 pll5_video_main_clk 0 99000000
ipu1_di_clk_0 pll5_video_main_clk 1 148500000
ipu1_pixel_clk_0 ipu1_di_clk_0 1 148500000
pll2_528_bus_main_clk osc_clk 1 528000000
pll2_pfd_594M pll2_528_bus_main_clk 0 594000000
gpu3d_shader_clk pll2_pfd_594M 0 594000000
pll2_pfd_352M pll2_528_bus_main_clk 0 352000000
ldb_di0_clk pll2_pfd_352M 0 50285714
ipu2_di_clk_0 ldb_di0_clk 0 50285714
ldb_di1_clk pll2_pfd_352M 0 50285714
ipu2_di_clk_1 ldb_di1_clk 0 50285714
pll2_pfd_400M pll2_528_bus_main_clk 2 352000000
pll2_200M pll2_pfd_400M 0 176000000
mmdc_ch1_axi_clk pll2_pfd_400M 0 352000000
vpu_clk pll2_pfd_400M 0 352000000
usdhc1_clk pll2_pfd_400M 0 176000000
usdhc2_clk pll2_pfd_400M 0 176000000
emi_clk pll2_pfd_400M 0 176000000
hsi_tx_clk pll2_pfd_400M 0 176000000
enfc_clk pll2_pfd_400M 0 19555555
gpmi_io_clk enfc_clk 0 19555555
usdhc4_clk pll2_pfd_400M 0 176000000
gpmi_bch_clk usdhc4_clk 0 176000000
usdhc3_clk pll2_pfd_400M 0 176000000
apbh_dma_clk usdhc3_clk 0 176000000
gpmi_apb_clk usdhc3_clk 0 176000000
gpmi_bch_apb_clk usdhc3_clk 0 176000000
periph_clk pll2_pfd_400M 4 352000000
axi_clk periph_clk 1 176000000
gpu3d_axi_clk axi_clk 0 176000000
emi_slow_clk axi_clk 0 88000000
gpu2d_axi_clk axi_clk 0 176000000
openvg_axi_clk gpu2d_axi_clk 0 176000000
pcie_axi_clk axi_clk 0 176000000
pcie_clk pcie_axi_clk 0 176000000
pcie_ep_clk pcie_axi_clk 0 176000000
vdo_axi_clk axi_clk 0 176000000
vdoa_clk vdo_axi_clk 0 176000000
ahb_clk periph_clk 5 117333333
sdma_clk ahb_clk 0 117333333
mx6per1_clk ahb_clk 2 117333333
pl301_mx6qperl_bch mx6per1_clk 0 117333333
ipg_clk ahb_clk 4 58666666
spba_clk ipg_clk 0 58666666
iim_clk ipg_clk 1 58666666
ipg_perclk ipg_clk 1 19555555
i2c_clk_0 ipg_perclk 0 19555555
i2c_clk_1 ipg_perclk 0 19555555
i2c_clk_2 ipg_perclk 0 19555555
pwm_clk_0 ipg_perclk 1 19555555
pwm_clk_1 ipg_perclk 0 19555555
pwm_clk_2 ipg_perclk 0 19555555
pwm_clk_3 ipg_perclk 0 19555555
enet_mdc_clk ipg_clk 0 58666666
usboh3_clk ahb_clk 1 117333333
hdmi_iahb_clk ahb_clk 1 117333333
aips_tz2_clk ahb_clk 0 117333333
aips_tz1_clk ahb_clk 0 117333333
mmdc_ch0_axi_clk periph_clk 4 352000000
gpu3d_core_clk mmdc_ch0_axi_clk 0 352000000
perfmon0_clk mmdc_ch0_axi_clk 0 352000000
perfmon2_clk mmdc_ch0_axi_clk 0 352000000
ipu1_clk mmdc_ch0_axi_clk 1 176000000
perfmon1_clk ipu1_clk 0 176000000
ipu1_pixel_clk_1 ipu1_clk 0 0
ipu2_clk mmdc_ch0_axi_clk 0 176000000
ipu2_pixel_clk_0 ipu2_clk 0 0
ipu2_pixel_clk_1 ipu2_clk 0 0
root@primero-s:/mnt/nfs/r2adve/higen/drv# ^C
죽여주네 ㅎ