summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-04-01 15:37:49 -0700
committerCommit Bot <commit-bot@chromium.org>2021-04-05 20:50:06 +0000
commita801f6505a207ff5f0787cfb89e1810eacf4a1db (patch)
tree265e2457159844c00449990db73e03c1ae253077
parent26c5b9897f23ea07633ee3eb156b1e5928eb67b1 (diff)
downloadchrome-ec-a801f6505a207ff5f0787cfb89e1810eacf4a1db.tar.gz
crc: Don't use crc_hw.h for host tools
Currently, crc_hw.h is included when CONFIG_HW_CRC is defined. This breaks host tools which call crc32 APIs because they run on an AP (which has no 'hw_crc'). This patch avoids using crc_hw.h for host tools. BUG=none BRANCH=none TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I50f496275f4d8969950bf51e3de5cff9697e3b29 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2800717 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--include/crc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/crc.h b/include/crc.h
index b899ca965e..04a82313d8 100644
--- a/include/crc.h
+++ b/include/crc.h
@@ -8,7 +8,7 @@
/* CRC-32 implementation with USB constants */
/* Note: it's a stateful CRC-32 to match the hardware block interface */
-#ifdef CONFIG_HW_CRC
+#if defined(CONFIG_HW_CRC) && !defined(HOST_TOOLS_BUILD)
#include "crc_hw.h"
#else
@@ -53,6 +53,6 @@ void crc32_ctx_hash8(uint32_t *ctx, uint8_t val);
uint32_t crc32_ctx_result(uint32_t *ctx);
-#endif /* CONFIG_HW_CRC */
+#endif /* CONFIG_HW_CRC && !HOST_TOOLS_BUILD */
#endif /* __CROS_EC_CRC_H */