blob: 410a84cf42c4ec77f3ff424b3c8c592a4eeaf191 [file] [log] [blame]
Martin Roth65a0e5a2022-04-23 15:19:11 -06001#!/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
13readarray -t platforms < <(find src/mainboard -mindepth 3 -name 'Kconfig' | sort)
14
15echo '```eval_rst'
16echo "+-------------------------------+------------------------+------------+-----------+"
17echo "| Vendor/Board | Processor | Date added | Brd type |"
18echo "+===============================+========================+============+===========+"
19
20for file in "${platforms[@]}"; do
21 platformname="$(echo "${file}" | sed 's|.*/mainboard/||;s|/Kconfig||')"
22 if [[ ! -f "${file/Kconfig/board_info.txt}" ]]; then
23 continue
24 fi
25 chips="$(grep "CPU_\|SOC_\|NORTHBRIDGE" "${file}" |
26 grep -v "SUBTYPE\|COMMON\|SOCKET\|ENABLE\|CONSOLE\|SMU\|depends on\|ESPI\|INTEL_CSE\|NORTHBRIDGE_AMD_AGESA\|INTEL_SLOT\|REBOOT\|DISABLE" |
27 sed -e 's|\s\+select\s\+||' \
28 -e '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="$(git log --format="format:%cs" -- "${file}" | tail -n1)"
39 platform_type="$(sed -nE -e 's/Category: (.*)/\1/p' "${file/Kconfig/board_info.txt}" 2>/dev/null)"
40 for chip in ${chips}; do
41
42 printf "| %-29s | %-22s | %-10s | %-9s |\n" "${platformname}" "${chip}" "${create_date}" "${platform_type}"
Nicholas Chin8bf53c02023-01-30 22:48:21 -070043 echo "+-------------------------------+------------------------+------------+-----------+"
Martin Roth65a0e5a2022-04-23 15:19:11 -060044 done
45done
46
Martin Roth65a0e5a2022-04-23 15:19:11 -060047echo '```'