diff options
author | Felix Singer <felixsinger@posteo.net> | 2022-04-09 05:44:39 +0200 |
---|---|---|
committer | Felix Singer <felixsinger@posteo.net> | 2022-07-10 23:38:16 +0000 |
commit | c2d1588623b0196b86c25f700d6d0c39cd550be2 (patch) | |
tree | 763a9070ffe4068920c1dc3dc92dccdc45df93e7 | |
parent | 851435e3792f8381a64aa6815e879b2503834e5a (diff) |
mb/lenovo/haswell: Convert to variant setup
In preparation to CB:63514, make use of the variant concept and convert
the existing T440p mainboard into a variant.
Change-Id: I3c7e06607135ce0a62c158e296b51e5311234505
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63513
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
-rw-r--r-- | src/mainboard/lenovo/haswell/Kconfig | 19 | ||||
-rw-r--r-- | src/mainboard/lenovo/haswell/Makefile.inc | 7 | ||||
-rw-r--r-- | src/mainboard/lenovo/haswell/romstage.c | 33 | ||||
-rw-r--r-- | src/mainboard/lenovo/haswell/variants/t440p/data.vbt (renamed from src/mainboard/lenovo/haswell/data.vbt) | bin | 4608 -> 4608 bytes | |||
-rw-r--r-- | src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb (renamed from src/mainboard/lenovo/haswell/devicetree.cb) | 0 | ||||
-rw-r--r-- | src/mainboard/lenovo/haswell/variants/t440p/gma-mainboard.ads (renamed from src/mainboard/lenovo/haswell/gma-mainboard.ads) | 0 | ||||
-rw-r--r-- | src/mainboard/lenovo/haswell/variants/t440p/gpio.c (renamed from src/mainboard/lenovo/haswell/gpio.c) | 0 | ||||
-rw-r--r-- | src/mainboard/lenovo/haswell/variants/t440p/hda_verb.c (renamed from src/mainboard/lenovo/haswell/hda_verb.c) | 0 | ||||
-rw-r--r-- | src/mainboard/lenovo/haswell/variants/t440p/romstage.c | 39 |
9 files changed, 58 insertions, 40 deletions
diff --git a/src/mainboard/lenovo/haswell/Kconfig b/src/mainboard/lenovo/haswell/Kconfig index 126e92da88..71d30f2778 100644 --- a/src/mainboard/lenovo/haswell/Kconfig +++ b/src/mainboard/lenovo/haswell/Kconfig @@ -1,7 +1,5 @@ -if BOARD_LENOVO_THINKPAD_T440P - -config BOARD_SPECIFIC_OPTIONS - def_bool y +config BOARD_LENOVO_HASWELL_COMMON + def_bool n select BOARD_ROMSIZE_KB_12288 select EC_LENOVO_H8 select EC_LENOVO_PMH7 @@ -23,6 +21,11 @@ config BOARD_SPECIFIC_OPTIONS select SOUTHBRIDGE_INTEL_LYNXPOINT select SYSTEM_TYPE_LAPTOP +config BOARD_LENOVO_THINKPAD_T440P + select BOARD_LENOVO_HASWELL_COMMON + +if BOARD_LENOVO_HASWELL_COMMON + config VBOOT select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC select GBB_FLAG_DISABLE_FWMP @@ -38,6 +41,12 @@ config VBOOT_VBNV_OFFSET hex default 0x2a +config VARIANT_DIR + default "t440p" if BOARD_LENOVO_THINKPAD_T440P + +config DEVICETREE + default "variants/\$(CONFIG_VARIANT_DIR)/devicetree.cb" + config FMDFILE default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwab.fmd" if VBOOT @@ -45,7 +54,7 @@ config MAINBOARD_DIR default "lenovo/haswell" config MAINBOARD_PART_NUMBER - default "ThinkPad T440p" + default "ThinkPad T440p" if BOARD_LENOVO_THINKPAD_T440P config VGA_BIOS_ID string diff --git a/src/mainboard/lenovo/haswell/Makefile.inc b/src/mainboard/lenovo/haswell/Makefile.inc index ebe01aea99..8250d31184 100644 --- a/src/mainboard/lenovo/haswell/Makefile.inc +++ b/src/mainboard/lenovo/haswell/Makefile.inc @@ -1,2 +1,5 @@ -romstage-y += gpio.c -ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads +romstage-y += variants/$(VARIANT_DIR)/gpio.c +romstage-y += variants/$(VARIANT_DIR)/romstage.c + +ramstage-y += mainboard.c +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += variants/$(VARIANT_DIR)/gma-mainboard.ads diff --git a/src/mainboard/lenovo/haswell/romstage.c b/src/mainboard/lenovo/haswell/romstage.c index 8a7da158e3..9b9a15fa21 100644 --- a/src/mainboard/lenovo/haswell/romstage.c +++ b/src/mainboard/lenovo/haswell/romstage.c @@ -34,36 +34,3 @@ void mb_late_romstage_setup(void) pci_and_config32(HOST_BRIDGE, DEVEN, ~DEVEN_D1F0EN); } } - -void mb_get_spd_map(struct spd_info *spdi) -{ - spdi->addresses[0] = 0x50; - spdi->addresses[2] = 0x51; -} - -const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS] = { - /* Length, Enable, OCn#, Location */ - { 0x0040, 1, 0, USB_PORT_BACK_PANEL }, /* USB3 */ - { 0x0040, 1, 0, USB_PORT_BACK_PANEL }, /* USB3 */ - { 0x0110, 1, 1, USB_PORT_BACK_PANEL }, /* USB2 charge */ - { 0x0040, 1, USB_OC_PIN_SKIP, USB_PORT_BACK_PANEL }, - { 0x0080, 1, USB_OC_PIN_SKIP, USB_PORT_DOCK }, - { 0x0080, 1, 2, USB_PORT_BACK_PANEL }, /* USB2 */ - { 0x0040, 1, 3, USB_PORT_BACK_PANEL }, - { 0x0040, 1, 3, USB_PORT_BACK_PANEL }, - { 0x0040, 1, 4, USB_PORT_BACK_PANEL }, - { 0x0110, 1, 4, USB_PORT_BACK_PANEL }, /* WWAN */ - { 0x0040, 1, 5, USB_PORT_INTERNAL }, /* WLAN */ - { 0x0040, 1, 5, USB_PORT_BACK_PANEL }, /* webcam */ - { 0x0080, 1, 6, USB_PORT_BACK_PANEL }, - { 0x0040, 1, 6, USB_PORT_BACK_PANEL }, -}; - -const struct usb3_port_config mainboard_usb3_ports[MAX_USB3_PORTS] = { - { 1, 0 }, - { 1, 0 }, - { 1, USB_OC_PIN_SKIP }, - { 1, USB_OC_PIN_SKIP }, - { 1, 1 }, - { 1, 1 }, /* WWAN */ -}; diff --git a/src/mainboard/lenovo/haswell/data.vbt b/src/mainboard/lenovo/haswell/variants/t440p/data.vbt Binary files differindex 79077ccb0a..79077ccb0a 100644 --- a/src/mainboard/lenovo/haswell/data.vbt +++ b/src/mainboard/lenovo/haswell/variants/t440p/data.vbt diff --git a/src/mainboard/lenovo/haswell/devicetree.cb b/src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb index b7588ea77d..b7588ea77d 100644 --- a/src/mainboard/lenovo/haswell/devicetree.cb +++ b/src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb diff --git a/src/mainboard/lenovo/haswell/gma-mainboard.ads b/src/mainboard/lenovo/haswell/variants/t440p/gma-mainboard.ads index 62dfc38228..62dfc38228 100644 --- a/src/mainboard/lenovo/haswell/gma-mainboard.ads +++ b/src/mainboard/lenovo/haswell/variants/t440p/gma-mainboard.ads diff --git a/src/mainboard/lenovo/haswell/gpio.c b/src/mainboard/lenovo/haswell/variants/t440p/gpio.c index 5494070b7a..5494070b7a 100644 --- a/src/mainboard/lenovo/haswell/gpio.c +++ b/src/mainboard/lenovo/haswell/variants/t440p/gpio.c diff --git a/src/mainboard/lenovo/haswell/hda_verb.c b/src/mainboard/lenovo/haswell/variants/t440p/hda_verb.c index 60b21be1e4..60b21be1e4 100644 --- a/src/mainboard/lenovo/haswell/hda_verb.c +++ b/src/mainboard/lenovo/haswell/variants/t440p/hda_verb.c diff --git a/src/mainboard/lenovo/haswell/variants/t440p/romstage.c b/src/mainboard/lenovo/haswell/variants/t440p/romstage.c new file mode 100644 index 0000000000..f158716ef2 --- /dev/null +++ b/src/mainboard/lenovo/haswell/variants/t440p/romstage.c @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <stdint.h> +#include <northbridge/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/raminit.h> +#include <southbridge/intel/lynxpoint/pch.h> + +void mb_get_spd_map(struct spd_info *spdi) +{ + spdi->addresses[0] = 0x50; + spdi->addresses[2] = 0x51; +} + +const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS] = { + /* Length, Enable, OCn#, Location */ + { 0x0040, 1, 0, USB_PORT_BACK_PANEL }, /* USB3 */ + { 0x0040, 1, 0, USB_PORT_BACK_PANEL }, /* USB3 */ + { 0x0110, 1, 1, USB_PORT_BACK_PANEL }, /* USB2 charge */ + { 0x0040, 1, USB_OC_PIN_SKIP, USB_PORT_BACK_PANEL }, + { 0x0080, 1, USB_OC_PIN_SKIP, USB_PORT_DOCK }, + { 0x0080, 1, 2, USB_PORT_BACK_PANEL }, /* USB2 */ + { 0x0040, 1, 3, USB_PORT_BACK_PANEL }, + { 0x0040, 1, 3, USB_PORT_BACK_PANEL }, + { 0x0040, 1, 4, USB_PORT_BACK_PANEL }, + { 0x0110, 1, 4, USB_PORT_BACK_PANEL }, /* WWAN */ + { 0x0040, 1, 5, USB_PORT_INTERNAL }, /* WLAN */ + { 0x0040, 1, 5, USB_PORT_BACK_PANEL }, /* webcam */ + { 0x0080, 1, 6, USB_PORT_BACK_PANEL }, + { 0x0040, 1, 6, USB_PORT_BACK_PANEL }, +}; + +const struct usb3_port_config mainboard_usb3_ports[MAX_USB3_PORTS] = { + { 1, 0 }, + { 1, 0 }, + { 1, USB_OC_PIN_SKIP }, + { 1, USB_OC_PIN_SKIP }, + { 1, 1 }, + { 1, 1 }, /* WWAN */ +}; |