aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/supermicro/x11-lga1151-series/bootblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/supermicro/x11-lga1151-series/bootblock.c')
-rw-r--r--src/mainboard/supermicro/x11-lga1151-series/bootblock.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/mainboard/supermicro/x11-lga1151-series/bootblock.c b/src/mainboard/supermicro/x11-lga1151-series/bootblock.c
new file mode 100644
index 0000000000..27653f5ae0
--- /dev/null
+++ b/src/mainboard/supermicro/x11-lga1151-series/bootblock.c
@@ -0,0 +1,48 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <bootblock_common.h>
+#include <soc/gpio.h>
+#include <variant/gpio.h>
+#include <superio/aspeed/common/aspeed.h>
+#include <superio/aspeed/ast2400/ast2400.h>
+#include <delay.h>
+#include <console/uart.h>
+
+static void early_config_gpio(void)
+{
+ /* This is a hack for FSP because it does things in MemoryInit()
+ * which it shouldn't do. We have to prepare certain gpios here
+ * because of the brokenness in FSP. */
+ gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table));
+}
+
+static void early_config_superio(void)
+{
+ const pnp_devfn_t serial_dev = PNP_DEV(0x2e, AST2400_SUART1);
+ if (CONFIG(CONSOLE_SERIAL)) {
+ aspeed_enable_serial(serial_dev, CONFIG_TTYS0_BASE);
+ /* The serial output is garbeled before this timeout.
+ * FIXME: Find out why and remove delay.
+ */
+ mdelay(1000);
+ }
+}
+
+void bootblock_mainboard_early_init(void)
+{
+ early_config_gpio();
+ early_config_superio();
+}