From e5663fcc81f7341a1b0fa7bd6f9904093f0a3f56 Mon Sep 17 00:00:00 2001 From: Marius Schilder Date: Tue, 17 Oct 2017 21:52:56 -0700 Subject: [PATCH] Add CONFIG_IGNORE_G_UPDATE_CHECKS In some scenarios we want to take RW updates w/o taking version numbers into consideration, much like the behavior we get w/ CR50_DEV. But then without the additional CR50_DEV features enabled for the rest of the code. BRANCH=none BUG=none TEST=compiles Change-Id: I7dd946ab77bbdc35850ed934cd53735418e13845 Reviewed-on: https://chromium-review.googlesource.com/724967 Reviewed-by: Marius Schilder Reviewed-by: Vadim Bendebury Tested-by: Marius Schilder Trybot-Ready: Marius Schilder --- chip/g/upgrade_fw.c | 7 ++++++- include/config.h | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/chip/g/upgrade_fw.c b/chip/g/upgrade_fw.c index c5c933cc90..caa5b88818 100644 --- a/chip/g/upgrade_fw.c +++ b/chip/g/upgrade_fw.c @@ -162,8 +162,13 @@ int usb_pdu_valid(struct upgrade_command *cmd_body, size_t cmd_size) return 1; } -#ifndef CR50_DEV +#ifdef CR50_DEV +#ifndef CONFIG_IGNORE_G_UPDATE_CHECKS +#define CONFIG_IGNORE_G_UPDATE_CHECKS +#endif +#endif +#ifndef CONFIG_IGNORE_G_UPDATE_CHECKS /* Compare two versions, return True if the new version is older. */ static int new_is_older(const struct SignedHeader *new, const struct SignedHeader *old) diff --git a/include/config.h b/include/config.h index 5a176670c7..7390e3d179 100644 --- a/include/config.h +++ b/include/config.h @@ -908,6 +908,11 @@ */ #undef CONFIG_UPTO_SHA512 +/* + * When enabled ignore version et al during fw upgrade for chip/g. + */ +#undef CONFIG_IGNORE_G_UPDATE_CHECKS + /*****************************************************************************/ /* * Debugging config