0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// Display contents of the card registers
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#include "sddisplayinfo.h"
|
|
19 |
|
|
20 |
/*
|
|
21 |
Class constructor
|
|
22 |
|
|
23 |
@param None
|
|
24 |
@return None
|
|
25 |
*/
|
|
26 |
CBaseTestSDDisplayInfo::CBaseTestSDDisplayInfo()
|
|
27 |
{
|
|
28 |
SetTestStepName(KTestStepDisplayInfo);
|
|
29 |
}
|
|
30 |
|
|
31 |
/*
|
|
32 |
Test Step Preamble
|
|
33 |
- Load device driver for direct disk access
|
|
34 |
|
|
35 |
@param None
|
|
36 |
@return EPass if successful or EFail if not
|
|
37 |
@see TVerdict
|
|
38 |
*/
|
|
39 |
TVerdict CBaseTestSDDisplayInfo::doTestStepPreambleL()
|
|
40 |
{
|
|
41 |
SetTestStepResult(EFail);
|
|
42 |
|
|
43 |
if (!InitDeviceDriver())
|
|
44 |
return TestStepResult();
|
|
45 |
|
|
46 |
SetTestStepResult(EPass);
|
|
47 |
return TestStepResult();
|
|
48 |
}
|
|
49 |
|
|
50 |
/**
|
|
51 |
Extract a value out of a 128-bit block (little-endian)
|
|
52 |
|
|
53 |
@param aArrayPtr Pointer to an array of 16x 8-bit values
|
|
54 |
@param aStart Position of the first bit
|
|
55 |
@param aEnd Position of the last bit
|
|
56 |
|
|
57 |
@return The value requested
|
|
58 |
*/
|
|
59 |
TUint32 CBaseTestSDDisplayInfo::Slice128(TUint8* aArrayPtr, TInt aStart, TInt aEnd)
|
|
60 |
{
|
|
61 |
TInt retval = 0;
|
|
62 |
for (TInt i = aStart; i >= aEnd; i--)
|
|
63 |
{
|
|
64 |
retval = retval << 1;
|
|
65 |
retval += ((*(aArrayPtr + i / 8)) & (1 << (i % 8))) >> (i % 8);
|
|
66 |
}
|
|
67 |
return retval;
|
|
68 |
}
|
|
69 |
|
|
70 |
/*
|
|
71 |
Test step
|
|
72 |
|
|
73 |
@param None
|
|
74 |
@return EPass if successful or EFail if not
|
|
75 |
@see TVerdict
|
|
76 |
*/
|
|
77 |
TVerdict CBaseTestSDDisplayInfo::doTestStepL()
|
|
78 |
{
|
|
79 |
if (TestStepResult() == EPass)
|
|
80 |
{
|
|
81 |
INFO_PRINTF1(_L("Display contents of card registers"));
|
|
82 |
INFO_PRINTF1(_L("++CID"));
|
|
83 |
INFO_PRINTF2(_L("--CID/MID: %02xh"), Slice128(iCardInfo.iCID, 127, 120));
|
|
84 |
INFO_PRINTF3(_L("--CID/OID: '%c%c'"), iCardInfo.iCID[14], iCardInfo.iCID[13]);
|
|
85 |
INFO_PRINTF6(_L("--CID/PNM: '%c%c%c%c%c'"), iCardInfo.iCID[12], iCardInfo.iCID[11], iCardInfo.iCID[10], iCardInfo.iCID[9], iCardInfo.iCID[8]);
|
|
86 |
INFO_PRINTF3(_L("--CID/PRV: %d.%d"), Slice128(iCardInfo.iCID, 63, 60), Slice128(iCardInfo.iCID, 59, 56));
|
|
87 |
INFO_PRINTF5(_L("--CID/PSN: %02x%02x%02x%02xh"), iCardInfo.iCID[6], iCardInfo.iCID[5], iCardInfo.iCID[4], iCardInfo.iCID[3]);
|
|
88 |
INFO_PRINTF3(_L("--CID/MDT: %02d/%d"), Slice128(iCardInfo.iCID, 11, 8), 2000 + Slice128(iCardInfo.iCID, 19, 12));
|
|
89 |
INFO_PRINTF2(_L("--CID/CRC: %02xh"), Slice128(iCardInfo.iCID, 7, 1));
|
|
90 |
|
|
91 |
INFO_PRINTF2(_L("++RCA: %04x"), iCardInfo.iRCA);
|
|
92 |
|
|
93 |
INFO_PRINTF1(_L("++CSD"));
|
|
94 |
INFO_PRINTF2(_L("--CSD/CSD_STRUCTURE: %02xh"), Slice128(iCardInfo.iCSD, 127, 126));
|
|
95 |
INFO_PRINTF2(_L("--CSD/TAAC: %02xh"), Slice128(iCardInfo.iCSD, 119, 112));
|
|
96 |
INFO_PRINTF2(_L("--CSD/NSAC: %02xh"), Slice128(iCardInfo.iCSD, 111, 104));
|
|
97 |
INFO_PRINTF2(_L("--CSD/TRAN_SPEED: %02xh"), Slice128(iCardInfo.iCSD, 103, 96));
|
|
98 |
INFO_PRINTF2(_L("--CSD/CCC: %012bb"), Slice128(iCardInfo.iCSD, 95, 84));
|
|
99 |
INFO_PRINTF2(_L("--CSD/READ_BL_LEN: %xh"), Slice128(iCardInfo.iCSD, 83, 80));
|
|
100 |
INFO_PRINTF2(_L("--CSD/READ_BL_PARTIAL: %b"), Slice128(iCardInfo.iCSD, 79, 79));
|
|
101 |
INFO_PRINTF2(_L("--CSD/WRITE_BLK_MISALIGN: %b"), Slice128(iCardInfo.iCSD, 78, 78));
|
|
102 |
INFO_PRINTF2(_L("--CSD/READ_BLK_MISALIGN: %b"), Slice128(iCardInfo.iCSD, 77, 77));
|
|
103 |
INFO_PRINTF2(_L("--CSD/DSR_IMP: %b"), Slice128(iCardInfo.iCSD, 76, 76));
|
|
104 |
if (Slice128(iCardInfo.iCSD, 127, 126) == 0)
|
|
105 |
{
|
|
106 |
INFO_PRINTF2(_L("--CSD/C_SIZE: %03xh"), Slice128(iCardInfo.iCSD, 73, 62));
|
|
107 |
}
|
|
108 |
else if (Slice128(iCardInfo.iCSD, 127, 126) == 1) // High capacity
|
|
109 |
{
|
|
110 |
INFO_PRINTF2(_L("--CSD/C_SIZE: %06xh"), Slice128(iCardInfo.iCSD, 69, 48));
|
|
111 |
}
|
|
112 |
INFO_PRINTF2(_L("--CSD/VDD_R_CURR_MIN: %03bb"), Slice128(iCardInfo.iCSD, 61, 59));
|
|
113 |
INFO_PRINTF2(_L("--CSD/VDD_R_CURR_MAX: %03bb"), Slice128(iCardInfo.iCSD, 58, 56));
|
|
114 |
INFO_PRINTF2(_L("--CSD/VDD_W_CURR_MIN: %03bb"), Slice128(iCardInfo.iCSD, 55, 53));
|
|
115 |
INFO_PRINTF2(_L("--CSD/VDD_W_CURR_MAX: %03bb"), Slice128(iCardInfo.iCSD, 52, 50));
|
|
116 |
INFO_PRINTF2(_L("--CSD/C_SIZE_MULT: %03bb"), Slice128(iCardInfo.iCSD, 49, 47));
|
|
117 |
INFO_PRINTF2(_L("--CSD/ERASE_BLK_EN: %b"), Slice128(iCardInfo.iCSD, 46, 46));
|
|
118 |
INFO_PRINTF2(_L("--CSD/SECTOR_SIZE: %07bb"), Slice128(iCardInfo.iCSD, 45, 39));
|
|
119 |
INFO_PRINTF2(_L("--CSD/WP_GRP_SIZE: %07bb"), Slice128(iCardInfo.iCSD, 38, 32));
|
|
120 |
INFO_PRINTF2(_L("--CSD/WP_GRP_ENABLE: %d"), Slice128(iCardInfo.iCSD, 31, 31));
|
|
121 |
INFO_PRINTF2(_L("--CSD/R2W_FACTOR: %03bb"), Slice128(iCardInfo.iCSD, 28, 26));
|
|
122 |
INFO_PRINTF2(_L("--CSD/WRITE_BL_LEN: %04bb"), Slice128(iCardInfo.iCSD, 25, 22));
|
|
123 |
INFO_PRINTF2(_L("--CSD/WRITE_BL_PARTIAL: %b"), Slice128(iCardInfo.iCSD, 21, 21));
|
|
124 |
INFO_PRINTF2(_L("--CSD/FILE_FORMAT_GRP: %b"), Slice128(iCardInfo.iCSD, 15, 15));
|
|
125 |
INFO_PRINTF2(_L("--CSD/COPY: %b"), Slice128(iCardInfo.iCSD, 14, 14));
|
|
126 |
INFO_PRINTF2(_L("--CSD/PERM_WRITE_PROTECT: %b"), Slice128(iCardInfo.iCSD, 13, 13));
|
|
127 |
INFO_PRINTF2(_L("--CSD/TMP_WRITE_PROTECT: %b"), Slice128(iCardInfo.iCSD, 12, 12));
|
|
128 |
INFO_PRINTF2(_L("--CSD/FILE_FORMAT: %02b"), Slice128(iCardInfo.iCSD, 11, 10));
|
|
129 |
INFO_PRINTF2(_L("--CSD/CRC: %07b"), Slice128(iCardInfo.iCSD, 7, 1));
|
|
130 |
}
|
|
131 |
else
|
|
132 |
{
|
|
133 |
INFO_PRINTF1(_L("Test preamble did not complete succesfully - Test Step skipped"));
|
|
134 |
}
|
|
135 |
return TestStepResult();
|
|
136 |
}
|