|
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 * Gareth Long - Symbian Foundation |
|
14 * |
|
15 * Description: Minimalistic non volatile memory driver |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef _BEAGLE_STATICRD_H |
|
20 #define _BEAGLE_STATICRD_H |
|
21 |
|
22 #include <kpower.h> |
|
23 #include <e32keys.h> |
|
24 //#include <system.h> |
|
25 |
|
26 //#define DEBUG_MEDSTATICRD |
|
27 #ifdef DEBUG_MEDSTATICRD |
|
28 #define __DEBUG_PRINT(format...) Kern::Printf(format) |
|
29 #else |
|
30 #define __DEBUG_PRINT(format...) __KTRACE_OPT(KLOCDRV,Kern::Printf(format)) |
|
31 #endif |
|
32 |
|
33 #define R_NVMEM_ID 0x0000 |
|
34 #define R_NVMEM_TRANSACTION_OFFSET 0x0004 |
|
35 #define R_NVMEM_TRANSACTION_SIZE 0x0008 |
|
36 #define R_NVMEM_TRANSACTION_DIRECTION 0x000c |
|
37 #define R_NVMEM_TRANSACTION_EXECUTE 0x0010 |
|
38 #define R_NVMEM_SHARED_MEMORY_BASE 0x0014 |
|
39 #define R_NVMEM_NV_MEMORY_SIZE 0x0018 |
|
40 #define R_NVMEM_SHARED_MEMORY_SIZE 0x001c |
|
41 #define R_NVMEM_STATUS 0x0020 |
|
42 #define R_NVMEM_ENABLE 0x0024 |
|
43 #define R_NVMEM_LASTREG 0x0028 // not a register, address of last register |
|
44 |
|
45 #define NVMEM_TRANSACTION_UNDEFINED 0 |
|
46 #define NVMEM_TRANSACTION_READ 1 |
|
47 #define NVMEM_TRANSACTION_WRITE 2 |
|
48 |
|
49 // 512 Byte sectors |
|
50 const TInt KDiskSectorShift = 9; |
|
51 const TInt KDiskSectorSize = 0x200; |
|
52 |
|
53 // Dfc thread priority |
|
54 const TInt KNVMemDfcThreadPriority = 24; |
|
55 |
|
56 // Transfer buffer size 256kBytes |
|
57 const TInt KNVMemTransferBufferSize = 0x40000; |
|
58 // Transfer buffer size in sectors |
|
59 const TInt KNVMemTransferBufferSectorCount = KNVMemTransferBufferSize/KDiskSectorSize; |
|
60 |
|
61 #endif |