summaryrefslogtreecommitdiff
path: root/drivers/staging/nmf-cm/configuration.h
blob: 8f1b88bc23f4f3a18f9086c8c2acd980f41b490a (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
/*
 * Copyright (C) ST-Ericsson SA 2010
 * Author: Pierre Peiffer <pierre.peiffer@stericsson.com> for ST-Ericsson.
 * License terms: GNU General Public License (GPL), version 2.
 */

#ifndef CONFIGURATION_H
#define CONFIGURATION_H

/** Peripherals description.
 * Some of these values are taken from kernel header description (which should be the
 * right place of these definition); the missing ones are defined here.
 */

#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
#include <generated/autoconf.h>
#else
#include <linux/autoconf.h>
#endif

/** Nomadik embedded Static RAM base address*/
#define ESRAM_BASE (U8500_ESRAM_BASE + 0x10000) // V1/V2 config: 0-64k: secure;

/** Nomadik embedded ram size for CM (in Kb) */
#define ESRAM_SIZE 576
enum {
	ESRAM_12,
	ESRAM_34,
	NB_ESRAM,
};

/** MPCs */
enum {
	SVA,
	SIA,
	NB_MPC,
};
#define COREIDX(id) (id-1)

/** Base address of shared SDRAM: use upper SDRAM. We reserve a rather */
#define SDRAM_CODE_SIZE_SVA (2*ONE_KB)
#define SDRAM_CODE_SIZE_SIA (2*ONE_KB)
#define SDRAM_DATA_SIZE     (8*ONE_KB)

extern bool cfgCommunicationLocationInSDRAM;
extern bool cfgSemaphoreTypeHSEM;
extern int cfgESRAMSize;

int init_config(void);

#define DECLARE_MPC_PARAM(mpc, sdramDataSize, extension, ybank)		\
	static unsigned int cfgMpcYBanks_##mpc = ybank;			\
	module_param(cfgMpcYBanks_##mpc, uint, S_IRUGO);		\
	MODULE_PARM_DESC(cfgMpcYBanks_##mpc, "Nb of Y-Ram banks used on " #mpc); \
									\
	static int          cfgSchedulerTypeHybrid_##mpc = 1;		\
	module_param(cfgSchedulerTypeHybrid_##mpc, bool, S_IRUGO);	\
	MODULE_PARM_DESC(cfgSchedulerTypeHybrid_##mpc, "Scheduler used on " #mpc " (Hybrid or Synchronous)"); \
									\
	static unsigned int cfgMpcSDRAMCodeSize_##mpc = SDRAM_CODE_SIZE_##mpc; \
	module_param(cfgMpcSDRAMCodeSize_##mpc, uint, S_IRUGO);		\
	MODULE_PARM_DESC(cfgMpcSDRAMCodeSize_##mpc, "Size of code segment on " #mpc " (in Kb)"); \
									\
	static unsigned int cfgMpcSDRAMDataSize_##mpc = sdramDataSize;	\
	module_param(cfgMpcSDRAMDataSize_##mpc, uint, S_IRUGO);		\
	MODULE_PARM_DESC(cfgMpcSDRAMDataSize_##mpc, "Size of data segment on " #mpc " (in Kb)" extension)

#endif