imxsdmareg.h revision 1.1 1 1.1 bsh /* $NetBSD: imxsdmareg.h,v 1.1 2010/11/13 07:11:03 bsh Exp $ */
2 1.1 bsh
3 1.1 bsh /*
4 1.1 bsh * Copyright (c) 2009 Genetec Corporation. All rights reserved.
5 1.1 bsh * Written by Hashimoto Kenichi and Hiroyuki Bessho for Genetec Corporation.
6 1.1 bsh *
7 1.1 bsh * Redistribution and use in source and binary forms, with or without
8 1.1 bsh * modification, are permitted provided that the following conditions
9 1.1 bsh * are met:
10 1.1 bsh * 1. Redistributions of source code must retain the above copyright
11 1.1 bsh * notice, this list of conditions and the following disclaimer.
12 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 bsh * notice, this list of conditions and the following disclaimer in the
14 1.1 bsh * documentation and/or other materials provided with the distribution.
15 1.1 bsh *
16 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
17 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
20 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.1 bsh * POSSIBILITY OF SUCH DAMAGE.
27 1.1 bsh */
28 1.1 bsh
29 1.1 bsh #ifndef _IMXSDMAREG_H
30 1.1 bsh #define _IMXSDMAREG_H
31 1.1 bsh
32 1.1 bsh #define SDMA_SIZE 0x100
33 1.1 bsh
34 1.1 bsh /* SDMA Controller */
35 1.1 bsh #define SDMA_N_CHANNELS 32
36 1.1 bsh #define SDMA_PRIORITY_MIN 1
37 1.1 bsh #define SDMA_PRIORITY_MAX 7
38 1.1 bsh
39 1.1 bsh #define SDMA_N_EVENTS 32 /* DMA events from periperals */
40 1.1 bsh
41 1.1 bsh #define SDMA_MC0PTR 0x0000
42 1.1 bsh #define SDMA_INTR 0x0004
43 1.1 bsh #define SDMA_STOP_STAT 0x0008
44 1.1 bsh #define SDMA_HSTART 0x000C
45 1.1 bsh #define SDMA_EVTOVR 0x0010
46 1.1 bsh #define SDMA_DSPOVR 0x0014
47 1.1 bsh #define SDMA_HOSTOVR 0x0018
48 1.1 bsh #define SDMA_EVTPEND 0x001C
49 1.1 bsh #define SDMA_RESET 0x0024
50 1.1 bsh #define SDMA_RESET_RESCHED __BIT(1)
51 1.1 bsh #define SDMA_RESET_RESET __BIT(0)
52 1.1 bsh #define SDMA_EVTERR 0x0028
53 1.1 bsh #define SDMA_INTRMASK 0x002C
54 1.1 bsh #define SDMA_PSW 0x0030
55 1.1 bsh #define SDMA_EVTERRDBG 0x0034
56 1.1 bsh #define SDMA_CONFIG 0x0038
57 1.1 bsh #define SDMA_ONCE_ENB 0x0040
58 1.1 bsh #define SDMA_ONCE_DATA 0x0044
59 1.1 bsh #define SDMA_ONCE_INSTR 0x0048
60 1.1 bsh #define SDMA_ONCE_STAT 0x004c
61 1.1 bsh #define ONCE_STAT_PST_SHIFT 12
62 1.1 bsh #define ONCE_STAT_PST_MASK (0xf<<ONCE_STAT_PST_SHIFT)
63 1.1 bsh #define ONCE_STAT_PST_PROGRAM (0<<ONCE_STAT_PST_SHIFT)
64 1.1 bsh #define ONCE_STAT_PST_DATA (1<<ONCE_STAT_PST_SHIFT)
65 1.1 bsh #define ONCE_STAT_PST_CHGFLOW (2<<ONCE_STAT_PST_SHIFT)
66 1.1 bsh #define ONCE_STAT_PST_CHGFLOW_IN_LOOP (3<<ONCE_STAT_PST_SHIFT)
67 1.1 bsh #define ONCE_STAT_PST_DEBUG (4<<ONCE_STAT_PST_SHIFT)
68 1.1 bsh #define ONCE_STAT_PST_FUNCUNIT (5<<ONCE_STAT_PST_SHIFT)
69 1.1 bsh #define ONCE_STAT_PST_SLEEP (6<<ONCE_STAT_PST_SHIFT)
70 1.1 bsh #define ONCE_STAT_PST_SAVE (7<<ONCE_STAT_PST_SHIFT)
71 1.1 bsh #define ONCE_STAT_PST_PROGRAM_IN_SLEEP (8<<ONCE_STAT_PST_SHIFT)
72 1.1 bsh #define ONCE_STAT_PST_DATA_IN_SLEEP (9<<ONCE_STAT_PST_SHIFT)
73 1.1 bsh #define ONCE_STAT_PST_CHGFLOW_IN_SLEEP (10<<ONCE_STAT_PST_SHIFT)
74 1.1 bsh #define ONCE_STAT_PST_CHGFLOW_IN_LOOP_IN_SLEEP (10<<ONCE_STAT_PST_SHIFT)
75 1.1 bsh #define ONCE_STAT_PST_DEBUG_IN_SLEEP (12<<ONCE_STAT_PST_SHIFT)
76 1.1 bsh #define ONCE_STAT_PST_FUNCUNIT_IN_SLEEP (13<<ONCE_STAT_PST_SHIFT)
77 1.1 bsh #define ONCE_STAT_PST_SLEEP_AFTER_RESET (14<<ONCE_STAT_PST_SHIFT)
78 1.1 bsh #define ONCE_STAT_PST_RESTORE (15<<ONCE_STAT_PST_SHIFT)
79 1.1 bsh
80 1.1 bsh #define ONCE_STAT_RCV __BIT(11)
81 1.1 bsh #define ONCE_STAT_EDR __BIT(10)
82 1.1 bsh #define ONCE_STAT_ODR __BIT(9)
83 1.1 bsh #define ONCE_STAT_SWB __BIT(8)
84 1.1 bsh #define ONCE_STAT_MST __BIT(7)
85 1.1 bsh #define ONCE_STAT_ECDR 0X07
86 1.1 bsh
87 1.1 bsh #define SDMA_ONCE_CMD 0x0050
88 1.1 bsh #define ONCE_RSTATUS 0
89 1.1 bsh #define ONCE_DMOV 1
90 1.1 bsh #define ONCE_EXEC_ONCE 2
91 1.1 bsh #define ONCE_RUN 3
92 1.1 bsh #define ONCE_EXEC_CORE 4
93 1.1 bsh #define ONCE_DEBUG_RQST 5
94 1.1 bsh #define ONCE_RBUFFER 6
95 1.1 bsh #define SDMA_EVT_MIRROR 0x0054
96 1.1 bsh #define SDMA_ILLINSTADDR 0x0058 /* Illegal Instruction Trap Address */
97 1.1 bsh #define SDMA_CHN0ADDR 0x005c /* Channel 0 Boot address */
98 1.1 bsh #define SDMA_XTRIG_CONF1 0x0070 /* Cross-Triger Evennts Config */
99 1.1 bsh #define SDMA_XTRIG_CONF2 0x0074
100 1.1 bsh #define SDMA_CHNENBL(n) (0x80+(n)*4) /* Channel Enable RAM */
101 1.1 bsh #define SDMA_CHNPRI(n) (0x100+(n)*4) /* Channel Priority */
102 1.1 bsh
103 1.1 bsh
104 1.1 bsh /*
105 1.1 bsh * Memory of SDMA Risc Core
106 1.1 bsh */
107 1.1 bsh
108 1.1 bsh #define SDMACORE_ROM_BASE 0x0000
109 1.1 bsh #define SDMACORE_ROM_SIZE 0x0400 /* in 32-bit word. 4K bytes */
110 1.1 bsh #define SDMACORE_RAM_BASE 0x0800
111 1.1 bsh #define SDMACORE_RAM_SIZE 0x0800 /* in 32-bit word. 8K byte */
112 1.1 bsh
113 1.1 bsh #define SDMACORE_CONTEXT_BASE 0x0800
114 1.1 bsh #define SDMACORE_CONTEXT_SIZE 32 /* XXX: or 24 */
115 1.1 bsh #define SDMACORE_CONTEXT_ADDR(ch) (SDMACORE_CONTEXT_BASE+ \
116 1.1 bsh (SDMACORE_CONTEXT_SIZE * (ch)))
117 1.1 bsh #define SDMACORE_CONTEXT_END SDMACORE_CONTEXT_ADDR(SDMA_N_CHANNELS)
118 1.1 bsh
119 1.1 bsh
120 1.1 bsh #endif /* _IMXSDMAREG_H */
121