[FOSS_TLK]platform: tegra: more fuse handling changes
Scott Long [Wed, 3 Dec 2014 00:32:33 +0000 (16:32 -0800)]
The new rollback protection scheme no longer requires
TLK to be involved in detecting whether the rollback
key should be programmed so that support can be removed.

Also modified the SS_GET_CONFIG call handling accordingly.

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

platform/tegra/common/fuse.c
platform/tegra/common/platform.c
platform/tegra/include/platform/platform_fuse.h
platform/tegra/include/platform/tegra4/fuse_ext.h

index 17f0c65..35c413a 100644 (file)
@@ -47,21 +47,8 @@ void platform_fuse_init(void)
        if (fuse_data & (1 << ODM_PROD_START_BIT))
                fuse_values[FUSE_ID_ODM_PROD] = true;
 
-       /* save rollback protection enable fuse value */
-       fuse_data = fuse_read(RB_ENABLE_ADDR);
-       if (fuse_data & (1 << RB_ENABLE_START_BIT))
-               fuse_values[FUSE_ID_RB_ENABLE] = true;
-
-       /* save rollback protection key programmed fuse value */
-       fuse_data = fuse_read(RB_KEY_PROGRAMMED_ADDR);
-       if (fuse_data & (1 << RB_KEY_PROGRAMMED_START_BIT))
-               fuse_values[FUSE_ID_RB_KEY_PROGRAMMED] = true;
-
-       dprintf(INFO, "%s: odm_prod %d rpb_en %d rpb_key_prgrm %d\n",
-               __func__,
-               fuse_values[FUSE_ID_ODM_PROD],
-               fuse_values[FUSE_ID_RB_ENABLE],
-               fuse_values[FUSE_ID_RB_KEY_PROGRAMMED]);
+       dprintf(INFO, "%s: odm_prod %d\n",
+               __func__, fuse_values[FUSE_ID_ODM_PROD]);
 
        /* move fuses back to invisible if necessary */
        if (made_visible)
index fa9095a..c2c687a 100644 (file)
@@ -232,17 +232,10 @@ int platform_ss_get_config(uint32_t *ss_config)
        *ss_config = 0;
 
        /*
-        * If we're on an ODM production unit, then return bits
-        * indicating if rollback protection should be enabled and
-        * if so, should key provisioning be performed.
+        * If we're on an ODM production unit then enable rollback.
         */
        if (platform_fuse_get(FUSE_ID_ODM_PROD)) {
-               if (platform_fuse_get(FUSE_ID_RB_ENABLE)) {
-                       *ss_config |= OTE_SS_CONFIG_RB_ENABLE;
-                       if (!platform_fuse_get(FUSE_ID_RB_KEY_PROGRAMMED)) {
-                               *ss_config |= OTE_SS_CONFIG_RB_PROGRAM_KEY;
-                       }
-               }
+               *ss_config |= OTE_SS_CONFIG_RB_ENABLE;
        }
 
        return 0;
index f5d41f9..e2c30ef 100644 (file)
 
 /*
  * ODM_PROD          -> ODM production fuse set
- * RB_ENABLE         -> enable rollback protection feature
- * RB_KEY_PROGRAMMED -> rollback protection key has been programmed
  */
 enum fuse_ids {
        FUSE_ID_ODM_PROD,
-       FUSE_ID_RB_ENABLE,
-       FUSE_ID_RB_KEY_PROGRAMMED,
        FUSE_ID_MAX
 };
 
index 84387d6..3f8b469 100644 (file)
 #define ODM_PROD_ADDR                  (0x0)
 #define ODM_PROD_START_BIT             (11)
 
-#define ODM_RESERVED0_ADDR             (0x2E)
-#define ODM_RESERVED0_START_BIT                (5)
-
 #elif defined(TARGET_T210) || defined(TARGET_T186)
 
 #define ODM_PROD_ADDR                  (0x0)
 #define ODM_PROD_START_BIT             (11)
 
-#define ODM_RESERVED0_ADDR             (0x2E)
-#define ODM_RESERVED0_START_BIT                (17)
-
 #else
 
 #error unknown architecture
 
 #endif
 
-/*
- * The rollback protection fuses are in the ODM reserved fuse range.
- * ODM reserved fuses are 256bits wide.  To calculate the location of
- * a given fuse we need to determine its offset from ODM_RESERVED0's
- * address/start bit.
- *
- * Note that ODM reserved addresses increment by 2 (so if ODM_RESERVED0
- * is 0x2e then ODM_RESERVED1 is 0x30, etc).
- */
-
-/* calculate ODM_RESERVED1[13:12] bit offset from start of reserved block */
-#define RB_ENABLE_BIT                  (ODM_RESERVED0_START_BIT + 32 + 12)
-#define RB_KEY_PROGRAMMED_BIT          (ODM_RESERVED0_START_BIT + 32 + 13)
-
-/* given bit offset from start of reserved block get address */
-#define GET_ADDR(b)                    (ODM_RESERVED0_ADDR + (((b) / 32) * 2))
-
-/* given bit offset from start of reserved block get addr-relative start bit */
-#define GET_START_BIT(b)               ((b) % 32)
-
-/* get fuse-specific address/start bit */
-#define RB_ENABLE_ADDR                 GET_ADDR(RB_ENABLE_BIT)
-#define RB_ENABLE_START_BIT            GET_START_BIT(RB_ENABLE_BIT)
-
-#define RB_KEY_PROGRAMMED_ADDR         GET_ADDR(RB_KEY_PROGRAMMED_BIT)
-#define RB_KEY_PROGRAMMED_START_BIT    GET_START_BIT(RB_KEY_PROGRAMMED_BIT)
-
 /* platform-dependent routines */
 bool fuse_make_visible(void);
 void fuse_make_invisible(void);