aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/psp_verstage/include/arch/io.h
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2020-05-28 00:44:50 -0600
committerMartin Roth <martinroth@google.com>2020-07-08 19:34:59 +0000
commitc7acf1666a517f0fcfec3a5f64791932ca145c45 (patch)
tree8f2e6c0539a028ee3f2e27e5c80fe613678e7444 /src/soc/amd/picasso/psp_verstage/include/arch/io.h
parentac41f582351dc2c6aaaf0c1ef662e6d99b67b4ce (diff)
soc/amd/picasso: add psp_verstage
This is the main code for building coreboot's verstage as a userspace application to run on the PSP. It does a minimal setup of hardware, then runs verstage_main. It uses hardware hashing to increase the speed and will directly reboot into recovery mode if there are any failures. BUG=b:158124527 TEST=Build & boot trembyle Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: Ia58839caa5bfbae0408702ee8d02ef482f2861c4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/41816 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/picasso/psp_verstage/include/arch/io.h')
-rw-r--r--src/soc/amd/picasso/psp_verstage/include/arch/io.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/psp_verstage/include/arch/io.h b/src/soc/amd/picasso/psp_verstage/include/arch/io.h
new file mode 100644
index 0000000000..efa128b25c
--- /dev/null
+++ b/src/soc/amd/picasso/psp_verstage/include/arch/io.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ARCH_IO_H__
+#define __ARCH_IO_H__
+
+#include <stdint.h>
+
+u8 io_read8(u16 reg);
+void io_write8(u16 reg, u8 value);
+
+static inline void outb(uint8_t value, uint16_t port)
+{
+ io_write8(port, value);
+}
+
+static inline uint8_t inb(uint16_t port)
+{
+ return io_read8(port);
+}
+
+#endif