summaryrefslogtreecommitdiff
path: root/drivers/dsp/syslink/procmgr/procdefs.h
blob: d28025835aad387698637f1a1dd2649b321d925c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * procdefs.h
 *
 * Syslink driver support functions for TI OMAP processors.
 *
 * Copyright (C) 2009-2010 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef SYSLINK_PROCDEFS_H
#define SYSLINK_PROCDEFS_H

#include <linux/types.h>

/* Module level headers */
#include <procmgr.h>


/* =============================
 *  Macros and types
 * =============================
 */
/*
 * Enumerates the types of Endianism of slave processor.
 */
enum processor_endian{
	PROCESSOR_ENDIAN_DEFAULT = 0,
	/* Default endianism (no conversion required) */
	PROCESSOR_ENDIAN_BIG = 1,
	/* Big endian */
	PROCESSOR_ENDIAN_LITTLE = 2,
	/* Little endian */
	PROCESSOR_ENDIAN_ENDVALUE = 3
	/* End delimiter indicating start of invalid values for this enum */
};


/*
 * Configuration parameters for attaching to the slave Processor
 */
struct processor_attach_params {
	struct proc_mgr_attach_params *params;
	/* Common attach parameters for ProcMgr */
	u16 num_mem_entries;
	/* Number of valid memory entries */
	struct proc_mgr_addr_info mem_entries[PROCMGR_MAX_MEMORY_REGIONS];
	/* Configuration of memory regions */
};

/*
 * Function pointer type for the function to attach to the processor.
 */
typedef int (*processor_attach_fxn) (void *handle,
				struct processor_attach_params *params);

/*
 * Function pointer type for the function to detach from the
 * procssor
 */
typedef int (*processor_detach_fxn) (void *handle);

/*
 * Function pointer type for the function to read from the slave
 *		processor's memory.
 */
typedef int (*processor_read_fxn) (void *handle, u32 proc_addr,
				u32 *num_bytes, void *buffer);

/*
 *Function pointer type for the function to write into the slave
 *processor's memory.
 */
typedef int (*processor_write_fxn) (void *handle, u32 proc_addr,
				u32 *num_bytes, void *buffer);

/*
 *Function pointer type for the function to perform device-dependent
 *		operations.
 */
typedef int (*processor_control_fxn) (void *handle, int cmd, void *arg);

/*
 *Function pointer type for the function to translate between
 *		two types of address spaces.
 */
typedef int (*processor_translate_addr_fxn) (void *handle, void **dst_addr,
		enum proc_mgr_addr_type dstAddrType, void *srcAddr,
		enum proc_mgr_addr_type srcAddrType);

/*
 *Function pointer type for the function that returns proc info
 */
typedef int (*processor_proc_info) (void *handle,
				struct  proc_mgr_proc_info *proc_info);

/*
 *Function pointer type for the function that returns proc info
 */
typedef int (*processor_virt_to_phys_fxn) (void *handle, u32 da,
			u32 *mapped_entries, u32 num_of_entries);


/* =============================
 *  Function table interface
 * =============================
 */
/*
 *Function table interface for Processor.
 */
struct processor_fxn_table {
	processor_attach_fxn attach;
	/* Function to attach to the slave processor */
	processor_detach_fxn detach;
	/* Function to detach from the slave processor */
	processor_read_fxn read;
	/* Function to read from the slave processor's memory */
	processor_write_fxn write;
	/* Function to write into the slave processor's memory */
	processor_control_fxn  control;
	/* Function to perform device-dependent control function */
	processor_translate_addr_fxn translateAddr;
	/* Function to translate between address ranges */
	processor_proc_info procinfo;
	/* Function to convert Virtual to Physical pages */
	processor_virt_to_phys_fxn virt_to_phys;
};

/* =============================
 * Processor structure
 * =============================
 */
/*
 *  Generic Processor object. This object defines the handle type for all
 *  Processor operations.
 */
struct processor_object {
	struct processor_fxn_table proc_fxn_table;
	/* interface function table to plug into the generic Processor. */
	enum proc_mgr_state state;
	/* State of the slave processor */
	enum proc_mgr_boot_mode boot_mode;
	/* Boot mode for the slave processor. */
	void *object;
	/* Pointer to Processor-specific object. */
	u16 proc_id;
	/* Processor ID addressed by this Processor instance. */
};
#endif