diff options
author | Leonardo Sandoval <leonardo.sandoval@freescale.com> | 2013-01-10 13:32:04 -0600 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2013-02-19 17:29:25 -0300 |
commit | 4616e02acf6ac6e86c7c782546829af11911c687 (patch) | |
tree | a2c20cadf1b43d861d04c6a7a91a5c84f84019ef | |
parent | ec0a11a81106b1fe154f5b3e142d5c4a1508bced (diff) | |
download | meta-fsl-arm-4616e02acf6ac6e86c7c782546829af11911c687.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 | ||