author | Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com> |
Fri, 08 Oct 2010 14:36:55 +0100 | |
changeset 4 | 5937e08d5244 |
parent 0 | 5de814552237 |
permissions | -rw-r--r-- |
0
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
1 |
/* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
8 |
* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
11 |
* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
13 |
* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
15 |
* naviengine_assp\navienginedma.h |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
16 |
* Definitions and constants of NE SoC DMA Controller. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
17 |
* See 2.10 DMA Controllers in NaviEngine User Manual |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
18 |
* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
19 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
20 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
21 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
22 |
#ifndef __NAVIENGINEDMA_H__ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
23 |
#define __NAVIENGINEDMA_H__ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
24 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
25 |
#include <drivers/dma.h> |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
26 |
#include <assp/naviengine/naviengine.h> |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
27 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
28 |
#include <platform.h> |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
29 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
30 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
31 |
#define FUNC_LOG __KTRACE_OPT(KDMA, Kern::Printf(__PRETTY_FUNCTION__)) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
32 |
#define PRINT(S) __KTRACE_OPT(KDMA, Kern::Printf("%s = 0x%08x", #S, (S))) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
33 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
34 |
/* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
35 |
* The list of DMA logical channels. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
36 |
* Use these values to populate iCookie when openning DMA channel. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
37 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
38 |
enum ENaviengineDmaChannels |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
39 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
40 |
EDMAChannelSD0, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
41 |
EDMAChannelSD1, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
42 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
43 |
EDMAChannelI2S0RX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
44 |
EDMAChannelI2S0TX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
45 |
EDMAChannelI2S1RX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
46 |
EDMAChannelI2S1TX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
47 |
EDMAChannelI2S2RX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
48 |
EDMAChannelI2S2TX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
49 |
EDMAChannelI2S3RX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
50 |
EDMAChannelI2S3TX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
51 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
52 |
EDMAChannelUART0RX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
53 |
EDMAChannelUART0TX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
54 |
EDMAChannelUART1RX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
55 |
EDMAChannelUART1TX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
56 |
EDMAChannelUART2RX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
57 |
EDMAChannelUART2TX, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
58 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
59 |
EDmaMemToMem0, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
60 |
EDmaMemToMem1, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
61 |
EDmaMemToMem2, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
62 |
EDmaMemToMem3, ///< Internal, clients get value from HCR |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
63 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
64 |
EDma32ChannelCount, //End of DMA32 channels |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
65 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
66 |
//Enum indexes into KDMAChannelLocator array - it doesn't have a gap |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
67 |
EDma64MemToMem0 = EDma32ChannelCount, |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
68 |
EDma64MemToMem1, |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
69 |
EDma64MemToMem2, |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
70 |
EDma64MemToMem3, |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
71 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
72 |
EDmaChannelCount, // End of DMA64 channels |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
73 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
74 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
75 |
/* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
76 |
* The list of DMA controllers in NE SoC |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
77 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
78 |
enum ENaviEngineDmaController |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
79 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
80 |
EDmaCtrlExBus, // not supported - there is no any H/W of interest |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
81 |
EDMACtrl32, // DMAC32(8C) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
82 |
EDmaCtrl64 // DMAC64(4C) - DMA controller on 64 Bit AXI bus |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
83 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
84 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
85 |
/* |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
86 |
* Specifies H/W parameters of logical DMA channels (@see ENaviengineDmaChannels). |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
87 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
88 |
struct TDMAChannelLocator |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
89 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
90 |
ENaviEngineDmaController iDMACtrl; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
91 |
TInt iGroup; // 0 for EDmaCtrlExBus & 0-4 EDMACtrl32 |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
92 |
TInt iSubChannel; // 0-3 for EDmaCtrlExBus & 0-7 for each group of EDMACtrl32 |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
93 |
TInt iDMACHCReg; // The content CHC register (excluding subchannel) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
94 |
TInt iTransferShiftSize;//0-Byte, 1-HalfWord, 2-Word, 4-FourWords, 5-EightWords, 6-SixteenWords |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
95 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
96 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
97 |
const TInt KDmaHWCtrl32Count = 5; // The number of DMA32 controllers |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
98 |
const TInt KDmaCtrl32HWSubChannelCount = 8; // The number of subchannels per controller. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
99 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
100 |
const TUint KDMAGroupOffset = 0x1000; // Regitsers' offset per cotroller |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
101 |
const TUint KDMAChannelOffset = 0x20; // Registers' offset per subchannel |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
102 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
103 |
/****** Offsets and bitmasks of DMA32 registers ************/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
104 |
const TUint KHoDMASAB = 0x00; // Source Address Base |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
105 |
const TUint KHoDMADAB = 0x04; // Destination Address Base |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
106 |
const TUint KHoDMATCB = 0x08; // Transfer Count Base |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
107 |
const TUint KHoDMASAW = 0x0c; // Source Address Work |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
108 |
const TUint KHoDMADAW = 0x10; // Destination Address Work |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
109 |
const TUint KHoDMATCW = 0x14; // Transfer Count Work |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
110 |
const TUint KHoDMACHC = 0x18; // Channel Control Register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
111 |
const TUint KHmDMACHC_SEL = 7; // Channel selection mask |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
112 |
const TUint KHvDMACHC_SW = 0xd1226000; // Settings for SW transfer. Word alignement for both source & dest. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
113 |
const TUint KHvDMACHC_SDR = 0xd0292600; // Settings for SD0 Read channel |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
114 |
const TUint KHvDMACHC_SDW = 0xd0922610; // Settings for SD1 Write channel |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
115 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
116 |
const TUint KHsDMACHC_HP = 28; // Sets the values output to HPROT[3:0] during DMA transfer. 1101 initial value |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
117 |
const TUint KHvDMACHC_HP = 0xd; // initial value for KHsDMACHC_HP bits |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
118 |
const TUint KHtDMACHC_TM = (1<<24); // transfer mode- 0:single transfer, 1:block transfer (memory-to-memory transfers only!) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
119 |
const TUint KHtDMACHC_DAD = (1<<23); // destination address count direction- 0:increment, 1:fixed |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
120 |
const TUint KHtDMACHC_SAD = (1<<19); // source address count direction- 0:increment, 1:fixed |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
121 |
const TUint KHsDMACHC_DDS = 20; // transfer data size at the DMA transfer destination. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
122 |
const TUint KHsDMACHC_SDS = 16; // transfer data size at the DMA transfer source. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
123 |
/* 000: Byte (8 bits) (initial value) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
124 |
001: Half-word (16 bits) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
125 |
010: Word (32 bits) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
126 |
100: 4 words (128 bits) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
127 |
101: 8 words (256 bits) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
128 |
110: 16 words (512 bits) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
129 |
Others: Setting prohibited */ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
130 |
const TUint KHtDMACHC_TCM = (1<<14); // Masks output to DMATCO[n]: 0: not mask the output, 1:mast the output |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
131 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
132 |
const TUint KHsDMACHC_AM = 12; // Sets the DMAACK[n] output timing, 00: Pulse mode (active for one clock), |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
133 |
// 01: Level mode (active as long as the selected DMAREQ inputs remain) 1x: Masks DMAACK[n]. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
134 |
const TUint KHtDMACHC_LVL = (1<<10); // DMA request is detected 1: at the level or 0: edge of the signal. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
135 |
const TUint KHtDMACHC_HIEN = (1<<9); // 1: high level or rising edge of signal, 0: does not recognize |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
136 |
const TUint KHtDMACHC_LOEN = (1<<8); // 1: low level or falling edge of signal, 0: does not recognize |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
137 |
const TUint KHtDMACHC_REQD = (1<<4); // Selects whether DMAREQ SEL bit is on the source or destination side. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
138 |
/* Also selects the timing at which DMAACK becomes active. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
139 |
0: Source side. DMAACK becomes active upon read (initial value). |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
140 |
1: Destination side. DMAACK becomes active upon write.*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
141 |
const TUint KHsDMACHC_SEL = 0; // Selects one of eight DMAREQ/DMAACK/DMATCO signals. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
142 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
143 |
// Settings for I2S TX channels |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
144 |
const TUint KHvDMACHC_I2SW = |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
145 |
KHvDMACHC_HP << KHsDMACHC_HP | // use initial value for KHsDMACHC_HP bits |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
146 |
KHtDMACHC_DAD | // destination address fixed, increment source only |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
147 |
1 << KHsDMACHC_DDS | // transfer data size at the DMA transfer destination. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
148 |
1 << KHsDMACHC_SDS | // transfer data size at the DMA transfer source. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
149 |
0 << KHsDMACHC_AM | // 00: Pulse mode (active for one clock),01: Level mode (active as long as the selected DMAREQ inputs remain) 1x: Masks DMAACK[n]. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
150 |
KHtDMACHC_LVL | // DMA request is detected 1: at the level or 0: edge of the signal. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
151 |
KHtDMACHC_HIEN| // 1: high level or rising edge of signal, 0: does not recognize |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
152 |
0 << KHsDMACHC_SEL; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
153 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
154 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
155 |
// Settings for I2S RX channels |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
156 |
const TUint KHvDMACHC_I2SR = |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
157 |
KHvDMACHC_HP << KHsDMACHC_HP | // use initial value for KHsDMACHC_HP bits |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
158 |
KHtDMACHC_SAD | // source address fixed, increment destination only |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
159 |
1 << KHsDMACHC_DDS | // transfer data size at the DMA transfer destination. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
160 |
1 << KHsDMACHC_SDS | // transfer data size at the DMA transfer source. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
161 |
0 << KHsDMACHC_AM | // 00: Pulse mode (active for one clock),01: Level mode (active as long as the selected DMAREQ inputs remain) 1x: Masks DMAACK[n]. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
162 |
KHtDMACHC_LVL | // DMA request is detected 1: at the level or 0: edge of the signal. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
163 |
KHtDMACHC_HIEN| // 1: high level or rising edge of signal, 0: does not recognize |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
164 |
0 << KHsDMACHC_SEL; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
165 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
166 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
167 |
const TUint KHoDMACHS = 0x1c; // Channel Status Register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
168 |
const TUint KHtDMACHS_EN = 0x001;// Enables/disables DMA transfer. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
169 |
const TUint KHtDMACHS_EN_EN = 0x002;// Enables writing to EN bit. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
170 |
const TUint KHtDMACHS_STG = 0x004;// SW activation of DMA transfer. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
171 |
const TUint KHtDMACHS_FCLR = 0x008;// Clears TC, END, ERR & RQST bits. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
172 |
const TUint KHtDMACHS_RQST = 0x010;// Indicates that transfer request has been received - RO. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
173 |
const TUint KHtDMACHS_ACT = 0x020;// Indicates that DMAC is performing transfer - RO. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
174 |
const TUint KHtDMACHS_ERR = 0x040;// Error in transfer - RO. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
175 |
const TUint KHtDMACHS_END = 0x080;// DMA transfer from working set is completed. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
176 |
const TUint KHtDMACHS_TC = 0x100;// DMA transfer from working set is completed while BVALID is 0. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
177 |
const TUint KHtDMACHS_BVALID = 0x200;// Indicates valid values in base set. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
178 |
const TUint KHoDMACONT = 0x300; // Control Register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
179 |
const TUint KHvDMACONT_INIT_VALUE = 0; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
180 |
const TUint KHoDMASTAT = 0x304; // Status Register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
181 |
const TUint KHmDSTAT_TC_DMA32 = 0xff000000; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
182 |
const TUint KHsDSTAT_TC = 24; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
183 |
const TUint KHsDSTAT_END = 20; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
184 |
const TUint KHsDSTAT_ER = 16; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
185 |
const TUint KHmDSTAT_DMA32 = 0x01000001; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
186 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
187 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
188 |
static const TUint KMaxDMAUnitTransferLen = 0x10000;// max DMA transfer length in units. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
189 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
190 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
191 |
Constants for the 64 bit AXI DMA controller |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
192 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
193 |
namespace Dma64 |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
194 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
195 |
const TInt KChannelCount = 4; // The number of channels on the controller. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
196 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
197 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
198 |
Hardware definitions used for DMA channels |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
199 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
200 |
namespace Channel |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
201 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
202 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
203 |
Register set offsets |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
204 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
205 |
namespace RegSet |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
206 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
207 |
enum TRegSets {ENext0, ENext1, ECurrent, ERegSetCount}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
208 |
const TUint32 KHoBases[ERegSetCount] = {0x0, 0xc, 0x18}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
209 |
const TUint32 KHoSrcAddr = 0x0; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
210 |
const TUint32 KHoDstAddr = 0x4; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
211 |
const TUint32 KHoTranByte = 0x8; // Transaction byte register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
212 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
213 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
214 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
215 |
Base offsets for each channel |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
216 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
217 |
const TUint32 KHoBases[KChannelCount] = { 0x0, 0x40, 0x80, 0xC0 }; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
218 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
219 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
220 |
Offset and bit definitions for channel status register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
221 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
222 |
namespace Status |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
223 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
224 |
const TUint32 KHoBase = 0x24; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
225 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
226 |
const TUint32 KHtDescErr = KBit10; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
227 |
const TUint32 KHtDescWb = KBit9; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
228 |
const TUint32 KHtDescLoad = KBit8; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
229 |
const TUint32 KHtTc = KBit6; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
230 |
const TUint32 KHtEnd = KBit5; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
231 |
const TUint32 KHtSuspended = KBit3; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
232 |
const TUint32 KHtAct = KBit2; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
233 |
const TUint32 KHtRqst = KBit1; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
234 |
const TUint32 KHtEnabled = KBit0; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
235 |
} |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
236 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
237 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
238 |
Offset and bit definitions for channel control register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
239 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
240 |
namespace Ctrl |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
241 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
242 |
const TUint32 KHoBase = 0x28; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
243 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
244 |
const TUint32 KHtSetEnable = KBit0; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
245 |
const TUint32 KHtSwTrigger = KBit2; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
246 |
const TUint32 KHtSwReset = KBit3; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
247 |
const TUint32 KHtClrEnd = KBit5; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
248 |
const TUint32 KHtClrTc = KBit6; //Clear the transfer complete status |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
249 |
const TUint32 KHtSetSuspend = KBit8; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
250 |
const TUint32 KHtClrSuspend = KBit9; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
251 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
252 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
253 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
254 |
Offset and bit definitions for channel configuration register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
255 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
256 |
namespace Cfg |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
257 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
258 |
const TUint32 KHoBase = 0x2c; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
259 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
260 |
const TUint32 KHtLinkMode = KBit31; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
261 |
const TUint32 KHtCompMask = KBit25; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
262 |
const TUint32 KHtEndMask = KBit24; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
263 |
const TUint32 KHtTransMode = KBit22; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
264 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
265 |
const TUint32 KHsDestDataSize = 16; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
266 |
const TUint32 KHsSrcDataSize = 12; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
267 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
268 |
const TUint32 KHmDestDataSize = (0xF << KHsDestDataSize); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
269 |
const TUint32 KHmSrcDataSize = (0xF << KHsSrcDataSize); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
270 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
271 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
272 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
273 |
Offset and bit definitions for channel interval register |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
274 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
275 |
namespace Interval |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
276 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
277 |
const TUint32 KHo = 0x30; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
278 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
279 |
const TUint32 KHm = 0x0000FFFF; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
280 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
281 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
282 |
const TUint32 KHoExt = 0x34; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
283 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
284 |
const TUint32 KHoNxtLnkAddr = 0x38; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
285 |
const TUint32 KHoCurrtLnkAddr = 0x3c; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
286 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
287 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
288 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
289 |
Registers common to all channels |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
290 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
291 |
namespace Cmn |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
292 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
293 |
const TUint32 KHoCtrl = 0x300; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
294 |
const TUint32 KHoEn = 0x310; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
295 |
const TUint32 KHoErr = 0x314; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
296 |
const TUint32 KHoEnd = 0x318; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
297 |
const TUint32 KHoTc = 0x31C; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
298 |
const TUint32 KHoSus = 0x320; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
299 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
300 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
301 |
const TUint KDma64MaxTransferBytes = KMaxTUint32; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
302 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
303 |
/** |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
304 |
Layout of the 64 bit DMAC's transfer descriptor |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
305 |
*/ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
306 |
struct TDma64Desc |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
307 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
308 |
TDma64Desc() {Clear();} |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
309 |
void Clear() {memclr(this, sizeof(*this));} |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
310 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
311 |
enum TTransferSize |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
312 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
313 |
E512Bit = 0x6, |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
314 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
315 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
316 |
void SetSourceDataSize(TTransferSize aTransferSize) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
317 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
318 |
iConfig &= ~Channel::Cfg::KHmSrcDataSize; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
319 |
iConfig |= (aTransferSize << Channel::Cfg::KHsSrcDataSize); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
320 |
} |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
321 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
322 |
void SetDestDataSize(TTransferSize aTransferSize) |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
323 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
324 |
iConfig &= ~Channel::Cfg::KHmDestDataSize; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
325 |
iConfig |= (aTransferSize << Channel::Cfg::KHsDestDataSize); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
326 |
} |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
327 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
328 |
#ifdef _DEBUG |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
329 |
void Print() |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
330 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
331 |
FUNC_LOG; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
332 |
PRINT(iHeader); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
333 |
PRINT(iSrcAddr); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
334 |
PRINT(iDestAddr); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
335 |
PRINT(iTransactionByte); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
336 |
PRINT(iConfig); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
337 |
PRINT(iInterval); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
338 |
PRINT(iExtension); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
339 |
PRINT(iNextLink); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
340 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
341 |
PRINT(Epoc::LinearToPhysical((TUint32)this)); |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
342 |
} |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
343 |
#endif |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
344 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
345 |
TUint32 iHeader; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
346 |
TUint32 iSrcAddr; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
347 |
TUint32 iDestAddr; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
348 |
TUint32 iTransactionByte; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
349 |
TUint32 iConfig; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
350 |
TUint32 iInterval; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
351 |
TUint32 iExtension; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
352 |
TUint32 iNextLink; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
353 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
354 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
355 |
/** Bit defs for hardware descriptor header */ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
356 |
namespace HwDesHeader |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
357 |
{ |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
358 |
const TUint32 KHtDim = KBit3; // Descriptor header load interrupt mask: 1: do not issue irq; 0: issue irq. |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
359 |
const TUint32 KHtWbd = KBit2; // Write back disable. Set to 1 to disable writeback |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
360 |
const TUint32 KHtLe = KBit1; // 1: This is the final link |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
361 |
const TUint32 KHtLv = KBit0; // 1: This link is valid |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
362 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
363 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
364 |
}; |
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
365 |
|
5de814552237
Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff
changeset
|
366 |
#endif // #ifndef __NAVIENGINEDMA_H__ |