summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathon Hall <jonathon.hall@puri.sm>2022-10-18 16:33:27 -0400
committerFelix Held <felix-coreboot@felixheld.de>2022-10-20 14:50:15 +0000
commitaeb8b3d4d641565ed8e92efced509483be9cdfab (patch)
tree3a21b303ed695251fae569e3e5194265ca50f5f9
parentf5575315fd628131adf1c237fd4a99996abfae59 (diff)
purism/librem_cnl: Add Kconfig to enable Mini UART
Librem Mini has a UART (accessible with soldering), which is very useful for work on coreboot. It can be used for coreboot/SeaBIOS/Linux boot logs, or as a general purpose UART. Change-Id: I38ad5f19da6af5ed286ad3583f34b824a3660916 Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm> Reviewed-on: https://review.coreboot.org/c/coreboot/+/68551 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/mainboard/purism/librem_cnl/Kconfig16
-rw-r--r--src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc1
-rw-r--r--src/mainboard/purism/librem_cnl/variants/librem_mini/com_init.c13
3 files changed, 30 insertions, 0 deletions
diff --git a/src/mainboard/purism/librem_cnl/Kconfig b/src/mainboard/purism/librem_cnl/Kconfig
index 39b0883a53..f0fd6a85f0 100644
--- a/src/mainboard/purism/librem_cnl/Kconfig
+++ b/src/mainboard/purism/librem_cnl/Kconfig
@@ -60,3 +60,19 @@ config NO_POST
default y
endif
+
+config ENABLE_EC_UART1
+ bool "Enable EC UART1"
+ depends on BOARD_PURISM_LIBREM_MINI || BOARD_PURISM_LIBREM_MINI_V2
+ default n
+ select DRIVERS_UART_8250IO
+ help
+ Enable UART1 on the EC.
+
+ This UART can be used for boot logging by coreboot, SeaBIOS, or
+ Linux. It also works as a general-purpose UART.
+
+ Soldering is required to access these signals. Locate the pads for
+ U81 on the bottom of the board near the front edge; the IC is not
+ populated. TX is pin 14, RX is pin 19. The signals are 3.3V (do NOT
+ connect directly to an RS-232 serial port).
diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc b/src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc
index 20ff43819f..59020ef001 100644
--- a/src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc
+++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/Makefile.inc
@@ -2,3 +2,4 @@
all-y += die.c
smm-y += die.c
+bootblock-$(CONFIG_ENABLE_EC_UART1) += com_init.c
diff --git a/src/mainboard/purism/librem_cnl/variants/librem_mini/com_init.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/com_init.c
new file mode 100644
index 0000000000..6d0f79f843
--- /dev/null
+++ b/src/mainboard/purism/librem_cnl/variants/librem_mini/com_init.c
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <bootblock_common.h>
+#include <device/pnp_ops.h>
+
+#define SERIAL_DEV PNP_DEV(0x6E, 1) /* ITE8528 UART1 */
+
+void bootblock_mainboard_early_init(void)
+{
+ /* Enable the serial port inside the EC */
+ pnp_set_logical_device(SERIAL_DEV);
+ pnp_set_enable(SERIAL_DEV, 1);
+}