Debian Codegraph @

util/scripts/show_platforms.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 #
3 # SPDX-License-Identifier: GPL-2.0-only
4 #
5 # This script finds all of the top-level mainboards, then goes through
6 # and finds the date the directory was added, the processor type, and
7 # the board type.
8 #
9 # This could be improved by finding all of the variants, then figuring
10 # out when those veriants were added.
11 # It's also very slow, but only needs to be run once in a while...
12
13 readarray -t platforms < <(findscip-shell system . . find. src/mainboard -mindepth 3 -name 'Kconfig' | sortscip-shell system . . sort.)
14
15 echoscip-shell system . . echo. '```eval_rst'
16 echoscip-shell system . . echo. "+-------------------------------+------------------------+------------+-----------+"
17 echoscip-shell system . . echo. "| Vendor/Board | Processor | Date added | Brd type |"
18 echoscip-shell system . . echo. "+===============================+========================+============+===========+"
19
20 for file in "${platforms[@]}"; do
21 platformname="$(echoscip-shell system . . echo. "${file}" | sedscip-shell system . . sed. 's|.*/mainboard/||;s|/Kconfig||')"
22 if [[ ! -f "${file/Kconfig/board_info.txt}" ]]; then
23 continue
24 fi
25 chips="$(grepscip-shell system . . grep. "CPU_\|SOC_\|NORTHBRIDGE" "${file}" |
26 grepscip-shell system . . grep. -v "SUBTYPE\|COMMON\|SOCKET\|ENABLE\|CONSOLE\|SMU\|depends on\|ESPI\|INTEL_CSE\|NORTHBRIDGE_AMD_AGESA\|INTEL_SLOT\|REBOOT\|DISABLE" |
27 sedscip-shell system . . sed. -e 's|\s\+select\s\+||' \
28 -escip-shell system . . sort. 's|\s\+if.*||' \
29 -e 's|SKYLAKE_SOC_PCH|INTEL_SKYLAKE|' \
30 -e 's|CPU_AMD_AGESA|AMD|' \
31 -e 's|SOC_INTEL_ALDERLAKE_PCH_|INTEL_ALDERLAKE|' \
32 -e 's|QC_|QUALCOMM_|' \
33 -e 's/SOC_\|NORTHBRIDGE_\|PCH_\|CPU_//g' |
34 sort -u)"
35 if [[ ! -f ${file/Kconfig/board_info.txt} ]]; then
36 continue
37 fi
38 create_date="$(gitscip-shell system . . git. log --format="format:%cs" -- "${file}" | tailscip-shell system . . tail. -n1)"
39 platform_type="$(sedscip-shell system . . sed. -nE -e 's/Category: (.*)/\1/p' "${file/Kconfig/board_info.txt}" 2>/dev/nullscip-shell filesystem . . `/dev/null`.)"
40 for chip in ${chips}; do
41
42 printfscip-shell system . . printf. "| %-29s | %-22s | %-10s | %-9s |\n" "${platformname}" "${chip}" "${create_date}" "${platform_type}"
43 echoscip-shell system . . echo. "+-------------------------------+------------------------+------------+-----------+"
44 done
45 done
46
47 echoscip-shell system . . echo. '```'