author | Lukasz Forynski <lukasz.forynski@gmail.com> |
Wed, 25 Aug 2010 03:09:47 +0100 | |
branch | generic_fixes_and_updates |
changeset 55 | fa7dcb51ca22 |
parent 46 | 78c240f59c9d |
permissions | -rw-r--r-- |
46
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
1 |
/* |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
3 |
* All rights reserved. |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
8 |
* |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
11 |
* |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
12 |
* Contributors: |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
13 |
* Gareth Long - Symbian Foundation |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
14 |
* |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
15 |
* Description: Minimalistic non volatile memory driver |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
16 |
* |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
17 |
*/ |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
18 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
19 |
#ifndef _BEAGLE_STATICRD_H |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
20 |
#define _BEAGLE_STATICRD_H |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
21 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
22 |
#include <kpower.h> |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
23 |
#include <e32keys.h> |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
24 |
//#include <system.h> |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
25 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
26 |
//#define DEBUG_MEDSTATICRD |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
27 |
#ifdef DEBUG_MEDSTATICRD |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
28 |
#define __DEBUG_PRINT(format...) Kern::Printf(format) |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
29 |
#else |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
30 |
#define __DEBUG_PRINT(format...) __KTRACE_OPT(KLOCDRV,Kern::Printf(format)) |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
31 |
#endif |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
32 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
33 |
#define R_NVMEM_ID 0x0000 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
34 |
#define R_NVMEM_TRANSACTION_OFFSET 0x0004 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
35 |
#define R_NVMEM_TRANSACTION_SIZE 0x0008 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
36 |
#define R_NVMEM_TRANSACTION_DIRECTION 0x000c |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
37 |
#define R_NVMEM_TRANSACTION_EXECUTE 0x0010 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
38 |
#define R_NVMEM_SHARED_MEMORY_BASE 0x0014 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
39 |
#define R_NVMEM_NV_MEMORY_SIZE 0x0018 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
40 |
#define R_NVMEM_SHARED_MEMORY_SIZE 0x001c |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
41 |
#define R_NVMEM_STATUS 0x0020 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
42 |
#define R_NVMEM_ENABLE 0x0024 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
43 |
#define R_NVMEM_LASTREG 0x0028 // not a register, address of last register |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
44 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
45 |
#define NVMEM_TRANSACTION_UNDEFINED 0 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
46 |
#define NVMEM_TRANSACTION_READ 1 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
47 |
#define NVMEM_TRANSACTION_WRITE 2 |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
48 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
49 |
// 512 Byte sectors |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
50 |
const TInt KDiskSectorShift = 9; |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
51 |
const TInt KDiskSectorSize = 0x200; |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
52 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
53 |
// Dfc thread priority |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
54 |
const TInt KNVMemDfcThreadPriority = 24; |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
55 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
56 |
// Transfer buffer size 256kBytes |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
57 |
const TInt KNVMemTransferBufferSize = 0x40000; |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
58 |
// Transfer buffer size in sectors |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
59 |
const TInt KNVMemTransferBufferSectorCount = KNVMemTransferBufferSize/KDiskSectorSize; |
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
60 |
|
78c240f59c9d
Changes for full working UI on 3.0.0 including Gareth's "persistent" RAM drives
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
61 |
#endif |