add lpc mapping interface and stubs
Add an lpc mapping interface to allow for multiple mapping
implementations, such as one for Aspeed and one for Nuvoton.
Add empty implementations for Aspeed and Nuvoton.
Add configuration options to enable aspeed or nuvoton lpc.
Change-Id: I3fd2b1e437db6366c7656f294d138224c25d4e81
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/configure.ac b/configure.ac
index b7b972e..0dd8799 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,27 @@
AX_APPEND_COMPILE_FLAGS([-DENABLE_LPC_BRIDGE], [CXXFLAGS])
])
+AC_ARG_ENABLE([aspeed-lpc],
+ AS_HELP_STRING([--enable-aspeed-lpc],
+ [Enable external transfers using Aspeed LPC]))
+AS_IF([test "x$enable_aspeed_lpc" = "xyes"], [
+ AC_CHECK_HEADER(linux/aspeed-lpc-ctrl.h,
+ [HAVE_UAPI_LINUX_LPC_CTRL_H=""],
+ [HAVE_UAPI_LINUX_LPC_CTRL_H="-I linux/aspeed-lpc-ctrl.h"])
+ AS_IF([test "$HAVE_UAPI_LINUX_LPC_CTRL_H" != ""],
+ AC_MSG_WARN([Could not find linux/aspeed-lpc-ctrl.h: Attempting to download locally for building from openbmc/linux/+dev-4.18])
+ AC_SUBST([BT_BMC_DL],
+ [`mkdir -p linux;wget https://raw.githubusercontent.com/openbmc/linux/dev-4.18/include/uapi/linux/aspeed-lpc-ctrl.h -O linux/aspeed-lpc-ctrl.h`])
+ )
+ AX_APPEND_COMPILE_FLAGS([-DASPEED_LPC], [CXXFLAGS])
+])
+AC_ARG_ENABLE([nuvoton-lpc],
+ AS_HELP_STRING([--enable-nuvoton-lpc],
+ [Enable external transfers using Nuvoton LPC SHM]))
+AS_IF([test "x$enable_nuvoton_lpc" = "xyes"], [
+ AX_APPEND_COMPILE_FLAGS([-DNUVOTON_LPC], [CXXFLAGS])
+])
+
# Check/set gtest specific functions.
PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])])
PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])])
@@ -85,7 +106,6 @@
AS_IF([test "x$STATIC_HANDLER_STAGED_NAME" == "x"], [STATIC_HANDLER_STAGED_NAME="/run/initramfs/bmc-image"])
AC_DEFINE_UNQUOTED([STATIC_HANDLER_STAGED_NAME], ["$STATIC_HANDLER_STAGED_NAME"], [The file to use for staging the firmware update.])
-
# Create configured output
AC_CONFIG_FILES([Makefile test/Makefile])
AC_OUTPUT