|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Minimalistic non volatile memory driver |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef _SYBORG_MEDNVMEMORY_H |
|
19 #define _SYBORG_MEDNVMEMORY_H |
|
20 |
|
21 #include <kpower.h> |
|
22 #include <e32keys.h> |
|
23 #include <system.h> |
|
24 |
|
25 //#define DEBUG_MEDNVMEMORY |
|
26 #ifdef DEBUG_MEDNVMEMORY |
|
27 #define __DEBUG_PRINT(format...) Kern::Printf(format) |
|
28 #else |
|
29 #define __DEBUG_PRINT(format...) __KTRACE_OPT(KLOCDRV,Kern::Printf(format)) |
|
30 #endif |
|
31 |
|
32 #define R_NVMEM_ID 0x0000 |
|
33 #define R_NVMEM_TRANSACTION_OFFSET 0x0004 |
|
34 #define R_NVMEM_TRANSACTION_SIZE 0x0008 |
|
35 #define R_NVMEM_TRANSACTION_DIRECTION 0x000c |
|
36 #define R_NVMEM_TRANSACTION_EXECUTE 0x0010 |
|
37 #define R_NVMEM_SHARED_MEMORY_BASE 0x0014 |
|
38 #define R_NVMEM_NV_MEMORY_SIZE 0x0018 |
|
39 #define R_NVMEM_SHARED_MEMORY_SIZE 0x001c |
|
40 #define R_NVMEM_STATUS 0x0020 |
|
41 #define R_NVMEM_ENABLE 0x0024 |
|
42 #define R_NVMEM_LASTREG 0x0028 // not a register, address of last register |
|
43 |
|
44 #define NVMEM_TRANSACTION_UNDEFINED 0 |
|
45 #define NVMEM_TRANSACTION_READ 1 |
|
46 #define NVMEM_TRANSACTION_WRITE 2 |
|
47 |
|
48 // 512 Byte sectors |
|
49 const TInt KDiskSectorShift = 9; |
|
50 const TInt KDiskSectorSize = 0x200; |
|
51 |
|
52 // Dfc thread priority |
|
53 const TInt KNVMemDfcThreadPriority = 24; |
|
54 |
|
55 // Transfer buffer size 256kBytes |
|
56 const TInt KNVMemTransferBufferSize = 0x40000; |
|
57 // Transfer buffer size in sectors |
|
58 const TInt KNVMemTransferBufferSectorCount = KNVMemTransferBufferSize/KDiskSectorSize; |
|
59 |
|
60 #endif |