misc: issp: add support for force update
Anshul Jain [Thu, 25 Apr 2013 02:14:33 +0000 (19:14 -0700)]
This change adds support for the firmware to be
force updated. This flag can be used to downgrade the
firmware.

Bug 1270341

Change-Id: I2c7eee9029cce38fdb902b211fb2800071579ff9
Signed-off-by: Anshul Jain <anshulj@nvidia.com>
(cherry picked from commit 7e506cd5b9af34b0f86956193d8bd8ad910ac0b0)
(cherry picked from commit 90b6a9378c0b3050ca43f8a75b55d1e266d6c592)
Reviewed-on: http://git-master/r/246781
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/misc/issp/issp.c
include/linux/issp.h

index da357dc..05ed516 100644 (file)
@@ -111,7 +111,10 @@ static int issp_need_update(struct issp_host *host, bool *update)
                        "Version Block is protected, force upgrade!\n");
                *update = true;
        } else if (ret == 1) {
-               *update = (ver_uc < host->version_fw);
+               *update = (ver_uc < host->version_fw) ||
+                               ((ver_uc != host->version_fw) &&
+                               host->pdata->force_update);
+
                if (*update)
                        dev_info(&host->pdev->dev, "firmware needs upgrade, "\
                                "version 0x%02x -> 0x%02x\n",
index aa4e0d3..04bbe27 100644 (file)
@@ -32,6 +32,7 @@ struct issp_platform_data {
        int blocks;
        int security_size;
        int version_addr;
+       int force_update;
 };
 
 #endif