From 90989b321091a3b7828628304c7cf4bffcc7aed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Thu, 7 Apr 2022 15:16:46 +0200 Subject: mainboard/msi/ms7d25: Add early support for MSI PRO Z690-A DDR4 WIFI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial mainboard code MSI PRO Z690-A DDR4 WIFI. The platform boots up up to romstage where it returns from FSP memory init with an error. What works: - open-source CAR setup - NCT6687D serial port with TX pin exposed on JBD1 header - SMBus reading SPD from all 4 DIMMs This board will serve as a reference board for enabling Alder Lake-S support in coreboot. More code and functionalities will be added in subsequent patches as src/soc/alderlake code will be improved for PCH-S. TEST=Extract the microcode from vendor firmware and include it in the build. The platform should print the console on the serial port even without FSP blob. Signed-off-by: Michał Żygowski Change-Id: I5df69822dbb3ff79e087408a0693de37df2142e8 Signed-off-by: Igor Bagnucki Signed-off-by: Michał Kopeć Reviewed-on: https://review.coreboot.org/c/coreboot/+/63463 Tested-by: build bot (Jenkins) Reviewed-by: Krystian Hebel --- src/mainboard/msi/ms7d25/Kconfig | 45 ++++++++++++++++++++++++++ src/mainboard/msi/ms7d25/Kconfig.name | 2 ++ src/mainboard/msi/ms7d25/Makefile.inc | 7 ++++ src/mainboard/msi/ms7d25/board_info.txt | 7 ++++ src/mainboard/msi/ms7d25/bootblock.c | 36 +++++++++++++++++++++ src/mainboard/msi/ms7d25/devicetree.cb | 28 ++++++++++++++++ src/mainboard/msi/ms7d25/dsdt.asl | 28 ++++++++++++++++ src/mainboard/msi/ms7d25/hda_verb.c | 37 +++++++++++++++++++++ src/mainboard/msi/ms7d25/mainboard.c | 18 +++++++++++ src/mainboard/msi/ms7d25/romstage_fsp_params.c | 44 +++++++++++++++++++++++++ 10 files changed, 252 insertions(+) create mode 100644 src/mainboard/msi/ms7d25/Kconfig create mode 100644 src/mainboard/msi/ms7d25/Kconfig.name create mode 100644 src/mainboard/msi/ms7d25/Makefile.inc create mode 100644 src/mainboard/msi/ms7d25/board_info.txt create mode 100644 src/mainboard/msi/ms7d25/bootblock.c create mode 100644 src/mainboard/msi/ms7d25/devicetree.cb create mode 100644 src/mainboard/msi/ms7d25/dsdt.asl create mode 100644 src/mainboard/msi/ms7d25/hda_verb.c create mode 100644 src/mainboard/msi/ms7d25/mainboard.c create mode 100644 src/mainboard/msi/ms7d25/romstage_fsp_params.c (limited to 'src/mainboard') diff --git a/src/mainboard/msi/ms7d25/Kconfig b/src/mainboard/msi/ms7d25/Kconfig new file mode 100644 index 0000000000..eb07413be2 --- /dev/null +++ b/src/mainboard/msi/ms7d25/Kconfig @@ -0,0 +1,45 @@ +config BOARD_MSI_Z690_A_PRO_WIFI_DDR4 + select BOARD_MSI_MS7D25 + +config BOARD_MSI_MS7D25 + def_bool n + select SOC_INTEL_ALDERLAKE_PCH_S + select BOARD_ROMSIZE_KB_32768 + select SOC_INTEL_COMMON_BLOCK_HDA_VERB + select SUPERIO_NUVOTON_NCT6687D + select DRIVERS_UART_8250IO + select HAVE_ACPI_RESUME + select HAVE_ACPI_TABLES + +if BOARD_MSI_MS7D25 + +config MAINBOARD_DIR + default "msi/ms7d25" + +config MAINBOARD_PART_NUMBER + default "PRO Z690-A WIFI DDR4(MS-7D25)" if BOARD_MSI_Z690_A_PRO_WIFI_DDR4 + +config MAINBOARD_VENDOR + string + default "Micro-Star International Co., Ltd." + +config DIMM_SPD_SIZE + default 512 + +config UART_FOR_CONSOLE + int + default 0 + +config USE_PM_ACPI_TIMER + bool + default n + +config USE_LEGACY_8254_TIMER + bool + default n + +config CBFS_SIZE + hex + default 0x1000000 + +endif diff --git a/src/mainboard/msi/ms7d25/Kconfig.name b/src/mainboard/msi/ms7d25/Kconfig.name new file mode 100644 index 0000000000..05a8ceee9d --- /dev/null +++ b/src/mainboard/msi/ms7d25/Kconfig.name @@ -0,0 +1,2 @@ +config BOARD_MSI_Z690_A_PRO_WIFI_DDR4 + bool "PRO Z690-A WIFI DDR4" diff --git a/src/mainboard/msi/ms7d25/Makefile.inc b/src/mainboard/msi/ms7d25/Makefile.inc new file mode 100644 index 0000000000..2e6759f093 --- /dev/null +++ b/src/mainboard/msi/ms7d25/Makefile.inc @@ -0,0 +1,7 @@ +## SPDX-License-Identifier: GPL-2.0-only + +bootblock-y += bootblock.c + +romstage-y += romstage_fsp_params.c + +ramstage-y += mainboard.c diff --git a/src/mainboard/msi/ms7d25/board_info.txt b/src/mainboard/msi/ms7d25/board_info.txt new file mode 100644 index 0000000000..2058be99a7 --- /dev/null +++ b/src/mainboard/msi/ms7d25/board_info.txt @@ -0,0 +1,7 @@ +Category: desktop +Board URL: https://www.msi.com/Motherboard/PRO-Z690-A-WIFI-DDR4 +ROM IC: MX25U25673G +ROM package: WSON-8 +ROM socketed: no +Flashrom support: yes +Release year: 2021 diff --git a/src/mainboard/msi/ms7d25/bootblock.c b/src/mainboard/msi/ms7d25/bootblock.c new file mode 100644 index 0000000000..cbadfb59c6 --- /dev/null +++ b/src/mainboard/msi/ms7d25/bootblock.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +#define SERIAL_DEV PNP_DEV(0x4e, NCT6687D_SP1) + +void bootblock_mainboard_early_init(void) +{ + /* Replicate vendor settings for multi-function pins in global config LDN */ + nuvoton_pnp_enter_conf_state(SERIAL_DEV); + pnp_write_config(SERIAL_DEV, 0x15, 0xaa); + pnp_write_config(SERIAL_DEV, 0x1a, 0x02); + pnp_write_config(SERIAL_DEV, 0x1b, 0x02); + pnp_write_config(SERIAL_DEV, 0x1d, 0x00); + pnp_write_config(SERIAL_DEV, 0x1e, 0xaa); + pnp_write_config(SERIAL_DEV, 0x1f, 0xb2); + pnp_write_config(SERIAL_DEV, 0x22, 0xbd); + pnp_write_config(SERIAL_DEV, 0x23, 0xdf); + pnp_write_config(SERIAL_DEV, 0x24, 0x39); + pnp_write_config(SERIAL_DEV, 0x25, 0xfe); + pnp_write_config(SERIAL_DEV, 0x26, 0x40); + pnp_write_config(SERIAL_DEV, 0x27, 0x77); + pnp_write_config(SERIAL_DEV, 0x28, 0x00); + pnp_write_config(SERIAL_DEV, 0x29, 0xfb); + pnp_write_config(SERIAL_DEV, 0x2a, 0x80); + pnp_write_config(SERIAL_DEV, 0x2b, 0x20); + pnp_write_config(SERIAL_DEV, 0x2c, 0x8a); + pnp_write_config(SERIAL_DEV, 0x2d, 0xaa); + nuvoton_pnp_exit_conf_state(SERIAL_DEV); + + if (CONFIG(CONSOLE_SERIAL)) + nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); +} diff --git a/src/mainboard/msi/ms7d25/devicetree.cb b/src/mainboard/msi/ms7d25/devicetree.cb new file mode 100644 index 0000000000..dccaa253ae --- /dev/null +++ b/src/mainboard/msi/ms7d25/devicetree.cb @@ -0,0 +1,28 @@ +chip soc/intel/alderlake + device domain 0 on + device ref igpu on end + device ref crashlog off end + device ref xhci on end + device ref heci1 on end + device ref heci2 off end + device ref ide_r off end + device ref kt off end + device ref heci3 off end + device ref heci4 off end + device ref sata on end + device ref pcie_rp1 on end + device ref pcie_rp2 on end + device ref pcie_rp3 on end + device ref pcie_rp4 on end + device ref pcie_rp5 on end + device ref pcie_rp6 on end + device ref pcie_rp7 on end + device ref pcie_rp8 on end + device ref pcie_rp9 on end + device ref pcie_rp10 on end + device ref pcie_rp11 on end + device ref p2sb on end + device ref hda on end + device ref smbus on end + end +end diff --git a/src/mainboard/msi/ms7d25/dsdt.asl b/src/mainboard/msi/ms7d25/dsdt.asl new file mode 100644 index 0000000000..9e4ce01513 --- /dev/null +++ b/src/mainboard/msi/ms7d25/dsdt.asl @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +DefinitionBlock( + "dsdt.aml", + "DSDT", + ACPI_DSDT_REV_2, + OEM_ID, + ACPI_TABLE_CREATOR, + 0x20110725 +) +{ + #include + #include + + /* global NVS and variables */ + #include + + #include + + Device (\_SB.PCI0) { + #include + #include + } + + #include +} diff --git a/src/mainboard/msi/ms7d25/hda_verb.c b/src/mainboard/msi/ms7d25/hda_verb.c new file mode 100644 index 0000000000..3ce5591f65 --- /dev/null +++ b/src/mainboard/msi/ms7d25/hda_verb.c @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +const u32 cim_verb_data[] = { + /* Realtek ALC897 */ + 0x10ec0897, /* Vendor ID */ + 0x14629d25, /* Subsystem ID */ + 15, /* Number of entries */ + AZALIA_SUBVENDOR(0, 0x14629d25), + AZALIA_PIN_CFG(0, 0x11, 0x4037d540), + AZALIA_PIN_CFG(0, 0x12, 0x411111f0), + AZALIA_PIN_CFG(0, 0x14, 0x01014010), + AZALIA_PIN_CFG(0, 0x15, 0x01011012), + AZALIA_PIN_CFG(0, 0x16, 0x01016011), + AZALIA_PIN_CFG(0, 0x17, 0x01012014), + AZALIA_PIN_CFG(0, 0x18, 0x01a19030), + AZALIA_PIN_CFG(0, 0x19, 0x02a19040), + AZALIA_PIN_CFG(0, 0x1a, 0x0181303f), + AZALIA_PIN_CFG(0, 0x1b, 0x02214020), + AZALIA_PIN_CFG(0, 0x1c, 0x411111f0), + AZALIA_PIN_CFG(0, 0x1d, 0x402af66b), + AZALIA_PIN_CFG(0, 0x1e, 0x411111f0), + AZALIA_PIN_CFG(0, 0x1f, 0x411111f0), + + /* Alderlake HDMI */ + 0x80862815, /* Vendor ID */ + 0x80860101, /* Subsystem ID */ + 2, /* Number of entries */ + AZALIA_SUBVENDOR(2, 0x80860101), + AZALIA_PIN_CFG(2, 0x04, 0x18560010), +}; + + +const u32 pc_beep_verbs[] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/msi/ms7d25/mainboard.c b/src/mainboard/msi/ms7d25/mainboard.c new file mode 100644 index 0000000000..ac6b252323 --- /dev/null +++ b/src/mainboard/msi/ms7d25/mainboard.c @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +static void mainboard_init(void *chip_info) +{ + +} + +static void mainboard_enable(struct device *dev) +{ + +} + +struct chip_operations mainboard_ops = { + .init = mainboard_init, + .enable_dev = mainboard_enable, +}; diff --git a/src/mainboard/msi/ms7d25/romstage_fsp_params.c b/src/mainboard/msi/ms7d25/romstage_fsp_params.c new file mode 100644 index 0000000000..210af0576c --- /dev/null +++ b/src/mainboard/msi/ms7d25/romstage_fsp_params.c @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include + +static const struct mb_cfg ddr4_mem_config = { + .type = MEM_TYPE_DDR4, + + .rcomp = { + /* Baseboard uses only 100ohm Rcomp resistor FIXME */ + .resistor = 100, + + /* Baseboard Rcomp target values FIXME */ + .targets = { 50, 20, 25, 25, 25 }, + }, + + .UserBd = BOARD_TYPE_DESKTOP_2DPC, /* FIXME */ + + .ddr_config = { + .dq_pins_interleaved = false, /* FIXME */ + }, +}; + +static const struct mem_spd dimm_module_spd_info = { + .topo = MEM_TOPO_DIMM_MODULE, + .smbus = { + [0] = { + .addr_dimm[0] = 0x50, + .addr_dimm[1] = 0x51, + }, + [1] = { + .addr_dimm[0] = 0x52, + .addr_dimm[1] = 0x53, + }, + }, +}; + +void mainboard_memory_init_params(FSPM_UPD *memupd) +{ + memcfg_init(memupd, &ddr4_mem_config, &dimm_module_spd_info, false); +} -- cgit v1.2.3