Nick Vaccaro has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39462 )
Change subject: coreboot: add Volteer template files
......................................................................
coreboot: add Volteer template files
Add template files for making a new barebones-copy of Volteer.
Also move the coreboot scripts according to CLs that landed
after this branch was created.
BUG=b:147483699
BRANCH=None
TEST=N/A
Change-Id: I8cc69b8ce7dbc6809de058019bdc466a060069e7
Signed-off-by: Nick Vaccaro <nvaccaro(a)google.com>
---
A util/mainboard/google/create_coreboot_variant.sh
A util/mainboard/google/kconfig.py
M util/mainboard/google/volteer/template/Makefile.inc
A util/mainboard/google/volteer/template/include/variant/ec.h
A util/mainboard/google/volteer/template/include/variant/gpio.h
A util/mainboard/google/volteer/template/overridetree.cb
6 files changed, 283 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/39462/1
diff --git a/util/mainboard/google/create_coreboot_variant.sh b/util/mainboard/google/create_coreboot_variant.sh
new file mode 100755
index 0000000..245bc1f
--- /dev/null
+++ b/util/mainboard/google/create_coreboot_variant.sh
@@ -0,0 +1,86 @@
+#!/bin/bash
+#
+# This file is part of the coreboot project.
+#
+# Copyright 2020 Google LLC.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+VERSION="1.0.2"
+SCRIPT=$(basename -- "${0}")
+
+export LC_ALL=C
+
+if [[ "$#" -lt 2 ]]; then
+ echo "Usage: ${SCRIPT} base_name variant_name [bug_number]"
+ echo "e.g. ${SCRIPT} hatch kohaku b:140261109"
+ echo "* Adds a new variant of the baseboard to Kconfig and Kconfig.name"
+ echo "* Copies the template files for the baseboard to the new variant"
+ exit 1
+fi
+
+# This is the name of the base board that we're using to make the variant.
+# ${var,,} converts to all lowercase.
+BASE="${1,,}"
+# This is the name of the variant that is being cloned.
+# ${var,,} converts to all lowercase; ${var^^} is all uppercase.
+VARIANT="${2,,}"
+VARIANT_UPPER="${VARIANT^^}"
+
+# Assign BUG= text, or "None" if that parameter was not specified.
+BUG=${3:-None}
+
+# This script lives in util/mainboard/google
+# The template files are in util/mainboard/google/${BASE}/templates
+# We need to create files in src/mainboard/google/${BASE}/variants/${VARIANT}
+pushd "${BASH_SOURCE%/*}" || exit 1
+SRC=$(pwd)
+popd || exit 1
+pushd "${SRC}/../../../src/mainboard/google/${BASE}" || {
+ echo "The baseboard directory for ${BASE} does not exist.";
+ exit 1; }
+
+# Make sure the variant doesn't already exist.
+if [[ -e variants/${VARIANT} ]]; then
+ echo "variants/${VARIANT} already exists."
+ echo "Have you already created this variant?"
+ exit 1
+fi
+
+# Start a branch. Use YMD timestamp to avoid collisions.
+DATE=$(date +%Y%m%d)
+git checkout -b "coreboot_${VARIANT}_${DATE}" || exit 1
+
+# Copy the template tree to the target.
+mkdir -p "variants/${VARIANT}/"
+cp -pr "${SRC}/${BASE}/template/." "variants/${VARIANT}/"
+git add "variants/${VARIANT}/"
+
+# Now add the new variant to Kconfig and Kconfig.name
+# These files are in the current directory, e.g. src/mainboard/google/hatch
+"${SRC}/kconfig.py" --board "${BASE}" --variant "${VARIANT}" || exit 1
+
+mv Kconfig.new Kconfig
+mv Kconfig.name.new Kconfig.name
+
+git add Kconfig Kconfig.name
+
+# Now commit the files.
+git commit -sm "${BASE}: Create ${VARIANT} variant
+
+Create the ${VARIANT} variant of the ${BASE} baseboard by
+copying the baseboard template files to a new directory
+named for the variant.
+
+(Auto-Generated by ${SCRIPT} version ${VERSION}).
+
+BUG=${BUG}
+TEST=util/abuild/abuild -p none -t google/${BASE} -x -a
+make sure the build includes GOOGLE_${VARIANT_UPPER}"
diff --git a/util/mainboard/google/kconfig.py b/util/mainboard/google/kconfig.py
new file mode 100755
index 0000000..6f9fccf
--- /dev/null
+++ b/util/mainboard/google/kconfig.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""Add a new variant to the Kconfig and Kconfig.name for the baseboard
+
+To start a new variant of an existing baseboard, we need to add
+the variant into the Kconfig and Kconfig.name files for the
+baseboard. In Kconfig, we have two sections that need additional
+entries, MAINBOARD_PART_NUMBER and VARIANT_DIR.
+
+The MAINBOARD_PART_NUMBER and VARIANT_DIR just use various
+capitalizations of the variant name to create the strings.
+
+Kconfig.name adds an entire section for the new variant, and all
+of these use various capitalizations of the variant name. The strings
+in this section are SOC-specific, so we'll need versions for each
+SOC that we support.
+
+Copyright 2019 Google LLC.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+"""
+
+from __future__ import print_function
+import argparse
+import sys
+
+
+def main():
+ parser = argparse.ArgumentParser(
+ description='Add strings to coreboot Kconfig for a new board variant')
+ parser.add_argument('--board', type=str, required=True,
+ help='Name of the baseboard')
+ parser.add_argument('--variant', type=str, required=True,
+ help='Name of the board variant')
+ args = parser.parse_args()
+
+ if args.board not in ['hatch', 'volteer']:
+ print('Unsupported baseboard "' + args.board + '"')
+ sys.exit(1)
+
+ add_to_Kconfig(args.variant)
+ add_to_Kconfig_name(args.board, args.variant)
+
+
+def add_to_Kconfig(variant_name):
+ """Add options for the variant to the Kconfig
+
+ Open the Kconfig file and read it line-by-line. When we detect that we're
+ in one of the sections of interest, wait until we get a blank line
+ (signalling the end of that section), and then add our new line before
+ the blank line. The updated lines are written out to Kconfig.new in the
+ same directory as Kconfig.
+
+ variant_name The name of the board variant, e.g. 'kohaku'
+ """
+ # These are the part of the strings that we'll add to the sections
+ BOARD = 'BOARD_GOOGLE_' + variant_name.upper()
+ lowercase = variant_name.lower()
+ capitalized = lowercase.capitalize()
+
+ # These flags track whether we're in a section where we need to add an option
+ in_mainboard_part_number = False
+ in_variant_dir = False
+
+ inputname = 'Kconfig'
+ outputname = 'Kconfig.new'
+ with open(outputname, 'w') as outfile:
+ with open(inputname, 'r') as infile:
+ for rawline in infile:
+ line = rawline.rstrip('\r\n')
+
+ # Are we in one of the sections of interest?
+ if line == 'config MAINBOARD_PART_NUMBER':
+ in_mainboard_part_number = True
+ if line == 'config VARIANT_DIR':
+ in_variant_dir = True
+
+ # Are we at the end of a section, and if so, is it one of the
+ # sections of interest?
+ if line == '':
+ if in_mainboard_part_number:
+ print('\tdefault "' + capitalized + '" if ' + BOARD, file=outfile)
+ in_mainboard_part_number = False
+ if in_variant_dir:
+ print('\tdefault "' + lowercase + '" if ' + BOARD, file=outfile)
+ in_variant_dir = False
+
+ print(line, file=outfile)
+
+
+def add_to_Kconfig_name(baseboard_name, variant_name):
+ """Add a config section for the variant to the Kconfig.name
+
+ Kconfig.name is easier to modify than Kconfig; it only has a block at
+ the end with the new variant's details.
+
+ baseboard_name The name of the baseboard, e.g. 'hatch'
+ We expect the caller to have checked that it is one we support
+ variant_name The name of the board variant, e.g. 'kohaku'
+ """
+ # Board name for the config section
+ uppercase = variant_name.upper()
+ capitalized = variant_name.lower().capitalize()
+
+ inputname = 'Kconfig.name'
+ outputname = 'Kconfig.name.new'
+ with open(outputname, 'w') as outfile:
+ with open(inputname, 'r') as infile:
+ # Copy all input lines to output
+ for rawline in infile:
+ line = rawline.rstrip('\r\n')
+ print(line, file=outfile)
+
+ # Now add the new section
+ if baseboard_name == 'hatch':
+ print('\nconfig ' + 'BOARD_GOOGLE_' + uppercase, file=outfile)
+ print('\tbool "-> ' + capitalized + '"', file=outfile)
+ print('\tselect BOARD_GOOGLE_BASEBOARD_HATCH', file=outfile)
+ print('\tselect BOARD_ROMSIZE_KB_16384', file=outfile)
+
+ if baseboard_name == 'volteer':
+ print('\nconfig ' + 'BOARD_GOOGLE_' + uppercase, file=outfile)
+ print('\tbool "-> ' + capitalized + '"', file=outfile)
+ print('\tselect BOARD_GOOGLE_BASEBOARD_VOLTEER', file=outfile)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/util/mainboard/google/volteer/template/Makefile.inc b/util/mainboard/google/volteer/template/Makefile.inc
index 38cf728..f130808 100644
--- a/util/mainboard/google/volteer/template/Makefile.inc
+++ b/util/mainboard/google/volteer/template/Makefile.inc
@@ -1,5 +1,8 @@
+##
## This file is part of the coreboot project.
##
+## Copyright 2020 Google LLC
+##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/util/mainboard/google/volteer/template/include/variant/ec.h b/util/mainboard/google/volteer/template/include/variant/ec.h
new file mode 100644
index 0000000..5d3278f
--- /dev/null
+++ b/util/mainboard/google/volteer/template/include/variant/ec.h
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2020 Google LLC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef __VARIANT_EC_H__
+#define __VARIANT_EC_H__
+
+#include <baseboard/ec.h>
+
+#endif
diff --git a/util/mainboard/google/volteer/template/include/variant/gpio.h b/util/mainboard/google/volteer/template/include/variant/gpio.h
new file mode 100644
index 0000000..ad4d68b
--- /dev/null
+++ b/util/mainboard/google/volteer/template/include/variant/gpio.h
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2020 Google LLC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+ * GNU General Public License for more details.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef VARIANT_GPIO_H
+#define VARIANT_GPIO_H
+
+#include <baseboard/gpio.h>
+
+/* Memory configuration board straps */
+/* Copied from baseboard and may need to change for the new variant. */
+#define GPIO_MEM_CONFIG_0 GPP_C12
+#define GPIO_MEM_CONFIG_1 GPP_C15
+#define GPIO_MEM_CONFIG_2 GPP_C14
+#define GPIO_MEM_CONFIG_3 GPP_D15
+
+#endif
diff --git a/util/mainboard/google/volteer/template/overridetree.cb b/util/mainboard/google/volteer/template/overridetree.cb
new file mode 100644
index 0000000..32204c5
--- /dev/null
+++ b/util/mainboard/google/volteer/template/overridetree.cb
@@ -0,0 +1,6 @@
+chip soc/intel/tigerlake
+
+ device domain 0 on
+ end
+
+end
--
To view, visit https://review.coreboot.org/c/coreboot/+/39462
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8cc69b8ce7dbc6809de058019bdc466a060069e7
Gerrit-Change-Number: 39462
Gerrit-PatchSet: 1
Gerrit-Owner: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39524 )
Change subject: util/inteltool: add code for dumping IO registers
......................................................................
Uploaded patch set 10: Patch Set 9 was rebased.
--
To view, visit https://review.coreboot.org/c/coreboot/+/39524
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I200e7a8fb85184fc954d6ae3cd71c6b5bdcb664a
Gerrit-Change-Number: 39524
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Christian Walter <christian.walter(a)9elements.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: HAOUAS Elyes <ehaouas(a)noos.fr>
Gerrit-Reviewer: Idwer Vollering <vidwer(a)gmail.com>
Gerrit-Reviewer: Maxim Polyakov <max.senia.poliak(a)gmail.com>
Gerrit-Reviewer: Mimoja <coreboot(a)mimoja.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 14 Mar 2020 23:10:07 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39523 )
Change subject: util/inteltool: add code for dumping APIC registers
......................................................................
Uploaded patch set 10: Patch Set 9 was rebased.
--
To view, visit https://review.coreboot.org/c/coreboot/+/39523
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic35e4d1dcb77ae2246197befb8cccc5af52d20e3
Gerrit-Change-Number: 39523
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Christian Walter <christian.walter(a)9elements.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: HAOUAS Elyes <ehaouas(a)noos.fr>
Gerrit-Reviewer: Idwer Vollering <vidwer(a)gmail.com>
Gerrit-Reviewer: Maxim Polyakov <max.senia.poliak(a)gmail.com>
Gerrit-Reviewer: Mimoja <coreboot(a)mimoja.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 14 Mar 2020 23:10:07 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment