Skip to content

Commit 9a5bf6d

Browse files
Hari KanigeriLuis Henriques
authored andcommitted
SYSLINK: add syslink headers
Add syslink headers Signed-off-by: Suman Anna <[email protected]> Signed-off-by: Miguel Vadillo <[email protected]> Signed-off-by: Juan Gutierrez <[email protected]> Signed-off-by: Paul Hunt <[email protected]> Signed-off-by: Hari Kanigeri <[email protected]> Signed-off-by: Subramaniam C.A <[email protected]> Signed-off-by: Arun M G <[email protected]> Signed-off-by: Ramesh Gupta G <[email protected]> Signed-off-by: Jayan John <[email protected]> Signed-off-by: Angela Stegmaier <[email protected]> Signed-off-by: Arun Radhakrishnan <[email protected]> Signed-off-by: Subin Gangadharan <[email protected]>
1 parent 11bf54b commit 9a5bf6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+8377
-0
lines changed
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/*
2+
* GlobalTypes.h
3+
*
4+
* Syslink driver support for OMAP Processors.
5+
*
6+
* Copyright (C) 2008-2009 Texas Instruments, Inc.
7+
*
8+
* This package is free software; you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License version 2 as
10+
* published by the Free Software Foundation.
11+
*
12+
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13+
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14+
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15+
*/
16+
17+
#ifndef __GLOBALTYPES_H
18+
#define __GLOBALTYPES_H
19+
20+
#define REG volatile
21+
22+
/*
23+
* Definition: RET_CODE_BASE
24+
*
25+
* DESCRIPTION: Base value for return code offsets
26+
*
27+
*
28+
*/
29+
#define RET_CODE_BASE 0
30+
31+
/*
32+
* TYPE: ReturnCode_t
33+
*
34+
* DESCRIPTION: Return codes to be returned by all library functions
35+
*
36+
*
37+
*/
38+
enum ReturnCode_label {
39+
RET_OK = 0,
40+
RET_FAIL = -1,
41+
RET_BAD_NULL_PARAM = -2,
42+
RET_PARAM_OUT_OF_RANGE = -3,
43+
RET_INVALID_ID = -4,
44+
RET_EMPTY = -5,
45+
RET_FULL = -6,
46+
RET_TIMEOUT = -7,
47+
RET_INVALID_OPERATION = -8,
48+
/* Add new error codes at end of above list */
49+
RET_NUM_RET_CODES /* this should ALWAYS be LAST entry */
50+
};
51+
52+
53+
54+
/*
55+
* MACRO: RD_MEM_32_VOLATILE, WR_MEM_32_VOLATILE
56+
*
57+
* DESCRIPTION: 32 bit register access macros
58+
*
59+
*
60+
*/
61+
#define RD_MEM_32_VOLATILE(addr) \
62+
((unsigned long)(*((REG unsigned long *)(addr))))
63+
64+
#define WR_MEM_32_VOLATILE(addr, data) \
65+
(*((REG unsigned long *)(addr)) = (unsigned long)(data))
66+
67+
68+
69+
70+
#ifdef CHECK_INPUT_PARAMS
71+
/*
72+
* MACRO: CHECK_INPUT_PARAMS
73+
*
74+
* DESCRIPTION: Checks an input code and returns a specified value if code is
75+
* invalid value, also writes spy value if error found.
76+
*
77+
* NOTE: Can be disabled to save HW cycles.
78+
*
79+
*
80+
*/
81+
#define CHECK_INPUT_PARAM(actualValue, invalidValue, \
82+
returnCodeIfMismatch, spyCodeIfMisMatch) do {\
83+
if ((invalidValue) == (actualValue)) {\
84+
RES_Set((spyCodeIfMisMatch));\
85+
return returnCodeIfMismatch; \
86+
} \
87+
} while (0)
88+
89+
/*
90+
* MACRO: CHECK_INPUT_RANGE
91+
*
92+
* DESCRIPTION: Checks an input value and returns a specified value if not in
93+
* specified range, also writes spy value if error found.
94+
*
95+
* NOTE: Can be disabled to save HW cycles.
96+
*
97+
*
98+
*/
99+
#define CHECK_INPUT_RANGE(actualValue, minValidValue, maxValidValue, \
100+
returnCodeIfMismatch, spyCodeIfMisMatch) do {\
101+
if (((actualValue) < (minValidValue)) || \
102+
((actualValue) > (maxValidValue))) {\
103+
RES_Set((spyCodeIfMisMatch));\
104+
return returnCodeIfMismatch; \
105+
} \
106+
} while (0)
107+
108+
/*
109+
* MACRO: CHECK_INPUT_RANGE_MIN0
110+
*
111+
* DESCRIPTION: Checks an input value and returns a
112+
* specified value if not in
113+
* specified range, also writes spy value if error found.
114+
* The minimum
115+
* value is 0.
116+
*
117+
* NOTE: Can be disabled to save HW cycles.
118+
*
119+
*
120+
*/
121+
#define CHECK_INPUT_RANGE_MIN0(actualValue, maxValidValue, \
122+
returnCodeIfMismatch, spyCodeIfMisMatch) do {\
123+
if ((actualValue) > (maxValidValue)) {\
124+
RES_Set((spyCodeIfMisMatch));\
125+
return returnCodeIfMismatch; \
126+
} \
127+
} while (0)
128+
129+
#else
130+
131+
#define CHECK_INPUT_PARAM(actualValue, invalidValue, returnCodeIfMismatch,\
132+
spyCodeIfMisMatch)
133+
134+
#define CHECK_INPUT_PARAM_NO_SPY(actualValue, invalidValue, \
135+
returnCodeIfMismatch)
136+
137+
#define CHECK_INPUT_RANGE(actualValue, minValidValue, maxValidValue, \
138+
returnCodeIfMismatch, spyCodeIfMisMatch)
139+
140+
#define CHECK_INPUT_RANGE_NO_SPY(actualValue, minValidValue , \
141+
maxValidValue, returnCodeIfMismatch)
142+
143+
#define CHECK_INPUT_RANGE_MIN0(actualValue, maxValidValue, \
144+
returnCodeIfMismatch, spyCodeIfMisMatch)
145+
146+
#define CHECK_INPUT_RANGE_NO_SPY_MIN0(actualValue, \
147+
maxValidValue, returnCodeIfMismatch)
148+
149+
#endif
150+
151+
#ifdef __cplusplus
152+
}
153+
#endif
154+
#endif /* __GLOBALTYPES_H */
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* _listmp.h
3+
*
4+
* Internal definitions for shared memory doubly linked list.
5+
*
6+
* Copyright (C) 2008-2009 Texas Instruments, Inc.
7+
*
8+
* This package is free software; you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License version 2 as
10+
* published by the Free Software Foundation.
11+
*
12+
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13+
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14+
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
15+
* PURPOSE.
16+
*/
17+
18+
#ifndef __LISTMP_H_
19+
#define __LISTMP_H_
20+
21+
/* Standard headers */
22+
#include <linux/types.h>
23+
#include <linux/list.h>
24+
25+
#include <listmp.h>
26+
#include <sharedregion.h>
27+
28+
/* Unique module ID. */
29+
#define LISTMP_MODULEID (0xa413)
30+
31+
/* Created tag */
32+
#define LISTMP_CREATED 0x12181964
33+
34+
35+
/* Structure defining shared memory attributes for the ListMP module. */
36+
struct listmp_attrs {
37+
u32 status;
38+
u32 *gatemp_addr;
39+
struct listmp_elem head;
40+
};
41+
42+
/* Structure defining config parameters for the ListMP module. */
43+
struct listmp_config {
44+
uint max_runtime_entries;
45+
/* Maximum number of ListMP's that can be dynamically created and
46+
added to the NameServer. */
47+
uint max_name_len; /* Maximum length of name */
48+
};
49+
50+
51+
/* Structure defining processor related information for the ListMP module. */
52+
struct listmp_proc_attrs {
53+
bool creator; /* Creator or opener */
54+
u16 proc_id; /* Processor Identifier */
55+
u32 open_count; /* How many times it is opened on a processor */
56+
};
57+
58+
59+
/* Function to get the configuration */
60+
void listmp_get_config(struct listmp_config *cfg_params);
61+
62+
/* Function to setup the listmp module */
63+
int listmp_setup(const struct listmp_config *config);
64+
65+
/* Function to destroy the listmp module */
66+
int listmp_destroy(void);
67+
68+
#endif /* __LISTMP_H_ */
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* _notify.h
3+
*
4+
* The MessageQ module supports the structured sending and receiving of
5+
* variable length messages. This module can be used for homogeneous or
6+
* heterogeneous multi-processor messaging.
7+
*
8+
* Copyright (C) 2009 Texas Instruments, Inc.
9+
*
10+
* This package is free software; you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License version 2 as
12+
* published by the Free Software Foundation.
13+
*
14+
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15+
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16+
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
17+
* PURPOSE.
18+
*/
19+
20+
#if !defined(__NOTIFY_H_)
21+
#define __NOTIFY_H_
22+
23+
24+
/* Module headers */
25+
#include <syslink/notify.h>
26+
27+
28+
/* Module ID for notify. */
29+
#define NOTIFY_MODULEID ((u16) 0x5F84)
30+
31+
/* Mask to check for event ID. */
32+
#define NOTIFY_EVENT_MASK ((u16) 0xFFFF)
33+
34+
#define ISRESERVED(event_id, reserved_event) \
35+
(((event_id & NOTIFY_EVENT_MASK) >= reserved_event) || \
36+
((event_id >> 16) == NOTIFY_SYSTEMKEY))
37+
38+
/* This structure defines attributes for initialization of the notify module. */
39+
struct notify_config {
40+
u32 num_events;
41+
/* Number of events to be supported */
42+
u32 send_event_poll_count;
43+
/* Poll for specified amount before send_event times out */
44+
u32 num_lines;
45+
/* Max. number of interrupt lines between a single pair of processors */
46+
u32 reserved_events;
47+
/* Number of reserved events to be supported */
48+
};
49+
50+
/* This structure defines the configuration structure for initialization
51+
* of the notify object. */
52+
struct notify_params {
53+
u32 reserved; /* Reserved field */
54+
};
55+
56+
57+
/* Function to get the default configuration for the notify module. */
58+
void notify_get_config(struct notify_config *cfg);
59+
60+
/* Function to setup the notify module */
61+
int notify_setup(struct notify_config *cfg);
62+
63+
/* Function to destroy the notify module */
64+
int notify_destroy(void);
65+
66+
/* Function to create an instance of notify driver */
67+
struct notify_object *notify_create(void *driver_handle, u16 remote_proc_id,
68+
u16 line_id, const struct notify_params *params);
69+
70+
/* Function to delete an instance of notify driver */
71+
int notify_delete(struct notify_object **handle_ptr);
72+
73+
/* Function to call device specific the notify module setup */
74+
int notify_attach(u16 proc_id, void *shared_addr);
75+
76+
/* Function to destroy the device specific notify module */
77+
int notify_detach(u16 proc_id);
78+
79+
/* Function registered as callback with the notify driver */
80+
void notify_exec(struct notify_object *obj, u32 event_id, u32 payload);
81+
82+
83+
#endif /* !defined(__NOTIFY_H_) */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* _sysmgr.h
3+
*
4+
* Defines for system manager functions
5+
*
6+
* Copyright (C) 2009 Texas Instruments, Inc.
7+
*
8+
* This package is free software; you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License version 2 as
10+
* published by the Free Software Foundation.
11+
*
12+
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13+
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14+
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
15+
* PURPOSE.
16+
*/
17+
18+
#ifndef __SYSMGR_H_
19+
#define __SYSMGR_H_
20+
21+
/* Structure to retrieve the scalability proc info from the slave */
22+
struct sysmgr_proc_config {
23+
u32 proc_id;
24+
u32 use_notify;
25+
u32 use_messageq;
26+
u32 use_heapbuf;
27+
u32 use_frameq;
28+
u32 use_ringio;
29+
u32 use_listmp;
30+
u32 use_nameserver;
31+
u32 boot_mode;
32+
};
33+
34+
/* Function to set the boot load page address for a slave */
35+
void sysmgr_set_boot_load_page(u16 proc_id, u32 boot_load_page);
36+
37+
/* Function to get configuration values for a host object(component/instance) */
38+
u32 sysmgr_get_object_config(u16 proc_id, void *config, u32 cmd_id, u32 size);
39+
40+
/* Function to put configuration values for a slave object(component/instance)*/
41+
u32 sysmgr_put_object_config(u16 proc_id, void *config, u32 cmd_id, u32 size);
42+
43+
/* Function to wait for scalability handshake value. */
44+
void sysmgr_wait_for_scalability_info(u16 proc_id);
45+
46+
/* Function to wait for slave to complete setup */
47+
void sysmgr_wait_for_slave_setup(u16 proc_id);
48+
49+
50+
#endif /* ifndef __SYSMGR_H_ */

0 commit comments

Comments
 (0)