PLATFORM_mx53 = "IMX53"
PLATFORM_mx51 = "IMX51"
-SRC_URI = "${FSL_MIRROR}/imx-test-${PV}.tar.gz"
+SRC_URI = "${FSL_MIRROR}/imx-test-${PV}.tar.gz \
+ file://clocks.sh"
+
do_compile() {
LDFLAGS="" make PLATFORM=${PLATFORM} LINUXPATH=${STAGING_KERNEL_DIR} \
do_install() {
install -d ${D}/unit_tests
install -m 755 test-utils.sh ${D}/unit_tests/test-utils.sh
+ install -m 0755 ${WORKDIR}/clocks.sh ${D}/unit_tests/clocks.sh
install -m 755 ${S}/platform/${PLATFORM}/* ${D}/unit_tests/
}
--- /dev/null
+#!/bin/bash
+
+# This script is taken directly from the section 5.10 of the Freescale Application Note
+# AN4509 and it simple prints the CPU clocks in a nice format
+
+saved_path=$PWD
+if ! mount|grep -sq '/sys/kernel/debug'; then
+ mount -t debugfs none /sys/kernel/debug
+fi
+
+printf "%-24s %-20s %3s %9s\n" "clock" "parent" "use" "flags" "rate"
+
+for foo in $(find /sys/kernel/debug/clock -type d); do
+ if [ "$foo" = '/sys/kernel/debug/clock' ]; then
+ continue
+ fi
+ cd $foo
+ ec="$(cat usecount)"
+ rate="$(cat rate)"
+ flag="$(cat flags)"
+ clk="$(basename $foo)"
+ cd ..
+ parent="$(basename $PWD)"
+ if [ "$parent" = 'clock' ]; then
+ parent=" ---"
+ fi
+ printf "%-24s %-24s %2d %2d %10d\n" "$clk" "$parent" "$ec" "$flag" "$rate"
+ cd $saved_path
+done