summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/nvddk
diff options
context:
space:
mode:
authorVenu Byravarasu <vbyravarasu@nvidia.com>2010-08-11 00:14:21 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2010-08-18 07:22:16 -0700
commitb0c9894398b13ab85da4bdba707efc68a438ddb8 (patch)
tree6fa9ed762d13e3bdd48630ff08c58ab7a96dca65 /arch/arm/mach-tegra/nvddk
parent97044f91ebed9521c666e1abcc3cf7ecca702a2a (diff)
tegra fuse: fixing fuse and AP compatibility issues
As Fuse ddk was not correctly storing SecBootDeviceConfig value, there was a mismatch between GfShell and Sysfs. These issues are fixed with this change. tested on: Whistler using GfShell and Sysfs Bug: 715134 Change-Id: Iccca2c1f9608f63938557b0ef0e88aff012bd574 Reviewed-on: http://git-master/r/4976 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/nvddk')
-rwxr-xr-xarch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c b/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c
index 8ad5d5ba930f..3d62c2fd5af1 100755
--- a/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c
+++ b/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c
@@ -101,7 +101,7 @@ typedef struct NvDdkFuseDataRec
NvU32 SecBootDeviceSelectRaw;
// Specifies the device configuration value (right aligned).
- NvU32 SecBootDeviceConfig;
+ NvU16 SecBootDeviceConfig;
// Specifies the SwReserved value.
NvU32 SwReserved;
@@ -1099,15 +1099,11 @@ NvError NvDdkFuseGet(NvDdkFuseDataType Type, void *pData, NvU32 *pSize)
case NvDdkFuseDataType_SecBootDeviceConfig:
RegData = FUSE_NV_READ32(FUSE_BOOT_DEVICE_INFO_0);
RegData = NV_DRF_VAL(FUSE,
- BOOT_DEVICE_INFO,
- BOOT_DEVICE_CONFIG,
- RegData);
-/* FixMe: Need to properly fix below code, for matching sysfs read with GfShell.
+ BOOT_DEVICE_INFO,
+ BOOT_DEVICE_CONFIG,
+ RegData);
*((NvU8 *)pData) = (RegData >> 0x8) & 0xFF;
*((NvU8 *)pData + 1) = RegData & 0xFF;
-*/
- *((NvU32 *)pData) = RegData;
-
break;
case NvDdkFuseDataType_SecBootDeviceSelect:
@@ -1295,11 +1291,17 @@ NvError NvDdkFuseSet(NvDdkFuseDataType Type, void *pData, NvU32 *pSize)
NvError e = NvSuccess; \
/* read existing fuse value */ \
e = NvDdkFuseGet(NvDdkFuseDataType_##name, p, &Size); \
- if (e != NvSuccess) \
- {\
- NvOsDebugPrintf("\r\n Err returned from Fuse Get:0x%x in Set",e); \
- goto fail; \
- }\
+ if (e != NvSuccess) \
+ { \
+ NvOsDebugPrintf("\r\n Err returned from Fuse Get:0x%x in Set",e); \
+ goto fail; \
+ } \
+ if (Type == NvDdkFuseDataType_SecBootDeviceConfig) \
+ { \
+ Data = *(NvU16 *)p; \
+ *p = (Data >> 0x8) & 0xFF; \
+ *(p + 1) = Data & 0xFF; \
+ } \
/* check consistency between existing and desired fuse values. */ \
/* fuses cannot be unburned, so desired value cannot specify */ \
/* any unburned (0x0) bits where the existing value already */ \
@@ -1325,6 +1327,7 @@ NvError NvDdkFuseSet(NvDdkFuseDataType Type, void *pData, NvU32 *pSize)
NvU32 DataSizeArrayLen;
NvDdkFuseData p_FuseData;
volatile NvU8* pDataPtr = (volatile NvU8*)pData;
+ NvU16 Data;
if(!s_pFuseRec)
{
// NV_ASSERT(0);
@@ -1392,6 +1395,13 @@ NvError NvDdkFuseSet(NvDdkFuseDataType Type, void *pData, NvU32 *pSize)
goto fail;
}
+ if (Type == NvDdkFuseDataType_SecBootDeviceConfig)
+ {
+ Data = *(NvU16 *)pData;
+ *((NvU8 *)pDataPtr) = (Data >> 0x8) & 0xFF;
+ *((NvU8 *)pDataPtr + 1) = Data & 0xFF;
+ }
+
switch (Type)
{
FUSE_SET(DeviceKey, DEVICE_KEY );