mb/system76/gaze15: Convert to variant setup

Change-Id: I6d8a97d71ff3b4408f5e11230ed3ff00357f7123
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58675
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Tim Crawford 2021-10-27 17:52:35 -06:00 committed by Patrick Georgi
parent c840bc4e32
commit 0893b871c6
15 changed files with 68 additions and 65 deletions

View File

@ -17,7 +17,7 @@ config BOARD_SPECIFIC_OPTIONS
select MAINBOARD_HAS_TPM2 select MAINBOARD_HAS_TPM2
select NO_UART_ON_SUPERIO select NO_UART_ON_SUPERIO
select SOC_INTEL_CANNONLAKE_PCH_H select SOC_INTEL_CANNONLAKE_PCH_H
select SOC_INTEL_COMETLAKE_1 select SOC_INTEL_COMETLAKE_1 if BOARD_SYSTEM76_GAZE15
select SOC_INTEL_COMMON_BLOCK_HDA_VERB select SOC_INTEL_COMMON_BLOCK_HDA_VERB
select SPD_READ_BY_WORD select SPD_READ_BY_WORD
select SYSTEM_TYPE_LAPTOP select SYSTEM_TYPE_LAPTOP
@ -25,45 +25,43 @@ config BOARD_SPECIFIC_OPTIONS
config MAINBOARD_DIR config MAINBOARD_DIR
default "system76/gaze15" default "system76/gaze15"
config VARIANT_DIR
default "gaze15" if BOARD_SYSTEM76_GAZE15
config OVERRIDE_DEVICETREE
default "variants/\$(CONFIG_VARIANT_DIR)/overridetree.cb"
config MAINBOARD_PART_NUMBER config MAINBOARD_PART_NUMBER
default "gaze15" default "gaze15" if BOARD_SYSTEM76_GAZE15
config MAINBOARD_SMBIOS_PRODUCT_NAME config MAINBOARD_SMBIOS_PRODUCT_NAME
string
default "Gazelle" default "Gazelle"
config MAINBOARD_VERSION config MAINBOARD_VERSION
string default "gaze15" if BOARD_SYSTEM76_GAZE15
default "gaze15"
config CBFS_SIZE config CBFS_SIZE
default 0xA00000 default 0xA00000
config CONSOLE_POST config CONSOLE_POST
bool
default y default y
config ONBOARD_VGA_IS_PRIMARY config ONBOARD_VGA_IS_PRIMARY
bool
default y default y
config UART_FOR_CONSOLE config UART_FOR_CONSOLE
int
default 2 default 2
config MAX_CPUS config MAX_CPUS
int
default 16 default 16
config DIMM_MAX config DIMM_MAX
default 2 default 2
config VGA_BIOS_ID config VGA_BIOS_ID
string
default "8086,9bc4" default "8086,9bc4"
config POST_DEVICE config POST_DEVICE
bool
default n default n
endif endif

View File

@ -1,8 +1,10 @@
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
bootblock-y += bootblock.c bootblock-y += bootblock.c
bootblock-y += gpio_early.c bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
romstage-y += romstage.c
ramstage-y += ramstage.c ramstage-y += ramstage.c
ramstage-y += gpio.c ramstage-y += variants/$(VARIANT_DIR)/gpio.c
ramstage-y += hda_verb.c ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c

View File

@ -1,7 +1,5 @@
Vendor name: System76 Vendor name: System76
Board name: gaze15
Category: laptop Category: laptop
Release year: 2020
ROM package: SOIC-8 ROM package: SOIC-8
ROM protocol: SPI ROM protocol: SPI
ROM socketed: n ROM socketed: n

View File

@ -1,10 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <bootblock_common.h> #include <bootblock_common.h>
#include <gpio.h> #include <variant/gpio.h>
#include <mainboard/gpio.h>
void bootblock_mainboard_early_init(void) void bootblock_mainboard_early_init(void)
{ {
mainboard_configure_early_gpios(); variant_configure_early_gpios();
} }

View File

@ -22,14 +22,6 @@ chip soc/intel/cannonlake
register "enable_c6dram" = "1" register "enable_c6dram" = "1"
# FSP Silicon (soc/intel/cannonlake/fsp_params.c) # FSP Silicon (soc/intel/cannonlake/fsp_params.c)
# Serial I/O
register "SerialIoDevMode" = "{
[PchSerialIoIndexI2C0] = PchSerialIoPci, // Touchpad I2C bus
[PchSerialIoIndexI2C1] = PchSerialIoPci, // USB-C
[PchSerialIoIndexUART2] = PchSerialIoSkipInit, // Debug console
}"
# Misc # Misc
register "AcousticNoiseMitigation" = "1" register "AcousticNoiseMitigation" = "1"
@ -60,7 +52,6 @@ chip soc/intel/cannonlake
end end
device domain 0 on device domain 0 on
subsystemid 0x1558 0x8520 inherit
device pci 00.0 on end # Host Bridge device pci 00.0 on end # Host Bridge
device pci 01.0 on # GPU Port device pci 01.0 on # GPU Port
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU) # PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
@ -101,24 +92,6 @@ chip soc/intel/cannonlake
end end
end end
device pci 14.5 off end # SDCard device pci 14.5 off end # SDCard
device pci 15.0 on
chip drivers/i2c/hid
register "generic.hid" = ""PNP0C50""
register "generic.desc" = ""ELAN Touchpad""
register "generic.irq" = "ACPI_IRQ_LEVEL_LOW(GPP_E7_IRQ)"
register "generic.probed" = "1"
register "hid_desc_reg_offset" = "0x01"
device i2c 15 on end
end
chip drivers/i2c/hid
register "generic.hid" = ""PNP0C50""
register "generic.desc" = ""Synaptics Touchpad""
register "generic.irq" = "ACPI_IRQ_LEVEL_LOW(GPP_E7_IRQ)"
register "generic.probed" = "1"
register "hid_desc_reg_offset" = "0x20"
device i2c 2c on end
end
end # I2C #0
device pci 15.1 on end # I2C #1 device pci 15.1 on end # I2C #1
device pci 15.2 off end # I2C #2 device pci 15.2 off end # I2C #2
device pci 15.3 off end # I2C #3 device pci 15.3 off end # I2C #3

