1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - CTRDG - libraries - ARM9
3   File:     ctrdg_flash_common.c
4 
5   Copyright 2008 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2007-11-15#$
14   $Rev: 2414 $
15   $Author: hatamoto_minoru $
16  *---------------------------------------------------------------------------*/
17 
18 #include <nitro.h>
19 
20 
21 // Extern data declaration----------------------
22 extern u16 CTRDGi_PollingSR1MCOMMON(u16 phase, u8 *adr, u16 lastData);
23 
24 // Define data----------------------------------
25 
26 // Function's prototype declaration-------------
27 extern u16 CTRDGi_EraseFlashChipMX(void);
28 extern u16 CTRDGi_EraseFlashSectorMX(u16 secNo);
29 extern u16 CTRDGi_WriteFlashSectorMX(u16 secNo, u8 *src);
30 extern void CTRDGi_EraseFlashChipAsyncMX(CTRDG_TASK_FUNC callback);
31 extern void CTRDGi_EraseFlashSectorAsyncMX(u16 secNo, CTRDG_TASK_FUNC callback);
32 extern void CTRDGi_WriteFlashSectorAsyncMX(u16 secNo, u8 *src, CTRDG_TASK_FUNC callback);
33 
34 // Const data-----------------------------------
35 static const u16 LeMaxTime[] = {
36     10,                                // Common       10ms
37     10,                                // Program      10ms(exactly:20usec)
38     2000,                              // Sector erase 2s
39     5000,                              // Chip   erase 5s
40 };
41 
42 const CTRDGiFlashTypePlus LE26FV10N1TS_10 = {
43     CTRDGi_WriteFlashSectorMX,
44     CTRDGi_EraseFlashChipMX,
45     CTRDGi_EraseFlashSectorMX,
46     CTRDGi_WriteFlashSectorAsyncMX,
47     CTRDGi_EraseFlashChipAsyncMX,
48     CTRDGi_EraseFlashSectorAsyncMX,
49     CTRDGi_PollingSR1MCOMMON,
50     LeMaxTime,
51     {
52 /* For debugging */
53 //#ifndef   __FLASH_DEBUG
54         0x00020000,                       // ROM size
55         {0x00001000, 12, 32, 0},          // Sector size, shift, count, top
56 //#else
57 //      0x00004000,
58 //      {0x00000200,  9, 32,  0},
59 //#endif
60         {MI_CTRDG_RAMCYCLE_18, MI_CTRDG_RAMCYCLE_8},       // agb read cycle=8, write cycle=3
61         0x62,                             // Maker ID
62         0x13,                             // Device ID
63     },
64 };
65