summaryrefslogtreecommitdiff
path: root/msm-platforms/msm-platforms.sh
blob: 535eb4463a11a817a49852f59bbffc7105f4432f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash

OUTPUT=$(mktemp)
OUTPUT_CSV=$(mktemp --suffix .csv)

echo "Year, SHA, Type, Subtype, Name" > ${OUTPUT_CSV}

for year in $(seq 2008 $(date +%Y)); do

    # Find 'last' commit of the year
    sha=$(git rev-list -1 --before="${year}-12-31" HEAD)
    echo "Year: $year - SHA: $sha"

    # very old stuff, platform files
    # mahimahi and sapphire have board file, but not include in Makefile, exclude them
    # trout and halibut use the same SoC, only count one for the SoC
    if git show ${sha}:arch/arm/mach-msm/ &> ${OUTPUT}; then
	grep 'board-.*\.c' ${OUTPUT} | \
	    grep -v '\(-panel\|-mmc\|-gpio\|-dt\|-mahimahi\|-sapphire\)' | \
	    while read -r line ; do
		echo "${year}, ${sha}, HW Device, Arm Board File, ${line}" >> ${OUTPUT_CSV}
	    done

	grep 'board-.*\.c' ${OUTPUT} | \
	    grep -v '\(-panel\|-mmc\|-gpio\|-dt\|-mahimahi\|-sapphire\|trout\)' | \
	    while read -r line ; do
		echo "${year}, ${sha}, SoC, Arm Board File, ${line}" >> ${OUTPUT_CSV}
	    done
    fi

    # arm32 DT
    if git show ${sha}:arch/arm/boot/dts/ &> ${OUTPUT}; then
	grep 'qcom-\(msm\|mdm\|ipq\|apq\|sdx\).*.dtsi' ${OUTPUT} | \
	    grep -v 'qcom-.*-' | \
	    while read -r line ; do
		echo "${year}, ${sha}, SoC, Arm32 DT Platform, ${line}" >> ${OUTPUT_CSV}
	    done

	grep 'qcom-\(msm\|mdm\|ipq\|apq\|sdx\).*.dts$' ${OUTPUT} | while read -r line ; do
	    echo "${year}, ${sha}, HW Device, Arm32 DT Board, ${line}" >> ${OUTPUT_CSV}
	done
    fi

    # arm64 DT
    if git show ${sha}:arch/arm64/boot/dts/qcom/ &> ${OUTPUT}; then
	grep '\(apq\|ipq\|msm\|sc\|sdm\|sm\|sa\|qcs\).*\.dtsi' ${OUTPUT} | \
	    grep -v '\-' | \
	    while read -r line ; do
		echo "${year}, ${sha}, SoC, Arm64 DT Plaform, ${line}" >> ${OUTPUT_CSV}
	    done

	grep '\(apq\|ipq\|msm\|sc\|sdm\|sm\|sa|\qcs\).*\.dts$' ${OUTPUT}  | while read -r line ; do
	    echo "${year}, ${sha}, HW Device, Arm64 DT Board, ${line}" >> ${OUTPUT_CSV}
	done

    fi

done

echo "Completed. Output file in ${OUTPUT_CSV}"