summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2015-04-16 01:31:20 -0400
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-17 01:47:34 +0000
commitf55a7e5774447dd1dcdb03ce4cc2d62f613b0eda (patch)
tree56fcbd4ed0f4700a79804c43c623f7daae118cad
parenta5b3bb0f979e7734c409d34fb3dc350d287d139d (diff)
downloadchrome-ec-f55a7e5774447dd1dcdb03ce4cc2d62f613b0eda.tar.gz
clean up x86 i/o checks
Rather than hardcode a specific mips toolchain, do a build-time test to see if the target is x86 based. BUG=chromium:443783 TEST=link still includes comm-lpc TEST=arm64 omits comm-lpc BRANCH=none Change-Id: I0253df6cbe89bee231ec643dd6bb3498eb040708 Reviewed-on: https://chromium-review.googlesource.com/265793 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
-rw-r--r--util/build.mk5
-rw-r--r--util/comm-lpc.c5
-rw-r--r--util/ectool.c3
3 files changed, 8 insertions, 5 deletions
diff --git a/util/build.mk b/util/build.mk
index 20377a46b6..f9b0f87932 100644
--- a/util/build.mk
+++ b/util/build.mk
@@ -10,10 +10,7 @@ host-util-bin=ectool lbplay stm32mon ec_sb_firmware_update lbcc
build-util-bin=ec_uartd iteflash
comm-objs=$(util-lock-objs:%=lock/%) comm-host.o comm-dev.o
-ifneq ($(HOSTCC),mipsel-cros-linux-gnu-gcc)
-comm-objs+=comm-lpc.o
-endif
-comm-objs+=comm-i2c.o
+comm-objs+=comm-lpc.o comm-i2c.o
ectool-objs=ectool.o ectool_keyscan.o misc_util.o ec_flash.o $(comm-objs)
ec_sb_firmware_update-objs=ec_sb_firmware_update.o $(comm-objs) misc_util.o
diff --git a/util/comm-lpc.c b/util/comm-lpc.c
index e7c5a25b55..54f16b3ffc 100644
--- a/util/comm-lpc.c
+++ b/util/comm-lpc.c
@@ -3,6 +3,9 @@
* found in the LICENSE file.
*/
+/* The I/O asm funcs exist only on x86. */
+#if defined(__i386__) || defined(__x86_64__)
+
#include <stdint.h>
#include <stdio.h>
#include <sys/io.h>
@@ -309,3 +312,5 @@ int comm_init_lpc(void)
ec_readmem = ec_readmem_lpc;
return 0;
}
+
+#endif
diff --git a/util/ectool.c b/util/ectool.c
index 99ad9f8f5e..d7e3cf6907 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -1186,7 +1186,8 @@ int cmd_pd_get_amode(int argc, char *argv[])
return -1;
}
-#ifdef __x86_64
+/* The I/O asm funcs exist only on x86. */
+#if defined(__i386__) || defined(__x86_64__)
#include <sys/io.h>
int cmd_serial_test(int argc, char *argv[])