mirror of
https://github.com/rvtr/ctr_card_test.git
synced 2025-06-18 14:45:42 -04:00

・enumをちょっと変更。 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_card_test@9 ff8ce827-af98-4349-adb5-4c00699b5328
159 lines
4.1 KiB
C++
159 lines
4.1 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: $project_name
|
|
File: $name
|
|
|
|
Copyright (C)$copyright_year Nintendo Co., Ltd. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Rev: $
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef CARDTESTFUNCTION_H_
|
|
#define CARDTESTFUNCTION_H_
|
|
|
|
#include <nn.h>
|
|
#include <nn/os.h>
|
|
|
|
using namespace std;
|
|
|
|
namespace nn{
|
|
namespace red{
|
|
namespace nakayama{
|
|
|
|
|
|
/* **************************************************
|
|
|
|
define
|
|
|
|
************************************************** */
|
|
#define BUFFER_SIZE (2048 * 512) // 0x100000
|
|
//#define INTEGRATION_TEST
|
|
|
|
/* **************************************************
|
|
|
|
struct
|
|
|
|
************************************************** */
|
|
//全テスト共通
|
|
struct settingInfo {
|
|
u8 up_down;
|
|
u64 StartAddress;
|
|
u64 EndAddress;
|
|
u32 size;
|
|
u32 data;
|
|
u32 reserved1;
|
|
u32 reserved2;
|
|
};
|
|
|
|
// 受信情報
|
|
struct detailInfo {
|
|
u32 mID1; //ID1
|
|
u32 mID2; //ID2
|
|
u8 mUID[8]; //UID
|
|
u32 mReadSpeed; //Mbyte/sec
|
|
u32 mCRC; //CRC(softで計算)
|
|
u32 mLOOP; //LoopCount
|
|
u64 currAccessAddr; //CurrentAccessAddress
|
|
u64 errorAddress[10]; //Error Address
|
|
u64 errorData[10]; //Error Data
|
|
};
|
|
|
|
// ARM11 設定情報
|
|
struct settingData {
|
|
u32 AccessPattern :3; // [0: 2] AccessPattern(INC:0 - REPEAT:7)
|
|
u32 Loop :1; // [3] Loop(Once:0 - Repeat:1)
|
|
u32 ReadCount :2; // [4: 5] ReadCount(1000:0 - 10000000:3)
|
|
u32 BackUpMemory :3; // [6: 8] BackUpMemory(No:0 - 4MFlash:3)
|
|
u32 WriteData :3; // [9:11] WriteData(0000h:0 - Repeat:6)
|
|
u32 :0;
|
|
};
|
|
|
|
|
|
/* **************************************************
|
|
|
|
enum
|
|
|
|
************************************************** */
|
|
enum TestCaseID {
|
|
TID_FUNC_TEST1,
|
|
TID_FUNC_TEST2,
|
|
TID_FUNC_INTEG,
|
|
TID_FUNC_RDID1,
|
|
TID_FUNC_RDID2,
|
|
TID_FUNC_RDSEQ_WITH_VERIFY,
|
|
TID_FUNC_RDSEQ,
|
|
TID_WR_PAGE_START,
|
|
TID_WR_PAGE,
|
|
TID_RD_WREXE,
|
|
TID_RD_UID,
|
|
TID_RD_REFRESH,
|
|
TID_AGING_TEST,
|
|
TID_READ_TEST,
|
|
TID_READ_SPEED,
|
|
TID_READ_READONLY,
|
|
};
|
|
|
|
|
|
enum CardType {
|
|
CARD_TYPE_S1,
|
|
CARD_TYPE_S2
|
|
};
|
|
|
|
|
|
// アクセスパターン
|
|
enum CardAccessPattern {
|
|
SETTING_ACCESS_PATTERN_INC = 0x00000000,
|
|
SETTING_ACCESS_PATTERN_DEC = 0x00000001,
|
|
SETTING_ACCESS_PATTERN_COMP = 0x00000002,
|
|
SETTING_ACCESS_PATTERN_RAMDOM1 = 0x00000004,
|
|
SETTING_ACCESS_PATTERN_RAMDOM2 = 0x00000008,
|
|
SETTING_ACCESS_PATTERN_ID1 = 0x00000010,
|
|
SETTING_ACCESS_PATTERN_ID2 = 0x00000020,
|
|
SETTING_ACCESS_PATTERN_REPEAT = 0x00000040
|
|
};
|
|
|
|
// ループ
|
|
enum CardLoopType {
|
|
SETTING_LOOP_TYPE_ONCE = 0x00000080,
|
|
SETTING_LOOP_TYPE_REPEAT = 0x00000100
|
|
};
|
|
|
|
// リードカウント
|
|
enum CardReadCount {
|
|
SETTING_READ_COUNT_10000 = 0x00000200,
|
|
SETTING_READ_COUNT_100000 = 0x00000400,
|
|
SETTING_READ_COUNT_1000000 = 0x00000800,
|
|
SETTING_READ_COUNT_10000000 = 0x00001000
|
|
};
|
|
|
|
// バックアップメモリ
|
|
enum CardBackupMemType {
|
|
SETTING_BACKUP_MEM_TYPE_NO = 0x00002000,
|
|
SETTING_BACKUP_MEM_TYPE_64K_EEP = 0x00004000,
|
|
SETTING_BACKUP_MEM_TYPE_1M_FLASH = 0x00008000,
|
|
SETTING_BACKUP_MEM_TYPE_4M_FLASH = 0x00010000
|
|
};
|
|
|
|
// ライトデータ
|
|
enum CardWriteData {
|
|
SETTING_WRITE_DATA_0000 = 0x00020000,
|
|
SETTING_WRITE_DATA_55AA = 0x00040000,
|
|
SETTING_WRITE_DATA_00FF = 0x00080000,
|
|
SETTING_WRITE_DATA_FFFF = 0x00100000,
|
|
SETTING_WRITE_DATA_DEC = 0x00200000,
|
|
SETTING_WRITE_DATA_INC = 0x00400000,
|
|
SETTING_WRITE_DATA_REPEAT = 0x00800000
|
|
};
|
|
|
|
|
|
} /* nakayama */
|
|
} /* red */
|
|
} /* nn */
|
|
|
|
#endif
|