View File

@ -7,7 +7,7 @@ DefinitionBlock(
ACPI_DSDT_REV_2, ACPI_DSDT_REV_2,
OEM_ID, OEM_ID,
ACPI_TABLE_CREATOR, ACPI_TABLE_CREATOR,
0x20110725 /* OEM revision */ 0x20110725
) )
{ {
#include <acpi/dsdt_top.asl> #include <acpi/dsdt_top.asl>

View File

@ -1,9 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef MAINBOARD_GPIO_H
#define MAINBOARD_GPIO_H
void mainboard_configure_early_gpios(void);
void mainboard_configure_gpios(void);
#endif

View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef VARIANT_GPIO_H
#define VARIANT_GPIO_H
void variant_configure_early_gpios(void);
void variant_configure_gpios(void);
#endif

View File

@ -1,13 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <mainboard/gpio.h>
#include <device/device.h> #include <device/device.h>
#include <variant/gpio.h>
static void init_mainboard(void *chip_info) static void mainboard_init(void *chip_info)
{ {
mainboard_configure_gpios(); variant_configure_gpios();
} }
struct chip_operations mainboard_ops = { struct chip_operations mainboard_ops = {
.init = init_mainboard, .init = mainboard_init,
}; };

View File

@ -0,0 +1,2 @@
Board name: gaze15
Release year: 2020

View File

@ -1,8 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <mainboard/gpio.h>
#include <soc/gpe.h> #include <soc/gpe.h>
#include <soc/gpio.h> #include <soc/gpio.h>
#include <variant/gpio.h>
static const struct pad_config gpio_table[] = { static const struct pad_config gpio_table[] = {
/* ------- GPIO Group GPD ------- */ /* ------- GPIO Group GPD ------- */
@ -271,7 +271,7 @@ static const struct pad_config gpio_table[] = {
PAD_CFG_GPI(GPP_K23, NONE, DEEP), // DGPU_PRSNT# PAD_CFG_GPI(GPP_K23, NONE, DEEP), // DGPU_PRSNT#
}; };
void mainboard_configure_gpios(void) void variant_configure_gpios(void)
{ {
gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
} }

View File

@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <mainboard/gpio.h>
#include <soc/gpio.h> #include <soc/gpio.h>
#include <variant/gpio.h>
static const struct pad_config early_gpio_table[] = { static const struct pad_config early_gpio_table[] = {
PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), // UART2_RXD PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), // UART2_RXD
@ -11,7 +11,7 @@ static const struct pad_config early_gpio_table[] = {
PAD_CFG_GPO(GPP_F23, 0, DEEP), // DGPU_PWR_EN PAD_CFG_GPO(GPP_F23, 0, DEEP), // DGPU_PWR_EN
}; };
void mainboard_configure_early_gpios(void) void variant_configure_early_gpios(void)
{ {
gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table)); gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table));
} }

View File

@ -0,0 +1,31 @@
chip soc/intel/cannonlake
# Serial I/O
register "SerialIoDevMode" = "{
[PchSerialIoIndexI2C0] = PchSerialIoPci, // Touchpad I2C bus
[PchSerialIoIndexI2C1] = PchSerialIoPci, // USB-C
[PchSerialIoIndexUART2] = PchSerialIoSkipInit, // Debug console
}"
device domain 0 on
subsystemid 0x1558 0x8520 inherit
device pci 15.0 on # I2C0
chip drivers/i2c/hid
register "generic.hid" = ""PNP0C50""
register "generic.desc" = ""ELAN Touchpad""
register "generic.irq" = "ACPI_IRQ_LEVEL_LOW(GPP_E7_IRQ)"
register "generic.probed" = "1"
register "hid_desc_reg_offset" = "0x01"
device i2c 15 on end
end
chip drivers/i2c/hid
register "generic.hid" = ""PNP0C50""
register "generic.desc" = ""Synaptics Touchpad""
register "generic.irq" = "ACPI_IRQ_LEVEL_LOW(GPP_E7_IRQ)"
register "generic.probed" = "1"
register "hid_desc_reg_offset" = "0x20"
device i2c 2c on end
end
end
end
end