coreboot-gerrit
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- 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
November 2021
- 1 participants
- 6398 discussions
Change in coreboot[master]: Port of Kontron bSC2 COMe module
by Jose Trujillo (Code Review) Aug. 7, 2023
by Jose Trujillo (Code Review) Aug. 7, 2023
Aug. 7, 2023
Jose Trujillo has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45658 )
Change subject: Port of Kontron bSC2 COMe module
......................................................................
Port of Kontron bSC2 COMe module
Change-Id: I2932af6016b044fa807da00acc7b147ef1c7c45e
Signed-off-by: JTCEA <ce.autom(a)protonmail.com>
---
A src/mainboard/kontron/bSC2/Kconfig
A src/mainboard/kontron/bSC2/Kconfig.name
A src/mainboard/kontron/bSC2/Makefile.inc
A src/mainboard/kontron/bSC2/acpi/ec.asl
A src/mainboard/kontron/bSC2/acpi/platform.asl
A src/mainboard/kontron/bSC2/acpi/superio.asl
A src/mainboard/kontron/bSC2/acpi_tables.c
A src/mainboard/kontron/bSC2/board_info.txt
A src/mainboard/kontron/bSC2/cmos.default
A src/mainboard/kontron/bSC2/cmos.layout
A src/mainboard/kontron/bSC2/devicetree.cb
A src/mainboard/kontron/bSC2/devicetree.cb.orig
A src/mainboard/kontron/bSC2/dsdt.asl
A src/mainboard/kontron/bSC2/early_init.c
A src/mainboard/kontron/bSC2/gma-mainboard.ads
A src/mainboard/kontron/bSC2/gma-mainboard.ads.orig
A src/mainboard/kontron/bSC2/gpio.c
A src/mainboard/kontron/bSC2/hda_verb.c
A src/mainboard/kontron/bSC2/mainboard.c
19 files changed, 1,259 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/45658/1
diff --git a/src/mainboard/kontron/bSC2/Kconfig b/src/mainboard/kontron/bSC2/Kconfig
new file mode 100644
index 0000000..66a74cd
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/Kconfig
@@ -0,0 +1,61 @@
+if BOARD_KONTRON_bSC2
+
+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 # FIXME: check this
+ select NORTHBRIDGE_INTEL_SANDYBRIDGE
+ select SERIRQ_CONTINUOUS_MODE
+ select SOUTHBRIDGE_INTEL_BD82X6X
+ select USE_NATIVE_RAMINIT
+
+ select HAVE_OPTION_TABLE
+ select HAVE_CMOS_DEFAULT
+ select USE_OPTION_TABLE
+ select SUPERIO_SMSC_SMSCSUPERIO
+ select DRIVERS_PS2_KEYBOARD
+ select GFX_GMA_PANEL_1_ON_LVDS
+ select BOOT_DEVICE_SUPPORTS_WRITES
+ select SMMSTORE
+ # select NO_POST
+
+config MAINBOARD_DIR
+ string
+ default kontron/bSC2
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "COMe-bCS2"
+
+config DRAM_RESET_GATE_GPIO # FIXME: check this
+ int
+ default 60
+
+config MAX_CPUS
+ int
+ default 4
+
+config CBFS_SIZE
+ hex
+ default 0x300000
+
+config INCLUDE_CONFIG_FILE
+ bool
+ default n
+
+config CPU_UCODE_BINARIES
+ string
+ default "3rdparty/blobs/mainboard/$(MAINBOARDDIR)/06-2a-07"
+
+config DRIVERS_UART_8250IO
+ bool
+ default y
+
+config CONSOLE_CBMEM
+ bool
+ default n
+
+endif
diff --git a/src/mainboard/kontron/bSC2/Kconfig.name b/src/mainboard/kontron/bSC2/Kconfig.name
new file mode 100644
index 0000000..b0110b6
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_KONTRON_bSC2
+ bool "bCS2-COMe"
diff --git a/src/mainboard/kontron/bSC2/Makefile.inc b/src/mainboard/kontron/bSC2/Makefile.inc
new file mode 100644
index 0000000..18391d8
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/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/kontron/bSC2/acpi/ec.asl b/src/mainboard/kontron/bSC2/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/acpi/ec.asl
diff --git a/src/mainboard/kontron/bSC2/acpi/platform.asl b/src/mainboard/kontron/bSC2/acpi/platform.asl
new file mode 100644
index 0000000..afb8abb
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/acpi/platform.asl
@@ -0,0 +1,8 @@
+Method(_WAK, 1)
+{
+ Return(Package() {0, 0})
+}
+
+Method(_PTS, 1)
+{
+}
diff --git a/src/mainboard/kontron/bSC2/acpi/superio.asl b/src/mainboard/kontron/bSC2/acpi/superio.asl
new file mode 100644
index 0000000..8c920eb
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/acpi/superio.asl
@@ -0,0 +1,262 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 The ChromiumOS 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.
+ */
+
+// Scope is \_SB.PCI0.LPCB
+
+#define SIO_ENABLE_COM1
+#define SIO_ENABLE_COM2
+#define SIO_ENABLE_PS2K
+#define SIO_ENABLE_PS2M
+#define SIO_ENABLE_COM3
+#define SIO_ENABLE_COM4
+
+Device (SIO) {
+ Name (_ADR, 0x2E)
+ OperationRegion (SIOA, SystemIO, 0x2E, 0x02)
+ Field (SIOA, ByteAcc, NoLock, Preserve)
+ {
+ SI2E, 8,
+ SI2F, 8,
+ }
+
+ IndexField (SI2E, SI2F, ByteAcc, NoLock, Preserve)
+ {
+ Offset (0x02),
+ SCNT, 8, /* Configure Control */
+ Offset (0x07),
+ SLDN, 8, /* Logical Device Number */
+ Offset (0x30),
+ SACT, 8, /* Activate */
+ Offset (0x60),
+ IO0H, 8, /* Base Address 0 MSB */
+ IO0L, 8, /* Base Address 0 LSB */
+ Offset (0x62),
+ IO1H, 8, /* Base Address 1 MSB */
+ IO1L, 8, /* Base Address 1 LSB */
+ Offset (0x70),
+ IQ00, 8, /* Interrupt Select */
+ IQ01, 8,
+ }
+
+ Name (SFDC, 0) /* Floppy Disk */
+ Name (SPPC, 3) /* Parallel Port */
+ Name (SSP1, 4) /* Serial Port 1 */
+ Name (SSP2, 5) /* Serial Port 2 */
+ Name (SKBC, 7) /* Keyboard & Mouse */
+ Name (SRRB, 10) /* Runtime Register Block */
+ Name (SSP3, 11) /* Serial Port 3 */
+ Name (SSP4, 12) /* Serial Port 4 */
+
+ Method (ENTR, 0, NotSerialized)
+ {
+ Store (0x55, SI2E)
+ }
+
+ Method (EXIT, 0, NotSerialized)
+ {
+ Store (0xaa, SI2E)
+ }
+
+ /* Parse activate register for an LDN */
+ Method (ISEN, 1, NotSerialized)
+ {
+ ENTR ()
+ Store (Arg0, SLDN)
+ Store (SACT, Local0)
+ EXIT ()
+
+ /* Check if it exists */
+ If (LEqual (Local0, 0xFF))
+ {
+ Return (0x00)
+ }
+
+ /* Check if activated */
+ If (LEqual (Local0, One))
+ {
+ Return (0x0F)
+ }
+ Else
+ {
+ Return (0x0D)
+ }
+ }
+
+ /* Enable an LDN via the activate register */
+ Method (SENA, 1, NotSerialized)
+ {
+ ENTR ()
+ Store (Arg0, SLDN)
+ Store (One, SACT)
+ EXIT ()
+ }
+
+ /* Disable an LDN via the activate register */
+ Method (SDIS, 1, NotSerialized)
+ {
+ ENTR ()
+ Store (Arg0, SLDN)
+ Store (Zero, SACT)
+ EXIT ()
+ }
+
+#ifdef SIO_ENABLE_COM1
+ Device (COM1) {
+ Name (_HID, EISAID ("PNP0501"))
+ Name (_UID, 1)
+
+ Method (_STA, 0, NotSerialized) {
+ Return (ISEN (SSP1))
+ }
+
+ Name (_CRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x03F8, 0x03F8, 0x08, 0x08)
+ //IRQNoFlags () {4}
+ IRQ (Edge, ActiveHigh, Exclusive) {4}
+ })
+
+ Name (_PRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x03F8, 0x03F8, 0x08, 0x08)
+ //IRQNoFlags () {4}
+ IRQ (Edge, ActiveHigh, Exclusive) {4}
+ })
+ }
+#endif
+
+#ifdef SIO_ENABLE_COM2
+ Device (COM2) {
+ Name (_HID, EISAID ("PNP0501"))
+ Name (_UID, 2)
+
+ Method (_STA, 0, NotSerialized) {
+ Return (ISEN (SSP2))
+ }
+
+ Name (_CRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x02F8, 0x02F8, 0x08, 0x08)
+ //IRQNoFlags () {3}
+ IRQ (Edge, ActiveHigh, Exclusive) {3}
+ })
+
+ Name (_PRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x02F8, 0x02F8, 0x08, 0x08)
+ //IRQNoFlags () {3}
+ IRQ (Edge, ActiveHigh, Exclusive) {3}
+ })
+ }
+#endif
+
+#ifdef SIO_ENABLE_PS2K
+ Device (PS2K) // Keyboard
+ {
+ Name (_HID, EISAID("PNP0303"))
+ Name (_CID, EISAID("PNP030B"))
+
+ Method (_STA, 0, NotSerialized) {
+ Return (ISEN (SKBC))
+ }
+
+ Name (_CRS, ResourceTemplate()
+ {
+ IO (Decode16, 0x60, 0x60, 0x01, 0x01)
+ IO (Decode16, 0x64, 0x64, 0x01, 0x01)
+ IRQNoFlags () {1}
+ })
+
+ Name (_PRS, ResourceTemplate()
+ {
+ IO (Decode16, 0x60, 0x60, 0x01, 0x01)
+ IO (Decode16, 0x64, 0x64, 0x01, 0x01)
+ IRQNoFlags () {1}
+ })
+ }
+#endif
+
+#ifdef SIO_ENABLE_PS2M
+ Device (PS2M) // Mouse
+ {
+ Name (_HID, EISAID("PNP0F13"))
+
+ Method (_STA, 0, NotSerialized) {
+ Return (ISEN (SKBC))
+ }
+
+ Name (_CRS, ResourceTemplate()
+ {
+ IRQNoFlags () {12}
+ })
+
+ Name (_PRS, ResourceTemplate()
+ {
+ IRQNoFlags () {12}
+ })
+ }
+#endif
+
+#ifdef SIO_ENABLE_COM3
+ Device (COM3) {
+ Name (_HID, EISAID ("PNP0501"))
+ Name (_UID, 3)
+
+ Method (_STA, 0, NotSerialized) {
+ Return (ISEN (SSP3))
+ }
+
+ Name (_CRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x03E8, 0x03E8, 0x08, 0x08)
+ //IRQNoFlags () {5}
+ IRQ (Edge, ActiveHigh, Exclusive) {5}
+ })
+
+ Name (_PRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x03E8, 0x03E8, 0x08, 0x08)
+ //IRQNoFlags () {5}
+ IRQ (Edge, ActiveHigh, Exclusive) {5}
+ })
+ }
+#endif
+
+#ifdef SIO_ENABLE_COM4
+ Device (COM4) {
+ Name (_HID, EISAID ("PNP0501"))
+ Name (_UID, 4)
+
+ Method (_STA, 0, NotSerialized) {
+ Return (ISEN (SSP4))
+ }
+
+ Name (_CRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x02E0, 0x02E0, 0x08, 0x08)
+ //IRQNoFlags () {10}
+ IRQ (Edge, ActiveHigh, Exclusive) {6}
+ })
+
+ Name (_PRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x02E0, 0x02E0, 0x08, 0x08)
+ //IRQNoFlags () {10}
+ IRQ (Edge, ActiveHigh, Exclusive) {6}
+ })
+ }
+#endif
+
+}
diff --git a/src/mainboard/kontron/bSC2/acpi_tables.c b/src/mainboard/kontron/bSC2/acpi_tables.c
new file mode 100644
index 0000000..b7f2730
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/acpi_tables.c
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi_gnvs.h>
+#include <southbridge/intel/bd82x6x/nvs.h>
+//#include "thermal.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/kontron/bSC2/board_info.txt b/src/mainboard/kontron/bSC2/board_info.txt
new file mode 100644
index 0000000..2b0447b
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/board_info.txt
@@ -0,0 +1,6 @@
+Category: half
+ROM protocol: SPI
+ROM package: 8-pin SOIC
+ROM socketed: n
+Flashrom support: n
+Release year: 2011
diff --git a/src/mainboard/kontron/bSC2/cmos.default b/src/mainboard/kontron/bSC2/cmos.default
new file mode 100644
index 0000000..fa9887f
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/cmos.default
@@ -0,0 +1,7 @@
+boot_option=Fallback
+debug_level=Debug
+gfx_uma_size=128M
+nmi=Enable
+power_on_after_fail=Disable
+sata_mode=AHCI
+hyper_threading=Enable
diff --git a/src/mainboard/kontron/bSC2/cmos.layout b/src/mainboard/kontron/bSC2/cmos.layout
new file mode 100644
index 0000000..8f6ae54
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/cmos.layout
@@ -0,0 +1,124 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2007-2008 coresystems GmbH
+##
+## 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
+385 3 r 0 reserved
+388 4 h 0 reboot_counter
+
+# -----------------------------------------------------------------
+# coreboot config options: console
+#392 3 r 0 unused
+395 4 e 5 debug_level
+#399 1 r 0 unused
+
+# coreboot config options: cpu
+400 1 e 2 hyper_threading
+401 3 e 9 gfx_uma_size
+#404 4 r 0 unused
+
+# coreboot config options: southbridge
+408 1 e 1 nmi
+409 2 e 10 power_on_after_fail
+411 1 e 8 sata_mode
+#412 4 r 0 unused
+
+# coreboot config options: bootloader
+416 424 s 0 boot_devices
+840 8 h 0 boot_default
+848 1 e 7 cmos_defaults_loaded
+#851 5 r 0 unused
+
+# coreboot config options: mainboard specific options
+#856 40 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
+#976 8 r 0 unused
+
+# coreboot config options: check sums
+984 16 h 0 check_sum
+#1000 24 r 0 amd_reserved
+
+# -----------------------------------------------------------------
+
+enumerations
+
+#ID value text
+1 0 Disable
+1 1 Enable
+2 0 Enable
+2 1 Disable
+3 0 Fallback
+3 1 Normal
+5 0 Emergency
+5 1 Alert
+5 2 Critical
+5 3 Error
+5 4 Warning
+5 5 Notice
+5 6 Info
+5 7 Debug
+5 8 Spew
+6 0 Disable
+6 1 Enable
+6 2 Keep
+7 0 No
+7 1 Yes
+8 0 AHCI
+8 1 Compatible
+9 0 32M
+9 1 64M
+9 2 96M
+9 3 128M
+9 4 160M
+9 5 192M
+9 6 224M
+10 0 Disable
+10 1 Enable
+10 2 Keep
+# -----------------------------------------------------------------
+checksums
+
+checksum 392 895 984
diff --git a/src/mainboard/kontron/bSC2/devicetree.cb b/src/mainboard/kontron/bSC2/devicetree.cb
new file mode 100644
index 0000000..018b72a
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/devicetree.cb
@@ -0,0 +1,126 @@
+chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
+
+ register "gfx" = "GMA_STATIC_DISPLAYS(1)"
+ 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" = "2000"
+ register "gpu_panel_power_backlight_on_delay" = "2000"
+ register "gpu_panel_power_cycle_delay" = "4"
+ register "gpu_panel_power_down_delay" = "500"
+ register "gpu_panel_power_up_delay" = "100"
+ register "gpu_pch_backlight" = "0x13121312"
+
+ 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" = "0x00fc0a01" # SIO Runtime registers I/O range forwarded to LPC
+ register "gen2_dec" = "0x000403e9" # COM3 I/O range forwarded to LPC
+ register "gen3_dec" = "0x000402e1" # COM4 I/O range forwarded to LPC
+ register "gen4_dec" = "0x000403e9"
+ 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" = "0x1"
+ 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 on end # Intel Gigabit Ethernet
+ device pci 1a.0 on # USB2 EHCI #2
+ subsystemid 0x8086 0x1c2d
+ end
+ device pci 1b.0 off end # High Definition Audio
+ device pci 1c.0 on # PCIe Port #1
+ subsystemid 0x8086 0x1c10
+ end
+ device pci 1c.1 on # PCIe Port #2: i82574
+ subsystemid 0x8086 0x1c12
+ end
+ device pci 1c.2 on # PCIe Port #3: OXPCIE958
+ subsystemid 0x8086 0x1c14
+ end
+ 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, 0x8086 0x1c1a: JMB368
+ device pci 1c.6 off end # PCIe Port #7, 0x8086 0x1c1c: PEX8112
+ device pci 1c.7 off end # PCIe Port #8, already in use by GB LAN
+ 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 0x1c4f
+ chip superio/smsc/smscsuperio
+ device pnp 2e.0 off end # Floppy
+ device pnp 2e.3 off end # Parallel Port
+ device pnp 2e.4 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.5 on # COM2
+ io 0x60 = 0x2f8
+ irq 0x70 = 3
+ end
+ device pnp 2e.7 on # PS2 Keyboard & Mouse
+ io 0x60 = 0x60
+ io 0x62 = 0x64
+ irq 0x70 = 1
+ irq 0x72 = 12
+ end
+ device pnp 2e.a on # Runtime Regs
+ io 0x60 = 0x0a00
+ drq 0xF0 = 0x0b # no 32kHz
+ end
+ device pnp 2e.b on # COM3
+ io 0x60 = 0x3e8
+ irq 0x70 = 5
+ end
+ device pnp 2e.c on # COM4
+ io 0x60 = 0x2e0
+ irq 0x70 = 6
+ end
+ end # smscsuperio
+ end
+ device pci 1f.2 on # SATA Controller 1
+ subsystemid 0x8086 0x1c01
+ end
+ device pci 1f.3 on # SMBus
+ subsystemid 0x8086 0x1c22
+ end
+ device pci 1f.5 off end # SATA Controller 2, subsystemid 0x8086 0x1c09
+ device pci 1f.6 off end # Thermal
+
+ end
+ device pci 00.0 on # Host bridge
+ subsystemid 0x8086 0x0104
+ 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/kontron/bSC2/devicetree.cb.orig b/src/mainboard/kontron/bSC2/devicetree.cb.orig
new file mode 100644
index 0000000..39214f9
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/devicetree.cb.orig
@@ -0,0 +1,109 @@
+chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
+ register "gfx" = "GMA_STATIC_DISPLAYS(1)"
+ 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" = "2000"
+ register "gpu_panel_power_backlight_on_delay" = "2000"
+ register "gpu_panel_power_cycle_delay" = "4"
+ register "gpu_panel_power_down_delay" = "500"
+ register "gpu_panel_power_up_delay" = "100"
+ register "gpu_pch_backlight" = "0x13121312"
+ 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" = "0x00fc0a01"
+ register "gen2_dec" = "0x000403e9"
+ register "gen3_dec" = "0x000402e1"
+ register "gen4_dec" = "0x000403e9"
+ 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" = "0x1"
+ 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 # 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
+ end
+ device pci 1a.0 on # USB2 EHCI #2
+ subsystemid 0x8086 0x1c2d
+ end
+ device pci 1b.0 off # High Definition Audio
+ end
+ device pci 1c.0 on # PCIe Port #1
+ subsystemid 0x8086 0x1c10
+ end
+ device pci 1c.1 on # PCIe Port #2
+ subsystemid 0x8086 0x1c12
+ end
+ device pci 1c.2 on # PCIe Port #3
+ subsystemid 0x8086 0x1c14
+ end
+ device pci 1c.3 off # PCIe Port #4
+ end
+ device pci 1c.4 off # PCIe Port #5
+ end
+ device pci 1c.5 on # PCIe Port #6
+ subsystemid 0x8086 0x1c1a
+ end
+ device pci 1c.6 on # PCIe Port #7
+ subsystemid 0x8086 0x1c1c
+ end
+ device pci 1c.7 off # PCIe Port #8
+ end
+ device pci 1d.0 on # USB2 EHCI #1
+ subsystemid 0x8086 0x1c26
+ end
+ device pci 1e.0 off # PCI bridge
+ end
+ device pci 1f.0 on # LPC bridge
+ subsystemid 0x8086 0x1c4f
+ end
+ device pci 1f.2 on # SATA Controller 1
+ subsystemid 0x8086 0x1c01
+ end
+ device pci 1f.3 on # SMBus
+ subsystemid 0x8086 0x1c22
+ end
+ device pci 1f.5 on # SATA Controller 2 Unsupported PCI device 8086:1c09
+ subsystemid 0x8086 0x1c09
+ end
+ device pci 1f.6 off # Thermal
+ end
+ end
+ device pci 00.0 on # Host bridge Host bridge
+ subsystemid 0x8086 0x0104
+ 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/kontron/bSC2/dsdt.asl b/src/mainboard/kontron/bSC2/dsdt.asl
new file mode 100644
index 0000000..e648a99
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/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/kontron/bSC2/early_init.c b/src/mainboard/kontron/bSC2/early_init.c
new file mode 100644
index 0000000..f53b749
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/early_init.c
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+
+#include <bootblock_common.h>
+#include <device/pci_ops.h>
+#include <northbridge/intel/sandybridge/sandybridge.h>
+#include <northbridge/intel/sandybridge/raminit_native.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+#include <superio/smsc/smscsuperio/smscsuperio.h>
+
+#define SERIAL_DEV PNP_DEV(0x2e, SMSCSUPERIO_SP1)
+
+const struct southbridge_usb_port mainboard_usb_ports[] = {
+/* enabled, power, oc pin */
+ { 1, 1, 0 }, /* P0: USB0 */
+ { 1, 1, 0 }, /* P1: USB1 */
+ { 1, 1, 1 }, /* P2: USB2 */
+ { 1, 1, 1 }, /* P3: USB3 */
+ { 0, 0, -1 }, /* P4: - */
+ { 0, 0, -1 }, /* P5: - */
+ { 0, 0, -1 }, /* P6: - */
+ { 0, 0, -1 }, /* P7: - */
+ { 1, 1, 4 }, /* P8: USB4 */
+ { 1, 1, 4 }, /* P9: USB5 */
+ { 1, 0, 5 }, /* P10: USB6 */
+ { 1, 0, 5 }, /* P11: USB7 */
+ { 0, 0, -1 }, /* P12: - */
+ { 0, 0, -1 }, /* P13: - */
+};
+
+void bootblock_mainboard_early_init(void)
+{
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x1403); /* COMA, COMB, KBC and LPC 0x2E enabled */
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0010); /* LPC decode ranges COMA=3F8, COMB=2F8 */
+}
+
+void mainboard_early_init(int s3resume)
+{
+ smscsuperio_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+}
+
+/* SPD map */
+void mainboard_get_spd(spd_raw_data *spd, bool id_only)
+{
+ read_spd(&spd[0], 0x50, id_only); /* Read Dimm1 RAM settings */
+ read_spd(&spd[2], 0x52, id_only); /* Read Dimm2 RAM settings */
+}
diff --git a/src/mainboard/kontron/bSC2/gma-mainboard.ads b/src/mainboard/kontron/bSC2/gma-mainboard.ads
new file mode 100644
index 0000000..8bfbab6
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/gma-mainboard.ads
@@ -0,0 +1,23 @@
+-- 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
+
+ -- FIXME: check this
+ ports : constant Port_List :=
+ (LVDS,
+ DP1,
+ DP2,
+ DP3,
+ HDMI1,
+ HDMI2,
+ HDMI3,
+ Analog,
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/kontron/bSC2/gma-mainboard.ads.orig b/src/mainboard/kontron/bSC2/gma-mainboard.ads.orig
new file mode 100644
index 0000000..133fde5
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/gma-mainboard.ads.orig
@@ -0,0 +1,23 @@
+-- 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
+
+ -- FIXME: check this
+ ports : constant Port_List :=
+ (DP1,
+ DP2,
+ DP3,
+ HDMI1,
+ HDMI2,
+ HDMI3,
+ Analog,
+ LVDS,
+ eDP);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/kontron/bSC2/gpio.c b/src/mainboard/kontron/bSC2/gpio.c
new file mode 100644
index 0000000..e93e29f
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/gpio.c
@@ -0,0 +1,232 @@
+/* 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_NATIVE,
+ .gpio10 = GPIO_MODE_GPIO,
+ .gpio11 = GPIO_MODE_GPIO,
+ .gpio12 = GPIO_MODE_NATIVE,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_GPIO,
+ .gpio15 = GPIO_MODE_GPIO,
+ .gpio16 = GPIO_MODE_GPIO,
+ .gpio17 = GPIO_MODE_GPIO,
+ .gpio18 = GPIO_MODE_GPIO,
+ .gpio19 = GPIO_MODE_GPIO,
+ .gpio20 = GPIO_MODE_GPIO,
+ .gpio21 = GPIO_MODE_GPIO,
+ .gpio22 = GPIO_MODE_GPIO,
+ .gpio23 = GPIO_MODE_NATIVE,
+ .gpio24 = GPIO_MODE_GPIO,
+ .gpio25 = GPIO_MODE_GPIO,
+ .gpio26 = GPIO_MODE_GPIO,
+ .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_INPUT,
+ .gpio5 = GPIO_DIR_INPUT,
+ .gpio6 = GPIO_DIR_INPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_OUTPUT,
+ .gpio10 = GPIO_DIR_OUTPUT,
+ .gpio11 = GPIO_DIR_INPUT,
+ .gpio13 = GPIO_DIR_INPUT,
+ .gpio14 = GPIO_DIR_OUTPUT,
+ .gpio15 = GPIO_DIR_OUTPUT,
+ .gpio16 = GPIO_DIR_OUTPUT,
+ .gpio17 = GPIO_DIR_OUTPUT,
+ .gpio18 = GPIO_DIR_OUTPUT,
+ .gpio19 = GPIO_DIR_INPUT,
+ .gpio20 = GPIO_DIR_OUTPUT,
+ .gpio21 = GPIO_DIR_OUTPUT,
+ .gpio22 = GPIO_DIR_INPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio25 = GPIO_DIR_OUTPUT,
+ .gpio26 = GPIO_DIR_OUTPUT,
+ .gpio27 = GPIO_DIR_INPUT,
+ .gpio28 = GPIO_DIR_INPUT,
+ .gpio29 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio8 = GPIO_LEVEL_LOW,
+ .gpio10 = GPIO_LEVEL_LOW,
+ .gpio14 = GPIO_LEVEL_LOW,
+ .gpio15 = GPIO_LEVEL_LOW,
+ .gpio16 = GPIO_LEVEL_LOW,
+ .gpio17 = GPIO_LEVEL_LOW,
+ .gpio18 = GPIO_LEVEL_LOW,
+ .gpio20 = GPIO_LEVEL_LOW,
+ .gpio21 = GPIO_LEVEL_LOW,
+ .gpio24 = GPIO_LEVEL_LOW,
+ .gpio25 = GPIO_LEVEL_LOW,
+ .gpio26 = GPIO_LEVEL_HIGH,
+ .gpio29 = GPIO_LEVEL_HIGH,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_reset = {
+ .gpio30 = GPIO_RESET_RSMRST,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_invert = {
+ .gpio4 = GPIO_INVERT,
+ .gpio5 = GPIO_INVERT,
+ .gpio6 = GPIO_INVERT,
+ .gpio7 = GPIO_INVERT,
+ .gpio11 = GPIO_INVERT,
+ .gpio13 = GPIO_INVERT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_blink = {
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_mode = {
+ .gpio32 = GPIO_MODE_NATIVE,
+ .gpio33 = GPIO_MODE_GPIO,
+ .gpio34 = GPIO_MODE_NATIVE,
+ .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_GPIO,
+ .gpio45 = GPIO_MODE_GPIO,
+ .gpio46 = GPIO_MODE_NATIVE,
+ .gpio47 = GPIO_MODE_GPIO,
+ .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_NATIVE,
+ .gpio62 = GPIO_MODE_NATIVE,
+ .gpio63 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_direction = {
+ .gpio33 = GPIO_DIR_OUTPUT,
+ .gpio35 = GPIO_DIR_INPUT,
+ .gpio36 = GPIO_DIR_INPUT,
+ .gpio37 = GPIO_DIR_INPUT,
+ .gpio38 = GPIO_DIR_INPUT,
+ .gpio39 = GPIO_DIR_INPUT,
+ .gpio44 = GPIO_DIR_INPUT,
+ .gpio45 = GPIO_DIR_INPUT,
+ .gpio47 = GPIO_DIR_INPUT,
+ .gpio48 = GPIO_DIR_INPUT,
+ .gpio49 = GPIO_DIR_INPUT,
+ .gpio50 = GPIO_DIR_OUTPUT,
+ .gpio51 = GPIO_DIR_INPUT,
+ .gpio52 = GPIO_DIR_OUTPUT,
+ .gpio53 = GPIO_DIR_OUTPUT,
+ .gpio54 = GPIO_DIR_INPUT,
+ .gpio55 = GPIO_DIR_INPUT,
+ .gpio56 = GPIO_DIR_INPUT,
+ .gpio57 = GPIO_DIR_INPUT,
+ .gpio60 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio33 = GPIO_LEVEL_LOW,
+ .gpio50 = GPIO_LEVEL_LOW,
+ .gpio52 = GPIO_LEVEL_LOW,
+ .gpio53 = GPIO_LEVEL_LOW,
+ .gpio60 = 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_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_GPIO,
+ .gpio74 = GPIO_MODE_NATIVE,
+ .gpio75 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_direction = {
+ .gpio65 = GPIO_DIR_OUTPUT,
+ .gpio66 = GPIO_DIR_OUTPUT,
+ .gpio67 = GPIO_DIR_OUTPUT,
+ .gpio68 = GPIO_DIR_OUTPUT,
+ .gpio69 = GPIO_DIR_OUTPUT,
+ .gpio70 = GPIO_DIR_OUTPUT,
+ .gpio71 = GPIO_DIR_OUTPUT,
+ .gpio73 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_level = {
+ .gpio65 = GPIO_LEVEL_LOW,
+ .gpio66 = GPIO_LEVEL_LOW,
+ .gpio67 = GPIO_LEVEL_LOW,
+ .gpio68 = GPIO_LEVEL_HIGH,
+ .gpio69 = GPIO_LEVEL_HIGH,
+ .gpio70 = GPIO_LEVEL_LOW,
+ .gpio71 = GPIO_LEVEL_LOW,
+ .gpio73 = 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/kontron/bSC2/hda_verb.c b/src/mainboard/kontron/bSC2/hda_verb.c
new file mode 100644
index 0000000..3804740
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/hda_verb.c
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008-2009 coresystems GmbH
+ * Copyright (C) 2014 Vladimir Serbinenko
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
+ 0x80862805, /* Codec Vendor / Device ID: Intel */
+ 0x80860101, /* Subsystem ID */
+
+ 0x00000004, /* Number of 4 dword sets */
+ /* NID 0x01: Subsystem ID. */
+ AZALIA_SUBVENDOR(0x3, 0x80860101),
+
+ /* NID 0x05. */
+ AZALIA_PIN_CFG(0x3, 0x05, 0x18560010),
+
+ /* NID 0x06. */
+ AZALIA_PIN_CFG(0x3, 0x06, 0x18560020),
+
+ /* NID 0x07. */
+ AZALIA_PIN_CFG(0x3, 0x07, 0x18560030),
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/kontron/bSC2/mainboard.c b/src/mainboard/kontron/bSC2/mainboard.c
new file mode 100644
index 0000000..1b9cd36
--- /dev/null
+++ b/src/mainboard/kontron/bSC2/mainboard.c
@@ -0,0 +1,139 @@
+#include <device/device.h>
+#include <drivers/intel/gma/int15.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+#include <console/console.h>
+#include <device/pnp_ops.h>
+#include <device/smbus_host.h>
+
+/* SCH3114 */
+#define SIO_RUNTIME_BASE 0x0A00
+
+/* CPLD */
+#define CPLD_IDX 0x0A80
+#define CPLD_DATA (CPLD_IDX + 1)
+#define I2C_PRER_LO_IDX 0x0B
+#define I2C_CTR_IDX 0x0D
+#define CFG_CPLD 0x37
+
+/* ADT7490 */
+#define SMBUS_IO_BASE 0x0400
+#define ADT7490_ADDRESS 0x2E
+#define REG_VENDID 0x3E
+#define REG_DEVID2 0x3F
+#define PWM1_DUTY_CYCLE 0x30
+#define PECI_TCON_LIMIT 0x3D
+#define CONF_REG_1 0x40
+#define PWM1_CONF_REG 0x5C
+#define R2_TRAN_PWM3_FREQ 0x61
+#define PWM1_MIN_DUTY_CYCLE 0x64
+#define PWM3_MIN_DUTY_CYCLE 0x66
+#define R2_TEMP_TMIN 0x69
+#define INT_MASK_1 0x74
+#define INT_MASK_2 0x75
+#define THERM_TIMER_LIMIT 0x7A
+#define INT_MASK_3 0x82
+#define INT_MASK_4 0x83
+
+static u32 smbus_io_base = SMBUS_IO_BASE;
+static u32 adt7490_address = ADT7490_ADDRESS;
+
+#define adt7490_read_byte(reg) do_smbus_read_byte(smbus_io_base, adt7490_address, reg)
+#define adt7490_write_byte(reg, val) do_smbus_write_byte(smbus_io_base, adt7490_address, reg, val)
+
+/* CPLD I/O operations */
+//static u8 cpld_read8(u8 idx)
+//{
+// outb(idx, CPLD_IDX);
+// return inb(CPLD_DATA);
+//}
+
+//static u16 cpld_read16(u8 idx)
+//{
+// return cpld_read8(idx) | (cpld_read8(idx + 1) << 8);
+//}
+
+static void cpld_write8(u8 idx, u8 value)
+{
+ outb(idx, CPLD_IDX);
+ outb(value, CPLD_DATA);
+}
+
+static void cpld_write16(u8 idx, u16 value)
+{
+ cpld_write8(idx, (u8)value);
+ cpld_write8(idx + 1, (u8)(value >> 8));
+}
+
+/* SCH3114 SIO GPIOs. */
+static const u16 sio_init_table[] = { // nibble: hi = offset, lo = value
+
+ // GP5x = COM2 function instead of GPIO
+ 0x3F05, 0x4005, 0x4105, 0x4204, 0x4305, 0x4404, 0x4505, 0x4604,
+
+ // GP1x = COM3 function instead of GPIO
+ 0x2305, 0x2404, 0x2505, 0x2605, 0x2705, 0x2904, 0x2A05, 0x2B04,
+
+ // GP6x = COM4 function instead of GPIO
+ 0x3405, 0x3704, 0x5405, 0x5505, 0x5605, 0x5704, 0x5805, 0x5904,
+};
+
+static void mainboard_init(struct device *dev)
+{
+ int i;
+ /* Init SCH311x SIO GPIOs. */
+ printk(BIOS_DEBUG, "Init SIO GPIOs @ 0x%04x\n", SIO_RUNTIME_BASE);
+ for (i = 0; i < ARRAY_SIZE(sio_init_table); i++) {
+ u16 val = sio_init_table[i];
+ outb((u8)val, SIO_RUNTIME_BASE + (val >> 8));
+ }
+
+ /* Init CPLD */
+ cpld_write16(I2C_PRER_LO_IDX, 0x020); // I2C Clock prescaler
+ cpld_write8(I2C_CTR_IDX, 0x80); // I2C Clock control
+
+ /* Init ADT7490 */
+ int vendid, devid2;
+
+ vendid = adt7490_read_byte(REG_VENDID); /* Read VEN & DEV ID */
+ devid2 = adt7490_read_byte(REG_DEVID2);
+
+ /* If ADT7490 is present, then initialize it, else exit */
+ if ((vendid = 0x41) && // Analog Devices
+ (devid2 & 0xfc) == 0x6c) { // Device ID
+
+ printk(BIOS_DEBUG, "Found ADT7490 at %x:%x\n", smbus_io_base, adt7490_address);
+
+ adt7490_write_byte(PWM1_DUTY_CYCLE, 0x81); // Half Duty
+ adt7490_write_byte(PECI_TCON_LIMIT, 0x80); // Disabled
+ adt7490_write_byte(CONF_REG_1, 0x15); // Monitoring and PWM control outputs enabled
+ adt7490_write_byte(PWM1_CONF_REG, 0x42); // 250ms spin time, Remote 2 temp. controls PWM1
+ adt7490_write_byte(R2_TRAN_PWM3_FREQ, 0xB4); // Frequency = 35.3 Hz, low frequency PWM mode,
+ // 26.67 C parameter.
+ adt7490_write_byte(PWM1_MIN_DUTY_CYCLE, 0x54);
+ adt7490_write_byte(PWM3_MIN_DUTY_CYCLE, 0x8C);
+ adt7490_write_byte(R2_TEMP_TMIN, 0x37); // When the temperature measured exceeds T MIN , the
+ // appropriate fan runs at minimum speed and
+ // increases with temperature according to T RANGE.
+ adt7490_write_byte(INT_MASK_1, 0xFF); // Mask all #SMBALERT
+ adt7490_write_byte(INT_MASK_2, 0xFF); // Mask all #SMBALERT
+ adt7490_write_byte(THERM_TIMER_LIMIT, 0xFF); // Avoid unwanted alerts from being generated.
+ adt7490_write_byte(INT_MASK_3, 0xFF); // Mask all #SMBALERT
+ adt7490_write_byte(INT_MASK_4, 0xF8); // Mask all #SMBALERT
+
+ }
+
+}
+
+static void mainboard_enable(struct device *dev)
+{
+ dev->ops->init = mainboard_init;
+
+ /* 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/+/45658
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2932af6016b044fa807da00acc7b147ef1c7c45e
Gerrit-Change-Number: 45658
Gerrit-PatchSet: 1
Gerrit-Owner: Jose Trujillo
Gerrit-MessageType: newchange
4
8
Aug. 7, 2023
Sergey Larin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38253 )
Change subject: src/superio: Add it8987e
......................................................................
src/superio: Add it8987e
Add support for IT8987E SuperIO. Based on it8528e.
Currently untested.
Signed-off-by: cerg2010cerg2010 <cerg2010cerg2010(a)mail.ru>
Change-Id: I3e39be986ffbdebe873ff9b9dbc6902ed1ceaf6f
---
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
4 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/38253/1
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/+/38253
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3e39be986ffbdebe873ff9b9dbc6902ed1ceaf6f
Gerrit-Change-Number: 38253
Gerrit-PatchSet: 1
Gerrit-Owner: Sergey Larin <cerg2010cerg2010(a)mail.ru>
Gerrit-MessageType: newchange
4
3
Name of user not set #1002723 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39705 )
Change subject: ok
......................................................................
ok
Change-Id: I1049a15110e671b334ab29411b4c148b33f207a6
---
M Documentation/contributing/project_ideas.md
A grub.cfg
A src/mainboard/dell/Kconfig
A src/mainboard/dell/Kconfig.name
A src/mainboard/dell/dell_system_vostro_3360/Kconfig
A src/mainboard/dell/dell_system_vostro_3360/Kconfig.name
A src/mainboard/dell/dell_system_vostro_3360/Makefile.inc
A src/mainboard/dell/dell_system_vostro_3360/acpi/ec.asl
A src/mainboard/dell/dell_system_vostro_3360/acpi/platform.asl
A src/mainboard/dell/dell_system_vostro_3360/acpi/superio.asl
A src/mainboard/dell/dell_system_vostro_3360/acpi_tables.c
A src/mainboard/dell/dell_system_vostro_3360/board_info.txt
A src/mainboard/dell/dell_system_vostro_3360/devicetree.cb
A src/mainboard/dell/dell_system_vostro_3360/dsdt.asl
A src/mainboard/dell/dell_system_vostro_3360/early_init.c
A src/mainboard/dell/dell_system_vostro_3360/gma-mainboard.ads
A src/mainboard/dell/dell_system_vostro_3360/gpio.c
A src/mainboard/dell/dell_system_vostro_3360/hda_verb.c
A src/mainboard/dell/dell_system_vostro_3360/mainboard.c
19 files changed, 782 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/39705/1
diff --git a/Documentation/contributing/project_ideas.md b/Documentation/contributing/project_ideas.md
index 2c621f4..141023f 100644
--- a/Documentation/contributing/project_ideas.md
+++ b/Documentation/contributing/project_ideas.md
@@ -184,3 +184,66 @@
### Mentors
* TODO
+
+## Fix POST code handling
+coreboot supports writing POST codes to I/O port 80.
+There are various Kconfigs that deal with POST codes, which don't have
+effect on most platforms.
+The code to send POST codes is scattered in C and Assembly, some use
+functions, some use macros and others simply use the `outb` instruction.
+The POST codes are duplicated between stages and aren't documented properly.
+
+
+Tasks:
+* Guard Kconfigs with a *depends on* to only show on supported platforms
+* Remove duplicated Kconfigs
+* Replace `outb(0x80, ...)` with calls to `post_code(...)`
+* Update Documentation/POSTCODES
+* Use defines from console/post_codes.h where possible
+* Drop duplicated POST codes
+* Make use of all possible 255 values
+
+### Requirements
+* knowledge in the coreboot build system and the concept of stages
+* other knowledge: Little experience with C and x86 Assembly
+* hardware requirements: Nothing special
+
+### Mentors
+* Patrick Rudolph <patrick.rudolph(a)9elements.com>
+* Christian Walter <christian.walter(a)9elements.com>
+
+## Board status replacement
+The [Board status page](https://coreboot.org/status/board-status.html) allows
+to see last working commit of a board. The page is generated by a cron job
+that runs on a huge git repository.
+
+Build an open source replacement written in Golang using existing tools
+and libraries, consisting of a backend, a frontend and client side
+scripts. The backend should connect to an SQL database with can be
+controlled using a RESTful API. The RESTful API should have basic authentication
+for managment tasks and new board status uploads.
+
+At least one older test result should be keept in the database.
+
+The frontend should use established UI libraries or frameworks (for example
+Angular) to display the current board status, that is if it's working or not
+and some details provided with the last test. If a board isn't working the last
+working commit (if any) should be shown in addition to the broken one.
+
+Provide a script/tool that allows to:
+1. Push mainboard details from coreboot master CI
+2. Push mainboard test results from authenticated users containing
+ * working
+ * commit hash
+ * bootlog (if any)
+ * dmesg (if it's booting)
+ * timestamps (if it's booting)
+ * coreboot config
+
+### Requirements
+* coreboot knowledge: Non-technical, needed to perform requirements analysis
+* software knowledge: Golang, SQL for the backend, JS for the frontend
+
+### Mentors
+* Patrick Rudolph <patrick.rudolph(a)9elements.com>
+* Christian Walter <christian.walter(a)9elements.com>
diff --git a/grub.cfg b/grub.cfg
new file mode 100644
index 0000000..fd425c3
--- /dev/null
+++ b/grub.cfg
@@ -0,0 +1,4 @@
+configfile (ahci0,3)/boot/grub/grub.cfg
+terminal_output --append cbmemc
+set debug=atkeyb
+
diff --git a/src/mainboard/dell/Kconfig b/src/mainboard/dell/Kconfig
new file mode 100644
index 0000000..298c62b
--- /dev/null
+++ b/src/mainboard/dell/Kconfig
@@ -0,0 +1,16 @@
+if VENDOR_DELL
+
+choice
+ prompt "Mainboard model"
+
+source "src/mainboard/dell/*/Kconfig.name"
+
+endchoice
+
+source "src/mainboard/dell/*/Kconfig"
+
+config MAINBOARD_VENDOR
+ string
+ default "Dell Inc."
+
+endif # VENDOR_DELL
diff --git a/src/mainboard/dell/Kconfig.name b/src/mainboard/dell/Kconfig.name
new file mode 100644
index 0000000..3d2fefd
--- /dev/null
+++ b/src/mainboard/dell/Kconfig.name
@@ -0,0 +1,2 @@
+config VENDOR_DELL
+ bool "Dell Inc."
diff --git a/src/mainboard/dell/dell_system_vostro_3360/Kconfig b/src/mainboard/dell/dell_system_vostro_3360/Kconfig
new file mode 100644
index 0000000..dfcc0e1
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/Kconfig
@@ -0,0 +1,43 @@
+if BOARD_DELL_DELL_SYSTEM_VOSTRO_3360
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select BOARD_ROMSIZE_KB_8192
+ select HAVE_ACPI_RESUME
+ select HAVE_ACPI_TABLES
+ select INTEL_INT15
+ select GFX_GMA_PANEL_1_ON_LVDS
+ select MAINBOARD_HAS_LIBGFXINIT # FIXME: check this
+ select NORTHBRIDGE_INTEL_SANDYBRIDGE
+ select SERIRQ_CONTINUOUS_MODE
+ select SOUTHBRIDGE_INTEL_C216
+ select USE_NATIVE_RAMINIT
+
+config MAINBOARD_DIR
+ string
+ default dell/dell_system_vostro_3360
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "Dell System Vostro 3360"
+
+config VGA_BIOS_FILE
+ string
+ default "pci8086,0156.rom"
+
+config VGA_BIOS_ID
+ string
+ default "8086,0156"
+
+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/dell/dell_system_vostro_3360/Kconfig.name b/src/mainboard/dell/dell_system_vostro_3360/Kconfig.name
new file mode 100644
index 0000000..8925217
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_DELL_DELL_SYSTEM_VOSTRO_3360
+ bool "Dell System Vostro 3360"
diff --git a/src/mainboard/dell/dell_system_vostro_3360/Makefile.inc b/src/mainboard/dell/dell_system_vostro_3360/Makefile.inc
new file mode 100644
index 0000000..18391d8
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/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/dell/dell_system_vostro_3360/acpi/ec.asl b/src/mainboard/dell/dell_system_vostro_3360/acpi/ec.asl
new file mode 100644
index 0000000..a9177df
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/acpi/ec.asl
@@ -0,0 +1 @@
+#include<drivers/pc80/pc/ps2_controller.asl>
diff --git a/src/mainboard/dell/dell_system_vostro_3360/acpi/platform.asl b/src/mainboard/dell/dell_system_vostro_3360/acpi/platform.asl
new file mode 100644
index 0000000..552fb6c
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/acpi/platform.asl
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008-2009 coresystems GmbH
+ * Copyright (C) 2014 Vladimir Serbinenko
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Method(_WAK, 1)
+{
+ Return(Package() {0, 0})
+}
+
+Method(_PTS, 1)
+{
+}
diff --git a/src/mainboard/dell/dell_system_vostro_3360/acpi/superio.asl b/src/mainboard/dell/dell_system_vostro_3360/acpi/superio.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/acpi/superio.asl
diff --git a/src/mainboard/dell/dell_system_vostro_3360/acpi_tables.c b/src/mainboard/dell/dell_system_vostro_3360/acpi_tables.c
new file mode 100644
index 0000000..cfc2061
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/acpi_tables.c
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008-2009 coresystems GmbH
+ * Copyright (C) 2014 Vladimir Serbinenko
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <southbridge/intel/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/dell/dell_system_vostro_3360/board_info.txt b/src/mainboard/dell/dell_system_vostro_3360/board_info.txt
new file mode 100644
index 0000000..be6bff8
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/board_info.txt
@@ -0,0 +1,4 @@
+Category: desktop
+ROM protocol: SPI
+Flashrom support: n
+FIXME: check category, , put ROM package, ROM socketed, Release year
diff --git a/src/mainboard/dell/dell_system_vostro_3360/devicetree.cb b/src/mainboard/dell/dell_system_vostro_3360/devicetree.cb
new file mode 100644
index 0000000..d234325
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/devicetree.cb
@@ -0,0 +1,111 @@
+chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
+ register "gfx.link_frequency_270_mhz" = "1"
+ register "gfx.use_spread_spectrum_clock" = "1"
+ register "gpu_cpu_backlight" = "0x00001312"
+ 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" = "3000"
+ register "gpu_panel_power_backlight_on_delay" = "1700"
+ register "gpu_panel_power_cycle_delay" = "5"
+ register "gpu_panel_power_down_delay" = "300"
+ register "gpu_panel_power_up_delay" = "300"
+ register "gpu_pch_backlight" = "0x13121312"
+ 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" = "1"
+ register "gen1_dec" = "0x00040069"
+ register "gen2_dec" = "0x00040911"
+ register "gen3_dec" = "0x00000000"
+ register "gen4_dec" = "0x000c06a1"
+ 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" = "0x1"
+ 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 0x1028 0x055c
+ end
+ device pci 16.0 off # Management Engine Interface 1
+ 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 0x1028 0x055c
+ end
+ device pci 1b.0 on # High Definition Audio
+ subsystemid 0x1028 0x055c
+ end
+ device pci 1c.0 on # PCIe Port #1
+ subsystemid 0x1028 0x055c
+ 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 on # PCIe Port #5
+ subsystemid 0x1028 0x055c
+ 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 0x1028 0x055c
+ end
+ device pci 1e.0 off # PCI bridge
+ end
+ device pci 1f.0 on # LPC bridge PCI-LPC bridge
+ subsystemid 0x1028 0x055c
+ end
+ device pci 1f.2 on # SATA Controller 1
+ subsystemid 0x1028 0x055c
+ end
+ device pci 1f.3 on # SMBus
+ subsystemid 0x1028 0x055c
+ 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 0x1028 0x055c
+ end
+ device pci 01.0 off # PEG
+ end
+ device pci 02.0 on # iGPU
+ subsystemid 0x1028 0x055c
+ end
+ end
+end
diff --git a/src/mainboard/dell/dell_system_vostro_3360/dsdt.asl b/src/mainboard/dell/dell_system_vostro_3360/dsdt.asl
new file mode 100644
index 0000000..98c2ad4
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/dsdt.asl
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+#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 */
+)
+{
+ #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/dell/dell_system_vostro_3360/early_init.c b/src/mainboard/dell/dell_system_vostro_3360/early_init.c
new file mode 100644
index 0000000..6dbf226
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/early_init.c
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+/* FIXME: Check if all includes are needed. */
+
+#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, 1, 0 },
+ { 1, 1, 0 },
+ { 1, 1, 1 },
+ { 1, 1, 1 },
+ { 1, 1, 2 },
+ { 1, 1, 2 },
+ { 0, 1, 3 },
+ { 0, 1, 3 },
+ { 1, 1, 4 },
+ { 0, 1, 4 },
+ { 1, 1, 5 },
+ { 0, 1, 5 },
+ { 1, 1, 6 },
+ { 0, 1, 6 },
+};
+
+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, 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], 0x51, id_only);
+ read_spd(&spd[2], 0x52, id_only);
+ read_spd(&spd[3], 0x53, id_only);
+}
diff --git a/src/mainboard/dell/dell_system_vostro_3360/gma-mainboard.ads b/src/mainboard/dell/dell_system_vostro_3360/gma-mainboard.ads
new file mode 100644
index 0000000..6cb572a
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/gma-mainboard.ads
@@ -0,0 +1,35 @@
+--
+-- This file is part of the coreboot project.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+
+with HW.GFX.GMA;
+with HW.GFX.GMA.Display_Probing;
+
+use HW.GFX.GMA;
+use HW.GFX.GMA.Display_Probing;
+
+private package GMA.Mainboard is
+
+ -- FIXME: check this
+ ports : constant Port_List :=
+ (DP1,
+ DP2,
+ DP3,
+ HDMI1,
+ HDMI2,
+ HDMI3,
+ Analog,
+ LVDS,
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/dell/dell_system_vostro_3360/gpio.c b/src/mainboard/dell/dell_system_vostro_3360/gpio.c
new file mode 100644
index 0000000..d7db210
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/gpio.c
@@ -0,0 +1,241 @@
+/*
+ * 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_NATIVE,
+ .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_GPIO,
+ .gpio19 = GPIO_MODE_GPIO,
+ .gpio20 = GPIO_MODE_GPIO,
+ .gpio21 = GPIO_MODE_GPIO,
+ .gpio22 = GPIO_MODE_GPIO,
+ .gpio23 = GPIO_MODE_GPIO,
+ .gpio24 = GPIO_MODE_GPIO,
+ .gpio25 = GPIO_MODE_GPIO,
+ .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_OUTPUT,
+ .gpio1 = 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_INPUT,
+ .gpio17 = GPIO_DIR_INPUT,
+ .gpio18 = GPIO_DIR_INPUT,
+ .gpio19 = GPIO_DIR_INPUT,
+ .gpio20 = GPIO_DIR_INPUT,
+ .gpio21 = GPIO_DIR_INPUT,
+ .gpio22 = GPIO_DIR_OUTPUT,
+ .gpio23 = GPIO_DIR_OUTPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio25 = GPIO_DIR_INPUT,
+ .gpio27 = GPIO_DIR_INPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+ .gpio29 = GPIO_DIR_INPUT,
+ .gpio31 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio0 = GPIO_LEVEL_LOW,
+ .gpio22 = GPIO_LEVEL_HIGH,
+ .gpio23 = GPIO_LEVEL_LOW,
+ .gpio24 = GPIO_LEVEL_LOW,
+ .gpio28 = GPIO_LEVEL_LOW,
+ .gpio31 = 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,
+ .gpio3 = GPIO_INVERT,
+ .gpio7 = 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_NATIVE,
+ .gpio45 = GPIO_MODE_GPIO,
+ .gpio46 = GPIO_MODE_GPIO,
+ .gpio47 = GPIO_MODE_GPIO,
+ .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_GPIO,
+ .gpio60 = GPIO_MODE_GPIO,
+ .gpio61 = GPIO_MODE_GPIO,
+ .gpio62 = GPIO_MODE_GPIO,
+ .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,
+ .gpio45 = GPIO_DIR_INPUT,
+ .gpio46 = GPIO_DIR_INPUT,
+ .gpio47 = GPIO_DIR_INPUT,
+ .gpio48 = GPIO_DIR_INPUT,
+ .gpio49 = GPIO_DIR_OUTPUT,
+ .gpio50 = GPIO_DIR_INPUT,
+ .gpio51 = GPIO_DIR_INPUT,
+ .gpio52 = GPIO_DIR_OUTPUT,
+ .gpio53 = GPIO_DIR_INPUT,
+ .gpio54 = GPIO_DIR_INPUT,
+ .gpio55 = GPIO_DIR_INPUT,
+ .gpio56 = GPIO_DIR_INPUT,
+ .gpio57 = GPIO_DIR_INPUT,
+ .gpio59 = GPIO_DIR_INPUT,
+ .gpio60 = GPIO_DIR_OUTPUT,
+ .gpio61 = GPIO_DIR_INPUT,
+ .gpio62 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio33 = GPIO_LEVEL_HIGH,
+ .gpio34 = GPIO_LEVEL_HIGH,
+ .gpio37 = GPIO_LEVEL_LOW,
+ .gpio38 = GPIO_LEVEL_HIGH,
+ .gpio39 = GPIO_LEVEL_HIGH,
+ .gpio49 = GPIO_LEVEL_HIGH,
+ .gpio52 = GPIO_LEVEL_LOW,
+ .gpio60 = GPIO_LEVEL_HIGH,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_reset = {
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_mode = {
+ .gpio64 = GPIO_MODE_GPIO,
+ .gpio65 = GPIO_MODE_NATIVE,
+ .gpio66 = GPIO_MODE_NATIVE,
+ .gpio67 = GPIO_MODE_NATIVE,
+ .gpio68 = GPIO_MODE_GPIO,
+ .gpio69 = GPIO_MODE_GPIO,
+ .gpio70 = GPIO_MODE_GPIO,
+ .gpio71 = GPIO_MODE_GPIO,
+ .gpio72 = GPIO_MODE_GPIO,
+ .gpio73 = GPIO_MODE_NATIVE,
+ .gpio74 = GPIO_MODE_GPIO,
+ .gpio75 = GPIO_MODE_NATIVE,
+};
+
+static const struct pch_gpio_set3 pch_gpio_set3_direction = {
+ .gpio64 = GPIO_DIR_INPUT,
+ .gpio68 = GPIO_DIR_INPUT,
+ .gpio69 = GPIO_DIR_INPUT,
+ .gpio70 = GPIO_DIR_INPUT,
+ .gpio71 = GPIO_DIR_INPUT,
+ .gpio72 = GPIO_DIR_INPUT,
+ .gpio74 = 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/dell/dell_system_vostro_3360/hda_verb.c b/src/mainboard/dell/dell_system_vostro_3360/hda_verb.c
new file mode 100644
index 0000000..c55bf3c
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/hda_verb.c
@@ -0,0 +1,43 @@
+/*
+ * 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[] = {
+ 0x10134213, /* Codec Vendor / Device ID: Cirrus */
+ 0x1028055c, /* Subsystem ID */
+ 6, /* Number of 4 dword sets */
+ AZALIA_SUBVENDOR(0x0, 0x1028055c),
+ AZALIA_PIN_CFG(0x0, 0x04, 0x0421101f),
+ AZALIA_PIN_CFG(0x0, 0x05, 0x90170010),
+ AZALIA_PIN_CFG(0x0, 0x06, 0x04a1103e),
+ AZALIA_PIN_CFG(0x0, 0x07, 0x40f000f0),
+ AZALIA_PIN_CFG(0x0, 0x08, 0x90a60030),
+
+ 0x80862806, /* Codec Vendor / Device ID: Intel */
+ 0x80860101, /* Subsystem ID */
+ 4, /* Number of 4 dword sets */
+ AZALIA_SUBVENDOR(0x3, 0x80860101),
+ AZALIA_PIN_CFG(0x3, 0x05, 0x18560010),
+ AZALIA_PIN_CFG(0x3, 0x06, 0x58560020),
+ AZALIA_PIN_CFG(0x3, 0x07, 0x58560030),
+
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/dell/dell_system_vostro_3360/mainboard.c b/src/mainboard/dell/dell_system_vostro_3360/mainboard.c
new file mode 100644
index 0000000..e6f8258
--- /dev/null
+++ b/src/mainboard/dell/dell_system_vostro_3360/mainboard.c
@@ -0,0 +1,41 @@
+/*
+ * 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 <console/console.h>
+#include <device/device.h>
+#include <drivers/intel/gma/int15.h>
+#include <pc80/keyboard.h>
+#include <southbridge/intel/bd82x6x/pch.h>
+
+static void mainboard_init(struct device *const dev)
+ {
+ printk(BIOS_DEBUG, "Vostro3360: Initializing keyboard.\n");
+ pc_keyboard_init(NO_AUX_DEVICE);
+ }
+
+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);
+ dev->ops->init = mainboard_init;
+}
+
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/39705
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1049a15110e671b334ab29411b4c148b33f207a6
Gerrit-Change-Number: 39705
Gerrit-PatchSet: 1
Gerrit-Owner: Name of user not set #1002723
Gerrit-MessageType: newchange
3
2
Change in coreboot[master]: mb/emulation/qemu-armv7: Add MMU support
by Patrick Rudolph (Code Review) Aug. 7, 2023
by Patrick Rudolph (Code Review) Aug. 7, 2023
Aug. 7, 2023
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44394 )
Change subject: mb/emulation/qemu-armv7: Add MMU support
......................................................................
mb/emulation/qemu-armv7: Add MMU support
Extend the memlayout and configure the MMU in the bootblock.
While there's no real benefit on emulated machines, it alignes the
qemu mainboard with real hardware.
Tested using uImage/FIT. Still able to boot into GNU/Linux 5.5.
Change-Id: Ic5a22bc8670dd11aa7bd05b88740c4f07bad3108
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
M src/mainboard/emulation/qemu-armv7/Makefile.inc
A src/mainboard/emulation/qemu-armv7/bootblock.c
M src/mainboard/emulation/qemu-armv7/memlayout.ld
3 files changed, 54 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/44394/1
diff --git a/src/mainboard/emulation/qemu-armv7/Makefile.inc b/src/mainboard/emulation/qemu-armv7/Makefile.inc
index 65fdfe1..1fcbef9 100644
--- a/src/mainboard/emulation/qemu-armv7/Makefile.inc
+++ b/src/mainboard/emulation/qemu-armv7/Makefile.inc
@@ -4,6 +4,8 @@
romstage-y += cbmem.c
+bootblock-y += bootblock.c
+
bootblock-y += media.c
romstage-y += media.c
ramstage-y += media.c
diff --git a/src/mainboard/emulation/qemu-armv7/bootblock.c b/src/mainboard/emulation/qemu-armv7/bootblock.c
new file mode 100644
index 0000000..0b011e1
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv7/bootblock.c
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <arch/cache.h>
+#include <bootblock_common.h>
+#include <symbols.h>
+
+void bootblock_soc_init(void)
+{
+ mmu_init();
+
+#define MMU_CONF_SYMBOL(x, y) extern u8 _##x[]; extern u8 _e##x[];\
+ if (REGION_SIZE(x) < MiB) { \
+ mmu_config_range_kb(((uintptr_t)(_##x))/KiB, REGION_SIZE(x)/KiB, (y)); \
+ } else { \
+ mmu_config_range(((uintptr_t)(_##x))/MiB, REGION_SIZE(x)/MiB, (y)); \
+ }
+ MMU_CONF_SYMBOL(flash, DCACHE_OFF)
+ MMU_CONF_SYMBOL(sysregs_uart_timer, DCACHE_OFF)
+ MMU_CONF_SYMBOL(pl111, DCACHE_OFF)
+ MMU_CONF_SYMBOL(sp805, DCACHE_OFF)
+ MMU_CONF_SYMBOL(nor_flash1, DCACHE_OFF)
+ MMU_CONF_SYMBOL(nor_flash2, DCACHE_OFF)
+ MMU_CONF_SYMBOL(videoram, DCACHE_OFF)
+ MMU_CONF_SYMBOL(ethernet, DCACHE_OFF)
+ MMU_CONF_SYMBOL(usb, DCACHE_OFF)
+#undef MMU_CONF_SYMBOL
+
+ mmu_config_range(((uintptr_t)_sram)/MiB,
+ REGION_SIZE(sram)/MiB, DCACHE_WRITEBACK);
+ /* Maximum supported DRAM size is 1 GiB, use 2 GiB for ramdetect */
+ mmu_config_range(((uintptr_t)_dram)/MiB, 2*(GiB/MiB), DCACHE_WRITEBACK);
+
+ dcache_mmu_enable();
+}
+
diff --git a/src/mainboard/emulation/qemu-armv7/memlayout.ld b/src/mainboard/emulation/qemu-armv7/memlayout.ld
index 4ddc6d2..b0408ed 100644
--- a/src/mainboard/emulation/qemu-armv7/memlayout.ld
+++ b/src/mainboard/emulation/qemu-armv7/memlayout.ld
@@ -5,15 +5,6 @@
#include <arch/header.ld>
/*
- * Memory map for qemu vexpress-a9 since
- * 6ec1588e09770ac7e9c60194faff6101111fc7f0 (Jul 2014):
- *
- * 0x0000_0000: NOR flash
- * 0x1000_0000: I/O map address
- * 0x6000_0000: RAM
- */
-
-/*
* This map is designed to work with new qemu vexpress memory layout and
* with -bios option which neatly puts coreboot into flash and so payloads
* can find CBFS and we don't risk overwriting CBFS.
@@ -26,18 +17,30 @@
*/
SECTIONS
{
- /* TODO: does this thing emulate SRAM? */
-
+ /*
+ * Memory map for qemu vexpress-a9 since
+ * 6ec1588e09770ac7e9c60194faff6101111fc7f0 (Jul 2014):
+ */
REGION(flash, 0, CONFIG_ROM_SIZE, 4K)
+ REGION(sysregs_uart_timer, 0x10000000, 0x20000, 4K)
+ REGION(pl111, 0x10020000, 0x40000, 4K)
+ REGION(sp805, 0x100e4000, 0x1000, 4K)
+ REGION(nor_flash1, 0x40000000, 0x4000000, 4K)
+ REGION(nor_flash2, 0x44000000, 0x4000000, 4K)
+ SRAM_START(0x48000000)
+ SRAM_END(0x4C000000)
+ REGION(videoram, 0x4c000000, 0x1000000, 4K)
+ REGION(ethernet, 0x4e000000, 0x1000000, 4K)
+ REGION(usb, 0x4f000000, 0x1000000, 4K)
DRAM_START(0x60000000)
STACK(0x60000000, 64K)
BOOTBLOCK(0x60010000, 128K)
FMAP_CACHE(0x60030000, 4K)
TIMESTAMP(0x60031000, 1K)
- /* TODO: Implement MMU support and move TTB to a better location. */
- TTB(0x60034000, 16K)
- ROMSTAGE(0x60038000, 128K)
+ TTB_SUBTABLES(0x60032000, 4K)
+ TTB(0x60034000, 32K)
+ ROMSTAGE(0x60040000, 128K)
RAMSTAGE(0x60060000, 16M)
POSTRAM_CBFS_CACHE(0x61060000, 8M)
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/44394
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic5a22bc8670dd11aa7bd05b88740c4f07bad3108
Gerrit-Change-Number: 44394
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
3
5
Change in coreboot[master]: Revert "console: Update for vboot before bootblock"
by Nico Huber (Code Review) Aug. 7, 2023
by Nico Huber (Code Review) Aug. 7, 2023
Aug. 7, 2023
Hello build bot (Jenkins), Raul Rangel, Martin Roth, Patrick Georgi, Furquan Shaikh, Eric Peers, Aaron Durbin,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/42165
to review the following change.
Change subject: Revert "console: Update for vboot before bootblock"
......................................................................
Revert "console: Update for vboot before bootblock"
This reverts commit baba3e961072bfb7ffb4f0031ada27046a58d29e.
Reason for revert: Submitted during review.
Change-Id: I657a6170aba5aba685531380353aa9ba999f9c4e
---
M src/console/Makefile.inc
1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/42165/1
diff --git a/src/console/Makefile.inc b/src/console/Makefile.inc
index e2a20d7..2154eb9 100644
--- a/src/console/Makefile.inc
+++ b/src/console/Makefile.inc
@@ -11,14 +11,12 @@
smm-y += die.c
smm-y += post.c
-ifneq ($(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),y)
+verstage-y += init.c
verstage-y += printk.c
+verstage-y += vtxprintf.c vsprintf.c
verstage-y += console.c
-endif
verstage-y += post.c
verstage-y += die.c
-verstage-y += init.c
-verstage-y += vtxprintf.c vsprintf.c
romstage-y += vtxprintf.c printk.c vsprintf.c
romstage-y += init.c console.c
--
To view, visit https://review.coreboot.org/c/coreboot/+/42165
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I657a6170aba5aba685531380353aa9ba999f9c4e
Gerrit-Change-Number: 42165
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Eric Peers <epeers(a)google.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newchange
3
4
Change in coreboot[master]: [WIP]mb/intel/minnowmax: Add mainboard
by Arthur Heymans (Code Review) Aug. 7, 2023
by Arthur Heymans (Code Review) Aug. 7, 2023
Aug. 7, 2023
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44102 )
Change subject: [WIP]mb/intel/minnowmax: Add mainboard
......................................................................
[WIP]mb/intel/minnowmax: Add mainboard
TODO: Fixup SPD handling, Check PCI (vendor disables most)
Working: USB (EHCI and XHCI), SATA, UART, ethernet
Change-Id: I9a1236425c8a0914f92adcad445230ef2692393a
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
A src/mainboard/intel/minnowmax/Kconfig
A src/mainboard/intel/minnowmax/Kconfig.name
A src/mainboard/intel/minnowmax/Makefile.inc
A src/mainboard/intel/minnowmax/acpi/ec.asl
A src/mainboard/intel/minnowmax/acpi/mainboard.asl
A src/mainboard/intel/minnowmax/acpi/superio.asl
A src/mainboard/intel/minnowmax/acpi_tables.c
A src/mainboard/intel/minnowmax/board_info.txt
A src/mainboard/intel/minnowmax/cmos.layout
A src/mainboard/intel/minnowmax/data.vbt
A src/mainboard/intel/minnowmax/devicetree.cb
A src/mainboard/intel/minnowmax/dsdt.asl
A src/mainboard/intel/minnowmax/gpio.c
A src/mainboard/intel/minnowmax/irqroute.c
A src/mainboard/intel/minnowmax/irqroute.h
A src/mainboard/intel/minnowmax/mainboard.c
A src/mainboard/intel/minnowmax/romstage.c
A src/mainboard/intel/minnowmax/spd/micron_2GiB_dimm_MT41K256M16HA-125.spd.hex
M src/soc/intel/baytrail/Makefile.inc
M src/soc/intel/baytrail/refcode.c
20 files changed, 662 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/44102/1
diff --git a/src/mainboard/intel/minnowmax/Kconfig b/src/mainboard/intel/minnowmax/Kconfig
new file mode 100644
index 0000000..d7ad307
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/Kconfig
@@ -0,0 +1,50 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2013-2014 Sage Electronic Engineering, LLC.
+## Copyright (C) 2014 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.
+##
+
+if BOARD_INTEL_MINNOWMAX
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select SOC_INTEL_BAYTRAIL
+ select BOARD_ROMSIZE_KB_8192
+ select HAVE_ACPI_TABLES
+ select HAVE_OPTION_TABLE
+ select ENABLE_BUILTIN_COM1 if CONSOLE_SERIAL
+ select HAVE_ACPI_RESUME
+ select INTEL_GMA_HAVE_VBT
+
+config MAINBOARD_DIR
+ string
+ default "intel/minnowmax"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "Minnow Max"
+
+config CBFS_SIZE
+ hex
+ default 0x00300000
+
+config POST_DEVICE
+ bool
+ default n
+
+config SEABIOS_HARDWARE_IRQ
+ bool
+ default n
+
+
+endif # BOARD_INTEL_MINNOWMAX
diff --git a/src/mainboard/intel/minnowmax/Kconfig.name b/src/mainboard/intel/minnowmax/Kconfig.name
new file mode 100644
index 0000000..abe9225
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_INTEL_MINNOWMAX
+ bool "Minnow Max"
diff --git a/src/mainboard/intel/minnowmax/Makefile.inc b/src/mainboard/intel/minnowmax/Makefile.inc
new file mode 100644
index 0000000..6d22cdf
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/Makefile.inc
@@ -0,0 +1,22 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+ramstage-y += gpio.c
+ramstage-y += irqroute.c
+
+SPD_BIN = $(obj)/spd.bin
+
+SPD_SOURCES = micron_2GiB_dimm_MT41K256M16HA-125
+
+SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).spd.hex)
+
+# Include spd ROM data
+$(SPD_BIN): $(SPD_DEPS)
+ for f in $+; \
+ do for c in $$(cat $$f | grep -v ^#); \
+ do printf $$(printf '\%o' 0x$$c); \
+ done; \
+ done > $@
+
+cbfs-files-y += spd.bin
+spd.bin-file := $(SPD_BIN)
+spd.bin-type := spd
diff --git a/src/mainboard/intel/minnowmax/acpi/ec.asl b/src/mainboard/intel/minnowmax/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/acpi/ec.asl
diff --git a/src/mainboard/intel/minnowmax/acpi/mainboard.asl b/src/mainboard/intel/minnowmax/acpi/mainboard.asl
new file mode 100644
index 0000000..d17d26f
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/acpi/mainboard.asl
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * NOTE: this has to be here even when the board has no LPE audio, otherwise
+ * it breaks the SOC specific ACPI code
+ */
+Scope (\_SB.PCI0.LPEA)
+{
+ Name (GBUF, ResourceTemplate () {})
+}
+
+
+Device (PWRB)
+{
+ Name(_HID, EisaId("PNP0C0C"))
+}
diff --git a/src/mainboard/intel/minnowmax/acpi/superio.asl b/src/mainboard/intel/minnowmax/acpi/superio.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/acpi/superio.asl
diff --git a/src/mainboard/intel/minnowmax/acpi_tables.c b/src/mainboard/intel/minnowmax/acpi_tables.c
new file mode 100644
index 0000000..5439050
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/acpi_tables.c
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+#include <acpi/acpi_gnvs.h>
+#include <arch/ioapic.h>
+#include <device/device.h>
+#include <soc/acpi.h>
+#include <soc/nvs.h>
+#include <soc/iomap.h>
+
+void acpi_create_gnvs(struct global_nvs *gnvs)
+{
+ acpi_init_gnvs(gnvs);
+
+ /* Enable USB ports in S3 */
+ gnvs->s3u0 = 1;
+ gnvs->s3u1 = 1;
+ /* Disable USB ports in S5 */
+ gnvs->s5u0 = 0;
+ gnvs->s5u1 = 0;
+ /* TPM not present */
+ gnvs->tpmp = 0;
+ /* Disable DPTF */
+ gnvs->dpte = 0;
+}
+
+unsigned long acpi_fill_madt(unsigned long current)
+{
+ /* Local APICs */
+ current = acpi_create_madt_lapics(current);
+
+ /* IOAPIC */
+ current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
+ 2, IO_APIC_ADDR, 0);
+
+ current = acpi_madt_irq_overrides(current);
+
+ return current;
+}
+
+void mainboard_fill_fadt(acpi_fadt_t *fadt)
+{
+ fadt->preferred_pm_profile = PM_DESKTOP;
+}
diff --git a/src/mainboard/intel/minnowmax/board_info.txt b/src/mainboard/intel/minnowmax/board_info.txt
new file mode 100644
index 0000000..5af79f8
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/board_info.txt
@@ -0,0 +1,4 @@
+Category: sbc
+ROM protocol: SPI
+Flashrom support: y
+Release year: 2014
diff --git a/src/mainboard/intel/minnowmax/cmos.layout b/src/mainboard/intel/minnowmax/cmos.layout
new file mode 100644
index 0000000..bbc3f3c
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/cmos.layout
@@ -0,0 +1,44 @@
+
+## SPDX-License-Identifier: GPL-2.0-only
+# -----------------------------------------------------------------
+entries
+# -----------------------------------------------------------------
+0 120 r 0 reserved_memory
+# -----------------------------------------------------------------
+# RTC_BOOT_BYTE (coreboot hardcoded)
+384 1 e 4 boot_option
+388 4 h 0 reboot_counter
+# -----------------------------------------------------------------
+# coreboot config options: console
+395 4 e 6 debug_level
+# coreboot config options: cpu
+400 1 e 2 hyper_threading
+# coreboot config options: southbridge
+408 1 e 1 nmi
+409 2 e 7 power_on_after_fail
+# 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
+# -----------------------------------------------------------------
+checksums
+checksum 392 415 984
diff --git a/src/mainboard/intel/minnowmax/data.vbt b/src/mainboard/intel/minnowmax/data.vbt
new file mode 100644
index 0000000..cfb393c
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/data.vbt
Binary files differ
diff --git a/src/mainboard/intel/minnowmax/devicetree.cb b/src/mainboard/intel/minnowmax/devicetree.cb
new file mode 100644
index 0000000..7f5a907
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/devicetree.cb
@@ -0,0 +1,82 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2013-2014 Sage Electronic Engineering, LLC.
+## Copyright (C) 2014 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.
+##
+
+chip soc/intel/baytrail
+
+ register "usb2_comp_bg" = "0x4700"
+ # Allow PCIe devices to wake system from suspend
+ register "pcie_wake_enable" = "1"
+ # SATA port enable mask (2 ports)
+ register "sata_port_map" = "0x1"
+ register "sata_ahci" = "0x1"
+ # Do not route USB ports to XHCI
+ register "usb_route_to_xhci" = "0"
+ # USB Port Disable Mask
+ register "usb2_port_disable_mask" = "0x0"
+ register "usb3_port_disable_mask" = "0x0"
+ # USB PHY settings
+ register "usb2_per_port_lane0" = "0x00049a09"
+ register "usb2_per_port_rcomp_hs_pullup0" = "0x0300401d"
+ register "usb2_per_port_lane1" = "0x00049a09"
+ register "usb2_per_port_rcomp_hs_pullup1" = "0x0300401d"
+ register "usb2_per_port_lane2" = "0x00049209"
+ register "usb2_per_port_rcomp_hs_pullup2" = "0x01004015"
+ register "usb2_per_port_lane3" = "0x00049a09"
+ register "usb2_per_port_rcomp_hs_pullup3" = "0x0300401d"
+ # Disable SLP_X stretching after SUS power well fail.
+ register "disable_slp_x_stretch_sus_fail" = "1"
+
+ device cpu_cluster 0 on
+ device lapic 0 on end
+ end
+
+ device domain 0 on
+ device pci 00.0 on end # 8086 0F00 - SoC router -
+ device pci 02.0 on end # 8086 0F31 - GFX micro HDMI
+ device pci 03.0 off end # 8086 0F38 - MIPI -
+
+ device pci 10.0 off end # 8086 0F14 - MMC Port -
+ device pci 11.0 off end # 8086 0F15 - SDIO Port -
+ device pci 12.0 on end # 8086 0F16 - SD Port MicroSD on SD3
+ device pci 13.0 on end # 8086 0F23 - SATA AHCI Onboard & HSEC
+ device pci 14.0 on end # 8086 0F35 - USB XHCI - Onboard & HSEC - Enabling both EHCI and XHCI will default to EHCI if not changed at runtime
+ device pci 15.0 on end # 8086 0F28 - LP Engine Audio LSEC
+ device pci 17.0 off end # 8086 0F50 - MMC45 Port -
+ device pci 18.0 on end # 8086 0F40 - SIO - DMA -
+ device pci 18.1 off end # 8086 0F41 - I2C Port 1 (0) -
+ device pci 18.2 on end # 8086 0F42 - I2C Port 2 (1) - (testpoints)
+ device pci 18.3 off end # 8086 0F43 - I2C Port 3 (2) -
+ device pci 18.4 off end # 8086 0F44 - I2C Port 4 (3) -
+ device pci 18.5 off end # 8086 0F45 - I2C Port 5 (4) -
+ device pci 18.6 on end # 8086 0F46 - I2C Port 6 (5) LSEC
+ device pci 18.7 on end # 8086 0F47 - I2C Port 7 (6) HSEC
+ device pci 1a.0 on end # 8086 0F18 - TXE -
+ device pci 1b.0 off end # 8086 0F04 - HD Audio -
+ device pci 1c.0 on end # 8086 0F48 - PCIe Port 1 (0) Must remain on
+ device pci 1c.1 on end # 8086 0F4A - PCIe Port 2 (1) Onboard GBE (some models)
+ device pci 1c.2 on end # 8086 0F4C - PCIe Port 3 (2) Onboard GBE
+ device pci 1c.3 on end # 8086 0F4E - PCIe Port 4 (3) HSEC
+ device pci 1d.0 on end # 8086 0F34 - USB EHCI - Enabling both EHCI and XHCI will default to EHCI if not changed at runtime
+ device pci 1e.0 on end # 8086 0F06 - SIO - DMA -
+ device pci 1e.1 on end # 8086 0F08 - PWM 1 LSEC
+ device pci 1e.2 on end # 8086 0F09 - PWM 2 LSEC
+ device pci 1e.3 on end # 8086 0F0A - HSUART 1 LSEC
+ device pci 1e.4 on end # 8086 0F0C - HSUART 2 LSEC
+ device pci 1e.5 on end # 8086 0F0E - SPI LSEC
+ device pci 1f.0 on end # 8086 0F1C - LPC bridge No connector
+ device pci 1f.3 on end # 8086 0F12 - SMBus 0 SPC
+ end
+end
diff --git a/src/mainboard/intel/minnowmax/dsdt.asl b/src/mainboard/intel/minnowmax/dsdt.asl
new file mode 100644
index 0000000..0ae74495
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/dsdt.asl
@@ -0,0 +1,22 @@
+/* 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,
+ 0x20110725 // OEM revision
+)
+{
+ #include <soc/intel/baytrail/acpi/platform.asl>
+ // global NVS and variables
+ #include <soc/intel/baytrail/acpi/globalnvs.asl>
+ #include <cpu/intel/common/acpi/cpu.asl>
+ Device (\_SB.PCI0)
+ {
+ #include <soc/intel/baytrail/acpi/southcluster.asl>
+ }
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+ #include "acpi/mainboard.asl"
+}
\ No newline at end of file
diff --git a/src/mainboard/intel/minnowmax/gpio.c b/src/mainboard/intel/minnowmax/gpio.c
new file mode 100644
index 0000000..8b5a639
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/gpio.c
@@ -0,0 +1,242 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Google Inc.
+ * Copyright (C) 2014 Sage Electronic Engineering, LLC.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <stdlib.h>
+#include <soc/gpio.h>
+#include "irqroute.h"
+
+#define GPIO_OUT_HIGH_LEGACY \
+ { .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_OUTPUT | PAD_VAL_HIGH, \
+ .use_sel = GPIO_USE_LEGACY, \
+ .io_sel = GPIO_DIR_OUTPUT, \
+ .gp_lvl = GPIO_LEVEL_HIGH, \
+ .is_gpio = 1 }
+
+
+/*
+ * For multiplexed functions, look in EDS:
+ * 10.3 Ball Name and Function by Location
+ *
+ * The pads list is in the BWG_VOL2 Rev1p2:
+ * Note that Pad # is not the same as GPIO#
+ * 37 GPIO Handling:
+ * Table 37-1. SCORE Pads List
+ * Table 37-2. SSUSORE Pads List
+ */
+
+/* NCORE GPIOs */
+static const struct soc_gpio_map gpncore_gpio_map[] = {
+ GPIO_FUNC2, // GPIO_S0_NC[00] - HDMI_HPD
+ GPIO_FUNC2, // GPIO_S0_NC[01] - HDMI_DDCDAT
+ GPIO_FUNC2, // GPIO_S0_NC[02] - HDMI_DDCCLK
+ GPIO_NC, // GPIO_S0_NC[03] - No Connect
+ GPIO_NC, // GPIO_S0_NC[04] - No Connect
+ GPIO_NC, // GPIO_S0_NC[05] - No Connect
+ GPIO_NC, // GPIO_S0_NC[06] - No Connect
+ GPIO_FUNC2, // GPIO_S0_NC[07] - DDI1_DDCDAT
+ GPIO_NC, // GPIO_S0_NC[08] - No Connect
+ GPIO_NC, // GPIO_S0_NC[09] - No Connect
+ GPIO_NC, // GPIO_S0_NC[10] - No Connect
+ GPIO_NC, // GPIO_S0_NC[11] - No Connect
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S0_NC[12] - TP15
+ GPIO_NC, // GPIO_S0_NC[13] - No Connect
+ GPIO_NC, // GPIO_S0_NC[14] - No Connect
+ GPIO_NC, // GPIO_S0_NC[15] - No Connect
+ GPIO_NC, // GPIO_S0_NC[16] - No Connect
+ GPIO_NC, // GPIO_S0_NC[17] - No Connect
+ GPIO_NC, // GPIO_S0_NC[18] - No Connect
+ GPIO_NC, // GPIO_S0_NC[19] - No Connect
+ GPIO_NC, // GPIO_S0_NC[20] - No Connect
+ GPIO_NC, // GPIO_S0_NC[21] - No Connect
+ GPIO_NC, // GPIO_S0_NC[22] - No Connect
+ GPIO_NC, // GPIO_S0_NC[23] - No Connect
+ GPIO_NC, // GPIO_S0_NC[24] - No Connect
+ GPIO_NC, // GPIO_S0_NC[25] - No Connect
+ GPIO_NC, // GPIO_S0_NC[26] - No Connect
+ GPIO_END
+};
+
+/* SCORE GPIOs (GPIO_S0_SC_XX) */
+static const struct soc_gpio_map gpscore_gpio_map[] = {
+ GPIO_FUNC1, // GPIO_S0_SC[000] - SATA_GP0
+ GPIO_FUNC1, // GPIO_S0_SC[001] - SATA_GP1
+ GPIO_FUNC1, // GPIO_S0_SC[002] - SATA_LED_B
+ GPIO_FUNC1, // GPIO_S0_SC[003] - PCIE_CLKREQ_0
+ GPIO_FUNC1, // GPIO_S0_SC[004] - PCIE_CLKREQ_1
+ GPIO_FUNC1, // GPIO_S0_SC[005] - PCIE_CLKREQ_2
+ GPIO_FUNC1, // GPIO_S0_SC[006] - PCIE_CLKREQ_3
+ GPIO_FUNC2, // GPIO_S0_SC[007] - SD3_WP
+ GPIO_NC, // GPIO_S0_SC[008] - No Connect
+ GPIO_NC, // GPIO_S0_SC[009] - No Connect
+ GPIO_NC, // GPIO_S0_SC[010] - No Connect
+ GPIO_NC, // GPIO_S0_SC[011] - No Connect
+ GPIO_NC, // GPIO_S0_SC[012] - No Connect
+ GPIO_NC, // GPIO_S0_SC[013] - No Connect
+ GPIO_NC, // GPIO_S0_SC[014] - No Connect
+ GPIO_NC, // GPIO_S0_SC[015] - No Connect
+ GPIO_NC, // GPIO_S0_SC[016] - No Connect
+ GPIO_NC, // GPIO_S0_SC[017] - No Connect
+ GPIO_NC, // GPIO_S0_SC[018] - No Connect
+ GPIO_NC, // GPIO_S0_SC[019] - No Connect
+ GPIO_NC, // GPIO_S0_SC[020] - No Connect
+ GPIO_NC, // GPIO_S0_SC[021] - No Connect
+ GPIO_NC, // GPIO_S0_SC[022] - No Connect
+ GPIO_NC, // GPIO_S0_SC[023] - No Connect
+ GPIO_NC, // GPIO_S0_SC[024] - No Connect
+ GPIO_NC, // GPIO_S0_SC[025] - No Connect
+ GPIO_NC, // GPIO_S0_SC[026] - No Connect
+ GPIO_NC, // GPIO_S0_SC[027] - No Connect
+ GPIO_NC, // GPIO_S0_SC[028] - No Connect
+ GPIO_NC, // GPIO_S0_SC[029] - No Connect
+ GPIO_NC, // GPIO_S0_SC[030] - No Connect
+ GPIO_NC, // GPIO_S0_SC[031] - No Connect
+ GPIO_NC, // GPIO_S0_SC[032] - No Connect
+ GPIO_FUNC1, // GPIO_S0_SC[033] - SD3_CLK
+ GPIO_FUNC1, // GPIO_S0_SC[034] - SD3_D0
+ GPIO_FUNC1, // GPIO_S0_SC[035] - SD3_D1
+ GPIO_FUNC1, // GPIO_S0_SC[036] - SD3_D2
+ GPIO_FUNC1, // GPIO_S0_SC[037] - SD3_D3
+ GPIO_FUNC1, // GPIO_S0_SC[038] - SD3_CD#
+ GPIO_FUNC1, // GPIO_S0_SC[039] - SD3_CMD
+ GPIO_FUNC1, // GPIO_S0_SC[040] - TP12 (SD3_1P8EN)
+ GPIO_FUNC1, // GPIO_S0_SC[041] - TP11 (/SD3_PWREN)
+ GPIO_NC, // GPIO_S0_SC[042] - No Connect
+ GPIO_NC, // GPIO_S0_SC[043] - No Connect
+ GPIO_NC, // GPIO_S0_SC[044] - No Connect
+ GPIO_NC, // GPIO_S0_SC[045] - No Connect
+ GPIO_NC, // GPIO_S0_SC[046] - No Connect
+ GPIO_NC, // GPIO_S0_SC[047] - No Connect
+ GPIO_NC, // GPIO_S0_SC[048] - No Connect
+ GPIO_NC, // GPIO_S0_SC[049] - No Connect
+ GPIO_NC, // GPIO_S0_SC[050] - No Connect
+ GPIO_FUNC1, // GPIO_S0_SC[051] - PCU_SMB_DATA
+ GPIO_FUNC1, // GPIO_S0_SC[052] - PCU_SMB_CLK
+ GPIO_FUNC1, // GPIO_S0_SC[053] - PCU_SMB_ALERT
+ GPIO_FUNC1, // GPIO_S0_SC[054] - ILB_8254_SPKR
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S0_SC[055] - TP8 (GPIO_S0_SC_55)
+ GPIO_FUNC0, // GPIO_S0_SC[056] - GPIO_S0_SC_56
+ GPIO_FUNC1, // GPIO_S0_SC[057] - PCU_UART3_TXD
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S0_SC[058] - TP9 (GPIO_S0_SC_58)
+ GPIO_FUNC0, // GPIO_S0_SC[059] - HDMI_DCDC_ENB
+ GPIO_FUNC0, // GPIO_S0_SC[060] - HDMI_LDSW_ENB
+ GPIO_FUNC1, // GPIO_S0_SC[061] - PCU_UART3_RXD
+ GPIO_FUNC1, // GPIO_S0_SC[062] - LPE_I2S_CLK
+ GPIO_FUNC1, // GPIO_S0_SC[063] - LPE_I2S_FRM
+ GPIO_FUNC1, // GPIO_S0_SC[064] - LPE_I2S_DATIN
+ GPIO_FUNC1, // GPIO_S0_SC[065] - LPE_I2S_DATOUT
+ GPIO_FUNC1, // GPIO_S0_SC[066] - SOC_SIO_SPI_CS1
+ GPIO_FUNC1, // GPIO_S0_SC[067] - SOC_SIO_SPI_MISO
+ GPIO_FUNC1, // GPIO_S0_SC[068] - SOC_SIO_SPI_MOSI
+ GPIO_FUNC1, // GPIO_S0_SC[069] - SOC_SIO_SPI_CLK
+ GPIO_FUNC1, // GPIO_S0_SC[070] - SIO_UART1_RXD
+ GPIO_FUNC1, // GPIO_S0_SC[071] - SIO_UART1_TXD
+ GPIO_FUNC1, // GPIO_S0_SC[072] - SIO_UART1_RTSB
+ GPIO_FUNC1, // GPIO_S0_SC[073] - SIO_UART1_CTSB
+ GPIO_FUNC1, // GPIO_S0_SC[074] - SIO_UART2_RXD
+ GPIO_FUNC1, // GPIO_S0_SC[075] - SIO_UART2_TXD
+ GPIO_NC, // GPIO_S0_SC[076] - No Connect
+ GPIO_NC, // GPIO_S0_SC[077] - No Connect
+ GPIO_NC, // GPIO_S0_SC[078] - No Connect
+ GPIO_NC, // GPIO_S0_SC[079] - No Connect
+ GPIO_FUNC1, // GPIO_S0_SC[080] - TP6 (SIO_I2C1_SDA)
+ GPIO_FUNC1, // GPIO_S0_SC[081] - TP5 (SIO_I2C1_SCL)
+ GPIO_NC, // GPIO_S0_SC[082] - No Connect
+ GPIO_NC, // GPIO_S0_SC[083] - No Connect
+ GPIO_NC, // GPIO_S0_SC[084] - No Connect
+ GPIO_NC, // GPIO_S0_SC[085] - No Connect
+ GPIO_NC, // GPIO_S0_SC[086] - No Connect
+ GPIO_NC, // GPIO_S0_SC[087] - No Connect
+ GPIO_FUNC1, // GPIO_S0_SC[088] - LSS_I2C_SDA
+ GPIO_FUNC1, // GPIO_S0_SC[089] - LSS_I2C_SCL
+ GPIO_FUNC1, // GPIO_S0_SC[090] - EXP_I2C_SDA
+ GPIO_FUNC1, // GPIO_S0_SC[091] - EXP_I2C_SCL
+ GPIO_FUNC(1, PULL_UP, 20K), // GPIO_S0_SC[092] - TP13
+ GPIO_FUNC(1, PULL_UP, 20K), // GPIO_S0_SC[093] - TP16
+ GPIO_FUNC1, // GPIO_S0_SC[094] - SOC_PWM0
+ GPIO_FUNC1, // GPIO_S0_SC[095] - SOC_PWM1
+ GPIO_NC, // GPIO_S0_SC[096] - No Connect
+ GPIO_NC, // GPIO_S0_SC[097] - No Connect
+ GPIO_NC, // GPIO_S0_SC[098] - No Connect
+ GPIO_NC, // GPIO_S0_SC[099] - No Connect
+ GPIO_NC, // GPIO_S0_SC[100] - No Connect
+ GPIO_NC, // GPIO_S0_SC[101] - No Connect
+ GPIO_END
+};
+
+/* SSUS GPIOs (GPIO_S5) */
+static const struct soc_gpio_map gpssus_gpio_map[] = {
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[00] - SOC_GPIO_S5_0
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[01] - SOC_GPIO_S5_1
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[02] - SOC_GPIO_S5_2
+ GPIO_FUNC6, // GPIO_S5[03] - mPCIE_WAKEB
+ GPIO_NC, // GPIO_S5[04] - No Connect
+ GPIO_INPUT, // GPIO_S5[05] - BOM_OP1
+ // Memory: 0=1GB 1=2GB or 4GB
+ GPIO_INPUT, // GPIO_S5[06] - BOM_OP2
+ GPIO_INPUT, // GPIO_S5[07] - BOM_OP3
+ GPIO_OUT_HIGH_LEGACY, // GPIO_S5[08] - SOC_USB_HOST_EN0
+ GPIO_OUT_HIGH_LEGACY, // GPIO_S5[09] - SOC_USB_HOST_EN1
+ GPIO_OUT_HIGH_LEGACY, // GPIO_S5[10] - GPIO_S5_10_UNLOCK
+ GPIO_FUNC0, // GPIO_S5[11] - SUSPWRDNACK (TP14)
+ GPIO_FUNC0, // GPIO_S5[12] - PMC_SUSCLK0
+ GPIO_FUNC1, // GPIO_S5[13] - PMC_SLP_S0IX (TP10)
+ GPIO_FUNC1, // GPIO_S5[14] - GPIO_S514_J20
+ GPIO_FUNC0, // GPIO_S5[15] - PMC_PCIE_WAKE_R
+ GPIO_FUNC0, // GPIO_S5[16] - PMC_PWRBTN
+ GPIO_NC, // GPIO_S5[17] - No Connect
+ GPIO_FUNC1, // GPIO_S5[18] - LPCPD_L (TP7)
+ GPIO_FUNC0, // GPIO_S5[19] - SOC_USB_HOST_OC0
+ GPIO_FUNC0, // GPIO_S5[20] - SOC_USB_HOST_OC1
+ GPIO_FUNC0, // GPIO_S5[21] - SOC_SPI_CS1B
+ GPIO_INPUT_PD, // GPIO_S5[22] - NC or LED D2
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[23] - XDP_H_OBSDATA_A0
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[24] - XDP_H_OBSDATA_A1
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[25] - XDP_H_OBSDATA_A2
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[26] - XDP_H_OBSDATA_A3
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[27] - EXP_GPIO1
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[28] - EXP_GPIO2
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[29] - EXP_GPIO3
+ GPIO_FUNC(0, PULL_UP, 20K), // GPIO_S5[30] - EXP_GPIO4
+ GPIO_NC, // GPIO_S5[31] - No Connect
+ GPIO_NC, // GPIO_S5[32] - No Connect
+ GPIO_NC, // GPIO_S5[33] - No Connect
+ GPIO_NC, // GPIO_S5[34] - No Connect
+ GPIO_NC, // GPIO_S5[35] - No Connect
+ GPIO_NC, // GPIO_S5[36] - No Connect
+ GPIO_NC, // GPIO_S5[37] - No Connect
+ GPIO_NC, // GPIO_S5[38] - No Connect
+ GPIO_NC, // GPIO_S5[39] - No Connect
+ GPIO_NC, // GPIO_S5[40] - No Connect
+ GPIO_NC, // GPIO_S5[41] - No Connect
+ GPIO_NC, // GPIO_S5[42] - No Connect
+ GPIO_NC, // GPIO_S5[43] - No Connect
+ GPIO_END
+};
+
+static struct soc_gpio_config gpio_config = {
+ .ncore = gpncore_gpio_map,
+ .score = gpscore_gpio_map,
+ .ssus = gpssus_gpio_map,
+ .core_dirq = NULL,
+ .sus_dirq = NULL,
+};
+
+struct soc_gpio_config *mainboard_get_gpios(void)
+{
+ return &gpio_config;
+}
diff --git a/src/mainboard/intel/minnowmax/irqroute.c b/src/mainboard/intel/minnowmax/irqroute.c
new file mode 100644
index 0000000..6fa0366
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/irqroute.c
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include "irqroute.h"
+
+DEFINE_IRQ_ROUTES;
diff --git a/src/mainboard/intel/minnowmax/irqroute.h b/src/mainboard/intel/minnowmax/irqroute.h
new file mode 100644
index 0000000..e0e43f0
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/irqroute.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <soc/irq.h>
+#include <soc/pci_devs.h>
+
+#define PCI_DEV_PIRQ_ROUTES \
+ PCI_DEV_PIRQ_ROUTE(GFX_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(SD_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(SATA_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(XHCI_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(LPE_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(SIO1_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(TXE_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(PCIE_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(EHCI_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(SIO2_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(PCU_DEV, A, B, C, D)
+
+#define PIRQ_PIC_ROUTES \
+ PIRQ_PIC(A, DISABLE), \
+ PIRQ_PIC(B, DISABLE), \
+ PIRQ_PIC(C, DISABLE), \
+ PIRQ_PIC(D, DISABLE), \
+ PIRQ_PIC(E, DISABLE), \
+ PIRQ_PIC(F, DISABLE), \
+ PIRQ_PIC(G, DISABLE), \
+ PIRQ_PIC(H, DISABLE)
diff --git a/src/mainboard/intel/minnowmax/mainboard.c b/src/mainboard/intel/minnowmax/mainboard.c
new file mode 100644
index 0000000..69b9405
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/mainboard.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpi.h>
+#include <bootstate.h>
+void mainboard_suspend_resume(void)
+{
+}
+
+static void mainboard_init(struct device *dev)
+{
+}
+static int mainboard_smbios_data(struct device *dev, int *handle,
+ unsigned long *current)
+{
+ return 0;
+}
+// mainboard_enable is executed as first thing after
+// enumerate_buses().
+static void mainboard_enable(struct device *dev)
+{
+ dev->ops->init = mainboard_init;
+ dev->ops->get_smbios_data = mainboard_smbios_data;
+}
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
diff --git a/src/mainboard/intel/minnowmax/romstage.c b/src/mainboard/intel/minnowmax/romstage.c
new file mode 100644
index 0000000..c504cd4
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/romstage.c
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <stdint.h>
+#include <soc/gpio.h>
+#include <cbfs.h>
+#include <console/console.h>
+#include <soc/mrc_wrapper.h>
+#include <soc/romstage.h>
+
+#define DRAM_GPIO_FUSE 5
+#define SPD_SIZE 256
+
+static void *get_spd_pointer(char *spd_file_content)
+{
+ u8 gpio5 = 0;
+
+ ssus_disable_internal_pull(DRAM_GPIO_FUSE);
+
+ gpio5 = ssus_get_gpio(DRAM_GPIO_FUSE);
+
+ // TODO
+ return &spd_file_content[SPD_SIZE * 0];
+}
+
+void mainboard_fill_mrc_params(struct mrc_params *mp)
+{
+ void *spd_content;
+ void *spd_file;
+ size_t spd_fsize;
+
+ spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD, &spd_fsize);
+
+ if (!spd_file)
+ die("SPD data not found.");
+
+ spd_content = get_spd_pointer(spd_file);
+
+ mp->mainboard.dram_type = DRAM_DDR3L;
+ mp->mainboard.dram_info_location = DRAM_INFO_SPD_MEM;
+ mp->mainboard.weaker_odt_settings = 1;
+
+ mp->mainboard.dram_data[0] = spd_content;
+}
diff --git a/src/mainboard/intel/minnowmax/spd/micron_2GiB_dimm_MT41K256M16HA-125.spd.hex b/src/mainboard/intel/minnowmax/spd/micron_2GiB_dimm_MT41K256M16HA-125.spd.hex
new file mode 100644
index 0000000..f3bcb56
--- /dev/null
+++ b/src/mainboard/intel/minnowmax/spd/micron_2GiB_dimm_MT41K256M16HA-125.spd.hex
@@ -0,0 +1,32 @@
+92 11 0b 03 04 19 02 02
+03 11 01 08 0a 00 fe 00
+69 78 69 3c 69 11 18 86
+20 08 3c 3c 01 40 83 05
+00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00
+00 00 00 00 0f 01 02 00
+00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00
+00 00 00 00 00 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 19 d2
+34 4b 54 46 32 35 36 36
+34 48 5a 2d 31 47 36 45
+31 20 45 31 80 2c 00 00
+00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
+ff ff ff ff ff ff ff ff
diff --git a/src/soc/intel/baytrail/Makefile.inc b/src/soc/intel/baytrail/Makefile.inc
index bfa1846..cd03458 100644
--- a/src/soc/intel/baytrail/Makefile.inc
+++ b/src/soc/intel/baytrail/Makefile.inc
@@ -66,8 +66,7 @@
postcar-y += ../../../cpu/intel/car/non-evict/exit_car.S
-cpu_microcode_bins += 3rdparty/blobs/soc/intel/baytrail/microcode.bin \
- 3rdparty/intel-microcode/intel-ucode/06-37-09
+cpu_microcode_bins += 3rdparty/intel-microcode/intel-ucode/06-37-*
CPPFLAGS_common += -Isrc/soc/intel/baytrail/include
diff --git a/src/soc/intel/baytrail/refcode.c b/src/soc/intel/baytrail/refcode.c
index 297ed9c..99fb335 100644
--- a/src/soc/intel/baytrail/refcode.c
+++ b/src/soc/intel/baytrail/refcode.c
@@ -19,7 +19,7 @@
static efi_wrapper_entry_t load_refcode_from_cache(void)
{
- struct prog refcode;
+ static struct prog refcode;
printk(BIOS_DEBUG, "refcode loading from cache.\n");
--
To view, visit https://review.coreboot.org/c/coreboot/+/44102
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9a1236425c8a0914f92adcad445230ef2692393a
Gerrit-Change-Number: 44102
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
5
15
Change in coreboot[master]: mb/google/volteer: Implement variant_devtree_update for volteer sku's
by Shaunak Saha (Code Review) Aug. 7, 2023
by Shaunak Saha (Code Review) Aug. 7, 2023
Aug. 7, 2023
Shaunak Saha has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44261 )
Change subject: mb/google/volteer: Implement variant_devtree_update for volteer sku's
......................................................................
mb/google/volteer: Implement variant_devtree_update for volteer sku's
HybridStorageMode FSP UPD needs to be set only for optane storage.
Enabling HybridStorageMode causes some extra delay in FspSiliconInit due
to HECI command and hence is avoided for NVMe and SATA scenerios. This change
disables "HybridStorageMode" by default from baseboard devicetree. Any
volteer variant which is using optane should enable "HybridStorageMode" from
the override devicetree file.This change also provides an implementation of
variant_devtree_update() for volteer that enables HybridStorageMode for
SKU ID = 3 and 5.
BUG=b:158573805
TEST=Verify HybridStorageMode is disabled when SKU ID != 3 or 5 and
enabled for those 2 sku's only.
Signed-off-by: Shaunak Saha <shaunak.saha(a)intel.com>
Change-Id: I5c3bcfafe1710155bb47f706c3568dd9500c1975
---
M src/mainboard/google/volteer/Makefile.inc
A src/mainboard/google/volteer/ramstage.c
M src/mainboard/google/volteer/variants/baseboard/devicetree.cb
M src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h
M src/mainboard/google/volteer/variants/volteer/Makefile.inc
A src/mainboard/google/volteer/variants/volteer/variant.c
6 files changed, 39 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/44261/1
diff --git a/src/mainboard/google/volteer/Makefile.inc b/src/mainboard/google/volteer/Makefile.inc
index c01f993..b5579a7 100644
--- a/src/mainboard/google/volteer/Makefile.inc
+++ b/src/mainboard/google/volteer/Makefile.inc
@@ -10,6 +10,7 @@
ramstage-y += ec.c
ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
ramstage-y += mainboard.c
+ramstage-y += ramstage.c
smm-y += smihandler.c
diff --git a/src/mainboard/google/volteer/ramstage.c b/src/mainboard/google/volteer/ramstage.c
new file mode 100644
index 0000000..084e69e
--- /dev/null
+++ b/src/mainboard/google/volteer/ramstage.c
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <baseboard/variants.h>
+#include <soc/ramstage.h>
+
+void mainboard_silicon_init_params(FSP_S_CONFIG *params)
+{
+ variant_devtree_update();
+}
+
+void __weak variant_devtree_update(void)
+{
+ /* Override dev tree settings per board */
+}
+
diff --git a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb
index 53bbe5a..ccd1877 100644
--- a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb
@@ -81,7 +81,9 @@
# Enable Optane PCIE 11 using clk 0
register "PcieRpEnable[10]" = "1"
register "PcieRpLtrEnable[10]" = "1"
- register "HybridStorageMode" = "1"
+ # Disable it by default. Device tree overwrite needs to enable this feature
+ # for platforms using Optane memory.
+ register "HybridStorageMode" = "0"
# Enable SD Card PCIE 8 using clk 3
register "PcieRpEnable[7]" = "1"
diff --git a/src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h
index 2f90a42..aa8ea27 100644
--- a/src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h
@@ -21,4 +21,6 @@
const struct lpddr4x_cfg *variant_memory_params(void);
int variant_memory_sku(void);
+void variant_devtree_update(void);
+
#endif /* __BASEBOARD_VARIANTS_H__ */
diff --git a/src/mainboard/google/volteer/variants/volteer/Makefile.inc b/src/mainboard/google/volteer/variants/volteer/Makefile.inc
index 13269db..04af3ae 100644
--- a/src/mainboard/google/volteer/variants/volteer/Makefile.inc
+++ b/src/mainboard/google/volteer/variants/volteer/Makefile.inc
@@ -3,3 +3,4 @@
bootblock-y += gpio.c
ramstage-y += gpio.c
+ramstage-y += variant.c
diff --git a/src/mainboard/google/volteer/variants/volteer/variant.c b/src/mainboard/google/volteer/variants/volteer/variant.c
new file mode 100644
index 0000000..8d3adef
--- /dev/null
+++ b/src/mainboard/google/volteer/variants/volteer/variant.c
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <baseboard/variants.h>
+#include <chip.h>
+#include <ec/google/chromeec/ec.h>
+
+void variant_devtree_update(void)
+{
+ uint32_t sku_id;
+ config_t *cfg = config_of_soc();
+
+ if (google_chromeec_cbi_get_sku_id(&sku_id))
+ return;
+
+ if ((sku_id == 3) || (sku_id == 5))
+ cfg->HybridStorageMode = 1;
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/44261
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5c3bcfafe1710155bb47f706c3568dd9500c1975
Gerrit-Change-Number: 44261
Gerrit-PatchSet: 1
Gerrit-Owner: Shaunak Saha <shaunak.saha(a)intel.com>
Gerrit-MessageType: newchange
4
11
Change in coreboot[master]: soc/intel/baytrail: Start VBOOT in bootblock
by Arthur Heymans (Code Review) Aug. 7, 2023
by Arthur Heymans (Code Review) Aug. 7, 2023
Aug. 7, 2023
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36874 )
Change subject: soc/intel/baytrail: Start VBOOT in bootblock
......................................................................
soc/intel/baytrail: Start VBOOT in bootblock
The earlier the more that can be updated via RW fmap regions.
Change-Id: Ifcaf6ad8e27c09fee99cf6a8b12f9fadcb0cef2c
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/mainboard/google/rambi/Makefile.inc
M src/soc/intel/baytrail/Kconfig
M src/soc/intel/baytrail/Makefile.inc
M src/soc/intel/baytrail/pmutil.c
4 files changed, 9 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/36874/1
diff --git a/src/mainboard/google/rambi/Makefile.inc b/src/mainboard/google/rambi/Makefile.inc
index 0e80b64..6660d23 100644
--- a/src/mainboard/google/rambi/Makefile.inc
+++ b/src/mainboard/google/rambi/Makefile.inc
@@ -13,6 +13,7 @@
## GNU General Public License for more details.
##
+verstage-$(CONFIG_CHROMEOS) += chromeos.c
romstage-$(CONFIG_CHROMEOS) += chromeos.c
ramstage-$(CONFIG_CHROMEOS) += chromeos.c
ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c
diff --git a/src/soc/intel/baytrail/Kconfig b/src/soc/intel/baytrail/Kconfig
index cfea93a..e4e8c30 100644
--- a/src/soc/intel/baytrail/Kconfig
+++ b/src/soc/intel/baytrail/Kconfig
@@ -41,11 +41,8 @@
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY
- select VBOOT_STARTS_IN_ROMSTAGE
-
-config BOOTBLOCK_CPU_INIT
- string
- default "soc/intel/baytrail/bootblock/bootblock.c"
+ select VBOOT_STARTS_IN_BOOTBLOCK
+ select VBOOT_SEPARATE_VERSTAGE
config MMCONF_BASE_ADDRESS
hex
diff --git a/src/soc/intel/baytrail/Makefile.inc b/src/soc/intel/baytrail/Makefile.inc
index eda3e25..d21f744 100644
--- a/src/soc/intel/baytrail/Makefile.inc
+++ b/src/soc/intel/baytrail/Makefile.inc
@@ -16,6 +16,8 @@
bootblock-y += ../../../cpu/x86/early_reset.S
bootblock-y += bootblock/bootblock.c
+verstage-y += pmutil.c
+
romstage-y += iosf.c
romstage-y += memmap.c
romstage-y += pmutil.c
diff --git a/src/soc/intel/baytrail/pmutil.c b/src/soc/intel/baytrail/pmutil.c
index 51174fc..2d14d84 100644
--- a/src/soc/intel/baytrail/pmutil.c
+++ b/src/soc/intel/baytrail/pmutil.c
@@ -368,7 +368,10 @@
{
uint32_t gen_pmcon1;
int rtc_fail;
- struct chipset_power_state *ps = cbmem_find(CBMEM_ID_POWER_STATE);
+ struct chipset_power_state *ps = NULL;
+
+ if (ENV_RAMSTAGE)
+ ps = cbmem_find(CBMEM_ID_POWER_STATE);
if (ps != NULL)
gen_pmcon1 = ps->gen_pmcon1;
--
To view, visit https://review.coreboot.org/c/coreboot/+/36874
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifcaf6ad8e27c09fee99cf6a8b12f9fadcb0cef2c
Gerrit-Change-Number: 36874
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
4
6
Change in coreboot[master]: mb/gigabyte/ga-g41m-es2l: Prepare for a variant
by Arthur Heymans (Code Review) Aug. 7, 2023
by Arthur Heymans (Code Review) Aug. 7, 2023
Aug. 7, 2023
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41867 )
Change subject: mb/gigabyte/ga-g41m-es2l: Prepare for a variant
......................................................................
mb/gigabyte/ga-g41m-es2l: Prepare for a variant
To ease the review of adding a variant (ga-g41m-combo) move a few
things around without yet adding the variant.
Change-Id: I0b22731849e157b76be97dbe02a7538f1cea472d
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/mainboard/gigabyte/ga-g41m-es2l/Kconfig
M src/mainboard/gigabyte/ga-g41m-es2l/Makefile.inc
M src/mainboard/gigabyte/ga-g41m-es2l/devicetree.cb
M src/mainboard/gigabyte/ga-g41m-es2l/early_init.c
A src/mainboard/gigabyte/ga-g41m-es2l/include/mainboard/superio.h
A src/mainboard/gigabyte/ga-g41m-es2l/superio.h
R src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/gpio.c
R src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/hda_verb.c
A src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/overridetree.cb
A src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/superio.c
10 files changed, 166 insertions(+), 119 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/41867/1
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/Kconfig b/src/mainboard/gigabyte/ga-g41m-es2l/Kconfig
index fa6783d1..97f155a 100644
--- a/src/mainboard/gigabyte/ga-g41m-es2l/Kconfig
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/Kconfig
@@ -7,7 +7,7 @@
select CPU_INTEL_SOCKET_LGA775
select NORTHBRIDGE_INTEL_X4X
select SOUTHBRIDGE_INTEL_I82801GX
- select SUPERIO_ITE_IT8718F
+ select SUPERIO_ITE_IT8718F if BOARD_GIGABYTE_GA_G41M_ES2L
select HAVE_ACPI_TABLES
select BOARD_ROMSIZE_KB_1024
select PCIEXP_ASPM
@@ -24,9 +24,17 @@
string
default "gigabyte/ga-g41m-es2l"
+config VARIANT_DIR
+ string
+ default "ga-g41m-es2l" if BOARD_GIGABYTE_GA_G41M_ES2L
+
+config OVERRIDE_DEVICETREE
+ string
+ default "variants/$(CONFIG_VARIANT_DIR)/overridetree.cb"
+
config MAINBOARD_PART_NUMBER
string
- default "GA-G41M-ES2L"
+ default "GA-G41M-ES2L" if BOARD_GIGABYTE_GA_G41M_ES2L
config MAX_CPUS
int
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/Makefile.inc b/src/mainboard/gigabyte/ga-g41m-es2l/Makefile.inc
index 4100476..cf8ce96 100644
--- a/src/mainboard/gigabyte/ga-g41m-es2l/Makefile.inc
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/Makefile.inc
@@ -1,7 +1,11 @@
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
+
+CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
+bootblock-y += variants/$(VARIANT_DIR)/superio.c
+romstage-y += variants/$(VARIANT_DIR)/gpio.c
+ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/devicetree.cb b/src/mainboard/gigabyte/ga-g41m-es2l/devicetree.cb
index 6328bc6..bdeda72 100644
--- a/src/mainboard/gigabyte/ga-g41m-es2l/devicetree.cb
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/devicetree.cb
@@ -68,79 +68,6 @@
device pci 1e.3 off end # AC'97 Modem
device pci 1f.0 on # ISA bridge
subsystemid 0x1458 0x5001
- chip superio/ite/it8718f # Super I/O
- register "TMPIN1.mode" = "THERMAL_RESISTOR"
- register "TMPIN2.mode" = "THERMAL_RESISTOR"
- register "TMPIN3.mode" = "THERMAL_DIODE"
- register "TMPIN3.offset" = "0"
- register "ec.vin_mask" = "VIN7 | VIN4 | VIN3 | VIN2 | VIN1 | VIN0"
-
- register "FAN1.mode" = "FAN_SMART_AUTOMATIC"
- register "FAN1.smart.tmpin" = "3"
- register "FAN1.smart.tmp_off" = "25"
- register "FAN1.smart.tmp_start" = "30"
- register "FAN1.smart.tmp_full" = "65"
- register "FAN1.smart.tmp_delta" = "3"
- register "FAN1.smart.smoothing" = "1"
- register "FAN1.smart.pwm_start" = "0"
- register "FAN1.smart.slope" = "10"
-
- register "FAN2.mode" = "FAN_SMART_AUTOMATIC"
- register "FAN2.smart.tmpin" = "3"
- register "FAN2.smart.tmp_off" = "25"
- register "FAN2.smart.tmp_start" = "30"
- register "FAN2.smart.tmp_full" = "65"
- register "FAN2.smart.tmp_delta" = "3"
- register "FAN2.smart.smoothing" = "1"
- register "FAN2.smart.pwm_start" = "0"
- register "FAN2.smart.slope" = "10"
-
- device pnp 2e.0 on # Floppy
- io 0x60 = 0x3f0
- irq 0x70 = 6
- drq 0x74 = 2
- irq 0xf0 = 0x00
- irq 0xf1 = 0x80
- end
- device pnp 2e.1 on # COM1
- io 0x60 = 0x3f8
- irq 0x70 = 4
- end
- device pnp 2e.2 on # COM2
- io 0x60 = 0x2f8
- irq 0x70 = 3
- end
- device pnp 2e.3 on # Parallel port
- io 0x60 = 0x378
- irq 0x70 = 7
- io 0x62 = 0x000
- drq 0x74 = 4
- irq 0xf0 = 0x08
- end
- device pnp 2e.4 on # Environment controller
- io 0x60 = 0x290
- irq 0x70 = 0x00
- io 0x62 = 0x000
- irq 0xf0 = 0x80
- irq 0xf1 = 0x00
- irq 0xf2 = 0x0a
- irq 0xf3 = 0x80
- irq 0xf4 = 0x00
- irq 0xf5 = 0x00
- irq 0xf6 = 0xff
- end
- device pnp 2e.5 on # Keyboard
- io 0x60 = 0x60
- irq 0x70 = 1
- io 0x62 = 0x64
- irq 0xf0 = 0x48
- end
- device pnp 2e.6 on # Mouse
- irq 0x70 = 12
- irq 0x71 = 2
- irq 0xf0 = 0
- end
- end
end
device pci 1f.1 on # PATA/IDE
subsystemid 0x1458 0xb004
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/early_init.c b/src/mainboard/gigabyte/ga-g41m-es2l/early_init.c
index 4b0ea16..c204070 100644
--- a/src/mainboard/gigabyte/ga-g41m-es2l/early_init.c
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/early_init.c
@@ -4,12 +4,7 @@
#include <device/pci_ops.h>
#include <southbridge/intel/i82801gx/i82801gx.h>
#include <northbridge/intel/x4x/x4x.h>
-#include <superio/ite/it8718f/it8718f.h>
-#include <superio/ite/common/ite.h>
-
-#define SERIAL_DEV PNP_DEV(0x2e, IT8718F_SP1)
-#define GPIO_DEV PNP_DEV(0x2e, IT8718F_GPIO)
-#define EC_DEV PNP_DEV(0x2e, IT8718F_EC)
+#include <mainboard/superio.h>
/* Early mainboard specific GPIO setup.
* We should use standard gpio.h eventually
@@ -17,43 +12,7 @@
void bootblock_mainboard_early_init(void)
{
- /* Set default GPIOs on superio */
- ite_reg_write(GPIO_DEV, 0x25, 0x00);
- ite_reg_write(GPIO_DEV, 0x26, 0xc7);
- ite_reg_write(GPIO_DEV, 0x27, 0x80);
- ite_reg_write(GPIO_DEV, 0x28, 0x41);
- ite_reg_write(GPIO_DEV, 0x29, 0x0a);
- ite_reg_write(GPIO_DEV, 0x2c, 0x01);
- ite_reg_write(GPIO_DEV, 0x62, 0x08);
- ite_reg_write(GPIO_DEV, 0x72, 0x00);
- ite_reg_write(GPIO_DEV, 0x73, 0x00);
- ite_reg_write(GPIO_DEV, 0xb8, 0x00);
- ite_reg_write(GPIO_DEV, 0xbb, 0x40);
- ite_reg_write(GPIO_DEV, 0xc0, 0x00);
- ite_reg_write(GPIO_DEV, 0xc1, 0xc7);
- ite_reg_write(GPIO_DEV, 0xc2, 0x80);
- ite_reg_write(GPIO_DEV, 0xc3, 0x01);
- ite_reg_write(GPIO_DEV, 0xc4, 0x0a);
- ite_reg_write(GPIO_DEV, 0xc8, 0x00);
- ite_reg_write(GPIO_DEV, 0xc9, 0x04);
- ite_reg_write(GPIO_DEV, 0xcb, 0x00);
- ite_reg_write(GPIO_DEV, 0xcc, 0x02);
- ite_reg_write(GPIO_DEV, 0xf0, 0x10);
- ite_reg_write(GPIO_DEV, 0xf1, 0x40);
- ite_reg_write(GPIO_DEV, 0xf6, 0x26);
- ite_reg_write(GPIO_DEV, 0xfc, 0x52);
-
- ite_reg_write(EC_DEV, 0xf0, 0x80);
- ite_reg_write(EC_DEV, 0xf1, 0x00);
- ite_reg_write(EC_DEV, 0xf2, 0x0a);
- ite_reg_write(EC_DEV, 0xf3, 0x80);
- ite_reg_write(EC_DEV, 0x70, 0x00); // Don't use IRQ9
- ite_reg_write(EC_DEV, 0x30, 0x01); // Enable
-
- ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
-
- /* Disable SIO reboot */
- ite_reg_write(GPIO_DEV, 0xEF, 0x7E);
+ mainboard_early_superio();
/* IRQ routing */
RCBA32(D31IP) = 0x00002210;
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/include/mainboard/superio.h b/src/mainboard/gigabyte/ga-g41m-es2l/include/mainboard/superio.h
new file mode 100644
index 0000000..ddc7d04
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/include/mainboard/superio.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef MAINBOARD_GIGABYTE_GA_G41M_ES2l_SUPERIO
+#define MAINBOARD_GIGABYTE_GA_G41M_ES2l_SUPERIO
+
+void mainboard_early_superio(void);
+
+#endif
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/superio.h b/src/mainboard/gigabyte/ga-g41m-es2l/superio.h
new file mode 100644
index 0000000..62bf591
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/superio.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifdef MAINBOARD_GIGABYTE_GA_G41M_ES2l_SUPERIO
+#define MAINBOARD_GIGABYTE_GA_G41M_ES2l_SUPERIO
+
+
+
+#endif
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/gpio.c b/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/gpio.c
similarity index 100%
rename from src/mainboard/gigabyte/ga-g41m-es2l/gpio.c
rename to src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/gpio.c
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/hda_verb.c b/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/hda_verb.c
similarity index 100%
rename from src/mainboard/gigabyte/ga-g41m-es2l/hda_verb.c
rename to src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/hda_verb.c
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/overridetree.cb b/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/overridetree.cb
new file mode 100644
index 0000000..f481195
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/overridetree.cb
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+chip northbridge/intel/x4x # Northbridge
+ device domain 0 on # PCI domain
+ chip southbridge/intel/i82801gx # Southbridge
+ device pci 1f.0 on # ISA bridge
+ subsystemid 0x1458 0x5001
+ chip superio/ite/it8718f # Super I/O
+ register "TMPIN1.mode" = "THERMAL_RESISTOR"
+ register "TMPIN2.mode" = "THERMAL_RESISTOR"
+ register "TMPIN3.mode" = "THERMAL_DIODE"
+ register "TMPIN3.offset" = "0"
+ register "ec.vin_mask" = "VIN7 | VIN4 | VIN3 | VIN2 | VIN1 | VIN0"
+
+ register "FAN1.mode" = "FAN_SMART_AUTOMATIC"
+ register "FAN1.smart.tmpin" = "3"
+ register "FAN1.smart.tmp_off" = "25"
+ register "FAN1.smart.tmp_start" = "30"
+ register "FAN1.smart.tmp_full" = "65"
+ register "FAN1.smart.tmp_delta" = "3"
+ register "FAN1.smart.smoothing" = "1"
+ register "FAN1.smart.pwm_start" = "0"
+ register "FAN1.smart.slope" = "10"
+
+ register "FAN2.mode" = "FAN_SMART_AUTOMATIC"
+ register "FAN2.smart.tmpin" = "3"
+ register "FAN2.smart.tmp_off" = "25"
+ register "FAN2.smart.tmp_start" = "30"
+ register "FAN2.smart.tmp_full" = "65"
+ register "FAN2.smart.tmp_delta" = "3"
+ register "FAN2.smart.smoothing" = "1"
+ register "FAN2.smart.pwm_start" = "0"
+ register "FAN2.smart.slope" = "10"
+
+ device pnp 2e.0 on # Floppy
+ io 0x60 = 0x3f0
+ irq 0x70 = 6
+ drq 0x74 = 2
+ irq 0xf0 = 0x00
+ irq 0xf1 = 0x80
+ end
+ device pnp 2e.1 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.2 on # COM2
+ io 0x60 = 0x2f8
+ irq 0x70 = 3
+ end
+ device pnp 2e.3 on # Parallel port
+ io 0x60 = 0x378
+ irq 0x70 = 7
+ io 0x62 = 0x000
+ drq 0x74 = 4
+ irq 0xf0 = 0x08
+ end
+ device pnp 2e.4 on # Environment controller
+ io 0x60 = 0x290
+ irq 0x70 = 0x00
+ io 0x62 = 0x000
+ irq 0xf0 = 0x80
+ irq 0xf1 = 0x00
+ irq 0xf2 = 0x0a
+ irq 0xf3 = 0x80
+ irq 0xf4 = 0x00
+ irq 0xf5 = 0x00
+ irq 0xf6 = 0xff
+ end
+ device pnp 2e.5 on # Keyboard
+ io 0x60 = 0x60
+ irq 0x70 = 1
+ io 0x62 = 0x64
+ irq 0xf0 = 0x48
+ end
+ device pnp 2e.6 on # Mouse
+ irq 0x70 = 12
+ irq 0x71 = 2
+ irq 0xf0 = 0
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/superio.c b/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/superio.c
new file mode 100644
index 0000000..c759532
--- /dev/null
+++ b/src/mainboard/gigabyte/ga-g41m-es2l/variants/ga-g41m-es2l/superio.c
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <mainboard/superio.h>
+#include <superio/ite/it8718f/it8718f.h>
+#include <superio/ite/common/ite.h>
+
+#define SERIAL_DEV PNP_DEV(0x2e, IT8718F_SP1)
+#define GPIO_DEV PNP_DEV(0x2e, IT8718F_GPIO)
+#define EC_DEV PNP_DEV(0x2e, IT8718F_EC)
+
+void mainboard_early_superio(void)
+{
+ /* Set default GPIOs on superio */
+ ite_reg_write(GPIO_DEV, 0x25, 0x00);
+ ite_reg_write(GPIO_DEV, 0x26, 0xc7);
+ ite_reg_write(GPIO_DEV, 0x27, 0x80);
+ ite_reg_write(GPIO_DEV, 0x28, 0x41);
+ ite_reg_write(GPIO_DEV, 0x29, 0x0a);
+ ite_reg_write(GPIO_DEV, 0x2c, 0x01);
+ ite_reg_write(GPIO_DEV, 0x62, 0x08);
+ ite_reg_write(GPIO_DEV, 0x72, 0x00);
+ ite_reg_write(GPIO_DEV, 0x73, 0x00);
+ ite_reg_write(GPIO_DEV, 0xb8, 0x00);
+ ite_reg_write(GPIO_DEV, 0xbb, 0x40);
+ ite_reg_write(GPIO_DEV, 0xc0, 0x00);
+ ite_reg_write(GPIO_DEV, 0xc1, 0xc7);
+ ite_reg_write(GPIO_DEV, 0xc2, 0x80);
+ ite_reg_write(GPIO_DEV, 0xc3, 0x01);
+ ite_reg_write(GPIO_DEV, 0xc4, 0x0a);
+ ite_reg_write(GPIO_DEV, 0xc8, 0x00);
+ ite_reg_write(GPIO_DEV, 0xc9, 0x04);
+ ite_reg_write(GPIO_DEV, 0xcb, 0x00);
+ ite_reg_write(GPIO_DEV, 0xcc, 0x02);
+ ite_reg_write(GPIO_DEV, 0xf0, 0x10);
+ ite_reg_write(GPIO_DEV, 0xf1, 0x40);
+ ite_reg_write(GPIO_DEV, 0xf6, 0x26);
+ ite_reg_write(GPIO_DEV, 0xfc, 0x52);
+
+ ite_reg_write(EC_DEV, 0xf0, 0x80);
+ ite_reg_write(EC_DEV, 0xf1, 0x00);
+ ite_reg_write(EC_DEV, 0xf2, 0x0a);
+ ite_reg_write(EC_DEV, 0xf3, 0x80);
+ ite_reg_write(EC_DEV, 0x70, 0x00); // Don't use IRQ9
+ ite_reg_write(EC_DEV, 0x30, 0x01); // Enable
+
+ ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+
+ /* Disable SIO reboot */
+ ite_reg_write(GPIO_DEV, 0xEF, 0x7E);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/41867
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0b22731849e157b76be97dbe02a7538f1cea472d
Gerrit-Change-Number: 41867
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
3
3
Change in coreboot[master]: The .config is overwritten when added to coreboot.rom via CBFS at the...
by Jeremy Jackson (Code Review) Aug. 7, 2023
by Jeremy Jackson (Code Review) Aug. 7, 2023
Aug. 7, 2023
Jeremy Jackson has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42028 )
Change subject: The .config is overwritten when added to coreboot.rom via CBFS at the end of the build (if you choose that option)... should this be a separate file for each of fallback and normal? Since there can be two different versions and/or configurations, would fallback/config and normal/config make more sense? Also the "revision" file might benefit from similar treatment.
......................................................................
The .config is overwritten when added to coreboot.rom via CBFS at the end
of the build (if you choose that option)... should this be a separate file
for each of fallback and normal? Since there can be two different versions
and/or configurations, would fallback/config and normal/config make more
sense? Also the "revision" file might benefit from similar treatment.
Signed-off-by: Jeremy Jackson <jerj(a)coplanar.net>
Change-Id: I3e904e44137f731f239f51dbf224965f33838e19
---
M Makefile.inc
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/42028/1
diff --git a/Makefile.inc b/Makefile.inc
index 86467a6..b547f11 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1195,13 +1195,13 @@
vgaroms/seavgabios.bin-file := $(CONFIG_PAYLOAD_VGABIOS_FILE)
vgaroms/seavgabios.bin-type := raw
-cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += config
-config-file := $(DOTCONFIG):defconfig
-config-type := raw
+cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += $(CONFIG_CBFS_PREFIX)/config
+$(CONFIG_CBFS_PREFIX)/config-file := $(DOTCONFIG):defconfig
+$(CONFIG_CBFS_PREFIX)/config-type := raw
-cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += revision
-revision-file := $(obj)/build.h
-revision-type := raw
+cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += $(CONFIG_CBFS_PREFIX)/revision
+$(CONFIG_CBFS_PREFIX)/revision-file := $(obj)/build.h
+$(CONFIG_CBFS_PREFIX)/revision-type := raw
BOOTSPLASH_SUFFIX=$(suffix $(call strip_quotes,$(CONFIG_BOOTSPLASH_FILE)))
cbfs-files-$(CONFIG_BOOTSPLASH_IMAGE) += bootsplash$(BOOTSPLASH_SUFFIX)
--
To view, visit https://review.coreboot.org/c/coreboot/+/42028
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3e904e44137f731f239f51dbf224965f33838e19
Gerrit-Change-Number: 42028
Gerrit-PatchSet: 1
Gerrit-Owner: Jeremy Jackson <jerj(a)coplanar.net>
Gerrit-MessageType: newchange
7
14