Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36363 )
Change subject: arch/x86: Remove EARLY_EBDA_INIT support
......................................................................
arch/x86: Remove EARLY_EBDA_INIT support
This is unused now.
Change-Id: Ie8bc1d6761d66c5e1dda40c34c940cdba90646d2
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/arch/x86/Kconfig
M src/arch/x86/Makefile.inc
M src/arch/x86/ebda.c
M src/arch/x86/include/arch/ebda.h
M src/arch/x86/tables.c
M src/device/device.c
6 files changed, 3 insertions(+), 111 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/36363/1
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 8ce5977..4ea11ea 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -141,15 +141,6 @@
help
Increase this value if preram cbmem console is getting truncated
-config EARLY_EBDA_INIT
- bool
- default n
- help
- Initialize BIOS EBDA area early in romstage to allow bootloader to
- use this region for storing data which can be available across
- various stages. If user is selecting this option then its users
- responsibility to perform EBDA initialization call during romstage.
-
config PC80_SYSTEM
bool
default y if ARCH_X86
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 612424d..e3aa7fe 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -226,7 +226,6 @@
romstage-y += cbmem.c
romstage-y += cbfs_and_run.c
romstage-y += cpu_common.c
-romstage-$(CONFIG_EARLY_EBDA_INIT) += ebda.c
romstage-$(CONFIG_IDT_IN_EVERY_STAGE) += exception.c
romstage-$(CONFIG_IDT_IN_EVERY_STAGE) += idt.S
romstage-y += memcpy.c
@@ -266,7 +265,6 @@
postcar-y += cbfs_and_run.c
postcar-y += cbmem.c
postcar-y += cpu_common.c
-postcar-$(CONFIG_EARLY_EBDA_INIT) += ebda.c
postcar-$(CONFIG_IDT_IN_EVERY_STAGE) += exception.c
postcar-$(CONFIG_IDT_IN_EVERY_STAGE) += idt.S
postcar-y += exit_car.S
diff --git a/src/arch/x86/ebda.c b/src/arch/x86/ebda.c
index d1212f9..80909f6 100644
--- a/src/arch/x86/ebda.c
+++ b/src/arch/x86/ebda.c
@@ -39,43 +39,7 @@
* the top of conventional memory (below 1MB)
*/
-/*
- * write_ebda_data is a wrapper function to write into EBDA area
- *
- * data = data to be written into EBDA area
- * length = input data size.
- */
-void write_ebda_data(const void *data, size_t length)
-{
- void *ebda;
-
- if (!is_length_valid(length))
- die("Input data length is > EBDA default size (1KiB)!");
-
- ebda = get_ebda_start();
-
- memcpy(ebda, data, length);
-}
-
-/*
- * read_ebda_data is a wrapper function to read from EBDA area
- *
- * data = data read from EBDA area based on input size
- * length = read data size.
- */
-void read_ebda_data(void *data, size_t length)
-{
- void *ebda;
-
- if (!is_length_valid(length))
- die("Input data length is > EBDA default size (1KiB)!");
-
- ebda = get_ebda_start();
-
- memcpy(data, ebda, length);
-}
-
-void setup_ebda(u32 low_memory_size, u16 ebda_segment, u16 ebda_size)
+static void setup_ebda(u32 low_memory_size, u16 ebda_segment, u16 ebda_size)
{
u16 low_memory_kb;
u16 ebda_kb;
diff --git a/src/arch/x86/include/arch/ebda.h b/src/arch/x86/include/arch/ebda.h
index 534fb3d..6ee3332 100644
--- a/src/arch/x86/include/arch/ebda.h
+++ b/src/arch/x86/include/arch/ebda.h
@@ -27,27 +27,6 @@
#define DEFAULT_EBDA_SEGMENT 0xF600
#define DEFAULT_EBDA_SIZE 0x400
-void setup_ebda(u32 low_memory_size, u16 ebda_segment, u16 ebda_size);
void setup_default_ebda(void);
-/*
- * This read/write API only allows and assumes
- * a single EBDA structure type for a platform.
- */
-
-/*
- * write_ebda_data is a wrapper function to write into EBDA area
- *
- * data = data to be written into EBDA area
- * length = input data size.
- */
-void write_ebda_data(const void *data, size_t length);
-/*
- * read_ebda_data is a wrapper function to read from EBDA area
- *
- * data = data read from EBDA area based on input size
- * length = read data size.
- */
-void read_ebda_data(void *data, size_t length);
-
#endif
diff --git a/src/arch/x86/tables.c b/src/arch/x86/tables.c
index ddb0710..55a4dd6 100644
--- a/src/arch/x86/tables.c
+++ b/src/arch/x86/tables.c
@@ -194,41 +194,6 @@
#define FORWARDING_TABLE_ADDR ((uintptr_t)0x500)
static uintptr_t forwarding_table = FORWARDING_TABLE_ADDR;
-/*
- * For EARLY_EBDA_INIT the BDA area will be wiped on the resume path which
- * has the forwarding table entry. Therefore, when tables are written an
- * entry is placed in cbmem that can be restored on OS resume to the proper
- * location.
- */
-static void stash_forwarding_table(uintptr_t addr, size_t sz)
-{
- void *cbmem_addr = cbmem_add(CBMEM_ID_CBTABLE_FWD, sz);
-
- if (cbmem_addr == NULL) {
- printk(BIOS_ERR, "Unable to allocate CBMEM forwarding entry.\n");
- return;
- }
-
- memcpy(cbmem_addr, (void *)addr, sz);
-}
-
-static void restore_forwarding_table(void *dest)
-{
- const struct cbmem_entry *fwd_entry;
-
- fwd_entry = cbmem_entry_find(CBMEM_ID_CBTABLE_FWD);
-
- if (fwd_entry == NULL) {
- printk(BIOS_ERR, "Unable to restore CBMEM forwarding entry.\n");
- return;
- }
-
- memcpy(dest, cbmem_entry_start(fwd_entry), cbmem_entry_size(fwd_entry));
-}
-
-BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY,
- restore_forwarding_table, (void *)FORWARDING_TABLE_ADDR);
-
void arch_write_tables(uintptr_t coreboot_table)
{
size_t sz;
diff --git a/src/device/device.c b/src/device/device.c
index 333f1f0..5d9938f 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -1165,13 +1165,8 @@
printk(BIOS_INFO, "Initializing devices...\n");
#if CONFIG(ARCH_X86)
- /*
- * Initialize EBDA area in ramstage if early
- * initialization is not done.
- */
- if (!CONFIG(EARLY_EBDA_INIT))
- /* Ensure EBDA is prepared before Option ROMs. */
- setup_default_ebda();
+ /* Ensure EBDA is prepared before Option ROMs. */
+ setup_default_ebda();
#endif
/* First call the mainboard init. */
--
To view, visit https://review.coreboot.org/c/coreboot/+/36363
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie8bc1d6761d66c5e1dda40c34c940cdba90646d2
Gerrit-Change-Number: 36363
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36360 )
Change subject: soc/intel/cannonlake: Don't save tolum_base to ebda
......................................................................
soc/intel/cannonlake: Don't save tolum_base to ebda
Later stages don't need access to it anymore.
Change-Id: Ic3b759f28f4969d4da2164ba61562f5cf53c5693
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/cannonlake/memmap.c
1 file changed, 3 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/36360/1
diff --git a/src/soc/intel/cannonlake/memmap.c b/src/soc/intel/cannonlake/memmap.c
index 2a25940..dacc3ae 100644
--- a/src/soc/intel/cannonlake/memmap.c
+++ b/src/soc/intel/cannonlake/memmap.c
@@ -15,7 +15,6 @@
*/
#include <arch/romstage.h>
-#include <arch/ebda.h>
#include <cbmem.h>
#include <console/console.h>
#include <cpu/x86/mtrr.h>
@@ -23,7 +22,6 @@
#include <device/device.h>
#include <device/pci.h>
#include <fsp/util.h>
-#include <intelblocks/ebda.h>
#include <intelblocks/systemagent.h>
#include <soc/pci_devs.h>
#include <soc/systemagent.h>
@@ -187,7 +185,7 @@
* the base registers from each other to determine sizes of the regions. In
* other words, the memory map is in a fixed order no matter what.
*/
-static uintptr_t calculate_dram_base(size_t *reserved_mem_size)
+static uintptr_t calculate_dram_base(void)
{
uintptr_t dram_base;
const struct device *dev;
@@ -204,28 +202,11 @@
dram_base -= calculate_traditional_mem_size(dram_base, dev);
/* Get Intel Reserved Memory Range Size */
- *reserved_mem_size = calculate_reserved_mem_size(dram_base, dev);
-
- dram_base -= *reserved_mem_size;
+ dram_base = calculate_reserved_mem_size(dram_base, dev);
return dram_base;
}
-/* Fill up memory layout information */
-void fill_soc_memmap_ebda(struct ebda_config *cfg)
-{
- size_t chipset_mem_size;
-
- cfg->tolum_base = calculate_dram_base(&chipset_mem_size);
- cfg->reserved_mem_size = chipset_mem_size;
-}
-
-void cbmem_top_init(void)
-{
- /* Fill up EBDA area */
- fill_ebda_area();
-}
-
/*
* +-------------------------+ Top of RAM (aligned)
* | System Management Mode |
@@ -255,8 +236,6 @@
*/
void *cbmem_top_romstage(void)
{
- struct ebda_config ebda_cfg;
-
/*
* Check if Tseg has been initialized, we will use this as a flag
* to check if the MRC is done, and only then continue to read the
@@ -266,9 +245,7 @@
if (sa_get_tseg_base() == 0)
return NULL;
- retrieve_ebda_object(&ebda_cfg);
-
- return (void *)(uintptr_t)ebda_cfg.tolum_base;
+ return (void *)calculate_dram_base();
}
void fill_postcar_frame(struct postcar_frame *pcf)
--
To view, visit https://review.coreboot.org/c/coreboot/+/36360
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic3b759f28f4969d4da2164ba61562f5cf53c5693
Gerrit-Change-Number: 36360
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31323
Change subject: [WIP]mb/asus/p5ql-em: Add mainboard
......................................................................
[WIP]mb/asus/p5ql-em: Add mainboard
Tested, working:
- First dimm slot of each channel
- USB, SATA
- CPU FSB at 1067MHz
- Libgfxinit on DVI and VGA slot
- PCI slot
- Realtek NIC (configure macaddress in Kconfig)
- PEG slot
Tested, not working:
- second dimm slot for each channel. Those are hooked up to the second
rank of the channel, instead of rank 3 and 4. The raminit does not
support such setups.
Untested:
- PCIe x1 slot, likely works fine
- HDMI
TODO:
- BSEL superio pins
Tested using SeaBIOS 1.12, Linux 4.19.
Change-Id: I88fe9c66dae079cd7eedcc9736c5922defbc0e5a
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
A src/mainboard/asus/p5ql-em/Kconfig
A src/mainboard/asus/p5ql-em/Kconfig.name
A src/mainboard/asus/p5ql-em/Makefile.inc
A src/mainboard/asus/p5ql-em/acpi/ec.asl
A src/mainboard/asus/p5ql-em/acpi/ich10_pci_irqs.asl
A src/mainboard/asus/p5ql-em/acpi/platform.asl
A src/mainboard/asus/p5ql-em/acpi/superio.asl
A src/mainboard/asus/p5ql-em/acpi_tables.c
A src/mainboard/asus/p5ql-em/board_info.txt
A src/mainboard/asus/p5ql-em/cmos.default
A src/mainboard/asus/p5ql-em/cmos.layout
A src/mainboard/asus/p5ql-em/cstates.c
A src/mainboard/asus/p5ql-em/data.vbt
A src/mainboard/asus/p5ql-em/devicetree.cb
A src/mainboard/asus/p5ql-em/dsdt.asl
A src/mainboard/asus/p5ql-em/gma-mainboard.ads
A src/mainboard/asus/p5ql-em/gpio.c
A src/mainboard/asus/p5ql-em/hda_verb.c
A src/mainboard/asus/p5ql-em/romstage.c
19 files changed, 811 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/31323/1
diff --git a/src/mainboard/asus/p5ql-em/Kconfig b/src/mainboard/asus/p5ql-em/Kconfig
new file mode 100644
index 0000000..07af627
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/Kconfig
@@ -0,0 +1,47 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.com>
+# Copyright (C) 2018 Arthur Heymans <arthur(a)aheymans.xyz>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+if BOARD_ASUS_P5QL_EM
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select ARCH_X86
+ select CPU_INTEL_SOCKET_LGA775
+ select NORTHBRIDGE_INTEL_X4X
+ select SOUTHBRIDGE_INTEL_I82801JX
+ select SUPERIO_WINBOND_W83627DHG
+ select HAVE_ACPI_TABLES
+ select BOARD_ROMSIZE_KB_1024
+ select HAVE_OPTION_TABLE
+ select HAVE_CMOS_DEFAULT
+ select HAVE_ACPI_RESUME
+ select INTEL_GMA_HAVE_VBT
+ select MAINBOARD_HAS_LIBGFXINIT
+ select REALTEK_8168_RESET
+
+config MAINBOARD_DIR
+ string
+ default "asus/p5ql-em"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "P5QL EM"
+
+config MAX_CPUS
+ int
+ default 4
+
+endif # BOARD_ASUS_P5QL_EM
diff --git a/src/mainboard/asus/p5ql-em/Kconfig.name b/src/mainboard/asus/p5ql-em/Kconfig.name
new file mode 100644
index 0000000..92ead65
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_ASUS_P5QL_EM
+ bool "P5QL EM"
diff --git a/src/mainboard/asus/p5ql-em/Makefile.inc b/src/mainboard/asus/p5ql-em/Makefile.inc
new file mode 100644
index 0000000..6b3d94a
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/Makefile.inc
@@ -0,0 +1,17 @@
+#
+# 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; 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.
+#
+
+ramstage-y += cstates.c
+romstage-y += gpio.c
+
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
diff --git a/src/mainboard/asus/p5ql-em/acpi/ec.asl b/src/mainboard/asus/p5ql-em/acpi/ec.asl
new file mode 100644
index 0000000..2997587
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/acpi/ec.asl
@@ -0,0 +1 @@
+/* dummy */
diff --git a/src/mainboard/asus/p5ql-em/acpi/ich10_pci_irqs.asl b/src/mainboard/asus/p5ql-em/acpi/ich10_pci_irqs.asl
new file mode 100644
index 0000000..861561a
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/acpi/ich10_pci_irqs.asl
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Arthur Heymans <arthur(a)aheymans.xyz>
+ *
+ * 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.
+ */
+
+/* This is board specific information:
+ * IRQ routing for the 0:1e.0 PCI bridge of the ICH10
+ */
+
+If (PICM) {
+ Return (Package() {
+ /* PCI slot */
+ Package() { 0x0000ffff, 0, 0, 0x10},
+ Package() { 0x0000ffff, 1, 0, 0x11},
+ Package() { 0x0000ffff, 2, 0, 0x12},
+ Package() { 0x0000ffff, 3, 0, 0x13},
+ })
+} Else {
+ Return (Package() {
+ Package() { 0x0000ffff, 0, \_SB.PCI0.LPCB.LNKA, 0},
+ Package() { 0x0000ffff, 1, \_SB.PCI0.LPCB.LNKB, 0},
+ Package() { 0x0000ffff, 2, \_SB.PCI0.LPCB.LNKC, 0},
+ Package() { 0x0000ffff, 3, \_SB.PCI0.LPCB.LNKD, 0},
+ })
+}
diff --git a/src/mainboard/asus/p5ql-em/acpi/platform.asl b/src/mainboard/asus/p5ql-em/acpi/platform.asl
new file mode 100644
index 0000000..6c92a4e
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/acpi/platform.asl
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.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; 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.
+ */
+
+Method(_PIC, 1)
+{
+ /* Remember the OS' IRQ routing choice. */
+ Store(Arg0, PICM)
+}
+
+/* SMI I/O Trap */
+Method(TRAP, 1, Serialized)
+{
+ Store (Arg0, SMIF) /* SMI Function */
+ Store (0, TRP0) /* Generate trap */
+ Return (SMIF) /* Return value of SMI handler */
+}
diff --git a/src/mainboard/asus/p5ql-em/acpi/superio.asl b/src/mainboard/asus/p5ql-em/acpi/superio.asl
new file mode 100644
index 0000000..8f414f5
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/acpi/superio.asl
@@ -0,0 +1 @@
+/* TODO */
diff --git a/src/mainboard/asus/p5ql-em/acpi_tables.c b/src/mainboard/asus/p5ql-em/acpi_tables.c
new file mode 100644
index 0000000..d609a0e
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/acpi_tables.c
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ * Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.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; 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 <string.h>
+#include <southbridge/intel/i82801jx/nvs.h>
+
+void acpi_create_gnvs(global_nvs_t *gnvs)
+{
+ memset((void *)gnvs, 0, sizeof(*gnvs));
+
+ gnvs->pwrs = 1; /* Power state (AC = 1) */
+ gnvs->osys = 2002; /* At least WINXP SP2 (HPET fix) */
+ gnvs->apic = 1; /* Enable APIC */
+ gnvs->mpen = 1; /* Enable Multi Processing */
+ gnvs->cmap = 0x01; /* Enable COM 1 port */
+}
diff --git a/src/mainboard/asus/p5ql-em/board_info.txt b/src/mainboard/asus/p5ql-em/board_info.txt
new file mode 100644
index 0000000..42d4812
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/board_info.txt
@@ -0,0 +1,6 @@
+Category: desktop
+Board URL: https://www.asus.com/Motherboards/P5QC/
+ROM package: DIP-8
+ROM protocol: SPI
+ROM socketed: y
+Flashrom support: y
diff --git a/src/mainboard/asus/p5ql-em/cmos.default b/src/mainboard/asus/p5ql-em/cmos.default
new file mode 100644
index 0000000..ad822d5
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/cmos.default
@@ -0,0 +1,5 @@
+boot_option=Fallback
+debug_level=Debug
+power_on_after_fail=Disable
+nmi=Enable
+sata_mode=AHCI
diff --git a/src/mainboard/asus/p5ql-em/cmos.layout b/src/mainboard/asus/p5ql-em/cmos.layout
new file mode 100644
index 0000000..09ba5c5
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/cmos.layout
@@ -0,0 +1,104 @@
+##
+## 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 5 r 0 unused?
+
+# -----------------------------------------------------------------
+# coreboot config options: console
+395 4 e 6 debug_level
+
+# coreboot config options: southbridge
+408 1 e 10 sata_mode
+409 2 e 7 power_on_after_fail
+411 1 e 1 nmi
+
+# coreboot config options: cpu
+#424 8 r 0 unused
+
+# coreboot config options: northbridge
+432 4 e 11 gfx_uma_size
+#436 548 r 0 unused
+
+# 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
+10 0 AHCI
+10 1 Compatible
+11 6 64M
+11 7 128M
+11 8 256M
+11 9 96M
+11 10 160M
+11 11 224M
+11 12 352M
+
+# -----------------------------------------------------------------
+checksums
+
+checksum 392 983 984
diff --git a/src/mainboard/asus/p5ql-em/cstates.c b/src/mainboard/asus/p5ql-em/cstates.c
new file mode 100644
index 0000000..aa7214d
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/cstates.c
@@ -0,0 +1,21 @@
+/*
+ * 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; 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 <arch/acpigen.h>
+#include <device/device.h>
+#include <southbridge/intel/i82801jx/i82801jx.h>
+
+int get_cst_entries(acpi_cstate_t **entries)
+{
+ return 0;
+}
diff --git a/src/mainboard/asus/p5ql-em/data.vbt b/src/mainboard/asus/p5ql-em/data.vbt
new file mode 100644
index 0000000..5dd1803
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/data.vbt
Binary files differ
diff --git a/src/mainboard/asus/p5ql-em/devicetree.cb b/src/mainboard/asus/p5ql-em/devicetree.cb
new file mode 100644
index 0000000..e13d59b
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/devicetree.cb
@@ -0,0 +1,169 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.com>
+# Copyright (C) 2018 Angel Pons <th3fanbus(a)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.
+#
+
+chip northbridge/intel/x4x # Northbridge
+ device cpu_cluster 0 on # APIC cluster
+ chip cpu/intel/socket_LGA775
+ device lapic 0 on end
+ end
+ chip cpu/intel/model_1067x # CPU
+ device lapic 0xACAC off end
+ end
+ end
+ device domain 0 on # PCI domain
+ device pci 0.0 on # Host Bridge
+ subsystemid 0x1043 0x8336
+ end
+ device pci 1.0 on # PEG
+ subsystemid 0x1043 0x8336
+ end
+ device pci 2.0 on # Integrated graphics controller
+ subsystemid 0x1043 0x8336
+ end
+ device pci 2.1 on # Integrated graphics controller 2
+ subsystemid 0x1043 0x8336
+ end
+ device pci 3.0 off end # ME
+ device pci 3.1 off end # ME
+ device pci 3.2 off end # ME
+ device pci 3.3 off end # ME
+ device pci 6.0 off end # PEG 2
+ chip southbridge/intel/i82801jx # Southbridge
+ register "gpe0_en" = "0x40"
+
+ # Set AHCI mode.
+ register "sata_port_map" = "0x3f"
+ register "sata_clock_request" = "0"
+ register "sata_traffic_monitor" = "0"
+
+ # Enable PCIe ports 0,2,3 as slots.
+ register "pcie_slot_implemented" = "0x31"
+
+ device pci 19.0 off end # GBE
+ device pci 1a.0 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1a.1 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1a.2 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1a.7 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1b.0 on # Audio
+ subsystemid 0x1043 0x82fe
+ end
+ device pci 1c.0 on end # PCIe 1 PCIe x1 Slot #1
+ device pci 1c.1 off end # PCIe 2
+ device pci 1c.2 off end # PCIe 3
+ device pci 1c.3 on # PCIe 4 1394 controller
+ device pci 0.0 on
+ subsystemid 0x1043 0x8313
+ end
+ end
+ device pci 1c.4 on # PCIe 5 Marvell IDE
+ device pci 0.0 on
+ subsystemid 0x1043 0x82a2
+ end
+ end
+ device pci 1c.5 on # PCIe 6 Realtek LAN
+ device pci 0.0 on
+ subsystemid 0x1043 0x82c6
+ end
+ end
+ device pci 1d.0 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1d.1 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1d.2 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1d.7 on # USB
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1e.0 on end # PCI bridge
+ device pci 1f.0 on # LPC bridge
+ subsystemid 0x1043 0x82d4
+ chip superio/winbond/w83627dhg
+ device pnp 2e.0 on # Floppy
+ # global
+ irq 0x2c = 0x92
+ #floppy
+ io 0x60 = 0x3f0
+ irq 0x70 = 0x06
+ drq 0x74 = 0x02
+ end
+ device pnp 2e.1 on # Parallel port
+ # parallel port
+ io 0x60 = 0x378
+ irq 0x70 = 7
+ drq 0x74 = 3
+ end
+ device pnp 2e.2 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.3 off end # COM2, IR
+ device pnp 2e.5 on # Keyboard, mouse
+ io 0x60 = 0x60
+ io 0x62 = 0x64
+ irq 0x70 = 1
+ irq 0x72 = 12
+ end
+ device pnp 2e.6 off end # SPI
+ device pnp 2e.7 on end # GPIO6 (all input)
+ device pnp 2e.8 off end # WDT0#, PLED
+ device pnp 2e.9 off end # GPIO2
+ device pnp 2e.109 on # GPIO3
+ irq 0xf0 = 0xf3
+ irq 0xf1 = 0x0c
+ end
+ device pnp 2e.209 on # GPIO4
+ irq 0xf4 = 0x06
+ irq 0xf5 = 0x06
+ end
+ device pnp 2e.309 on # GPIO5
+ irq 0xe0 = 0xdf
+ irq 0xf3 = 0x09 # RSVD SUSLED settings
+ end
+ device pnp 2e.a off end # ACPI
+ device pnp 2e.b on # HWM, front pannel LED
+ io 0x60 = 0x290
+ irq 0x70 = 0
+ end
+ device pnp 2e.c off end # PECI, SST
+ end
+ end
+ device pci 1f.1 off end # PATA/IDE
+ device pci 1f.2 on # SATA
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1f.3 on # SMbus
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1f.4 off end
+ device pci 1f.5 on # IDE
+ subsystemid 0x1043 0x82d4
+ end
+ device pci 1f.6 off end # Thermal
+ end
+ end
+end
diff --git a/src/mainboard/asus/p5ql-em/dsdt.asl b/src/mainboard/asus/p5ql-em/dsdt.asl
new file mode 100644
index 0000000..d7ce26e
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/dsdt.asl
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ * Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.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; 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/i82801jx/i82801jx.h>
+
+#include <arch/acpi.h>
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x02, // DSDT revision: ACPI v2.0 and up
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x00000001 // OEM revision
+)
+{
+ // global NVS and variables
+ #include "acpi/platform.asl"
+ #include <southbridge/intel/i82801jx/acpi/globalnvs.asl>
+
+ Scope (\_SB) {
+ Device (PCI0)
+ {
+ #include <northbridge/intel/x4x/acpi/x4x.asl>
+ #include <southbridge/intel/i82801jx/acpi/ich10.asl>
+ #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
+ }
+ }
+
+ /* Chipset specific sleep states */
+ #include <southbridge/intel/i82801jx/acpi/sleepstates.asl>
+}
diff --git a/src/mainboard/asus/p5ql-em/gma-mainboard.ads b/src/mainboard/asus/p5ql-em/gma-mainboard.ads
new file mode 100644
index 0000000..43a7d89
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/gma-mainboard.ads
@@ -0,0 +1,29 @@
+--
+-- 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 :=
+ (HDMI1,
+ HDMI2,
+ Analog,
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/asus/p5ql-em/gpio.c b/src/mainboard/asus/p5ql-em/gpio.c
new file mode 100644
index 0000000..7bc8b9b
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/gpio.c
@@ -0,0 +1,128 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Arthur Heymans <arthur(a)aheymans.xyz>
+ *
+ * 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,
+ .gpio6 = GPIO_MODE_GPIO,
+ .gpio7 = GPIO_MODE_GPIO,
+ .gpio8 = GPIO_MODE_GPIO,
+ .gpio10 = GPIO_MODE_GPIO,
+ .gpio12 = GPIO_MODE_GPIO,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_GPIO,
+ .gpio18 = GPIO_MODE_GPIO,
+ .gpio19 = GPIO_MODE_GPIO,
+ .gpio20 = GPIO_MODE_GPIO,
+ .gpio21 = GPIO_MODE_GPIO,
+ .gpio22 = GPIO_MODE_GPIO,
+ .gpio24 = GPIO_MODE_GPIO,
+ .gpio27 = GPIO_MODE_GPIO,
+ .gpio28 = GPIO_MODE_GPIO,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_direction = {
+ .gpio0 = GPIO_DIR_INPUT,
+ .gpio1 = GPIO_DIR_INPUT,
+ .gpio6 = GPIO_DIR_INPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_INPUT,
+ .gpio10 = GPIO_DIR_INPUT,
+ .gpio12 = GPIO_DIR_OUTPUT,
+ .gpio13 = GPIO_DIR_INPUT,
+ .gpio14 = GPIO_DIR_INPUT,
+ .gpio18 = GPIO_DIR_OUTPUT,
+ .gpio19 = GPIO_DIR_INPUT,
+ .gpio20 = GPIO_DIR_OUTPUT,
+ .gpio21 = GPIO_DIR_OUTPUT,
+ .gpio22 = GPIO_DIR_INPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio27 = GPIO_DIR_OUTPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio12 = GPIO_LEVEL_LOW,
+ .gpio18 = GPIO_LEVEL_HIGH,
+ .gpio20 = GPIO_LEVEL_HIGH,
+ .gpio21 = GPIO_LEVEL_HIGH,
+ .gpio24 = GPIO_LEVEL_LOW,
+ .gpio27 = GPIO_LEVEL_LOW,
+ .gpio28 = GPIO_LEVEL_LOW,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_invert = {
+ .gpio7 = GPIO_INVERT,
+ .gpio10 = 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_GPIO,
+ .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,
+ .gpio48 = GPIO_MODE_GPIO,
+ .gpio49 = GPIO_MODE_GPIO,
+ .gpio56 = GPIO_MODE_GPIO,
+ .gpio57 = GPIO_MODE_GPIO,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_direction = {
+ .gpio32 = GPIO_DIR_OUTPUT,
+ .gpio33 = GPIO_DIR_OUTPUT,
+ .gpio34 = GPIO_DIR_OUTPUT,
+ .gpio35 = GPIO_DIR_OUTPUT,
+ .gpio36 = GPIO_DIR_INPUT,
+ .gpio37 = GPIO_DIR_INPUT,
+ .gpio38 = GPIO_DIR_INPUT,
+ .gpio39 = GPIO_DIR_INPUT,
+ .gpio48 = GPIO_DIR_INPUT,
+ .gpio49 = GPIO_DIR_OUTPUT,
+ .gpio56 = GPIO_DIR_INPUT,
+ .gpio57 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio32 = GPIO_LEVEL_HIGH,
+ .gpio33 = GPIO_LEVEL_HIGH,
+ .gpio34 = GPIO_LEVEL_LOW,
+ .gpio35 = GPIO_LEVEL_LOW,
+ .gpio49 = GPIO_LEVEL_HIGH,
+};
+
+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,
+ },
+ .set2 = {
+ .mode = &pch_gpio_set2_mode,
+ .direction = &pch_gpio_set2_direction,
+ .level = &pch_gpio_set2_level,
+ },
+};
diff --git a/src/mainboard/asus/p5ql-em/hda_verb.c b/src/mainboard/asus/p5ql-em/hda_verb.c
new file mode 100644
index 0000000..9e54df6
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/hda_verb.c
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Arthur Heymans <arthur(a)aheymans.xyz>
+ *
+ * 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/azalia_device.h>
+
+const u32 cim_verb_data[] = {
+ /* coreboot specific header */
+ 0x10ec0888,
+ 0x104382fe, // Subsystem ID
+ 13, // Number of entries
+
+ /* Pin Widget Verb Table */
+
+ AZALIA_PIN_CFG(0, 0x11, 0x99430130),
+ AZALIA_PIN_CFG(0, 0x14, 0x01014010),
+ AZALIA_PIN_CFG(0, 0x15, 0x01011012),
+ AZALIA_PIN_CFG(0, 0x16, 0x01016011),
+ AZALIA_PIN_CFG(0, 0x17, 0x01012014),
+ AZALIA_PIN_CFG(0, 0x18, 0x01a19840),
+ AZALIA_PIN_CFG(0, 0x19, 0x02a19c50),
+ AZALIA_PIN_CFG(0, 0x1a, 0x0181304f),
+ AZALIA_PIN_CFG(0, 0x1b, 0x02214c20),
+ AZALIA_PIN_CFG(0, 0x1c, 0x593301f0),
+ AZALIA_PIN_CFG(0, 0x1d, 0x4015e601),
+ AZALIA_PIN_CFG(0, 0x1e, 0x411111f0),
+ AZALIA_PIN_CFG(0, 0x1f, 0x411111f0),
+
+ 0x80862803,
+ 0x80860101,
+ 1,
+
+ AZALIA_PIN_CFG(1, 0x03, 0x18560010),
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+const u32 pc_beep_verbs_size = ARRAY_SIZE(pc_beep_verbs);
+const u32 cim_verb_data_size = ARRAY_SIZE(cim_verb_data);
diff --git a/src/mainboard/asus/p5ql-em/romstage.c b/src/mainboard/asus/p5ql-em/romstage.c
new file mode 100644
index 0000000..da822ac
--- /dev/null
+++ b/src/mainboard/asus/p5ql-em/romstage.c
@@ -0,0 +1,93 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Arthur Heymans <arthur(a)aheymans.xyz>
+ *
+ * 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 <arch/io.h>
+#include <console/console.h>
+#include <southbridge/intel/i82801jx/i82801jx.h>
+#include <southbridge/intel/common/gpio.h>
+#include <northbridge/intel/x4x/x4x.h>
+#include <cpu/x86/bist.h>
+#include <cpu/intel/romstage.h>
+#include <superio/winbond/w83627dhg/w83627dhg.h>
+#include <superio/winbond/common/winbond.h>
+#include <northbridge/intel/x4x/iomap.h>
+
+#define SERIAL_DEV PNP_DEV(0x2e, W83627DHG_SP1)
+#define LPC_DEV PCI_DEV(0, 0x1f, 0)
+
+/* Early mainboard specific GPIO setup.
+ * We should use standard gpio.h eventually
+ */
+
+static void mb_gpio_init(void)
+{
+ /* Set the value for GPIO base address register and enable GPIO. */
+ pci_write_config32(LPC_DEV, D31F0_GPIO_BASE, (DEFAULT_GPIOBASE | 1));
+ pci_write_config8(LPC_DEV, D31F0_GPIO_CNTL, 0x10);
+
+ setup_pch_gpios(&mainboard_gpio_map);
+
+ /* Enable IOAPIC */
+ RCBA8(0x31ff) = 0x03;
+ RCBA8(0x31ff);
+}
+
+static void ich10_enable_lpc(void)
+{
+ /* Configure serial IRQs.*/
+ pci_write_config16(LPC_DEV, D31F0_LPC_IODEC, 0x0010);
+ pci_write_config16(LPC_DEV, D31F0_LPC_EN, CNF1_LPC_EN | KBC_LPC_EN
+ | FDD_LPC_EN | LPT_LPC_EN | COMB_LPC_EN
+ | COMA_LPC_EN);
+ /* HW EC */
+ pci_write_config32(LPC_DEV, D31F0_GEN1_DEC, 0x00000295);
+ /* TODO: FSB BSEL pins... */
+}
+
+void mainboard_romstage_entry(unsigned long bist)
+{
+ /* This board has first dimm slot of each channel hooked up to
+ rank0 and rank1, while the second dimm slot is only connected
+ to rank1. The raminit does not support such setups
+ const u8 spd_addrmap[4] = { 0x50, 0x51, 0x52, 0x53 }; */
+ const u8 spd_addrmap[4] = { 0x50, 0, 0x52, 0 };
+ u8 boot_path = 0;
+ u8 s3_resume;
+
+ /* Set southbridge and Super I/O GPIOs. */
+ ich10_enable_lpc();
+ mb_gpio_init();
+ winbond_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+
+ console_init();
+
+ report_bist_failure(bist);
+ enable_smbus();
+
+ x4x_early_init();
+
+ s3_resume = southbridge_detect_s3_resume();
+ if (s3_resume)
+ boot_path = BOOT_PATH_RESUME;
+ if (MCHBAR32(PMSTS_MCHBAR) & PMSTS_WARM_RESET)
+ boot_path = BOOT_PATH_WARM_RESET;
+
+ sdram_initialize(boot_path, spd_addrmap);
+
+ x4x_late_init(s3_resume);
+
+ printk(BIOS_DEBUG, "x4x late init complete\n");
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31323
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I88fe9c66dae079cd7eedcc9736c5922defbc0e5a
Gerrit-Change-Number: 31323
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36452 )
Change subject: hatch: Create puff variant
......................................................................
hatch: Create puff variant
Includes:
- gpio mappings,
- overridetree.cb,
- kconfig adjustments for reading spd over smbus.
BUG=b:141658115
TEST=util/abuild/abuild -p none -t google/hatch -x -a
Change-Id: I6449c4fcc1df702ed4f0d35afd7b0981e4c72323
Signed-off-by: Edward O'Callaghan <quasisec(a)chromium.org>
---
M src/mainboard/google/hatch/Kconfig
M src/mainboard/google/hatch/Kconfig.name
A src/mainboard/google/hatch/variants/puff/Makefile.inc
A src/mainboard/google/hatch/variants/puff/gpio.c
A src/mainboard/google/hatch/variants/puff/include/variant/acpi/dptf.asl
A src/mainboard/google/hatch/variants/puff/include/variant/ec.h
A src/mainboard/google/hatch/variants/puff/include/variant/gpio.h
A src/mainboard/google/hatch/variants/puff/overridetree.cb
8 files changed, 270 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/36452/1
diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig
index e339693..8488762 100644
--- a/src/mainboard/google/hatch/Kconfig
+++ b/src/mainboard/google/hatch/Kconfig
@@ -93,6 +93,7 @@
default "Helios" if BOARD_GOOGLE_HELIOS
default "Kindred" if BOARD_GOOGLE_KINDRED
default "Kohaku" if BOARD_GOOGLE_KOHAKU
+ default "Puff" if BOARD_GOOGLE_PUFF
config MAINBOARD_VENDOR
string
@@ -118,6 +119,7 @@
default "helios" if BOARD_GOOGLE_HELIOS
default "kindred" if BOARD_GOOGLE_KINDRED
default "kohaku" if BOARD_GOOGLE_KOHAKU
+ default "puff" if BOARD_GOOGLE_PUFF
config VBOOT
select HAS_RECOVERY_MRC_CACHE
diff --git a/src/mainboard/google/hatch/Kconfig.name b/src/mainboard/google/hatch/Kconfig.name
index 160194b..2051e0f 100644
--- a/src/mainboard/google/hatch/Kconfig.name
+++ b/src/mainboard/google/hatch/Kconfig.name
@@ -32,3 +32,9 @@
select BOARD_ROMSIZE_KB_16384
select CHROMEOS_DSM_CALIB
select DRIVERS_I2C_RT1011
+
+config BOARD_GOOGLE_PUFF
+ bool "-> Puff"
+ select BOARD_GOOGLE_BASEBOARD_HATCH
+ select BOARD_ROMSIZE_KB_32768
+ select ROMSTAGE_SPD_SMBUS
diff --git a/src/mainboard/google/hatch/variants/puff/Makefile.inc b/src/mainboard/google/hatch/variants/puff/Makefile.inc
new file mode 100644
index 0000000..30daaf7
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/puff/Makefile.inc
@@ -0,0 +1,16 @@
+## This file is part of the coreboot project.
+##
+## Copyright 2019 Google LLC
+##
+## 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.
+##
+
+ramstage-y += gpio.c
+bootblock-y += gpio.c
diff --git a/src/mainboard/google/hatch/variants/puff/gpio.c b/src/mainboard/google/hatch/variants/puff/gpio.c
new file mode 100644
index 0000000..baefcf2
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/puff/gpio.c
@@ -0,0 +1,73 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Google LLC
+ *
+ * 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 <arch/acpi.h>
+#include <baseboard/gpio.h>
+#include <baseboard/variants.h>
+#include <commonlib/helpers.h>
+
+/* Pad configuration in ramstage */
+static const struct pad_config gpio_table[] = {
+};
+
+const struct pad_config *override_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(gpio_table);
+ return gpio_table;
+}
+
+/* Early pad configuration in bootblock */
+static const struct pad_config early_gpio_table[] = {
+ /* B14 : GPP_B14_STRAP */
+ PAD_NC(GPP_B14, NONE),
+ /* B22 : GPP_B22_STRAP */
+ PAD_NC(GPP_B22, NONE),
+ /* E19 : GPP_E19_STRAP */
+ PAD_NC(GPP_E19, NONE),
+ /* E21 : GPP_E21_STRAP */
+ PAD_NC(GPP_E21, NONE),
+ /* E23 : TP1 */
+ PAD_NC(GPP_E23, NONE),
+ /* H17 : TP2 */
+ PAD_NC(GPP_H17, NONE),
+ /* B15 : H1_SLAVE_SPI_CS_L */
+ PAD_CFG_NF(GPP_B15, NONE, DEEP, NF1),
+ /* B16 : H1_SLAVE_SPI_CLK */
+ PAD_CFG_NF(GPP_B16, NONE, DEEP, NF1),
+ /* B17 : H1_SLAVE_SPI_MISO_R */
+ PAD_CFG_NF(GPP_B17, NONE, DEEP, NF1),
+ /* B18 : H1_SLAVE_SPI_MOSI_R */
+ PAD_CFG_NF(GPP_B18, NONE, DEEP, NF1),
+ /* C14 : BT_DISABLE_L */
+ PAD_CFG_GPO(GPP_C14, 0, DEEP),
+ /* PCH_WP_OD */
+ PAD_CFG_GPI(GPP_C20, NONE, DEEP),
+ /* C21 : H1_PCH_INT_ODL */
+ PAD_CFG_GPI_APIC(GPP_C21, NONE, PLTRST, LEVEL, INVERT),
+ /* C23 : WLAN_PE_RST# */
+ PAD_CFG_GPO(GPP_C23, 1, DEEP),
+ /* E1 : M2_SSD_PEDET */
+ PAD_CFG_NF(GPP_E1, NONE, DEEP, NF1),
+ /* E5 : SATA_DEVSLP1 */
+ PAD_CFG_NF(GPP_E5, NONE, PLTRST, NF1),
+ /* F2 : MEM_CH_SEL */
+ PAD_CFG_GPI(GPP_F2, NONE, PLTRST),
+};
+
+const struct pad_config *variant_early_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(early_gpio_table);
+ return early_gpio_table;
+}
diff --git a/src/mainboard/google/hatch/variants/puff/include/variant/acpi/dptf.asl b/src/mainboard/google/hatch/variants/puff/include/variant/acpi/dptf.asl
new file mode 100644
index 0000000..496334d
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/puff/include/variant/acpi/dptf.asl
@@ -0,0 +1,14 @@
+/*
+ * 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; 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 <baseboard/acpi/dptf.asl>
diff --git a/src/mainboard/google/hatch/variants/puff/include/variant/ec.h b/src/mainboard/google/hatch/variants/puff/include/variant/ec.h
new file mode 100644
index 0000000..2526962
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/puff/include/variant/ec.h
@@ -0,0 +1,19 @@
+/*
+ * 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; 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.
+ */
+
+#ifndef VARIANT_EC_H
+#define VARIANT_EC_H
+
+#include <baseboard/ec.h>
+
+#endif
diff --git a/src/mainboard/google/hatch/variants/puff/include/variant/gpio.h b/src/mainboard/google/hatch/variants/puff/include/variant/gpio.h
new file mode 100644
index 0000000..d99e2bb
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/puff/include/variant/gpio.h
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Google LLC
+ *
+ * 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.
+ */
+
+#ifndef VARIANT_GPIO_H
+#define VARIANT_GPIO_H
+
+#include <baseboard/gpio.h>
+
+#endif
diff --git a/src/mainboard/google/hatch/variants/puff/overridetree.cb b/src/mainboard/google/hatch/variants/puff/overridetree.cb
new file mode 100644
index 0000000..d82030d
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/puff/overridetree.cb
@@ -0,0 +1,119 @@
+chip soc/intel/cannonlake
+
+ register "SerialIoDevMode" = "{
+ [PchSerialIoIndexI2C0] = PchSerialIoPci,
+ [PchSerialIoIndexI2C1] = PchSerialIoPci,
+ [PchSerialIoIndexI2C2] = PchSerialIoPci,
+ [PchSerialIoIndexI2C3] = PchSerialIoPci,
+ [PchSerialIoIndexI2C4] = PchSerialIoPci,
+ [PchSerialIoIndexI2C5] = PchSerialIoPci,
+ [PchSerialIoIndexSPI0] = PchSerialIoPci,
+ [PchSerialIoIndexSPI1] = PchSerialIoPci,
+ [PchSerialIoIndexSPI2] = PchSerialIoDisabled,
+ [PchSerialIoIndexUART0] = PchSerialIoSkipInit,
+ [PchSerialIoIndexUART1] = PchSerialIoDisabled,
+ [PchSerialIoIndexUART2] = PchSerialIoDisabled,
+ }"
+
+ # VR Slew rate setting
+ register "AcousticNoiseMitigation" = "1"
+ register "SlowSlewRateForIa" = "2"
+ register "SlowSlewRateForGt" = "2"
+ register "SlowSlewRateForSa" = "2"
+ register "FastPkgCRampDisableIa" = "1"
+ register "FastPkgCRampDisableGt" = "1"
+ register "FastPkgCRampDisableSa" = "1"
+
+ # Intel Common SoC Config
+ #+-------------------+---------------------------+
+ #| Field | Value |
+ #+-------------------+---------------------------+
+ #| GSPI0 | cr50 TPM. Early init is |
+ #| | required to set up a BAR |
+ #| | for TPM communication |
+ #| | before memory is up |
+ #| I2C0 | RFU |
+ #| I2C2 | PS175 |
+ #| I2C3 | MST |
+ #| I2C4 | Audio |
+ #+-------------------+---------------------------+
+ register "common_soc_config" = "{
+ .gspi[0] = {
+ .speed_mhz = 1,
+ .early_init = 1,
+ },
+ .i2c[0] = {
+ .speed = I2C_SPEED_FAST,
+ .rise_time_ns = 0,
+ .fall_time_ns = 0,
+ },
+ .i2c[1] = {
+ .speed = I2C_SPEED_FAST,
+ .rise_time_ns = 0,
+ .fall_time_ns = 0,
+ },
+ .i2c[3] = {
+ .speed = I2C_SPEED_FAST,
+ .rise_time_ns = 0,
+ .fall_time_ns = 0,
+ },
+ .i2c[4] = {
+ .speed = I2C_SPEED_FAST,
+ .rise_time_ns = 0,
+ .fall_time_ns = 0,
+ },
+ }"
+
+ # GPIO for SD card detect
+ register "sdcard_cd_gpio" = "vSD3_CD_B"
+
+ device domain 0 on
+ device pci 15.0 off
+ # RFU - Reserved for Future Use.
+ end # I2C #0
+ device pci 15.1 off end # I2C #1
+ device pci 15.2 on
+ chip drivers/i2c/generic
+ register "name" = ""PS175""
+ register "desc" = ""PCON PS175""
+ register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_C10)"
+ register "stop_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_C11)"
+ register "has_power_resource" = "1"
+ device i2c 15 on end # ?????
+ end
+ end # I2C #2
+ device pci 15.3 on
+ chip drivers/i2c/generic
+ register "name" = ""RTD21""
+ register "desc" = ""Realtek RTD2142""
+ device i2c 4a on end # ?????
+ end
+ end # I2C #3
+ device pci 19.0 on
+ chip drivers/i2c/generic
+ register "hid" = ""10EC5682""
+ register "name" = ""RT58""
+ register "desc" = ""Realtek RT5682""
+ register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_H0)"
+ register "property_count" = "1"
+ # Set the jd_src to RT5668_JD1 for jack detection
+ register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER"
+ register "property_list[0].name" = ""realtek,jd-src""
+ register "property_list[0].integer" = "1"
+ device i2c 1a on end
+ end
+ end #I2C #4
+ device pci 1e.3 on
+ chip drivers/spi/acpi
+ register "name" = ""CRFP""
+ register "hid" = "ACPI_DT_NAMESPACE_HID"
+ register "uid" = "1"
+ register "compat_string" = ""google,cros-ec-spi""
+ register "irq" = "ACPI_IRQ_WAKE_LEVEL_LOW(GPP_A23_IRQ)"
+ register "wake" = "GPE0_DW0_23"
+ device spi 1 on end
+ end # FPMCU
+ end # GSPI #1
+ end
+
+end
--
To view, visit https://review.coreboot.org/c/coreboot/+/36452
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6449c4fcc1df702ed4f0d35afd7b0981e4c72323
Gerrit-Change-Number: 36452
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange