<p>Iru Cai has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20776">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mb/hp: Add common code for Sandy/Ivy Bridge HP Elitebooks<br><br>Change-Id: I5d53bee1b957a34b018b47db8fc3653dd41b1b12<br>Signed-off-by: Iru Cai <mytbk920423@gmail.com><br>---<br>A src/mainboard/hp/elitebook_snb_ivb/Kconfig<br>A src/mainboard/hp/elitebook_snb_ivb/Makefile.inc<br>A src/mainboard/hp/elitebook_snb_ivb/acpi/ec.asl<br>A src/mainboard/hp/elitebook_snb_ivb/acpi/platform.asl<br>A src/mainboard/hp/elitebook_snb_ivb/acpi/superio.asl<br>A src/mainboard/hp/elitebook_snb_ivb/acpi_tables.c<br>A src/mainboard/hp/elitebook_snb_ivb/dsdt.asl<br>A src/mainboard/hp/elitebook_snb_ivb/gma-mainboard.ads<br>A src/mainboard/hp/elitebook_snb_ivb/hda_verb.c<br>A src/mainboard/hp/elitebook_snb_ivb/mainboard.c<br>A src/mainboard/hp/elitebook_snb_ivb/romstage.c<br>11 files changed, 313 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/20776/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/mainboard/hp/elitebook_snb_ivb/Kconfig b/src/mainboard/hp/elitebook_snb_ivb/Kconfig<br>new file mode 100644<br>index 0000000..dfac1e2<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/Kconfig<br>@@ -0,0 +1,41 @@<br>+config HP_ELITEBOOK_SNB_IVB<br>+ def_bool n<br>+   select EC_ACPI<br>+       select HAVE_ACPI_RESUME<br>+      select HAVE_ACPI_TABLES<br>+      select INTEL_INT15<br>+   select SANDYBRIDGE_IVYBRIDGE_LVDS<br>+    select SERIRQ_CONTINUOUS_MODE<br>+        select SYSTEM_TYPE_LAPTOP<br>+    select USE_NATIVE_RAMINIT<br>+    select EC_HP_KBC1126<br>+ select MAINBOARD_HAS_LIBGFXINIT<br>+      select GFX_GMA_INTERNAL_IS_LVDS<br>+<br>+if HP_ELITEBOOK_SNB_IVB<br>+<br>+config HAVE_IFD_BIN<br>+        bool<br>+ default n<br>+<br>+config HAVE_ME_BIN<br>+    bool<br>+ default n<br>+<br>+config MAINBOARD_DIR<br>+  string<br>+       default hp/elitebook_snb_ivb<br>+<br>+config MMCONF_BASE_ADDRESS<br>+ hex<br>+  default 0xf0000000<br>+<br>+config DRAM_RESET_GATE_GPIO<br>+  int<br>+  default 60<br>+<br>+config MAX_CPUS<br>+      int<br>+  default 8<br>+<br>+endif<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/Makefile.inc b/src/mainboard/hp/elitebook_snb_ivb/Makefile.inc<br>new file mode 100644<br>index 0000000..4e8f96a<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/Makefile.inc<br>@@ -0,0 +1,21 @@<br>+##<br>+## This file is part of the coreboot project.<br>+##<br>+## Copyright (C) 2017 Iru Cai <mytbk920423@gmail.com><br>+##<br>+## This program is free software; you can redistribute it and/or modify<br>+## it under the terms of the GNU General Public License as published by<br>+## the Free Software Foundation; version 2 of the License.<br>+##<br>+## This program is distributed in the hope that it will be useful,<br>+## but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+## GNU General Public License for more details.<br>+##<br>+<br>+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads<br>+<br>+subdirs-$(CONFIG_BOARD_HP_2760P) += ../2760p<br>+subdirs-$(CONFIG_BOARD_HP_2570P) += ../2570p<br>+subdirs-$(CONFIG_BOARD_HP_8460P) += ../8460p<br>+subdirs-$(CONFIG_BOARD_HP_8470P) += ../8470p<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/acpi/ec.asl b/src/mainboard/hp/elitebook_snb_ivb/acpi/ec.asl<br>new file mode 100644<br>index 0000000..ac65fb3<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/acpi/ec.asl<br>@@ -0,0 +1,16 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2017 Iru Cai <mytbk920423@gmail.com><br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <ec/hp/kbc1126/acpi/ec.asl><br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/acpi/platform.asl b/src/mainboard/hp/elitebook_snb_ivb/acpi/platform.asl<br>new file mode 100644<br>index 0000000..79eddcb<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/acpi/platform.asl<br>@@ -0,0 +1,23 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2011-2012 The Chromium OS Authors. All rights reserved.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+Method(_WAK,1)<br>+{<br>+     Return(Package(){0,0})<br>+}<br>+<br>+Method(_PTS,1)<br>+{<br>+}<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/acpi/superio.asl b/src/mainboard/hp/elitebook_snb_ivb/acpi/superio.asl<br>new file mode 100644<br>index 0000000..b3ea115<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/acpi/superio.asl<br>@@ -0,0 +1,16 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2007-2009 coresystems GmbH<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <drivers/pc80/pc/ps2_controller.asl><br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/acpi_tables.c b/src/mainboard/hp/elitebook_snb_ivb/acpi_tables.c<br>new file mode 100644<br>index 0000000..6b731cc<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/acpi_tables.c<br>@@ -0,0 +1,36 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2008-2009 coresystems GmbH<br>+ * Copyright (C) 2014 Vladimir Serbinenko<br>+ *<br>+ * This program is free software; you can redistribute it and/or<br>+ * modify it under the terms of the GNU General Public License as<br>+ * published by the Free Software Foundation; version 2 of<br>+ * the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <southbridge/intel/bd82x6x/nvs.h><br>+<br>+/* FIXME: check this function.  */<br>+void acpi_create_gnvs(global_nvs_t *gnvs)<br>+{<br>+      /* Disable USB ports in S3 by default */<br>+     gnvs->s3u0 = 0;<br>+   gnvs->s3u1 = 0;<br>+<br>+        /* Disable USB ports in S5 by default */<br>+     gnvs->s5u0 = 0;<br>+   gnvs->s5u1 = 0;<br>+<br>+        // the lid is open by default.<br>+       gnvs->lids = 1;<br>+<br>+        gnvs->tcrt = 100;<br>+ gnvs->tpsv = 90;<br>+}<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/dsdt.asl b/src/mainboard/hp/elitebook_snb_ivb/dsdt.asl<br>new file mode 100644<br>index 0000000..d4fab7a<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/dsdt.asl<br>@@ -0,0 +1,45 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2007-2009 coresystems GmbH<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB<br>+#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB<br>+#define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0<br>+DefinitionBlock(<br>+  "dsdt.aml",<br>+        "DSDT",<br>+    0x03,           // DSDT revision: ACPI v3.0<br>+  "COREv4",     // OEM id<br>+    "COREBOOT",   // OEM table id<br>+      0x20141018      // OEM revision<br>+)<br>+{<br>+      // Some generic macros<br>+       #include "acpi/platform.asl"<br>+       #include <cpu/intel/model_206ax/acpi/cpu.asl><br>+  #include <southbridge/intel/bd82x6x/acpi/platform.asl><br>+ /* global NVS and variables.  */<br>+     #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl><br>+        #include <southbridge/intel/bd82x6x/acpi/sleepstates.asl><br>+<br>+   Scope (\_SB) {<br>+               Device (PCI0)<br>+                {<br>+            #include <northbridge/intel/sandybridge/acpi/sandybridge.asl><br>+          #include <drivers/intel/gma/acpi/default_brightness_levels.asl><br>+                #include <southbridge/intel/bd82x6x/acpi/pch.asl><br>+              #include <southbridge/intel/bd82x6x/acpi/default_irq_route.asl><br>+                }<br>+    }<br>+}<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/gma-mainboard.ads b/src/mainboard/hp/elitebook_snb_ivb/gma-mainboard.ads<br>new file mode 100644<br>index 0000000..736dce7<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/gma-mainboard.ads<br>@@ -0,0 +1,20 @@<br>+with HW.GFX.GMA;<br>+with HW.GFX.GMA.Display_Probing;<br>+<br>+use HW.GFX.GMA;<br>+use HW.GFX.GMA.Display_Probing;<br>+<br>+private package GMA.Mainboard is<br>+<br>+   ports : constant Port_List :=<br>+     (DP1,<br>+      DP2,<br>+      DP3,<br>+      HDMI1,<br>+      HDMI2,<br>+      HDMI3,<br>+      Analog,<br>+      Internal,<br>+      others => Disabled);<br>+<br>+end GMA.Mainboard;<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/hda_verb.c b/src/mainboard/hp/elitebook_snb_ivb/hda_verb.c<br>new file mode 100644<br>index 0000000..e913500<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/hda_verb.c<br>@@ -0,0 +1 @@<br>+/* use board specific hda_verb.c */<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/mainboard.c b/src/mainboard/hp/elitebook_snb_ivb/mainboard.c<br>new file mode 100644<br>index 0000000..d84bff9<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/mainboard.c<br>@@ -0,0 +1,29 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2017 Iru Cai <mytbk920423@gmail.com><br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; either version 2 of the License, or<br>+ * (at your option) any later version.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <device/device.h><br>+#include <drivers/intel/gma/int15.h><br>+<br>+static void mainboard_enable(device_t dev)<br>+{<br>+     install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,<br>+                       GMA_INT15_PANEL_FIT_DEFAULT,<br>+                 GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);<br>+}<br>+<br>+struct chip_operations mainboard_ops = {<br>+        .enable_dev = mainboard_enable,<br>+};<br>diff --git a/src/mainboard/hp/elitebook_snb_ivb/romstage.c b/src/mainboard/hp/elitebook_snb_ivb/romstage.c<br>new file mode 100644<br>index 0000000..0c3f2f1<br>--- /dev/null<br>+++ b/src/mainboard/hp/elitebook_snb_ivb/romstage.c<br>@@ -0,0 +1,65 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2017 Iru Cai <mytbk920423@gmail.com><br>+ *<br>+ * This program is free software; you can redistribute it and/or<br>+ * modify it under the terms of the GNU General Public License as<br>+ * published by the Free Software Foundation; version 2 of<br>+ * the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <arch/io.h><br>+#include <northbridge/intel/sandybridge/sandybridge.h><br>+#include <northbridge/intel/sandybridge/raminit_native.h><br>+#include <southbridge/intel/bd82x6x/pch.h><br>+#include <superio/smsc/lpc47n217/lpc47n217.h><br>+#include <ec/hp/kbc1126/ec.h><br>+<br>+#define SERIAL_DEV PNP_DEV(0x4e, LPC47N217_SP1)<br>+<br>+void pch_enable_lpc(void)<br>+{<br>+     pci_write_config16(PCH_LPC_DEV, LPC_EN, 0x3f0f);<br>+     pci_write_config16(PCH_LPC_DEV, LPC_IO_DEC, 0x0010);<br>+ pci_write_config32(PCH_LPC_DEV, ETR3, 0x02010000);<br>+}<br>+<br>+void rcba_config(void)<br>+{<br>+       RCBA32(BUC) = 0;<br>+}<br>+<br>+void mainboard_early_init(int s3resume)<br>+{<br>+}<br>+<br>+void mainboard_config_superio(void)<br>+{<br>+       if (IS_ENABLED(CONFIG_SUPERIO_SMSC_LPC47N217))<br>+               lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);<br>+      else<br>+         kbc1126_disable4e();<br>+<br>+      kbc1126_enter_conf();<br>+        kbc1126_mailbox_init();<br>+      kbc1126_kbc_init();<br>+  kbc1126_ec_init();<br>+<br>+        if (IS_ENABLED(CONFIG_BOARD_HP_2760P))<br>+               kbc1126_com1_init();<br>+<br>+      kbc1126_pm1_init();<br>+  kbc1126_exit_conf();<br>+}<br>+<br>+void mainboard_get_spd(spd_raw_data *spd, bool id_only)<br>+{<br>+    read_spd(&spd[0], 0x50, id_only);<br>+        read_spd(&spd[2], 0x52, id_only);<br>+}<br></pre><p>To view, visit <a href="https://review.coreboot.org/20776">change 20776</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/20776"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5d53bee1b957a34b018b47db8fc3653dd41b1b12 </div>
<div style="display:none"> Gerrit-Change-Number: 20776 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Iru Cai <mytbk920423@gmail.com> </div>