diff options
| author | Leonardo Sandoval <leonardo.sandoval@freescale.com> | 2013-01-10 13:32:04 -0600 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2013-01-11 10:43:28 -0200 |
| commit | 11cd0dbb3ee81797a1c313c50caa9894270656cb (patch) | |
| tree | f3dfe452e404be61c84541fa2dae64dba16b88c2 | |
| parent | 78774f79f352c23ef55e6a23173678232c5311ad (diff) | |
| download | meta-fsl-arm-11cd0dbb3ee81797a1c313c50caa9894270656cb.tar.gz | |
imx-test: Add script to print system clocks
This adds a 'clocks.sh' which can print the system clocks of the system.
[YOCTO #3586]
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@freescale.com>
| -rw-r--r-- | recipes-bsp/imx-test/imx-test.inc | 5 | ||||
| -rwxr-xr-x | recipes-bsp/imx-test/imx-test/clocks.sh | 29 |
2 files changed, 33 insertions, 1 deletions
diff --git a/recipes-bsp/imx-test/imx-test.inc b/recipes-bsp/imx-test/imx-test.inc index 52ead1c..b3b9a07 100644 --- a/recipes-bsp/imx-test/imx-test.inc +++ b/recipes-bsp/imx-test/imx-test.inc | |||
| @@ -11,7 +11,9 @@ PLATFORM_mx6 = "IMX6Q" | |||
| 11 | PLATFORM_mx53 = "IMX53" | 11 | PLATFORM_mx53 = "IMX53" |
| 12 | PLATFORM_mx51 = "IMX51" | 12 | PLATFORM_mx51 = "IMX51" |
| 13 | 13 | ||
| 14 | SRC_URI = "${FSL_MIRROR}/imx-test-${PV}.tar.gz" | 14 | SRC_URI = "${FSL_MIRROR}/imx-test-${PV}.tar.gz \ |
| 15 | file://clocks.sh" | ||
| 16 | |||
| 15 | 17 | ||
| 16 | do_compile() { | 18 | do_compile() { |
| 17 | LDFLAGS="" make PLATFORM=${PLATFORM} LINUXPATH=${STAGING_KERNEL_DIR} \ | 19 | LDFLAGS="" make PLATFORM=${PLATFORM} LINUXPATH=${STAGING_KERNEL_DIR} \ |
| @@ -21,6 +23,7 @@ do_compile() { | |||
| 21 | do_install() { | 23 | do_install() { |
| 22 | install -d ${D}/unit_tests | 24 | install -d ${D}/unit_tests |
| 23 | install -m 755 test-utils.sh ${D}/unit_tests/test-utils.sh | 25 | install -m 755 test-utils.sh ${D}/unit_tests/test-utils.sh |
| 26 | install -m 0755 ${WORKDIR}/clocks.sh ${D}/unit_tests/clocks.sh | ||
| 24 | install -m 755 ${S}/platform/${PLATFORM}/* ${D}/unit_tests/ | 27 | install -m 755 ${S}/platform/${PLATFORM}/* ${D}/unit_tests/ |
| 25 | } | 28 | } |
| 26 | 29 | ||
diff --git a/recipes-bsp/imx-test/imx-test/clocks.sh b/recipes-bsp/imx-test/imx-test/clocks.sh new file mode 100755 index 0000000..2121bef --- /dev/null +++ b/recipes-bsp/imx-test/imx-test/clocks.sh | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # This script is taken directly from the section 5.10 of the Freescale Application Note | ||
| 4 | # AN4509 and it simple prints the CPU clocks in a nice format | ||
| 5 | |||
| 6 | saved_path=$PWD | ||
| 7 | if ! mount|grep -sq '/sys/kernel/debug'; then | ||
| 8 | mount -t debugfs none /sys/kernel/debug | ||
| 9 | fi | ||
| 10 | |||
| 11 | printf "%-24s %-20s %3s %9s\n" "clock" "parent" "use" "flags" "rate" | ||
| 12 | |||
| 13 | for foo in $(find /sys/kernel/debug/clock -type d); do | ||
| 14 | if [ "$foo" = '/sys/kernel/debug/clock' ]; then | ||
| 15 | continue | ||
| 16 | fi | ||
| 17 | cd $foo | ||
| 18 | ec="$(cat usecount)" | ||
| 19 | rate="$(cat rate)" | ||
| 20 | flag="$(cat flags)" | ||
| 21 | clk="$(basename $foo)" | ||
| 22 | cd .. | ||
| 23 | parent="$(basename $PWD)" | ||
| 24 | if [ "$parent" = 'clock' ]; then | ||
| 25 | parent=" ---" | ||
| 26 | fi | ||
| 27 | printf "%-24s %-24s %2d %2d %10d\n" "$clk" "$parent" "$ec" "$flag" "$rate" | ||
| 28 | cd $saved_path | ||
| 29 | done | ||
