summaryrefslogtreecommitdiff
path: root/include/lib
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2017-06-09 15:17:15 -0700
committerJulius Werner <jwerner@chromium.org>2018-01-19 15:21:12 -0800
commit3429c77ab09b69eef4ed752c2d641ed724e72110 (patch)
tree5274f8e062b0828309b59d4fdc6a06be199ebc0a /include/lib
parent38ba8e9327a3911e8a24ada75346c0765ffffba1 (diff)
Add platform-independent coreboot support library
This patch adds the foundation for a platform-independent coreboot support library that can be shared by all platforms that boot BL31 from coreboot (acting as BL2). It adds code to parse the "coreboot table", a data structure that coreboot uses to communicate different kinds of information to later-stage firmware and certain OS drivers. As a first small use case for this information, allow platforms to access the serial console configuration used by coreboot, removing the need to hardcode base address and divisors and allowing Trusted Firmware to benefit from coreboot's user configuration (e.g. which UART to pick and which baud rate to use). Change-Id: I2bfb39cd2609ce6640b844ab68df6c9ae3f28e9e Signed-off-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'include/lib')
-rw-r--r--include/lib/coreboot.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/lib/coreboot.h b/include/lib/coreboot.h
new file mode 100644
index 00000000..4b1f200a
--- /dev/null
+++ b/include/lib/coreboot.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef __COREBOOT_H__
+#define __COREBOOT_H__
+
+#include <types.h>
+
+typedef struct {
+ uint32_t type; /* always 2 (memory-mapped) on ARM */
+ uint32_t baseaddr;
+ uint32_t baud;
+ uint32_t regwidth; /* in bytes, i.e. usually 4 */
+ uint32_t input_hertz;
+ uint32_t uart_pci_addr; /* unused on current ARM systems */
+} coreboot_serial_t;
+extern coreboot_serial_t coreboot_serial;
+
+void coreboot_table_setup(void *base);
+
+#endif /* __COREBOOT_H__ */