[FOSS_TLK]platform: tegra: add CPC rollback support
Scott Long [Sat, 10 Jan 2015 01:09:11 +0000 (17:09 -0800)]
Modified the DT rollback protection processing to handle
a device_name="cpc" (enable Content Protection Chip-based
rollback support).

Change-Id: Ib40696861e9adc2c8aa40e81b8bfed70387cba64
Reviewed-on: http://git-master/r/715773
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>

platform/tegra/common/platform.c

index 92fe45a..01ff9b0 100644 (file)
@@ -269,12 +269,16 @@ int platform_ss_get_config(uint32_t *ss_config)
        if (strcmp(status, "okay"))
                return 0;
 
-       /* RPMB only for now */
-       if (strcmp(device_name, "sdmmc"))
-               return 0;
-
-       /* looks good so let the storage TA know rollback can be enabled */
-       *ss_config |= OTE_SS_CONFIG_RB_ENABLE;
+       /* check for rollback device */
+       if (!strcmp(device_name, "sdmmc")) {
+               *ss_config |= OTE_SS_CONFIG_RPMB_ENABLE;
+       } else if (!strcmp(device_name, "cpc")) {
+               *ss_config |= OTE_SS_CONFIG_CPC_ENABLE;
+       } else {
+               dprintf(CRITICAL, "%s: unknown device: %s\n", __func__,
+                       device_name);
+               return 1;
+       }
 
        return 0;
 }