Arthur Heymans has uploaded this change for review.

View Change

[WIP]mb/fujitsu/d3041-a1: Add mainboard

Tested and works:
- using 2 4GB DDR3 dual rank dimms (vendor fails)
- USB
- PS2 Keyboard, Serial
- Libgfxinit on VGA
- NIC

Tested and doesn't work:
- S3 resume: The ram doesn't seem to be in self refresh, even when
suspending from vendor BIOS and booting with coreboot this seems
to fail

Change-Id: I2eeddfde84fc93a6f285fd8c20a56ff63335a02f
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
---
A src/mainboard/fujitsu/Kconfig
A src/mainboard/fujitsu/Kconfig.name
A src/mainboard/fujitsu/d3041-a1/Kconfig
A src/mainboard/fujitsu/d3041-a1/Kconfig.name
A src/mainboard/fujitsu/d3041-a1/Makefile.inc
A src/mainboard/fujitsu/d3041-a1/acpi/ec.asl
A src/mainboard/fujitsu/d3041-a1/acpi/ich7_pci_irqs.asl
A src/mainboard/fujitsu/d3041-a1/acpi/platform.asl
A src/mainboard/fujitsu/d3041-a1/acpi/superio.asl
A src/mainboard/fujitsu/d3041-a1/acpi_tables.c
A src/mainboard/fujitsu/d3041-a1/board_info.txt
A src/mainboard/fujitsu/d3041-a1/cmos.default
A src/mainboard/fujitsu/d3041-a1/cmos.layout
A src/mainboard/fujitsu/d3041-a1/cstates.c
A src/mainboard/fujitsu/d3041-a1/data.vbt
A src/mainboard/fujitsu/d3041-a1/devicetree.cb
A src/mainboard/fujitsu/d3041-a1/dsdt.asl
A src/mainboard/fujitsu/d3041-a1/gma-mainboard.ads
A src/mainboard/fujitsu/d3041-a1/gpio.c
A src/mainboard/fujitsu/d3041-a1/hda_verb.c
A src/mainboard/fujitsu/d3041-a1/romstage.c
21 files changed, 846 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/30906/1
diff --git a/src/mainboard/fujitsu/Kconfig b/src/mainboard/fujitsu/Kconfig
new file mode 100644
index 0000000..9719e9d
--- /dev/null
+++ b/src/mainboard/fujitsu/Kconfig
@@ -0,0 +1,28 @@
+##
+## This file is part of the coreboot project.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+if VENDOR_FUJITSU
+
+choice
+ prompt "Mainboard model"
+
+source "src/mainboard/fujitsu/*/Kconfig.name"
+
+endchoice
+
+source "src/mainboard/fujitsu/*/Kconfig"
+
+config MAINBOARD_VENDOR
+ string
+ default "Fujitsu"
+
+endif
diff --git a/src/mainboard/fujitsu/Kconfig.name b/src/mainboard/fujitsu/Kconfig.name
new file mode 100644
index 0000000..60d1dd9
--- /dev/null
+++ b/src/mainboard/fujitsu/Kconfig.name
@@ -0,0 +1,2 @@
+config VENDOR_FUJITSU
+ bool "Fujitsu"
diff --git a/src/mainboard/fujitsu/d3041-a1/Kconfig b/src/mainboard/fujitsu/d3041-a1/Kconfig
new file mode 100644
index 0000000..de629c3
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/Kconfig
@@ -0,0 +1,50 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2015 Damien Zammit <damien@zamaudio.com>
+# Copyright (C) 2017 Arthur Heymans <arthur@aheymans.xyz>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+if BOARD_FUJITSU_D4041_A1
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select ARCH_X86
+ select CPU_INTEL_SOCKET_LGA775
+ select NORTHBRIDGE_INTEL_X4X
+ select SOUTHBRIDGE_INTEL_I82801GX
+ select SUPERIO_WINBOND_W83627DHG
+ select HAVE_ACPI_TABLES
+ select BOARD_ROMSIZE_KB_1024
+ select PCIEXP_ASPM
+ select PCIEXP_CLK_PM
+ select PCIEXP_L1_SUB_STATE
+ select HAVE_OPTION_TABLE
+ select HAVE_CMOS_DEFAULT
+ select HAVE_ACPI_RESUME
+ select DRIVERS_I2C_CK505
+ select INTEL_GMA_HAVE_VBT
+ select MAINBOARD_HAS_LIBGFXINIT
+
+config MAINBOARD_DIR
+ string
+ default "fujitsu/d3041-a1"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "D4041-A1"
+
+config MAX_CPUS
+ int
+ default 4
+
+endif # BOARD_FUJITSU_D4041_A1
diff --git a/src/mainboard/fujitsu/d3041-a1/Kconfig.name b/src/mainboard/fujitsu/d3041-a1/Kconfig.name
new file mode 100644
index 0000000..624fca7
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_FUJITSU_D4041_A1
+ bool "D4041_A1"
diff --git a/src/mainboard/fujitsu/d3041-a1/Makefile.inc b/src/mainboard/fujitsu/d3041-a1/Makefile.inc
new file mode 100644
index 0000000..0786d6f
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/Makefile.inc
@@ -0,0 +1,4 @@
+ramstage-y += cstates.c
+romstage-y += gpio.c
+
+ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
diff --git a/src/mainboard/fujitsu/d3041-a1/acpi/ec.asl b/src/mainboard/fujitsu/d3041-a1/acpi/ec.asl
new file mode 100644
index 0000000..2997587
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/acpi/ec.asl
@@ -0,0 +1 @@
+/* dummy */
diff --git a/src/mainboard/fujitsu/d3041-a1/acpi/ich7_pci_irqs.asl b/src/mainboard/fujitsu/d3041-a1/acpi/ich7_pci_irqs.asl
new file mode 100644
index 0000000..324caab
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/acpi/ich7_pci_irqs.asl
@@ -0,0 +1,47 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Arthur Heymans <arthur@aheymans.xyz>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/*
+ * This is board specific information:
+ * IRQ routing for the 0:1e.0 PCI bridge of the ICH7
+ */
+
+If (PICM) {
+ Return (Package() {
+ /* PCI SLOT 1 */
+ Package() { 0x0005ffff, 0, 0, 0x16},
+ Package() { 0x0005ffff, 1, 0, 0x15},
+ Package() { 0x0005ffff, 2, 0, 0x13},
+ Package() { 0x0005ffff, 3, 0, 0x12},
+
+ /* PCI SLOT 2 */
+ Package() { 0x0007ffff, 0, 0, 0x15},
+ Package() { 0x0007ffff, 1, 0, 0x16},
+ Package() { 0x0007ffff, 2, 0, 0x12},
+ Package() { 0x0007ffff, 3, 0, 0x13},
+ })
+} Else {
+ Return (Package() {
+ Package() { 0x0003ffff, 0, \_SB.PCI0.LPCB.LNKG, 0},
+ Package() { 0x0003ffff, 1, \_SB.PCI0.LPCB.LNKF, 0},
+ Package() { 0x0003ffff, 2, \_SB.PCI0.LPCB.LNKD, 0},
+ Package() { 0x0003ffff, 3, \_SB.PCI0.LPCB.LNKC, 0},
+
+ Package() { 0x0004ffff, 0, \_SB.PCI0.LPCB.LNKF, 0},
+ Package() { 0x0004ffff, 1, \_SB.PCI0.LPCB.LNKG, 0},
+ Package() { 0x0004ffff, 2, \_SB.PCI0.LPCB.LNKC, 0},
+ Package() { 0x0004ffff, 3, \_SB.PCI0.LPCB.LNKD, 0},
+ })
+}
diff --git a/src/mainboard/fujitsu/d3041-a1/acpi/platform.asl b/src/mainboard/fujitsu/d3041-a1/acpi/platform.asl
new file mode 100644
index 0000000..6c92a4e
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/acpi/platform.asl
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Damien Zammit <damien@zamaudio.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Method(_PIC, 1)
+{
+ /* Remember the OS' IRQ routing choice. */
+ Store(Arg0, PICM)
+}
+
+/* SMI I/O Trap */
+Method(TRAP, 1, Serialized)
+{
+ Store (Arg0, SMIF) /* SMI Function */
+ Store (0, TRP0) /* Generate trap */
+ Return (SMIF) /* Return value of SMI handler */
+}
diff --git a/src/mainboard/fujitsu/d3041-a1/acpi/superio.asl b/src/mainboard/fujitsu/d3041-a1/acpi/superio.asl
new file mode 100644
index 0000000..0deb302
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/acpi/superio.asl
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#undef SUPERIO_DEV
+#undef SUPERIO_PNP_BASE
+#undef W83627DHG_SHOW_UARTA
+#undef W83627DHG_SHOW_UARTB
+#undef W83627DHG_SHOW_KBC
+#undef W83627DHG_SHOW_PS2M
+#undef W83627DHG_SHOW_HWMON
+#define SUPERIO_DEV SIO0
+#define SUPERIO_PNP_BASE 0x4e
+#define W83627DHG_SHOW_UARTA
+#define W83627DHG_SHOW_KBC
+#define W83627DHG_SHOW_PS2M
+#define W83627DHG_SHOW_HWMON
+#include <superio/winbond/w83627dhg/acpi/superio.asl>
diff --git a/src/mainboard/fujitsu/d3041-a1/acpi_tables.c b/src/mainboard/fujitsu/d3041-a1/acpi_tables.c
new file mode 100644
index 0000000..666bba6
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/acpi_tables.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ * Copyright (C) 2015 Damien Zammit <damien@zamaudio.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <string.h>
+#include <stdint.h>
+#include <southbridge/intel/i82801gx/nvs.h>
+
+void acpi_create_gnvs(global_nvs_t *gnvs)
+{
+ memset((void *)gnvs, 0, sizeof(*gnvs));
+
+ gnvs->pwrs = 1; /* Power state (AC = 1) */
+ gnvs->cmap = 0x01; /* Enable COM 1 port */
+}
diff --git a/src/mainboard/fujitsu/d3041-a1/board_info.txt b/src/mainboard/fujitsu/d3041-a1/board_info.txt
new file mode 100644
index 0000000..dbb8fed
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/board_info.txt
@@ -0,0 +1,7 @@
+Category: desktop
+Board URL: ftp://ftp.ts.fujitsu.com/pub/mainboard-oem-sales/products/mainboards/eol/EoL_ClassicDesktop/Datasheets/D3xxx/DS_D3041-A.pdf
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: y
+Release year: 2010
diff --git a/src/mainboard/fujitsu/d3041-a1/cmos.default b/src/mainboard/fujitsu/d3041-a1/cmos.default
new file mode 100644
index 0000000..8aa2238
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/cmos.default
@@ -0,0 +1,5 @@
+boot_option=Fallback
+debug_level=Debug
+power_on_after_fail=Disable
+nmi=Enable
+gfx_uma_size=64M
diff --git a/src/mainboard/fujitsu/d3041-a1/cmos.layout b/src/mainboard/fujitsu/d3041-a1/cmos.layout
new file mode 100644
index 0000000..387d81d
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/cmos.layout
@@ -0,0 +1,103 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2007-2008 coresystems GmbH
+## Copyright (C) 2014 Vladimir Serbinenko
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+
+# -----------------------------------------------------------------
+entries
+
+# -----------------------------------------------------------------
+# Status Register A
+# -----------------------------------------------------------------
+# Status Register B
+# -----------------------------------------------------------------
+# Status Register C
+#96 4 r 0 status_c_rsvd
+#100 1 r 0 uf_flag
+#101 1 r 0 af_flag
+#102 1 r 0 pf_flag
+#103 1 r 0 irqf_flag
+# -----------------------------------------------------------------
+# Status Register D
+#104 7 r 0 status_d_rsvd
+#111 1 r 0 valid_cmos_ram
+# -----------------------------------------------------------------
+# Diagnostic Status Register
+#112 8 r 0 diag_rsvd1
+
+# -----------------------------------------------------------------
+0 120 r 0 reserved_memory
+#120 264 r 0 unused
+
+# -----------------------------------------------------------------
+# RTC_BOOT_BYTE (coreboot hardcoded)
+384 1 e 4 boot_option
+388 4 h 0 reboot_counter
+#390 5 r 0 unused?
+
+# -----------------------------------------------------------------
+# coreboot config options: console
+395 4 e 6 debug_level
+#399 1 r 0 unused
+
+# coreboot config options: southbridge
+408 1 e 1 nmi
+409 2 e 7 power_on_after_fail
+
+# coreboot config options: cpu
+#424 8 r 0 unused
+
+# coreboot config options: northbridge
+432 4 e 11 gfx_uma_size
+#435 549 r 0 unused
+
+
+# coreboot config options: check sums
+984 16 h 0 check_sum
+
+# -----------------------------------------------------------------
+
+enumerations
+
+#ID value text
+1 0 Disable
+1 1 Enable
+2 0 Enable
+2 1 Disable
+4 0 Fallback
+4 1 Normal
+6 1 Emergency
+6 2 Alert
+6 3 Critical
+6 4 Error
+6 5 Warning
+6 6 Notice
+6 7 Info
+6 8 Debug
+6 9 Spew
+7 0 Disable
+7 1 Enable
+7 2 Keep
+11 6 64M
+11 7 128M
+11 8 256M
+11 9 96M
+11 10 160M
+11 11 224M
+11 12 352M
+
+# -----------------------------------------------------------------
+checksums
+
+checksum 392 983 984
diff --git a/src/mainboard/fujitsu/d3041-a1/cstates.c b/src/mainboard/fujitsu/d3041-a1/cstates.c
new file mode 100644
index 0000000..128f655
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/cstates.c
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 secunet Security Networks AG
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <arch/acpigen.h>
+
+int get_cst_entries(acpi_cstate_t **entries)
+{
+ return 0;
+}
diff --git a/src/mainboard/fujitsu/d3041-a1/data.vbt b/src/mainboard/fujitsu/d3041-a1/data.vbt
new file mode 100644
index 0000000..2b58f3a
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/data.vbt
Binary files differ
diff --git a/src/mainboard/fujitsu/d3041-a1/devicetree.cb b/src/mainboard/fujitsu/d3041-a1/devicetree.cb
new file mode 100644
index 0000000..6d8bb8a
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/devicetree.cb
@@ -0,0 +1,136 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2017 Arthur Heymans <arthur@aheymans.xyz>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+chip northbridge/intel/x4x # Northbridge
+ device cpu_cluster 0 on # APIC cluster
+ chip cpu/intel/socket_LGA775
+ device lapic 0 on end
+ end
+ chip cpu/intel/model_1067x # CPU
+ device lapic 0xACAC off end
+ end
+ end
+ device domain 0 on # PCI domain
+ subsystemid 0x1734 0x114c inherit
+ device pci 0.0 on end # Host Bridge
+ device pci 1.0 on end # PEG
+ device pci 2.0 on end # Integrated graphics controller
+ chip southbridge/intel/i82801gx # Southbridge
+ register "pirqa_routing" = "0x0b"
+ register "pirqb_routing" = "0x0b"
+ register "pirqc_routing" = "0x0b"
+ register "pirqd_routing" = "0x0b"
+ register "pirqe_routing" = "0x80"
+ register "pirqf_routing" = "0x80"
+ register "pirqg_routing" = "0x80"
+ register "pirqh_routing" = "0x0b"
+ # GPI routing
+ # 0 No effect (default)
+ # 1 SMI# (if corresponding ALT_GPI_SMI_EN bit is also set)
+ # 2 SCI (if corresponding GPIO_EN bit is also set)
+
+ register "ide_enable_primary" = "0x1"
+ register "sata_ahci" = "0x0" # AHCI not supported on this ICH7 variant
+ register "gpe0_en" = "0x20000040"
+
+ device pci 1b.0 on # Audio 1734:1166
+ subsystemid 0x1734 0x1166
+ end
+ device pci 1c.0 on end # PCIe 1
+ device pci 1c.1 off end # PCIe 2
+ device pci 1c.2 off end # PCIe 3
+ device pci 1c.3 on end # PCIe 4: NIC
+ device pci 1d.0 on # USB
+ subsystemid 0x1734 0x1085
+ end
+ device pci 1d.1 on # USB
+ subsystemid 0x1734 0x1085
+ end
+ device pci 1d.2 on # USB
+ subsystemid 0x1734 0x1085
+ end
+ device pci 1d.3 on # USB
+ subsystemid 0x1734 0x1085
+ end
+ device pci 1d.7 on # USB
+ subsystemid 0x1734 0x1085
+ end
+ device pci 1e.0 on end # PCI bridge
+ device pci 1e.2 off end # AC'97 Audio Controller
+ device pci 1e.3 off end # AC'97 Modem Controller
+ device pci 1f.0 on # ISA bridge
+ subsystemid 0x1734 0x1085
+ chip superio/winbond/w83627dhg
+ device pnp 4e.0 on # Floppy
+ # global
+ irq 0x2c = 0xda
+ irq 0x2d = 0x01
+ #floppy
+ io 0x60 = 0x3f0
+ irq 0x70 = 0x06
+ drq 0x74 = 0x02
+ end
+ device pnp 4e.1 off end # Parallel port
+ device pnp 4e.2 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 4e.3 off end # COM2, IR
+ device pnp 4e.5 on # Keyboard, mouse
+ io 0x60 = 0x60
+ io 0x62 = 0x64
+ irq 0x70 = 1
+ irq 0x72 = 12
+ end
+ device pnp 4e.6 off end # SPI
+ device pnp 4e.7 on end # GPIO6 (all input)
+ device pnp 4e.8 off end # WDT0#, PLED
+ device pnp 4e.9 off end # GPIO2
+ device pnp 4e.109 on # GPIO3
+ irq 0xf0 = 0xfb
+ irq 0xf1 = 0x04
+ end
+ device pnp 4e.209 on # GPIO4
+ irq 0xf4 = 0xfe
+ irq 0xf5 = 0x1
+ end
+ device pnp 4e.309 off end # GPIO5
+ device pnp 4e.a on # ACPI
+ irq 0xe4 = 0x70 # Power dram during s3
+ end
+ device pnp 4e.b on # HWM, front pannel LED
+ io 0x60 = 0x600
+ irq 0x70 = 0
+ end
+ device pnp 4e.c on # PECI, SST
+ irq 0xe0 = 0x11
+ irq 0xe1 = 0x50
+ end
+ end
+ end
+ device pci 1f.1 on end # PATA/IDE
+ device pci 1f.2 on end # SATA
+ device pci 1f.3 on # SMbus
+ subsystemid 0x1734 0x1085
+ chip drivers/i2c/ck505
+ register "mask" = "{ 0xff, 0x80 }"
+ register "regs" = "{ 0x00, 0x80 }"
+ device i2c 69 on end
+ end
+ end
+ end
+ end
+end
diff --git a/src/mainboard/fujitsu/d3041-a1/dsdt.asl b/src/mainboard/fujitsu/d3041-a1/dsdt.asl
new file mode 100644
index 0000000..4eade3d
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/dsdt.asl
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ * Copyright (C) 2015 Damien Zammit <damien@zamaudio.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <southbridge/intel/i82801gx/i82801gx.h>
+
+#include <arch/acpi.h>
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x02, // DSDT revision: ACPI v2.0 and up
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x20090419 // OEM revision
+)
+{
+ // global NVS and variables
+ #include "acpi/platform.asl"
+ #include <southbridge/intel/i82801gx/acpi/globalnvs.asl>
+
+ Scope (\_SB) {
+ Device (PCI0)
+ {
+ #include <northbridge/intel/x4x/acpi/x4x.asl>
+ #include <southbridge/intel/i82801gx/acpi/ich7.asl>
+ #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
+ }
+ }
+
+ /* Chipset specific sleep states */
+ #include <southbridge/intel/i82801gx/acpi/sleepstates.asl>
+}
diff --git a/src/mainboard/fujitsu/d3041-a1/gma-mainboard.ads b/src/mainboard/fujitsu/d3041-a1/gma-mainboard.ads
new file mode 100644
index 0000000..bd14b28
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/gma-mainboard.ads
@@ -0,0 +1,27 @@
+--
+-- This file is part of the coreboot project.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+
+with HW.GFX.GMA;
+with HW.GFX.GMA.Display_Probing;
+
+use HW.GFX.GMA;
+use HW.GFX.GMA.Display_Probing;
+
+private package GMA.Mainboard is
+
+ ports : constant Port_List :=
+ (Analog,
+ others => Disabled);
+
+end GMA.Mainboard;
diff --git a/src/mainboard/fujitsu/d3041-a1/gpio.c b/src/mainboard/fujitsu/d3041-a1/gpio.c
new file mode 100644
index 0000000..0d21e2f
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/gpio.c
@@ -0,0 +1,134 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Arthur Heymans <arthur@aheymans.xyz>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <southbridge/intel/common/gpio.h>
+
+static const struct pch_gpio_set1 pch_gpio_set1_mode = {
+ .gpio0 = GPIO_MODE_GPIO,
+ .gpio1 = GPIO_MODE_GPIO,
+ .gpio6 = GPIO_MODE_GPIO,
+ .gpio7 = GPIO_MODE_GPIO,
+ .gpio8 = GPIO_MODE_GPIO,
+ .gpio9 = GPIO_MODE_GPIO,
+ .gpio10 = GPIO_MODE_GPIO,
+ .gpio12 = GPIO_MODE_GPIO,
+ .gpio13 = GPIO_MODE_GPIO,
+ .gpio14 = GPIO_MODE_GPIO,
+ .gpio15 = GPIO_MODE_GPIO,
+ .gpio16 = 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_GPIO,
+ .gpio27 = GPIO_MODE_GPIO,
+ .gpio28 = GPIO_MODE_GPIO,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_direction = {
+ .gpio0 = GPIO_DIR_INPUT,
+ .gpio1 = GPIO_DIR_INPUT,
+ .gpio6 = GPIO_DIR_OUTPUT,
+ .gpio7 = GPIO_DIR_INPUT,
+ .gpio8 = GPIO_DIR_OUTPUT,
+ .gpio9 = GPIO_DIR_OUTPUT,
+ .gpio10 = GPIO_DIR_OUTPUT,
+ .gpio12 = GPIO_DIR_INPUT,
+ .gpio13 = GPIO_DIR_OUTPUT,
+ .gpio14 = GPIO_DIR_OUTPUT,
+ .gpio15 = GPIO_DIR_OUTPUT,
+ .gpio16 = GPIO_DIR_OUTPUT,
+ .gpio18 = GPIO_DIR_INPUT,
+ .gpio19 = GPIO_DIR_OUTPUT,
+ .gpio20 = GPIO_DIR_OUTPUT,
+ .gpio21 = GPIO_DIR_INPUT,
+ .gpio22 = GPIO_DIR_OUTPUT,
+ .gpio23 = GPIO_DIR_OUTPUT,
+ .gpio24 = GPIO_DIR_OUTPUT,
+ .gpio25 = GPIO_DIR_INPUT,
+ .gpio26 = GPIO_DIR_OUTPUT,
+ .gpio27 = GPIO_DIR_OUTPUT,
+ .gpio28 = GPIO_DIR_OUTPUT,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_level = {
+ .gpio6 = GPIO_LEVEL_HIGH,
+ .gpio8 = GPIO_LEVEL_LOW,
+ .gpio9 = GPIO_LEVEL_LOW,
+ .gpio10 = GPIO_LEVEL_LOW,
+ .gpio13 = GPIO_LEVEL_LOW,
+ .gpio14 = GPIO_LEVEL_LOW,
+ .gpio15 = GPIO_LEVEL_HIGH,
+ .gpio16 = GPIO_LEVEL_HIGH,
+ .gpio19 = GPIO_LEVEL_HIGH,
+ .gpio20 = GPIO_LEVEL_LOW,
+ .gpio22 = GPIO_LEVEL_LOW,
+ .gpio23 = GPIO_LEVEL_LOW,
+ .gpio24 = GPIO_LEVEL_LOW,
+ .gpio26 = GPIO_LEVEL_LOW,
+ .gpio27 = GPIO_LEVEL_LOW,
+ .gpio28 = GPIO_LEVEL_LOW,
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_invert = {
+};
+
+static const struct pch_gpio_set1 pch_gpio_set1_blink = {
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_mode = {
+ .gpio32 = GPIO_MODE_GPIO,
+ .gpio33 = GPIO_MODE_GPIO,
+ .gpio34 = GPIO_MODE_GPIO,
+ .gpio35 = GPIO_MODE_GPIO,
+ .gpio36 = GPIO_MODE_GPIO,
+ .gpio37 = GPIO_MODE_GPIO,
+ .gpio38 = GPIO_MODE_GPIO,
+ .gpio39 = GPIO_MODE_GPIO,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_direction = {
+ .gpio32 = GPIO_DIR_INPUT,
+ .gpio33 = GPIO_DIR_INPUT,
+ .gpio34 = GPIO_DIR_OUTPUT,
+ .gpio35 = GPIO_DIR_INPUT,
+ .gpio36 = GPIO_DIR_INPUT,
+ .gpio37 = GPIO_DIR_INPUT,
+ .gpio38 = GPIO_DIR_INPUT,
+ .gpio39 = GPIO_DIR_INPUT,
+};
+
+static const struct pch_gpio_set2 pch_gpio_set2_level = {
+ .gpio34 = GPIO_LEVEL_LOW,
+};
+
+const struct pch_gpio_map mainboard_gpio_map = {
+ .set1 = {
+ .mode = &pch_gpio_set1_mode,
+ .direction = &pch_gpio_set1_direction,
+ .level = &pch_gpio_set1_level,
+ .blink = &pch_gpio_set1_blink,
+ .invert = &pch_gpio_set1_invert,
+ },
+ .set2 = {
+ .mode = &pch_gpio_set2_mode,
+ .direction = &pch_gpio_set2_direction,
+ .level = &pch_gpio_set2_level,
+ },
+};
diff --git a/src/mainboard/fujitsu/d3041-a1/hda_verb.c b/src/mainboard/fujitsu/d3041-a1/hda_verb.c
new file mode 100644
index 0000000..9c0ae42
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/hda_verb.c
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Arthur Heymans <arthur@aheymans.xyz>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
+ /* coreboot specific header */
+ /* Eaglelake HDMI (not polulated) */
+ 0x80862803, /* Vendor ID */
+ 0x80860101, /* Subsystem ID */
+ 1, /* Number of entries */
+
+ /* Pin Widget Verb Table */
+ AZALIA_PIN_CFG(0, 0x03, 0x18560010),
+
+ /* Realtek ALC663 */
+ 0x10ec0663, /* Vendor ID */
+ 0x17341166, /* Subsystem ID */
+ 1, /* Number of entries */
+
+ /* Pin Widget Verb Table */
+ AZALIA_PIN_CFG(2, 0x11, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x12, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x13, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x14, 0x01014410),
+ AZALIA_PIN_CFG(2, 0x15, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x16, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x17, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x18, 0x01a19c20),
+ AZALIA_PIN_CFG(2, 0x19, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x1a, 0x01813c2f),
+ AZALIA_PIN_CFG(2, 0x1b, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x1d, 0x40030603),
+ AZALIA_PIN_CFG(2, 0x1e, 0x411111f0),
+ AZALIA_PIN_CFG(2, 0x21, 0x411111f0),
+};
+
+const u32 pc_beep_verbs[0] = {};
+
+const u32 pc_beep_verbs_size = ARRAY_SIZE(pc_beep_verbs);
+const u32 cim_verb_data_size = ARRAY_SIZE(cim_verb_data);
diff --git a/src/mainboard/fujitsu/d3041-a1/romstage.c b/src/mainboard/fujitsu/d3041-a1/romstage.c
new file mode 100644
index 0000000..8d2dd83
--- /dev/null
+++ b/src/mainboard/fujitsu/d3041-a1/romstage.c
@@ -0,0 +1,99 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Damien Zammit <damien@zamaudio.com>
+ * Copyright (C) 2017 Arthur Heymans <arthur@aheymans.xyz>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <console/console.h>
+#include <southbridge/intel/i82801gx/i82801gx.h>
+#include <southbridge/intel/common/gpio.h>
+#include <northbridge/intel/x4x/x4x.h>
+#include <cpu/x86/bist.h>
+#include <cpu/intel/romstage.h>
+#include <superio/winbond/w83627dhg/w83627dhg.h>
+#include <superio/winbond/common/winbond.h>
+#include <northbridge/intel/x4x/iomap.h>
+#include <device/pnp_def.h>
+
+#define SERIAL_DEV PNP_DEV(0x4e, W83627DHG_SP1)
+#define LPC_DEV PCI_DEV(0, 0x1f, 0)
+
+static void mb_lpc_setup(void)
+{
+ /* Set the value for GPIO base address register and enable GPIO. */
+ pci_write_config32(LPC_DEV, GPIO_BASE, (DEFAULT_GPIOBASE | 1));
+ pci_write_config8(LPC_DEV, GPIO_CNTL, 0x10);
+
+ setup_pch_gpios(&mainboard_gpio_map);
+
+ /* Set GPIOs on superio, enable UART */
+ pnp_enter_ext_func_mode(SERIAL_DEV);
+ pnp_set_logical_device(SERIAL_DEV);
+
+ pnp_write_config(SERIAL_DEV, 0x2c, 0xda);
+
+ pnp_exit_ext_func_mode(SERIAL_DEV);
+
+ /* Enable IOAPIC */
+ RCBA8(0x31ff) = 0x03;
+ RCBA8(0x31ff);
+
+ RCBA32(CG) = 0x00000001;
+}
+
+static void ich7_enable_lpc(void)
+{
+ pci_write_config8(LPC_DEV, SERIRQ_CNTL, 0xd0);
+ /* Fixed IO decode ranges */
+ pci_write_config16(LPC_DEV, LPC_IO_DEC, 0x0010);
+ /* LPC enable devices */
+ pci_write_config16(LPC_DEV, LPC_EN, CNF2_LPC_EN | CNF1_LPC_EN
+ | MC_LPC_EN | KBC_LPC_EN | GAMEH_LPC_EN
+ | GAMEL_LPC_EN | FDD_LPC_EN | LPT_LPC_EN
+ | COMB_LPC_EN | COMA_LPC_EN);
+ /* IO decode range: HWM on 0xa00 */
+ pci_write_config32(LPC_DEV, GEN1_DEC, 0x00fc0601);
+}
+
+void mainboard_romstage_entry(unsigned long bist)
+{
+ // ch0 ch1
+ const u8 spd_addrmap[4] = { 0x50, 0, 0x52, 0 };
+ u8 boot_path = 0;
+ u8 s3_resume;
+
+ /* Set southbridge and Super I/O GPIOs. */
+ ich7_enable_lpc();
+ mb_lpc_setup();
+ winbond_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+
+ console_init();
+
+ report_bist_failure(bist);
+ enable_smbus();
+
+ x4x_early_init();
+
+ s3_resume = southbridge_detect_s3_resume();
+ if (s3_resume)
+ boot_path = BOOT_PATH_RESUME;
+ if (MCHBAR32(PMSTS_MCHBAR) & PMSTS_WARM_RESET)
+ boot_path = BOOT_PATH_WARM_RESET;
+
+ sdram_initialize(boot_path, spd_addrmap);
+
+ x4x_late_init(s3_resume);
+
+ printk(BIOS_DEBUG, "x4x late init complete\n");
+}

To view, visit change 30906. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2eeddfde84fc93a6f285fd8c20a56ff63335a02f
Gerrit-Change-Number: 30906
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-MessageType: newchange