diff options
Diffstat (limited to 'drivers/media/video/tegra/nvavp/nvavp_os.h')
-rw-r--r-- | drivers/media/video/tegra/nvavp/nvavp_os.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/drivers/media/video/tegra/nvavp/nvavp_os.h b/drivers/media/video/tegra/nvavp/nvavp_os.h new file mode 100644 index 00000000000..4d7f6776f11 --- /dev/null +++ b/drivers/media/video/tegra/nvavp/nvavp_os.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * drivers/media/video/tegra/nvavp/nvavp_os.h | ||
3 | * | ||
4 | * Copyright (C) 2011 NVIDIA Corp. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MEDIA_VIDEO_TEGRA_NVAVP_OS_H | ||
12 | #define __MEDIA_VIDEO_TEGRA_NVAVP_OS_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | |||
16 | #include "../../../../video/tegra/nvmap/nvmap.h" | ||
17 | |||
18 | #define NVE2_AVP (0x0000E276) | ||
19 | |||
20 | struct nv_e276_control { | ||
21 | u32 reserved00[5]; | ||
22 | u32 dma_start; | ||
23 | u32 reserved01[2]; | ||
24 | u32 dma_end; | ||
25 | u32 reserved02[7]; | ||
26 | u32 put; | ||
27 | u32 reserved03[15]; | ||
28 | u32 get; | ||
29 | u32 reserved04[10]; | ||
30 | u32 watchdog_timeout; | ||
31 | u32 idle_notify_enable; | ||
32 | u32 idle_notify_delay; | ||
33 | u32 idle_clk_enable; | ||
34 | u32 iram_clk_gating; | ||
35 | u32 idle; | ||
36 | u32 outbox_data; | ||
37 | u32 app_intr_enable; | ||
38 | u32 app_start_time; | ||
39 | u32 app_in_iram; | ||
40 | u32 iram_ucode_addr; | ||
41 | u32 iram_ucode_size; | ||
42 | u32 dbg_state[57]; | ||
43 | u32 os_method_data[16]; | ||
44 | u32 app_method_data[128]; | ||
45 | }; | ||
46 | |||
47 | #define NVE26E_HOST1X_INCR_SYNCPT (0x00000000) | ||
48 | #define NVE26E_HOST1X_INCR_SYNCPT_COND_OP_DONE (0x00000001) | ||
49 | |||
50 | #define NVE26E_CH_OPCODE_INCR(Addr, Count) \ | ||
51 | /* op, addr, count */ \ | ||
52 | ((1UL << 28) | ((Addr) << 16) | (Count)) | ||
53 | |||
54 | #define NVE26E_CH_OPCODE_IMM(addr, value) \ | ||
55 | /* op, addr, count */ \ | ||
56 | ((4UL << 28) | ((addr) << 16) | (value)) | ||
57 | |||
58 | #define NVE26E_CH_OPCODE_GATHER(off, ins, type, cnt) \ | ||
59 | /* op, offset, insert, type, count */ \ | ||
60 | ((6UL << 28) | ((off) << 16) | ((ins) << 15) | ((type) << 14) | cnt) | ||
61 | |||
62 | /* AVP OS methods */ | ||
63 | #define NVE276_NOP (0x00000080) | ||
64 | #define NVE276_SET_APP_TIMEOUT (0x00000084) | ||
65 | #define NVE276_SET_MICROCODE_A (0x00000085) | ||
66 | #define NVE276_SET_MICROCODE_B (0x00000086) | ||
67 | #define NVE276_SET_MICROCODE_C (0x00000087) | ||
68 | |||
69 | /* Interrupt codes through inbox/outbox data codes (cpu->avp or avp->cpu) */ | ||
70 | #define NVE276_OS_INTERRUPT_NOP (0x00000000) /* wake up avp */ | ||
71 | #define NVE276_OS_INTERRUPT_TIMEOUT (0x00000001) | ||
72 | #define NVE276_OS_INTERRUPT_SEMAPHORE_AWAKEN (0x00000002) | ||
73 | #define NVE276_OS_INTERRUPT_EXECUTE_AWAKEN (0x00000004) | ||
74 | #define NVE276_OS_INTERRUPT_DEBUG_STRING (0x00000008) | ||
75 | #define NVE276_OS_INTERRUPT_DH_KEYEXCHANGE (0x00000010) | ||
76 | #define NVE276_OS_INTERRUPT_APP_NOTIFY (0x00000020) | ||
77 | #define NVE276_OS_INTERRUPT_VIDEO_IDLE (0x00000040) | ||
78 | #define NVE276_OS_INTERRUPT_AUDIO_IDLE (0x00000080) | ||
79 | #define NVE276_OS_INTERRUPT_AVP_BREAKPOINT (0x00800000) | ||
80 | #define NVE276_OS_INTERRUPT_AVP_FATAL_ERROR (0x01000000) | ||
81 | |||
82 | struct nvavp_os_info { | ||
83 | u32 entry_offset; | ||
84 | u32 control_offset; | ||
85 | u32 debug_offset; | ||
86 | |||
87 | struct nvmap_handle_ref *handle; | ||
88 | void *data; | ||
89 | u32 size; | ||
90 | phys_addr_t phys; | ||
91 | void *os_bin; | ||
92 | phys_addr_t reset_addr; | ||
93 | }; | ||
94 | |||
95 | struct nvavp_ucode_info { | ||
96 | struct nvmap_handle_ref *handle; | ||
97 | void *data; | ||
98 | u32 size; | ||
99 | phys_addr_t phys; | ||
100 | void *ucode_bin; | ||
101 | }; | ||
102 | |||
103 | #endif /* __MEDIA_VIDEO_TEGRA_NVAVP_OS_H */ | ||