4
* Many multi-processor modules have the concept of processor id. multiproc
5
* centeralizes the processor id management.
7
* Copyright (C) 2008-2009 Texas Instruments, Inc.
9
* This package is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License version 2 as
11
* published by the Free Software Foundation.
13
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
22
#include <linux/types.h>
25
#define VOLATILE volatile
30
#define MULTIPROC_MODULEID (u16)0xB522
32
/* Macro to define invalid processor id */
33
#define MULTIPROC_INVALIDID ((u16)0xFFFF)
36
* Maximum number of processors in the system
37
* OMAP4 has 4 processors in single core.
39
#define MULTIPROC_MAXPROCESSORS 4
42
* Max name length for a processor name
44
#define MULTIPROC_MAXNAMELENGTH 32
47
* Configuration structure for multiproc module
49
struct multiproc_config {
50
s32 num_processors; /* Number of procs for particular system */
51
char name_list[MULTIPROC_MAXPROCESSORS][MULTIPROC_MAXNAMELENGTH];
52
/* Name List for processors in the system */
53
u16 id; /* Local Proc ID. This needs to be set before calling any
57
/* =============================================================================
59
* =============================================================================
62
/* Function to get the default configuration for the multiproc module. */
63
void multiproc_get_config(struct multiproc_config *cfg);
65
/* Function to setup the multiproc Module */
66
s32 multiproc_setup(struct multiproc_config *cfg);
68
/* Function to destroy the multiproc module */
69
s32 multiproc_destroy(void);
71
/* Function to set local processor Id */
72
int multiproc_set_local_id(u16 proc_id);
74
/* Function to get processor id from processor name. */
75
u16 multiproc_get_id(const char *proc_name);
77
/* Function to get name from processor id. */
78
char *multiproc_get_name(u16 proc_id);
80
/* Function to get number of processors in the system. */
81
u16 multiproc_get_num_processors(void);
83
/* Return Id of current processor */
84
u16 multiproc_self(void);
86
/* Determines the offset for any two processors. */
87
u32 multiproc_get_slot(u16 remote_proc_id);
89
#endif /* _MULTIPROC_H_ */