aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh')
-rw-r--r--recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh b/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh
new file mode 100644
index 0000000..0e3cc10
--- /dev/null
+++ b/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+JSON="$2"
+
+iter=0
+echo "[" > "${JSON}"
+for file in $1/bdwlan.elf $1/bdwlan.e* ; do
+ iter=$((iter+1))
+ [ $iter -ne 1 ] && echo " }," >> "${JSON}"
+
+ echo " {" >> "${JSON}"
+ echo " \"data\": \"$file\"," >> "${JSON}"
+ if [ `basename $file` = "bdwlan.elf" ]; then
+ file_ext="255"
+ else
+ file_ext="$(( $(basename "${file}" | sed -E 's:^.*\.e?([0-9a-f]*)$:0x\1:') ))"
+ fi
+ echo " \"names\": [\"bus=pci,qmi-chip-id=0,qmi-board-id=${file_ext}\"]" >> "${JSON}"
+done
+
+echo " }" >> "${JSON}"
+echo "]" >> "${JSON}"
+