Hello Iru Cai,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to review the following change.
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
Tested: - i5-4300M, 8G+8G - keyboard and trackpoint - USB - SATA - WLAN - Arch Linux loaded from SeaBIOS - libgfxinit - ACPI support
Issues: - The touchpad is misconfigured, there's no middle button, and the 3 keys on top are all identified as left button - The Fn key is on by default
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 16 files changed, 837 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/1
diff --git a/src/mainboard/lenovo/t440p/Kconfig b/src/mainboard/lenovo/t440p/Kconfig new file mode 100644 index 0000000..59a257e --- /dev/null +++ b/src/mainboard/lenovo/t440p/Kconfig @@ -0,0 +1,41 @@ +if BOARD_LENOVO_THINKPAD_T440P + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select BOARD_ROMSIZE_KB_12288 + select CPU_INTEL_HASWELL + select EC_LENOVO_H8 + select EC_LENOVO_PMH7 + select HAVE_ACPI_RESUME + select HAVE_ACPI_TABLES + select INTEL_INT15 + select MAINBOARD_HAS_LIBGFXINIT + select NORTHBRIDGE_INTEL_HASWELL + select SERIRQ_CONTINUOUS_MODE + select SOUTHBRIDGE_INTEL_LYNXPOINT + select SYSTEM_TYPE_LAPTOP + +config MAINBOARD_DIR + string + default lenovo/t440p + +config MAINBOARD_PART_NUMBER + string + default "ThinkPad T440p" + +config VGA_BIOS_FILE + string + default "pci8086,0416.rom" + +config VGA_BIOS_ID + string + default "8086,0416" + +config MAX_CPUS + int + default 8 + +config USBDEBUG_HCD_INDEX # FIXME: check this + int + default 2 +endif diff --git a/src/mainboard/lenovo/t440p/Kconfig.name b/src/mainboard/lenovo/t440p/Kconfig.name new file mode 100644 index 0000000..e90299d --- /dev/null +++ b/src/mainboard/lenovo/t440p/Kconfig.name @@ -0,0 +1,2 @@ +config BOARD_LENOVO_THINKPAD_T440P + bool "ThinkPad T440p" diff --git a/src/mainboard/lenovo/t440p/Makefile.inc b/src/mainboard/lenovo/t440p/Makefile.inc new file mode 100644 index 0000000..fa6e7af --- /dev/null +++ b/src/mainboard/lenovo/t440p/Makefile.inc @@ -0,0 +1,3 @@ +romstage-y += gpio.c +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads +smm-y += smihandler.c diff --git a/src/mainboard/lenovo/t440p/acpi/ec.asl b/src/mainboard/lenovo/t440p/acpi/ec.asl new file mode 100644 index 0000000..c3569e8 --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi/ec.asl @@ -0,0 +1 @@ +#include <ec/lenovo/h8/acpi/ec.asl> diff --git a/src/mainboard/lenovo/t440p/acpi/platform.asl b/src/mainboard/lenovo/t440p/acpi/platform.asl new file mode 100644 index 0000000..dfced7a --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi/platform.asl @@ -0,0 +1,12 @@ +Method(_WAK,1) +{ + /* ME may not be up yet. */ + Store (0, _TZ.MEB1) + Store (0, _TZ.MEB2) + Return(Package(){0,0}) +} + +Method(_PTS,1) +{ + _SB.PCI0.LPCB.EC.RADI(0) +} diff --git a/src/mainboard/lenovo/t440p/acpi/superio.asl b/src/mainboard/lenovo/t440p/acpi/superio.asl new file mode 100644 index 0000000..f2b35ba --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi/superio.asl @@ -0,0 +1 @@ +#include <drivers/pc80/pc/ps2_controller.asl> diff --git a/src/mainboard/lenovo/t440p/acpi_tables.c b/src/mainboard/lenovo/t440p/acpi_tables.c new file mode 100644 index 0000000..5dc98d8 --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi_tables.c @@ -0,0 +1,36 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <southbridge/intel/lynxpoint/nvs.h> + +/* FIXME: check this function. */ +void acpi_create_gnvs(global_nvs_t *gnvs) +{ + /* Disable USB ports in S3 by default */ + gnvs->s3u0 = 0; + gnvs->s3u1 = 0; + + /* Disable USB ports in S5 by default */ + gnvs->s5u0 = 0; + gnvs->s5u1 = 0; + + // the lid is open by default. + gnvs->lids = 1; + + gnvs->tcrt = 100; + gnvs->tpsv = 90; +} diff --git a/src/mainboard/lenovo/t440p/board_info.txt b/src/mainboard/lenovo/t440p/board_info.txt new file mode 100644 index 0000000..cdbf8b8 --- /dev/null +++ b/src/mainboard/lenovo/t440p/board_info.txt @@ -0,0 +1,4 @@ +Category: laptop +ROM protocol: SPI +Flashrom support: n +FIXME: put ROM package, ROM socketed, Release year diff --git a/src/mainboard/lenovo/t440p/devicetree.cb b/src/mainboard/lenovo/t440p/devicetree.cb new file mode 100644 index 0000000..df98ef8 --- /dev/null +++ b/src/mainboard/lenovo/t440p/devicetree.cb @@ -0,0 +1,165 @@ +chip northbridge/intel/haswell # FIXME: check gfx.ndid and gfx.did + register "gfx.did" = "{ 0x80000100, 0x80000240, 0x80000410, 0x80000410, 0x00000005 }" + register "gfx.ndid" = "3" + register "gpu_cpu_backlight" = "0x12ba12ba" + register "gpu_ddi_e_connected" = "1" + register "gpu_dp_b_hotplug" = "4" + register "gpu_dp_c_hotplug" = "4" + register "gpu_dp_d_hotplug" = "4" + register "gpu_panel_port_select" = "0" + register "gpu_panel_power_backlight_off_delay" = "1" + register "gpu_panel_power_backlight_on_delay" = "1" + register "gpu_panel_power_cycle_delay" = "6" + register "gpu_panel_power_down_delay" = "500" + register "gpu_panel_power_up_delay" = "2000" + register "gpu_pch_backlight" = "0x12ba12ba" + device cpu_cluster 0x0 on + chip cpu/intel/haswell + register "c1_acpower" = "1" + register "c1_battery" = "1" + register "c2_acpower" = "3" + register "c2_battery" = "3" + register "c3_acpower" = "5" + register "c3_battery" = "5" + device lapic 0x0 on + end + device lapic 0xacac off + end + end + end + device domain 0x0 on + chip southbridge/intel/lynxpoint # Intel Series 8 Lynx Point PCH + register "gen1_dec" = "0x007c1601" + register "gen2_dec" = "0x000c15e1" + register "gen3_dec" = "0x00000000" + register "gen4_dec" = "0x000c06a1" + register "gpi13_routing" = "2" + register "gpi1_routing" = "2" + register "pirqa_routing" = "0x8b" + register "pirqb_routing" = "0x8a" + register "pirqc_routing" = "0x8a" + register "pirqd_routing" = "0x89" + register "pirqe_routing" = "0x86" + register "pirqf_routing" = "0x80" + register "pirqg_routing" = "0x8b" + register "pirqh_routing" = "0x87" + register "sata_ahci" = "1" + # 0(HDD), 5(ODD) + register "sata_port_map" = "0x21" + device pci 14.0 on # xHCI Controller + subsystemid 0x17aa 0x220e + end + device pci 16.0 on # Management Engine Interface 1 + subsystemid 0x17aa 0x220e + end + device pci 16.1 off # Management Engine Interface 2 + end + device pci 16.2 off # Management Engine IDE-R + end + device pci 16.3 off # Management Engine KT + end + device pci 19.0 on # Intel Gigabit Ethernet Unsupported PCI device 8086:153a + subsystemid 0x17aa 0x220e + end + device pci 1a.0 on # USB2 EHCI #2 + subsystemid 0x17aa 0x220e + end + device pci 1b.0 on # High Definition Audio Audio controller + subsystemid 0x17aa 0x220e + end + device pci 1c.0 on # PCIe Port #1 + subsystemid 0x17aa 0x220e + end + device pci 1c.1 on # PCIe Port #2 + subsystemid 0x17aa 0x220e + end + device pci 1c.2 off # PCIe Port #3 + end + device pci 1c.3 off # PCIe Port #4 + end + device pci 1c.4 off # PCIe Port #5 + end + device pci 1c.5 off # PCIe Port #6 + end + device pci 1c.6 off # PCIe Port #7 + end + device pci 1c.7 off # PCIe Port #8 + end + device pci 1d.0 on # USB2 EHCI #1 + subsystemid 0x17aa 0x220e + end + device pci 1f.0 on # LPC bridge PCI-LPC bridge + subsystemid 0x17aa 0x220e + chip ec/lenovo/pmh7 + register "backlight_enable" = "0x01" + register "dock_event_enable" = "0x01" + device pnp ff.1 on # dummy + end + end + chip ec/lenovo/h8 # FIXME: has_keyboard_backlight, has_power_management_beeps, has_uwb + register "beepmask0" = "0x00" + register "beepmask1" = "0x86" + register "config0" = "0xa6" + register "config1" = "0x0d" + register "config2" = "0xa8" + register "config3" = "0xc4" + register "event2_enable" = "0xff" + register "event3_enable" = "0xff" + register "event4_enable" = "0xd0" + register "event5_enable" = "0x3c" + register "event7_enable" = "0x01" + register "event8_enable" = "0x7b" + register "event9_enable" = "0xff" + register "eventc_enable" = "0xff" + register "eventd_enable" = "0xff" + register "evente_enable" = "0x9d" + device pnp ff.2 on # dummy + io 0x60 = 0x62 + io 0x62 = 0x66 + io 0x64 = 0x1600 + io 0x66 = 0x1604 + end + end + end + device pci 1f.2 on # SATA Controller 1 + subsystemid 0x17aa 0x220e + end + device pci 1f.3 on # SMBus + subsystemid 0x17aa 0x220e + chip drivers/i2c/at24rf08c # eeprom, 8 virtual devices, same chip + device i2c 54 on + end + device i2c 55 on + end + device i2c 56 on + end + device i2c 57 on + end + device i2c 5c on + end + device i2c 5d on + end + device i2c 5e on + end + device i2c 5f on + end + end + end + device pci 1f.5 off # SATA Controller 2 + end + device pci 1f.6 off # Thermal + end + end + device pci 00.0 on # Host bridge Host bridge + subsystemid 0x17aa 0x220e + end + device pci 01.0 off # PCIe Bridge for discrete graphics + end + device pci 02.0 on # Internal graphics VGA controller + subsystemid 0x17aa 0x220e + end + device pci 03.0 on # Mini-HD audio Audio controller + subsystemid 0x17aa 0x220e + end + end +end diff --git a/src/mainboard/lenovo/t440p/dsdt.asl b/src/mainboard/lenovo/t440p/dsdt.asl new file mode 100644 index 0000000..4838877 --- /dev/null +++ b/src/mainboard/lenovo/t440p/dsdt.asl @@ -0,0 +1,31 @@ +#define BRIGHTNESS_UP _SB.PCI0.GFX0.INCB +#define BRIGHTNESS_DOWN _SB.PCI0.GFX0.DECB +#define ACPI_VIDEO_DEVICE _SB.PCI0.GFX0 +#define EC_LENOVO_H8_ME_WORKAROUND 1 +#define THINKPAD_EC_GPE 17 + +#include <arch/acpi.h> +DefinitionBlock( + "dsdt.aml", + "DSDT", + 0x02, // DSDT revision: ACPI 2.0 and up + OEM_ID, + ACPI_TABLE_CREATOR, + 0x20141018 // OEM revision +) +{ + /* Some generic macros */ + #include "acpi/platform.asl" + #include <cpu/intel/common/acpi/cpu.asl> + #include <southbridge/intel/lynxpoint/acpi/platform.asl> + /* global NVS and variables. */ + #include <southbridge/intel/lynxpoint/acpi/globalnvs.asl> + #include <southbridge/intel/lynxpoint/acpi/sleepstates.asl> + + Device (_SB.PCI0) + { + #include <northbridge/intel/haswell/acpi/haswell.asl> + #include <drivers/intel/gma/acpi/default_brightness_levels.asl> + #include <southbridge/intel/lynxpoint/acpi/pch.asl> + } +} diff --git a/src/mainboard/lenovo/t440p/gma-mainboard.ads b/src/mainboard/lenovo/t440p/gma-mainboard.ads new file mode 100644 index 0000000..ce27742 --- /dev/null +++ b/src/mainboard/lenovo/t440p/gma-mainboard.ads @@ -0,0 +1,35 @@ +-- +-- 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; either version 2 of the License, or +-- (at your option) any later version. +-- +-- 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. +-- + +with HW.GFX.GMA; +with HW.GFX.GMA.Display_Probing; + +use HW.GFX.GMA; +use HW.GFX.GMA.Display_Probing; + +private package GMA.Mainboard is + + -- FIXME: check this + ports : constant Port_List := + (DP1, + DP2, + DP3, + HDMI1, + HDMI2, + HDMI3, + Analog, + Internal, + others => Disabled); + +end GMA.Mainboard; diff --git a/src/mainboard/lenovo/t440p/gpio.c b/src/mainboard/lenovo/t440p/gpio.c new file mode 100644 index 0000000..16fef44 --- /dev/null +++ b/src/mainboard/lenovo/t440p/gpio.c @@ -0,0 +1,224 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <southbridge/intel/common/gpio.h> + +static const struct pch_gpio_set1 pch_gpio_set1_mode = { + .gpio0 = GPIO_MODE_GPIO, + .gpio1 = GPIO_MODE_GPIO, + .gpio2 = GPIO_MODE_GPIO, + .gpio3 = GPIO_MODE_GPIO, + .gpio4 = GPIO_MODE_GPIO, + .gpio5 = GPIO_MODE_GPIO, + .gpio6 = GPIO_MODE_GPIO, + .gpio7 = GPIO_MODE_GPIO, + .gpio8 = GPIO_MODE_GPIO, + .gpio9 = GPIO_MODE_NATIVE, + .gpio10 = GPIO_MODE_GPIO, + .gpio11 = GPIO_MODE_GPIO, + .gpio12 = GPIO_MODE_NATIVE, + .gpio13 = GPIO_MODE_GPIO, + .gpio14 = GPIO_MODE_NATIVE, + .gpio15 = GPIO_MODE_GPIO, + .gpio16 = GPIO_MODE_NATIVE, + .gpio17 = GPIO_MODE_GPIO, + .gpio18 = GPIO_MODE_NATIVE, + .gpio19 = GPIO_MODE_NATIVE, + .gpio20 = GPIO_MODE_NATIVE, + .gpio21 = GPIO_MODE_GPIO, + .gpio22 = GPIO_MODE_GPIO, + .gpio23 = GPIO_MODE_NATIVE, + .gpio24 = GPIO_MODE_GPIO, + .gpio25 = GPIO_MODE_NATIVE, + .gpio26 = GPIO_MODE_NATIVE, + .gpio27 = GPIO_MODE_GPIO, + .gpio28 = GPIO_MODE_GPIO, + .gpio29 = GPIO_MODE_NATIVE, + .gpio30 = GPIO_MODE_NATIVE, + .gpio31 = GPIO_MODE_GPIO, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_direction = { + .gpio0 = GPIO_DIR_INPUT, + .gpio1 = GPIO_DIR_INPUT, + .gpio2 = GPIO_DIR_INPUT, + .gpio3 = GPIO_DIR_OUTPUT, + .gpio4 = GPIO_DIR_OUTPUT, + .gpio5 = GPIO_DIR_INPUT, + .gpio6 = GPIO_DIR_INPUT, + .gpio7 = GPIO_DIR_OUTPUT, + .gpio8 = GPIO_DIR_OUTPUT, + .gpio10 = GPIO_DIR_OUTPUT, + .gpio11 = GPIO_DIR_INPUT, + .gpio13 = GPIO_DIR_INPUT, + .gpio15 = GPIO_DIR_OUTPUT, + .gpio17 = GPIO_DIR_INPUT, + .gpio21 = GPIO_DIR_INPUT, + .gpio22 = GPIO_DIR_OUTPUT, + .gpio24 = GPIO_DIR_OUTPUT, + .gpio27 = GPIO_DIR_INPUT, + .gpio28 = GPIO_DIR_OUTPUT, + .gpio31 = GPIO_DIR_INPUT, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_level = { + .gpio3 = GPIO_LEVEL_LOW, + .gpio4 = GPIO_LEVEL_LOW, + .gpio7 = GPIO_LEVEL_LOW, + .gpio8 = GPIO_LEVEL_LOW, + .gpio10 = GPIO_LEVEL_HIGH, + .gpio15 = GPIO_LEVEL_LOW, + .gpio22 = GPIO_LEVEL_LOW, + .gpio24 = GPIO_LEVEL_LOW, + .gpio28 = GPIO_LEVEL_LOW, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_reset = { + .gpio24 = GPIO_RESET_RSMRST, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_invert = { + .gpio0 = GPIO_INVERT, + .gpio1 = GPIO_INVERT, + .gpio11 = GPIO_INVERT, + .gpio13 = GPIO_INVERT, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_blink = { +}; + +static const struct pch_gpio_set2 pch_gpio_set2_mode = { + .gpio32 = GPIO_MODE_NATIVE, + .gpio33 = GPIO_MODE_GPIO, + .gpio34 = GPIO_MODE_GPIO, + .gpio35 = GPIO_MODE_GPIO, + .gpio36 = GPIO_MODE_GPIO, + .gpio37 = GPIO_MODE_GPIO, + .gpio38 = GPIO_MODE_GPIO, + .gpio39 = GPIO_MODE_GPIO, + .gpio40 = GPIO_MODE_NATIVE, + .gpio41 = GPIO_MODE_NATIVE, + .gpio42 = GPIO_MODE_NATIVE, + .gpio43 = GPIO_MODE_GPIO, + .gpio44 = GPIO_MODE_NATIVE, + .gpio45 = GPIO_MODE_NATIVE, + .gpio46 = GPIO_MODE_NATIVE, + .gpio47 = GPIO_MODE_NATIVE, + .gpio48 = GPIO_MODE_GPIO, + .gpio49 = GPIO_MODE_NATIVE, + .gpio50 = GPIO_MODE_GPIO, + .gpio51 = GPIO_MODE_GPIO, + .gpio52 = GPIO_MODE_GPIO, + .gpio53 = GPIO_MODE_GPIO, + .gpio54 = GPIO_MODE_GPIO, + .gpio55 = GPIO_MODE_GPIO, + .gpio56 = GPIO_MODE_NATIVE, + .gpio57 = GPIO_MODE_GPIO, + .gpio58 = GPIO_MODE_NATIVE, + .gpio59 = GPIO_MODE_NATIVE, + .gpio60 = GPIO_MODE_NATIVE, + .gpio61 = GPIO_MODE_NATIVE, + .gpio62 = GPIO_MODE_NATIVE, + .gpio63 = GPIO_MODE_NATIVE, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_direction = { + .gpio33 = GPIO_DIR_OUTPUT, + .gpio34 = GPIO_DIR_INPUT, + .gpio35 = GPIO_DIR_OUTPUT, + .gpio36 = GPIO_DIR_INPUT, + .gpio37 = GPIO_DIR_INPUT, + .gpio38 = GPIO_DIR_INPUT, + .gpio39 = GPIO_DIR_INPUT, + .gpio43 = GPIO_DIR_OUTPUT, + .gpio48 = GPIO_DIR_INPUT, + .gpio50 = GPIO_DIR_INPUT, + .gpio51 = GPIO_DIR_OUTPUT, + .gpio52 = GPIO_DIR_INPUT, + .gpio53 = GPIO_DIR_OUTPUT, + .gpio54 = GPIO_DIR_OUTPUT, + .gpio55 = GPIO_DIR_OUTPUT, + .gpio57 = GPIO_DIR_INPUT, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_level = { + .gpio33 = GPIO_LEVEL_HIGH, + .gpio35 = GPIO_LEVEL_LOW, + .gpio43 = GPIO_LEVEL_HIGH, + .gpio51 = GPIO_LEVEL_HIGH, + .gpio53 = GPIO_LEVEL_HIGH, + .gpio54 = GPIO_LEVEL_LOW, + .gpio55 = GPIO_LEVEL_HIGH, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_reset = { +}; + +static const struct pch_gpio_set3 pch_gpio_set3_mode = { + .gpio64 = GPIO_MODE_GPIO, + .gpio65 = GPIO_MODE_GPIO, + .gpio66 = GPIO_MODE_GPIO, + .gpio67 = GPIO_MODE_GPIO, + .gpio68 = GPIO_MODE_GPIO, + .gpio69 = GPIO_MODE_GPIO, + .gpio70 = GPIO_MODE_GPIO, + .gpio71 = GPIO_MODE_GPIO, + .gpio72 = GPIO_MODE_NATIVE, + .gpio73 = GPIO_MODE_NATIVE, + .gpio74 = GPIO_MODE_NATIVE, + .gpio75 = GPIO_MODE_NATIVE, +}; + +static const struct pch_gpio_set3 pch_gpio_set3_direction = { + .gpio64 = GPIO_DIR_INPUT, + .gpio65 = GPIO_DIR_INPUT, + .gpio66 = GPIO_DIR_INPUT, + .gpio67 = GPIO_DIR_INPUT, + .gpio68 = GPIO_DIR_INPUT, + .gpio69 = GPIO_DIR_INPUT, + .gpio70 = GPIO_DIR_INPUT, + .gpio71 = GPIO_DIR_INPUT, +}; + +static const struct pch_gpio_set3 pch_gpio_set3_level = { +}; + +static const struct pch_gpio_set3 pch_gpio_set3_reset = { +}; + +const struct pch_gpio_map mainboard_gpio_map = { + .set1 = { + .mode = &pch_gpio_set1_mode, + .direction = &pch_gpio_set1_direction, + .level = &pch_gpio_set1_level, + .blink = &pch_gpio_set1_blink, + .invert = &pch_gpio_set1_invert, + .reset = &pch_gpio_set1_reset, + }, + .set2 = { + .mode = &pch_gpio_set2_mode, + .direction = &pch_gpio_set2_direction, + .level = &pch_gpio_set2_level, + .reset = &pch_gpio_set2_reset, + }, + .set3 = { + .mode = &pch_gpio_set3_mode, + .direction = &pch_gpio_set3_direction, + .level = &pch_gpio_set3_level, + .reset = &pch_gpio_set3_reset, + }, +}; diff --git a/src/mainboard/lenovo/t440p/hda_verb.c b/src/mainboard/lenovo/t440p/hda_verb.c new file mode 100644 index 0000000..ac509bf --- /dev/null +++ b/src/mainboard/lenovo/t440p/hda_verb.c @@ -0,0 +1,25 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <device/azalia_device.h> + +const u32 cim_verb_data[] = { +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/lenovo/t440p/mainboard.c b/src/mainboard/lenovo/t440p/mainboard.c new file mode 100644 index 0000000..dcfd503 --- /dev/null +++ b/src/mainboard/lenovo/t440p/mainboard.c @@ -0,0 +1,34 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Iru Cai mytbk920423@gmail.com + * + * 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, either version 2 of the License, or + * (at your option) any later version. + * + * 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 <device/device.h> +#include <drivers/intel/gma/int15.h> +#include <ec/lenovo/h8/h8.h> + +static void mainboard_enable(struct device *dev) +{ + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, + GMA_INT15_PANEL_FIT_DEFAULT, + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); +} + +void h8_mainboard_init_dock(void) +{ +} + +struct chip_operations mainboard_ops = { + .enable_dev = mainboard_enable, +}; diff --git a/src/mainboard/lenovo/t440p/romstage.c b/src/mainboard/lenovo/t440p/romstage.c new file mode 100644 index 0000000..28f766b --- /dev/null +++ b/src/mainboard/lenovo/t440p/romstage.c @@ -0,0 +1,103 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <stdint.h> +#include <cpu/intel/romstage.h> +#include <cpu/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/pei_data.h> +#include <southbridge/intel/common/gpio.h> +#include <southbridge/intel/lynxpoint/pch.h> + +static const struct rcba_config_instruction rcba_config[] = { + RCBA_SET_REG_16(D31IR, DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQA)), + RCBA_SET_REG_16(D29IR, DIR_ROUTE(PIRQH, PIRQD, PIRQA, PIRQC)), + RCBA_SET_REG_16(D28IR, DIR_ROUTE(PIRQA, PIRQA, PIRQA, PIRQA)), + RCBA_SET_REG_16(D27IR, DIR_ROUTE(PIRQG, PIRQB, PIRQC, PIRQD)), + RCBA_SET_REG_16(D26IR, DIR_ROUTE(PIRQA, PIRQF, PIRQC, PIRQD)), + RCBA_SET_REG_16(D25IR, DIR_ROUTE(PIRQE, PIRQF, PIRQG, PIRQH)), + RCBA_SET_REG_16(D22IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)), + RCBA_SET_REG_16(D20IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)), + + RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS), + + RCBA_END_CONFIG, +}; + +void mainboard_config_superio(void) +{ +} + +void mainboard_romstage_entry(unsigned long bist) +{ + struct pei_data pei_data = { + .pei_version = PEI_VERSION, + .mchbar = (uintptr_t)DEFAULT_MCHBAR, + .dmibar = (uintptr_t)DEFAULT_DMIBAR, + .epbar = DEFAULT_EPBAR, + .pciexbar = CONFIG_MMCONF_BASE_ADDRESS, + .smbusbar = SMBUS_IO_BASE, + .wdbbar = 0x4000000, + .wdbsize = 0x1000, + .hpet_address = HPET_ADDR, + .rcba = (uintptr_t)DEFAULT_RCBA, + .pmbase = DEFAULT_PMBASE, + .gpiobase = DEFAULT_GPIOBASE, + .temp_mmio_base = 0xfed08000, + .system_type = 0, /* mobile */ + .tseg_size = CONFIG_SMM_TSEG_SIZE, + .spd_addresses = { 0xa0, 0, 0xa2, 0 }, + .ec_present = 0, + .dimm_channel0_disabled = 0, + .dimm_channel1_disabled = 0, + .max_ddr3_freq = 1600, + .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 }, + { 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 }, + }, + .usb3_ports = { + { 1, 0 }, + { 1, 0 }, + { 1, USB_OC_PIN_SKIP }, + { 1, USB_OC_PIN_SKIP }, + { 1, 1 }, + { 1, 1 }, + }, + }; + + struct romstage_params romstage_params = { + .pei_data = &pei_data, + .gpio_map = &mainboard_gpio_map, + .rcba_config = rcba_config, + .bist = bist, + }; + + romstage_common(&romstage_params); +} diff --git a/src/mainboard/lenovo/t440p/smihandler.c b/src/mainboard/lenovo/t440p/smihandler.c new file mode 100644 index 0000000..5ea7118 --- /dev/null +++ b/src/mainboard/lenovo/t440p/smihandler.c @@ -0,0 +1,120 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <device/pci_ops.h> +#include <console/console.h> +#include <cpu/x86/smm.h> +#include <ec/acpi/ec.h> +#include <ec/lenovo/h8/h8.h> +#include <delay.h> +#include <southbridge/intel/lynxpoint/pch.h> + +#define GPE_EC_SCI 1 +/* FIXME: check this */ +#define GPE_EC_WAKE 13 + +static void mainboard_smm_init(void) +{ + printk(BIOS_DEBUG, "initializing SMI\n"); + /* Enable 0x1600/0x1600 register pair */ + ec_set_bit(0x00, 0x05); +} + +int mainboard_io_trap_handler(int smif) +{ + static int smm_initialized; + + if (!smm_initialized) { + mainboard_smm_init(); + smm_initialized = 1; + } + + return 0; +} + +static void mainboard_smi_handle_ec_sci(void) +{ + u8 status = inb(EC_SC); + u8 event; + + if (!(status & EC_SCI_EVT)) + return; + + event = ec_query(); + printk(BIOS_DEBUG, "EC event %02x\n", event); +} + +void mainboard_smi_gpi(u32 gpi_sts) +{ + if (gpi_sts & (1 << GPE_EC_SCI)) + mainboard_smi_handle_ec_sci(); +} + +/* lynxpoint doesn't have gpi_route_interrupt, so add it */ +#define GPI_DISABLE 0x00 +#define GPI_IS_SMI 0x01 +#define GPI_IS_SCI 0x02 +#define GPI_IS_NMI 0x03 + +static void gpi_route_interrupt(u8 gpi, u8 mode) +{ + u32 gpi_rout; + + gpi_rout = pci_read_config32(PCI_DEV(0, 0x1f, 0), GPIO_ROUT); + gpi_rout &= ~(3 << (2 * gpi)); + gpi_rout |= ((mode & 3) << (2 * gpi)); + pci_write_config32(PCI_DEV(0, 0x1f, 0), GPIO_ROUT, gpi_rout); +} + +int mainboard_smi_apmc(u8 data) +{ + switch (data) { + case APM_CNT_ACPI_ENABLE: + /* use 0x1600/0x1604 to prevent races with userspace */ + ec_set_ports(0x1604, 0x1600); + /* route EC_SCI to SCI */ + gpi_route_interrupt(GPE_EC_SCI, GPI_IS_SCI); + /* discard all events, and enable attention */ + ec_write(0x80, 0x01); + break; + case APM_CNT_ACPI_DISABLE: + /* we have to use port 0x62/0x66, as 0x1600/0x1604 doesn't + provide a EC query function */ + ec_set_ports(0x66, 0x62); + /* route EC_SCI to SMI */ + gpi_route_interrupt(GPE_EC_SCI, GPI_IS_SMI); + /* discard all events, and enable attention */ + ec_write(0x80, 0x01); + break; + default: + break; + } + return 0; +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + if (slp_typ == 3) { + u8 ec_wake = ec_read(0x32); + /* If EC wake events are enabled, + * enable wake on EC WAKE GPE. */ + if (ec_wake & 0x14) { + /* Redirect EC WAKE GPE to SCI. */ + gpi_route_interrupt(GPE_EC_WAKE, GPI_IS_SCI); + } + } +}
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 1:
(6 comments)
Please addd documentation as well.
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 71: subsystemid 0x17aa 0x220e missing smbios_slot_desc
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 74: subsystemid 0x17aa 0x220e missing smbios_slot_desc
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 156: f on, for nvidia GPU
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/hda_verb.c:
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 20: const u32 cim_verb_data[] = { missing verbs
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/smihandler.c:
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 31: { can be removed, already done in h8.c
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 37: int mainboard_io_trap_handler(int smif) can be removed as it has no purpose
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#2).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
Tested: - i5-4300M, 8G+8G - keyboard and trackpoint - USB - SATA - WLAN - Arch Linux loaded from SeaBIOS - libgfxinit - ACPI support - EHCI debug: the port is the non-charging USB2 port on the right
Issues: - The touchpad is misconfigured, there's no middle button, and the 3 keys on top are all identified as left button - The Fn key is on by default
Not tested: - the dGPU model - the M.2 slot for WWAN/SSD (SATA port number to be added to devtree)
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 16 files changed, 867 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/2
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#3).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
Tested: - i5-4300M, 8G+8G - keyboard and trackpoint - USB - SATA - M.2 SATA SSD - WLAN - Arch Linux loaded from SeaBIOS - libgfxinit - ACPI support - EHCI debug: the port is the non-charging USB2 port on the right
Issues: - The touchpad is misconfigured, the 3 keys on top are all identified as left button - The Fn key is on by default - Mainboard serial number is invalid
Not tested: - the dGPU model - WWAN
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 20 files changed, 907 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/3
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 3: Code-Review+1
(2 comments)
please limit pictures to 800px in width and try to reduce it's size by using 70% JPEG compression.
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@27 PS3, Line 27: - Mainboard serial number is invalid does the mainboard have at24rf80 i2c eeprom? I noticed that the t480 doesn't have one.
https://review.coreboot.org/c/coreboot/+/34359/3/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/34359/3/src/mainboard/lenovo/t440p/... PS3, Line 1: chip northbridge/intel/haswell # FIXME: check gfx.ndid and gfx.did remove FIXME
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... PS3, Line 32: Please see :doc:`../../northbridge/intel/haswell/mrc.bin`. no need for rst. The lastest sphinx can interpret markdown that has ../ in the path
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@26 PS3, Line 26: - The Fn key is on by default The Fn key issue can be resolved by (in the OEM firmware it uses 0x1604/0x1600, but 0x66/0x62 should be ok):
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index 2b959ceea1..118bd69d88 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -80,10 +80,10 @@ static void h8_charge_priority(enum battery battery)
static void h8_sticky_fn(int on) { - if (on) - ec_set_bit(0x0, 3); + if (!on) + ec_set_bit(0x3b, 3); else - ec_clr_bit(0x0, 3); + ec_clr_bit(0x3b, 3); }
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@27 PS3, Line 27: - Mainboard serial number is invalid
does the mainboard have at24rf80 i2c eeprom? […]
I don't know. And not all the EEPROM in the thinkpads are at24rf80. I think the serial number is still stored in some chip.
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... PS3, Line 32: Please see :doc:`../../northbridge/intel/haswell/mrc.bin`.
no need for rst. The lastest sphinx can interpret markdown that has .. […]
I see other docs using this. I think rst is for :doc:?
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@26 PS3, Line 26: - The Fn key is on by default
The Fn key issue can be resolved by (in the OEM firmware it uses 0x1604/0x1600, but 0x66/0x62 should […]
Yes 62/66 is safe to use. You could read read the EC version register to detect when this change is necessary.
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... PS3, Line 32: Please see :doc:`../../northbridge/intel/haswell/mrc.bin`.
I see other docs using this. […]
It was used when Sphinx didn't support ../ in path. That has been fixed and is now safe to use.
Alexander Couzens has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@27 PS3, Line 27: - Mainboard serial number is invalid
I don't know. And not all the EEPROM in the thinkpads are at24rf80. […]
Starting with the x240/t440 the at24 is no more, it's integrated into the EC
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 3:
Once the comments are fixed I think it's fine to merge.
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Patrick Rudolph, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#4).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 20 files changed, 934 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/4
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 4:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@26 PS3, Line 26: - The Fn key is on by default
Yes 62/66 is safe to use. […]
From the cbmem log I can see the EC firmware ID and version are read correctly, but I don't know what's the proper way to change the code now. I may change it in the future.
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@27 PS3, Line 27: - Mainboard serial number is invalid
Starting with the x240/t440 the at24 is no more, it's integrated into the EC
Still don't know how to read these information. Maybe I should find a way to unselect SMBIOS_PROVIDED_BY_MOBO until it's solved?
https://review.coreboot.org/c/coreboot/+/34359/3/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/34359/3/src/mainboard/lenovo/t440p/... PS3, Line 1: chip northbridge/intel/haswell # FIXME: check gfx.ndid and gfx.did
remove FIXME
Done
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Patrick Rudolph, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#5).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,077 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/5
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 5: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 5:
(2 comments)
Schematics for this
https://review.coreboot.org/c/coreboot/+/34359/5/Documentation/mainboard/len... File Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg:
PS5: NM-A131... Schematics for this board say it has a SMSC MSC1633 EC. Why does this board's Kconfig select the H8S then?
https://review.coreboot.org/c/coreboot/+/34359/5/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/romstage.c:
https://review.coreboot.org/c/coreboot/+/34359/5/src/mainboard/lenovo/t440p/... PS5, Line 66: dimm_channel0_disabled google/slippy/variants/wolf has the following values for this:
// 0 = leave channel enabled // 1 = disable dimm 0 on channel // 2 = disable dimm 1 on channel // 3 = disable dimm 0+1 on channel .dimm_channel0_disabled = 2, .dimm_channel1_disabled = 2,
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Patrick Rudolph, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#6).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,071 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/6
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 6:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@26 PS3, Line 26: - The Fn key is on by default
From the cbmem log I can see the EC firmware ID and version are read correctly, but I don't know wha […]
I misunderstood the meaning of sticky_fn ("Fn Sticky" in the OEM setting). The coreboot h8 code still works. What we need is to add a "F1-F12 as Primary" option.
There's no known way to disable the touchpad, and bt/wwan is disabled by disabling the USB port instead of using EC, so I remove these CMOS options.
https://review.coreboot.org/c/coreboot/+/34359/5/Documentation/mainboard/len... File Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg:
PS5:
NM-A131... Schematics for this board say it has a SMSC MSC1633 EC. […]
There's no H8S starting from xx30 series, but the EC interface still works.
https://review.coreboot.org/c/coreboot/+/34359/5/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/romstage.c:
https://review.coreboot.org/c/coreboot/+/34359/5/src/mainboard/lenovo/t440p/... PS5, Line 66: dimm_channel0_disabled
google/slippy/variants/wolf has the following values for this: […]
Oh, I forgot to disable one dimm.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 6: Code-Review+2
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 6: Code-Review+2
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Patrick Rudolph, Philipp Deppenwiese, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#7).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,076 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/7
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 7:
(8 comments)
patchset 7: adds the F1-F12 as primary option, and adds TPM support.
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@27 PS3, Line 27: - Mainboard serial number is invalid
Still don't know how to read these information. […]
No good way to fix because the at24rf08c code is built when VENDOR_LENOVO is selected, not going to fix it now.
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/3/Documentation/mainboard/len... PS3, Line 32: Please see :doc:`../../northbridge/intel/haswell/mrc.bin`.
It was used when Sphinx didn't support ../ in path. That has been fixed and is now safe to use.
Done
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 71: subsystemid 0x17aa 0x220e
missing smbios_slot_desc
Done
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 74: subsystemid 0x17aa 0x220e
missing smbios_slot_desc
Done
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 156: f
on, for nvidia GPU
Done
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/hda_verb.c:
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 20: const u32 cim_verb_data[] = {
missing verbs
Done
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/smihandler.c:
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 31: {
can be removed, already done in h8. […]
Done
https://review.coreboot.org/c/coreboot/+/34359/1/src/mainboard/lenovo/t440p/... PS1, Line 37: int mainboard_io_trap_handler(int smif)
can be removed as it has no purpose
Done
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 7: Code-Review+1
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Patrick Rudolph, Philipp Deppenwiese, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#8).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,055 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/8
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@27 PS3, Line 27: - Mainboard serial number is invalid
No good way to fix because the at24rf08c code is built when VENDOR_LENOVO is selected, not going to […]
I've found that the serial number is read via port 0x1630/0x1634, which is implemented in EmulatedEepromDxe in the OEM UEFI image, but I still don't know how to initialize the "emulated EEPROM" to make it work. I only know it runs after smbus from the UEFI module dependencies.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 8: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34359/3//COMMIT_MSG@27 PS3, Line 27: - Mainboard serial number is invalid
I've found that the serial number is read via port 0x1630/0x1634, which is implemented in EmulatedEe […]
According to https://airbus-seclab.github.io/embedded_controller/BH2019-Slides-Breaking_T... 0x1630/0x1634 is just another EC interface as 0x62/0x66 is. However as 0x1600-0x1604 needs to be enabled using H8_CONFIG0_SMM_H8_ENABLE in reg H8_CONFIG0, there might be a similar bit for 0x1630/0x1634.
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Patrick Rudolph, Philipp Deppenwiese, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#9).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,049 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/9
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 10: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 10:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34359/10/Documentation/mainboard/le... File Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg:
PS10: Minor: picture is rather blurry, mind retaking it? Thanks
https://review.coreboot.org/c/coreboot/+/34359/10/src/mainboard/lenovo/t440p... File src/mainboard/lenovo/t440p/acpi_tables.c:
https://review.coreboot.org/c/coreboot/+/34359/10/src/mainboard/lenovo/t440p... PS10, Line 20: /* FIXME: check this function. */ Maybe drop the comment
https://review.coreboot.org/c/coreboot/+/34359/10/src/mainboard/lenovo/t440p... PS10, Line 31: // the lid is open by default. Please be consistent with the comment style
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Patrick Rudolph, Philipp Deppenwiese, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#11).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,052 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/11
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 11:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34359/10/Documentation/mainboard/le... File Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg:
PS10:
Minor: picture is rather blurry, mind retaking it? Thanks
Done
https://review.coreboot.org/c/coreboot/+/34359/10/src/mainboard/lenovo/t440p... File src/mainboard/lenovo/t440p/acpi_tables.c:
https://review.coreboot.org/c/coreboot/+/34359/10/src/mainboard/lenovo/t440p... PS10, Line 20: /* FIXME: check this function. */
Maybe drop the comment
All FIXMEs are removed
https://review.coreboot.org/c/coreboot/+/34359/10/src/mainboard/lenovo/t440p... PS10, Line 31: // the lid is open by default.
Please be consistent with the comment style
Done
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 12: Code-Review+1
(3 comments)
Minor not in the devicetree.cb, but LGTM.
https://review.coreboot.org/c/coreboot/+/34359/12/Documentation/mainboard/le... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/12/Documentation/mainboard/le... PS12, Line 38: - Cannot get the mainboard serial number Are there any eeproms on smbus?
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... File src/mainboard/lenovo/t440p/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... PS12, Line 39: register "gen3_dec" = "0x00000000" remove
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... File src/mainboard/lenovo/t440p/romstage.c:
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... PS12, Line 36: RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS), If you want, you can put this in a common location (like broadwell).
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Arthur Heymans, Patrick Rudolph, Philipp Deppenwiese, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#13).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,051 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/13
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 12:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34359/12/Documentation/mainboard/le... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/12/Documentation/mainboard/le... PS12, Line 38: - Cannot get the mainboard serial number
Are there any eeproms on smbus?
As I said at https://review.coreboot.org/c/coreboot/+/34359/12#message-984b10347baf70fd8e..., Lenovo has something they call it in UEFI a emulated eeprom, but I don't know how to initialize it to make it readable. Now I can set DRIVER_LENOVO_SERIALS=n as a work around.
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... File src/mainboard/lenovo/t440p/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... PS12, Line 39: register "gen3_dec" = "0x00000000"
remove
Done
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 13: Code-Review+2
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... File src/mainboard/lenovo/t440p/romstage.c:
https://review.coreboot.org/c/coreboot/+/34359/12/src/mainboard/lenovo/t440p... PS12, Line 36: RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS),
If you want, you can put this in a common location (like broadwell).
Ack
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 13: Code-Review+1
(3 comments)
Nice.
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... PS13, Line 23: ``` : 00000000:00000fff fd : 00001000:00002fff gbe : 00003000:004fffff me : 00500000:00bfffff bios : ``` You could just indent the “code block” with four spaces, and remove the ``` tags.
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... PS13, Line 30: in Remove?
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... PS13, Line 45: Add tested with Arch Linux [version] with Linux [version].
Travis Hall has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 13:
Have VT-d, Bluetooth and DisplayPort been tested?
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Arthur Heymans, Patrick Rudolph, Paul Menzel, Philipp Deppenwiese, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#14).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,052 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/14
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 14:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... PS13, Line 23: ``` : 00000000:00000fff fd : 00001000:00002fff gbe : 00003000:004fffff me : 00500000:00bfffff bios : ```
You could just indent the “code block” with four spaces, and remove the ``` tags.
Done
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... PS13, Line 30: in
Remove?
Done
https://review.coreboot.org/c/coreboot/+/34359/13/Documentation/mainboard/le... PS13, Line 45:
Add tested with Arch Linux [version] with Linux [version].
Done
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 14:
Patch Set 13:
Have VT-d, Bluetooth and DisplayPort been tested?
DisplayPort is tested, including dock DP and HDMI. VT-d and bluetooth is not tested yet. Bluetooth on the WLAN module should work.
Hello Alexander Couzens, Patrick Rudolph, Iru Cai, Angel Pons, Arthur Heymans, Patrick Rudolph, Paul Menzel, Philipp Deppenwiese, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34359
to look at the new patch set (#15).
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,056 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/34359/15
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 17:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34359/17/Documentation/mainboard/le... File Documentation/mainboard/lenovo/t440p.md:
https://review.coreboot.org/c/coreboot/+/34359/17/Documentation/mainboard/le... PS17, Line 34: - The touchpad is misconfigured, the 3 keys on top are all identified The touchpad issue can be solved by https://review.coreboot.org/c/coreboot/+/36371 with device id LEN0036.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
Patch Set 17: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/34359 )
Change subject: mainboard: Add Lenovo ThinkPad T440p ......................................................................
mainboard: Add Lenovo ThinkPad T440p
The code is based on autoport.
This port is tested on a T440p without a dGPU and can boot Arch Linux from SATA disk with SeaBIOS payload. The tested components and issues are in the documentation.
Change-Id: I56a6b94197789a83731d8b349b8ba6814bf57ca2 Signed-off-by: Iru Cai mytbk920423@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34359 Reviewed-by: Patrick Rudolph siro@das-labor.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M Documentation/mainboard/index.md A Documentation/mainboard/lenovo/t440p.md A Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg A Documentation/mainboard/lenovo/t440p_flash_chip.jpg A src/mainboard/lenovo/t440p/Kconfig A src/mainboard/lenovo/t440p/Kconfig.name A src/mainboard/lenovo/t440p/Makefile.inc A src/mainboard/lenovo/t440p/acpi/ec.asl A src/mainboard/lenovo/t440p/acpi/platform.asl A src/mainboard/lenovo/t440p/acpi/superio.asl A src/mainboard/lenovo/t440p/acpi_tables.c A src/mainboard/lenovo/t440p/board_info.txt A src/mainboard/lenovo/t440p/cmos.default A src/mainboard/lenovo/t440p/cmos.layout A src/mainboard/lenovo/t440p/data.vbt A src/mainboard/lenovo/t440p/devicetree.cb A src/mainboard/lenovo/t440p/dsdt.asl A src/mainboard/lenovo/t440p/gma-mainboard.ads A src/mainboard/lenovo/t440p/gpio.c A src/mainboard/lenovo/t440p/hda_verb.c A src/mainboard/lenovo/t440p/mainboard.c A src/mainboard/lenovo/t440p/romstage.c A src/mainboard/lenovo/t440p/smihandler.c 23 files changed, 1,056 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Rudolph: Looks good to me, approved
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md index 4c9d08c..8e88443 100644 --- a/Documentation/mainboard/index.md +++ b/Documentation/mainboard/index.md @@ -91,6 +91,10 @@ - [T430 / T530 / X230 / W530 common](lenovo/xx30_series.md) - [T431s](lenovo/t431s.md)
+### Haswell series + +- [T440p](lenovo/t440p.md) + ## Portwell
- [PQ7-M107](portwell/pq7-m107.md) diff --git a/Documentation/mainboard/lenovo/t440p.md b/Documentation/mainboard/lenovo/t440p.md new file mode 100644 index 0000000..98c1da5 --- /dev/null +++ b/Documentation/mainboard/lenovo/t440p.md @@ -0,0 +1,66 @@ +# Lenovo ThinkPad T440p + +This page describes how to run coreboot on [Lenovo ThinkPad T440p]. + +## Required proprietary blobs + +Please see [mrc.bin](../../northbridge/intel/haswell/mrc.bin). + +## Flashing instructions + +T440p has two flash chips, an 8MB W25Q64FV and a 4MB W25Q32FV. To flash +coreboot, you just need to remove the big door according to the T440 +[Hardware Maintenance Manual] and flash the 4MB chip. + +![T440p flash chip](t440p_flash_chip.jpg) + +To access the 8MB chip, you need to remove the base cover. + +![T440p 8MB flash chip](t440p_all_flash_chips.jpg) + +The flash layout of the OEM firmware is as follows: + + 00000000:00000fff fd + 00001000:00002fff gbe + 00003000:004fffff me + 00500000:00bfffff bios + +After flashing coreboot, you may need to re-plug the AC adapter to make +the laptop able to power on. + +## Known Issues + +- No audio output when using a headphone +- The touchpad is misconfigured, the 3 keys on top are all identified + as left button +- Cannot get the mainboard serial number from the mainboard: the OEM + UEFI firmware gets the serial number from an "emulated EEPROM" via + I/O port 0x1630/0x1634, but it's still unknown how to make it work + +## Untested + +- the dGPU model + +## Working + +- boot Arch Linux with Linux 4.19.77 from SeaBIOS payload +- integrated graphics init with libgfxinit +- EHCI debug: the port is the non-charging USB2 port on the right +- video output: internal (eDP), miniDP, dock DP, dock HDMI +- ACPI support +- keyboard and trackpoint +- SATA +- M.2 SATA SSD +- USB +- Ethernet +- WLAN +- WWAN +- bluetooth +- virtualization: VT-x and VT-d +- dock +- CMOS options: wlan, trackpoint, fn_ctrl_swap +- internal flashing when IFD is unlocked +- using `me_cleaner` + +[Lenovo ThinkPad T440p]: https://pcsupport.lenovo.com/us/zh/products/laptops-and-netbooks/thinkpad-t-... +[Hardware Maintenance Manual]: https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/t440p_hmm_en_sp4... diff --git a/Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg b/Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg new file mode 100644 index 0000000..cab80f2 --- /dev/null +++ b/Documentation/mainboard/lenovo/t440p_all_flash_chips.jpg Binary files differ diff --git a/Documentation/mainboard/lenovo/t440p_flash_chip.jpg b/Documentation/mainboard/lenovo/t440p_flash_chip.jpg new file mode 100644 index 0000000..3e041e8 --- /dev/null +++ b/Documentation/mainboard/lenovo/t440p_flash_chip.jpg Binary files differ diff --git a/src/mainboard/lenovo/t440p/Kconfig b/src/mainboard/lenovo/t440p/Kconfig new file mode 100644 index 0000000..bf821f3 --- /dev/null +++ b/src/mainboard/lenovo/t440p/Kconfig @@ -0,0 +1,54 @@ +if BOARD_LENOVO_THINKPAD_T440P + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select BOARD_ROMSIZE_KB_12288 + select CPU_INTEL_HASWELL + select EC_LENOVO_H8 + select H8_HAS_PRIMARY_FN_KEYS + select EC_LENOVO_PMH7 + select NO_UART_ON_SUPERIO + select HAVE_ACPI_RESUME + select HAVE_ACPI_TABLES + select HAVE_OPTION_TABLE + select HAVE_CMOS_DEFAULT + select MAINBOARD_HAS_LPC_TPM + select MAINBOARD_HAS_TPM1 + select INTEL_GMA_HAVE_VBT + select INTEL_INT15 + select MAINBOARD_HAS_LIBGFXINIT + select NORTHBRIDGE_INTEL_HASWELL + select SERIRQ_CONTINUOUS_MODE + select SOUTHBRIDGE_INTEL_LYNXPOINT + select SYSTEM_TYPE_LAPTOP + select MAINBOARD_USES_IFD_GBE_REGION + +config MAINBOARD_DIR + string + default lenovo/t440p + +config MAINBOARD_PART_NUMBER + string + default "ThinkPad T440p" + +config VGA_BIOS_FILE + string + default "pci8086,0416.rom" + +config VGA_BIOS_ID + string + default "8086,0416" + +config MAX_CPUS + int + default 8 + +config USBDEBUG_HCD_INDEX + int + default 2 + +config DRIVER_LENOVO_SERIALS + bool + default n + +endif diff --git a/src/mainboard/lenovo/t440p/Kconfig.name b/src/mainboard/lenovo/t440p/Kconfig.name new file mode 100644 index 0000000..e90299d --- /dev/null +++ b/src/mainboard/lenovo/t440p/Kconfig.name @@ -0,0 +1,2 @@ +config BOARD_LENOVO_THINKPAD_T440P + bool "ThinkPad T440p" diff --git a/src/mainboard/lenovo/t440p/Makefile.inc b/src/mainboard/lenovo/t440p/Makefile.inc new file mode 100644 index 0000000..fa6e7af --- /dev/null +++ b/src/mainboard/lenovo/t440p/Makefile.inc @@ -0,0 +1,3 @@ +romstage-y += gpio.c +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads +smm-y += smihandler.c diff --git a/src/mainboard/lenovo/t440p/acpi/ec.asl b/src/mainboard/lenovo/t440p/acpi/ec.asl new file mode 100644 index 0000000..3ff0ff7 --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi/ec.asl @@ -0,0 +1,17 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Iru Cai mytbk920423@gmail.com + * + * 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, either version 2 of the License, or + * (at your option) any later version. + * + * 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 <ec/lenovo/h8/acpi/ec.asl> diff --git a/src/mainboard/lenovo/t440p/acpi/platform.asl b/src/mainboard/lenovo/t440p/acpi/platform.asl new file mode 100644 index 0000000..db142f0 --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi/platform.asl @@ -0,0 +1,28 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Iru Cai mytbk920423@gmail.com + * + * 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, either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +Method(_WAK,1) +{ + /* ME may not be up yet. */ + Store (0, _TZ.MEB1) + Store (0, _TZ.MEB2) + Return(Package(){0,0}) +} + +Method(_PTS,1) +{ + _SB.PCI0.LPCB.EC.RADI(0) +} diff --git a/src/mainboard/lenovo/t440p/acpi/superio.asl b/src/mainboard/lenovo/t440p/acpi/superio.asl new file mode 100644 index 0000000..3139e35 --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi/superio.asl @@ -0,0 +1,17 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Iru Cai mytbk920423@gmail.com + * + * 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, either version 2 of the License, or + * (at your option) any later version. + * + * 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 <drivers/pc80/pc/ps2_controller.asl> diff --git a/src/mainboard/lenovo/t440p/acpi_tables.c b/src/mainboard/lenovo/t440p/acpi_tables.c new file mode 100644 index 0000000..6012708 --- /dev/null +++ b/src/mainboard/lenovo/t440p/acpi_tables.c @@ -0,0 +1,35 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <southbridge/intel/lynxpoint/nvs.h> + +void acpi_create_gnvs(global_nvs_t *gnvs) +{ + /* Disable USB ports in S3 by default */ + gnvs->s3u0 = 0; + gnvs->s3u1 = 0; + + /* Disable USB ports in S5 by default */ + gnvs->s5u0 = 0; + gnvs->s5u1 = 0; + + /* the lid is open by default */ + gnvs->lids = 1; + + gnvs->tcrt = 100; + gnvs->tpsv = 90; +} diff --git a/src/mainboard/lenovo/t440p/board_info.txt b/src/mainboard/lenovo/t440p/board_info.txt new file mode 100644 index 0000000..46461fe --- /dev/null +++ b/src/mainboard/lenovo/t440p/board_info.txt @@ -0,0 +1,7 @@ +Category: laptop +Board URL: https://pcsupport.lenovo.com/us/zh/products/laptops-and-netbooks/thinkpad-t-... +ROM package: SOIC-8 +ROM protocol: SPI +ROM socketed: n +Flashrom support: n +Release year: 2013 diff --git a/src/mainboard/lenovo/t440p/cmos.default b/src/mainboard/lenovo/t440p/cmos.default new file mode 100644 index 0000000..b104ae1 --- /dev/null +++ b/src/mainboard/lenovo/t440p/cmos.default @@ -0,0 +1,13 @@ +boot_option=Fallback +debug_level=Debug +power_on_after_fail=Disable +nmi=Enable +volume=0x3 +first_battery=Primary +wlan=Enable +fn_ctrl_swap=Disable +f1_to_f12_as_primary=Enable +sticky_fn=Disable +trackpoint=Enable +backlight=Both +usb_always_on=Disable diff --git a/src/mainboard/lenovo/t440p/cmos.layout b/src/mainboard/lenovo/t440p/cmos.layout new file mode 100644 index 0000000..8c5fb0b --- /dev/null +++ b/src/mainboard/lenovo/t440p/cmos.layout @@ -0,0 +1,120 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2007-2008 coresystems GmbH +## Copyright (C) 2014 Vladimir Serbinenko +## +## 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. +## + +# ----------------------------------------------------------------- +entries + +# ----------------------------------------------------------------- +# Status Register A +# ----------------------------------------------------------------- +# Status Register B +# ----------------------------------------------------------------- +# Status Register C +#96 4 r 0 status_c_rsvd +#100 1 r 0 uf_flag +#101 1 r 0 af_flag +#102 1 r 0 pf_flag +#103 1 r 0 irqf_flag +# ----------------------------------------------------------------- +# Status Register D +#104 7 r 0 status_d_rsvd +#111 1 r 0 valid_cmos_ram +# ----------------------------------------------------------------- +# Diagnostic Status Register +#112 8 r 0 diag_rsvd1 + +# ----------------------------------------------------------------- +0 120 r 0 reserved_memory +#120 264 r 0 unused + +# ----------------------------------------------------------------- +# RTC_BOOT_BYTE (coreboot hardcoded) +384 1 e 4 boot_option +388 4 h 0 reboot_counter +#390 2 r 0 unused? + +# ----------------------------------------------------------------- +# coreboot config options: console +#392 3 r 0 unused +395 4 e 6 debug_level +#399 1 r 0 unused + +#400 8 r 0 reserved for century byte + +# coreboot config options: southbridge +408 1 e 1 nmi +409 2 e 7 power_on_after_fail + +# coreboot config options: EC +411 1 e 8 first_battery +415 1 e 1 wlan +416 1 e 1 trackpoint +417 1 e 1 fn_ctrl_swap +418 1 e 1 sticky_fn +419 2 e 13 usb_always_on +422 2 e 10 backlight +424 1 e 1 f1_to_f12_as_primary + +# coreboot config options: northbridge +#435 2 e 12 hybrid_graphics_mode +#437 3 r 0 unused +440 8 h 0 volume + +# coreboot config options: check sums +984 16 h 0 check_sum + +# ----------------------------------------------------------------- + +enumerations + +#ID value text +1 0 Disable +1 1 Enable +2 0 Enable +2 1 Disable +4 0 Fallback +4 1 Normal +6 0 Emergency +6 1 Alert +6 2 Critical +6 3 Error +6 4 Warning +6 5 Notice +6 6 Info +6 7 Debug +6 8 Spew +7 0 Disable +7 1 Enable +7 2 Keep +8 0 Secondary +8 1 Primary +9 0 AHCI +9 1 Compatible +10 0 Both +10 1 Keyboard only +10 2 Thinklight only +10 3 None +#12 0 Integrated Only +#12 1 Discrete Only +#12 2 Dual Graphics +13 0 Disable +13 1 AC and battery +13 2 AC only + +# ----------------------------------------------------------------- +checksums + +checksum 392 447 984 diff --git a/src/mainboard/lenovo/t440p/data.vbt b/src/mainboard/lenovo/t440p/data.vbt new file mode 100644 index 0000000..1b2cd87 --- /dev/null +++ b/src/mainboard/lenovo/t440p/data.vbt Binary files differ diff --git a/src/mainboard/lenovo/t440p/devicetree.cb b/src/mainboard/lenovo/t440p/devicetree.cb new file mode 100644 index 0000000..7e5e616 --- /dev/null +++ b/src/mainboard/lenovo/t440p/devicetree.cb @@ -0,0 +1,113 @@ +chip northbridge/intel/haswell + register "gfx.did" = "{ 0x80000100, 0x80000240, 0x80000410 }" + register "gfx.ndid" = "3" + register "gpu_cpu_backlight" = "0x12ba12ba" + register "gpu_ddi_e_connected" = "1" + register "gpu_dp_b_hotplug" = "4" + register "gpu_dp_c_hotplug" = "4" + register "gpu_dp_d_hotplug" = "4" + register "gpu_panel_port_select" = "0" + register "gpu_panel_power_backlight_off_delay" = "1" + register "gpu_panel_power_backlight_on_delay" = "1" + register "gpu_panel_power_cycle_delay" = "6" + register "gpu_panel_power_down_delay" = "500" + register "gpu_panel_power_up_delay" = "2000" + register "gpu_pch_backlight" = "0x12ba12ba" + device cpu_cluster 0x0 on + chip cpu/intel/haswell + register "c1_acpower" = "1" + register "c1_battery" = "1" + register "c2_acpower" = "3" + register "c2_battery" = "3" + register "c3_acpower" = "5" + register "c3_battery" = "5" + device lapic 0x0 on end + device lapic 0xacac off end + end + end + device domain 0x0 on + subsystemid 0x17aa 0x220e inherit + + device pci 00.0 on end # Host bridge Host bridge + device pci 01.0 on end # PCIe Bridge for discrete graphics + device pci 02.0 on end # Internal graphics VGA controller + device pci 03.0 on end # Mini-HD audio Audio controller + + chip southbridge/intel/lynxpoint # Intel Series 8 Lynx Point PCH + register "gen1_dec" = "0x007c1601" + register "gen2_dec" = "0x000c15e1" + register "gen4_dec" = "0x000c06a1" + register "gpi13_routing" = "2" + register "gpi1_routing" = "2" + register "pirqa_routing" = "0x8b" + register "pirqb_routing" = "0x8a" + register "pirqc_routing" = "0x8a" + register "pirqd_routing" = "0x89" + register "pirqe_routing" = "0x86" + register "pirqf_routing" = "0x80" + register "pirqg_routing" = "0x8b" + register "pirqh_routing" = "0x87" + register "sata_ahci" = "1" + # 0(HDD), 1(M.2), 5(ODD) + register "sata_port_map" = "0x23" + device pci 14.0 on end # xHCI Controller + device pci 16.0 on end # Management Engine Interface 1 + device pci 16.1 off end # Management Engine Interface 2 + device pci 16.2 off end # Management Engine IDE-R + device pci 16.3 off end # Management Engine KT + device pci 19.0 on end # Intel Gigabit Ethernet + device pci 1a.0 on end # USB2 EHCI #2 + device pci 1b.0 on end # High Definition Audio Audio controller + device pci 1c.0 on end # PCIe Port #1, Realtek Card Reader + device pci 1c.1 on # PCIe Port #2, WLAN + smbios_slot_desc "0x14" "1" "M.2 2230" "8" + end + device pci 1c.2 off end # PCIe Port #3 + device pci 1c.3 off end # PCIe Port #4 + device pci 1c.4 off end # PCIe Port #5 + device pci 1c.5 off end # PCIe Port #6 + device pci 1c.6 off end # PCIe Port #7 + device pci 1c.7 off end # PCIe Port #8 + device pci 1d.0 on end # USB2 EHCI #1 + device pci 1f.0 on # LPC bridge PCI-LPC bridge + chip ec/lenovo/pmh7 + register "backlight_enable" = "0x01" + register "dock_event_enable" = "0x01" + device pnp ff.1 on # dummy + end + end + chip ec/lenovo/h8 + register "beepmask0" = "0x00" + register "beepmask1" = "0x86" + register "config0" = "0xa6" + register "config1" = "0x0d" + register "config2" = "0xa8" + register "config3" = "0xc4" + register "event2_enable" = "0xff" + register "event3_enable" = "0xff" + register "event4_enable" = "0xd0" + register "event5_enable" = "0x3c" + register "event7_enable" = "0x01" + register "event8_enable" = "0x7b" + register "event9_enable" = "0xff" + register "eventc_enable" = "0xff" + register "eventd_enable" = "0xff" + register "evente_enable" = "0x9d" + device pnp ff.2 on # dummy + io 0x60 = 0x62 + io 0x62 = 0x66 + io 0x64 = 0x1600 + io 0x66 = 0x1604 + end + end + chip drivers/pc80/tpm + device pnp 0c31.0 on end + end + end + device pci 1f.2 on end # SATA Controller 1 + device pci 1f.3 on end # SMBus + device pci 1f.5 off end # SATA Controller 2 + device pci 1f.6 off end # Thermal + end + end +end diff --git a/src/mainboard/lenovo/t440p/dsdt.asl b/src/mainboard/lenovo/t440p/dsdt.asl new file mode 100644 index 0000000..3014a57 --- /dev/null +++ b/src/mainboard/lenovo/t440p/dsdt.asl @@ -0,0 +1,46 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Iru Cai mytbk920423@gmail.com + * + * 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, either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +#define BRIGHTNESS_UP _SB.PCI0.GFX0.INCB +#define BRIGHTNESS_DOWN _SB.PCI0.GFX0.DECB +#define ACPI_VIDEO_DEVICE _SB.PCI0.GFX0 +#define EC_LENOVO_H8_ME_WORKAROUND 1 +#define THINKPAD_EC_GPE 17 + +#include <arch/acpi.h> +DefinitionBlock( + "dsdt.aml", + "DSDT", + 0x02, // DSDT revision: ACPI 2.0 and up + OEM_ID, + ACPI_TABLE_CREATOR, + 0x20141018 // OEM revision +) +{ + #include "acpi/platform.asl" + #include <cpu/intel/common/acpi/cpu.asl> + #include <southbridge/intel/lynxpoint/acpi/platform.asl> + /* global NVS and variables. */ + #include <southbridge/intel/lynxpoint/acpi/globalnvs.asl> + #include <southbridge/intel/lynxpoint/acpi/sleepstates.asl> + + Device (_SB.PCI0) + { + #include <northbridge/intel/haswell/acpi/haswell.asl> + #include <drivers/intel/gma/acpi/default_brightness_levels.asl> + #include <southbridge/intel/lynxpoint/acpi/pch.asl> + } +} diff --git a/src/mainboard/lenovo/t440p/gma-mainboard.ads b/src/mainboard/lenovo/t440p/gma-mainboard.ads new file mode 100644 index 0000000..d36cb82 --- /dev/null +++ b/src/mainboard/lenovo/t440p/gma-mainboard.ads @@ -0,0 +1,30 @@ +-- +-- 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; either version 2 of the License, or +-- (at your option) any later version. +-- +-- 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. +-- + +with HW.GFX.GMA; +with HW.GFX.GMA.Display_Probing; + +use HW.GFX.GMA; +use HW.GFX.GMA.Display_Probing; + +private package GMA.Mainboard is + + ports : constant Port_List := + (DP1, -- MiniDP + DP2, -- dock, DP2-1 (DP/HDMI) and DP2-2 (DP/DVI) + Analog, + Internal, + others => Disabled); + +end GMA.Mainboard; diff --git a/src/mainboard/lenovo/t440p/gpio.c b/src/mainboard/lenovo/t440p/gpio.c new file mode 100644 index 0000000..cdb707a --- /dev/null +++ b/src/mainboard/lenovo/t440p/gpio.c @@ -0,0 +1,224 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <southbridge/intel/common/gpio.h> + +static const struct pch_gpio_set1 pch_gpio_set1_mode = { + .gpio0 = GPIO_MODE_GPIO, + .gpio1 = GPIO_MODE_GPIO, + .gpio2 = GPIO_MODE_GPIO, + .gpio3 = GPIO_MODE_GPIO, + .gpio4 = GPIO_MODE_GPIO, + .gpio5 = GPIO_MODE_GPIO, + .gpio6 = GPIO_MODE_GPIO, + .gpio7 = GPIO_MODE_GPIO, + .gpio8 = GPIO_MODE_GPIO, + .gpio9 = GPIO_MODE_NATIVE, + .gpio10 = GPIO_MODE_GPIO, + .gpio11 = GPIO_MODE_GPIO, + .gpio12 = GPIO_MODE_NATIVE, + .gpio13 = GPIO_MODE_GPIO, + .gpio14 = GPIO_MODE_NATIVE, + .gpio15 = GPIO_MODE_GPIO, + .gpio16 = GPIO_MODE_NATIVE, + .gpio17 = GPIO_MODE_GPIO, + .gpio18 = GPIO_MODE_NATIVE, + .gpio19 = GPIO_MODE_NATIVE, + .gpio20 = GPIO_MODE_NATIVE, + .gpio21 = GPIO_MODE_GPIO, + .gpio22 = GPIO_MODE_GPIO, + .gpio23 = GPIO_MODE_NATIVE, + .gpio24 = GPIO_MODE_GPIO, + .gpio25 = GPIO_MODE_NATIVE, + .gpio26 = GPIO_MODE_NATIVE, + .gpio27 = GPIO_MODE_GPIO, + .gpio28 = GPIO_MODE_GPIO, + .gpio29 = GPIO_MODE_NATIVE, + .gpio30 = GPIO_MODE_NATIVE, + .gpio31 = GPIO_MODE_GPIO, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_direction = { + .gpio0 = GPIO_DIR_INPUT, + .gpio1 = GPIO_DIR_INPUT, + .gpio2 = GPIO_DIR_INPUT, + .gpio3 = GPIO_DIR_OUTPUT, + .gpio4 = GPIO_DIR_OUTPUT, + .gpio5 = GPIO_DIR_INPUT, + .gpio6 = GPIO_DIR_INPUT, + .gpio7 = GPIO_DIR_OUTPUT, + .gpio8 = GPIO_DIR_OUTPUT, + .gpio10 = GPIO_DIR_OUTPUT, + .gpio11 = GPIO_DIR_INPUT, + .gpio13 = GPIO_DIR_INPUT, + .gpio15 = GPIO_DIR_OUTPUT, + .gpio17 = GPIO_DIR_INPUT, + .gpio21 = GPIO_DIR_INPUT, + .gpio22 = GPIO_DIR_OUTPUT, + .gpio24 = GPIO_DIR_OUTPUT, + .gpio27 = GPIO_DIR_INPUT, + .gpio28 = GPIO_DIR_OUTPUT, + .gpio31 = GPIO_DIR_INPUT, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_level = { + .gpio3 = GPIO_LEVEL_LOW, + .gpio4 = GPIO_LEVEL_LOW, + .gpio7 = GPIO_LEVEL_LOW, + .gpio8 = GPIO_LEVEL_HIGH, + .gpio10 = GPIO_LEVEL_HIGH, + .gpio15 = GPIO_LEVEL_LOW, + .gpio22 = GPIO_LEVEL_LOW, + .gpio24 = GPIO_LEVEL_HIGH, + .gpio28 = GPIO_LEVEL_LOW, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_reset = { + .gpio24 = GPIO_RESET_RSMRST, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_invert = { + .gpio0 = GPIO_INVERT, + .gpio1 = GPIO_INVERT, + .gpio11 = GPIO_INVERT, + .gpio13 = GPIO_INVERT, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_blink = { +}; + +static const struct pch_gpio_set2 pch_gpio_set2_mode = { + .gpio32 = GPIO_MODE_NATIVE, + .gpio33 = GPIO_MODE_GPIO, + .gpio34 = GPIO_MODE_GPIO, + .gpio35 = GPIO_MODE_GPIO, + .gpio36 = GPIO_MODE_GPIO, + .gpio37 = GPIO_MODE_GPIO, + .gpio38 = GPIO_MODE_GPIO, + .gpio39 = GPIO_MODE_GPIO, + .gpio40 = GPIO_MODE_NATIVE, + .gpio41 = GPIO_MODE_NATIVE, + .gpio42 = GPIO_MODE_NATIVE, + .gpio43 = GPIO_MODE_GPIO, + .gpio44 = GPIO_MODE_NATIVE, + .gpio45 = GPIO_MODE_NATIVE, + .gpio46 = GPIO_MODE_NATIVE, + .gpio47 = GPIO_MODE_NATIVE, + .gpio48 = GPIO_MODE_GPIO, + .gpio49 = GPIO_MODE_NATIVE, + .gpio50 = GPIO_MODE_GPIO, + .gpio51 = GPIO_MODE_GPIO, + .gpio52 = GPIO_MODE_GPIO, + .gpio53 = GPIO_MODE_GPIO, + .gpio54 = GPIO_MODE_GPIO, + .gpio55 = GPIO_MODE_GPIO, + .gpio56 = GPIO_MODE_NATIVE, + .gpio57 = GPIO_MODE_GPIO, + .gpio58 = GPIO_MODE_NATIVE, + .gpio59 = GPIO_MODE_NATIVE, + .gpio60 = GPIO_MODE_NATIVE, + .gpio61 = GPIO_MODE_NATIVE, + .gpio62 = GPIO_MODE_NATIVE, + .gpio63 = GPIO_MODE_NATIVE, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_direction = { + .gpio33 = GPIO_DIR_OUTPUT, + .gpio34 = GPIO_DIR_INPUT, + .gpio35 = GPIO_DIR_OUTPUT, + .gpio36 = GPIO_DIR_INPUT, + .gpio37 = GPIO_DIR_INPUT, + .gpio38 = GPIO_DIR_INPUT, + .gpio39 = GPIO_DIR_INPUT, + .gpio43 = GPIO_DIR_OUTPUT, + .gpio48 = GPIO_DIR_INPUT, + .gpio50 = GPIO_DIR_INPUT, + .gpio51 = GPIO_DIR_OUTPUT, + .gpio52 = GPIO_DIR_INPUT, + .gpio53 = GPIO_DIR_OUTPUT, + .gpio54 = GPIO_DIR_OUTPUT, + .gpio55 = GPIO_DIR_OUTPUT, + .gpio57 = GPIO_DIR_INPUT, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_level = { + .gpio33 = GPIO_LEVEL_HIGH, + .gpio35 = GPIO_LEVEL_LOW, + .gpio43 = GPIO_LEVEL_HIGH, + .gpio51 = GPIO_LEVEL_HIGH, + .gpio53 = GPIO_LEVEL_HIGH, + .gpio54 = GPIO_LEVEL_LOW, + .gpio55 = GPIO_LEVEL_HIGH, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_reset = { +}; + +static const struct pch_gpio_set3 pch_gpio_set3_mode = { + .gpio64 = GPIO_MODE_GPIO, + .gpio65 = GPIO_MODE_GPIO, + .gpio66 = GPIO_MODE_GPIO, + .gpio67 = GPIO_MODE_GPIO, + .gpio68 = GPIO_MODE_GPIO, + .gpio69 = GPIO_MODE_GPIO, + .gpio70 = GPIO_MODE_GPIO, + .gpio71 = GPIO_MODE_GPIO, + .gpio72 = GPIO_MODE_NATIVE, + .gpio73 = GPIO_MODE_NATIVE, + .gpio74 = GPIO_MODE_NATIVE, + .gpio75 = GPIO_MODE_NATIVE, +}; + +static const struct pch_gpio_set3 pch_gpio_set3_direction = { + .gpio64 = GPIO_DIR_INPUT, + .gpio65 = GPIO_DIR_INPUT, + .gpio66 = GPIO_DIR_INPUT, + .gpio67 = GPIO_DIR_INPUT, + .gpio68 = GPIO_DIR_INPUT, + .gpio69 = GPIO_DIR_INPUT, + .gpio70 = GPIO_DIR_INPUT, + .gpio71 = GPIO_DIR_INPUT, +}; + +static const struct pch_gpio_set3 pch_gpio_set3_level = { +}; + +static const struct pch_gpio_set3 pch_gpio_set3_reset = { +}; + +const struct pch_gpio_map mainboard_gpio_map = { + .set1 = { + .mode = &pch_gpio_set1_mode, + .direction = &pch_gpio_set1_direction, + .level = &pch_gpio_set1_level, + .blink = &pch_gpio_set1_blink, + .invert = &pch_gpio_set1_invert, + .reset = &pch_gpio_set1_reset, + }, + .set2 = { + .mode = &pch_gpio_set2_mode, + .direction = &pch_gpio_set2_direction, + .level = &pch_gpio_set2_level, + .reset = &pch_gpio_set2_reset, + }, + .set3 = { + .mode = &pch_gpio_set3_mode, + .direction = &pch_gpio_set3_direction, + .level = &pch_gpio_set3_level, + .reset = &pch_gpio_set3_reset, + }, +}; diff --git a/src/mainboard/lenovo/t440p/hda_verb.c b/src/mainboard/lenovo/t440p/hda_verb.c new file mode 100644 index 0000000..9527312 --- /dev/null +++ b/src/mainboard/lenovo/t440p/hda_verb.c @@ -0,0 +1,40 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <device/azalia_device.h> + +const u32 cim_verb_data[] = { + 0x10ec0292, /* Codec Vendor / Device ID: Realtek */ + 0x17aa220e, /* Subsystem ID */ + 12, /* Number of 4 dword sets */ + AZALIA_SUBVENDOR(0x0, 0x17aa220e), + AZALIA_PIN_CFG(0x0, 0x12, 0x90a60130), + AZALIA_PIN_CFG(0x0, 0x13, 0x40000000), + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + AZALIA_PIN_CFG(0x0, 0x15, 0x0321101f), + AZALIA_PIN_CFG(0x0, 0x16, 0x411111f0), + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + AZALIA_PIN_CFG(0x0, 0x19, 0x411111f0), + AZALIA_PIN_CFG(0x0, 0x1a, 0x03a11020), + AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0), + AZALIA_PIN_CFG(0x0, 0x1d, 0x40738105), + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/lenovo/t440p/mainboard.c b/src/mainboard/lenovo/t440p/mainboard.c new file mode 100644 index 0000000..dcfd503 --- /dev/null +++ b/src/mainboard/lenovo/t440p/mainboard.c @@ -0,0 +1,34 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Iru Cai mytbk920423@gmail.com + * + * 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, either version 2 of the License, or + * (at your option) any later version. + * + * 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 <device/device.h> +#include <drivers/intel/gma/int15.h> +#include <ec/lenovo/h8/h8.h> + +static void mainboard_enable(struct device *dev) +{ + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, + GMA_INT15_PANEL_FIT_DEFAULT, + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); +} + +void h8_mainboard_init_dock(void) +{ +} + +struct chip_operations mainboard_ops = { + .enable_dev = mainboard_enable, +}; diff --git a/src/mainboard/lenovo/t440p/romstage.c b/src/mainboard/lenovo/t440p/romstage.c new file mode 100644 index 0000000..c8c630b --- /dev/null +++ b/src/mainboard/lenovo/t440p/romstage.c @@ -0,0 +1,103 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <stdint.h> +#include <arch/romstage.h> +#include <cpu/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/pei_data.h> +#include <southbridge/intel/common/gpio.h> +#include <southbridge/intel/lynxpoint/pch.h> + +static const struct rcba_config_instruction rcba_config[] = { + RCBA_SET_REG_16(D31IR, DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQA)), + RCBA_SET_REG_16(D29IR, DIR_ROUTE(PIRQH, PIRQD, PIRQA, PIRQC)), + RCBA_SET_REG_16(D28IR, DIR_ROUTE(PIRQA, PIRQA, PIRQA, PIRQA)), + RCBA_SET_REG_16(D27IR, DIR_ROUTE(PIRQG, PIRQB, PIRQC, PIRQD)), + RCBA_SET_REG_16(D26IR, DIR_ROUTE(PIRQA, PIRQF, PIRQC, PIRQD)), + RCBA_SET_REG_16(D25IR, DIR_ROUTE(PIRQE, PIRQF, PIRQG, PIRQH)), + RCBA_SET_REG_16(D22IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)), + RCBA_SET_REG_16(D20IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)), + + RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS), + + RCBA_END_CONFIG, +}; + +void mainboard_config_superio(void) +{ +} + +void mainboard_romstage_entry(void) +{ + struct pei_data pei_data = { + .pei_version = PEI_VERSION, + .mchbar = (uintptr_t)DEFAULT_MCHBAR, + .dmibar = (uintptr_t)DEFAULT_DMIBAR, + .epbar = DEFAULT_EPBAR, + .pciexbar = CONFIG_MMCONF_BASE_ADDRESS, + .smbusbar = SMBUS_IO_BASE, + .wdbbar = 0x4000000, + .wdbsize = 0x1000, + .hpet_address = HPET_ADDR, + .rcba = (uintptr_t)DEFAULT_RCBA, + .pmbase = DEFAULT_PMBASE, + .gpiobase = DEFAULT_GPIOBASE, + .temp_mmio_base = 0xfed08000, + .system_type = 0, /* mobile */ + .tseg_size = CONFIG_SMM_TSEG_SIZE, + .spd_addresses = { 0xa0, 0, 0xa2, 0 }, + .ec_present = 1, + .gbe_enable = 1, + .dimm_channel0_disabled = 2, + .dimm_channel1_disabled = 2, + .max_ddr3_freq = 1600, + .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 }, + }, + .usb3_ports = { + { 1, 0 }, + { 1, 0 }, + { 1, USB_OC_PIN_SKIP }, + { 1, USB_OC_PIN_SKIP }, + { 1, 1 }, + { 1, 1 }, /* WWAN */ + }, + }; + + struct romstage_params romstage_params = { + .pei_data = &pei_data, + .gpio_map = &mainboard_gpio_map, + .rcba_config = rcba_config, + }; + + romstage_common(&romstage_params); +} diff --git a/src/mainboard/lenovo/t440p/smihandler.c b/src/mainboard/lenovo/t440p/smihandler.c new file mode 100644 index 0000000..9f5044a --- /dev/null +++ b/src/mainboard/lenovo/t440p/smihandler.c @@ -0,0 +1,100 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2008-2009 coresystems GmbH + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 <device/pci_ops.h> +#include <console/console.h> +#include <cpu/x86/smm.h> +#include <ec/acpi/ec.h> +#include <ec/lenovo/h8/h8.h> +#include <delay.h> +#include <southbridge/intel/lynxpoint/pch.h> + +#define GPE_EC_SCI 1 +#define GPE_EC_WAKE 13 + +static void mainboard_smi_handle_ec_sci(void) +{ + u8 status = inb(EC_SC); + u8 event; + + if (!(status & EC_SCI_EVT)) + return; + + event = ec_query(); + printk(BIOS_DEBUG, "EC event %02x\n", event); +} + +void mainboard_smi_gpi(u32 gpi_sts) +{ + if (gpi_sts & (1 << GPE_EC_SCI)) + mainboard_smi_handle_ec_sci(); +} + +/* lynxpoint doesn't have gpi_route_interrupt, so add it */ +#define GPI_DISABLE 0x00 +#define GPI_IS_SMI 0x01 +#define GPI_IS_SCI 0x02 +#define GPI_IS_NMI 0x03 + +static void gpi_route_interrupt(u8 gpi, u8 mode) +{ + u32 gpi_rout; + + gpi_rout = pci_read_config32(PCI_DEV(0, 0x1f, 0), GPIO_ROUT); + gpi_rout &= ~(3 << (2 * gpi)); + gpi_rout |= ((mode & 3) << (2 * gpi)); + pci_write_config32(PCI_DEV(0, 0x1f, 0), GPIO_ROUT, gpi_rout); +} + +int mainboard_smi_apmc(u8 data) +{ + switch (data) { + case APM_CNT_ACPI_ENABLE: + /* use 0x1600/0x1604 to prevent races with userspace */ + ec_set_ports(0x1604, 0x1600); + /* route EC_SCI to SCI */ + gpi_route_interrupt(GPE_EC_SCI, GPI_IS_SCI); + /* discard all events, and enable attention */ + ec_write(0x80, 0x01); + break; + case APM_CNT_ACPI_DISABLE: + /* we have to use port 0x62/0x66, as 0x1600/0x1604 doesn't + provide a EC query function */ + ec_set_ports(0x66, 0x62); + /* route EC_SCI to SMI */ + gpi_route_interrupt(GPE_EC_SCI, GPI_IS_SMI); + /* discard all events, and enable attention */ + ec_write(0x80, 0x01); + break; + default: + break; + } + return 0; +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + if (slp_typ == 3) { + u8 ec_wake = ec_read(0x32); + /* If EC wake events are enabled, + * enable wake on EC WAKE GPE. */ + if (ec_wake & 0x14) { + /* Redirect EC WAKE GPE to SCI. */ + gpi_route_interrupt(GPE_EC_WAKE, GPI_IS_SCI); + } + } +}