From 8abb05ac457bb28c2cf0d210bad0d28cd2aeb7f1 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 1 Jan 2020 23:57:30 +0100 Subject: [PATCH] mb/hp/2570p: Transform into variant-enabled structure Get ready to squash all the HP Sandy Bridge and Ivy Bridge laptops together, so as to factor out lots of repeated code. Tested with BUILD_TIMELESS=1, binary does not change. Change-Id: I0b68e524b57e3705e91e3cd98be5571b3554bd67 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/38090 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/mainboard/hp/2570p/Kconfig | 59 ----------------- src/mainboard/hp/2570p/Kconfig.name | 2 - src/mainboard/hp/snb_ivb_laptops/Kconfig | 64 +++++++++++++++++++ src/mainboard/hp/snb_ivb_laptops/Kconfig.name | 25 ++++++++ .../{2570p => snb_ivb_laptops}/Makefile.inc | 12 ++-- .../hp/{2570p => snb_ivb_laptops}/acpi/ec.asl | 0 .../acpi/platform.asl | 0 .../acpi/superio.asl | 0 .../{2570p => snb_ivb_laptops}/acpi_tables.c | 0 .../hp/snb_ivb_laptops/board_info.txt | 4 ++ .../{2570p => snb_ivb_laptops}/cmos.default | 0 .../hp/{2570p => snb_ivb_laptops}/cmos.layout | 0 .../hp/{2570p => snb_ivb_laptops}/dsdt.asl | 0 src/mainboard/hp/snb_ivb_laptops/hda_verb.c | 0 .../hp/{2570p => snb_ivb_laptops}/mainboard.c | 0 .../variants}/2570p/board_info.txt | 0 .../variants}/2570p/devicetree.cb | 0 .../variants}/2570p/early_init.c | 0 .../variants}/2570p/gma-mainboard.ads | 0 .../variants}/2570p/gpio.c | 0 .../variants}/2570p/hda_verb.c | 0 21 files changed, 99 insertions(+), 67 deletions(-) delete mode 100644 src/mainboard/hp/2570p/Kconfig delete mode 100644 src/mainboard/hp/2570p/Kconfig.name create mode 100644 src/mainboard/hp/snb_ivb_laptops/Kconfig create mode 100644 src/mainboard/hp/snb_ivb_laptops/Kconfig.name rename src/mainboard/hp/{2570p => snb_ivb_laptops}/Makefile.inc (63%) rename src/mainboard/hp/{2570p => snb_ivb_laptops}/acpi/ec.asl (100%) rename src/mainboard/hp/{2570p => snb_ivb_laptops}/acpi/platform.asl (100%) rename src/mainboard/hp/{2570p => snb_ivb_laptops}/acpi/superio.asl (100%) rename src/mainboard/hp/{2570p => snb_ivb_laptops}/acpi_tables.c (100%) create mode 100644 src/mainboard/hp/snb_ivb_laptops/board_info.txt rename src/mainboard/hp/{2570p => snb_ivb_laptops}/cmos.default (100%) rename src/mainboard/hp/{2570p => snb_ivb_laptops}/cmos.layout (100%) rename src/mainboard/hp/{2570p => snb_ivb_laptops}/dsdt.asl (100%) create mode 100644 src/mainboard/hp/snb_ivb_laptops/hda_verb.c rename src/mainboard/hp/{2570p => snb_ivb_laptops}/mainboard.c (100%) rename src/mainboard/hp/{ => snb_ivb_laptops/variants}/2570p/board_info.txt (100%) rename src/mainboard/hp/{ => snb_ivb_laptops/variants}/2570p/devicetree.cb (100%) rename src/mainboard/hp/{ => snb_ivb_laptops/variants}/2570p/early_init.c (100%) rename src/mainboard/hp/{ => snb_ivb_laptops/variants}/2570p/gma-mainboard.ads (100%) rename src/mainboard/hp/{ => snb_ivb_laptops/variants}/2570p/gpio.c (100%) rename src/mainboard/hp/{ => snb_ivb_laptops/variants}/2570p/hda_verb.c (100%) diff --git a/src/mainboard/hp/2570p/Kconfig b/src/mainboard/hp/2570p/Kconfig deleted file mode 100644 index f7d27818ea..0000000000 --- a/src/mainboard/hp/2570p/Kconfig +++ /dev/null @@ -1,59 +0,0 @@ -# -# This file is part of the coreboot project. -# -# Copyright (C) 2017 Iru Cai -# -# 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 BOARD_HP_2570P - -config BOARD_SPECIFIC_OPTIONS - def_bool y - select BOARD_ROMSIZE_KB_16384 - select EC_HP_KBC1126 - select GFX_GMA_INTERNAL_IS_LVDS - select HAVE_ACPI_RESUME - select HAVE_ACPI_TABLES - select HAVE_CMOS_DEFAULT - select HAVE_OPTION_TABLE - select INTEL_INT15 - select MAINBOARD_HAS_LIBGFXINIT - select MAINBOARD_USES_IFD_GBE_REGION - select NORTHBRIDGE_INTEL_SANDYBRIDGE - select SERIRQ_CONTINUOUS_MODE - select SOUTHBRIDGE_INTEL_C216 - select SYSTEM_TYPE_LAPTOP - select USE_NATIVE_RAMINIT - -config MAINBOARD_DIR - string - default "hp/2570p" - -config MAINBOARD_PART_NUMBER - string - default "EliteBook 2570p" - -config VGA_BIOS_FILE - string - default "pci8086,0166.rom" - -config VGA_BIOS_ID - string - default "8086,0166" - -config MAX_CPUS - int - default 8 - -config USBDEBUG_HCD_INDEX - int - default 2 -endif diff --git a/src/mainboard/hp/2570p/Kconfig.name b/src/mainboard/hp/2570p/Kconfig.name deleted file mode 100644 index af13735ab5..0000000000 --- a/src/mainboard/hp/2570p/Kconfig.name +++ /dev/null @@ -1,2 +0,0 @@ -config BOARD_HP_2570P - bool "EliteBook 2570p" diff --git a/src/mainboard/hp/snb_ivb_laptops/Kconfig b/src/mainboard/hp/snb_ivb_laptops/Kconfig new file mode 100644 index 0000000000..c92039fbe2 --- /dev/null +++ b/src/mainboard/hp/snb_ivb_laptops/Kconfig @@ -0,0 +1,64 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2017 Iru Cai +## +## 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. +## + +config BOARD_HP_SNB_IVB_LAPTOPS + def_bool n + select EC_HP_KBC1126 + select HAVE_ACPI_RESUME + select HAVE_ACPI_TABLES + select HAVE_CMOS_DEFAULT + select HAVE_OPTION_TABLE + select NORTHBRIDGE_INTEL_SANDYBRIDGE + select SERIRQ_CONTINUOUS_MODE + select SYSTEM_TYPE_LAPTOP + select USE_NATIVE_RAMINIT + +if BOARD_HP_SNB_IVB_LAPTOPS + +config MAINBOARD_DIR + string + default "hp/snb_ivb_laptops" + +config VARIANT_DIR + string + default "2570p" if BOARD_HP_2570P + +config MAINBOARD_PART_NUMBER + string + default "EliteBook 2570p" if BOARD_HP_2570P + +config DEVICETREE + string + default "variants/$(CONFIG_VARIANT_DIR)/devicetree.cb" + +config VGA_BIOS_FILE + string + default "pci8086,0116.rom" if SOUTHBRIDGE_INTEL_BD82X6X + default "pci8086,0166.rom" if SOUTHBRIDGE_INTEL_C216 + +config VGA_BIOS_ID + string + default "8086,0116" if SOUTHBRIDGE_INTEL_BD82X6X + default "8086,0166" if SOUTHBRIDGE_INTEL_C216 + +config MAX_CPUS + int + default 8 + +config USBDEBUG_HCD_INDEX + int + default 2 if BOARD_HP_2570P + +endif diff --git a/src/mainboard/hp/snb_ivb_laptops/Kconfig.name b/src/mainboard/hp/snb_ivb_laptops/Kconfig.name new file mode 100644 index 0000000000..ecef3b339c --- /dev/null +++ b/src/mainboard/hp/snb_ivb_laptops/Kconfig.name @@ -0,0 +1,25 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2017 Iru Cai +## +## 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. +## + +config BOARD_HP_2570P + bool "EliteBook 2570p" + + select BOARD_HP_SNB_IVB_LAPTOPS + select BOARD_ROMSIZE_KB_16384 + select GFX_GMA_INTERNAL_IS_LVDS + select INTEL_INT15 + select MAINBOARD_HAS_LIBGFXINIT + select MAINBOARD_USES_IFD_GBE_REGION + select SOUTHBRIDGE_INTEL_C216 diff --git a/src/mainboard/hp/2570p/Makefile.inc b/src/mainboard/hp/snb_ivb_laptops/Makefile.inc similarity index 63% rename from src/mainboard/hp/2570p/Makefile.inc rename to src/mainboard/hp/snb_ivb_laptops/Makefile.inc index 1d258758be..663f81adad 100644 --- a/src/mainboard/hp/2570p/Makefile.inc +++ b/src/mainboard/hp/snb_ivb_laptops/Makefile.inc @@ -13,9 +13,9 @@ ## GNU General Public License for more details. ## -bootblock-y += gpio.c -romstage-y += gpio.c - -ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads -bootblock-y += early_init.c -romstage-y += early_init.c +bootblock-y += variants/$(VARIANT_DIR)/early_init.c +romstage-y += variants/$(VARIANT_DIR)/early_init.c +bootblock-y += variants/$(VARIANT_DIR)/gpio.c +romstage-y += variants/$(VARIANT_DIR)/gpio.c +ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += variants/$(VARIANT_DIR)/gma-mainboard.ads diff --git a/src/mainboard/hp/2570p/acpi/ec.asl b/src/mainboard/hp/snb_ivb_laptops/acpi/ec.asl similarity index 100% rename from src/mainboard/hp/2570p/acpi/ec.asl rename to src/mainboard/hp/snb_ivb_laptops/acpi/ec.asl diff --git a/src/mainboard/hp/2570p/acpi/platform.asl b/src/mainboard/hp/snb_ivb_laptops/acpi/platform.asl similarity index 100% rename from src/mainboard/hp/2570p/acpi/platform.asl rename to src/mainboard/hp/snb_ivb_laptops/acpi/platform.asl diff --git a/src/mainboard/hp/2570p/acpi/superio.asl b/src/mainboard/hp/snb_ivb_laptops/acpi/superio.asl similarity index 100% rename from src/mainboard/hp/2570p/acpi/superio.asl rename to src/mainboard/hp/snb_ivb_laptops/acpi/superio.asl diff --git a/src/mainboard/hp/2570p/acpi_tables.c b/src/mainboard/hp/snb_ivb_laptops/acpi_tables.c similarity index 100% rename from src/mainboard/hp/2570p/acpi_tables.c rename to src/mainboard/hp/snb_ivb_laptops/acpi_tables.c diff --git a/src/mainboard/hp/snb_ivb_laptops/board_info.txt b/src/mainboard/hp/snb_ivb_laptops/board_info.txt new file mode 100644 index 0000000000..ef4e5dd6c5 --- /dev/null +++ b/src/mainboard/hp/snb_ivb_laptops/board_info.txt @@ -0,0 +1,4 @@ +Category: laptop +ROM protocol: SPI +ROM package: SOIC-8 or SOIC-16 +ROM socketed: n diff --git a/src/mainboard/hp/2570p/cmos.default b/src/mainboard/hp/snb_ivb_laptops/cmos.default similarity index 100% rename from src/mainboard/hp/2570p/cmos.default rename to src/mainboard/hp/snb_ivb_laptops/cmos.default diff --git a/src/mainboard/hp/2570p/cmos.layout b/src/mainboard/hp/snb_ivb_laptops/cmos.layout similarity index 100% rename from src/mainboard/hp/2570p/cmos.layout rename to src/mainboard/hp/snb_ivb_laptops/cmos.layout diff --git a/src/mainboard/hp/2570p/dsdt.asl b/src/mainboard/hp/snb_ivb_laptops/dsdt.asl similarity index 100% rename from src/mainboard/hp/2570p/dsdt.asl rename to src/mainboard/hp/snb_ivb_laptops/dsdt.asl diff --git a/src/mainboard/hp/snb_ivb_laptops/hda_verb.c b/src/mainboard/hp/snb_ivb_laptops/hda_verb.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/mainboard/hp/2570p/mainboard.c b/src/mainboard/hp/snb_ivb_laptops/mainboard.c similarity index 100% rename from src/mainboard/hp/2570p/mainboard.c rename to src/mainboard/hp/snb_ivb_laptops/mainboard.c diff --git a/src/mainboard/hp/2570p/board_info.txt b/src/mainboard/hp/snb_ivb_laptops/variants/2570p/board_info.txt similarity index 100% rename from src/mainboard/hp/2570p/board_info.txt rename to src/mainboard/hp/snb_ivb_laptops/variants/2570p/board_info.txt diff --git a/src/mainboard/hp/2570p/devicetree.cb b/src/mainboard/hp/snb_ivb_laptops/variants/2570p/devicetree.cb similarity index 100% rename from src/mainboard/hp/2570p/devicetree.cb rename to src/mainboard/hp/snb_ivb_laptops/variants/2570p/devicetree.cb diff --git a/src/mainboard/hp/2570p/early_init.c b/src/mainboard/hp/snb_ivb_laptops/variants/2570p/early_init.c similarity index 100% rename from src/mainboard/hp/2570p/early_init.c rename to src/mainboard/hp/snb_ivb_laptops/variants/2570p/early_init.c diff --git a/src/mainboard/hp/2570p/gma-mainboard.ads b/src/mainboard/hp/snb_ivb_laptops/variants/2570p/gma-mainboard.ads similarity index 100% rename from src/mainboard/hp/2570p/gma-mainboard.ads rename to src/mainboard/hp/snb_ivb_laptops/variants/2570p/gma-mainboard.ads diff --git a/src/mainboard/hp/2570p/gpio.c b/src/mainboard/hp/snb_ivb_laptops/variants/2570p/gpio.c similarity index 100% rename from src/mainboard/hp/2570p/gpio.c rename to src/mainboard/hp/snb_ivb_laptops/variants/2570p/gpio.c diff --git a/src/mainboard/hp/2570p/hda_verb.c b/src/mainboard/hp/snb_ivb_laptops/variants/2570p/hda_verb.c similarity index 100% rename from src/mainboard/hp/2570p/hda_verb.c rename to src/mainboard/hp/snb_ivb_laptops/variants/2570p/hda_verb.c