diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2017-04-24 14:35:58 +0200 |
---|---|---|
committer | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2017-04-24 14:35:58 +0200 |
commit | 81a0c84ade760ee4674aa397a8943a52fec14e75 (patch) | |
tree | 6d78f1ee2ca7aa2345ab84d533b78bbecfbba860 | |
parent | 06741fee2a537060347a555679f12df202183a34 (diff) |
qdsp-start: add support for 4.9 remoteproc implementation
In kernel 4.9 (and upstream) the remoteproc implementation was changed, and we
should now use /sys/class/remoteproc instead of debugfs. This patch adds
supports for remoteproc instances in /sys/class/remoteproc and falls back to the
old implementation, so that it should be backward compatible.
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rwxr-xr-x | qdsp-start | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -1,18 +1,29 @@ #!/bin/sh # check if we have a qDSP available on the platform -found=0 + +# new implementation of remoteproc use /sys/class/remoteproc +# instead of debugfs +for f in $(ls -d /sys/class/remoteproc/* 2> /dev/null); do + device=$(readlink -f "$f"/device) + name=$(basename "$device") + if [ "${name%.hexagon}" != "$name" ] ; then + echo "Found Hexagon at $f" + echo start > "$f"/state + exit + fi +done + for f in $(ls /sys/kernel/debug/remoteproc/*/name 2> /dev/null); do name=$(cat "$f") if [ "${name%.hexagon}" != "$name" ] ; then f=$(dirname "$f") echo "Found Hexagon at $f" - found=1 - break + echo start > "$f"/state + exit fi done -# no, then move on.. -[ $found -eq 0 ] && exit +# no found, then move on.. +exit -echo start > "$f"/state |