summaryrefslogtreecommitdiff
path: root/include/lib
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2018-01-24 14:31:53 +0000
committerGitHub <noreply@github.com>2018-01-24 14:31:53 +0000
commit040f1e6987ab78ce459a96137a92cb985c16a136 (patch)
tree4ac8cf8073f03180de5b04373302518727a03490 /include/lib
parentd2184052ec9f7055e666885d2e9f1c563bdd8d93 (diff)
parent1c5f5031f38ed77688298d419727a6f0930e0673 (diff)
Merge pull request #1193 from jwerner-chromium/JW_coreboot
New console API and coreboot support [v4]
Diffstat (limited to 'include/lib')
-rw-r--r--include/lib/coreboot.h24
-rw-r--r--include/lib/utils_def.h9
2 files changed, 32 insertions, 1 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__ */
diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h
index 185a1c12..bda3b073 100644
--- a/include/lib/utils_def.h
+++ b/include/lib/utils_def.h
@@ -16,7 +16,7 @@
#define SIZE_FROM_LOG2_WORDS(n) (4 << (n))
-#define BIT(nr) (1ULL << (nr))
+#define BIT(nr) (ULL(1) << (nr))
/*
* This variant of div_round_up can be used in macro definition but should not
@@ -84,6 +84,13 @@
# define ULL(_x) (_x##ull)
#endif
+/* Register size of the current architecture. */
+#ifdef AARCH32
+#define REGSZ U(4)
+#else
+#define REGSZ U(8)
+#endif
+
/*
* Test for the current architecture version to be at least the version
* expected.