mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
testsにnandサンプル追加。 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@255 b871894f-2f95-9b40-918c-086798483c85
87 lines
3.1 KiB
C
87 lines
3.1 KiB
C
/*---------------------------------------------------------------------------*
|
||
Project: CTR - NAND driver
|
||
File: nandif_ip.h
|
||
|
||
Copyright 2006 Nintendo. 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.
|
||
*---------------------------------------------------------------------------*/
|
||
|
||
#ifndef __NAND_IF_IP_H__
|
||
#define __NAND_IF_IP_H__
|
||
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
定数定義
|
||
*---------------------------------------------------------------------------*/
|
||
#define NAND_PAGE_DATASIZE (2048)
|
||
#define NAND_PAGE_SPARESIZE (64)
|
||
#define NAND_PAGE_ALLSIZE (NAND_PAGE_DATASIZE + NAND_PAGE_SPARESIZE)
|
||
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
構造体
|
||
*---------------------------------------------------------------------------*/
|
||
typedef struct NandSpareFormat {/*スペア領域 64バイト*/
|
||
u8 block_stat_bad; // 1 ブロックステータス(バッドブロック)
|
||
u8 block_stat_warning; // 1 ブロックステータス(注意ブロック)
|
||
u8 page_stat; // 1 ページステータス
|
||
u8 pad0; // 1
|
||
u32 block_erase_count0; // 4 ブロック消去回数(パリティ付き)
|
||
u16 logical_adr0; // 2 論理アドレス(パリティ付き)
|
||
u16 pad1; // 2
|
||
u32 ecc[4]; //16 ECC 0~3
|
||
u32 block_erase_count1; // 4 ブロック消去回数(パリティ付き)予備
|
||
u16 logical_adr1; // 2 論理アドレス(パリティ付き)予備
|
||
u16 pad2; // 2
|
||
char sig0[4]; // 4 Signature"CTR\0"
|
||
char sig1[4]; // 4 Signature"CTR\0"
|
||
u8 reserve[20]; //28 予約
|
||
} NandSpareFormat;
|
||
|
||
typedef struct NandDataFormat { /*データ領域 2048バイト*/
|
||
u32 data[4][512/4];
|
||
/* u32 data0[512/4]; //データ領域1/4(512バイト)
|
||
u32 data1[512/4]; //データ領域2/4(512バイト)
|
||
u32 data2[512/4]; //データ領域3/4(512バイト)
|
||
u32 data3[512/4]; //データ領域4/4(512バイト)*/
|
||
} NandDataFormat;
|
||
|
||
typedef struct NandPageFormat { /*ページ全体*/
|
||
struct NandDataFormat data;
|
||
struct NandSpareFormat spare; //スペア領域(64バイト)
|
||
} NandPageFormat;
|
||
|
||
|
||
/*
|
||
typedef struct NandSysFormat {
|
||
u16 logical_adr;
|
||
u16 read_count;
|
||
u32 erase_count;
|
||
} NandSysFormat;*/
|
||
|
||
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
API
|
||
*---------------------------------------------------------------------------*/
|
||
BOOL i_nandEraseBlock( u16 physical_blk);
|
||
BOOL i_nandReadPage( NandPageFormat* dest, u32 physical_page_addr, BOOL sync);
|
||
BOOL i_nandWritePage( NandPageFormat* src, u32 physical_page_addr, BOOL sync);
|
||
|
||
|
||
#ifdef __cplusplus
|
||
} /* extern "C" */
|
||
#endif
|
||
|
||
|
||
#endif /*__NAND_IF_IP_H__*/
|