Paul Fagerburg has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A src/mainboard/google/hatch/scripts/create_coreboot_variant.sh A src/mainboard/google/hatch/scripts/kconfig.py 2 files changed, 303 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/1
diff --git a/src/mainboard/google/hatch/scripts/create_coreboot_variant.sh b/src/mainboard/google/hatch/scripts/create_coreboot_variant.sh new file mode 100755 index 0000000..d172045 --- /dev/null +++ b/src/mainboard/google/hatch/scripts/create_coreboot_variant.sh @@ -0,0 +1,150 @@ +#!/bin/bash +name=`git config --global --get user.name` +email=`git config --global --get user.email` + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 variant_name" + echo "e.g. $0 kohaku" + echo "Adds a new variant of Hatch to Kconfig and Kconfig.name, creates the" + echo "skeleton files for acpi, ec, and gpio, copies the makefile for" + echo "SPD sources, and sets up a basic overridetree" + exit 1 +fi + +base="hatch" +variant="$1" +# We will use all uppercase and all lowercase versions of these names +# ${var,,} converts to all lowercase, ${var^^} is all uppercase + +# All of the necessary files are in the parent directory from this script +pushd "${BASH_SOURCE%/*}/.." + +# Make sure the variant doesn't already exist +if [ -e variants/${variant,,} ]; then + echo "variants/${variant,,} aleady exists; have you already created this variant?" + popd + exit 2 +fi + +# Start a branch +repo start ${variant,,} + +mkdir -p variants/${variant,,}/include/variant/acpi + +echo <<EOF >variants/${variant,,}/include/variant/acpi/dptf.asl +/* + * This file is part of the coreboot project. + * + * 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. + */ + +#include <baseboard/acpi/dptf.asl> +EOF +git add variants/${variant,,}/include/variant/acpi/dptf.asl + +echo <<EOF >variants/${variant,,}/include/variant/ec.h +/* + * This file is part of the coreboot project. + * + * 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. + */ + +#ifndef VARIANT_EC_H +#define VARIANT_EC_H + +#include <baseboard/ec.h> + +#endif +EOF +git add variants/${variant,,}/include/variant/ec.h + +echo <<EOF >variants/${variant,,}/include/variant/gpio.h +/* + * This file is part of the coreboot project. + * + * 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. + */ + +#ifndef VARIANT_GPIO_H +#define VARIANT_GPIO_H + +#include <baseboard/gpio.h> + +#endif +EOF +git add variants/${variant,,}/include/variant/gpio.h + +echo <<EOF >variants/${variant,,}/include/variant/Makefile.inc +## This file is part of the coreboot project. +## +## 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. +## + +SPD_SOURCES = 4G_2400 # 0b000 +SPD_SOURCES += empty_ddr4 # 0b001 +SPD_SOURCES += 8G_2400 # 0b010 +SPD_SOURCES += 8G_2666 # 0b011 +SPD_SOURCES += 16G_2400 # 0b100 +SPD_SOURCES += 16G_2666 # 0b101 +EOF +git add variants/${variant,,}/include/variant/Makefile.inc + +cp variants/${base,,}/overridetree.cb variants/${variant,,} +git add variants/${variant,,}/overridetree.cb + +scripts/kconfig.py --name ${variant} + +mv Kconfig.new Kconfig +mv Kconfig.name.new Kconfig.name + +git add KConfig KConfig.name + +# Now commit the files +git commit -m "${base,,}: Create ${variant,,} variant + +BUG=none +TEST=util/abuild/abuild -p none -t google/${base,,} -x -a +make sure the build includes GOOGLE_{variant^^} + +Signed-off-by: ${name} <${email}>" + +popd + +echo "Please check all the files (git show), make any changes you want," +echo "and then push to coreboot HEAD:refs/for/master" diff --git a/src/mainboard/google/hatch/scripts/kconfig.py b/src/mainboard/google/hatch/scripts/kconfig.py new file mode 100644 index 0000000..5a10a7e --- /dev/null +++ b/src/mainboard/google/hatch/scripts/kconfig.py @@ -0,0 +1,153 @@ +#!/usr/bin/python3 +"""Add a new variant to the EC Kconfig for the baseboard + +To start a new variant of an existing baseboard, we need to add +the variant into the Kconfig and Kconfig.name EC files for the +baseboard. In Kconfig, we have three sections that need additional +entries, GBB_HWID, MAINBOARD_PART_NUMBER, and VARIANT_DIR. + +In GBB_HWID, we need to add a HWID that includes a numeric suffix. +The numeric suffix is the CRC-32 of the all-caps ASCII name, +modulo 10000. +For example, if the board name is "Fizz", we calculate the CRC of +"FIZZ TEST", which is 0x598C492D. In decimal, the value is 1502365997, +modulo 10000 is 5997. So the HWID string is "FIZZ TEST 5997" +In the past, we have used an online CRC-32 calculator such as +https://www.lammertbies.nl/comm/info/crc-calculation.html, and then +used the calculator app to convert to decimal and take the last +4 digits. + +The MAINBOARD_PART_NUMBER and VARIANT_DIR are simpler, just using +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 The Chromium OS Authors. All rights reserved. +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +""" + +import argparse +import zlib + + + +def main(): + parser = argparse.ArgumentParser( + description="Add strings to coreboot Kconfig for a new board variant") + parser.add_argument('--name', type=str, required=True, + help='Name of the board variant') + args = parser.parse_args() + + add_to_Kconfig(args.name) + add_to_Kconfig_name(args.name) + + +def get_gbb_hwid(variant_name): + """Create the GBB_HWID for a variant + + variant_name The name of the board variant, e.g. 'kindred' + + Returns: + GBB_HWID string for the board variant, e.g. 'KOHAKU TEST 1953' + + Note that the case of the variant name does not matter; it gets + converted to all uppercase as part of this function.""" + hwid = variant_name + ' test' + upperhwid = hwid.upper() + suffix = zlib.crc32(upperhwid.encode('UTF-8')) % 10000 + gbb_hwid = upperhwid + ' ' + str(suffix).zfill(4) + return gbb_hwid + + + +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. 'kindred'""" + # These are the part of the strings that we'll add to the sections + BOARD = 'BOARD_GOOGLE_' + variant_name.upper() + gbb_hwid = get_gbb_hwid(variant_name) + lowercase = variant_name.lower() + capitalized = lowercase.capitalize() + + # These flags track whether we're in a section where we need to add an option + in_gbb_hwid = False + 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 GBB_HWID': + in_gbb_hwid = True + 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_gbb_hwid: + print('\tdefault "' + gbb_hwid + '" if ' + BOARD, file=outfile) + in_gbb_hwid = False + 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(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. + + config BOARD_GOOGLE_${VARIANT} + + variant_name The name of the board variant, e.g. 'kindred'""" + # Board name for the config section + uppercase = variant_name.upper() + BOARD = 'BOARD_GOOGLE_' + uppercase + 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 + print('\nconfig ' + BOARD, file=outfile) + print('\tbool "-> ' + capitalized + '"', file=outfile) + print('\tselect BOARD_GOOGLE_BASEBOARD_HATCH', file=outfile) + print('\tselect BOARD_ROMSIZE_KB_16384', file=outfile) + print('\tselect SOC_INTEL_COMETLAKE', file=outfile) + + + +if __name__ == '__main__': + main()
Jett Rink has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 1:
(4 comments)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 34: echo <<EOF >variants/${variant,,}/include/variant/acpi/dptf.asl it feels a little weird for all of the templates to live in this script. Can we look at using separate template files instead? Does coreboot already have and code generation stuff?
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 38: 2019 We will want this date to update
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 119: # should these be source code comments instead?
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 136: git add KConfig KConfig.name : : # Now commit the files : git commit -m "${base,,}: Create ${variant,,} variant : : BUG=none : TEST=util/abuild/abuild -p none -t google/${base,,} -x -a : make sure the build includes GOOGLE_{variant^^} : : Signed-off-by: ${name} <${email}>" I don't think we need to add the git logic to the script. Let's just create the files in the working directory
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 34: echo <<EOF >variants/${variant,,}/include/variant/acpi/dptf.asl
it feels a little weird for all of the templates to live in this script. […]
Yeah, I don't especially like it either, but it was good-enough to get something started. I would much prefer to use separate template files.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 136: git add KConfig KConfig.name : : # Now commit the files : git commit -m "${base,,}: Create ${variant,,} variant : : BUG=none : TEST=util/abuild/abuild -p none -t google/${base,,} -x -a : make sure the build includes GOOGLE_{variant^^} : : Signed-off-by: ${name} <${email}>"
I don't think we need to add the git logic to the script. […]
Eventually, this script and others will be called in a sequence, everything will be git committ'ed and repo upload'ed, and you just have to get the CLs reviewed and CQ+2'ed. So I think we need to keep the git logic.
Jett Rink has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 136: git add KConfig KConfig.name : : # Now commit the files : git commit -m "${base,,}: Create ${variant,,} variant : : BUG=none : TEST=util/abuild/abuild -p none -t google/${base,,} -x -a : make sure the build includes GOOGLE_{variant^^} : : Signed-off-by: ${name} <${email}>"
Eventually, this script and others will be called in a sequence, everything will be git committ'ed a […]
How many commits do we plan to stack together when running the completed script(s)?
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 136: git add KConfig KConfig.name : : # Now commit the files : git commit -m "${base,,}: Create ${variant,,} variant : : BUG=none : TEST=util/abuild/abuild -p none -t google/${base,,} -x -a : make sure the build includes GOOGLE_{variant^^} : : Signed-off-by: ${name} <${email}>"
How many commits do we plan to stack together when running the completed script(s)?
Six. The various files that need to be added or changed all live in different repos (plus the coreboot CL needs to be upstreamed into the chromiumos tree), and they have to happen in a certain order as well to make it through CQ.
Jett Rink has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 34: echo <<EOF >variants/${variant,,}/include/variant/acpi/dptf.asl
Yeah, I don't especially like it either, but it was good-enough to get something started. […]
Since you are seeding this, you are setting the standard that people will use/copy. Since you already have python going, what about using that to copy template files and replace token like date and variant?
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 143: make sure the build includes GOOGLE_{variant^^} if we are keeping the git stuff, then we can use the -s option on git so we don't have to manually write the Signed-off-by line manually
git commit -sm "....."
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#2).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A src/mainboard/google/hatch/scripts/create_coreboot_variant.sh A src/mainboard/google/hatch/scripts/kconfig.py 2 files changed, 303 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/2
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 5:
This change is ready for review.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 5:
(5 comments)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 34: echo <<EOF >variants/${variant,,}/include/variant/acpi/dptf.asl
Since you are seeding this, you are setting the standard that people will use/copy. […]
I'm changing it over to use template files (*.tmpl, in the same directory as the script), and sed to put the correct year into the text. The template files and the overridetree.cb (which does not need to be a template) do not contain the name of the baseboard or the variant.
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 38: 2019
We will want this date to update
As noted above, the year in each template file will be substituted with the current year at the time the script runs.
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 119: #
should these be source code comments instead?
I think these are appropriate in the makefile. The C source code doesn't actually refer to any of the SPD names, just indices into the SPD array.
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 143: make sure the build includes GOOGLE_{variant^^}
if we are keeping the git stuff, then we can use the -s option on git so we don't have to manually w […]
Done
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 136: git add KConfig KConfig.name : : # Now commit the files : git commit -m "${base,,}: Create ${variant,,} variant : : BUG=none : TEST=util/abuild/abuild -p none -t google/${base,,} -x -a : make sure the build includes GOOGLE_{variant^^} : : Signed-off-by: ${name} <${email}>"
Six. […]
Done
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#6).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A src/mainboard/google/hatch/scripts/Makefile.inc.tmpl A src/mainboard/google/hatch/scripts/create_coreboot_variant.sh A src/mainboard/google/hatch/scripts/dptf.asl.tmpl A src/mainboard/google/hatch/scripts/ec.h.tmpl A src/mainboard/google/hatch/scripts/gpio.h.tmpl A src/mainboard/google/hatch/scripts/kconfig.py 6 files changed, 316 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/6
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#7).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A src/mainboard/google/hatch/scripts/Makefile.inc.tmpl A src/mainboard/google/hatch/scripts/create_coreboot_variant.sh A src/mainboard/google/hatch/scripts/dptf.asl.tmpl A src/mainboard/google/hatch/scripts/ec.h.tmpl A src/mainboard/google/hatch/scripts/gpio.h.tmpl A src/mainboard/google/hatch/scripts/kconfig.py A util/mainboard/google/hatch/Makefile.inc.tmpl A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/dptf.asl.tmpl A util/mainboard/google/hatch/ec.h.tmpl A util/mainboard/google/hatch/gpio.h.tmpl A util/mainboard/google/hatch/kconfig.py 12 files changed, 660 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/7
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#8).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/Makefile.inc.tmpl A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/dptf.asl.tmpl A util/mainboard/google/hatch/ec.h.tmpl A util/mainboard/google/hatch/gpio.h.tmpl A util/mainboard/google/hatch/kconfig.py 6 files changed, 344 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/8
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/8/util/mainboard/google/hatch... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/8/util/mainboard/google/hatch... PS8, Line 25: # Note that this script is specific to Hatch, and so it lives in the tree Outdated comment that I missed.
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#9).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/Makefile.inc.tmpl A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/dptf.asl.tmpl A util/mainboard/google/hatch/ec.h.tmpl A util/mainboard/google/hatch/gpio.h.tmpl A util/mainboard/google/hatch/kconfig.py 6 files changed, 343 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/9
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 9:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/8/util/mainboard/google/hatch... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/8/util/mainboard/google/hatch... PS8, Line 25: # Note that this script is specific to Hatch, and so it lives in the tree
Outdated comment that I missed.
Done
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 9:
(5 comments)
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/scripts/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 34: echo <<EOF >variants/${variant,,}/include/variant/acpi/dptf.asl
I'm changing it over to use template files (*. […]
Done
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 38: 2019
As noted above, the year in each template file will be substituted with the current year at the time […]
Done
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 119: #
I think these are appropriate in the makefile. […]
Done
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 143: make sure the build includes GOOGLE_{variant^^}
Done
Done
https://review.coreboot.org/c/coreboot/+/35239/1/src/mainboard/google/hatch/... PS1, Line 136: git add KConfig KConfig.name : : # Now commit the files : git commit -m "${base,,}: Create ${variant,,} variant : : BUG=none : TEST=util/abuild/abuild -p none -t google/${base,,} -x -a : make sure the build includes GOOGLE_{variant^^} : : Signed-off-by: ${name} <${email}>"
Done
Done
Jett Rink has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 9: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/9/util/mainboard/google/hatch... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/9/util/mainboard/google/hatch... PS9, Line 37: hatch nit: since you made it a variable (base), do you want to use that here instead?
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 9:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/9/util/mainboard/google/hatch... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/9/util/mainboard/google/hatch... PS9, Line 37: hatch
nit: since you made it a variable (base), do you want to use that here instead?
Yeah, that's probably a good idea.
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#10).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/Makefile.inc.tmpl A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/dptf.asl.tmpl A util/mainboard/google/hatch/ec.h.tmpl A util/mainboard/google/hatch/gpio.h.tmpl A util/mainboard/google/hatch/kconfig.py 6 files changed, 343 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/10
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#11).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/Makefile.inc.tmpl A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/dptf.asl.tmpl A util/mainboard/google/hatch/ec.h.tmpl A util/mainboard/google/hatch/gpio.h.tmpl A util/mainboard/google/hatch/kconfig.py 6 files changed, 344 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/11
Jett Rink has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 11: Code-Review+1
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#12).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/Makefile.inc.tmpl A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/dptf.asl.tmpl A util/mainboard/google/hatch/ec.h.tmpl A util/mainboard/google/hatch/gpio.h.tmpl A util/mainboard/google/hatch/kconfig.py 6 files changed, 347 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/12
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 12:
Made some style changes that were flagged in other reviews where this script and that script shared some common structure.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 12:
(15 comments)
https://review.coreboot.org/c/coreboot/+/35239/11//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35239/11//COMMIT_MSG@7 PS11, Line 7: hatch util/
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... File util/mainboard/google/hatch/Makefile.inc.tmpl:
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 15: SPD_SOURCES = 4G_2400 # 0b000 : SPD_SOURCES += empty_ddr4 # 0b001 : SPD_SOURCES += 8G_2400 # 0b010 : SPD_SOURCES += 8G_2666 # 0b011 : SPD_SOURCES += 16G_2400 # 0b100 : SPD_SOURCES += 16G_2666 # 0b101 Can we just leave these as: SPD_SOURCES =
Values here depend upon whether the variant chooses DDR4 v/s LPDDR3.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 51: repo start Is the assumption here that this is being run from chromeos chroot? That should be stated somewhere.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 73: copy_tmpl "${SRC}/dptf.asl.tmpl" \ : "variants/${variant}/include/variant/acpi/dptf.asl" : git add "variants/${variant}/include/variant/acpi/dptf.asl" : : copy_tmpl "${SRC}/ec.h.tmpl" "variants/${variant}/include/variant/ec.h" : git add "variants/${variant}/include/variant/ec.h" : : copy_tmpl "${SRC}/gpio.h.tmpl" "variants/${variant}/include/variant/gpio.h" : git add "variants/${variant}/include/variant/gpio.h" : : copy_tmpl "${SRC}/Makefile.inc.tmpl" "variants/${variant}/Makefile.inc" : git add "variants/${variant}/Makefile.inc" : : # overridetree.cb does not have any dates in it, so we can just copy : cp "variants/${base}/overridetree.cb" "variants/${variant}" : git add "variants/${variant}/overridetree.cb" This works, but do you think we could layout the files under template/ here in the same fashion as they should be under src/mainboard/google/${base} and do a find and replace __YEAR__ to ${YEAR} in all and just do a recursive copy of those files directly to src/mainboard/google/${base}. That way if there are more files added to templates, you wouldn't have to update the script. Also, makes it easy to adapt it to more boards?
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 97: KConfig Kconfig -- lowercase c
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 97: KConfig.name Kconfig.name -- lowercase c
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 102: none It would be good to provide an option to user to specify a bug argument.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 103: util/abuild/abuild -p none -t google/${base} -x -a : make sure the build includes GOOGLE_${variant^^}" Is this validated by the script?
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... File util/mainboard/google/hatch/kconfig.py:
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 2: EC Kconfig coreboot?
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 5: EC coreboot?
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 44: Do we need 3 blank lines here?
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 62: 'KOHAKU TEST 1953' It is confusing that the example above states kindred and the one here provides HWID for kohaku.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 73: Are 3 blank lines required?
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 78: wait until we get a blank line : (signalling the end of that section) nit: I generally like to see Kconfigs and their values ordered alphabetically. Just easier to read through the configs.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 130: only has a block at : the end Is it possible to do this alphabetically? I know we let HELIOS slip in out of order, but it would be good if we can avoid that.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 12:
(15 comments)
https://review.coreboot.org/c/coreboot/+/35239/11//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35239/11//COMMIT_MSG@7 PS11, Line 7: hatch
util/
Done
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... File util/mainboard/google/hatch/Makefile.inc.tmpl:
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 15: SPD_SOURCES = 4G_2400 # 0b000 : SPD_SOURCES += empty_ddr4 # 0b001 : SPD_SOURCES += 8G_2400 # 0b010 : SPD_SOURCES += 8G_2666 # 0b011 : SPD_SOURCES += 16G_2400 # 0b100 : SPD_SOURCES += 16G_2666 # 0b101
Can we just leave these as: […]
Done
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 51: repo start
Is the assumption here that this is being run from chromeos chroot? That should be stated somewhere.
Yes, it has to run inside the chroot. Added code to detect the chroot and exit if we're not in the chroot.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 73: copy_tmpl "${SRC}/dptf.asl.tmpl" \ : "variants/${variant}/include/variant/acpi/dptf.asl" : git add "variants/${variant}/include/variant/acpi/dptf.asl" : : copy_tmpl "${SRC}/ec.h.tmpl" "variants/${variant}/include/variant/ec.h" : git add "variants/${variant}/include/variant/ec.h" : : copy_tmpl "${SRC}/gpio.h.tmpl" "variants/${variant}/include/variant/gpio.h" : git add "variants/${variant}/include/variant/gpio.h" : : copy_tmpl "${SRC}/Makefile.inc.tmpl" "variants/${variant}/Makefile.inc" : git add "variants/${variant}/Makefile.inc" : : # overridetree.cb does not have any dates in it, so we can just copy : cp "variants/${base}/overridetree.cb" "variants/${variant}" : git add "variants/${variant}/overridetree.cb"
This works, but do you think we could layout the files under template/ here in the same fashion as t […]
I'll work on this. It's a combination of finding the files in a template directory local to the script, then stripping off a common prefix on the path name so I can create the new directory structure and copy_tmpl into that directory.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 97: KConfig
Kconfig -- lowercase c
Done
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 97: KConfig.name
Kconfig. […]
Done
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 102: none
It would be good to provide an option to user to specify a bug argument.
Next version. I added it to the bug so we don't lose track.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 103: util/abuild/abuild -p none -t google/${base} -x -a : make sure the build includes GOOGLE_${variant^^}"
Is this validated by the script?
Not in this round, no. Part of the issue is that the human has to scan the output to see if the new variant got built. I've added to the bug so we don't lose track.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... File util/mainboard/google/hatch/kconfig.py:
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 2: EC Kconfig
coreboot?
Done
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 5: EC
coreboot?
Done
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 44:
Do we need 3 blank lines here?
Old coding habits die hard. Changed to 2 lines per style guide.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 62: 'KOHAKU TEST 1953'
It is confusing that the example above states kindred and the one here provides HWID for kohaku.
Changed all 'kindred' to 'kohaku'. My notes from manually doing this has all the CLs for kindred, but I've used kohaku in other places, hence the inconsistency.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 73:
Are 3 blank lines required?
Done
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 78: wait until we get a blank line : (signalling the end of that section)
nit: I generally like to see Kconfigs and their values ordered alphabetically. […]
I'm not aware of a tool that will let me read in a Kconfig, walk the structure to find the node and add the value, and then write it out again. I suggest that this will work for now, and we can focus on changing from append to insert-sorted in a new rev. I did add this to the bug so we don't lose track of it.
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 130: only has a block at : the end
Is it possible to do this alphabetically? I know we let HELIOS slip in out of order, but it would be […]
Same comment as above.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/12/util/mainboard/google/hatc... PS12, Line 73: copy_tmpl "${SRC}/dptf.asl.tmpl" \ : "variants/${variant}/include/variant/acpi/dptf.asl" : git add "variants/${variant}/include/variant/acpi/dptf.asl" : : copy_tmpl "${SRC}/ec.h.tmpl" "variants/${variant}/include/variant/ec.h" : git add "variants/${variant}/include/variant/ec.h" : : copy_tmpl "${SRC}/gpio.h.tmpl" "variants/${variant}/include/variant/gpio.h" : git add "variants/${variant}/include/variant/gpio.h" : : copy_tmpl "${SRC}/Makefile.inc.tmpl" "variants/${variant}/Makefile.inc" : git add "variants/${variant}/Makefile.inc" : : # overridetree.cb does not have any dates in it, so we can just copy : cp "variants/${base}/overridetree.cb" "variants/${variant}" : git add "variants/${variant}/overridetree.cb"
I'll work on this. […]
Done
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Furquan Shaikh, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#13).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/Makefile.inc.tmpl A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/dptf.asl.tmpl A util/mainboard/google/hatch/ec.h.tmpl A util/mainboard/google/hatch/gpio.h.tmpl A util/mainboard/google/hatch/kconfig.py A util/mainboard/google/hatch/template/Makefile.inc A util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl A util/mainboard/google/hatch/template/include/variant/ec.h A util/mainboard/google/hatch/template/include/variant/gpio.h A util/mainboard/google/hatch/template/overridetree.cb 11 files changed, 598 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/13
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/template/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 15: SPD_SOURCES = trailing whitespace
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 13:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 16: if [[ ! -e /etc/cros_chroot_version ]]; then : echo "This script must be run inside the chroot" : exit 1 : fi What's needed in the chroot? If it needs to be run in the chroot, why push it to coreboot.org? Why not put it in the public overlay?
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/dptf.asl.tmpl:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 4: * Copyright __YEAR__ Google LLC We're getting rid of all the copyright lines and just having the AUTHORS file instead.
Google LLC is there already, so I'd just skip all the copyright lines.
For an example, see: https://review.coreboot.org/c/coreboot/+/35177
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 13:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 16: if [[ ! -e /etc/cros_chroot_version ]]; then : echo "This script must be run inside the chroot" : exit 1 : fi
What's needed in the chroot? […]
Now that I look closer, nothing is needed for the chroot. I'm removing this check.
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/dptf.asl.tmpl:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 4: * Copyright __YEAR__ Google LLC
We're getting rid of all the copyright lines and just having the AUTHORS file instead. […]
This file actually shouldn't be part of the CL; I deleted it but it didn't get cherry-picked.
If we get rid of the copyrights, then __YEAR__ doesn't show up anywhere, and it becomes a simple copy. Is that what we want?
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Patrick Georgi, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#14).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/kconfig.py A util/mainboard/google/hatch/template/Makefile.inc A util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl A util/mainboard/google/hatch/template/include/variant/ec.h A util/mainboard/google/hatch/template/include/variant/gpio.h A util/mainboard/google/hatch/template/overridetree.cb 7 files changed, 507 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/14
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 14:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 54: # Start a branch. Use YMD timestamp to avoid collisions. : DATE=$(date +%Y%m%d) : repo start "create_${variant}_${DATE}" Get rid of this? This is just a personal preference, right? If you want to keep it, start the branch with git instead of repo?
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/dptf.asl.tmpl:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 4: * Copyright __YEAR__ Google LLC
This file actually shouldn't be part of the CL; I deleted it but it didn't get cherry-picked. […]
Yes, I think so.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 14:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 54: # Start a branch. Use YMD timestamp to avoid collisions. : DATE=$(date +%Y%m%d) : repo start "create_${variant}_${DATE}"
Get rid of this? This is just a personal preference, right? […]
The goal is to have the scripts do all of the basic work to clone a baseboard into a new variant's name. I would prefer to keep a branch for this, so I'll change it over to git instead of repo.
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/dptf.asl.tmpl:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 4: * Copyright __YEAR__ Google LLC
Yes, I think so.
OK, will do.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/14/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/14/util/mainboard/google/hatc... PS14, Line 54: # Copy a template file to a new name while substituting the : # current year for __YEAR__ If it's just a filled-in template, arguably the template gets a copyright (with the year in which the template was created) while the file merely filled in by a computer is not a creative work. I'd leave the copyright constant in the template.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 54: # Start a branch. Use YMD timestamp to avoid collisions. : DATE=$(date +%Y%m%d) : repo start "create_${variant}_${DATE}"
The goal is to have the scripts do all of the basic work to clone a baseboard into a new variant's n […]
Done
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/14/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/14/util/mainboard/google/hatc... PS14, Line 54: # Copy a template file to a new name while substituting the : # current year for __YEAR__
If it's just a filled-in template, arguably the template gets a copyright (with the year in which th […]
I've had feedback both ways. At first, it said 2019 (as a constant) in the template. I was advised that we want this date to update, so that's how we got __YEAR__ and the copy_tmpl function. Then I got feedback that we shouldn't have a copyright line at all because we're using OWNERS files.
How do we resolve the three competing visions for copyright notices (or lack thereof)?
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 54: # Start a branch. Use YMD timestamp to avoid collisions. : DATE=$(date +%Y%m%d) : repo start "create_${variant}_${DATE}"
The goal is to have the scripts do all of the basic work to clone a baseboard into a new variant's n […]
Ok, I guess i'd let the user do all the git work, but that's just my own preference.
If you are doing the git work for them, why not do a git fetch and checkout origin/master as well?
You might want to print their previous head in case they weren't on a branch, and lose their position.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 14:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 54: # Start a branch. Use YMD timestamp to avoid collisions. : DATE=$(date +%Y%m%d) : repo start "create_${variant}_${DATE}"
Ok, I guess i'd let the user do all the git work, but that's just my own preference. […]
Those are all good ideas, but not for this revision.
https://review.coreboot.org/c/coreboot/+/35239/14/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/14/util/mainboard/google/hatc... PS14, Line 54: # Copy a template file to a new name while substituting the : # current year for __YEAR__
I've had feedback both ways. At first, it said 2019 (as a constant) in the template. […]
The initial copy of a file to another directory isn't a copyrightable work anyway, but the intent was that when the author came along to make changes to those files for the variant, the copyright would already be correct. Martin has pointed out that Google LLC is already listed in the AUTHORS file, and so the copyright notices are redundant. So, there will be no copyright line, and no __YEAR__ to update.
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Martin Roth, Patrick Georgi, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#15).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/kconfig.py A util/mainboard/google/hatch/template/Makefile.inc A util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl A util/mainboard/google/hatch/template/include/variant/ec.h A util/mainboard/google/hatch/template/include/variant/gpio.h A util/mainboard/google/hatch/template/overridetree.cb 7 files changed, 490 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/15
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 54: # Start a branch. Use YMD timestamp to avoid collisions. : DATE=$(date +%Y%m%d) : repo start "create_${variant}_${DATE}"
Those are all good ideas, but not for this revision.
Ack
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/15/util/mainboard/google/hatc... File util/mainboard/google/hatch/template/overridetree.cb:
PS15: Can we please remove most of the stuff here? These are not the default settings and some of these should not be applied to every variant.
Marco Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15:
Sorry to jump in lately and curious about one question - for almost variants, they will base on reference board - hatch to design the deviation so why don't see variants/hatch as the template? Thanks.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15: Code-Review-1
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/15/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/15/util/mainboard/google/hatc... PS15, Line 53: # Find all files in the template tree and copy them to the target : # in the same paths, substituting the current year for __YEAR__ : # Use ``while/find -print0`` instead of ``for/in`` due to shellcheck warning : while IFS= read -r -d '' f ; do : # Because we're in the destination directory, ``find ${SRC}/template/`` : # will return filenames with a full path. We need to strip that path : # and just get the path and filename relative to ${SRC}/template/ : s="${f#"${SRC}/template/"}" : # Now create the directory tree under the destination : mkdir -p "variants/${variant}/$(dirname "${s}")" : # Use the full path and file ${f} as the source, and the relative : # path and name as the target : cp "${f}" "variants/${variant}/${s}" : : git add "variants/${variant}/${s}" : done< <(find "${SRC}/template" -type f -print0) : Had an epiphany - the loop isn't necessary, since we're not modifying the files. We can just cp -r and then git add the directory.
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15: -Code-Review
Waiting for updates.
Paul Fagerburg has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Removed Code-Review-1 by Paul Fagerburg pfagerburg@chromium.org
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15:
What do you think about putting the template in the src/mainboard/google/hatch/variant/template directory? Then the script could be made generic for any variant with a template directory. Pass in 2 param - mainboard & variant names.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15:
Patch Set 15:
What do you think about putting the template in the src/mainboard/google/hatch/variant/template directory? Then the script could be made generic for any variant with a template directory. Pass in 2 param - mainboard & variant names.
We could still have the templates in util/ (util/templates/$VENDOR/$BOARD?) and keep the script generic (in util/templates/*.sh)
Sumeet R Pawnikar has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 24: Adds a new variant of Hatch to Kconfig and Kconfig.name, creates the" : echo "skeleton files for acpi, ec, and gpio, copies the makefile for" : echo "SPD sources, and sets up a basic overridetree" I guess we need baseboard files before this.
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 84: mkdir -p "variants/${variant}/$(dirname "${s}")" do we need to check first if baseboard files exists or not ?
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 15:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 24: Adds a new variant of Hatch to Kconfig and Kconfig.name, creates the" : echo "skeleton files for acpi, ec, and gpio, copies the makefile for" : echo "SPD sources, and sets up a basic overridetree"
I guess we need baseboard files before this.
Yes, these scripts are intended to create variants of a baseboard that already exists.
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 84: mkdir -p "variants/${variant}/$(dirname "${s}")"
do we need to check first if baseboard files exists or not ?
Yeah, that might be a good idea. I'll add it.
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Patrick Georgi, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#16).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/kconfig.py A util/mainboard/google/hatch/template/Makefile.inc A util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl A util/mainboard/google/hatch/template/include/variant/ec.h A util/mainboard/google/hatch/template/include/variant/gpio.h A util/mainboard/google/hatch/template/overridetree.cb 7 files changed, 479 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/16
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 16:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/13/util/mainboard/google/hatc... PS13, Line 84: mkdir -p "variants/${variant}/$(dirname "${s}")"
Yeah, that might be a good idea. I'll add it.
Fixed in latest; as part of the pushd, if it fails (because the baseboard doesn't exist), then there is a clear error message and the script exits.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 16:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/15/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/15/util/mainboard/google/hatc... PS15, Line 53: # Find all files in the template tree and copy them to the target : # in the same paths, substituting the current year for __YEAR__ : # Use ``while/find -print0`` instead of ``for/in`` due to shellcheck warning : while IFS= read -r -d '' f ; do : # Because we're in the destination directory, ``find ${SRC}/template/`` : # will return filenames with a full path. We need to strip that path : # and just get the path and filename relative to ${SRC}/template/ : s="${f#"${SRC}/template/"}" : # Now create the directory tree under the destination : mkdir -p "variants/${variant}/$(dirname "${s}")" : # Use the full path and file ${f} as the source, and the relative : # path and name as the target : cp "${f}" "variants/${variant}/${s}" : : git add "variants/${variant}/${s}" : done< <(find "${SRC}/template" -type f -print0) :
Had an epiphany - the loop isn't necessary, since we're not modifying the files. […]
Done
Hello Marco Chen, Jett Rink, Keith Short, Justin TerAvest, Shelley Chen, build bot (Jenkins), Scott Collyer, Patrick Georgi, Martin Roth, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35239
to look at the new patch set (#17).
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org --- A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/kconfig.py A util/mainboard/google/hatch/template/Makefile.inc A util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl A util/mainboard/google/hatch/template/include/variant/ec.h A util/mainboard/google/hatch/template/include/variant/gpio.h A util/mainboard/google/hatch/template/overridetree.cb 7 files changed, 305 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35239/17
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 16:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/15/util/mainboard/google/hatc... File util/mainboard/google/hatch/template/overridetree.cb:
PS15:
Can we please remove most of the stuff here? These are not the default settings and some of these sh […]
Newest patchset has a very minimal overridetree.cb
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 17: Code-Review+1
(1 comment)
Looks okay to me. I will wait to see if other reviewers have any comments. Else +2 it tomorrow.
https://review.coreboot.org/c/coreboot/+/35239/17/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/17/util/mainboard/google/hatc... PS17, Line 40: echo "The baseboard directory for ${base} does not exist." Kind of contradictory. Line 25 says this script is only for Hatch and here it checks to ensure that the baseboard directory exists. Is it just a check in place that will ensure it can be adapted to other baseboards in the future?
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 17:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35239/17/util/mainboard/google/hatc... File util/mainboard/google/hatch/create_coreboot_variant.sh:
https://review.coreboot.org/c/coreboot/+/35239/17/util/mainboard/google/hatc... PS17, Line 40: echo "The baseboard directory for ${base} does not exist."
Kind of contradictory. […]
Yes, when the script is adapted to apply to multiple baseboards, the check will be necessary to make sure you don't try to make a variant of e.g. the "htach" baseboard.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 17: Code-Review+2
Not for this change, but another thing that would be good to have:
Version # for the script. And adding a line to commit message (Auto-Generated using script version #). I think it will make reviewing code easier.
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 17:
Patch Set 17: Code-Review+2
Not for this change, but another thing that would be good to have:
Version # for the script. And adding a line to commit message (Auto-Generated using script version #). I think it will make reviewing code easier.
Excellent idea. Would you please add this to the bug?
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 17:
Patch Set 17:
Patch Set 17: Code-Review+2
Not for this change, but another thing that would be good to have:
Version # for the script. And adding a line to commit message (Auto-Generated using script version #). I think it will make reviewing code easier.
Excellent idea. Would you please add this to the bug?
Done.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
Patch Set 17:
should be moved once it's more generic, but I guess we can leave it in util/mainboard/ for now
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35239 )
Change subject: hatch: automate creating a new variant in coreboot ......................................................................
hatch: automate creating a new variant in coreboot
To create a new variant of the hatch baseboard, we need to add the variant's GBB_HWID and other information to Kconfig and Kconfig.name, and set up a skeletal build based on the hatch baseboard.
BUG=b:140261109 BRANCH=none TEST=``./create_coreboot_variant.sh sushi && git show`` Kconfig will have three new lines for the SUSHI variant, and Kconfig.name will have an entirely new section. New files created are: variants/sushi/Makefile.inc variants/sushi/overridetree.cb variants/sushi/include/ec.h variants/sushi/include/gpio.h variants/sushi/include/variant/acpi/dptf.asl
Also run the script with an existing board name to verify that you can't create a variant that already exists.
Change-Id: I1a5b9c8735faafebb2e4e384cb3346867d64c556 Signed-off-by: Paul Fagerburg pfagerburg@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/35239 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com --- A util/mainboard/google/hatch/create_coreboot_variant.sh A util/mainboard/google/hatch/kconfig.py A util/mainboard/google/hatch/template/Makefile.inc A util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl A util/mainboard/google/hatch/template/include/variant/ec.h A util/mainboard/google/hatch/template/include/variant/gpio.h A util/mainboard/google/hatch/template/overridetree.cb 7 files changed, 305 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/util/mainboard/google/hatch/create_coreboot_variant.sh b/util/mainboard/google/hatch/create_coreboot_variant.sh new file mode 100755 index 0000000..32720ca --- /dev/null +++ b/util/mainboard/google/hatch/create_coreboot_variant.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# +# This file is part of the coreboot project. +# +# 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. + +if [[ "$#" -ne 1 ]]; then + echo "Usage: $0 variant_name" + echo "e.g. $0 kohaku" + echo "Adds a new variant of Hatch to Kconfig and Kconfig.name, creates the" + echo "skeleton files for acpi, ec, and gpio, copies the makefile for" + echo "SPD sources, and sets up a basic overridetree" + exit 1 +fi + +# Note that this script is specific to Hatch, and so it does not allow +# you to specify the baseboard as one of the cmdline arguments. +# +# This is the name of the base board that we're cloning to make the variant. +base="hatch" +# This is the name of the variant that is being cloned +# ${var,,} converts to all lowercase +variant="${1,,}" + +# This script and the templates live in util/mainboard/google/hatch +# We need to create files in src/mainboard/google/hatch +pushd "${BASH_SOURCE%/*}" || exit +SRC=$(pwd) +popd || exit +pushd "${SRC}/../../../../src/mainboard/google/${base}" || { + echo "The baseboard directory for ${base} does not exist."; + exit; } + +# 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?" + popd || exit + exit 2 +fi + +# Start a branch. Use YMD timestamp to avoid collisions. +DATE=$(date +%Y%m%d) +git checkout -b "create_${variant}_${DATE}" + +# Copy the template tree to the target +cp -r "${SRC}/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" --name "${variant}" + +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 + +BUG=none +TEST=util/abuild/abuild -p none -t google/${base} -x -a +make sure the build includes GOOGLE_${variant^^}" + +popd || exit + +echo "Please check all the files (git show), make any changes you want," +echo "and then push to coreboot HEAD:refs/for/master" diff --git a/util/mainboard/google/hatch/kconfig.py b/util/mainboard/google/hatch/kconfig.py new file mode 100755 index 0000000..8b54b75 --- /dev/null +++ b/util/mainboard/google/hatch/kconfig.py @@ -0,0 +1,156 @@ +#!/usr/bin/python3 +"""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 three sections that need additional +entries, GBB_HWID, MAINBOARD_PART_NUMBER, and VARIANT_DIR. + +In GBB_HWID, we need to add a HWID that includes a numeric suffix. +The numeric suffix is the CRC-32 of the all-caps ASCII name, +modulo 10000. +For example, if the board name is "Fizz", we calculate the CRC of +"FIZZ TEST", which is 0x598C492D. In decimal, the value is 1502365997, +modulo 10000 is 5997. So the HWID string is "FIZZ TEST 5997" +In the past, we have used an online CRC-32 calculator such as +https://www.lammertbies.nl/comm/info/crc-calculation.html, and then +used the calculator app to convert to decimal and take the last +4 digits. + +The MAINBOARD_PART_NUMBER and VARIANT_DIR are simpler, just using +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. +""" + +import argparse +import zlib + + +def main(): + parser = argparse.ArgumentParser( + description="Add strings to coreboot Kconfig for a new board variant") + parser.add_argument('--name', type=str, required=True, + help='Name of the board variant') + args = parser.parse_args() + + add_to_Kconfig(args.name) + add_to_Kconfig_name(args.name) + + +def get_gbb_hwid(variant_name): + """Create the GBB_HWID for a variant + + variant_name The name of the board variant, e.g. 'kohaku' + + Returns: + GBB_HWID string for the board variant, e.g. 'KOHAKU TEST 1953' + + Note that the case of the variant name does not matter; it gets + converted to all uppercase as part of this function.""" + hwid = variant_name + ' test' + upperhwid = hwid.upper() + suffix = zlib.crc32(upperhwid.encode('UTF-8')) % 10000 + gbb_hwid = upperhwid + ' ' + str(suffix).zfill(4) + return gbb_hwid + + +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() + gbb_hwid = get_gbb_hwid(variant_name) + lowercase = variant_name.lower() + capitalized = lowercase.capitalize() + + # These flags track whether we're in a section where we need to add an option + in_gbb_hwid = False + 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 GBB_HWID': + in_gbb_hwid = True + 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_gbb_hwid: + print('\tdefault "' + gbb_hwid + '" if ' + BOARD, file=outfile) + in_gbb_hwid = False + 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(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. + + config BOARD_GOOGLE_${VARIANT} + + variant_name The name of the board variant, e.g. 'kohaku'""" + # Board name for the config section + uppercase = variant_name.upper() + BOARD = 'BOARD_GOOGLE_' + uppercase + 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 + print('\nconfig ' + BOARD, file=outfile) + print('\tbool "-> ' + capitalized + '"', file=outfile) + print('\tselect BOARD_GOOGLE_BASEBOARD_HATCH', file=outfile) + print('\tselect BOARD_ROMSIZE_KB_16384', file=outfile) + print('\tselect SOC_INTEL_COMETLAKE', file=outfile) + + +if __name__ == '__main__': + main() diff --git a/util/mainboard/google/hatch/template/Makefile.inc b/util/mainboard/google/hatch/template/Makefile.inc new file mode 100644 index 0000000..38cf728 --- /dev/null +++ b/util/mainboard/google/hatch/template/Makefile.inc @@ -0,0 +1,13 @@ +## This file is part of the coreboot project. +## +## 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. +## + +SPD_SOURCES = diff --git a/util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl b/util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl new file mode 100644 index 0000000..496334d --- /dev/null +++ b/util/mainboard/google/hatch/template/include/variant/acpi/dptf.asl @@ -0,0 +1,14 @@ +/* + * This file is part of the coreboot project. + * + * 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. + */ + +#include <baseboard/acpi/dptf.asl> diff --git a/util/mainboard/google/hatch/template/include/variant/ec.h b/util/mainboard/google/hatch/template/include/variant/ec.h new file mode 100644 index 0000000..2526962 --- /dev/null +++ b/util/mainboard/google/hatch/template/include/variant/ec.h @@ -0,0 +1,19 @@ +/* + * This file is part of the coreboot project. + * + * 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. + */ + +#ifndef VARIANT_EC_H +#define VARIANT_EC_H + +#include <baseboard/ec.h> + +#endif diff --git a/util/mainboard/google/hatch/template/include/variant/gpio.h b/util/mainboard/google/hatch/template/include/variant/gpio.h new file mode 100644 index 0000000..1322233 --- /dev/null +++ b/util/mainboard/google/hatch/template/include/variant/gpio.h @@ -0,0 +1,19 @@ +/* + * This file is part of the coreboot project. + * + * 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. + */ + +#ifndef VARIANT_GPIO_H +#define VARIANT_GPIO_H + +#include <baseboard/gpio.h> + +#endif diff --git a/util/mainboard/google/hatch/template/overridetree.cb b/util/mainboard/google/hatch/template/overridetree.cb new file mode 100644 index 0000000..abbcaaa --- /dev/null +++ b/util/mainboard/google/hatch/template/overridetree.cb @@ -0,0 +1,6 @@ +chip soc/intel/cannonlake + + device domain 0 on + end + +end