coreboot-gerrit
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
October 2023
- 1 participants
- 3355 discussions

Change in coreboot[master]: mb/supermicro: Add X10SLM+-LN4F as X10SLM variant
by Christoph Pomaska (Code Review) June 8, 2024
by Christoph Pomaska (Code Review) June 8, 2024
June 8, 2024
Christoph Pomaska has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35163 )
Change subject: mb/supermicro: Add X10SLM+-LN4F as X10SLM variant
......................................................................
mb/supermicro: Add X10SLM+-LN4F as X10SLM variant
This commit modifies the source tree of the X10SLM-F board to support
building a slightly different variant of the board, the X10SLM-LN4F.
Change-Id: I686d8d4e2ec5b4eb2db214b6e0827ac9c33829d1
Signed-off-by: Christoph Pomaska <c.pomaska(a)hosting.de>
---
D src/mainboard/supermicro/x10slm-f/Kconfig.name
D src/mainboard/supermicro/x10slm-f/board_info.txt
R src/mainboard/supermicro/x10slm/Kconfig
A src/mainboard/supermicro/x10slm/Kconfig.name
R src/mainboard/supermicro/x10slm/Makefile.inc
R src/mainboard/supermicro/x10slm/acpi/ec.asl
R src/mainboard/supermicro/x10slm/acpi/platform.asl
R src/mainboard/supermicro/x10slm/acpi/superio.asl
R src/mainboard/supermicro/x10slm/acpi_tables.c
A src/mainboard/supermicro/x10slm/board_info.txt
R src/mainboard/supermicro/x10slm/bootblock.c
R src/mainboard/supermicro/x10slm/cmos.default
R src/mainboard/supermicro/x10slm/cmos.layout
R src/mainboard/supermicro/x10slm/dsdt.asl
R src/mainboard/supermicro/x10slm/gpio.c
R src/mainboard/supermicro/x10slm/mainboard.c
R src/mainboard/supermicro/x10slm/romstage.c
R src/mainboard/supermicro/x10slm/variants/x10slm-f/devicetree.cb
R src/mainboard/supermicro/x10slm/variants/x10slm-f/hda_verb.c
A src/mainboard/supermicro/x10slm/variants/x10slm-ln4f/devicetree.cb
C src/mainboard/supermicro/x10slm/variants/x10slm-ln4f/hda_verb.c
21 files changed, 238 insertions(+), 78 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/35163/1
diff --git a/src/mainboard/supermicro/x10slm-f/Kconfig.name b/src/mainboard/supermicro/x10slm-f/Kconfig.name
deleted file mode 100644
index a1965a3..0000000
--- a/src/mainboard/supermicro/x10slm-f/Kconfig.name
+++ /dev/null
@@ -1,2 +0,0 @@
-config BOARD_SUPERMICRO_X10SLM_PLUS_F
- bool "X10SLM+-F"
diff --git a/src/mainboard/supermicro/x10slm-f/board_info.txt b/src/mainboard/supermicro/x10slm-f/board_info.txt
deleted file mode 100644
index e558429..0000000
--- a/src/mainboard/supermicro/x10slm-f/board_info.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Category: server
-Board URL: https://www.supermicro.com/products/motherboard/xeon/c220/x10slm_-f.cfm
-ROM package: SOIC-8
-ROM protocol: SPI
-ROM socketed: n
-Flashrom support: y
-Release year: 2013
diff --git a/src/mainboard/supermicro/x10slm-f/Kconfig b/src/mainboard/supermicro/x10slm/Kconfig
similarity index 60%
rename from src/mainboard/supermicro/x10slm-f/Kconfig
rename to src/mainboard/supermicro/x10slm/Kconfig
index 3945c09..99a3099 100644
--- a/src/mainboard/supermicro/x10slm-f/Kconfig
+++ b/src/mainboard/supermicro/x10slm/Kconfig
@@ -2,6 +2,7 @@
## This file is part of the coreboot project.
##
## Copyright (C) 2018 Tristan Corrick <tristan(a)corrick.kiwi>
+## Copyright (C) 2019 Hosting.de GmbH <c.pomaska(a)hosting.de>
##
## 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
@@ -14,13 +15,12 @@
## GNU General Public License for more details.
##
-if BOARD_SUPERMICRO_X10SLM_PLUS_F
+if BOARD_SUPERMICRO_X10SLM_PLUS_F || BOARD_SUPERMICRO_X10SLM_PLUS_LN4F
config BOARD_SPECIFIC_OPTIONS
def_bool y
select BOARD_ROMSIZE_KB_16384
select CPU_INTEL_HASWELL
- select DRIVERS_ASPEED_AST2050 # Supports AST2400 too.
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES
select HAVE_OPTION_TABLE
@@ -30,19 +30,33 @@
select SOUTHBRIDGE_INTEL_LYNXPOINT
select SUPERIO_NUVOTON_NCT6776
select SUPERIO_NUVOTON_NCT6776_COM_A
+ select DRIVERS_ASPEED_AST2050
+ select SUPERIO_ASPEED_AST2400 # The board's BMC
+ select MAINBOARD_HAS_LPC_TPM
+ select MAINBOARD_HAS_TPM2
+
+config MAINBOARD_DIR
+ string
+ default "supermicro/x10slm"
+
+config VARIANT_DIR
+ string
+ default "x10slm-f" if BOARD_SUPERMICRO_X10SLM_PLUS_F
+ default "x10slm-ln4f" if BOARD_SUPERMICRO_X10SLM_PLUS_LN4F
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "X10SLM+-F" if BOARD_SUPERMICRO_X10SLM_PLUS_F
+ default "X10SLM+-LN4F" if BOARD_SUPERMICRO_X10SLM_PLUS_LN4F
+
+config DEVICETREE
+ default "variants/x10slm-f/devicetree.cb" if BOARD_SUPERMICRO_X10SLM_PLUS_F
+ default "variants/x10slm-ln4f/devicetree.cb" if BOARD_SUPERMICRO_X10SLM_PLUS_LN4F
config CBFS_SIZE
hex
default 0xb00000
-config MAINBOARD_DIR
- string
- default "supermicro/x10slm-f"
-
-config MAINBOARD_PART_NUMBER
- string
- default "X10SLM+-F"
-
config MAX_CPUS
int
default 8
diff --git a/src/mainboard/supermicro/x10slm/Kconfig.name b/src/mainboard/supermicro/x10slm/Kconfig.name
new file mode 100644
index 0000000..6f95d97
--- /dev/null
+++ b/src/mainboard/supermicro/x10slm/Kconfig.name
@@ -0,0 +1,4 @@
+config BOARD_SUPERMICRO_X10SLM_PLUS_F
+ bool "X10SLM+-F"
+config BOARD_SUPERMICRO_X10SLM_PLUS_LN4F
+ bool "X10SLM+-LN4F"
diff --git a/src/mainboard/supermicro/x10slm-f/Makefile.inc b/src/mainboard/supermicro/x10slm/Makefile.inc
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/Makefile.inc
rename to src/mainboard/supermicro/x10slm/Makefile.inc
diff --git a/src/mainboard/supermicro/x10slm-f/acpi/ec.asl b/src/mainboard/supermicro/x10slm/acpi/ec.asl
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/acpi/ec.asl
rename to src/mainboard/supermicro/x10slm/acpi/ec.asl
diff --git a/src/mainboard/supermicro/x10slm-f/acpi/platform.asl b/src/mainboard/supermicro/x10slm/acpi/platform.asl
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/acpi/platform.asl
rename to src/mainboard/supermicro/x10slm/acpi/platform.asl
diff --git a/src/mainboard/supermicro/x10slm-f/acpi/superio.asl b/src/mainboard/supermicro/x10slm/acpi/superio.asl
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/acpi/superio.asl
rename to src/mainboard/supermicro/x10slm/acpi/superio.asl
diff --git a/src/mainboard/supermicro/x10slm-f/acpi_tables.c b/src/mainboard/supermicro/x10slm/acpi_tables.c
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/acpi_tables.c
rename to src/mainboard/supermicro/x10slm/acpi_tables.c
diff --git a/src/mainboard/supermicro/x10slm/board_info.txt b/src/mainboard/supermicro/x10slm/board_info.txt
new file mode 100644
index 0000000..741cfa3
--- /dev/null
+++ b/src/mainboard/supermicro/x10slm/board_info.txt
@@ -0,0 +1,9 @@
+Category: server
+Board URLs:
+X10SLM-F: https://www.supermicro.com/products/motherboard/xeon/c220/x10slm_-f.cfm
+X10SLM-LN4F: https://www.supermicro.com/en/products/motherboard/X10SLM+-LN4F
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
+Release year: 2013
diff --git a/src/mainboard/supermicro/x10slm-f/bootblock.c b/src/mainboard/supermicro/x10slm/bootblock.c
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/bootblock.c
rename to src/mainboard/supermicro/x10slm/bootblock.c
diff --git a/src/mainboard/supermicro/x10slm-f/cmos.default b/src/mainboard/supermicro/x10slm/cmos.default
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/cmos.default
rename to src/mainboard/supermicro/x10slm/cmos.default
diff --git a/src/mainboard/supermicro/x10slm-f/cmos.layout b/src/mainboard/supermicro/x10slm/cmos.layout
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/cmos.layout
rename to src/mainboard/supermicro/x10slm/cmos.layout
diff --git a/src/mainboard/supermicro/x10slm-f/dsdt.asl b/src/mainboard/supermicro/x10slm/dsdt.asl
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/dsdt.asl
rename to src/mainboard/supermicro/x10slm/dsdt.asl
diff --git a/src/mainboard/supermicro/x10slm-f/gpio.c b/src/mainboard/supermicro/x10slm/gpio.c
similarity index 86%
rename from src/mainboard/supermicro/x10slm-f/gpio.c
rename to src/mainboard/supermicro/x10slm/gpio.c
index a1668f1..0ecdaca 100644
--- a/src/mainboard/supermicro/x10slm-f/gpio.c
+++ b/src/mainboard/supermicro/x10slm/gpio.c
@@ -87,16 +87,14 @@
.gpio28 = GPIO_LEVEL_HIGH,
};
-static const struct pch_gpio_set1 pch_gpio_set1_reset = {
-};
+static const struct pch_gpio_set1 pch_gpio_set1_reset = {};
static const struct pch_gpio_set1 pch_gpio_set1_invert = {
.gpio3 = GPIO_INVERT,
.gpio14 = GPIO_INVERT,
};
-static const struct pch_gpio_set1 pch_gpio_set1_blink = {
-};
+static const struct pch_gpio_set1 pch_gpio_set1_blink = {};
static const struct pch_gpio_set2 pch_gpio_set2_mode = {
.gpio32 = GPIO_MODE_GPIO,
@@ -156,8 +154,7 @@
.gpio54 = GPIO_LEVEL_HIGH,
};
-static const struct pch_gpio_set2 pch_gpio_set2_reset = {
-};
+static const struct pch_gpio_set2 pch_gpio_set2_reset = {};
static const struct pch_gpio_set3 pch_gpio_set3_mode = {
.gpio64 = GPIO_MODE_GPIO,
@@ -188,28 +185,30 @@
.gpio73 = GPIO_LEVEL_LOW,
};
-static const struct pch_gpio_set3 pch_gpio_set3_reset = {
-};
+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,
- },
+ .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/supermicro/x10slm-f/mainboard.c b/src/mainboard/supermicro/x10slm/mainboard.c
similarity index 96%
rename from src/mainboard/supermicro/x10slm-f/mainboard.c
rename to src/mainboard/supermicro/x10slm/mainboard.c
index 4bd5d15..57b5cec 100644
--- a/src/mainboard/supermicro/x10slm-f/mainboard.c
+++ b/src/mainboard/supermicro/x10slm/mainboard.c
@@ -53,6 +53,5 @@
}
struct chip_operations mainboard_ops = {
- CHIP_NAME("X10SLM+-F")
- .enable_dev = mainboard_enable,
+ CHIP_NAME("X10SLM+-F").enable_dev = mainboard_enable,
};
diff --git a/src/mainboard/supermicro/x10slm-f/romstage.c b/src/mainboard/supermicro/x10slm/romstage.c
similarity index 70%
rename from src/mainboard/supermicro/x10slm-f/romstage.c
rename to src/mainboard/supermicro/x10slm/romstage.c
index 552ebd2..0ff9b69 100644
--- a/src/mainboard/supermicro/x10slm-f/romstage.c
+++ b/src/mainboard/supermicro/x10slm/romstage.c
@@ -16,7 +16,7 @@
*/
#include <cpu/intel/haswell/haswell.h>
-#include <arch/romstage.h>
+#include <cpu/intel/romstage.h>
#include <northbridge/intel/haswell/haswell.h>
#include <northbridge/intel/haswell/pei_data.h>
#include <southbridge/intel/common/gpio.h>
@@ -38,7 +38,7 @@
RCBA_END_CONFIG,
};
-void mainboard_romstage_entry(void)
+void mainboard_romstage_entry(unsigned long bist)
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
@@ -56,42 +56,45 @@
.temp_mmio_base = 0xfed08000,
.system_type = 1, /* desktop/server */
.tseg_size = CONFIG_SMM_TSEG_SIZE,
- .spd_addresses = { 0xa0, 0xa2, 0xa4, 0xa6 },
+ .spd_addresses = {0xa0, 0xa2, 0xa4, 0xa6},
.ec_present = 0,
.ddr_refresh_2x = 1,
.max_ddr3_freq = 1600,
- .usb2_ports = {
- /* Length, Enable, OCn#, Location */
- { 0x0040, 1, 0, USB_PORT_INTERNAL },
- { 0x0040, 1, 0, USB_PORT_BACK_PANEL },
- { 0x0110, 1, 1, USB_PORT_BACK_PANEL },
- { 0x0110, 1, 1, USB_PORT_BACK_PANEL },
- { 0x0110, 1, 2, USB_PORT_BACK_PANEL },
- { 0x0110, 1, 2, USB_PORT_BACK_PANEL },
- { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
- { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
- { 0x0040, 1, 4, USB_PORT_BACK_PANEL },
- { 0x0040, 1, 4, USB_PORT_BACK_PANEL },
- { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
- { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
- { 0x0040, 1, 6, USB_PORT_BACK_PANEL },
- { 0x0040, 1, 6, USB_PORT_BACK_PANEL },
- },
- .usb3_ports = {
- /* Enable, OCn# */
- { 1, 1 },
- { 1, 1 },
- { 0, USB_OC_PIN_SKIP },
- { 0, USB_OC_PIN_SKIP },
- { 1, 3 },
- { 1, 3 },
- },
+ .usb2_ports =
+ {
+ /* Length, Enable, OCn#, Location */
+ {0x0040, 1, 0, USB_PORT_INTERNAL},
+ {0x0040, 1, 0, USB_PORT_BACK_PANEL},
+ {0x0110, 1, 1, USB_PORT_BACK_PANEL},
+ {0x0110, 1, 1, USB_PORT_BACK_PANEL},
+ {0x0110, 1, 2, USB_PORT_BACK_PANEL},
+ {0x0110, 1, 2, USB_PORT_BACK_PANEL},
+ {0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP},
+ {0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP},
+ {0x0040, 1, 4, USB_PORT_BACK_PANEL},
+ {0x0040, 1, 4, USB_PORT_BACK_PANEL},
+ {0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP},
+ {0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP},
+ {0x0040, 1, 6, USB_PORT_BACK_PANEL},
+ {0x0040, 1, 6, USB_PORT_BACK_PANEL},
+ },
+ .usb3_ports =
+ {
+ /* Enable, OCn# */
+ {1, 1},
+ {1, 1},
+ {0, USB_OC_PIN_SKIP},
+ {0, USB_OC_PIN_SKIP},
+ {1, 3},
+ {1, 3},
+ },
};
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/supermicro/x10slm-f/devicetree.cb b/src/mainboard/supermicro/x10slm/variants/x10slm-f/devicetree.cb
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/devicetree.cb
rename to src/mainboard/supermicro/x10slm/variants/x10slm-f/devicetree.cb
diff --git a/src/mainboard/supermicro/x10slm-f/hda_verb.c b/src/mainboard/supermicro/x10slm/variants/x10slm-f/hda_verb.c
similarity index 100%
rename from src/mainboard/supermicro/x10slm-f/hda_verb.c
rename to src/mainboard/supermicro/x10slm/variants/x10slm-f/hda_verb.c
diff --git a/src/mainboard/supermicro/x10slm/variants/x10slm-ln4f/devicetree.cb b/src/mainboard/supermicro/x10slm/variants/x10slm-ln4f/devicetree.cb
new file mode 100644
index 0000000..5dce6b0
--- /dev/null
+++ b/src/mainboard/supermicro/x10slm/variants/x10slm-ln4f/devicetree.cb
@@ -0,0 +1,141 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2018 Tristan Corrick <tristan(a)corrick.kiwi>
+##
+## 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/haswell
+
+ device cpu_cluster 0 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 0 on end
+ device lapic 0xacac off end
+ end
+ end
+
+ device domain 0 on
+ subsystemid 0x15d9 0x0803 inherit
+
+ device pci 00.0 on end # Host bridge
+ device pci 01.0 on end # PEG 10
+ device pci 01.1 on end # PEG 11
+ device pci 02.0 off end # IGD
+ device pci 03.0 off end # Mini-HD audio
+
+ chip southbridge/intel/lynxpoint
+ register "pirqa_routing" = "0x8b"
+ register "pirqb_routing" = "0x8a"
+ register "pirqc_routing" = "0x8b"
+ register "pirqd_routing" = "0x8a"
+ register "pirqe_routing" = "0x80"
+ register "pirqf_routing" = "0x80"
+ register "pirqg_routing" = "0x80"
+ register "pirqh_routing" = "0x85"
+
+ register "sata_ahci" = "1"
+ register "sata_port_map" = "0x3f"
+
+ register "gen1_dec" = "0x00000295" # Super I/O HWM
+
+ device pci 14.0 on end # xHCI controller
+ device pci 16.0 on end # Management Engine interface 1
+ device pci 16.1 on 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 off end # Intel Gigabit Ethernet
+ device pci 1a.0 on end # EHCI controller 2
+ device pci 1b.0 off end # HD audio controller
+ device pci 1c.0 on # PCIe root port 1
+ device pci 00.0 on # ASPEED PCI-to-PCI bridge
+ device pci 00.0 on end # VGA controller
+ end
+ end
+ device pci 1c.1 off end # PCIe root port 2
+ device pci 1c.2 on # PCIe root port 3
+ device pci 00.0 on # Intel I210 Gigabit Ethernet
+ subsystemid 0x15d9 0x1533
+ end
+ end
+ device pci 1c.3 on # PCIe root port 4
+ device pci 00.0 on # Intel I210 Gigabit Ethernet
+ subsystemid 0x15d9 0x1533
+ end
+ end
+ device pci 1c.4 on end # PCIe root port 5
+ device pci 1c.5 off end # PCIe root port 6
+ device pci 1c.6 on # PCIe root port 7
+ device pci 00.0 on # Intel I210 Gigabit Ethernet
+ subsystemid 0x15d9 0x1533
+ end
+ end
+ device pci 1c.7 on # PCIe root port 8
+ device pci 00.0 on # Intel I210 Gigabit Ethernet
+ subsystemid 0x15d9 0x1533
+ end
+ end
+ device pci 1d.0 on end # EHCI controller 1
+ device pci 1f.0 on # LPC bridge
+ chip superio/nuvoton/nct6776
+ device pnp 2e.0 off end # Floppy
+ device pnp 2e.1 off end # Parallel
+ device pnp 2e.2 on # UART A
+ io 0x60 = 0x03f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.3 on # UART B
+ io 0x60 = 0x02f8
+ irq 0x70 = 3
+ end
+ device pnp 2e.5 off end # PS/2 KBC
+ device pnp 2e.6 off end # CIR
+ device pnp 2e.7 off end # GPIO8
+ device pnp 2e.107 off end # GPIO9
+ device pnp 2e.8 off end # WDT
+ device pnp 2e.108 off end # GPIO0
+ device pnp 2e.208 off end # GPIOA
+ device pnp 2e.308 off end # GPIO base
+ device pnp 2e.109 off end # GPIO1
+ device pnp 2e.209 off end # GPIO2
+ device pnp 2e.309 off end # GPIO3
+ device pnp 2e.409 off end # GPIO4
+ device pnp 2e.509 off end # GPIO5
+ device pnp 2e.609 off end # GPIO6
+ device pnp 2e.709 off end # GPIO7
+ device pnp 2e.a off end # ACPI
+ device pnp 2e.b on # HWM, LED
+ io 0x60 = 0x0290
+ io 0x62 = 0
+ irq 0x70 = 0
+ end
+ device pnp 2e.d off end # VID
+ device pnp 2e.e off end # CIR wake-up
+ device pnp 2e.f off end # GPIO PP/OD
+ device pnp 2e.14 off end # SVID
+ device pnp 2e.16 off end # Deep sleep
+ device pnp 2e.17 off end # GPIOA
+ 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 on end # PCH thermal sensor
+ end
+ end
+end
diff --git a/src/mainboard/supermicro/x10slm-f/hda_verb.c b/src/mainboard/supermicro/x10slm/variants/x10slm-ln4f/hda_verb.c
similarity index 100%
copy from src/mainboard/supermicro/x10slm-f/hda_verb.c
copy to src/mainboard/supermicro/x10slm/variants/x10slm-ln4f/hda_verb.c
--
To view, visit https://review.coreboot.org/c/coreboot/+/35163
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I686d8d4e2ec5b4eb2db214b6e0827ac9c33829d1
Gerrit-Change-Number: 35163
Gerrit-PatchSet: 1
Gerrit-Owner: Christoph Pomaska <github(a)aufmachen.jetzt>
Gerrit-MessageType: newchange
6
17

Change in ...coreboot[master]: mainboard/samsung/350v5c: add initial board files
by Kacper Słomiński (Code Review) June 8, 2024
by Kacper Słomiński (Code Review) June 8, 2024
June 8, 2024
Kacper Słomiński has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30942
Change subject: mainboard/samsung/350v5c: add initial board files
......................................................................
mainboard/samsung/350v5c: add initial board files
Signed-off-by: Kacper Słomiński <kacper.slominski72(a)gmail.com>
Change-Id: I64fcf931938fb3b158b9576b787f452bf6077843
---
A src/mainboard/samsung/350v5c/Kconfig
A src/mainboard/samsung/350v5c/Kconfig.name
A src/mainboard/samsung/350v5c/Makefile.inc
A src/mainboard/samsung/350v5c/acpi/ec.asl
A src/mainboard/samsung/350v5c/acpi/platform.asl
A src/mainboard/samsung/350v5c/acpi/superio.asl
A src/mainboard/samsung/350v5c/acpi_tables.c
A src/mainboard/samsung/350v5c/board_info.txt
A src/mainboard/samsung/350v5c/devicetree.cb
A src/mainboard/samsung/350v5c/dsdt.asl
A src/mainboard/samsung/350v5c/gnvs.c
A src/mainboard/samsung/350v5c/gpio.c
A src/mainboard/samsung/350v5c/hda_verb.c
A src/mainboard/samsung/350v5c/mainboard.c
A src/mainboard/samsung/350v5c/romstage.c
15 files changed, 705 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/30942/1
diff --git a/src/mainboard/samsung/350v5c/Kconfig b/src/mainboard/samsung/350v5c/Kconfig
new file mode 100644
index 0000000..5ec7139
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/Kconfig
@@ -0,0 +1,53 @@
+if BOARD_SAMSUNG_350V5C
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_6144
+ select CPU_INTEL_SOCKET_RPGA989
+ select EC_ACPI
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select INTEL_INT15
+ select NORTHBRIDGE_INTEL_IVYBRIDGE
+ select SANDYBRIDGE_IVYBRIDGE_LVDS
+ select SERIRQ_CONTINUOUS_MODE
+ select SOUTHBRIDGE_INTEL_C216
+ select SYSTEM_TYPE_LAPTOP
+ select USE_NATIVE_RAMINIT
+
+config MAINBOARD_DIR
+ string
+ default samsung/350v5c
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "350V5C"
+
+config VGA_BIOS_FILE
+ string
+ default "pci8086,0166.rom"
+
+config VGA_BIOS_ID
+ string
+ default "8086,0166"
+
+config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID
+ hex
+ default 0xc0d8
+
+config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID
+ hex
+ default 0x144d
+
+config DRAM_RESET_GATE_GPIO # FIXME: check this
+ int
+ default 60
+
+config MAX_CPUS
+ int
+ default 8
+
+config USBDEBUG_HCD_INDEX # FIXME: check this
+ int
+ default 2
+endif
diff --git a/src/mainboard/samsung/350v5c/Kconfig.name b/src/mainboard/samsung/350v5c/Kconfig.name
new file mode 100644
index 0000000..9a2e96a
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_SAMSUNG_350V5C
+ bool "350V5C"
diff --git a/src/mainboard/samsung/350v5c/Makefile.inc b/src/mainboard/samsung/350v5c/Makefile.inc
new file mode 100644
index 0000000..c55eebe
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/Makefile.inc
@@ -0,0 +1,2 @@
+romstage-y += gpio.c
+ramstage-y += gnvs.c
diff --git a/src/mainboard/samsung/350v5c/acpi/ec.asl b/src/mainboard/samsung/350v5c/acpi/ec.asl
new file mode 100644
index 0000000..f2f4269
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/acpi/ec.asl
@@ -0,0 +1,7 @@
+Device(EC)
+{
+ Name (_HID, EISAID("PNP0C09"))
+ Name (_UID, 0)
+ Name (_GPE, 23)
+/* FIXME: EC support */
+}
diff --git a/src/mainboard/samsung/350v5c/acpi/platform.asl b/src/mainboard/samsung/350v5c/acpi/platform.asl
new file mode 100644
index 0000000..c2862c9
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/acpi/platform.asl
@@ -0,0 +1,10 @@
+Method(_WAK,1)
+{
+ /* FIXME: EC support */
+ Return(Package(){0,0})
+}
+
+Method(_PTS,1)
+{
+ /* FIXME: EC support */
+}
diff --git a/src/mainboard/samsung/350v5c/acpi/superio.asl b/src/mainboard/samsung/350v5c/acpi/superio.asl
new file mode 100644
index 0000000..f2b35ba
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/acpi/superio.asl
@@ -0,0 +1 @@
+#include <drivers/pc80/pc/ps2_controller.asl>
diff --git a/src/mainboard/samsung/350v5c/acpi_tables.c b/src/mainboard/samsung/350v5c/acpi_tables.c
new file mode 100644
index 0000000..2997587
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/acpi_tables.c
@@ -0,0 +1 @@
+/* dummy */
diff --git a/src/mainboard/samsung/350v5c/board_info.txt b/src/mainboard/samsung/350v5c/board_info.txt
new file mode 100644
index 0000000..cdbf8b8
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/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/samsung/350v5c/devicetree.cb b/src/mainboard/samsung/350v5c/devicetree.cb
new file mode 100644
index 0000000..91093c0
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/devicetree.cb
@@ -0,0 +1,119 @@
+chip northbridge/intel/sandybridge # FIXME: check gfx.ndid and gfx.did
+ register "gfx.did" = "{ 0x80000100, 0x80000240, 0x80000410, 0x80000410, 0x00000005 }"
+ register "gfx.link_frequency_270_mhz" = "0"
+ register "gfx.ndid" = "3"
+ register "gfx.use_spread_spectrum_clock" = "0"
+ register "gpu_cpu_backlight" = "0x00000000"
+ register "gpu_dp_b_hotplug" = "0"
+ register "gpu_dp_c_hotplug" = "0"
+ register "gpu_dp_d_hotplug" = "0"
+ register "gpu_panel_port_select" = "0"
+ register "gpu_panel_power_backlight_off_delay" = "0"
+ register "gpu_panel_power_backlight_on_delay" = "0"
+ register "gpu_panel_power_cycle_delay" = "0"
+ register "gpu_panel_power_down_delay" = "0"
+ register "gpu_panel_power_up_delay" = "0"
+ register "gpu_pch_backlight" = "0x00000000"
+ device cpu_cluster 0x0 on
+ chip cpu/intel/socket_rPGA989
+ device lapic 0x0 on
+ end
+ end
+ chip cpu/intel/model_206ax # FIXME: check all registers
+ 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 0xacac off
+ end
+ end
+ end
+ device domain 0x0 on
+ chip southbridge/intel/bd82x6x # Intel Series 6 Cougar Point PCH
+ register "c2_latency" = "0x0065"
+ register "docking_supported" = "1"
+ register "gen1_dec" = "0x00040069"
+ register "gen2_dec" = "0x0004fd61"
+ register "gen3_dec" = "0x00000000"
+ register "gen4_dec" = "0x00000000"
+ register "gpi7_routing" = "2"
+ register "p_cnt_throttling_supported" = "0"
+ register "pcie_hotplug_map" = "{ 0, 0, 0, 0, 0, 0, 0, 0 }"
+ register "pcie_port_coalesce" = "1"
+ register "sata_interface_speed_support" = "0x3"
+ register "sata_port_map" = "0x11"
+ register "spi_lvscc" = "0x2005"
+ register "spi_uvscc" = "0x2005"
+ register "superspeed_capable_ports" = "0x0000000f"
+ register "xhci_overcurrent_mapping" = "0x00000c03"
+ register "xhci_switchable_ports" = "0x0000000f"
+ device pci 14.0 on # USB 3.0 Controller
+ subsystemid 0x144d 0xc0d8
+ end
+ device pci 16.0 on # Management Engine Interface 1
+ subsystemid 0x144d 0xc0d8
+ 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 off # Intel Gigabit Ethernet
+ end
+ device pci 1a.0 on # USB2 EHCI #2
+ subsystemid 0x144d 0xc0d8
+ end
+ device pci 1b.0 on # High Definition Audio Audio controller
+ subsystemid 0x144d 0xc0d8
+ end
+ device pci 1c.0 on # PCIe Port #1
+ subsystemid 0x144d 0xc0d8
+ end
+ device pci 1c.1 on # PCIe Port #2
+ subsystemid 0x144d 0xc0d8
+ 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 0x144d 0xc0d8
+ end
+ device pci 1e.0 off # PCI bridge
+ end
+ device pci 1f.0 on # LPC bridge PCI-LPC bridge
+ subsystemid 0x144d 0xc0d8
+ end
+ device pci 1f.2 on # SATA Controller 1
+ subsystemid 0x144d 0xc0d8
+ end
+ device pci 1f.3 on # SMBus
+ subsystemid 0x144d 0xc0d8
+ 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 0x144d 0xc0d8
+ end
+ device pci 01.0 on # PCIe Bridge for discrete graphics
+ subsystemid 0x144d 0xc0d8
+ end
+ device pci 02.0 on # Internal graphics VGA controller
+ subsystemid 0x144d 0xc0d8
+ end
+ end
+end
diff --git a/src/mainboard/samsung/350v5c/dsdt.asl b/src/mainboard/samsung/350v5c/dsdt.asl
new file mode 100644
index 0000000..fb55547
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/dsdt.asl
@@ -0,0 +1,30 @@
+#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
+#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
+#define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
+#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/model_206ax/acpi/cpu.asl>
+ #include <southbridge/intel/bd82x6x/acpi/platform.asl>
+ /* global NVS and variables. */
+ #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
+ #include <southbridge/intel/bd82x6x/acpi/sleepstates.asl>
+
+ Scope (\_SB) {
+ Device (PCI0)
+ {
+ #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
+ #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
+ #include <southbridge/intel/bd82x6x/acpi/pch.asl>
+ }
+ }
+}
diff --git a/src/mainboard/samsung/350v5c/gnvs.c b/src/mainboard/samsung/350v5c/gnvs.c
new file mode 100644
index 0000000..6b731cc
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/gnvs.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/bd82x6x/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/samsung/350v5c/gpio.c b/src/mainboard/samsung/350v5c/gpio.c
new file mode 100644
index 0000000..6bf860f
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/gpio.c
@@ -0,0 +1,232 @@
+/*
+ * 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_NATIVE,
+ .gpio11 = GPIO_MODE_GPIO,
+ .gpio12 = GPIO_MODE_GPIO,
+ .gpio13 = GPIO_MODE_NATIVE,
+ .gpio14 = GPIO_MODE_GPIO,
+ .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_NATIVE,
+ .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_GPIO,
+ .gpio30 = GPIO_MODE_NATIVE,
+ .gpio31 = GPIO_MODE_NATIVE,
+};
+
+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_INPUT,
+ .gpio4 = GPIO_DIR_OUTPUT,
+ .gpio5 = GPIO_DIR_INPUT,
+ .gpio6 = GPIO_DIR_INPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_INPUT,
+ .gpio11 = GPIO_DIR_INPUT,
+ .gpio12 = GPIO_DIR_OUTPUT,
+ .gpio14 = GPIO_DIR_INPUT,
+ .gpio15 = GPIO_DIR_INPUT,
+ .gpio17 = GPIO_DIR_INPUT,
+ .gpio22 = GPIO_DIR_INPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio27 = GPIO_DIR_OUTPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+ .gpio29 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio4 = GPIO_LEVEL_LOW,
+ .gpio12 = GPIO_LEVEL_HIGH,
+ .gpio24 = GPIO_LEVEL_LOW,
+ .gpio27 = GPIO_LEVEL_LOW,
+ .gpio28 = GPIO_LEVEL_LOW,
+ .gpio29 = GPIO_LEVEL_HIGH,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_reset = {
+ .gpio24 = GPIO_RESET_RSMRST,
+ .gpio30 = GPIO_RESET_RSMRST,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_invert = {
+ .gpio1 = GPIO_INVERT,
+ .gpio3 = GPIO_INVERT,
+ .gpio7 = GPIO_INVERT,
+ .gpio8 = GPIO_INVERT,
+ .gpio15 = 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_NATIVE,
+ .gpio34 = GPIO_MODE_GPIO,
+ .gpio35 = GPIO_MODE_GPIO,
+ .gpio36 = GPIO_MODE_NATIVE,
+ .gpio37 = GPIO_MODE_GPIO,
+ .gpio38 = GPIO_MODE_GPIO,
+ .gpio39 = GPIO_MODE_GPIO,
+ .gpio40 = GPIO_MODE_NATIVE,
+ .gpio41 = GPIO_MODE_NATIVE,
+ .gpio42 = GPIO_MODE_GPIO,
+ .gpio43 = GPIO_MODE_NATIVE,
+ .gpio44 = GPIO_MODE_NATIVE,
+ .gpio45 = GPIO_MODE_GPIO,
+ .gpio46 = GPIO_MODE_GPIO,
+ .gpio47 = GPIO_MODE_NATIVE,
+ .gpio48 = GPIO_MODE_GPIO,
+ .gpio49 = GPIO_MODE_GPIO,
+ .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_GPIO,
+ .gpio57 = GPIO_MODE_GPIO,
+ .gpio58 = GPIO_MODE_NATIVE,
+ .gpio59 = GPIO_MODE_NATIVE,
+ .gpio60 = GPIO_MODE_GPIO,
+ .gpio61 = GPIO_MODE_GPIO,
+ .gpio62 = GPIO_MODE_NATIVE,
+ .gpio63 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_direction = {
+ .gpio34 = GPIO_DIR_OUTPUT,
+ .gpio35 = GPIO_DIR_OUTPUT,
+ .gpio37 = GPIO_DIR_OUTPUT,
+ .gpio38 = GPIO_DIR_INPUT,
+ .gpio39 = GPIO_DIR_INPUT,
+ .gpio42 = GPIO_DIR_OUTPUT,
+ .gpio45 = GPIO_DIR_INPUT,
+ .gpio46 = GPIO_DIR_INPUT,
+ .gpio48 = GPIO_DIR_INPUT,
+ .gpio49 = GPIO_DIR_OUTPUT,
+ .gpio50 = GPIO_DIR_OUTPUT,
+ .gpio51 = GPIO_DIR_OUTPUT,
+ .gpio52 = GPIO_DIR_OUTPUT,
+ .gpio53 = GPIO_DIR_OUTPUT,
+ .gpio54 = GPIO_DIR_OUTPUT,
+ .gpio55 = GPIO_DIR_OUTPUT,
+ .gpio56 = GPIO_DIR_INPUT,
+ .gpio57 = GPIO_DIR_INPUT,
+ .gpio60 = GPIO_DIR_OUTPUT,
+ .gpio61 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio34 = GPIO_LEVEL_LOW,
+ .gpio35 = GPIO_LEVEL_HIGH,
+ .gpio37 = GPIO_LEVEL_LOW,
+ .gpio42 = GPIO_LEVEL_LOW,
+ .gpio49 = GPIO_LEVEL_LOW,
+ .gpio50 = GPIO_LEVEL_HIGH,
+ .gpio51 = GPIO_LEVEL_HIGH,
+ .gpio52 = GPIO_LEVEL_HIGH,
+ .gpio53 = GPIO_LEVEL_HIGH,
+ .gpio54 = GPIO_LEVEL_HIGH,
+ .gpio55 = GPIO_LEVEL_HIGH,
+ .gpio60 = GPIO_LEVEL_HIGH,
+ .gpio61 = 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_NATIVE,
+ .gpio65 = GPIO_MODE_NATIVE,
+ .gpio66 = GPIO_MODE_GPIO,
+ .gpio67 = GPIO_MODE_GPIO,
+ .gpio68 = GPIO_MODE_GPIO,
+ .gpio69 = GPIO_MODE_GPIO,
+ .gpio70 = GPIO_MODE_NATIVE,
+ .gpio71 = GPIO_MODE_NATIVE,
+ .gpio72 = GPIO_MODE_NATIVE,
+ .gpio73 = GPIO_MODE_NATIVE,
+ .gpio74 = GPIO_MODE_GPIO,
+ .gpio75 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_direction = {
+ .gpio66 = GPIO_DIR_OUTPUT,
+ .gpio67 = GPIO_DIR_INPUT,
+ .gpio68 = GPIO_DIR_OUTPUT,
+ .gpio69 = GPIO_DIR_INPUT,
+ .gpio74 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_level = {
+ .gpio66 = GPIO_LEVEL_LOW,
+ .gpio68 = GPIO_LEVEL_LOW,
+ .gpio74 = GPIO_LEVEL_HIGH,
+};
+
+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/samsung/350v5c/hda_verb.c b/src/mainboard/samsung/350v5c/hda_verb.c
new file mode 100644
index 0000000..d05fc02
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/hda_verb.c
@@ -0,0 +1,76 @@
+/*
+ * 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[] = {
+ 0x10ec0269, /* Codec Vendor / Device ID: Realtek */
+ 0x144dc0d8, /* Subsystem ID */
+
+ 0x0000000b, /* Number of 4 dword sets */
+ /* NID 0x01: Subsystem ID. */
+ AZALIA_SUBVENDOR(0x0, 0x144dc0d8),
+
+ /* NID 0x12. */
+ AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0),
+
+ /* NID 0x14. */
+ AZALIA_PIN_CFG(0x0, 0x14, 0x90170110),
+
+ /* NID 0x15. */
+ AZALIA_PIN_CFG(0x0, 0x15, 0x0421101f),
+
+ /* NID 0x17. */
+ AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0),
+
+ /* NID 0x18. */
+ AZALIA_PIN_CFG(0x0, 0x18, 0x04a11820),
+
+ /* NID 0x19. */
+ AZALIA_PIN_CFG(0x0, 0x19, 0x90a7092f),
+
+ /* NID 0x1a. */
+ AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0),
+
+ /* NID 0x1b. */
+ AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0),
+
+ /* NID 0x1d. */
+ AZALIA_PIN_CFG(0x0, 0x1d, 0x4005822d),
+
+ /* NID 0x1e. */
+ AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0),
+ 0x80862806, /* Codec Vendor / Device ID: Intel */
+ 0x144dc0d8, /* Subsystem ID */
+
+ 0x00000004, /* Number of 4 dword sets */
+ /* NID 0x01: Subsystem ID. */
+ AZALIA_SUBVENDOR(0x3, 0x144dc0d8),
+
+ /* NID 0x05. */
+ AZALIA_PIN_CFG(0x3, 0x05, 0x18560010),
+
+ /* NID 0x06. */
+ AZALIA_PIN_CFG(0x3, 0x06, 0x58560020),
+
+ /* NID 0x07. */
+ AZALIA_PIN_CFG(0x3, 0x07, 0x58560030),
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/samsung/350v5c/mainboard.c b/src/mainboard/samsung/350v5c/mainboard.c
new file mode 100644
index 0000000..44f4fa4
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/mainboard.c
@@ -0,0 +1,50 @@
+#include <device/device.h>
+#include <drivers/intel/gma/int15.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+#include <ec/acpi/ec.h>
+#include <console/console.h>
+#include <pc80/keyboard.h>
+
+static void mainboard_init(struct device *dev)
+{
+ /* FIXME: trim this down or remove if necessary */
+ {
+ int i;
+ const u8 dmp[256] = {
+ /* 00 */ 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 10 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 20 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 30 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 40 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 50 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 60 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 70 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 80 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 90 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* a0 */ 0x00, 0x04, 0x00, 0x84, 0xc1, 0x00, 0x00, 0x61, 0x64, 0x00, 0x00, 0x08, 0x64, 0x19, 0x00, 0xd8,
+ /* b0 */ 0x00, 0x00, 0xff, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x4b, 0x00, 0x00,
+ /* c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* f0 */ 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+
+ printk(BIOS_DEBUG, "Replaying EC dump ...");
+ for (i = 0; i < 256; i++)
+ ec_write (i, dmp[i]);
+ printk(BIOS_DEBUG, "done\n");
+ }
+ pc_keyboard_init(NO_AUX_DEVICE);
+}
+
+static void mainboard_enable(struct device *dev)
+{
+ dev->ops->init = mainboard_init;
+
+ /* FIXME: fix those values*/
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
+}
+
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
diff --git a/src/mainboard/samsung/350v5c/romstage.c b/src/mainboard/samsung/350v5c/romstage.c
new file mode 100644
index 0000000..860b045
--- /dev/null
+++ b/src/mainboard/samsung/350v5c/romstage.c
@@ -0,0 +1,82 @@
+/*
+ * 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 <string.h>
+#include <lib.h>
+#include <timestamp.h>
+#include <arch/byteorder.h>
+#include <arch/io.h>
+#include <device/pci_def.h>
+#include <device/pnp_def.h>
+#include <cpu/x86/lapic.h>
+#include <arch/acpi.h>
+#include <console/console.h>
+#include "northbridge/intel/sandybridge/sandybridge.h"
+#include "northbridge/intel/sandybridge/raminit_native.h"
+#include "southbridge/intel/bd82x6x/pch.h"
+#include <southbridge/intel/common/gpio.h>
+#include <arch/cpu.h>
+#include <cpu/x86/msr.h>
+
+void pch_enable_lpc(void)
+{
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x3c00);
+ pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x84, 0x00040069);
+ pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x88, 0x0004fd61);
+ pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x8c, 0x00000000);
+ pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x90, 0x00000000);
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0000);
+}
+
+void mainboard_rcba_config(void)
+{
+}
+
+const struct southbridge_usb_port mainboard_usb_ports[] = {
+ { 1, 1, 0 },
+ { 1, 1, 0 },
+ { 1, 1, 1 },
+ { 1, 1, 1 },
+ { 0, 0, 2 },
+ { 0, 0, 2 },
+ { 0, 0, 3 },
+ { 0, 0, 3 },
+ { 1, 1, 4 },
+ { 1, 1, 4 },
+ { 0, 0, 5 },
+ { 1, 0, 5 },
+ { 0, 0, 6 },
+ { 0, 0, 6 },
+};
+
+void mainboard_early_init(int s3resume)
+{
+}
+
+void mainboard_config_superio(void)
+{
+}
+
+/* FIXME: Put proper SPD map here. */
+void mainboard_get_spd(spd_raw_data *spd, bool id_only)
+{
+ read_spd(&spd[0], 0x50, id_only);
+ read_spd(&spd[1], 0x51, id_only);
+ read_spd(&spd[2], 0x52, id_only);
+ read_spd(&spd[3], 0x53, id_only);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/30942
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I64fcf931938fb3b158b9576b787f452bf6077843
Gerrit-Change-Number: 30942
Gerrit-PatchSet: 1
Gerrit-Owner: Kacper Słomiński <kacper.slominski72(a)gmail.com>
Gerrit-MessageType: newchange
6
25

June 8, 2024
James has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31363
Change subject: mb/gigabyte: add GA-P67A-UD3R
......................................................................
mb/gigabyte: add GA-P67A-UD3R
This is a Intel P67 chipset motherboard for Sandy Bridge processors.
The P67 chipset has no graphics support.
This board has redundant 4MB SOIC-8 flash chips, and flashrom is usable with the
vendor BIOS.
This is an original P67 chipset, and is affected by a SATA 2 hardware bug.
There is a variant P67A-UD3R-B3 that is unaffected.
The function of PCIe ports PCIEX4 and PCIEX1_* are configured in PCHSTRP9.
By default, PCIEX4 is configured for 4 lanes and PCIEX1_* are disabled.
This can be switched to 1 lane for all ports.
Tested and working:
- Intel Core i7 2600
- 4 DIMMs (4x4GB DDR3)
- Booting Linux (SeaBIOS)
- Native RAM init
- PCIe graphics
- Onboard Ethernet
- Sensors (SuperIO)
- S3 sleep
- S4 hibernate
- SATA 3
- USB 2.0
- USB 3.0
- Onboard audio (speakers, headphones)
- CMOS
- EHCI debug port
- Serial port
Not tested:
- SATA 2
- PS/2 keyboard/mouse
- Digital audio
Change-Id: I4fbf50376be3184bf01a3bc8aae09bce54676707
Signed-off-by: James Ye <jye836(a)gmail.com>
---
A src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig
A src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig.name
A src/mainboard/gigabyte/ga-p67a-ud3r/Makefile.inc
A src/mainboard/gigabyte/ga-p67a-ud3r/acpi/ec.asl
A src/mainboard/gigabyte/ga-p67a-ud3r/acpi/mainboard.asl
A src/mainboard/gigabyte/ga-p67a-ud3r/acpi/platform.asl
A src/mainboard/gigabyte/ga-p67a-ud3r/acpi/superio.asl
A src/mainboard/gigabyte/ga-p67a-ud3r/acpi_tables.c
A src/mainboard/gigabyte/ga-p67a-ud3r/board_info.txt
A src/mainboard/gigabyte/ga-p67a-ud3r/cmos.default
A src/mainboard/gigabyte/ga-p67a-ud3r/cmos.layout
A src/mainboard/gigabyte/ga-p67a-ud3r/devicetree.cb
A src/mainboard/gigabyte/ga-p67a-ud3r/dsdt.asl
A src/mainboard/gigabyte/ga-p67a-ud3r/gpio.c
A src/mainboard/gigabyte/ga-p67a-ud3r/hda_verb.c
A src/mainboard/gigabyte/ga-p67a-ud3r/romstage.c
16 files changed, 781 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/31363/1
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig b/src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig
new file mode 100644
index 0000000..c1efe12
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig
@@ -0,0 +1,40 @@
+if BOARD_GIGABYTE_GA_P67A_UD3R
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_4096
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select HAVE_OPTION_TABLE
+ select HAVE_CMOS_DEFAULT
+ select NORTHBRIDGE_INTEL_SANDYBRIDGE
+ select SERIRQ_CONTINUOUS_MODE
+ select SOUTHBRIDGE_INTEL_BD82X6X
+ select USE_NATIVE_RAMINIT
+ select SUPERIO_ITE_IT8728F
+
+config MAINBOARD_DIR
+ string
+ default "gigabyte/ga-p67a-ud3r"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "GA-P67A-UD3R"
+
+config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID
+ hex
+ default 0x5001
+
+config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID
+ hex
+ default 0x1458
+
+config MAX_CPUS
+ int
+ default 8
+
+config USBDEBUG_HCD_INDEX
+ int
+ default 2
+
+endif # BOARD_GIGABYTE_GA_P67A_UD3R
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig.name b/src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig.name
new file mode 100644
index 0000000..15f0655
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_GIGABYTE_GA_P67A_UD3R
+ bool "GA-P67A-UD3R"
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/Makefile.inc b/src/mainboard/gigabyte/ga-p67a-ud3r/Makefile.inc
new file mode 100644
index 0000000..3dae61e
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/Makefile.inc
@@ -0,0 +1 @@
+romstage-y += gpio.c
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/ec.asl b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/ec.asl
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/mainboard.asl b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/mainboard.asl
new file mode 100644
index 0000000..34de86f
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/mainboard.asl
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Google Inc.
+ *
+ * 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.
+ */
+
+Scope (\_SB)
+{
+ Device (PWRB)
+ {
+ Name (_HID, EisaId("PNP0C0C"))
+ }
+}
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/platform.asl b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/platform.asl
new file mode 100644
index 0000000..d8d3320
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/platform.asl
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
+ *
+ * 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.
+ */
+
+/* The _PTS method (Prepare To Sleep) is called before the OS is
+ * entering a sleep state. The sleep state number is passed in Arg0
+ */
+
+Method(_PTS,1)
+{
+}
+
+/* The _WAK method is called on system wakeup */
+
+Method(_WAK,1)
+{
+ Return(Package(){0,0})
+}
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/superio.asl b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/superio.asl
new file mode 100644
index 0000000..2b20c77
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi/superio.asl
@@ -0,0 +1,16 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 James Ye <jye836(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; 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 <drivers/pc80/pc/ps2_controller.asl>
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/acpi_tables.c b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi_tables.c
new file mode 100644
index 0000000..a2f383b
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/acpi_tables.c
@@ -0,0 +1,29 @@
+/*
+ * 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/bd82x6x/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;
+}
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/board_info.txt b/src/mainboard/gigabyte/ga-p67a-ud3r/board_info.txt
new file mode 100644
index 0000000..c6f16ae
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/board_info.txt
@@ -0,0 +1,7 @@
+Category: desktop
+Board URL: https://www.gigabyte.com/Motherboard/GA-P67A-UD3R-rev-10
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
+Release year: 2011
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/cmos.default b/src/mainboard/gigabyte/ga-p67a-ud3r/cmos.default
new file mode 100644
index 0000000..60de212
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/cmos.default
@@ -0,0 +1,5 @@
+boot_option=Fallback
+debug_level=Debug
+nmi=Enable
+power_on_after_fail=Disable
+sata_mode=AHCI
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/cmos.layout b/src/mainboard/gigabyte/ga-p67a-ud3r/cmos.layout
new file mode 100644
index 0000000..4e5c0a8
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/cmos.layout
@@ -0,0 +1,107 @@
+##
+## 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 3 boot_option
+388 4 h 0 reboot_counter
+
+# -----------------------------------------------------------------
+# coreboot config options: console
+#392 3 r 0 unused
+395 4 e 4 debug_level
+#399 1 r 0 unused
+
+#400 8 r 0 reserved for century byte
+
+# coreboot config options: southbridge
+#400 1 e 0 unused
+408 1 e 1 nmi
+409 2 e 5 power_on_after_fail
+411 1 e 6 sata_mode
+
+# coreboot config options: northbridge
+#432 3 r 0 unused
+
+# SandyBridge MRC Scrambler Seed values
+896 32 r 0 mrc_scrambler_seed
+928 32 r 0 mrc_scrambler_seed_s3
+960 16 r 0 mrc_scrambler_seed_chk
+
+# 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
+
+3 0 Fallback
+3 1 Normal
+
+4 0 Emergency
+4 1 Alert
+4 2 Critical
+4 3 Error
+4 4 Warning
+4 5 Notice
+4 6 Info
+4 7 Debug
+4 8 Spew
+
+5 0 Disable
+5 1 Enable
+5 2 Keep
+
+6 0 AHCI
+6 1 Compatible
+
+# -----------------------------------------------------------------
+checksums
+
+checksum 392 415 984
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/devicetree.cb b/src/mainboard/gigabyte/ga-p67a-ud3r/devicetree.cb
new file mode 100644
index 0000000..4ed458d
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/devicetree.cb
@@ -0,0 +1,124 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2019 James Ye <jye836(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; 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.
+##
+#
+chip northbridge/intel/sandybridge
+ device cpu_cluster 0x0 on
+ chip cpu/intel/model_206ax
+ device lapic 0x0 on end
+
+ # Magic APIC ID to locate this chip
+ device lapic 0xacac off end
+
+ register "c1_acpower" = "1"
+ register "c2_acpower" = "3"
+ register "c3_acpower" = "5"
+
+ register "c1_battery" = "1"
+ register "c2_battery" = "3"
+ register "c3_battery" = "5"
+ end
+ end
+
+ device domain 0x0 on
+ subsystemid 0x1458 0x5001 inherit
+
+ device pci 00.0 on end # Host bridge
+ device pci 01.0 on # PCIe bridge (PCIEX16)
+ subsystemid 0x1458 0x5000
+ end
+ device pci 02.0 off end # Internal graphics
+
+ chip southbridge/intel/bd82x6x # Intel Series 6 Cougar Point PCH
+ register "sata_port_map" = "0x3f"
+ register "sata_interface_speed_support" = "0x3"
+
+ register "gen1_dec" = "0x000c0801"
+ register "gen2_dec" = "0x000c0291"
+
+ register "pcie_port_coalesce" = "0"
+ register "c2_latency" = "0x0065"
+ register "p_cnt_throttling_supported" = "1"
+
+ register "spi_lvscc" = "0x2005"
+ register "spi_uvscc" = "0x2005"
+
+ device pci 16.0 off 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 off end # Intel Gigabit Ethernet
+ device pci 1a.0 on # USB2 EHCI #2
+ subsystemid 0x1458 0x5006
+ end
+ device pci 1b.0 on # High Definition Audio controller
+ subsystemid 0x1458 0xa102
+ end
+ device pci 1c.0 on end # Unrouted, to disable coalescing
+ device pci 1c.1 on # PCIe Port #2
+ device pci 00.0 on # USB 3.0 controller
+ subsystemid 0x1458 0x5007
+ end
+ end
+ device pci 1c.2 on # PCIe Port #3
+ device pci 00.0 on # Ethernet controller
+ subsystemid 0x1458 0xe000
+ end
+ end
+ device pci 1c.3 on # PCIe Port #4
+ device pci 00.0 on # PCI bridge
+ subsystemid 0x1458 0x5000
+ end
+ end
+ device pci 1c.4 on end # PCIe Port #5 (PCIEX4)
+ device pci 1c.5 off end # PCIe Port #6 (PCIEX1_1)
+ device pci 1c.6 off end # PCIe Port #7 (PCIEX1_2)
+ device pci 1c.7 off end # PCIe Port #8 (PCIEX1_3)
+ device pci 1d.0 on # USB2 EHCI #1
+ subsystemid 0x1458 0x5006
+ end
+ device pci 1e.0 off end # PCI bridge
+ device pci 1f.0 on # LPC bridge
+ chip superio/ite/it8728f
+ device pnp 2e.0 off end # Floppy, not routed
+ device pnp 2e.1 on # COM1
+ io 0x60 = 0x03f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.2 off end # COM2, not routed
+ device pnp 2e.3 off end # Parallel port, not rounted
+ device pnp 2e.4 on # Environment Controller
+ io 0x60 = 0x0290
+ io 0x62 = 0x0
+ irq 0x70 = 0
+ end
+ device pnp 2e.5 on # Keyboard
+ io 0x60 = 0x60
+ io 0x62 = 0x64
+ irq 0x70 = 1
+ end
+ device pnp 2e.6 off end # Mouse
+ device pnp 2e.7 off end # GPIO
+ device pnp 2e.a off end # CIR, not routed
+ end
+ end
+ device pci 1f.2 on # SATA Controller 1
+ subsystemid 0x1458 0xb005
+ end
+ 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/gigabyte/ga-p67a-ud3r/dsdt.asl b/src/mainboard/gigabyte/ga-p67a-ud3r/dsdt.asl
new file mode 100644
index 0000000..365a0fa
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/dsdt.asl
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 James Ye <jye836(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; 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>
+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/mainboard.asl"
+ #include "acpi/platform.asl"
+ #include "acpi/superio.asl"
+ #include <cpu/intel/common/acpi/cpu.asl>
+ #include <southbridge/intel/bd82x6x/acpi/platform.asl>
+
+ // Global NVS and variables
+ #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
+
+ // Chipset specific sleep states
+ #include <southbridge/intel/bd82x6x/acpi/sleepstates.asl>
+
+ Device (\_SB.PCI0)
+ {
+ #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
+ #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
+ #include <southbridge/intel/bd82x6x/acpi/pch.asl>
+ }
+}
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/gpio.c b/src/mainboard/gigabyte/ga-p67a-ud3r/gpio.c
new file mode 100644
index 0000000..c65f432
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/gpio.c
@@ -0,0 +1,204 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008-2009 coresystems GmbH
+ * Copyright (C) 2014 Vladimir Serbinenko
+ * Copyright (C) 2019 James Ye <jye836(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; 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_NATIVE,
+ .gpio3 = GPIO_MODE_NATIVE,
+ .gpio4 = GPIO_MODE_NATIVE,
+ .gpio5 = GPIO_MODE_NATIVE,
+ .gpio6 = GPIO_MODE_GPIO,
+ .gpio7 = GPIO_MODE_GPIO,
+ .gpio8 = GPIO_MODE_GPIO,
+ .gpio9 = GPIO_MODE_NATIVE,
+ .gpio10 = GPIO_MODE_NATIVE,
+ .gpio11 = GPIO_MODE_GPIO,
+ .gpio12 = GPIO_MODE_GPIO,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_NATIVE,
+ .gpio15 = GPIO_MODE_GPIO,
+ .gpio16 = GPIO_MODE_GPIO,
+ .gpio17 = GPIO_MODE_GPIO,
+ .gpio18 = GPIO_MODE_NATIVE,
+ .gpio19 = GPIO_MODE_GPIO,
+ .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_GPIO,
+ .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,
+ .gpio6 = GPIO_DIR_INPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_OUTPUT,
+ .gpio11 = GPIO_DIR_INPUT,
+ .gpio12 = GPIO_DIR_OUTPUT,
+ .gpio13 = GPIO_DIR_INPUT,
+ .gpio15 = GPIO_DIR_INPUT,
+ .gpio16 = GPIO_DIR_INPUT,
+ .gpio17 = GPIO_DIR_INPUT,
+ .gpio19 = GPIO_DIR_INPUT,
+ .gpio21 = GPIO_DIR_INPUT,
+ .gpio22 = GPIO_DIR_INPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio27 = GPIO_DIR_INPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+ .gpio29 = GPIO_DIR_INPUT,
+ .gpio31 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio8 = GPIO_LEVEL_HIGH,
+ .gpio12 = 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 = {
+ .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_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,
+ .gpio40 = GPIO_MODE_NATIVE,
+ .gpio41 = GPIO_MODE_NATIVE,
+ .gpio42 = GPIO_MODE_NATIVE,
+ .gpio43 = GPIO_MODE_NATIVE,
+ .gpio44 = GPIO_MODE_NATIVE,
+ .gpio45 = GPIO_MODE_NATIVE,
+ .gpio46 = GPIO_MODE_NATIVE,
+ .gpio47 = GPIO_MODE_GPIO,
+ .gpio48 = GPIO_MODE_GPIO,
+ .gpio49 = GPIO_MODE_GPIO,
+ .gpio50 = GPIO_MODE_NATIVE,
+ .gpio51 = GPIO_MODE_NATIVE,
+ .gpio52 = GPIO_MODE_NATIVE,
+ .gpio53 = GPIO_MODE_NATIVE,
+ .gpio54 = GPIO_MODE_NATIVE,
+ .gpio55 = GPIO_MODE_NATIVE,
+ .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 = {
+ .gpio32 = GPIO_DIR_OUTPUT,
+ .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,
+ .gpio47 = GPIO_DIR_INPUT,
+ .gpio48 = GPIO_DIR_INPUT,
+ .gpio49 = GPIO_DIR_INPUT,
+ .gpio57 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio32 = GPIO_LEVEL_LOW,
+ .gpio33 = GPIO_LEVEL_HIGH,
+ .gpio35 = GPIO_LEVEL_LOW,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_reset = {
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_mode = {
+ .gpio64 = GPIO_MODE_NATIVE,
+ .gpio65 = GPIO_MODE_NATIVE,
+ .gpio66 = GPIO_MODE_NATIVE,
+ .gpio67 = GPIO_MODE_NATIVE,
+ .gpio68 = GPIO_MODE_GPIO,
+ .gpio69 = GPIO_MODE_GPIO,
+ .gpio70 = GPIO_MODE_NATIVE,
+ .gpio71 = GPIO_MODE_NATIVE,
+ .gpio72 = GPIO_MODE_GPIO,
+ .gpio73 = GPIO_MODE_NATIVE,
+ .gpio74 = GPIO_MODE_NATIVE,
+ .gpio75 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_direction = {
+ .gpio68 = GPIO_DIR_INPUT,
+ .gpio69 = GPIO_DIR_INPUT,
+ .gpio72 = 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/gigabyte/ga-p67a-ud3r/hda_verb.c b/src/mainboard/gigabyte/ga-p67a-ud3r/hda_verb.c
new file mode 100644
index 0000000..a843a2b
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/hda_verb.c
@@ -0,0 +1,74 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008-2009 coresystems GmbH
+ * Copyright (C) 2014 Vladimir Serbinenko
+ * Copyright (C) 2019 James Ye <jye836(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; 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[] = {
+ 0x10ec0892, /* Codec Vendor / Device ID: Realtek */
+ 0x1458a022, /* Subsystem ID */
+
+ 15, /* Number of 4 dword sets */
+ /* NID 0x01: Subsystem ID. */
+ AZALIA_SUBVENDOR(0x2, 0x1458a022),
+
+ /* NID 0x11. */
+ AZALIA_PIN_CFG(0x2, 0x11, 0x99430140),
+
+ /* NID 0x12. */
+ AZALIA_PIN_CFG(0x2, 0x12, 0x411111f0),
+
+ /* NID 0x14. */
+ AZALIA_PIN_CFG(0x2, 0x14, 0x01014410),
+
+ /* NID 0x15. */
+ AZALIA_PIN_CFG(0x2, 0x15, 0x01011412),
+
+ /* NID 0x16. */
+ AZALIA_PIN_CFG(0x2, 0x16, 0x01016411),
+
+ /* NID 0x17. */
+ AZALIA_PIN_CFG(0x2, 0x17, 0x01012414),
+
+ /* NID 0x18. */
+ AZALIA_PIN_CFG(0x2, 0x18, 0x01a19c50),
+
+ /* NID 0x19. */
+ AZALIA_PIN_CFG(0x2, 0x19, 0x02a19c60),
+
+ /* NID 0x1a. */
+ AZALIA_PIN_CFG(0x2, 0x1a, 0x0181345f),
+
+ /* NID 0x1b. */
+ AZALIA_PIN_CFG(0x2, 0x1b, 0x02214c20),
+
+ /* NID 0x1c. */
+ AZALIA_PIN_CFG(0x2, 0x1c, 0x593301f0),
+
+ /* NID 0x1d. */
+ AZALIA_PIN_CFG(0x2, 0x1d, 0x4005e601),
+
+ /* NID 0x1e. */
+ AZALIA_PIN_CFG(0x2, 0x1e, 0x014b6130),
+
+ /* NID 0x1f. */
+ AZALIA_PIN_CFG(0x2, 0x1f, 0x411111f0),
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/gigabyte/ga-p67a-ud3r/romstage.c b/src/mainboard/gigabyte/ga-p67a-ud3r/romstage.c
new file mode 100644
index 0000000..3037b73
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-p67a-ud3r/romstage.c
@@ -0,0 +1,75 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008-2009 coresystems GmbH
+ * Copyright (C) 2014 Vladimir Serbinenko
+ * Copyright (C) 2019 James Ye <jye836(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; 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 <northbridge/intel/sandybridge/sandybridge.h>
+#include <northbridge/intel/sandybridge/raminit_native.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+#include <superio/ite/common/ite.h>
+#include <superio/ite/it8728f/it8728f.h>
+
+#define SUPERIO_BASE 0x2e
+#define SUPERIO_GPIO PNP_DEV(SUPERIO_BASE, IT8728F_GPIO)
+#define SERIAL_DEV PNP_DEV(SUPERIO_BASE, 0x01)
+
+void pch_enable_lpc(void)
+{
+ pci_write_config16(PCH_LPC_DEV, LPC_EN, KBC_LPC_EN | CNF1_LPC_EN |
+ CNF2_LPC_EN | COMA_LPC_EN);
+}
+
+void mainboard_rcba_config(void)
+{
+}
+
+const struct southbridge_usb_port mainboard_usb_ports[] = {
+ { 1, 1, 0 },
+ { 1, 1, 0 },
+ { 1, 1, 1 },
+ { 1, 1, 1 },
+ { 1, 6, 2 },
+ { 1, 6, 2 },
+ { 1, 6, 3 },
+ { 1, 5, 3 },
+ { 1, 5, 4 },
+ { 1, 5, 4 },
+ { 1, 5, 5 },
+ { 1, 5, 5 },
+ { 1, 5, 6 },
+ { 1, 5, 6 },
+};
+
+void mainboard_early_init(int s3resume)
+{
+}
+
+void mainboard_config_superio(void)
+{
+ /* Enable serial port */
+ ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+
+ /* Disable SIO WDT which kicks in DualBIOS */
+ ite_reg_write(SUPERIO_GPIO, 0xEF, 0x7E);
+}
+
+void mainboard_get_spd(spd_raw_data *spd, bool id_only)
+{
+ read_spd(&spd[0], 0x50, id_only);
+ read_spd(&spd[1], 0x51, id_only);
+ read_spd(&spd[2], 0x52, id_only);
+ read_spd(&spd[3], 0x53, id_only);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31363
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4fbf50376be3184bf01a3bc8aae09bce54676707
Gerrit-Change-Number: 31363
Gerrit-PatchSet: 1
Gerrit-Owner: James <jye836(a)gmail.com>
Gerrit-MessageType: newchange
6
24

Change in coreboot[master]: src/mainboard: Port for Chuwi Minibook (m3/8GB)
by Sergey Larin (Code Review) June 8, 2024
by Sergey Larin (Code Review) June 8, 2024
June 8, 2024
Sergey Larin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38249 )
Change subject: src/mainboard: Port for Chuwi Minibook (m3/8GB)
......................................................................
src/mainboard: Port for Chuwi Minibook (m3/8GB)
Hardware:
- Intel Core m3-8100Y (Amber Lake aka Kabylake)
- Sunrise Point-LP C iHDCP 2.2 Premium
- ITE IT8987E EC
- Unknown soldered 8GB memory - SPD was extracted from BIOS image
(BIOS says it's Micron/2 ranks/13-15-15-34)
- 1200x1920 eDP display (yep it's rotated)
- mini-HDMI port
- 1 USB 3.0, 1 USB 2.0, 1 USB Type-C port (as charger but working)
- eMMC storage (unknown)
- SD card slot
- M.2 2242 slot
- Intel WiFi chip
Currently hangs after postcar stage.
Change-Id: I7cfa4588802b9c07b504f03471265574608519c8
---
M src/drivers/spi/flashconsole.c
A src/mainboard/chuwi/Kconfig
A src/mainboard/chuwi/Kconfig.name
A src/mainboard/chuwi/minibook/Kconfig
A src/mainboard/chuwi/minibook/Kconfig.name
A src/mainboard/chuwi/minibook/Makefile.inc
A src/mainboard/chuwi/minibook/acpi/ec.asl
A src/mainboard/chuwi/minibook/acpi/mainboard.asl
A src/mainboard/chuwi/minibook/acpi/superio.asl
A src/mainboard/chuwi/minibook/acpi_tables.c
A src/mainboard/chuwi/minibook/board_info.txt
A src/mainboard/chuwi/minibook/data.vbt
A src/mainboard/chuwi/minibook/devicetree.cb
A src/mainboard/chuwi/minibook/dsdt.asl
A src/mainboard/chuwi/minibook/gma-mainboard.ads
A src/mainboard/chuwi/minibook/gpio.h
A src/mainboard/chuwi/minibook/hda_verb.c
A src/mainboard/chuwi/minibook/mainboard.c
A src/mainboard/chuwi/minibook/ramstage.c
A src/mainboard/chuwi/minibook/romstage.c
A src/mainboard/chuwi/minibook/spd/Makefile.inc
A src/mainboard/chuwi/minibook/spd/micron.spd.hex
A src/mainboard/chuwi/minibook/spd/spd.h
A src/mainboard/chuwi/minibook/spd/spd_util.c
A src/superio/ite/it8987e/Kconfig
A src/superio/ite/it8987e/Makefile.inc
A src/superio/ite/it8987e/it8987e.h
A src/superio/ite/it8987e/superio.c
28 files changed, 1,360 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/38249/1
diff --git a/src/drivers/spi/flashconsole.c b/src/drivers/spi/flashconsole.c
index 80c63e0..149a84e 100644
--- a/src/drivers/spi/flashconsole.c
+++ b/src/drivers/spi/flashconsole.c
@@ -22,11 +22,11 @@
#define LINE_BUFFER_SIZE 128
#define READ_BUFFER_SIZE 0x100
-static const struct region_device *rdev_ptr;
-static struct region_device rdev;
-static uint8_t line_buffer[LINE_BUFFER_SIZE];
-static size_t offset;
-static size_t line_offset;
+static const struct region_device *g_rdev_ptr;
+static struct region_device g_rdev;
+static uint8_t g_line_buffer[LINE_BUFFER_SIZE];
+static size_t g_offset;
+static size_t g_line_offset;
void flashconsole_init(void)
{
@@ -36,11 +36,11 @@
size_t len = READ_BUFFER_SIZE;
size_t i;
- if (fmap_locate_area_as_rdev_rw("CONSOLE", &rdev)) {
+ if (fmap_locate_area_as_rdev_rw("CONSOLE", &g_rdev)) {
printk(BIOS_INFO, "Can't find 'CONSOLE' area in FMAP\n");
return;
}
- size = region_device_sz(&rdev);
+ size = region_device_sz(&g_rdev);
/*
* We need to check the region until we find a 0xff indicating
@@ -56,7 +56,7 @@
// Fill the buffer on first iteration
if (i == 0) {
len = MIN(READ_BUFFER_SIZE, size - offset);
- if (rdev_readat(&rdev, buffer, offset, len) != len)
+ if (rdev_readat(&g_rdev, buffer, offset, len) != len)
return;
}
if (buffer[i] == 0xff) {
@@ -75,29 +75,29 @@
return;
}
- offset = offset;
- rdev_ptr = &rdev;
+ g_offset = offset;
+ g_rdev_ptr = &g_rdev;
}
void flashconsole_tx_byte(unsigned char c)
{
- if (!rdev_ptr)
+ if (!g_rdev_ptr)
return;
- size_t region_size = region_device_sz(rdev_ptr);
+ size_t region_size = region_device_sz(g_rdev_ptr);
- line_buffer[line_offset++] = c;
+ g_line_buffer[g_line_offset++] = c;
- if (line_offset >= LINE_BUFFER_SIZE ||
- offset + line_offset >= region_size || c == '\n') {
+ if (g_line_offset >= LINE_BUFFER_SIZE ||
+ g_offset + g_line_offset >= region_size || c == '\n') {
flashconsole_tx_flush();
}
}
void flashconsole_tx_flush(void)
{
- size_t offset = offset;
- size_t len = line_offset;
+ size_t offset = g_offset;
+ size_t len = g_line_offset;
size_t region_size;
static int busy;
@@ -107,23 +107,23 @@
if (busy)
return;
- if (!rdev_ptr)
+ if (!g_rdev_ptr)
return;
busy = 1;
- region_size = region_device_sz(rdev_ptr);
+ region_size = region_device_sz(g_rdev_ptr);
if (offset + len >= region_size)
len = region_size - offset;
- if (rdev_writeat(&rdev, line_buffer, offset, len) != len)
+ if (rdev_writeat(&g_rdev, g_line_buffer, offset, len) != len)
return;
// If the region is full, stop future write attempts
if (offset + len >= region_size)
return;
- offset = offset + len;
- line_offset = 0;
+ g_offset = offset + len;
+ g_line_offset = 0;
busy = 0;
}
diff --git a/src/mainboard/chuwi/Kconfig b/src/mainboard/chuwi/Kconfig
new file mode 100644
index 0000000..234d863
--- /dev/null
+++ b/src/mainboard/chuwi/Kconfig
@@ -0,0 +1,16 @@
+if VENDOR_CHUWI
+
+choice
+ prompt "Mainboard model"
+
+source "src/mainboard/chuwi/*/Kconfig.name"
+
+endchoice
+
+source "src/mainboard/chuwi/*/Kconfig"
+
+config MAINBOARD_VENDOR
+ string
+ default "CHUWI Innovation And Technology(ShenZhen)co.,Ltd"
+
+endif # VENDOR_CHUWI
diff --git a/src/mainboard/chuwi/Kconfig.name b/src/mainboard/chuwi/Kconfig.name
new file mode 100644
index 0000000..2582c97
--- /dev/null
+++ b/src/mainboard/chuwi/Kconfig.name
@@ -0,0 +1,2 @@
+config VENDOR_CHUWI
+ bool "CHUWI Innovation And Technology(ShenZhen)co.,Ltd"
diff --git a/src/mainboard/chuwi/minibook/Kconfig b/src/mainboard/chuwi/minibook/Kconfig
new file mode 100644
index 0000000..32881b8
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/Kconfig
@@ -0,0 +1,73 @@
+if BOARD_CHUWI_MINIBOOK
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select SYSTEM_TYPE_CONVERTIBLE
+ select BOARD_ROMSIZE_KB_8192
+ select SUPERIO_ITE_IT8987E
+ select SOC_INTEL_KABYLAKE
+ select SOC_INTEL_COMMON_BLOCK_HDA_VERB
+ select INTEL_GMA_HAVE_VBT
+ select MAINBOARD_HAS_LIBGFXINIT
+ select GFX_GMA_INTERNAL_IS_EDP
+ select GENERIC_SPD_BIN
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select ADD_FSP_BINARIES
+ select FSP_USE_REPO
+
+config SPI_FLASH_INCLUDE_ALL_DRIVERS
+ bool
+ default n
+
+config SPI_FLASH
+ bool
+ default y
+
+config SPI_FLASH_WINBOND
+ bool
+ default y
+
+config DIMM_SPD_SIZE
+ int
+ default 512
+
+config VGA_BIOS_ID
+ string
+ default "8086,591c"
+
+config IRQ_SLOT_COUNT
+ int
+ default 18
+
+config MINIBOOK_EC_BIN_PATH
+ string
+ default "3rdparty/blobs/mainboard/$(CONFIG_MAINBOARD_DIR)/ec.bin"
+
+config FSP_FD_PATH
+ string
+ #default "3rdparty/fsp/AmberLakeFspBinPkg/Fsp.fd"
+ default "3rdparty/fsp/KabylakeFspBinPkg/Fsp.fd"
+
+config FSP_HEADER_PATH
+ string
+ #default "3rdparty/fsp/AmberLakeFspBinPkg/Include/"
+ default "3rdparty/fsp/KabylakeFspBinPkg/Include/"
+
+config MAX_CPUS
+ int
+ default 4
+
+config CBFS_SIZE
+ hex
+ default 0x600000
+
+config MAINBOARD_DIR
+ string
+ default "chuwi/minibook"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "MiniBook"
+
+endif
diff --git a/src/mainboard/chuwi/minibook/Kconfig.name b/src/mainboard/chuwi/minibook/Kconfig.name
new file mode 100644
index 0000000..a8cb30a
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_CHUWI_MINIBOOK
+ bool "MiniBook"
diff --git a/src/mainboard/chuwi/minibook/Makefile.inc b/src/mainboard/chuwi/minibook/Makefile.inc
new file mode 100644
index 0000000..7c7ca2a
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/Makefile.inc
@@ -0,0 +1,26 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2015 Google Inc.
+##
+## 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.
+##
+
+subdirs-y += spd
+
+#ramstage-y += mainboard.c
+ramstage-y += ramstage.c
+ramstage-y += hda_verb.c
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
+
+cbfs-files-y += ec.bin
+ec.bin-file := $(call strip_quotes,$(CONFIG_MINIBOOK_EC_BIN_PATH))
+ec.bin-type := raw
+ec.bin-position := 0xffa40000
diff --git a/src/mainboard/chuwi/minibook/acpi/ec.asl b/src/mainboard/chuwi/minibook/acpi/ec.asl
new file mode 100644
index 0000000..ecc384e
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/acpi/ec.asl
@@ -0,0 +1,176 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Johanna Schander <coreboot(a)mimoja.de>
+ *
+ * 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.
+ */
+
+Device (EC)
+{
+ Name (_HID, EisaId ("PNP0C09"))
+ Name (_UID, 0)
+
+ Name (_CRS, ResourceTemplate () {
+ IO (Decode16, 0x62, 0x62, 0, 1)
+ IO (Decode16, 0x66, 0x66, 0, 1)
+ })
+
+ Name (ACEX, 0)
+
+ OperationRegion (ERAM, EmbeddedControl, 0x00, 0xFF)
+ Field (ERAM, ByteAcc, NoLock, Preserve)
+ {
+ XXX0, 8,
+ XXX1, 8,
+ XXX2, 8,
+ Offset (0x11),
+ KBCD, 8,
+ Offset (0x20),
+ RCMD, 8,
+ RCST, 8,
+ TESR, 8,
+ Offset (0x60),
+ TSR1, 8,
+ TSR2, 8,
+ TSR3, 8,
+ TSI, 4,
+ HYST, 4,
+ TSHT, 8,
+ TSLT, 8,
+ TSSR, 8,
+ CHGR, 16,
+ Offset (0x72),
+ CHGT, 8,
+ Offset (0x7F),
+ LSTE, 1,
+ Offset (0x80),
+ ECWR, 8,
+ XX10, 8,
+ XX11, 16,
+ B1DC, 16,
+ B1FV, 16,
+ B1FC, 16,
+ XX15, 16,
+ B1ST, 8,
+ B1CR, 16,
+ B1RC, 16,
+ B1VT, 16,
+ BPCN, 8,
+ Offset (0xC0),
+ VER1, 8,
+ VER2, 8,
+ RSV1, 8,
+ RSV2, 8,
+ CCI0, 8,
+ CCI1, 8,
+ CCI2, 8,
+ CCI3, 8,
+ CTL0, 8,
+ CTL1, 8,
+ CTL2, 8,
+ CTL3, 8,
+ CTL4, 8,
+ CTL5, 8,
+ CTL6, 8,
+ CTL7, 8,
+ MGI0, 8,
+ MGI1, 8,
+ MGI2, 8,
+ MGI3, 8,
+ MGI4, 8,
+ MGI5, 8,
+ MGI6, 8,
+ MGI7, 8,
+ MGI8, 8,
+ MGI9, 8,
+ MGIA, 8,
+ MGIB, 8,
+ MGIC, 8,
+ MGID, 8,
+ MGIE, 8,
+ MGIF, 8,
+ MGO0, 8,
+ MGO1, 8,
+ MGO2, 8,
+ MGO3, 8,
+ MGO4, 8,
+ MGO5, 8,
+ MGO6, 8,
+ MGO7, 8,
+ MGO8, 8,
+ MGO9, 8,
+ MGOA, 8,
+ MGOB, 8,
+ MGOC, 8,
+ MGOD, 8,
+ MGOE, 8,
+ MGOF, 8,
+ , 3,
+ TPCC, 1,
+ , 2,
+ DRMD, 1,
+ Offset (0xF1)
+ }
+
+ Method (_REG, 2, NotSerialized)
+ {
+ }
+
+ // KEY_RFKILL???
+ Method (_Q01, 0, NotSerialized)
+ {
+ }
+
+ // AC plugged?
+ Method (_Q0A, 0, NotSerialized)
+ {
+ }
+
+ // AC unplugged?
+ Method (_Q0B, 0, NotSerialized)
+ {
+ }
+
+ // Lid open/closed
+ Method (_Q0C, 0, NotSerialized)
+ {
+ }
+
+ // Lid open/closed
+ Method (_Q0D, 0, NotSerialized)
+ {
+ }
+
+ // Brigtness up
+ Method (_Q06, 0, NotSerialized)
+ {
+ }
+
+ // Brigtness down
+ Method (_Q07, 0, NotSerialized)
+ {
+ }
+
+ // Power down event
+ Method (_Q54, 0, NotSerialized)
+ {
+ }
+
+ // ??? USB Type C/UCSI Something?
+ Method (_Q79, 0, NotSerialized)
+ {
+ }
+
+ // ??? DCI (OTG?)
+ Method (_QDD, 0, NotSerialized)
+ {
+ }
+}
diff --git a/src/mainboard/chuwi/minibook/acpi/mainboard.asl b/src/mainboard/chuwi/minibook/acpi/mainboard.asl
new file mode 100644
index 0000000..20d993a
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/acpi/mainboard.asl
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Google Inc.
+ *
+ * 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.
+ */
+
+Scope (\_SB)
+{
+ Device (LID0)
+ {
+ Name (_HID, EisaId ("PNP0C0D"))
+
+ Method (_LID)
+ {
+ if (LEqual(\_SB.PCI0.LPCB.EC.LSTE,0))
+ {
+ Return (One)
+ }
+ else
+ {
+ Return (Zero)
+ }
+ }
+
+ Method (_STA)
+ {
+ Return (_LID)
+ }
+ }
+
+ Device (PWRB)
+ {
+ Name (_HID, EisaId ("PNP0C0C"))
+
+ Method (_STA)
+ {
+ Return (0xF)
+ }
+
+ Name (_PRW, Package () { 27, 4 })
+ }
+
+}
diff --git a/src/mainboard/chuwi/minibook/acpi/superio.asl b/src/mainboard/chuwi/minibook/acpi/superio.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/acpi/superio.asl
diff --git a/src/mainboard/chuwi/minibook/acpi_tables.c b/src/mainboard/chuwi/minibook/acpi_tables.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/acpi_tables.c
diff --git a/src/mainboard/chuwi/minibook/board_info.txt b/src/mainboard/chuwi/minibook/board_info.txt
new file mode 100644
index 0000000..ebb9053
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/board_info.txt
@@ -0,0 +1,6 @@
+Vendor name: Chuwi
+Board name: Minibook
+Category: laptop
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
diff --git a/src/mainboard/chuwi/minibook/data.vbt b/src/mainboard/chuwi/minibook/data.vbt
new file mode 100644
index 0000000..16eac95
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/data.vbt
Binary files differ
diff --git a/src/mainboard/chuwi/minibook/devicetree.cb b/src/mainboard/chuwi/minibook/devicetree.cb
new file mode 100644
index 0000000..20ec6d9
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/devicetree.cb
@@ -0,0 +1,264 @@
+chip soc/intel/skylake
+ # Enable deep Sx states
+ register "deep_s3_enable_ac" = "0"
+ register "deep_s3_enable_dc" = "0"
+ register "deep_s5_enable_ac" = "0"
+ register "deep_s5_enable_dc" = "0"
+ register "deep_sx_config" = "DSX_EN_LAN_WAKE_PIN"
+
+ register "eist_enable" = "1"
+
+ # GPE configuration
+ # Note that GPE events called out in ASL code rely on this
+ # route. i.e. If this route changes then the affected GPE
+ # offset bits also need to be changed.
+ register "gpe0_dw0" = "GPP_C"
+ register "gpe0_dw1" = "GPP_D"
+ register "gpe0_dw2" = "GPP_E"
+
+ register "gen1_dec" = "0x000c0681"
+ register "gen2_dec" = "0x000c1641"
+ register "gen3_dec" = "0x00000069"
+ register "gen4_dec" = "0x0000006d"
+
+ # Enable "Intel Speed Shift Technology"
+ register "speed_shift_enable" = "1"
+
+ # Enable DPTF
+ register "dptf_enable" = "1"
+
+ # FSP Configuration
+ register "ProbelessTrace" = "0"
+ register "EnableLan" = "0"
+ register "EnableSata" = "1"
+ register "SataSalpSupport" = "0"
+ register "SataMode" = "0"
+ register "SataPortsEnable[0]" = "1"
+ register "SataPortsEnable[1]" = "1"
+ register "SataPortsEnable[2]" = "1"
+ register "SataPortsDevSlp[1]" = "1"
+ register "EnableAzalia" = "1"
+ register "DspEnable" = "1"
+ register "IoBufferOwnership" = "0"
+ register "EnableTraceHub" = "0"
+ register "SsicPortEnable" = "0"
+ register "SmbusEnable" = "1"
+ register "Cio2Enable" = "0"
+ register "ScsEmmcEnabled" = "1"
+ register "ScsEmmcHs400Enabled" = "1"
+ register "ScsSdCardEnabled" = "2" # IDK why 2 really
+ register "PttSwitch" = "0"
+ register "SkipExtGfxScan" = "1"
+ register "PrimaryDisplay" = "Display_iGFX"
+ register "Device4Enable" = "1"
+ register "HeciEnabled" = "1"
+ register "SaGv" = "SaGv_Enabled"
+ register "PmConfigSlpS3MinAssert" = "2" # 50ms
+ register "PmConfigSlpS4MinAssert" = "1" # 1s
+ register "PmConfigSlpSusMinAssert" = "3" # 500ms
+ register "PmConfigSlpAMinAssert" = "3" # 2s
+ register "PmTimerDisabled" = "0"
+
+ register "serirq_mode" = "SERIRQ_CONTINUOUS"
+
+ register "pirqa_routing" = "PCH_IRQ11"
+ register "pirqb_routing" = "PCH_IRQ10"
+ register "pirqc_routing" = "PCH_IRQ11"
+ register "pirqd_routing" = "PCH_IRQ11"
+ register "pirqe_routing" = "PCH_IRQ11"
+ register "pirqf_routing" = "PCH_IRQ11"
+ register "pirqg_routing" = "PCH_IRQ11"
+ register "pirqh_routing" = "PCH_IRQ11"
+
+ # VR Settings Configuration for 4 Domains
+ #+----------------+-----------+-----------+-------------+----------+
+ #| Domain/Setting | SA | IA | GT Unsliced | GT |
+ #+----------------+-----------+-----------+-------------+----------+
+ #| Psi1Threshold | 20A | 20A | 20A | 20A |
+ #| Psi2Threshold | 5A | 5A | 5A | 5A |
+ #| Psi3Threshold | 1A | 1A | 1A | 1A |
+ #| Psi3Enable | 1 | 1 | 1 | 1 |
+ #| Psi4Enable | 1 | 1 | 1 | 1 |
+ #| ImonSlope | 0 | 0 | 0 | 0 |
+ #| ImonOffset | 0 | 0 | 0 | 0 |
+ #| IccMax | 4A | 28A | 24A | 24A |
+ #| VrVoltageLimit | 1.52V | 1.52V | 1.52V | 1.52V |
+ #+----------------+-----------+-----------+-------------+----------+
+ register "domain_vr_config[VR_SYSTEM_AGENT]" = "{ \
+ .vr_config_enable = 1, \
+ .psi1threshold = VR_CFG_AMP(20), \
+ .psi2threshold = VR_CFG_AMP(5), \
+ .psi3threshold = VR_CFG_AMP(1), \
+ .psi3enable = 1, \
+ .psi4enable = 1, \
+ .imon_slope = 0x0, \
+ .imon_offset = 0x0, \
+ .icc_max = VR_CFG_AMP(4), \
+ .voltage_limit = 1520, \
+ .ac_loadline = 1800, \
+ .dc_loadline = 1800, \
+ }"
+
+ register "domain_vr_config[VR_IA_CORE]" = "{ \
+ .vr_config_enable = 1, \
+ .psi1threshold = VR_CFG_AMP(20), \
+ .psi2threshold = VR_CFG_AMP(5), \
+ .psi3threshold = VR_CFG_AMP(1), \
+ .psi3enable = 1, \
+ .psi4enable = 1, \
+ .imon_slope = 0x0, \
+ .imon_offset = 0x0, \
+ .icc_max = VR_CFG_AMP(28), \
+ .voltage_limit = 1520, \
+ .ac_loadline = 400, \
+ .dc_loadline = 400, \
+ }"
+
+ register "domain_vr_config[VR_GT_UNSLICED]" = "{ \
+ .vr_config_enable = 1, \
+ .psi1threshold = VR_CFG_AMP(20), \
+ .psi2threshold = VR_CFG_AMP(5), \
+ .psi3threshold = VR_CFG_AMP(1), \
+ .psi3enable = 1, \
+ .psi4enable = 1, \
+ .imon_slope = 0x0, \
+ .imon_offset = 0x0, \
+ .icc_max = VR_CFG_AMP(24), \
+ .voltage_limit = 1520, \
+ .ac_loadline = 570, \
+ .dc_loadline = 570, \
+ }"
+
+ register "domain_vr_config[VR_GT_SLICED]" = "{ \
+ .vr_config_enable = 1, \
+ .psi1threshold = VR_CFG_AMP(20), \
+ .psi2threshold = VR_CFG_AMP(5), \
+ .psi3threshold = VR_CFG_AMP(1), \
+ .psi3enable = 1, \
+ .psi4enable = 1, \
+ .imon_slope = 0x0, \
+ .imon_offset = 0x0, \
+ .icc_max = VR_CFG_AMP(24), \
+ .voltage_limit = 1520, \
+ .ac_loadline = 570, \
+ .dc_loadline = 570, \
+ }"
+
+ # Enable Root Port 6 (WiFi)
+ register "PcieRpEnable[5]" = "1"
+
+ register "PcieRpLtrEnable[5]" = "1"
+
+ # USB
+ register "usb2_ports[0]" = "USB2_PORT_TYPE_C(OC_SKIP)" # Type-C Port
+ register "usb2_ports[1]" = "USB2_PORT_MID(OC_SKIP)" # Type-A Port (left)
+ register "usb2_ports[2]" = "USB2_PORT_FLEX(OC_SKIP)" # Camera
+ register "usb2_ports[4]" = "USB2_PORT_MID(OC_SKIP)" # Type-A Port (right)
+ register "usb2_ports[6]" = "USB2_PORT_FLEX(OC_SKIP)" # Wireless
+ register "usb2_ports[8]" = "USB2_PORT_FLEX(OC_SKIP)" # Touchpad
+
+ register "usb3_ports[1]" = "USB3_PORT_DEFAULT(OC_SKIP)" # Type-A Port (left)
+
+ register "i2c_voltage[0]" = "I2C_VOLTAGE_3V3"
+ register "i2c_voltage[1]" = "I2C_VOLTAGE_3V3"
+ register "i2c_voltage[2]" = "I2C_VOLTAGE_1V8"
+
+ # PL1 override 8W
+ register "tdp_pl1_override" = "8"
+
+ # PL2 override 18W
+ register "tdp_pl2_override" = "18"
+
+ # Send an extra VR mailbox command
+ register "SendVrMbxCmd" = "1"
+
+ # Lock Down
+ register "common_soc_config" = "{ \
+ .chipset_lockdown = CHIPSET_LOCKDOWN_COREBOOT, \
+ }"
+
+ # I2C4 is marked as "IoExpander" in BIOS
+ register "SerialIoDevMode" = "{ \
+ [PchSerialIoIndexI2C0] = PchSerialIoPci, \
+ [PchSerialIoIndexI2C1] = PchSerialIoPci, \
+ [PchSerialIoIndexI2C2] = PchSerialIoPci, \
+ [PchSerialIoIndexI2C3] = PchSerialIoDisabled, \
+ [PchSerialIoIndexI2C4] = PchSerialIoAcpiHidden, \
+ [PchSerialIoIndexI2C5] = PchSerialIoDisabled, \
+ [PchSerialIoIndexSpi0] = PchSerialIoDisabled, \
+ [PchSerialIoIndexSpi1] = PchSerialIoPci, \
+ [PchSerialIoIndexUart0] = PchSerialIoPci, \
+ [PchSerialIoIndexUart1] = PchSerialIoDisabled, \
+ [PchSerialIoIndexUart2] = PchSerialIoDisabled, \
+ }"
+
+ register "sdcard_cd_gpio_default" = "GPP_B17"
+
+ device cpu_cluster 0 on
+ device lapic 0 on end
+ end
+ device domain 0 on
+ device pci 00.0 on end # Host Bridge
+ device pci 02.0 on end # Integrated Graphics Device
+ device pci 04.0 on end # Thermal Subsystem
+ device pci 07.0 on end # ???
+ device pci 08.0 on end # Gaussian Mixture Model
+ device pci 14.0 on end # USB xHCI
+ device pci 14.2 on end # Thermal Subsystem
+ # TODO fill I2C
+ device pci 15.0 on end # I2C Controller #0
+ device pci 15.1 on end # I2C Controller #0
+ device pci 15.2 on end # I2C Controller #0
+ device pci 16.0 on end # Management Engine Interface 1
+ device pci 17.0 on end # SATA
+ device pci 1c.0 on end # PCI Express Port 1
+ device pci 1e.0 on end # Serial IO UART0
+ device pci 1e.3 on end # SPI Controller #0
+ device pci 1e.4 on end # SD Host Controller
+ device pci 1e.6 on end # SD Host Controller
+ device pci 1f.0 on # LPC
+ chip superio/ite/it8987e
+ device pnp 4e.4 off end # System Wake Up Control
+ device pnp 4e.5 on # KBC/Mouse Interface
+ irq 0x70 = 12
+ end
+ device pnp 4e.6 on # KBC/Keyboard Interface
+ io 0x60 = 0x60
+ io 0x62 = 0x64
+ irq 0x70 = 1
+ end
+ device pnp 4e.a off end # Consumer IR
+ device pnp 4e.f on # Shared Memory/Flash Interface
+ io 0x60 = 0x200
+ irq 0x70 = 0
+ irq 0x71 = 2
+ irq 0xf4 = 9
+ end
+ device pnp 4e.10 on # Real Time Clock
+ io 0x60 = 0x912
+ io 0x62 = 0x910
+ irq 0x70 = 8
+ end
+ device pnp 4e.11 on # Power Management I/F Channel 1 (PMC1)
+ io 0x60 = 0x62
+ io 0x62 = 0x66
+ irq 0x70 = 0
+ end
+ device pnp 4e.12 on # Power Management I/F Channel 2 (PMC2)
+ io 0x60 = 0x68
+ io 0x62 = 0x6c
+ irq 0x70 = 0
+ irq 0xf0 = 0
+ end
+ device pnp 4e.13 off end # Serial Peripheral Interface (SSPI)
+ device pnp 4e.14 off end # Platform Environment Control Interface (PECI)
+ device pnp 4e.17 off end # Power Management I/F Channel 3 (PMC3)
+ device pnp 4e.18 off end # Power Management I/F Channel 3 (PMC4)
+ device pnp 4e.19 off end # Power Management I/F Channel 3 (PMC5)
+ end
+ end # LPC Bridge
+ device pci 1f.2 on end # Power Management Controller
+ device pci 1f.3 on end # Intel HDA
+ device pci 1f.4 on end # SMBus
+ end
+end
diff --git a/src/mainboard/chuwi/minibook/dsdt.asl b/src/mainboard/chuwi/minibook/dsdt.asl
new file mode 100644
index 0000000..ef48745
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/dsdt.asl
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ * Copyright (C) 2015 Google Inc.
+ * Copyright (C) 2015 Intel Corporation
+ *
+ * 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>
+
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x05, // DSDT revision: ACPI v5.0
+ "COREv4", // OEM id
+ "COREBOOT", // OEM table id
+ 0x20110725 // OEM revision
+){
+ //Platform
+ #include <soc/intel/skylake/acpi/platform.asl>
+
+ // global NVS and variables
+ #include <soc/intel/skylake/acpi/globalnvs.asl>
+
+ // CPU
+ #include <cpu/intel/common/acpi/cpu.asl>
+
+ Scope (\_SB) {
+ Device (PCI0)
+ {
+ #include <soc/intel/skylake/acpi/systemagent.asl>
+ #include <soc/intel/skylake/acpi/pch.asl>
+ }
+
+ }
+
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+
+ #include "acpi/mainboard.asl"
+}
diff --git a/src/mainboard/chuwi/minibook/gma-mainboard.ads b/src/mainboard/chuwi/minibook/gma-mainboard.ads
new file mode 100644
index 0000000..452cf26
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/gma-mainboard.ads
@@ -0,0 +1,33 @@
+--
+-- This file is part of the coreboot project.
+--
+-- Copyright (C) 2018 Tristan Corrick <tristan(a)corrick.kiwi>
+-- Copyright (C) 2019 Maxim Polyakov <max.senia.poliak(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.
+--
+
+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 :=
+ (Internal,
+ DP1,
+ HDMI1,
+ Analog,
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/chuwi/minibook/gpio.h b/src/mainboard/chuwi/minibook/gpio.h
new file mode 100644
index 0000000..e8460a7
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/gpio.h
@@ -0,0 +1,194 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Sergey Larin <cerg2010cerg2010(a)mail.ru>
+ *
+ * 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 MAINBOARD_GPIO_H
+#define MAINBOARD_GPIO_H
+
+#include <soc/gpe.h>
+#include <soc/gpio.h>
+
+#ifndef __ACPI__
+
+/* Pad configuration in ramstage. */
+static const struct pad_config gpio_table[] = {
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A0, 0x4000100, 0x1000),
+ /* LAD0 */ _PAD_CFG_STRUCT(GPP_A1, 0x44000702, 0x3c00),
+ /* LAD1 */ _PAD_CFG_STRUCT(GPP_A2, 0x44000702, 0x3c00),
+ /* LAD2 */ _PAD_CFG_STRUCT(GPP_A3, 0x44000702, 0x3c00),
+ /* LAD3 */ _PAD_CFG_STRUCT(GPP_A4, 0x44000702, 0x3c00),
+ /* LFRAME# */ _PAD_CFG_STRUCT(GPP_A5, 0x44000700, 0x0),
+ /* SERIRQ */ _PAD_CFG_STRUCT(GPP_A6, 0x44000702, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A7, 0x44000100, 0x1000),
+ /* CLKRUN# */ _PAD_CFG_STRUCT(GPP_A8, 0x44000700, 0x0),
+ /* CLKOUT_LPC0 */ _PAD_CFG_STRUCT(GPP_A9, 0x44000700, 0x1000),
+ /* CLKOUT_LPC1 */ _PAD_CFG_STRUCT(GPP_A10, 0x44000700, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A11, 0x44000102, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A12, 0x44000100, 0x1000),
+ /* SUSWARN#/SUSPWRDNACK */ _PAD_CFG_STRUCT(GPP_A13, 0x44000700, 0x0),
+ /* SUS_STAT# */ _PAD_CFG_STRUCT(GPP_A14, 0x44000700, 0x0),
+ /* SUS_ACK# */ _PAD_CFG_STRUCT(GPP_A15, 0x44000702, 0x3000),
+ /* SD_1P8_SEL */ _PAD_CFG_STRUCT(GPP_A16, 0x44000500, 0x0),
+ /* SD_PWR_EN# */ _PAD_CFG_STRUCT(GPP_A17, 0x44000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A18, 0x40800102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A19, 0x40000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A20, 0x42000100, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A21, 0x44000201, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A22, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_A23, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B0, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B1, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B2, 0x44000201, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B3, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B4, 0x44000201, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B5, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B6, 0x44000102, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B7, 0x44000102, 0x3000),
+ /* SRCCLKREQ3# */ _PAD_CFG_STRUCT(GPP_B8, 0x44000702, 0x3000),
+ /* SRCCLKREQ4# */ _PAD_CFG_STRUCT(GPP_B9, 0x44000702, 0x0),
+ /* SRCCLKREQ5# */ _PAD_CFG_STRUCT(GPP_B10, 0x44000702, 0x0),
+ /* EXT_PWR_GATE# */ _PAD_CFG_STRUCT(GPP_B11, 0x44000700, 0x0),
+ /* SLP_S0# */ _PAD_CFG_STRUCT(GPP_B12, 0x44000700, 0x0),
+ /* PLTRST# */ _PAD_CFG_STRUCT(GPP_B13, 0x44000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B14, 0x44000100, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B15, 0x44000201, 0x800),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B16, 0x42000100, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B17, 0x46000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B18, 0x44000100, 0x1000),
+ /* GSPI1_CS# */ _PAD_CFG_STRUCT(GPP_B19, 0x44000700, 0x0),
+ /* GSPI1_CLK */ _PAD_CFG_STRUCT(GPP_B20, 0x44000700, 0x1000),
+ /* GSPI1_MISO */ _PAD_CFG_STRUCT(GPP_B21, 0x44000700, 0x1000),
+ /* GSPI1_MOSI */ _PAD_CFG_STRUCT(GPP_B22, 0x44000700, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_B23, 0x44000100, 0x1000),
+ /* SMBCLK */ _PAD_CFG_STRUCT(GPP_C0, 0x44000702, 0x2800),
+ /* SMBDATA */ _PAD_CFG_STRUCT(GPP_C1, 0x44000702, 0x2800),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C2, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C3, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C4, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C5, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C6, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C7, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C8, 0x44000102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C9, 0x86080102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C10, 0x4000201, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C11, 0x44000102, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C12, 0x44000200, 0x2400),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C13, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C14, 0x44000201, 0x800),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C15, 0x82180102, 0x0),
+ /* I2C0_SDA */ _PAD_CFG_STRUCT(GPP_C16, 0x44000702, 0x0),
+ /* I2C0_SCL */ _PAD_CFG_STRUCT(GPP_C17, 0x44000702, 0x0),
+ /* I2C1_SDA */ _PAD_CFG_STRUCT(GPP_C18, 0x44000702, 0x0),
+ /* I2C1_SCL */ _PAD_CFG_STRUCT(GPP_C19, 0x44000702, 0x0),
+ /* UART2_RXD */ _PAD_CFG_STRUCT(GPP_C20, 0x44000702, 0x0),
+ /* UART2_TXD */ _PAD_CFG_STRUCT(GPP_C21, 0x44000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C22, 0x44000200, 0x2400),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_C23, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D0, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D1, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D2, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D3, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D4, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D5, 0x44000102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D6, 0x44000102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D7, 0x44000102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D8, 0x44000102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D9, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D10, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D11, 0x40000102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D12, 0x40000102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D13, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D14, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D15, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D16, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D17, 0x44000200, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D18, 0x44000201, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D19, 0x44000201, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D20, 0x4000201, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D21, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D22, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_D23, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E0, 0x44000100, 0x1000),
+ /* SATAXPCIE1 */ _PAD_CFG_STRUCT(GPP_E1, 0x44000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E2, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E3, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E4, 0x44000100, 0x1000),
+ /* SATA_DEVSLP1 */ _PAD_CFG_STRUCT(GPP_E5, 0x4000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E6, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E7, 0x80180102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E8, 0x44000201, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E9, 0x44000200, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E10, 0x44000200, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E11, 0x44000201, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E12, 0x44000200, 0x3000),
+ /* DDPB_HPD0 */ _PAD_CFG_STRUCT(GPP_E13, 0x44000700, 0x0),
+ /* DDPC_HPD1 */ _PAD_CFG_STRUCT(GPP_E14, 0x44000700, 0x0),
+ /* DDPD_HPD2 */ _PAD_CFG_STRUCT(GPP_E15, 0x44000702, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E16, 0x80880102, 0x3000),
+ /* EDP_HPD */ _PAD_CFG_STRUCT(GPP_E17, 0x44000702, 0x0),
+ /* DDPB_CTRLCLK */ _PAD_CFG_STRUCT(GPP_E18, 0x44000700, 0x0),
+ /* DDPB_CTRLDATA */ _PAD_CFG_STRUCT(GPP_E19, 0x44000700, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E20, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E21, 0x44000102, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E22, 0x44000100, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_E23, 0x44000201, 0x1000),
+ /* BATLOW# */ _PAD_CFG_STRUCT(GPD0, 0x4000702, 0x0),
+ /* ACPRESENT */ _PAD_CFG_STRUCT(GPD1, 0x4000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPD2, 0x4000100, 0x1000),
+ /* PWRBTN# */ _PAD_CFG_STRUCT(GPD3, 0x4000702, 0x3000),
+ /* SLP_S3# */ _PAD_CFG_STRUCT(GPD4, 0x4000700, 0x0),
+ /* SLP_S4# */ _PAD_CFG_STRUCT(GPD5, 0x4000700, 0x0),
+ /* SLP_A# */ _PAD_CFG_STRUCT(GPD6, 0x4000600, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPD7, 0x4000201, 0x0),
+ /* SUSCLK */ _PAD_CFG_STRUCT(GPD8, 0x4000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPD9, 0x4000200, 0x0),
+ /* SLP_S5# */ _PAD_CFG_STRUCT(GPD10, 0x4000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPD11, 0x4000200, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F0, 0x44000200, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F1, 0x44000200, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F2, 0x44000200, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F3, 0x44000200, 0x1000),
+ /* I2C2_SDA */ _PAD_CFG_STRUCT(GPP_F4, 0x44000702, 0x2000000),
+ /* I2C2_SCL */ _PAD_CFG_STRUCT(GPP_F5, 0x44000702, 0x2000000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F6, 0x44000201, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F7, 0x80180102, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F8, 0x40080100, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F9, 0x44000201, 0x3000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F10, 0x44000200, 0x1000),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F11, 0x44000201, 0x0),
+ /* EMMC_CMD */ _PAD_CFG_STRUCT(GPP_F12, 0x44000702, 0x0),
+ /* EMMC_DATA0 */ _PAD_CFG_STRUCT(GPP_F13, 0x44000702, 0x0),
+ /* EMMC_DATA1 */ _PAD_CFG_STRUCT(GPP_F14, 0x44000702, 0x0),
+ /* EMMC_DATA2 */ _PAD_CFG_STRUCT(GPP_F15, 0x44000702, 0x0),
+ /* EMMC_DATA3 */ _PAD_CFG_STRUCT(GPP_F16, 0x44000702, 0x0),
+ /* EMMC_DATA4 */ _PAD_CFG_STRUCT(GPP_F17, 0x44000702, 0x0),
+ /* EMMC_DATA5 */ _PAD_CFG_STRUCT(GPP_F18, 0x44000702, 0x0),
+ /* EMMC_DATA6 */ _PAD_CFG_STRUCT(GPP_F19, 0x44000702, 0x0),
+ /* EMMC_DATA7 */ _PAD_CFG_STRUCT(GPP_F20, 0x44000702, 0x0),
+ /* EMMC_RCLK */ _PAD_CFG_STRUCT(GPP_F21, 0x44000700, 0x0),
+ /* EMMC_CLK */ _PAD_CFG_STRUCT(GPP_F22, 0x44000700, 0x0),
+ /* GPIO */ _PAD_CFG_STRUCT(GPP_F23, 0x44000200, 0x1000),
+ /* SD_CMD */ _PAD_CFG_STRUCT(GPP_G0, 0x44000702, 0x0),
+ /* SD_DATA0 */ _PAD_CFG_STRUCT(GPP_G1, 0x44000702, 0x0),
+ /* SD_DATA1 */ _PAD_CFG_STRUCT(GPP_G2, 0x44000702, 0x0),
+ /* SD_DATA2 */ _PAD_CFG_STRUCT(GPP_G3, 0x44000702, 0x0),
+ /* SD_DATA3 */ _PAD_CFG_STRUCT(GPP_G4, 0x44000702, 0x0),
+ /* SD_CD# */ _PAD_CFG_STRUCT(GPP_G5, 0x44000700, 0x3000),
+ /* SD_CLK */ _PAD_CFG_STRUCT(GPP_G6, 0x44000702, 0x0),
+ /* SD_WP */ _PAD_CFG_STRUCT(GPP_G7, 0x44000700, 0x0),
+};
+
+#endif
+
+#endif
diff --git a/src/mainboard/chuwi/minibook/hda_verb.c b/src/mainboard/chuwi/minibook/hda_verb.c
new file mode 100644
index 0000000..c654e70
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/hda_verb.c
@@ -0,0 +1,47 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Intel Corporation.
+ * Copyright (C) 2019 Sergey Larin <cerg2010cerg2010(a)mail.ru>
+ *
+ * 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[] = {
+ /* Realtek, ALC269VC */
+ 0x10ec0269, /* Vendor ID */
+ 0x10ec0000, /* Subsystem ID */
+ 11, /* Number of entries */
+ AZALIA_SUBVENDOR(0, 0x10ec0000),
+ AZALIA_PIN_CFG(0, 0x12, 0xb7a60140),
+ AZALIA_PIN_CFG(0, 0x14, 0x90170120),
+ AZALIA_PIN_CFG(0, 0x15, 0x04211010),
+ AZALIA_PIN_CFG(0, 0x17, 0x40000000),
+ AZALIA_PIN_CFG(0, 0x18, 0x04a11030),
+ AZALIA_PIN_CFG(0, 0x19, 0x411111f0),
+ AZALIA_PIN_CFG(0, 0x1a, 0x411111f0),
+ AZALIA_PIN_CFG(0, 0x1b, 0x411111f0),
+ AZALIA_PIN_CFG(0, 0x1d, 0x40e4a205),
+ AZALIA_PIN_CFG(0, 0x1e, 0x411111f0),
+
+ /* Intel, KabylakeHDMI */
+ 0x8086280b, /* Vendor ID */
+ 0x80860101, /* Subsystem ID */
+ 4, /* Number of entries */
+ AZALIA_SUBVENDOR(2, 0x80860101),
+ AZALIA_PIN_CFG(2, 0x05, 0x18560010),
+ AZALIA_PIN_CFG(2, 0x06, 0x18560010),
+ AZALIA_PIN_CFG(2, 0x07, 0x18560010),
+};
+
+const u32 pc_beep_verbs[] = {};
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/chuwi/minibook/mainboard.c b/src/mainboard/chuwi/minibook/mainboard.c
new file mode 100644
index 0000000..7f1f114
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/mainboard.c
@@ -0,0 +1,48 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Purism SPC
+ *
+ * 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 <smbios.h>
+#include <string.h>
+#include <cbfs.h>
+
+#define MAX_SERIAL_LENGTH 0x100
+
+const char *smbios_mainboard_serial_number(void)
+{
+ static char serial_number[MAX_SERIAL_LENGTH + 1] = {0};
+ struct cbfsf file;
+
+ if (serial_number[0] != 0)
+ return serial_number;
+
+ if (cbfs_boot_locate(&file, "serial_number", NULL) == 0) {
+ struct region_device cbfs_region;
+ size_t ser_len;
+
+ cbfs_file_data(&cbfs_region, &file);
+
+ ser_len = region_device_sz(&cbfs_region);
+ if (ser_len <= MAX_SERIAL_LENGTH) {
+ if (rdev_readat(&cbfs_region, serial_number, 0, ser_len) == ser_len) {
+ serial_number[ser_len] = 0;
+ return serial_number;
+ }
+ }
+ }
+
+ strncpy(serial_number, CONFIG_MAINBOARD_SERIAL_NUMBER, MAX_SERIAL_LENGTH);
+
+ return serial_number;
+}
diff --git a/src/mainboard/chuwi/minibook/ramstage.c b/src/mainboard/chuwi/minibook/ramstage.c
new file mode 100644
index 0000000..94f8071
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/ramstage.c
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corporation
+ * Copyright (C) 2015 Google Inc.
+ *
+ * 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 <soc/ramstage.h>
+#include "gpio.h"
+
+void mainboard_silicon_init_params(FSP_SIL_UPD *params)
+{
+ /* Configure pads prior to SiliconInit() in case there's any
+ * dependencies during hardware initialization. */
+ gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
+}
diff --git a/src/mainboard/chuwi/minibook/romstage.c b/src/mainboard/chuwi/minibook/romstage.c
new file mode 100644
index 0000000..d57adc5
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/romstage.c
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2010 coresystems GmbH
+ * Copyright (C) 2015 Google Inc.
+ * Copyright (C) 2015 Intel Corporation
+ * Copyright (C) 2017 Purism SPC.
+ *
+ * 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 <assert.h>
+#include <console/console.h>
+#include <soc/romstage.h>
+#include <spd_bin.h>
+#include "spd/spd.h"
+#include <ec/acpi/ec.h>
+#include <stdint.h>
+#include <stddef.h>
+
+void mainboard_memory_init_params(FSPM_UPD *mupd)
+{
+ FSP_M_CONFIG *mem_cfg;
+ mem_cfg = &mupd->FspmConfig;
+
+ printk(BIOS_INFO, "SPD index %d\n", 0);
+
+ mainboard_fill_dq_map_data(&mem_cfg->DqByteMapCh0);
+ mainboard_fill_dqs_map_data(&mem_cfg->DqsMapCpu2DramCh0);
+ mainboard_fill_rcomp_res_data(&mem_cfg->RcompResistor);
+ mainboard_fill_rcomp_strength_data(&mem_cfg->RcompTarget);
+
+ struct region_device spd_rdev;
+
+ mem_cfg->DqPinsInterleaved = 0;
+ if (get_spd_cbfs_rdev(&spd_rdev, 0) < 0)
+ die("spd.bin not found\n");
+ mem_cfg->MemorySpdDataLen = region_device_sz(&spd_rdev);
+ /* Memory leak is ok since we have memory mapped boot media */
+ // TODO evaluate google/eve way of loading
+ mem_cfg->MemorySpdPtr00 = (uintptr_t)rdev_mmap_full(&spd_rdev);
+ //mem_cfg->MemorySpdPtr10 = mem_cfg->MemorySpdPtr00;
+ print_spd_info((uint8_t*)mem_cfg->MemorySpdPtr00);
+
+ mupd->FspmTestConfig.DmiVc1 = 1;
+}
diff --git a/src/mainboard/chuwi/minibook/spd/Makefile.inc b/src/mainboard/chuwi/minibook/spd/Makefile.inc
new file mode 100644
index 0000000..3f2fde0
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/spd/Makefile.inc
@@ -0,0 +1,21 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2019 Johanna Schander <coreboot(a)mimoja.de>
+##
+## 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.
+##
+
+romstage-y += spd_util.c
+
+SPD_BIN = $(obj)/spd.bin
+
+# It's probably the same SPD used for 16GB version
+SPD_SOURCES += micron # 0b0000 8GB
diff --git a/src/mainboard/chuwi/minibook/spd/micron.spd.hex b/src/mainboard/chuwi/minibook/spd/micron.spd.hex
new file mode 100644
index 0000000..0f1c25f
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/spd/micron.spd.hex
@@ -0,0 +1,32 @@
+91 20 f1 03 05 1a 05 0a 03 11 01 08 0a 00 00 01
+78 78 90 50 90 11 50 e0 90 06 3c 3c 01 90 00 00
+00 b1 00 00 00 00 00 a8 00 88 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 80 2c 00 00 00 00 00 00 00 da b0
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
diff --git a/src/mainboard/chuwi/minibook/spd/spd.h b/src/mainboard/chuwi/minibook/spd/spd.h
new file mode 100644
index 0000000..36363cc
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/spd/spd.h
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
+ * Copyright (C) 2019 Johanna Schander <coreboot(a)mimoja.de>
+ *
+ * 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 MAINBOARD_SPD_H
+#define MAINBOARD_SPD_H
+
+#include <gpio.h>
+#include "../gpio.h"
+
+void mainboard_fill_dq_map_data(void *dq_map_ptr);
+void mainboard_fill_dqs_map_data(void *dqs_map_ptr);
+void mainboard_fill_rcomp_res_data(void *rcomp_ptr);
+void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr);
+#endif
diff --git a/src/mainboard/chuwi/minibook/spd/spd_util.c b/src/mainboard/chuwi/minibook/spd/spd_util.c
new file mode 100644
index 0000000..babd8ef
--- /dev/null
+++ b/src/mainboard/chuwi/minibook/spd/spd_util.c
@@ -0,0 +1,56 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Intel Corporation.
+ *
+ * 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 "spd.h"
+
+void mainboard_fill_dq_map_data(void *dq_map_ptr)
+{
+ /* DQ byte map */
+ const u8 dq_map[2][12] = {
+ {0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0, 0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00},
+ {0x33, 0xCC, 0x00, 0xCC, 0x33, 0xCC, 0x33, 0x00, 0xFF, 0x00, 0xFF, 0x00}};
+ memcpy(dq_map_ptr, dq_map, sizeof(dq_map));
+}
+
+void mainboard_fill_dqs_map_data(void *dqs_map_ptr)
+{
+ /* DQS CPU<>DRAM map */
+ //const u8 dqs_map[2][8] = {{0, 1, 3, 2, 4, 5, 6, 7}, {1, 0, 4, 5, 2, 3, 6, 7}};
+ const u8 dqs_map[2][8] = {{6, 4, 7, 5, 1, 3, 2, 0},
+ {3, 1, 6, 4, 2, 0, 5, 7}};
+ memcpy(dqs_map_ptr, dqs_map, sizeof(dqs_map));
+}
+
+void mainboard_fill_rcomp_res_data(void *rcomp_ptr)
+{
+ /* Rcomp resistor */
+ /* Cannot find these in original BIOS, so use defaults */
+ /* They are valid, probably */
+ const u16 RcompResistor[3] = {200, 81, 162};
+ memcpy(rcomp_ptr, RcompResistor, sizeof(RcompResistor));
+}
+
+void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr)
+{
+ /* Rcomp target */
+ /* Cannot find these in original BIOS, so use defaults */
+ /* They are valid, probably */
+ static const u16 RcompTarget[5] = {100, 40, 40, 23, 40};
+
+ memcpy(rcomp_strength_ptr, RcompTarget, sizeof(RcompTarget));
+}
diff --git a/src/superio/ite/it8987e/Kconfig b/src/superio/ite/it8987e/Kconfig
new file mode 100644
index 0000000..b8e3258
--- /dev/null
+++ b/src/superio/ite/it8987e/Kconfig
@@ -0,0 +1,18 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2019 Sergey Larin <cerg2010cerg2010(a)mail.ru>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+
+config SUPERIO_ITE_IT8987E
+ bool
+ select SUPERIO_ITE_COMMON_PRE_RAM
diff --git a/src/superio/ite/it8987e/Makefile.inc b/src/superio/ite/it8987e/Makefile.inc
new file mode 100644
index 0000000..01e4d3e
--- /dev/null
+++ b/src/superio/ite/it8987e/Makefile.inc
@@ -0,0 +1,17 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2019 Sergey Larin <cerg2010cerg2010(a)mail.ru>
+##
+## 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.
+##
+
+ramstage-$(CONFIG_SUPERIO_ITE_IT8987E) += superio.c
diff --git a/src/superio/ite/it8987e/it8987e.h b/src/superio/ite/it8987e/it8987e.h
new file mode 100644
index 0000000..4e265df
--- /dev/null
+++ b/src/superio/ite/it8987e/it8987e.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Sergey Larin <cerg2010cerg2010(a)mail.ru>
+ *
+ * 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.
+ */
+
+#ifndef SUPERIO_ITE_IT8987E_H
+#define SUPERIO_ITE_IT8987E_H
+
+#define IT8987E_SWUC 0x04 /* System Wake-Up */
+#define IT8987E_KBCM 0x05 /* PS/2 mouse */
+#define IT8987E_KBCK 0x06 /* PS/2 keyboard */
+#define IT8987E_IR 0x0a /* Consumer IR */
+#define IT8987E_SMFI 0x0f /* Shared Memory/Flash Interface */
+#define IT8987E_RTCT 0x10 /* RTC-like Timer */
+#define IT8987E_PMC1 0x11 /* Power Management Channel 1 */
+#define IT8987E_PMC2 0x12 /* Power Management Channel 2 */
+#define IT8987E_SSPI 0x13 /* Serial Peripheral Interface */
+#define IT8987E_PECI 0x14 /* Platform EC Interface */
+#define IT8987E_PMC3 0x17 /* Power Management Channel 3 */
+#define IT8987E_PMC4 0x18 /* Power Management Channel 4 */
+#define IT8987E_PMC5 0x19 /* Power Management Channel 5 */
+
+
+#endif /* SUPERIO_ITE_IT8987E_H */
diff --git a/src/superio/ite/it8987e/superio.c b/src/superio/ite/it8987e/superio.c
new file mode 100644
index 0000000..dce7a6f
--- /dev/null
+++ b/src/superio/ite/it8987e/superio.c
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Sergey Larin <cerg2010cerg2010(a)mail.ru>
+ *
+ * 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 <device/pnp.h>
+#include <superio/conf_mode.h>
+
+#include "it8987e.h"
+
+static void it8987e_init(struct device *dev)
+{
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_alt_enable,
+ .init = it8987e_init,
+ .ops_pnp_mode = &pnp_conf_mode_870155_aa,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { NULL, IT8987E_SWUC, PNP_IO0 | PNP_IRQ0, 0xfff0, },
+ { NULL, IT8987E_KBCM, PNP_IRQ0, },
+ { NULL, IT8987E_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff, },
+ { NULL, IT8987E_IR, PNP_IO0 | PNP_IRQ0, 0xfff8, },
+ { NULL, IT8987E_SMFI, PNP_IO0 | PNP_IRQ0 | PNP_MSC4, 0xfff0, },
+ { NULL, IT8987E_RTCT, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IO3 | PNP_IRQ0
+ | PNP_MSC0 | PNP_MSC1 | PNP_MSC2,
+ 0xfffe, 0xfffe, 0xfffe, 0xfffe},
+ { NULL, IT8987E_PMC1, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff },
+ { NULL, IT8987E_PMC2, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IRQ0 | PNP_MSC0,
+ 0x07fc, 0x07fc, 0xfff0 },
+ { NULL, IT8987E_SSPI, PNP_IO0 | PNP_IRQ0, 0xfff8 },
+ { NULL, IT8987E_PECI, PNP_IO0, 0xfff8 },
+ { NULL, IT8987E_PMC3, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff },
+ { NULL, IT8987E_PMC4, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_MSC0,
+ 0x07ff, 0x07ff },
+ { NULL, IT8987E_PMC5, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_MSC0,
+ 0x07ff, 0x07ff },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_ite_it8987e_ops = {
+ CHIP_NAME("ITE IT8987E Super I/O")
+ .enable_dev = enable_dev,
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/38249
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7cfa4588802b9c07b504f03471265574608519c8
Gerrit-Change-Number: 38249
Gerrit-PatchSet: 1
Gerrit-Owner: Sergey Larin <cerg2010cerg2010(a)mail.ru>
Gerrit-MessageType: newchange
6
9

Change in coreboot[master]: mb/intel/dq45ek: Add new mainboard
by Samuel Holland (Code Review) June 8, 2024
by Samuel Holland (Code Review) June 8, 2024
June 8, 2024
Samuel Holland has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44696 )
Change subject: mb/intel/dq45ek: Add new mainboard
......................................................................
mb/intel/dq45ek: Add new mainboard
The Intel DQ45EK is a mini-ITX motherboard featuring the Q45 chipset.
The flash chip is soldered in the center of the bottom of the board, and
cannot be flashed in-system, so flashing the board requires overriding
the IFD permissions (grounding GPIO33 when powering the board on) or
desoldering the chip.
At that point, the ME firmware region can be completely removed (this
will break fan control).
Tested, working:
* SeaBIOS, Tianocore
* libgfxinit (both DVI ports, plus VGA on DVI-I)
* PCIe x1 slot
* COM1
* Audio, Ethernet, SATA (AHCI/IDE), USB (1.1/2.0)
* S3 suspend/resume
* power_on_after_fail option
Change-Id: I565690c4ed7b4ae60760b8fa6b1e2d783f8e094b
Signed-off-by: Samuel Holland <samuel(a)sholland.org>
---
A src/mainboard/intel/dq45ek/Kconfig
A src/mainboard/intel/dq45ek/Kconfig.name
A src/mainboard/intel/dq45ek/Makefile.inc
A src/mainboard/intel/dq45ek/acpi/ec.asl
A src/mainboard/intel/dq45ek/acpi/ich10_pci_irqs.asl
A src/mainboard/intel/dq45ek/acpi/superio.asl
A src/mainboard/intel/dq45ek/acpi_tables.c
A src/mainboard/intel/dq45ek/board_info.txt
A src/mainboard/intel/dq45ek/cmos.default
A src/mainboard/intel/dq45ek/cmos.layout
A src/mainboard/intel/dq45ek/cstates.c
A src/mainboard/intel/dq45ek/data.vbt
A src/mainboard/intel/dq45ek/devicetree.cb
A src/mainboard/intel/dq45ek/dsdt.asl
A src/mainboard/intel/dq45ek/early_init.c
A src/mainboard/intel/dq45ek/gma-mainboard.ads
A src/mainboard/intel/dq45ek/gpio.c
A src/mainboard/intel/dq45ek/hda_verb.c
18 files changed, 487 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/44696/1
diff --git a/src/mainboard/intel/dq45ek/Kconfig b/src/mainboard/intel/dq45ek/Kconfig
new file mode 100644
index 0000000..593c878
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/Kconfig
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+if BOARD_INTEL_DQ45EK
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select CPU_INTEL_SOCKET_LGA775
+ select NORTHBRIDGE_INTEL_X4X
+ select SOUTHBRIDGE_INTEL_I82801JX
+ select SUPERIO_WINBOND_WPCD376I
+ select BOARD_ROMSIZE_KB_4096
+ select DRIVERS_I2C_CK505
+ select GFX_GMA_ANALOG_I2C_HDMI_C
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select HAVE_CMOS_DEFAULT
+ select HAVE_OPTION_TABLE
+ select INTEL_GMA_HAVE_VBT
+ select MAINBOARD_HAS_LIBGFXINIT
+ select MAINBOARD_USES_IFD_GBE_REGION
+
+config VGA_BIOS_ID
+ string
+ default "8086,2e02"
+
+config MAINBOARD_DIR
+ string
+ default "intel/dq45ek"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "DQ45EK"
+
+endif # BOARD_INTEL_DQ45EK
diff --git a/src/mainboard/intel/dq45ek/Kconfig.name b/src/mainboard/intel/dq45ek/Kconfig.name
new file mode 100644
index 0000000..aa065e8
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_INTEL_DQ45EK
+ bool "DQ45EK"
diff --git a/src/mainboard/intel/dq45ek/Makefile.inc b/src/mainboard/intel/dq45ek/Makefile.inc
new file mode 100644
index 0000000..ede8d87
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/Makefile.inc
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+ramstage-y += cstates.c
+romstage-y += gpio.c
+
+bootblock-y += early_init.c
+romstage-y += early_init.c
+
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
diff --git a/src/mainboard/intel/dq45ek/acpi/ec.asl b/src/mainboard/intel/dq45ek/acpi/ec.asl
new file mode 100644
index 0000000..2997587
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/acpi/ec.asl
@@ -0,0 +1 @@
+/* dummy */
diff --git a/src/mainboard/intel/dq45ek/acpi/ich10_pci_irqs.asl b/src/mainboard/intel/dq45ek/acpi/ich10_pci_irqs.asl
new file mode 100644
index 0000000..836523f
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/acpi/ich10_pci_irqs.asl
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/* This is board specific information:
+ * IRQ routing for the 0:1e.0 PCI bridge of the ICH10
+ */
+
+If (PICM) {
+ Return (Package() {
+ })
+} Else {
+ Return (Package() {
+ })
+}
diff --git a/src/mainboard/intel/dq45ek/acpi/superio.asl b/src/mainboard/intel/dq45ek/acpi/superio.asl
new file mode 100644
index 0000000..2997587
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/acpi/superio.asl
@@ -0,0 +1 @@
+/* dummy */
diff --git a/src/mainboard/intel/dq45ek/acpi_tables.c b/src/mainboard/intel/dq45ek/acpi_tables.c
new file mode 100644
index 0000000..f745951
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/acpi_tables.c
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi_gnvs.h>
+#include <southbridge/intel/i82801jx/nvs.h>
+
+void acpi_create_gnvs(struct global_nvs *gnvs)
+{
+ gnvs->pwrs = 1; /* Power state (AC = 1) */
+ gnvs->apic = 1; /* Enable APIC */
+ gnvs->mpen = 1; /* Enable Multi Processing */
+ gnvs->cmap = 1; /* Enable COM1 port */
+}
diff --git a/src/mainboard/intel/dq45ek/board_info.txt b/src/mainboard/intel/dq45ek/board_info.txt
new file mode 100644
index 0000000..eb1f4bf
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/board_info.txt
@@ -0,0 +1,7 @@
+Category: desktop
+Board URL: https://ark.intel.com/products/34688
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
+Release year: 2008
diff --git a/src/mainboard/intel/dq45ek/cmos.default b/src/mainboard/intel/dq45ek/cmos.default
new file mode 100644
index 0000000..706f5dd
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/cmos.default
@@ -0,0 +1,6 @@
+boot_option=Fallback
+debug_level=Debug
+power_on_after_fail=Disable
+nmi=Enable
+sata_mode=AHCI
+gfx_uma_size=64M
diff --git a/src/mainboard/intel/dq45ek/cmos.layout b/src/mainboard/intel/dq45ek/cmos.layout
new file mode 100644
index 0000000..2174ecd
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/cmos.layout
@@ -0,0 +1,96 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+# -----------------------------------------------------------------
+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
+#435 549 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 1 4M
+11 2 8M
+11 3 16M
+11 4 32M
+11 5 48M
+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/intel/dq45ek/cstates.c b/src/mainboard/intel/dq45ek/cstates.c
new file mode 100644
index 0000000..21b18b9
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/cstates.c
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpigen.h>
+
+int get_cst_entries(acpi_cstate_t **entries)
+{
+ return 0;
+}
diff --git a/src/mainboard/intel/dq45ek/data.vbt b/src/mainboard/intel/dq45ek/data.vbt
new file mode 100644
index 0000000..c4a94cb
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/data.vbt
Binary files differ
diff --git a/src/mainboard/intel/dq45ek/devicetree.cb b/src/mainboard/intel/dq45ek/devicetree.cb
new file mode 100644
index 0000000..d574498
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/devicetree.cb
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+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
+ subsystemid 0x8086 0x1004 inherit
+ device pci 0.0 on end # Host Bridge
+ device pci 2.0 on end # Integrated graphics controller
+ device pci 2.1 on end # Integrated graphics controller 2
+ chip southbridge/intel/i82801jx # Southbridge
+ register "gpe0_en" = "0x28000140"
+
+ register "sata_port_map" = "0x1f"
+
+ register "pcie_slot_implemented" = "0x8"
+
+ register "gen1_dec" = "0x00fc0a01"
+
+ device pci 19.0 on end # GBE
+ device pci 1a.0 on end # USB
+ device pci 1a.1 on end # USB
+ device pci 1a.2 on end # USB
+ device pci 1a.7 on end # USB
+ device pci 1b.0 on end # Audio
+ device pci 1c.0 on end # PCIe 1
+ device pci 1c.1 off end # PCIe 2
+ device pci 1c.2 off end # PCIe 3
+ device pci 1c.3 on end # PCIe 4
+ device pci 1c.4 off end # PCIe 5
+ device pci 1c.5 off end # PCIe 6
+ device pci 1d.0 on end # USB
+ device pci 1d.1 on end # USB
+ device pci 1d.2 on end # USB
+ device pci 1d.7 on end # USB
+ device pci 1e.0 off end # PCI bridge
+ device pci 1f.0 on # LPC bridge
+ chip superio/winbond/wpcd376i # Super I/O
+ device pnp 2e.0 off end # Floppy
+ device pnp 2e.1 off end # Parallel port
+ device pnp 2e.3 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 0x4
+ irq 0xf0 = 0x2
+ end
+ device pnp 2e.4 on # SWC
+ io 0x60 = 0xa00
+ io 0x62 = 0xa10
+ irq 0x70 = 0x0
+ end
+ device pnp 2e.5 off end # Mouse
+ device pnp 2e.6 off end # Keyboard
+ device pnp 2e.7 on # GPIO
+ io 0x60 = 0xa20
+ irq 0x70 = 0x0
+ irq 0xf0 = 0x17
+ irq 0xf1 = 0x03
+ irq 0xf2 = 0x00
+ irq 0xf3 = 0x00
+ irq 0xf8 = 0x01
+ end
+ device pnp 2e.15 off end # ECIR
+ device pnp 2e.16 off end # COM3 / IR
+ end
+ end
+ device pci 1f.2 on end # SATA
+ device pci 1f.3 on # SMBus
+ chip drivers/i2c/ck505 # SLG8XP549T
+ register "mask" = "{ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff }"
+ register "regs" = "{ 0x91, 0xd9, 0xff, 0xff,
+ 0xff, 0x00, 0x00, 0x06,
+ 0x03, 0x25, 0x01, 0x80, 0x0d }"
+ device i2c 69 on end
+ end
+ end
+ device pci 1f.5 off end # IDE
+ device pci 1f.6 off end # Thermal
+ end
+ end
+end
diff --git a/src/mainboard/intel/dq45ek/dsdt.asl b/src/mainboard/intel/dq45ek/dsdt.asl
new file mode 100644
index 0000000..de548d1
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/dsdt.asl
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x02, // DSDT revision: ACPI v2.0 and up
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x20090419 // OEM revision
+)
+{
+ // global NVS and variables
+ #include <southbridge/intel/common/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>
+ }
+ }
+
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+}
diff --git a/src/mainboard/intel/dq45ek/early_init.c b/src/mainboard/intel/dq45ek/early_init.c
new file mode 100644
index 0000000..dffde0a
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/early_init.c
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <bootblock_common.h>
+#include <northbridge/intel/x4x/x4x.h>
+#include <southbridge/intel/i82801jx/i82801jx.h>
+#include <superio/winbond/common/winbond.h>
+#include <superio/winbond/wpcd376i/wpcd376i.h>
+
+#define SERIAL_DEV PNP_DEV(0x2e, WPCD376I_SP1)
+
+void bootblock_mainboard_early_init(void)
+{
+ winbond_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+}
+
+void mb_get_spd_map(u8 spd_map[4])
+{
+ spd_map[0] = 0x50;
+ spd_map[2] = 0x52;
+}
diff --git a/src/mainboard/intel/dq45ek/gma-mainboard.ads b/src/mainboard/intel/dq45ek/gma-mainboard.ads
new file mode 100644
index 0000000..8b07c07
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/gma-mainboard.ads
@@ -0,0 +1,17 @@
+-- SPDX-License-Identifier: GPL-2.0-or-later
+
+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/intel/dq45ek/gpio.c b/src/mainboard/intel/dq45ek/gpio.c
new file mode 100644
index 0000000..1c64b2f
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/gpio.c
@@ -0,0 +1,117 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#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,
+ .gpio11 = GPIO_MODE_GPIO,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_GPIO,
+ .gpio17 = GPIO_MODE_GPIO,
+ .gpio18 = GPIO_MODE_GPIO,
+ .gpio20 = GPIO_MODE_GPIO,
+ .gpio21 = GPIO_MODE_GPIO,
+ .gpio22 = 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,
+ .gpio11 = GPIO_DIR_INPUT,
+ .gpio13 = GPIO_DIR_INPUT,
+ .gpio14 = GPIO_DIR_INPUT,
+ .gpio17 = GPIO_DIR_INPUT,
+ .gpio18 = GPIO_DIR_INPUT,
+ .gpio20 = GPIO_DIR_OUTPUT,
+ .gpio21 = GPIO_DIR_OUTPUT,
+ .gpio22 = GPIO_DIR_INPUT,
+ .gpio27 = GPIO_DIR_OUTPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio20 = GPIO_LEVEL_HIGH,
+ .gpio21 = GPIO_LEVEL_LOW,
+ .gpio27 = GPIO_LEVEL_LOW,
+ .gpio28 = GPIO_LEVEL_LOW,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_blink = {
+ .gpio18 = GPIO_BLINK,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_invert = {
+ .gpio13 = GPIO_INVERT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_mode = {
+ .gpio32 = GPIO_MODE_GPIO,
+ .gpio33 = GPIO_MODE_GPIO,
+ .gpio34 = 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,
+ .gpio60 = GPIO_MODE_GPIO,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_direction = {
+ .gpio32 = GPIO_DIR_OUTPUT,
+ .gpio33 = GPIO_DIR_INPUT,
+ .gpio34 = 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,
+ .gpio60 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio32 = GPIO_LEVEL_LOW,
+ .gpio49 = GPIO_LEVEL_LOW,
+ .gpio60 = GPIO_LEVEL_LOW,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_mode = {
+ .gpio72 = GPIO_MODE_GPIO,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_direction = {
+ .gpio72 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_level = { };
+
+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,
+ },
+ .set3 = {
+ .mode = &pch_gpio_set3_mode,
+ .direction = &pch_gpio_set3_direction,
+ .level = &pch_gpio_set3_level,
+ },
+
+};
diff --git a/src/mainboard/intel/dq45ek/hda_verb.c b/src/mainboard/intel/dq45ek/hda_verb.c
new file mode 100644
index 0000000..6a29631
--- /dev/null
+++ b/src/mainboard/intel/dq45ek/hda_verb.c
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
+ /* coreboot specific header */
+ 0x11d41882, // Vendor ID
+ 0x80861004, // Subsystem ID
+ 11, // Number of entries
+
+ /* Pin Widget Verb Table */
+
+ AZALIA_PIN_CFG(0, 0x11, 0x02214030),
+ AZALIA_PIN_CFG(0, 0x12, 0x01014010),
+ AZALIA_PIN_CFG(0, 0x13, 0x511711f0),
+ AZALIA_PIN_CFG(0, 0x14, 0x02a19040),
+ AZALIA_PIN_CFG(0, 0x15, 0x0181302e),
+ AZALIA_PIN_CFG(0, 0x16, 0x41011012),
+ AZALIA_PIN_CFG(0, 0x17, 0x01a19020),
+ AZALIA_PIN_CFG(0, 0x18, 0x59331122),
+ AZALIA_PIN_CFG(0, 0x1a, 0x91f711f0),
+ AZALIA_PIN_CFG(0, 0x1b, 0x4145f1a0),
+ AZALIA_PIN_CFG(0, 0x24, 0x41016011),
+};
+
+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);
--
To view, visit https://review.coreboot.org/c/coreboot/+/44696
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I565690c4ed7b4ae60760b8fa6b1e2d783f8e094b
Gerrit-Change-Number: 44696
Gerrit-PatchSet: 1
Gerrit-Owner: Samuel Holland <samuel(a)sholland.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
7
8

Change in coreboot[master]: mb/lenovo/thinkcentre_m91p add ThinkCentre M91p
by Name of user not set (Code Review) June 8, 2024
by Name of user not set (Code Review) June 8, 2024
June 8, 2024
Name of user not set #1003058 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44302 )
Change subject: mb/lenovo/thinkcentre_m91p add ThinkCentre M91p
......................................................................
mb/lenovo/thinkcentre_m91p add ThinkCentre M91p
Add mainboard for ThinkCentre M91p, this port was generated with autoport.
This is an OEM board with a Macronix MX25L6406E flash chip
Working:
- All DIMM slots
- libgfxinit
- VGA
- Flashing with flashrom
Untested:
- All USB Ports
- All PCIe Ports
- SATA Ports
- Audio output
- S3 suspend/resume
- Intel GbE
Issues: - Randomly hangs before and after a payload has chance to be loaded
Signed-off-by: bengris32 <bengrisdale123(a)gmail.com>
Change-Id: I48bf9093099abdece3b52d7169c000e25b400feb
---
A src/mainboard/lenovo/thinkcentre_m91p/Kconfig
A src/mainboard/lenovo/thinkcentre_m91p/Kconfig.name
A src/mainboard/lenovo/thinkcentre_m91p/Makefile.inc
A src/mainboard/lenovo/thinkcentre_m91p/acpi/ec.asl
A src/mainboard/lenovo/thinkcentre_m91p/acpi/platform.asl
A src/mainboard/lenovo/thinkcentre_m91p/acpi/superio.asl
A src/mainboard/lenovo/thinkcentre_m91p/acpi_tables.c
A src/mainboard/lenovo/thinkcentre_m91p/board_info.txt
A src/mainboard/lenovo/thinkcentre_m91p/data.vbt
A src/mainboard/lenovo/thinkcentre_m91p/devicetree.cb
A src/mainboard/lenovo/thinkcentre_m91p/dsdt.asl
A src/mainboard/lenovo/thinkcentre_m91p/early_init.c
A src/mainboard/lenovo/thinkcentre_m91p/gma-mainboard.ads
A src/mainboard/lenovo/thinkcentre_m91p/gpio.c
A src/mainboard/lenovo/thinkcentre_m91p/hda_verb.c
A src/mainboard/lenovo/thinkcentre_m91p/mainboard.c
16 files changed, 481 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/44302/1
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/Kconfig b/src/mainboard/lenovo/thinkcentre_m91p/Kconfig
new file mode 100644
index 0000000..07fc6cf
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/Kconfig
@@ -0,0 +1,32 @@
+if BOARD_LENOVO_THINKCENTRE_M91P
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_8192
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select INTEL_INT15
+ select MAINBOARD_HAS_LIBGFXINIT
+ select INTEL_GMA_HAVE_VBT
+ select NORTHBRIDGE_INTEL_SANDYBRIDGE
+ select MAINBOARD_USES_IFD_GBE_REGION
+ select SERIRQ_CONTINUOUS_MODE
+ select SOUTHBRIDGE_INTEL_BD82X6X
+ select USE_NATIVE_RAMINIT
+
+config MAINBOARD_DIR
+ string
+ default lenovo/thinkcentre_m91p
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "ThinkCentre M91p"
+
+config DRAM_RESET_GATE_GPIO # FIXME: check this
+ int
+ default 10
+
+config USBDEBUG_HCD_INDEX # FIXME: check this
+ int
+ default 2
+endif
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/Kconfig.name b/src/mainboard/lenovo/thinkcentre_m91p/Kconfig.name
new file mode 100644
index 0000000..01956a6
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_LENOVO_THINKCENTRE_M91P
+ bool "ThinkCentre M91p"
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/Makefile.inc b/src/mainboard/lenovo/thinkcentre_m91p/Makefile.inc
new file mode 100644
index 0000000..18391d8
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/Makefile.inc
@@ -0,0 +1,5 @@
+bootblock-y += early_init.c
+bootblock-y += gpio.c
+romstage-y += early_init.c
+romstage-y += gpio.c
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/acpi/ec.asl b/src/mainboard/lenovo/thinkcentre_m91p/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/acpi/ec.asl
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/acpi/platform.asl b/src/mainboard/lenovo/thinkcentre_m91p/acpi/platform.asl
new file mode 100644
index 0000000..afb8abb
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/acpi/platform.asl
@@ -0,0 +1,8 @@
+Method(_WAK, 1)
+{
+ Return(Package() {0, 0})
+}
+
+Method(_PTS, 1)
+{
+}
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/acpi/superio.asl b/src/mainboard/lenovo/thinkcentre_m91p/acpi/superio.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/acpi/superio.asl
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/acpi_tables.c b/src/mainboard/lenovo/thinkcentre_m91p/acpi_tables.c
new file mode 100644
index 0000000..f8364ab
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/acpi_tables.c
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi_gnvs.h>
+#include <southbridge/intel/bd82x6x/nvs.h>
+
+/* FIXME: check this function. */
+void acpi_create_gnvs(struct global_nvs *gnvs)
+{
+ /* The lid is open by default. */
+ gnvs->lids = 1;
+
+ /* Temperature at which OS will shutdown */
+ gnvs->tcrt = 100;
+ /* Temperature at which OS will throttle CPU */
+ gnvs->tpsv = 90;
+}
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/board_info.txt b/src/mainboard/lenovo/thinkcentre_m91p/board_info.txt
new file mode 100644
index 0000000..3353f8d
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/board_info.txt
@@ -0,0 +1,2 @@
+Category: desktop
+FIXME: check category, , put ROM package, ROM socketed, ROM protocol, Flashrom support, Release year
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/data.vbt b/src/mainboard/lenovo/thinkcentre_m91p/data.vbt
new file mode 100644
index 0000000..73336f72
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/data.vbt
Binary files differ
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/devicetree.cb b/src/mainboard/lenovo/thinkcentre_m91p/devicetree.cb
new file mode 100644
index 0000000..7a7da62
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/devicetree.cb
@@ -0,0 +1,105 @@
+chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
+ register "gfx" = "GMA_STATIC_DISPLAYS(0)"
+ register "gpu_cpu_backlight" = "0x00000000"
+ register "gpu_dp_b_hotplug" = "0"
+ register "gpu_dp_c_hotplug" = "0"
+ register "gpu_dp_d_hotplug" = "0"
+ register "gpu_panel_port_select" = "0"
+ register "gpu_panel_power_backlight_off_delay" = "0"
+ register "gpu_panel_power_backlight_on_delay" = "0"
+ register "gpu_panel_power_cycle_delay" = "0"
+ register "gpu_panel_power_down_delay" = "0"
+ register "gpu_panel_power_up_delay" = "0"
+ register "gpu_pch_backlight" = "0x00000000"
+ device cpu_cluster 0x0 on
+ chip cpu/intel/model_206ax # FIXME: check all registers
+ 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/bd82x6x # Intel Series 6 Cougar Point PCH
+ register "c2_latency" = "0x0065"
+ register "docking_supported" = "0"
+ register "gen1_dec" = "0x003c0a01"
+ register "gen2_dec" = "0x00000000"
+ register "gen3_dec" = "0x00000000"
+ register "gen4_dec" = "0x00000000"
+ register "pcie_hotplug_map" = "{ 0, 0, 0, 0, 0, 0, 0, 0 }"
+ register "pcie_port_coalesce" = "1"
+ register "sata_interface_speed_support" = "0x3"
+ register "sata_port_map" = "0x8"
+ register "spi_lvscc" = "0x0"
+ register "spi_uvscc" = "0x0"
+ device pci 16.0 on # Management Engine Interface 1
+ subsystemid 0x17aa 0x3070
+ 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
+ subsystemid 0x17aa 0x3070
+ end
+ device pci 1a.0 on # USB2 EHCI #2
+ subsystemid 0x17aa 0x3070
+ end
+ device pci 1b.0 on # High Definition Audio
+ subsystemid 0x17aa 0x3070
+ end
+ device pci 1c.0 off # PCIe Port #1
+ end
+ device pci 1c.1 off # PCIe Port #2
+ 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 0x3070
+ end
+ device pci 1e.0 on # PCI bridge
+ subsystemid 0x17aa 0x3070
+ end
+ device pci 1f.0 on # LPC bridge
+ subsystemid 0x17aa 0x3070
+ end
+ device pci 1f.2 on # SATA Controller 1
+ subsystemid 0x17aa 0x3070
+ end
+ device pci 1f.3 on # SMBus
+ subsystemid 0x17aa 0x3070
+ 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 0x3070
+ end
+ device pci 01.0 off # PEG
+ end
+ device pci 02.0 on # iGPU
+ subsystemid 0x17aa 0x3070
+ end
+ end
+end
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/dsdt.asl b/src/mainboard/lenovo/thinkcentre_m91p/dsdt.asl
new file mode 100644
index 0000000..e648a99
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/dsdt.asl
@@ -0,0 +1,28 @@
+#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
+#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
+
+
+#include <acpi/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/common/acpi/platform.asl>
+ #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+
+ Device (\_SB.PCI0)
+ {
+ #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
+ #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
+ #include <southbridge/intel/bd82x6x/acpi/pch.asl>
+ }
+}
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/early_init.c b/src/mainboard/lenovo/thinkcentre_m91p/early_init.c
new file mode 100644
index 0000000..e3facd4
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/early_init.c
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+
+#include <bootblock_common.h>
+#include <northbridge/intel/sandybridge/raminit_native.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+#include <device/pci.h>
+#include <device/pci_def.h>
+
+const struct southbridge_usb_port mainboard_usb_ports[] = {
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+};
+
+void bootblock_mainboard_early_init(void)
+{
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x3f01);
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0010);
+}
+
+/* FIXME: Put proper SPD map here. */
+void mainboard_get_spd(spd_raw_data *spd, bool id_only)
+{
+ read_spd(&spd[0], 0x50, id_only);
+ read_spd(&spd[1], 0x52, id_only);
+ read_spd(&spd[2], 0x51, id_only);
+ read_spd(&spd[3], 0x53, id_only);
+}
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/gma-mainboard.ads b/src/mainboard/lenovo/thinkcentre_m91p/gma-mainboard.ads
new file mode 100644
index 0000000..df757d1
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/gma-mainboard.ads
@@ -0,0 +1,16 @@
+-- SPDX-License-Identifier: GPL-2.0-or-later
+
+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,
+ Analog,
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/gpio.c b/src/mainboard/lenovo/thinkcentre_m91p/gpio.c
new file mode 100644
index 0000000..fc6b035
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/gpio.c
@@ -0,0 +1,179 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#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_NATIVE,
+ .gpio3 = GPIO_MODE_NATIVE,
+ .gpio4 = GPIO_MODE_NATIVE,
+ .gpio5 = GPIO_MODE_NATIVE,
+ .gpio6 = GPIO_MODE_GPIO,
+ .gpio7 = GPIO_MODE_GPIO,
+ .gpio8 = GPIO_MODE_GPIO,
+ .gpio9 = GPIO_MODE_NATIVE,
+ .gpio10 = GPIO_MODE_NATIVE,
+ .gpio11 = GPIO_MODE_GPIO,
+ .gpio12 = GPIO_MODE_NATIVE,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_NATIVE,
+ .gpio15 = GPIO_MODE_GPIO,
+ .gpio16 = GPIO_MODE_GPIO,
+ .gpio17 = GPIO_MODE_GPIO,
+ .gpio18 = GPIO_MODE_NATIVE,
+ .gpio19 = GPIO_MODE_NATIVE,
+ .gpio20 = GPIO_MODE_NATIVE,
+ .gpio21 = GPIO_MODE_NATIVE,
+ .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_GPIO,
+ .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,
+ .gpio6 = GPIO_DIR_INPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_OUTPUT,
+ .gpio11 = GPIO_DIR_INPUT,
+ .gpio13 = GPIO_DIR_INPUT,
+ .gpio15 = GPIO_DIR_OUTPUT,
+ .gpio16 = GPIO_DIR_INPUT,
+ .gpio17 = GPIO_DIR_INPUT,
+ .gpio22 = GPIO_DIR_INPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio27 = GPIO_DIR_INPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+ .gpio29 = GPIO_DIR_OUTPUT,
+ .gpio31 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio8 = GPIO_LEVEL_HIGH,
+ .gpio15 = GPIO_LEVEL_LOW,
+ .gpio24 = GPIO_LEVEL_LOW,
+ .gpio28 = GPIO_LEVEL_LOW,
+ .gpio29 = GPIO_LEVEL_HIGH,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_reset = {
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_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_GPIO,
+ .gpio33 = GPIO_MODE_GPIO,
+ .gpio34 = GPIO_MODE_GPIO,
+ .gpio35 = GPIO_MODE_NATIVE,
+ .gpio36 = GPIO_MODE_GPIO,
+ .gpio37 = GPIO_MODE_NATIVE,
+ .gpio38 = GPIO_MODE_NATIVE,
+ .gpio39 = GPIO_MODE_NATIVE,
+ .gpio40 = GPIO_MODE_GPIO,
+ .gpio41 = GPIO_MODE_NATIVE,
+ .gpio42 = GPIO_MODE_NATIVE,
+ .gpio43 = GPIO_MODE_NATIVE,
+ .gpio44 = GPIO_MODE_NATIVE,
+ .gpio45 = GPIO_MODE_NATIVE,
+ .gpio46 = GPIO_MODE_NATIVE,
+ .gpio47 = GPIO_MODE_NATIVE,
+ .gpio48 = GPIO_MODE_NATIVE,
+ .gpio49 = GPIO_MODE_GPIO,
+ .gpio50 = GPIO_MODE_NATIVE,
+ .gpio51 = GPIO_MODE_NATIVE,
+ .gpio52 = GPIO_MODE_NATIVE,
+ .gpio53 = GPIO_MODE_NATIVE,
+ .gpio54 = GPIO_MODE_NATIVE,
+ .gpio55 = GPIO_MODE_NATIVE,
+ .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 = {
+ .gpio32 = GPIO_DIR_OUTPUT,
+ .gpio33 = GPIO_DIR_INPUT,
+ .gpio34 = GPIO_DIR_INPUT,
+ .gpio36 = GPIO_DIR_INPUT,
+ .gpio40 = GPIO_DIR_INPUT,
+ .gpio49 = GPIO_DIR_INPUT,
+ .gpio57 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio32 = 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_NATIVE,
+ .gpio65 = GPIO_MODE_NATIVE,
+ .gpio66 = GPIO_MODE_NATIVE,
+ .gpio67 = GPIO_MODE_NATIVE,
+ .gpio68 = GPIO_MODE_GPIO,
+ .gpio69 = GPIO_MODE_GPIO,
+ .gpio70 = GPIO_MODE_NATIVE,
+ .gpio71 = GPIO_MODE_GPIO,
+ .gpio72 = GPIO_MODE_GPIO,
+ .gpio73 = GPIO_MODE_NATIVE,
+ .gpio74 = GPIO_MODE_NATIVE,
+ .gpio75 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_direction = {
+ .gpio68 = GPIO_DIR_INPUT,
+ .gpio69 = GPIO_DIR_INPUT,
+ .gpio71 = GPIO_DIR_INPUT,
+ .gpio72 = 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/thinkcentre_m91p/hda_verb.c b/src/mainboard/lenovo/thinkcentre_m91p/hda_verb.c
new file mode 100644
index 0000000..6786be0
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/hda_verb.c
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
+ 0x10ec0662, /* Codec Vendor / Device ID: Realtek */
+ 0x17aa3070, /* Subsystem ID */
+ 11, /* Number of 4 dword sets */
+ AZALIA_SUBVENDOR(0, 0x17aa3070),
+ AZALIA_PIN_CFG(0, 0x14, 0x01014010),
+ AZALIA_PIN_CFG(0, 0x15, 0x99130120),
+ AZALIA_PIN_CFG(0, 0x16, 0x411111f0),
+ AZALIA_PIN_CFG(0, 0x18, 0x01a19840),
+ AZALIA_PIN_CFG(0, 0x19, 0x02a19850),
+ AZALIA_PIN_CFG(0, 0x1a, 0x0181304f),
+ AZALIA_PIN_CFG(0, 0x1b, 0x0221401f),
+ AZALIA_PIN_CFG(0, 0x1c, 0x411111f0),
+ AZALIA_PIN_CFG(0, 0x1d, 0x4004c601),
+ AZALIA_PIN_CFG(0, 0x1e, 0x411111f0),
+
+ 0x80862805, /* Codec Vendor / Device ID: Intel */
+ 0x17aa3070, /* Subsystem ID */
+ 4, /* Number of 4 dword sets */
+ AZALIA_SUBVENDOR(3, 0x17aa3070),
+ AZALIA_PIN_CFG(3, 0x05, 0x58560010),
+ AZALIA_PIN_CFG(3, 0x06, 0x18560020),
+ AZALIA_PIN_CFG(3, 0x07, 0x58560030),
+
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/thinkcentre_m91p/mainboard.c b/src/mainboard/lenovo/thinkcentre_m91p/mainboard.c
new file mode 100644
index 0000000..e5cfebf
--- /dev/null
+++ b/src/mainboard/lenovo/thinkcentre_m91p/mainboard.c
@@ -0,0 +1,15 @@
+#include <device/device.h>
+#include <drivers/intel/gma/int15.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+
+static void mainboard_enable(struct device *dev)
+{
+ /* FIXME: fix these values. */
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
+ GMA_INT15_PANEL_FIT_DEFAULT,
+ GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
+}
+
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/44302
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I48bf9093099abdece3b52d7169c000e25b400feb
Gerrit-Change-Number: 44302
Gerrit-PatchSet: 1
Gerrit-Owner: Name of user not set #1003058
Gerrit-MessageType: newchange
6
25

June 8, 2024
Mac Mini has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49074 )
Change subject: Apple Mac Mini (mid 2011)
......................................................................
Apple Mac Mini (mid 2011)
Autoported and tested on real device
Signed-off-by: Mac Mini <mac-mini-2011(a)outlook.com>
Change-Id: Ied578e8a9c7ff2c041b5495491acb256019f1c6d
---
A src/mainboard/apple/macmini5_1/Kconfig
A src/mainboard/apple/macmini5_1/Kconfig.name
A src/mainboard/apple/macmini5_1/Makefile.inc
A src/mainboard/apple/macmini5_1/acpi/ec.asl
A src/mainboard/apple/macmini5_1/acpi/platform.asl
A src/mainboard/apple/macmini5_1/acpi/superio.asl
A src/mainboard/apple/macmini5_1/acpi_tables.c
A src/mainboard/apple/macmini5_1/board_info.txt
A src/mainboard/apple/macmini5_1/devicetree.cb
A src/mainboard/apple/macmini5_1/dsdt.asl
A src/mainboard/apple/macmini5_1/early_init.c
A src/mainboard/apple/macmini5_1/gma-mainboard.ads
A src/mainboard/apple/macmini5_1/gpio.c
A src/mainboard/apple/macmini5_1/hda_verb.c
A src/mainboard/apple/macmini5_1/mainboard.c
15 files changed, 494 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/49074/1
diff --git a/src/mainboard/apple/macmini5_1/Kconfig b/src/mainboard/apple/macmini5_1/Kconfig
new file mode 100644
index 0000000..edc994e
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/Kconfig
@@ -0,0 +1,36 @@
+if BOARD_APPLE_MACMINI5_1
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_8192
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select INTEL_INT15
+ select NORTHBRIDGE_INTEL_SANDYBRIDGE
+ select USE_NATIVE_RAMINIT
+ select SERIRQ_CONTINUOUS_MODE
+ select SOUTHBRIDGE_INTEL_BD82X6X
+ select MAINBOARD_HAS_LIBGFXINIT
+ # select HAVE_CMOS_DEFAULT
+ # select HAVE_OPTION_TABLE
+
+config MAINBOARD_DIR
+ string
+ default "apple/macmini5_1"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "Macmini5,1"
+
+config VGA_BIOS_FILE
+ string
+ default "pci8086,0126.rom"
+
+config VGA_BIOS_ID
+ string
+ default "8086,0126"
+
+config DRAM_RESET_GATE_GPIO
+ int
+ default 30
+endif
diff --git a/src/mainboard/apple/macmini5_1/Kconfig.name b/src/mainboard/apple/macmini5_1/Kconfig.name
new file mode 100644
index 0000000..bca6a27
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_APPLE_MACMINI5_1
+ bool "Macmini5,1"
diff --git a/src/mainboard/apple/macmini5_1/Makefile.inc b/src/mainboard/apple/macmini5_1/Makefile.inc
new file mode 100644
index 0000000..e402ffa
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/Makefile.inc
@@ -0,0 +1,6 @@
+bootblock-y += gpio.c
+romstage-y += gpio.c
+
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
+bootblock-y += early_init.c
+romstage-y += early_init.c
diff --git a/src/mainboard/apple/macmini5_1/acpi/ec.asl b/src/mainboard/apple/macmini5_1/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/acpi/ec.asl
diff --git a/src/mainboard/apple/macmini5_1/acpi/platform.asl b/src/mainboard/apple/macmini5_1/acpi/platform.asl
new file mode 100644
index 0000000..aff432b
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/acpi/platform.asl
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+Method(_WAK, 1)
+{
+ Return(Package() {0, 0})
+}
+
+Method(_PTS, 1)
+{
+}
diff --git a/src/mainboard/apple/macmini5_1/acpi/superio.asl b/src/mainboard/apple/macmini5_1/acpi/superio.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/acpi/superio.asl
diff --git a/src/mainboard/apple/macmini5_1/acpi_tables.c b/src/mainboard/apple/macmini5_1/acpi_tables.c
new file mode 100644
index 0000000..161689d
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/acpi_tables.c
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi_gnvs.h>
+#include <southbridge/intel/bd82x6x/nvs.h>
+
+void acpi_create_gnvs(struct global_nvs *gnvs)
+{
+ /* Temperature at which OS will shutdown */
+ gnvs->tcrt = 100;
+ /* Temperature at which OS will throttle CPU */
+ gnvs->tpsv = 90;
+}
diff --git a/src/mainboard/apple/macmini5_1/board_info.txt b/src/mainboard/apple/macmini5_1/board_info.txt
new file mode 100644
index 0000000..85a3d5d
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/board_info.txt
@@ -0,0 +1,6 @@
+Category: mini
+ROM protocol: SPI
+Flashrom support: y
+ROM package: SOIC-8
+ROM socketed: n
+Release year: 2011
diff --git a/src/mainboard/apple/macmini5_1/devicetree.cb b/src/mainboard/apple/macmini5_1/devicetree.cb
new file mode 100644
index 0000000..820bba9
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/devicetree.cb
@@ -0,0 +1,77 @@
+chip northbridge/intel/sandybridge
+ device cpu_cluster 0x0 on
+ chip cpu/intel/model_206ax
+ 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 0 on
+ subsystemid 0x8086 0x7270 inherit
+
+ device pci 00.0 on # Host bridge
+ subsystemid 0x106b 0x00e6
+ end
+ device pci 01.0 on # PCI Express Graphics
+ subsystemid 0x106b 0x00e6
+ end
+ device pci 01.1 on # Thunderbolt
+ subsystemid 0x106b 0x00e6
+ end
+ device pci 02.0 on # iGPU
+ subsystemid 0x106b 0x00e6
+ end
+ device pci 04.0 off end # Signal Processing Controller ??
+
+ chip southbridge/intel/bd82x6x # Intel Series 6 Chipset
+ register "c2_latency" = "0x0065"
+ register "docking_supported" = "0"
+ register "gen1_dec" = "0x000c0681"
+ register "gen2_dec" = "0x000c1641"
+ register "gen3_dec" = "0x001c0301"
+ register "gen4_dec" = "0x00fc0701"
+ register "pcie_hotplug_map" = "{ 0, 0, 0, 0, 0, 0, 0, 0 }"
+ register "pcie_port_coalesce" = "1"
+ register "sata_interface_speed_support" = "0x3"
+ register "sata_port_map" = "0x3"
+ register "spi_lvscc" = "0x0"
+ register "spi_uvscc" = "0x2005"
+
+ 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 off end # Intel Gigabit Ethernet
+
+ device pci 1a.0 on end # USB2 EHCI #2
+ device pci 1a.7 on end
+
+ device pci 1b.0 on end # High Definition Audio
+ device pci 1c.0 on end # Ethernet Controller
+ device pci 1c.1 on end # Broadcom WiFi
+ device pci 1c.2 on end # FireWire
+
+ 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 1d.7 on end
+
+ device pci 1e.0 off end # PCI bridge
+
+ device pci 1f.0 on end # LPC bridge
+ 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/apple/macmini5_1/dsdt.asl b/src/mainboard/apple/macmini5_1/dsdt.asl
new file mode 100644
index 0000000..27d14ae
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/dsdt.asl
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
+#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
+
+#include <acpi/acpi.h>
+
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ ACPI_DSDT_REV_2,
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x20141018 /* OEM revision */
+)
+{
+ #include "acpi/platform.asl"
+ #include <cpu/intel/common/acpi/cpu.asl>
+ #include <southbridge/intel/common/acpi/platform.asl>
+ #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+
+ Device (\_SB.PCI0)
+ {
+ #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
+ #include <southbridge/intel/bd82x6x/acpi/pch.asl>
+ #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
+ }
+}
diff --git a/src/mainboard/apple/macmini5_1/early_init.c b/src/mainboard/apple/macmini5_1/early_init.c
new file mode 100644
index 0000000..c02d482
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/early_init.c
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/pci_ops.h>
+#include <device/pci_def.h>
+#include <bootblock_common.h>
+#include <northbridge/intel/sandybridge/raminit_native.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+
+const struct southbridge_usb_port mainboard_usb_ports[] = {
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+ { 1, 0, -1 },
+};
+
+void bootblock_mainboard_early_init(void)
+{
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x3f0f);
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0070);
+}
+
+void mainboard_get_spd(spd_raw_data *spd, bool id_only)
+{
+ read_spd(&spd[0], 0x50, id_only);
+ read_spd(&spd[2], 0x52, id_only);
+}
diff --git a/src/mainboard/apple/macmini5_1/gma-mainboard.ads b/src/mainboard/apple/macmini5_1/gma-mainboard.ads
new file mode 100644
index 0000000..e07e1e9
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/gma-mainboard.ads
@@ -0,0 +1,13 @@
+-- SPDX-License-Identifier: GPL-2.0-or-later
+
+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, HDMI1, DP3, HDMI3, others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/apple/macmini5_1/gpio.c b/src/mainboard/apple/macmini5_1/gpio.c
new file mode 100644
index 0000000..e69fd26
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/gpio.c
@@ -0,0 +1,216 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#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_GPIO,
+ .gpio10 = GPIO_MODE_GPIO,
+ .gpio11 = GPIO_MODE_GPIO,
+ .gpio12 = GPIO_MODE_GPIO,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_GPIO,
+ .gpio15 = GPIO_MODE_GPIO,
+ .gpio16 = GPIO_MODE_GPIO,
+ .gpio17 = GPIO_MODE_GPIO,
+ .gpio18 = GPIO_MODE_NATIVE,
+ .gpio19 = GPIO_MODE_GPIO,
+ .gpio20 = GPIO_MODE_NATIVE,
+ .gpio21 = GPIO_MODE_GPIO,
+ .gpio22 = GPIO_MODE_GPIO,
+ .gpio23 = GPIO_MODE_GPIO,
+ .gpio24 = GPIO_MODE_GPIO,
+ .gpio25 = GPIO_MODE_NATIVE,
+ .gpio26 = GPIO_MODE_NATIVE,
+ .gpio27 = GPIO_MODE_GPIO,
+ .gpio28 = GPIO_MODE_GPIO,
+ .gpio29 = GPIO_MODE_GPIO,
+ .gpio30 = GPIO_MODE_GPIO,
+ .gpio31 = GPIO_MODE_NATIVE,
+};
+
+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_INPUT,
+ .gpio4 = GPIO_DIR_INPUT,
+ .gpio5 = GPIO_DIR_INPUT,
+ .gpio6 = GPIO_DIR_INPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_INPUT,
+ .gpio9 = GPIO_DIR_INPUT,
+ .gpio10 = GPIO_DIR_INPUT,
+ .gpio11 = GPIO_DIR_INPUT,
+ .gpio12 = GPIO_DIR_INPUT,
+ .gpio13 = GPIO_DIR_INPUT,
+ .gpio14 = GPIO_DIR_INPUT,
+ .gpio15 = GPIO_DIR_INPUT,
+ .gpio16 = GPIO_DIR_OUTPUT,
+ .gpio17 = GPIO_DIR_INPUT,
+ .gpio19 = GPIO_DIR_INPUT,
+ .gpio21 = GPIO_DIR_OUTPUT,
+ .gpio22 = GPIO_DIR_OUTPUT,
+ .gpio23 = GPIO_DIR_OUTPUT,
+ .gpio24 = GPIO_DIR_INPUT,
+ .gpio27 = GPIO_DIR_INPUT,
+ .gpio28 = GPIO_DIR_INPUT,
+ .gpio29 = GPIO_DIR_INPUT,
+ .gpio30 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio16 = GPIO_LEVEL_LOW,
+ .gpio21 = GPIO_LEVEL_LOW,
+ .gpio22 = GPIO_LEVEL_LOW,
+ .gpio23 = GPIO_LEVEL_HIGH,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_reset = {
+ .gpio24 = GPIO_RESET_RSMRST,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_invert = {
+ .gpio1 = GPIO_INVERT,
+ .gpio4 = GPIO_INVERT,
+ .gpio5 = GPIO_INVERT,
+ .gpio7 = GPIO_INVERT,
+ .gpio9 = 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_GPIO,
+ .gpio41 = GPIO_MODE_GPIO,
+ .gpio42 = GPIO_MODE_GPIO,
+ .gpio43 = GPIO_MODE_GPIO,
+ .gpio44 = GPIO_MODE_GPIO,
+ .gpio45 = GPIO_MODE_GPIO,
+ .gpio46 = GPIO_MODE_GPIO,
+ .gpio47 = GPIO_MODE_NATIVE,
+ .gpio48 = GPIO_MODE_GPIO,
+ .gpio49 = GPIO_MODE_GPIO,
+ .gpio50 = GPIO_MODE_GPIO,
+ .gpio51 = GPIO_MODE_NATIVE,
+ .gpio52 = GPIO_MODE_NATIVE,
+ .gpio53 = GPIO_MODE_NATIVE,
+ .gpio54 = GPIO_MODE_NATIVE,
+ .gpio55 = GPIO_MODE_NATIVE,
+ .gpio56 = GPIO_MODE_GPIO,
+ .gpio57 = GPIO_MODE_GPIO,
+ .gpio58 = GPIO_MODE_NATIVE,
+ .gpio59 = GPIO_MODE_GPIO,
+ .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_OUTPUT,
+ .gpio35 = GPIO_DIR_INPUT,
+ .gpio36 = GPIO_DIR_INPUT,
+ .gpio37 = GPIO_DIR_OUTPUT,
+ .gpio38 = GPIO_DIR_OUTPUT,
+ .gpio39 = GPIO_DIR_OUTPUT,
+ .gpio40 = GPIO_DIR_INPUT,
+ .gpio41 = GPIO_DIR_INPUT,
+ .gpio42 = GPIO_DIR_INPUT,
+ .gpio43 = GPIO_DIR_INPUT,
+ .gpio44 = GPIO_DIR_INPUT,
+ .gpio45 = GPIO_DIR_OUTPUT,
+ .gpio46 = GPIO_DIR_INPUT,
+ .gpio48 = GPIO_DIR_INPUT,
+ .gpio49 = GPIO_DIR_OUTPUT,
+ .gpio50 = GPIO_DIR_INPUT,
+ .gpio56 = GPIO_DIR_INPUT,
+ .gpio57 = GPIO_DIR_INPUT,
+ .gpio59 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio33 = GPIO_LEVEL_LOW,
+ .gpio34 = GPIO_LEVEL_HIGH,
+ .gpio37 = GPIO_LEVEL_LOW,
+ .gpio38 = GPIO_LEVEL_LOW,
+ .gpio39 = GPIO_LEVEL_LOW,
+ .gpio45 = GPIO_LEVEL_LOW,
+ .gpio49 = GPIO_LEVEL_LOW,
+};
+
+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/apple/macmini5_1/hda_verb.c b/src/mainboard/apple/macmini5_1/hda_verb.c
new file mode 100644
index 0000000..e622098
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/hda_verb.c
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
+ 0x10134206, /* Codec Vendor / Device ID: Cirrus */
+ 0x106b2100, /* Subsystem ID */
+ 11, /* Number of 4 dword sets */
+ AZALIA_SUBVENDOR(0, 0x106b2100),
+ AZALIA_PIN_CFG(0, 0x09, 0x400000f0),
+ AZALIA_PIN_CFG(0, 0x0a, 0x002b4040),
+ AZALIA_PIN_CFG(0, 0x0b, 0x90100130),
+ AZALIA_PIN_CFG(0, 0x0c, 0x008b3010),
+ AZALIA_PIN_CFG(0, 0x0d, 0x400000f0),
+ AZALIA_PIN_CFG(0, 0x0e, 0x400000f0),
+ AZALIA_PIN_CFG(0, 0x0f, 0x00cbe020),
+ AZALIA_PIN_CFG(0, 0x10, 0x004be050),
+ AZALIA_PIN_CFG(0, 0x12, 0x400000f0),
+ AZALIA_PIN_CFG(0, 0x15, 0x400000f0),
+
+ 0x80862805, /* Codec Vendor / Device ID: Intel */
+ 0x80860101, /* Subsystem ID */
+ 4, /* Number of 4 dword sets */
+ AZALIA_SUBVENDOR(3, 0x80860101),
+ AZALIA_PIN_CFG(3, 0x05, 0x18560010),
+ AZALIA_PIN_CFG(3, 0x06, 0x18560010),
+ AZALIA_PIN_CFG(3, 0x07, 0x18560010),
+
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/apple/macmini5_1/mainboard.c b/src/mainboard/apple/macmini5_1/mainboard.c
new file mode 100644
index 0000000..e90d85e
--- /dev/null
+++ b/src/mainboard/apple/macmini5_1/mainboard.c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/device.h>
+#include <drivers/intel/gma/int15.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+
+static void mainboard_enable(struct device *dev)
+{
+ install_intel_vga_int15_handler(
+ GMA_INT15_ACTIVE_LFP_NONE,
+ GMA_INT15_PANEL_FIT_DEFAULT,
+ GMA_INT15_BOOT_DISPLAY_DEFAULT,
+ 0);
+}
+
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/49074
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ied578e8a9c7ff2c041b5495491acb256019f1c6d
Gerrit-Change-Number: 49074
Gerrit-PatchSet: 1
Gerrit-Owner: Mac Mini <mac-mini-2011(a)outlook.com>
Gerrit-MessageType: newchange
6
10

Change in coreboot[master]: adding new mainboard (no official website as it is a noname board but...
by Skoll RC (Code Review) June 8, 2024
by Skoll RC (Code Review) June 8, 2024
June 8, 2024
Skoll RC has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40813 )
Change subject: adding new mainboard (no official website as it is a noname board but easy to find) see https://github.com/skollrc/coreboot_noname_h61S1_port for more details
......................................................................
adding new mainboard (no official website as it is a noname board but easy to find) see https://github.com/skollrc/coreboot_noname_h61S1_port for more details
Signed-off-by: Robin CASSET <amisbievre(a)posteo.net>
Change-Id: I1f42ffdbbfb59a1b699ba49650919c1d538c8e6c
---
A src/mainboard/ongy/Kconfig
A src/mainboard/ongy/Kconfig.name
A src/mainboard/ongy/h61m-s1/Kconfig
A src/mainboard/ongy/h61m-s1/Kconfig.name
A src/mainboard/ongy/h61m-s1/Makefile.inc
A src/mainboard/ongy/h61m-s1/acpi/ec.asl
A src/mainboard/ongy/h61m-s1/acpi/platform.asl
A src/mainboard/ongy/h61m-s1/acpi/superio.asl
A src/mainboard/ongy/h61m-s1/acpi_tables.c
A src/mainboard/ongy/h61m-s1/board_info.txt
A src/mainboard/ongy/h61m-s1/devicetree.cb
A src/mainboard/ongy/h61m-s1/dsdt.asl
A src/mainboard/ongy/h61m-s1/early_init.c
A src/mainboard/ongy/h61m-s1/gma-mainboard.ads
A src/mainboard/ongy/h61m-s1/gpio.c
A src/mainboard/ongy/h61m-s1/hda_verb.c
A src/mainboard/ongy/h61m-s1/mainboard.c
17 files changed, 559 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/40813/1
diff --git a/src/mainboard/ongy/Kconfig b/src/mainboard/ongy/Kconfig
new file mode 100644
index 0000000..30ea9f3
--- /dev/null
+++ b/src/mainboard/ongy/Kconfig
@@ -0,0 +1,14 @@
+if VENDOR_ONGY
+choice
+ prompt "Mainboard model"
+
+source "src/mainboard/ongy/*/Kconfig.name"
+
+endchoice
+
+source "src/mainboard/ongy/*/Kconfig"
+
+config MAINBOARD_VENDOR
+ default "H61M-S1"
+
+endif # VENDOR_ONGY
diff --git a/src/mainboard/ongy/Kconfig.name b/src/mainboard/ongy/Kconfig.name
new file mode 100644
index 0000000..d0e84b5
--- /dev/null
+++ b/src/mainboard/ongy/Kconfig.name
@@ -0,0 +1,2 @@
+config VENDOR_ONGY
+ bool "ongy"
diff --git a/src/mainboard/ongy/h61m-s1/Kconfig b/src/mainboard/ongy/h61m-s1/Kconfig
new file mode 100644
index 0000000..65bda16
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/Kconfig
@@ -0,0 +1,56 @@
+##
+## 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.
+##
+
+if BOARD_H61M_S1
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_4096
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select INTEL_INT15
+ select MAINBOARD_HAS_LIBGFXINIT
+ select NORTHBRIDGE_INTEL_SANDYBRIDGE
+ select SERIRQ_CONTINUOUS_MODE
+ select SOUTHBRIDGE_INTEL_BD82X6X
+ select USE_NATIVE_RAMINIT
+
+config MAINBOARD_DIR
+ string
+ default ongy/h61m-s1
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "h61m-s1"
+
+config VGA_BIOS_FILE
+ string
+ default "pci8086,0112.rom"
+
+config VGA_BIOS_ID
+ string
+ default "8086,0112"
+
+config DRAM_RESET_GATE_GPIO
+ int
+ default 60
+
+config MAX_CPUS
+ int
+ default 8
+
+config USBDEBUG_HCD_INDEX
+ int
+ default 2
+endif
diff --git a/src/mainboard/ongy/h61m-s1/Kconfig.name b/src/mainboard/ongy/h61m-s1/Kconfig.name
new file mode 100644
index 0000000..36eed8c
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_H61M_S1
+ bool "h61m-s1"
diff --git a/src/mainboard/ongy/h61m-s1/Makefile.inc b/src/mainboard/ongy/h61m-s1/Makefile.inc
new file mode 100644
index 0000000..18391d8
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/Makefile.inc
@@ -0,0 +1,5 @@
+bootblock-y += early_init.c
+bootblock-y += gpio.c
+romstage-y += early_init.c
+romstage-y += gpio.c
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
diff --git a/src/mainboard/ongy/h61m-s1/acpi/ec.asl b/src/mainboard/ongy/h61m-s1/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/acpi/ec.asl
diff --git a/src/mainboard/ongy/h61m-s1/acpi/platform.asl b/src/mainboard/ongy/h61m-s1/acpi/platform.asl
new file mode 100644
index 0000000..ac9ff88
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/acpi/platform.asl
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+/* The _PTS method (Prepare To Sleep) is called before the OS is
+* entering a sleep state. The sleep state number is passed in Arg0
+*/
+
+Method(_PTS,1)
+{
+}
+
+/*The _WAK method is called on system wakeup*/
+
+Method(_WAK,1)
+{
+ Return(Package(){0,0})
+}
diff --git a/src/mainboard/ongy/h61m-s1/acpi/superio.asl b/src/mainboard/ongy/h61m-s1/acpi/superio.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/acpi/superio.asl
diff --git a/src/mainboard/ongy/h61m-s1/acpi_tables.c b/src/mainboard/ongy/h61m-s1/acpi_tables.c
new file mode 100644
index 0000000..3319c25
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/acpi_tables.c
@@ -0,0 +1,22 @@
+/*
+* 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/bd82x6x/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;
+}
diff --git a/src/mainboard/ongy/h61m-s1/board_info.txt b/src/mainboard/ongy/h61m-s1/board_info.txt
new file mode 100644
index 0000000..0fc073c
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/board_info.txt
@@ -0,0 +1,6 @@
+Category: desktop
+Board URL: none
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
\ No newline at end of file
diff --git a/src/mainboard/ongy/h61m-s1/devicetree.cb b/src/mainboard/ongy/h61m-s1/devicetree.cb
new file mode 100644
index 0000000..38b740f
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/devicetree.cb
@@ -0,0 +1,95 @@
+## SPDX-License-Identifier: GPL-2.0-only
+## This file is part of the coreboot project.
+
+chip northbridge/intel/sandybridge
+ register "gfx" = "GMA_STATIC_DISPLAYS(0)"
+ register "gpu_cpu_backlight" = "0x00000000"
+ 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" = "0"
+ register "gpu_panel_power_backlight_on_delay" = "0"
+ register "gpu_panel_power_cycle_delay" = "4"
+ register "gpu_panel_power_down_delay" = "0"
+ register "gpu_panel_power_up_delay" = "0"
+ register "gpu_pch_backlight" = "0x00000000"
+ device cpu_cluster 0x0 on
+ chip cpu/intel/model_206ax
+ 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/bd82x6x # Intel Series 6 Cougar Point PCH
+ register "c2_latency" = "0x0065"
+ register "docking_supported" = "0"
+ register "gen1_dec" = "0x00fc0a01"
+ register "gen2_dec" = "0x00000000"
+ register "gen3_dec" = "0x00000000"
+ register "gen4_dec" = "0x00000000"
+ register "pcie_hotplug_map" = "{ 0, 0, 0, 0, 0, 0, 0, 0 }"
+ register "pcie_port_coalesce" = "1"
+ register "sata_interface_speed_support" = "0x3"
+ register "sata_port_map" = "0x33"
+ register "spi_lvscc" = "0x2005"
+ register "spi_uvscc" = "0x2005"
+ device pci 16.0 on # Management Engine Interface 1
+ subsystemid 0x8086 0x1c3a
+ end
+ 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 off end # Intel Gigabit Ethernet
+ device pci 1a.0 on # USB2 EHCI #2
+ subsystemid 0x8086 0x1c2d
+ end
+ device pci 1b.0 on # High Definition Audio
+ subsystemid 0x8086 0x1c20
+ end
+ device pci 1c.0 on # PCIe Port #1
+ subsystemid 0x8086 0x1c10
+ end
+ device pci 1c.1 off end # PCIe Port #2
+ 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 on # PCIe Port #6
+ subsystemid 0x8086 0x1c1a
+ end
+ device pci 1c.6 off end # PCIe Port #7
+ device pci 1c.7 off end # PCIe Port #8
+ device pci 1d.0 on # USB2 EHCI #1
+ subsystemid 0x8086 0x1c26
+ end
+ device pci 1e.0 off end # PCI bridge
+ device pci 1f.0 on # LPC bridge
+ subsystemid 0x8086 0x1c5c
+ end
+ device pci 1f.2 on # SATA Controller 1
+ subsystemid 0x8086 0x1c02
+ end
+ device pci 1f.3 on # SMBus
+ subsystemid 0x8086 0x1c22
+ end
+ device pci 1f.5 off end # SATA Controller 2
+
+ device pci 1f.6 off end # Thermal
+ end
+ device pci 00.0 on # Host bridge Host bridge
+ subsystemid 0x8086 0x0100
+ end
+ device pci 01.0 on # PEG
+ subsystemid 0x8086 0x0101
+ end
+ device pci 02.0 on # iGPU
+ subsystemid 0x8086 0x2010
+ end
+ end
+end
diff --git a/src/mainboard/ongy/h61m-s1/dsdt.asl b/src/mainboard/ongy/h61m-s1/dsdt.asl
new file mode 100644
index 0000000..8c67659
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/dsdt.asl
@@ -0,0 +1,43 @@
+/*
+*
+* 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.
+*/
+
+#define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
+
+#include <arch/acpi.h>
+
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x02, // DSDT revision: ACPI v2.0 and up
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x20141018 // OEM revision
+)
+{
+ #include "acpi/mainboard.asl"
+ #include "acpi/platform.asl"
+ #include "acpi/superio.asl"
+ #include "acpi/thermal.asl"
+ #include <cpu/intel/common/acpi/cpu.asl>
+ #include <southbridge/intel/common/acpi/platform.asl>
+
+ /* global NVS and variables. */
+ #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+
+ Device (\_SB.PCI0)
+ {
+ #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
+ #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
+ #include <southbridge/intel/bd82x6x/acpi/pch.asl>
+ }
+}
diff --git a/src/mainboard/ongy/h61m-s1/early_init.c b/src/mainboard/ongy/h61m-s1/early_init.c
new file mode 100644
index 0000000..6cb36f1
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/early_init.c
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <stdint.h>
+#include <string.h>
+#include <timestamp.h>
+#include <arch/byteorder.h>
+#include <device/mmio.h>
+#include <device/pci_ops.h>
+#include <device/pnp_ops.h>
+#include <console/console.h>
+#include <bootblock_common.h>
+#include <northbridge/intel/sandybridge/sandybridge.h>
+#include <northbridge/intel/sandybridge/raminit_native.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+#include <southbridge/intel/common/gpio.h>
+
+const struct southbridge_usb_port mainboard_usb_ports[] = {
+ { 1, 0, 0 },
+ { 1, 0, 0 },
+ { 1, 0, 1 },
+ { 1, 0, 1 },
+ { 1, 0, 2 },
+ { 1, 0, 2 },
+ { 1, 0, 3 },
+ { 1, 0, 3 },
+ { 1, 0, 4 },
+ { 1, 0, 4 },
+ { 1, 0, 6 },
+ { 1, 0, 5 },
+ { 1, 0, 5 },
+ { 1, 0, 6 },
+};
+
+void bootblock_mainboard_early_init(void)
+{
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x1401);
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0000);
+}
+
+void mainboard_get_spd(spd_raw_data *spd, bool id_only)
+{
+ read_spd(&spd[0], 0x50, id_only);
+ read_spd(&spd[2], 0x52, id_only);
+}
diff --git a/src/mainboard/ongy/h61m-s1/gma-mainboard.ads b/src/mainboard/ongy/h61m-s1/gma-mainboard.ads
new file mode 100644
index 0000000..e2c84c6
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/gma-mainboard.ads
@@ -0,0 +1,15 @@
+-- SPDX-License-Identifier: GPL-2.0-only
+-- This file is part of the coreboot project.
+
+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,
+ Analog,
+ others => Disabled);
+end GMA.Mainboard;
diff --git a/src/mainboard/ongy/h61m-s1/gpio.c b/src/mainboard/ongy/h61m-s1/gpio.c
new file mode 100644
index 0000000..22f4838
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/gpio.c
@@ -0,0 +1,178 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#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_NATIVE,
+ .gpio3 = GPIO_MODE_NATIVE,
+ .gpio4 = GPIO_MODE_NATIVE,
+ .gpio5 = GPIO_MODE_NATIVE,
+ .gpio6 = GPIO_MODE_GPIO,
+ .gpio7 = GPIO_MODE_GPIO,
+ .gpio8 = GPIO_MODE_GPIO,
+ .gpio9 = GPIO_MODE_NATIVE,
+ .gpio10 = GPIO_MODE_NATIVE,
+ .gpio11 = GPIO_MODE_NATIVE,
+ .gpio12 = GPIO_MODE_GPIO,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_NATIVE,
+ .gpio15 = GPIO_MODE_GPIO,
+ .gpio16 = GPIO_MODE_GPIO,
+ .gpio17 = GPIO_MODE_GPIO,
+ .gpio18 = GPIO_MODE_NATIVE,
+ .gpio19 = GPIO_MODE_NATIVE,
+ .gpio20 = GPIO_MODE_NATIVE,
+ .gpio21 = GPIO_MODE_NATIVE,
+ .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_GPIO,
+ .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,
+ .gpio6 = GPIO_DIR_INPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_OUTPUT,
+ .gpio12 = GPIO_DIR_OUTPUT,
+ .gpio13 = GPIO_DIR_INPUT,
+ .gpio15 = GPIO_DIR_OUTPUT,
+ .gpio16 = GPIO_DIR_INPUT,
+ .gpio17 = GPIO_DIR_INPUT,
+ .gpio22 = GPIO_DIR_INPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio27 = GPIO_DIR_INPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+ .gpio29 = GPIO_DIR_OUTPUT,
+ .gpio31 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio8 = GPIO_LEVEL_HIGH,
+ .gpio12 = GPIO_LEVEL_HIGH,
+ .gpio15 = GPIO_LEVEL_LOW,
+ .gpio24 = GPIO_LEVEL_LOW,
+ .gpio28 = GPIO_LEVEL_LOW,
+ .gpio29 = GPIO_LEVEL_HIGH,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_reset = {
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_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_NATIVE,
+ .gpio36 = GPIO_MODE_NATIVE,
+ .gpio37 = GPIO_MODE_NATIVE,
+ .gpio38 = GPIO_MODE_NATIVE,
+ .gpio39 = GPIO_MODE_NATIVE,
+ .gpio40 = GPIO_MODE_NATIVE,
+ .gpio41 = GPIO_MODE_NATIVE,
+ .gpio42 = GPIO_MODE_NATIVE,
+ .gpio43 = GPIO_MODE_NATIVE,
+ .gpio44 = GPIO_MODE_NATIVE,
+ .gpio45 = GPIO_MODE_NATIVE,
+ .gpio46 = GPIO_MODE_NATIVE,
+ .gpio47 = GPIO_MODE_NATIVE,
+ .gpio48 = GPIO_MODE_NATIVE,
+ .gpio49 = GPIO_MODE_GPIO,
+ .gpio50 = GPIO_MODE_NATIVE,
+ .gpio51 = GPIO_MODE_NATIVE,
+ .gpio52 = GPIO_MODE_NATIVE,
+ .gpio53 = GPIO_MODE_NATIVE,
+ .gpio54 = GPIO_MODE_NATIVE,
+ .gpio55 = GPIO_MODE_NATIVE,
+ .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 = {
+ .gpio32 = GPIO_DIR_OUTPUT,
+ .gpio33 = GPIO_DIR_OUTPUT,
+ .gpio34 = GPIO_DIR_INPUT,
+ .gpio49 = 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,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_reset = {
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_mode = {
+ .gpio64 = GPIO_MODE_NATIVE,
+ .gpio65 = GPIO_MODE_NATIVE,
+ .gpio66 = GPIO_MODE_NATIVE,
+ .gpio67 = GPIO_MODE_NATIVE,
+ .gpio68 = GPIO_MODE_GPIO,
+ .gpio69 = GPIO_MODE_GPIO,
+ .gpio70 = GPIO_MODE_NATIVE,
+ .gpio71 = GPIO_MODE_NATIVE,
+ .gpio72 = GPIO_MODE_GPIO,
+ .gpio73 = GPIO_MODE_NATIVE,
+ .gpio74 = GPIO_MODE_NATIVE,
+ .gpio75 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_direction = {
+ .gpio68 = GPIO_DIR_INPUT,
+ .gpio69 = GPIO_DIR_INPUT,
+ .gpio72 = 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/ongy/h61m-s1/hda_verb.c b/src/mainboard/ongy/h61m-s1/hda_verb.c
new file mode 100644
index 0000000..09748c0
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/hda_verb.c
@@ -0,0 +1,43 @@
+/*
+* 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[] = {
+ 0x10ec0662, /* Codec Vendor / Device ID: Realtek*/
+ 0x10ec0000, /* Subsystem ID*/
+ 12, /* Number of 4 dword sets*/
+ AZALIA_SUBVENDOR(2, 0x10ec0000),
+ AZALIA_PIN_CFG(2, 0x12, 0x40130000),
+ AZALIA_PIN_CFG(2, 0x14, 0x01014010),
+ AZALIA_PIN_CFG(2, 0x15, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x16, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x18, 0x01a19040),
+ AZALIA_PIN_CFG(2, 0x19, 0x02a19050),
+ AZALIA_PIN_CFG(2, 0x1a, 0x0181304f),
+ AZALIA_PIN_CFG(2, 0x1b, 0x02214020),
+ AZALIA_PIN_CFG(2, 0x1c, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x1d, 0x4044c601),
+ AZALIA_PIN_CFG(2, 0x1e, 0x01441130),
+
+ 0x80862805, /* Codec Vendor / Device ID: Intel*/
+ 0x80860101, /* Subsystem ID*/
+ 4, /* Number of 4 dword sets*/
+ AZALIA_SUBVENDOR(3, 0x80860101),
+ AZALIA_PIN_CFG(3, 0x05, 0x18560010),
+ AZALIA_PIN_CFG(3, 0x06, 0x18560020),
+ AZALIA_PIN_CFG(3, 0x07, 0x18560030),
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/ongy/h61m-s1/mainboard.c b/src/mainboard/ongy/h61m-s1/mainboard.c
new file mode 100644
index 0000000..3f9c24e
--- /dev/null
+++ b/src/mainboard/ongy/h61m-s1/mainboard.c
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <device/device.h>
+#include <drivers/intel/gma/int15.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+
+static void mainboard_enable(struct device *dev)
+{
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
+ GMA_INT15_PANEL_FIT_DEFAULT,
+ GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
+}
+
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/40813
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1f42ffdbbfb59a1b699ba49650919c1d538c8e6c
Gerrit-Change-Number: 40813
Gerrit-PatchSet: 1
Gerrit-Owner: Skoll RC
Gerrit-MessageType: newchange
8
117

Change in coreboot[master]: mb/yanling: Add Yanling YL-KBR6L mainboard + doc
by Thomas (Code Review) June 8, 2024
by Thomas (Code Review) June 8, 2024
June 8, 2024
Thomas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48769 )
Change subject: mb/yanling: Add Yanling YL-KBR6L mainboard + doc
......................................................................
mb/yanling: Add Yanling YL-KBR6L mainboard + doc
The Yanling YL-KBR6L (aka Yanling N18) is a Protecli FW6 with a newer
CPUs (i5-8250U), different SuperIO chip (ITE IT8613F), slightly
different (newer?) flash memory chip (MX25L6436F) and support for a
mPCIe modem.
Working:
- USB 3.0 front ports (SeaBIOS, Linux and FreeBSD)
- 6 Ethernet ports
- HDMI port with libgfxinit and VGA Option ROM
- flashrom
- PCIe WiFi
- SATA and mSATA
- mPCIe Modem in mSATA slot (tested with Simcom SIM7100E mPCIe)
- Super I/O serial port 0 (RS232 via front RJ45 connector)
- SeaBIOS payload (version rel-1.14.0)
- Booting Ubuntu 20.04, FreeBSD 12.2
- 64GB RAM (tested with Crucial CT2K32G4SFD8266)
Untested (same as Protectli FW6):
- Internal USB 2.0 headers
- Boot with cleaned ME
Misc:
- Removed "ProbelessTrace" in devicetree as done for other boards by
coreboot.
Change-Id: Icbc18914670f87f0943b371400c509ff0eeacf6a
Signed-off-by: Thomas Kupper <thomas.kupper(a)gmail.com>
---
M Documentation/mainboard/index.md
A Documentation/mainboard/yanling/yl-kbr6l.md
A Documentation/mainboard/yanling/yl-kbr6l_front.jpg
A src/mainboard/yanling/Kconfig
A src/mainboard/yanling/Kconfig.name
A src/mainboard/yanling/yl_kbr6l/Kconfig
A src/mainboard/yanling/yl_kbr6l/Kconfig.name
A src/mainboard/yanling/yl_kbr6l/Makefile.inc
A src/mainboard/yanling/yl_kbr6l/acpi/ec.asl
A src/mainboard/yanling/yl_kbr6l/acpi/superio.asl
A src/mainboard/yanling/yl_kbr6l/board_info.txt
A src/mainboard/yanling/yl_kbr6l/bootblock.c
A src/mainboard/yanling/yl_kbr6l/data.vbt
A src/mainboard/yanling/yl_kbr6l/devicetree.cb
A src/mainboard/yanling/yl_kbr6l/dsdt.asl
A src/mainboard/yanling/yl_kbr6l/gma-mainboard.ads
A src/mainboard/yanling/yl_kbr6l/gpio.h
A src/mainboard/yanling/yl_kbr6l/ramstage.c
A src/mainboard/yanling/yl_kbr6l/romstage.c
19 files changed, 820 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/48769/1
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md
index 95efe55..2480069 100644
--- a/Documentation/mainboard/index.md
+++ b/Documentation/mainboard/index.md
@@ -179,3 +179,7 @@
## UP
- [Squared](up/squared/index.md)
+
+## Yanling
+
+- [YL-KBR6L](yanling/yl-kbr6l.md)
\ No newline at end of file
diff --git a/Documentation/mainboard/yanling/yl-kbr6l.md b/Documentation/mainboard/yanling/yl-kbr6l.md
new file mode 100644
index 0000000..28d1d56
--- /dev/null
+++ b/Documentation/mainboard/yanling/yl-kbr6l.md
@@ -0,0 +1,133 @@
+# Yanling YL-KBR6L
+
+This board and therefore its documentation is very, very similar to the Protectli FW6. This document is based on theirs, all praise to 3mdeb/Protectli.
+
+This page describes how to run coreboot on the [Yanling YL-KBR6L], or [Yanling N18] as it seems to be called officially (and its three CPU variants).
+
+
+
+## Required proprietary blobs
+
+To build a minimal working coreboot image some blobs are required (assuming
+only the BIOS region is being modified).
+
+```eval_rst
++-----------------+---------------------------------+---------------------+
+| Binary file | Apply | Required / Optional |
++=================+=================================+=====================+
+| FSP-M, FSP-S | Intel Firmware Support Package | Required |
++-----------------+---------------------------------+---------------------+
+| microcode | CPU microcode | Required |
++-----------------+---------------------------------+---------------------+
+| vgabios | VGA Option ROM | Optional |
++-----------------+---------------------------------+---------------------+
+```
+
+FSP-M and FSP-S are obtained after splitting the Kaby Lake FSP binary (done
+automatically by the coreboot build system and included into the image) from
+the `3rdparty/fsp` submodule.
+
+Microcode updates are automatically included into the coreboot image by build
+system from the `3rdparty/intel-microcode` submodule.
+
+VGA Option ROM is not required to boot, but if one needs graphics in pre-OS
+stage, it should be included (if not using libgfxinit).
+
+## Flashing coreboot
+
+### Internal programming
+
+The main SPI flash can be accessed using [flashrom]. The first version
+supporting the chipset is flashrom v1.1. Firmware an be easily flashed
+with internal programmer (either BIOS region or full image).
+
+### External programming
+
+The system has an internal flash chip which is a 8 MiB soldered SOIC-8 chip.
+This chip is located on the bottom side of the case (the radiator side). One
+has to remove all screws (in order): 4 top cover screws, 4 side cover screws
+(one side is enough), 4 mainboard screws, 4 CPU screws (under DIMMs). Lift up
+the mainboard and turn around it. The flash chip is near the SoC on the DIMM
+slots side. Use a clip (or solder the wires) to program the chip. Specifically,
+it's a Macronix MX25L6436F M2I-08Q (3V) - [datasheet][MX25L6436F].
+
+## Known issues
+
+- assume the same as for Protectli FW6:
+
+- After flashing with external programmer it is always required to reset RTC
+ with jumper or disconnect coin cell temporarily. Only then the platform will
+ boot after flashing.
+- FW6A does not always work reliably with all DIMMs. Linux happens to hang or
+ gives many panics. This issue was present also with vendor BIOS.
+- Sometimes FSPMemoryInit return errors or hangs (especially with 2 DIMMs
+ connected). A workaround is to power cycle the board (even a few times) or
+ temporarily disconnect DIMM when platform is powered off.
+- When using libgfxinit and SeaBIOS bootsplash, the red color is dim
+
+## Untested
+
+- assume the same as for Protectli FW6:
+
+Not all mainboard's peripherals and functions were tested because of lack of
+the cables or not being populated on the board case.
+
+- Internal USB 2.0 headers
+- Boot with cleaned ME
+
+## Working
+
+- USB 3.0 front ports (SeaBIOS and Linux)
+- 6 Ethernet ports
+- HDMI port with libgfxinit and VGA Option ROM
+- flashrom
+- PCIe WiFi
+- SATA and mSATA
+- mPCIe Modem in mSATA slot (tested with Simcom SIM7100E mPCIe)
+- Super I/O serial port 0 (RS232 via front RJ45 connector)
+- SeaBIOS payload (version rel-1.14)
+- Booting Ubuntu 20.04, FreeBSD 12.2
+- 64GB RAM (tested with Crucial CT2K32G4SFD8266)
+
+## Technology
+
+```eval_rst
++---------------------+-----------------------------------------------+
+| CPU | [Intel Core i5-8250U] |
++---------------------+-----------------------------------------------+
+| PCH | Kaby Lake U w/ iHDCP2.2 Premium |
++---------------------+-----------------------------------------------+
+| Super I/O, EC | ITE IT8613F |
++---------------------+-----------------------------------------------+
+| Coprocessor | Intel Management Engine |
++---------------------+-----------------------------------------------+
+| Ethernet Controller | 6x Intel I211AT |
++---------------------+-----------------------------------------------+
+```
+Information about the PCH can be found in [Intel 7th and 8th gen datasheet vol 1] and [Intel 7th and 8th gen datasheet vol 2].
+
+## Ports
+
+```eval_rst
++---------------------+-----------------------------------------------+
+| Ethernet | 6x 1GbE |
++---------------------+-----------------------------------------------+
+| USB | 4x USB 3.0 |
++---------------------+-----------------------------------------------+
+| Serial/COM | 1x RJ-45 serial port |
++---------------------+-----------------------------------------------+
+| SATA | 1x mSATA (port 0) + 1x SATA 3.0 (port 1) |
++---------------------+-----------------------------------------------+
+| Cellular Modem | 1x mPCIe, shared with mSATA slot, nano-SIM |
++---------------------+-----------------------------------------------+
+| Wifi/Bluetooth | 1x mPCIe slot, under mSATA/Modem, |
+| | supports half-size cards only |
++---------------------+-----------------------------------------------+
+```
+
+[flashrom]: https://flashrom.org/Flashrom
+[Intel 7th and 8th gen datasheet vol 1]: https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/7th…
+[Intel 7th and 8th gen datasheet vol 2]: https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/7th…
+[MX25L6436F]: https://www.mxic.com.tw/Lists/Datasheet/Attachments/7405/MX25L6436F,%203V,%…
+[Yanling YL-KBR6L]: https://www.aliexpress.com/item/1005001813291053.html
+[Yanling N18]:https://www.ylipc.com/product/network_server_network_server/N18_Firewa…
diff --git a/Documentation/mainboard/yanling/yl-kbr6l_front.jpg b/Documentation/mainboard/yanling/yl-kbr6l_front.jpg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Documentation/mainboard/yanling/yl-kbr6l_front.jpg
diff --git a/src/mainboard/yanling/Kconfig b/src/mainboard/yanling/Kconfig
new file mode 100644
index 0000000..2972a38
--- /dev/null
+++ b/src/mainboard/yanling/Kconfig
@@ -0,0 +1,15 @@
+if VENDOR_YANLING
+
+choice
+ prompt "Mainboard model"
+
+source "src/mainboard/yanling/*/Kconfig.name"
+
+endchoice
+
+source "src/mainboard/yanling/*/Kconfig"
+
+config MAINBOARD_VENDOR
+ default "Yanling"
+
+endif # VENDOR_YANLING
diff --git a/src/mainboard/yanling/Kconfig.name b/src/mainboard/yanling/Kconfig.name
new file mode 100644
index 0000000..6cc7ef1
--- /dev/null
+++ b/src/mainboard/yanling/Kconfig.name
@@ -0,0 +1,2 @@
+config VENDOR_YANLING
+ bool "Yanling"
diff --git a/src/mainboard/yanling/yl_kbr6l/Kconfig b/src/mainboard/yanling/yl_kbr6l/Kconfig
new file mode 100644
index 0000000..838bc44
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/Kconfig
@@ -0,0 +1,57 @@
+if BOARD_YANLING_YLKBR6L
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_8192
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select INTEL_GMA_HAVE_VBT
+ select MAINBOARD_HAS_LIBGFXINIT
+ select SEABIOS_ADD_SERCON_PORT_FILE if PAYLOAD_SEABIOS
+ select SOC_INTEL_KABYLAKE
+ select SPI_FLASH_MACRONIX
+ select SUPERIO_ITE_IT8613E
+ select MAINBOARD_HAS_CRB_TPM
+ select HAVE_INTEL_PTT
+ select TPM2
+
+config IRQ_SLOT_COUNT
+ int
+ default 18
+
+config MAINBOARD_DIR
+ string
+ default "yanling/yl_kbr6l"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "YLKBR6L"
+
+config DIMM_MAX
+ int
+ default 2
+
+config DIMM_SPD_SIZE
+ int
+ default 512
+
+config MAX_CPUS
+ int
+ default 8
+
+config VGA_BIOS_ID
+ string
+ default "8086,5917"
+
+config PXE_ROM_ID
+ string
+ default "8086,1539"
+
+config CBFS_SIZE
+ hex
+ default 0x600000
+
+config USE_PM_ACPI_TIMER
+ default n
+
+endif
diff --git a/src/mainboard/yanling/yl_kbr6l/Kconfig.name b/src/mainboard/yanling/yl_kbr6l/Kconfig.name
new file mode 100644
index 0000000..8b039de
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_YANLING_YLKBR6L
+ bool "YLKBR6L"
diff --git a/src/mainboard/yanling/yl_kbr6l/Makefile.inc b/src/mainboard/yanling/yl_kbr6l/Makefile.inc
new file mode 100644
index 0000000..4cd7aac
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/Makefile.inc
@@ -0,0 +1,7 @@
+## SPDX-License-Identifier: GPL-2.0-or-later
+
+bootblock-y += bootblock.c
+
+ramstage-y += ramstage.c
+
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
diff --git a/src/mainboard/yanling/yl_kbr6l/acpi/ec.asl b/src/mainboard/yanling/yl_kbr6l/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/acpi/ec.asl
diff --git a/src/mainboard/yanling/yl_kbr6l/acpi/superio.asl b/src/mainboard/yanling/yl_kbr6l/acpi/superio.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/acpi/superio.asl
diff --git a/src/mainboard/yanling/yl_kbr6l/board_info.txt b/src/mainboard/yanling/yl_kbr6l/board_info.txt
new file mode 100644
index 0000000..c12e388
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/board_info.txt
@@ -0,0 +1,6 @@
+Vendor name: Yanling
+Board name: YL-KBR6L
+Category: sbc
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
diff --git a/src/mainboard/yanling/yl_kbr6l/bootblock.c b/src/mainboard/yanling/yl_kbr6l/bootblock.c
new file mode 100644
index 0000000..e35a7cc
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/bootblock.c
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <bootblock_common.h>
+#include <superio/ite/it8613e/it8613e.h>
+#include <superio/ite/common/ite.h>
+
+#define GPIO_DEV PNP_DEV(0x2e, IT8613E_GPIO)
+#define UART_DEV PNP_DEV(0x2e, IT8613E_SP1)
+
+void bootblock_mainboard_early_init(void)
+{
+ ite_reg_write(GPIO_DEV, 0x2c, 0x41); /* disable K8 power seq */
+ ite_reg_write(GPIO_DEV, 0x2d, 0x02); /* PCICLK 25MHz */
+ ite_enable_serial(UART_DEV, CONFIG_TTYS0_BASE);
+}
diff --git a/src/mainboard/yanling/yl_kbr6l/data.vbt b/src/mainboard/yanling/yl_kbr6l/data.vbt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/data.vbt
diff --git a/src/mainboard/yanling/yl_kbr6l/devicetree.cb b/src/mainboard/yanling/yl_kbr6l/devicetree.cb
new file mode 100644
index 0000000..b57ab96
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/devicetree.cb
@@ -0,0 +1,278 @@
+chip soc/intel/skylake
+
+ # Enable deep Sx states
+ register "deep_s3_enable_ac" = "0"
+ register "deep_s3_enable_dc" = "0"
+ register "deep_s5_enable_ac" = "1"
+ register "deep_s5_enable_dc" = "1"
+ register "deep_sx_config" = "DSX_EN_WAKE_PIN | DSX_DIS_AC_PRESENT_PD"
+ register "s0ix_enable" = "1"
+
+ register "gpe0_dw0" = "GPP_B"
+ register "gpe0_dw1" = "GPP_D"
+ register "gpe0_dw2" = "GPP_E"
+
+ register "gen1_dec" = "0x00fc0201"
+ register "gen2_dec" = "0x007c0a01"
+ register "gen3_dec" = "0x000c03e1"
+ register "gen4_dec" = "0x001c02e1"
+
+ register "eist_enable" = "1"
+
+ # Disable DPTF
+ register "dptf_enable" = "0"
+
+ # Enable VT-d
+ register "ignore_vtd" = "0"
+
+ # Enable SERIRQ continuous
+ register "serirq_mode" = "SERIRQ_CONTINUOUS"
+
+ register "tcc_offset" = "5" # TCC of 95C
+
+ # FSP Configuration
+ register "SataSalpSupport" = "0"
+ register "SataMode" = "0"
+ register "DspEnable" = "0"
+ register "IoBufferOwnership" = "0"
+ register "SsicPortEnable" = "0"
+ register "ScsEmmcHs400Enabled" = "0"
+ register "SkipExtGfxScan" = "1"
+ register "HeciEnabled" = "1"
+ register "SaGv" = "SaGv_Enabled"
+ register "IslVrCmd" = "2"
+ register "PmConfigSlpS3MinAssert" = "2" # 50ms
+ register "PmConfigSlpS4MinAssert" = "4" # 4s
+ register "PmConfigSlpSusMinAssert" = "1" # 500ms
+ register "PmConfigSlpAMinAssert" = "3" # 2s
+
+ # VR Settings Configuration for 4 Domains
+ #+----------------+-------+-------+-------+-------+
+ #| Domain/Setting | SA | IA | GTUS | GTS |
+ #+----------------+-------+-------+-------+-------+
+ #| Psi1Threshold | 20A | 20A | 20A | 20A |
+ #| Psi2Threshold | 4A | 5A | 5A | 5A |
+ #| Psi3Threshold | 1A | 1A | 1A | 1A |
+ #| Psi3Enable | 1 | 1 | 1 | 1 |
+ #| Psi4Enable | 1 | 1 | 1 | 1 |
+ #| ImonSlope | 0 | 0 | 0 | 0 |
+ #| ImonOffset | 0 | 0 | 0 | 0 |
+ #| IccMax | 7A | 34A | 35A | 35A |
+ #| VrVoltageLimit | 1.52V | 1.52V | 1.52V | 1.52V |
+ #| AcLoadline(ohm)| 10.3m | 2.4m | 3.1m | 3.1m |
+ #| DcLoadline(ohm)| 10.3m | 2.4m | 3.1m | 3.1m |
+ #+----------------+-------+-------+-------+-------+
+ #Note: IccMax settings are moved to SoC code
+ register "domain_vr_config[VR_SYSTEM_AGENT]" = "{
+ .vr_config_enable = 1,
+ .psi1threshold = VR_CFG_AMP(20),
+ .psi2threshold = VR_CFG_AMP(4),
+ .psi3threshold = VR_CFG_AMP(1),
+ .psi3enable = 1,
+ .psi4enable = 1,
+ .imon_slope = 0x0,
+ .imon_offset = 0x0,
+ .voltage_limit = 1520,
+ }"
+
+ register "domain_vr_config[VR_IA_CORE]" = "{
+ .vr_config_enable = 1,
+ .psi1threshold = VR_CFG_AMP(20),
+ .psi2threshold = VR_CFG_AMP(5),
+ .psi3threshold = VR_CFG_AMP(1),
+ .psi3enable = 1,
+ .psi4enable = 1,
+ .imon_slope = 0x0,
+ .imon_offset = 0x0,
+ .voltage_limit = 1520,
+ }"
+
+ register "domain_vr_config[VR_GT_UNSLICED]" = "{
+ .vr_config_enable = 1,
+ .psi1threshold = VR_CFG_AMP(20),
+ .psi2threshold = VR_CFG_AMP(5),
+ .psi3threshold = VR_CFG_AMP(1),
+ .psi3enable = 1,
+ .psi4enable = 1,
+ .imon_slope = 0x0,
+ .imon_offset = 0x0,
+ .voltage_limit = 1520,
+ }"
+
+ register "domain_vr_config[VR_GT_SLICED]" = "{
+ .vr_config_enable = 1,
+ .psi1threshold = VR_CFG_AMP(20),
+ .psi2threshold = VR_CFG_AMP(5),
+ .psi3threshold = VR_CFG_AMP(1),
+ .psi3enable = 1,
+ .psi4enable = 1,
+ .imon_slope = 0x0,
+ .imon_offset = 0x0,
+ .voltage_limit = 1520,
+ }"
+
+ # Send an extra VR mailbox command for the PS4 exit issue
+ register "SendVrMbxCmd" = "2"
+
+ # Enable SATA ports 1,2
+ register "SataPortsEnable[0]" = "1"
+ register "SataPortsEnable[1]" = "1"
+ register "SataPortsEnable[2]" = "0"
+ register "SataPortsDevSlp[0]" = "0"
+ register "SataPortsDevSlp[1]" = "0"
+
+ # Enable Root ports. 1-6 for LAN and Root Port 9
+ register "PcieRpEnable[0]" = "1"
+ register "PcieRpEnable[1]" = "1"
+ register "PcieRpEnable[2]" = "1"
+ register "PcieRpEnable[3]" = "1"
+ register "PcieRpEnable[4]" = "1"
+ register "PcieRpEnable[5]" = "1"
+ register "PcieRpEnable[8]" = "1" # mPCIe WiFi
+
+ # Enable Advanced Error Reporting for RP 1-6, 9
+ register "PcieRpAdvancedErrorReporting[0]" = "1"
+ register "PcieRpAdvancedErrorReporting[1]" = "1"
+ register "PcieRpAdvancedErrorReporting[2]" = "1"
+ register "PcieRpAdvancedErrorReporting[3]" = "1"
+ register "PcieRpAdvancedErrorReporting[4]" = "1"
+ register "PcieRpAdvancedErrorReporting[5]" = "1"
+ register "PcieRpAdvancedErrorReporting[8]" = "1"
+
+ # Enable Latency Tolerance Reporting Mechanism RP 1-6, 9
+ register "PcieRpLtrEnable[0]" = "1"
+ register "PcieRpLtrEnable[1]" = "1"
+ register "PcieRpLtrEnable[2]" = "1"
+ register "PcieRpLtrEnable[3]" = "1"
+ register "PcieRpLtrEnable[4]" = "1"
+ register "PcieRpLtrEnable[5]" = "1"
+ register "PcieRpLtrEnable[8]" = "1"
+
+ # TODO: Check why protectli used them and WiFi won't work
+ # for me if I set them -> err: lost pci device
+ # Enable RP 9 CLKREQ# support
+ #register "PcieRpClkReqSupport[8]" = "1"
+ # RP 9 uses CLKREQ0#
+ #register "PcieRpClkReqNumber[8]" = "0"
+
+ # Clocks 0-5 for RP 1-6
+ register "PcieRpClkSrcNumber[0]" = "0"
+ register "PcieRpClkSrcNumber[1]" = "1"
+ register "PcieRpClkSrcNumber[2]" = "2"
+ register "PcieRpClkSrcNumber[3]" = "3"
+ register "PcieRpClkSrcNumber[4]" = "4"
+ register "PcieRpClkSrcNumber[5]" = "5"
+ # RP 9 shares CLKSRC5# with RP 6
+ register "PcieRpClkSrcNumber[8]" = "5"
+
+
+ # USB 2.0 enable ports 1-8, disable ports 9-12
+ register "usb2_ports[0]" = "USB2_PORT_SHORT(OC_SKIP)" # TYPE-A Port
+ register "usb2_ports[1]" = "USB2_PORT_SHORT(OC_SKIP)" # TYPE-A Port
+ register "usb2_ports[2]" = "USB2_PORT_SHORT(OC_SKIP)" # TYPE-A Port
+ register "usb2_ports[3]" = "USB2_PORT_SHORT(OC_SKIP)" # TYPE-A Port
+ register "usb2_ports[4]" = "USB2_PORT_SHORT(OC_SKIP)" # Type-A Port
+ register "usb2_ports[5]" = "USB2_PORT_SHORT(OC_SKIP)" # TYPE-A Port
+ register "usb2_ports[6]" = "USB2_PORT_SHORT(OC_SKIP)" # TYPE-A Port
+ register "usb2_ports[7]" = "USB2_PORT_SHORT(OC_SKIP)" # mPCIe slot
+
+ # USB 3.0 enable ports 1-4, disable ports 5-6
+ register "usb3_ports[0]" = "USB3_PORT_DEFAULT(OC_SKIP)" # TYPE-A Port
+ register "usb3_ports[1]" = "USB3_PORT_DEFAULT(OC_SKIP)" # TYPE-A Port
+ register "usb3_ports[2]" = "USB3_PORT_DEFAULT(OC_SKIP)" # TYPE-A Port
+ register "usb3_ports[3]" = "USB3_PORT_DEFAULT(OC_SKIP)" # TYPE-A Port
+
+ register "SerialIoDevMode" = "{ \
+ [PchSerialIoIndexI2C0] = PchSerialIoDisabled, \
+ [PchSerialIoIndexI2C1] = PchSerialIoDisabled, \
+ [PchSerialIoIndexI2C2] = PchSerialIoDisabled, \
+ [PchSerialIoIndexI2C3] = PchSerialIoDisabled, \
+ [PchSerialIoIndexI2C4] = PchSerialIoDisabled, \
+ [PchSerialIoIndexI2C5] = PchSerialIoDisabled, \
+ [PchSerialIoIndexSpi0] = PchSerialIoDisabled, \
+ [PchSerialIoIndexSpi1] = PchSerialIoDisabled, \
+ [PchSerialIoIndexUart0] = PchSerialIoDisabled, \
+ [PchSerialIoIndexUart1] = PchSerialIoDisabled, \
+ [PchSerialIoIndexUart2] = PchSerialIoDisabled, \
+ }"
+
+ # Lock Down CHIPSET_LOCKDOWN_COREBOOT
+ register "common_soc_config" = "{
+ .chipset_lockdown = CHIPSET_LOCKDOWN_COREBOOT,
+ }"
+
+ device cpu_cluster 0 on
+ device lapic 0 on end
+ end
+ device domain 0 on
+ device pci 00.0 on end # 8086 5914 - Host Bridge
+ device pci 02.0 on end # 8086 5917 - Integrated Graphics Device
+ device pci 04.0 off end # 8086 ???? - SA thermal subsystem
+ device pci 05.0 off end # 8086 ???? - SA IMGU
+ device pci 08.0 off end # 8086 ???? - Gaussian Mixture Model
+ device pci 13.0 off end # 8086 9d35 - Integrated Sensor Hub
+ device pci 14.0 on end # 8086 9d2f - USB xHCI
+ device pci 14.1 off end # 8086 9d30 - USB xDCI (OTG)
+ device pci 14.2 off end # 8086 9d31 - Thermal Subsystem
+ device pci 14.3 off end # 8086 9d32 - Camera I/O Host Controller
+ device pci 15.0 off end # 8086 9d60 - I2C #0
+ device pci 15.1 off end # 8086 9d61 - I2C #1
+ device pci 15.2 off end # 8086 9d62 - I2C #2
+ device pci 15.3 off end # 8086 9d63 - I2C #3
+ device pci 16.0 on end # 8086 9d3a - Management Engine Interface 1
+ device pci 16.1 off end # 8086 9d3b - Management Engine Interface 2
+ device pci 16.2 off end # 8086 9d3c - Management Engine IDE-Redirection
+ device pci 16.3 off end # 8086 9d3d - Management Engine KT Redirection
+ device pci 16.4 off end # 8086 9d3e - Management Engine Interface 3
+ device pci 17.0 on end # 8086 9d03 - SATA
+ device pci 19.0 off end # 8086 9d66 - UART #2
+ device pci 19.1 off end # 8086 9d65 - I2C #5
+ device pci 19.2 off end # 8086 9d64 - I2C #4
+ device pci 1c.0 on end # 8086 9d10 - PCI Express Port 1
+ device pci 1c.1 on end # 8086 9d11 - PCI Express Port 2
+ device pci 1c.2 on end # 8086 9d12 - PCI Express Port 3
+ device pci 1c.3 on end # 8086 9d13 - PCI Express Port 4
+ device pci 1c.4 on end # 8086 9d14 - PCI Express Port 5
+ device pci 1c.5 on end # 8086 9d15 - PCI Express Port 6
+ device pci 1c.6 off end # 8086 9d16 - PCI Express Port 7
+ device pci 1c.7 off end # 8086 9d17 - PCI Express Port 8
+ device pci 1d.0 on # 8086 9d18 - PCI Express Port 9 - WiFi
+ smbios_slot_desc
+ "SlotTypePciExpressMini52pinWithoutBSKO"
+ "SlotLengthShort" "WIFI1" "SlotDataBusWidth1X"
+ end
+ device pci 1d.1 off end # 8086 9d19 - PCI Express Port 10
+ device pci 1d.2 off end # 8086 9d1a - PCI Express Port 11
+ device pci 1d.3 off end # 8086 9d1b - PCI Express Port 12
+ device pci 1e.0 off end # 8086 9d27 - UART #0
+ device pci 1e.1 off end # 8086 9d28 - UART #1
+ device pci 1e.2 off end # 8086 9d29 - GSPI #0
+ device pci 1e.3 off end # 8086 9d2a - GSPI #1
+ device pci 1e.4 off end # 8086 9d2b - eMMC
+ device pci 1e.5 off end # 8086 ???? - SDIO
+ device pci 1e.6 off end # 8086 9d2d = SDXC
+ device pci 1f.0 on # 8086 9d4e - LPC Controller
+ chip superio/ite/it8613e
+ device pnp 2e.0 off end
+ device pnp 2e.1 on # COM 1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.4 off end # Environment Controller
+ device pnp 2e.5 off end # Keyboard
+ device pnp 2e.6 off end # Mouse
+ device pnp 2e.7 off end # GPIO
+ device pnp 2e.a off end # CIR
+ end
+ end # LPC Interface
+ device pci 1f.1 on end # 8086 9d20 - P2SB
+ device pci 1f.2 on end # 8086 9d21 - Power Management Controller
+ device pci 1f.3 off end # 8086 9d71 - Intel HDA
+ device pci 1f.4 on end # 8086 9d23 - SMBus
+ device pci 1f.5 off end # 8086 9d24 - PCH SPI
+ device pci 1f.6 off end # 8086 9d25 - GbE
+ end
+ chip drivers/crb
+ device mmio 0xfed40000 on end
+ end
+end
diff --git a/src/mainboard/yanling/yl_kbr6l/dsdt.asl b/src/mainboard/yanling/yl_kbr6l/dsdt.asl
new file mode 100644
index 0000000..3de4e26
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/dsdt.asl
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <acpi/acpi.h>
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ ACPI_DSDT_REV_2,
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x20110725 /* OEM revision */
+)
+{
+ #include <soc/intel/common/block/acpi/acpi/platform.asl>
+ #include <soc/intel/skylake/acpi/globalnvs.asl>
+ #include <cpu/intel/common/acpi/cpu.asl>
+
+ Device (\_SB.PCI0)
+ {
+ #include <soc/intel/skylake/acpi/systemagent.asl>
+ #include <soc/intel/skylake/acpi/pch.asl>
+ }
+
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+}
diff --git a/src/mainboard/yanling/yl_kbr6l/gma-mainboard.ads b/src/mainboard/yanling/yl_kbr6l/gma-mainboard.ads
new file mode 100644
index 0000000..0e0f4f8
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/gma-mainboard.ads
@@ -0,0 +1,15 @@
+-- SPDX-License-Identifier: GPL-2.0-or-later
+
+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,
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/yanling/yl_kbr6l/gpio.h b/src/mainboard/yanling/yl_kbr6l/gpio.h
new file mode 100644
index 0000000..7ec5a8a
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/gpio.h
@@ -0,0 +1,179 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef _GPIOFW6B_H
+#define _GPIOFW6B_H
+
+#include <soc/gpe.h>
+#include <soc/gpio.h>
+
+#ifndef __ACPI__
+
+/* Pad configuration in ramstage. */
+static const struct pad_config gpio_table[] = {
+/* RCIN# */ PAD_CFG_NF(GPP_A0, NONE, DEEP, NF1),
+/* LPC_LAD_0 */ PAD_CFG_NF(GPP_A1, UP_20K, DEEP, NF1),
+/* LPC_LAD_1 */ PAD_CFG_NF(GPP_A2, UP_20K, DEEP, NF1),
+/* LPC_LAD_2 */ PAD_CFG_NF(GPP_A3, UP_20K, DEEP, NF1),
+/* LPC_LAD_3 */ PAD_CFG_NF(GPP_A4, UP_20K, DEEP, NF1),
+/* LPC_FRAME */ PAD_CFG_NF(GPP_A5, NONE, DEEP, NF1),
+/* LPC_SERIRQ */ PAD_CFG_NF(GPP_A6, NONE, DEEP, NF1),
+/* PIRQA_N*/ PAD_CFG_TERM_GPO(GPP_A7, 1, NONE, DEEP),
+/* LPC_CLKRUN */ PAD_CFG_NF(GPP_A8, NONE, DEEP, NF1),
+/* PCH_LPC_CLK0 */ PAD_CFG_NF(GPP_A9, DN_20K, DEEP, NF1),
+/* PCH_LPC_CLK1 */ PAD_CFG_NF(GPP_A10, DN_20K, DEEP, NF1),
+/* PME# */ PAD_CFG_NF(GPP_A11, UP_20K, DEEP, NF1),
+/* ISH_GP6 */ PAD_NC(GPP_A12, NONE),
+/* PCH_SUSPWRACB */ PAD_CFG_NF(GPP_A13, NONE, DEEP, NF1),
+/* PCH_SUSSTAT */ PAD_CFG_NF(GPP_A14, NONE, DEEP, NF1),
+/* PCH_SUSACK */ PAD_CFG_NF(GPP_A15, DN_20K, DEEP, NF1),
+/* SD_1P8_SEL */ PAD_NC(GPP_A16, NONE),
+/* SD_PWR_EN */ PAD_NC(GPP_A17, NONE),
+/* ISH_GP0 */ PAD_NC(GPP_A18, NONE),
+/* ISH_GP1 */ PAD_NC(GPP_A19, NONE),
+/* ISH_GP2 */ PAD_NC(GPP_A20, NONE),
+/* ISH_GP3 */ PAD_NC(GPP_A21, NONE),
+/* ISH_GP4 */ PAD_NC(GPP_A22, NONE),
+/* ISH_GP5 */ PAD_NC(GPP_A23, NONE),
+/* CORE_VID0 */ PAD_NC(GPP_B0, NONE),
+/* CORE_VID1 */ PAD_NC(GPP_B1, NONE),
+/* VRALERT_N */ PAD_CFG_NF(GPP_B2, NONE, DEEP, NF1),
+/* CPU_GP2 */ PAD_NC(GPP_B3, NONE),
+/* CPU_GP3 */ PAD_NC(GPP_B4, NONE),
+/* SRCCLKREQ0_N */ PAD_CFG_NF(GPP_B5, NONE, DEEP, NF1),
+/* SRCCLKREQ1_N*/ PAD_NC(GPP_B6, NONE),
+/* SRCCLKREQ2_N*/ PAD_NC(GPP_B7, NONE),
+/* SRCCLKREQ3_N*/ PAD_NC(GPP_B8, NONE),
+/* SRCCLKREQ4_N*/ PAD_NC(GPP_B9, NONE),
+/* SRCCLKREQ5_N*/ PAD_NC(GPP_B10, NONE),
+/* EXT_PWR_GATE_N */ PAD_CFG_NF(GPP_B11, NONE, DEEP, NF1),
+/* SLP_S0# */ PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1),
+/* PCH_PLT_RST */ PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1),
+/* SPKR */ PAD_CFG_NF(GPP_B14, DN_20K, PLTRST, NF1),
+/* GSPI0_CS_N */ PAD_NC(GPP_B15, NONE),
+/* GSPI0_CLK */ PAD_NC(GPP_B16, NONE),
+/* GSPI0_MISO */ PAD_NC(GPP_B17, NONE),
+/* GSPI0_MOSI */ PAD_NC(GPP_B18, NONE),
+/* GSPI1_CS_N */ PAD_NC(GPP_B19, NONE),
+/* GSPI1_CLK */ PAD_NC(GPP_B20, NONE),
+/* GSPI1_MISO */ PAD_NC(GPP_B21, NONE),
+/* GSPI1_MOSI */ PAD_NC(GPP_B22, NONE),
+/* SM1ALERT# */ PAD_NC(GPP_B23, NONE),
+/* SMB_CLK */ PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1),
+/* SMB_DATA */ PAD_CFG_NF(GPP_C1, NONE, DEEP, NF1),
+/* SMBALERT# */ PAD_CFG_NF(GPP_C2, NONE, DEEP, NF1),
+/* SML0_CLK */ PAD_NC(GPP_C3, NONE),
+/* SML0DATA */ PAD_NC(GPP_C4, NONE),
+/* SML0ALERT# */ PAD_NC(GPP_C5, NONE),
+/* UART0_RXD */ PAD_NC(GPP_C8, NONE),
+/* UART0_TXD */ PAD_NC(GPP_C9, NONE),
+/* UART0_CTS_N */ PAD_NC(GPP_C10, NONE),
+/* UART0_RTS_N */ PAD_NC(GPP_C11, NONE),
+/* UART1_RXD */ PAD_NC(GPP_C12, NONE),
+/* UART1_TXD */ PAD_NC(GPP_C13, NONE),
+/* UART1_CTS_N */ PAD_NC(GPP_C14, NONE),
+/* UART1_RTS_N */ PAD_NC(GPP_C15, NONE),
+/* I2C0_SDA */ PAD_NC(GPP_C16, NONE),
+/* I2C0_SCL */ PAD_NC(GPP_C17, NONE),
+/* I2C1_SDA */ PAD_NC(GPP_C18, NONE),
+/* I2C1_SCL */ PAD_NC(GPP_C19, NONE),
+/* UART2_RXD */ PAD_NC(GPP_C20, NONE),
+/* UART2_TXD */ PAD_NC(GPP_C21, NONE),
+/* UART2_CTS_N */ PAD_NC(GPP_C22, NONE),
+/* UART2_RTS_N */ PAD_NC(GPP_C23, NONE),
+/* ITCH_SPI_CS */ PAD_NC(GPP_D0, NONE),
+/* ITCH_SPI_CLK */ PAD_NC(GPP_D1, NONE),
+/* ITCH_SPI_MISO_1 */ PAD_NC(GPP_D2, NONE),
+/* ITCH_SPI_MISO_0 */ PAD_NC(GPP_D3, NONE),
+/* FLASHTRIG */ PAD_NC(GPP_D4, NONE),
+/* ISH_I2C0_SDA */ PAD_NC(GPP_D5, NONE),
+/* ISH_I2C0_SCL */ PAD_NC(GPP_D6, NONE),
+/* ISH_I2C1_SDA */ PAD_NC(GPP_D7, NONE),
+/* ISH_I2C1_SCL */ PAD_NC(GPP_D8, NONE),
+/* GPP_D9 */ PAD_NC(GPP_D9, NONE),
+/* GPP_D10 */ PAD_NC(GPP_D10, NONE),
+/* GPP_D11 */ PAD_NC(GPP_D11, NONE),
+/* GPP_D12 */ PAD_NC(GPP_D12, NONE),
+/* ISH_UART0_RXD */ PAD_NC(GPP_D13, NONE),
+/* ISH_UART0_TXD */ PAD_NC(GPP_D14, NONE),
+/* ISH_UART0_RTS */ PAD_NC(GPP_D15, NONE),
+/* ISH_UART0_CTS */ PAD_NC(GPP_D16, NONE),
+/* DMIC_CLK_1 */ PAD_NC(GPP_D17, NONE),
+/* DMIC_DATA_1 */ PAD_NC(GPP_D18, NONE),
+/* DMIC_CLK_0 */ PAD_NC(GPP_D19, NONE),
+/* DMIC_DATA_0 */ PAD_NC(GPP_D20, NONE),
+/* ITCH_SPI_D2 */ PAD_NC(GPP_D21, NONE),
+/* ITCH_SPI_D3 */ PAD_NC(GPP_D22, NONE),
+/* I2S_MCLK */ PAD_NC(GPP_D23, NONE),
+/* SATAXPCIE0 (TP8) */ PAD_NC(GPP_E0, NONE),
+/* SATAXPCIE1 (TP9)*/ PAD_NC(GPP_E1, NONE),
+/* SATAXPCIE2 (TP10) */ PAD_NC(GPP_E2, NONE),
+/* CPU_GP0 */ PAD_NC(GPP_E3, NONE),
+/* SATA_DEVSLP0 */ PAD_NC(GPP_E4, NONE),
+/* SATA_DEVSLP1 */ PAD_NC(GPP_E5, NONE),
+/* SATA_DEVSLP2 */ PAD_NC(GPP_E6, NONE),
+/* CPU_GP1 */ PAD_NC(GPP_E7, NONE),
+/* SATA_LED */ PAD_CFG_NF(GPP_E8, NONE, DEEP, NF1),
+/* USB2_OC_0 */ PAD_NC(GPP_E9, NONE),
+/* USB2_OC_1 */ PAD_NC(GPP_E10, NONE),
+/* USB2_OC_2 */ PAD_NC(GPP_E11, NONE),
+/* USB2_OC_3 */ PAD_NC(GPP_E12, NONE),
+/* DDI1_HPD */ PAD_CFG_NF(GPP_E13, NONE, DEEP, NF1),
+/* DDI2_HPD */ PAD_NC(GPP_E14, NONE),
+/* DDI3_HPD */ PAD_NC(GPP_E15, NONE),
+/* DDI4_HPD */ PAD_NC(GPP_E16, NONE),
+/* EDP_HPD */ PAD_NC(GPP_E17, NONE),
+/* DDPB_CTRLCLK */ PAD_CFG_NF(GPP_E18, NONE, DEEP, NF1),
+/* DDPB_CTRLDATA */ PAD_CFG_NF(GPP_E19, DN_20K, DEEP, NF1),
+/* DDPC_CTRLCLK */ PAD_NC(GPP_E20, NONE),
+/* DDPC_CTRLDATA */ PAD_NC(GPP_E21, NONE),
+/* DDPD_CTRLCLK */ PAD_NC(GPP_E22, NONE),
+/* DDPD_CTRLDATA */ PAD_NC(GPP_E23, NONE),
+/* I2S2_SCLK */ PAD_NC(GPP_F0, NONE),
+/* I2S2_SFRM */ PAD_NC(GPP_F1, NONE),
+/* I2S2_TXD */ PAD_NC(GPP_F2, NONE),
+/* I2S2_RXD */ PAD_NC(GPP_F3, NONE),
+/* I2C2_SDA */ PAD_NC(GPP_F4, NONE),
+/* I2C2_SCL */ PAD_NC(GPP_F5, NONE),
+/* I2C3_SDA */ PAD_NC(GPP_F6, NONE),
+/* I2C3_SCL */ PAD_NC(GPP_F7, NONE),
+/* I2C4_SDA */ PAD_NC(GPP_F8, NONE),
+/* I2C4_SDA */ PAD_NC(GPP_F9, NONE),
+/* I2C5_SDA */ PAD_NC(GPP_F10, NONE),
+/* I2C5_SCL */ PAD_NC(GPP_F11, NONE),
+/* EMMC_CMD */ PAD_NC(GPP_F12, NONE),
+/* EMMC_DATA0 */ PAD_NC(GPP_F13, NONE),
+/* EMMC_DATA1 */ PAD_NC(GPP_F14, NONE),
+/* EMMC_DATA2 */ PAD_NC(GPP_F15, NONE),
+/* EMMC_DATA3 */ PAD_NC(GPP_F16, NONE),
+/* EMMC_DATA4 */ PAD_NC(GPP_F17, NONE),
+/* EMMC_DATA5 */ PAD_NC(GPP_F18, NONE),
+/* EMMC_DATA6 */ PAD_NC(GPP_F19, NONE),
+/* EMMC_DATA7 */ PAD_NC(GPP_F20, NONE),
+/* EMMC_RCLK */ PAD_NC(GPP_F21, NONE),
+/* EMMC_CLK */ PAD_NC(GPP_F22, NONE),
+/* GPP_F23 */ PAD_NC(GPP_F23, NONE),
+/* SD_CMD */ PAD_NC(GPP_G0, NONE),
+/* SD_DATA0 */ PAD_NC(GPP_G1, NONE),
+/* SD_DATA1 */ PAD_NC(GPP_G2, NONE),
+/* SD_DATA2 */ PAD_NC(GPP_G3, NONE),
+/* SD_DATA3 */ PAD_NC(GPP_G4, NONE),
+/* SD_CD# */ PAD_NC(GPP_G5, NONE),
+/* SD_CLK */ PAD_NC(GPP_G6, NONE),
+/* SD_WP */ PAD_NC(GPP_G7, NONE),
+/* PCH_BATLOW */ PAD_NC(GPD0, NONE),
+/* ACPRESENT */ PAD_CFG_NF(GPD1, NONE, DEEP, NF1),
+/* LAN_WAKE_N */ PAD_NC(GPD2, NONE),
+/* PWRBTN */ PAD_CFG_NF(GPD3, UP_20K, DEEP, NF1),
+/* PM_SLP_S3# */ PAD_CFG_NF(GPD4, NONE, DEEP, NF1),
+/* PM_SLP_S4# */ PAD_CFG_NF(GPD5, NONE, DEEP, NF1),
+/* PM_SLP_SA# (TP7) */ PAD_CFG_NF(GPD6, NONE, DEEP, NF1),
+/* GPD7_RSVD */ PAD_CFG_TERM_GPO(GPD7, 1, NONE, DEEP),
+/* PM_SUSCLK */ PAD_CFG_NF(GPD8, NONE, DEEP, NF1),
+/* SLP_WLAN# (TP6) */ PAD_NC(GPD9, NONE),
+/* SLP_S5# (TP3) */ PAD_CFG_NF(GPD10, NONE, DEEP, NF1),
+/* LANPHYC */ PAD_NC(GPD11, NONE),
+};
+
+#endif
+
+#endif
diff --git a/src/mainboard/yanling/yl_kbr6l/ramstage.c b/src/mainboard/yanling/yl_kbr6l/ramstage.c
new file mode 100644
index 0000000..9518b1d
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/ramstage.c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <soc/ramstage.h>
+
+#include "gpio.h"
+
+void mainboard_silicon_init_params(FSP_SIL_UPD *params)
+{
+ /*
+ * Configure pads prior to SiliconInit() in case there's any
+ * dependencies during hardware initialization.
+ */
+ gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
+
+ params->TurboMode = 1;
+ params->PchPort61hEnable = 1;
+ params->CdClock = 3;
+}
diff --git a/src/mainboard/yanling/yl_kbr6l/romstage.c b/src/mainboard/yanling/yl_kbr6l/romstage.c
new file mode 100644
index 0000000..2b68e1a
--- /dev/null
+++ b/src/mainboard/yanling/yl_kbr6l/romstage.c
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <fsp/api.h>
+#include <soc/romstage.h>
+#include <spd_bin.h>
+#include <string.h>
+
+static void mainboard_fill_dq_map_data(void *dq_map_ch0, void *dq_map_ch1)
+{
+ const u8 dq_map[2][12] = {
+ { 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0,
+ 0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
+ { 0x33, 0xCC, 0x00, 0xCC, 0x33, 0xCC,
+ 0x33, 0x00, 0xFF, 0x00, 0xFF, 0x00 } };
+ memcpy(dq_map_ch0, dq_map[0], sizeof(dq_map[0]));
+ memcpy(dq_map_ch1, dq_map[1], sizeof(dq_map[1]));
+}
+
+static void mainboard_fill_dqs_map_data(void *dqs_map_ch0, void *dqs_map_ch1)
+{
+ const u8 dqs_map[2][8] = {
+ { 0, 1, 2, 3, 4, 5, 6, 7 },
+ { 1, 0, 2, 3, 4, 5, 6, 7 } };
+ memcpy(dqs_map_ch0, dqs_map[0], sizeof(dqs_map[0]));
+ memcpy(dqs_map_ch1, dqs_map[1], sizeof(dqs_map[1]));
+}
+
+static void mainboard_fill_rcomp_res_data(void *rcomp_ptr)
+{
+ const u16 RcompResistor[3] = { 121, 81, 100 };
+ memcpy(rcomp_ptr, RcompResistor, sizeof(RcompResistor));
+}
+
+static void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr)
+{
+ static const u16 RcompTarget[5] = { 100, 40, 20, 20, 26 };
+ memcpy(rcomp_strength_ptr, RcompTarget, sizeof(RcompTarget));
+}
+
+void mainboard_memory_init_params(FSPM_UPD *mupd)
+{
+ FSP_M_CONFIG *mem_cfg;
+ mem_cfg = &mupd->FspmConfig;
+
+ mainboard_fill_dq_map_data(&mem_cfg->DqByteMapCh0,
+ &mem_cfg->DqByteMapCh1);
+ mainboard_fill_dqs_map_data(&mem_cfg->DqsMapCpu2DramCh0,
+ &mem_cfg->DqsMapCpu2DramCh1);
+ mainboard_fill_rcomp_res_data(&mem_cfg->RcompResistor);
+ mainboard_fill_rcomp_strength_data(&mem_cfg->RcompTarget);
+
+ struct spd_block blk = {
+ .addr_map = { 0x50, 0x52, },
+ };
+
+ mem_cfg->DqPinsInterleaved = 1;
+ mem_cfg->CaVrefConfig = 2;
+
+ get_spd_smbus(&blk);
+ dump_spd_info(&blk);
+
+ mem_cfg->MemorySpdDataLen = blk.len;
+ mem_cfg->MemorySpdPtr00 = (uintptr_t)blk.spd_array[0];
+ mem_cfg->MemorySpdPtr10 = (uintptr_t)blk.spd_array[1];
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/48769
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Icbc18914670f87f0943b371400c509ff0eeacf6a
Gerrit-Change-Number: 48769
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas
Gerrit-MessageType: newchange
5
12

Change in coreboot[master]: soc/intel/braswell: Increase dcache size
by Shelley Chen (Code Review) May 8, 2024
by Shelley Chen (Code Review) May 8, 2024
May 8, 2024
Shelley Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45827 )
Change subject: soc/intel/braswell: Increase dcache size
......................................................................
soc/intel/braswell: Increase dcache size
Need to increase the DRAM cache size for braswell as the was getting
the compilation error "Cache as RAM area is too full" when moving the
mrc_cache writeback to romstage. We need to increase this first
before landing the CL moving mrc_cache writeback to romstage.
BUG=b:150502246
BRANCH=None
TEST=Able to successfully compile braswell boards
Change-Id: I1538d504ddad8654c79a789e58ffe6b11b5d544c
Signed-off-by: Shelley Chen <shchen(a)google.com>
---
M src/soc/intel/braswell/Kconfig
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/45827/1
diff --git a/src/soc/intel/braswell/Kconfig b/src/soc/intel/braswell/Kconfig
index 5c9988c..077b5a1 100644
--- a/src/soc/intel/braswell/Kconfig
+++ b/src/soc/intel/braswell/Kconfig
@@ -96,7 +96,7 @@
config DCACHE_RAM_SIZE
hex
- default 0x4000
+ default 0x5000
help
The size of the cache-as-ram region required during bootblock
and/or romstage. Note DCACHE_RAM_SIZE and DCACHE_RAM_MRC_VAR_SIZE
--
To view, visit https://review.coreboot.org/c/coreboot/+/45827
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1538d504ddad8654c79a789e58ffe6b11b5d544c
Gerrit-Change-Number: 45827
Gerrit-PatchSet: 1
Gerrit-Owner: Shelley Chen <shchen(a)google.com>
Gerrit-MessageType: newchange
5
9