mb/siemens/chili: Add new mainboard

The Chili base board is a ruggedized laptop with additional industrial
interfaces. So far, only booting and basic interfaces (USB, UART,
Video) are working with the original model, the "base" variant.
No further development is planned for this variant, as our primary
target was another one that will be added in a follow-up.

Change-Id: I1d3508b615ec877edc8db756e9ad38132b37219c
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Felix Singer <felix.singer@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39976
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/src/mainboard/siemens/chili/romstage.c b/src/mainboard/siemens/chili/romstage.c
new file mode 100644
index 0000000..9c941c2
--- /dev/null
+++ b/src/mainboard/siemens/chili/romstage.c
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <option.h>
+#include <soc/cnl_memcfg_init.h>
+#include <soc/gpio.h>
+#include <soc/romstage.h>
+
+#include "variant.h"
+
+static void mainboard_init(void)
+{
+	const struct pad_config *pads;
+	size_t num;
+
+	pads = variant_gpio_table(&num);
+	gpio_configure_pads(pads, num);
+}
+
+void mainboard_memory_init_params(FSPM_UPD *memupd)
+{
+	uint8_t vtd = 1;
+	const struct cnl_mb_cfg cfg = {
+		.spd = {
+			[0] = { READ_SMBUS, { 0x50 << 1 } },
+			[2] = { READ_SMBUS, { 0x52 << 1 } },
+		},
+		.rcomp_resistor = { 121, 75, 100 },
+		.rcomp_targets = { 50, 25, 20, 20, 26 },
+		.dq_pins_interleaved = 1,
+		.vref_ca_config = 2,
+		.ect = 0,
+	};
+	cannonlake_memcfg_init(&memupd->FspmConfig, &cfg);
+	memupd->FspmConfig.EccSupport = 1;
+	memupd->FspmConfig.UserBd = BOARD_TYPE_MOBILE;
+
+	get_option(&vtd, "vtd");
+	memupd->FspmTestConfig.VtdDisable = !vtd;
+	get_option(&memupd->FspmConfig.HyperThreading, "hyper_threading");
+
+	mainboard_init();
+}