summaryrefslogtreecommitdiff
path: root/drivers/staging/nmf-cm/configuration.h
blob: 39416cde6862641859e199b064f7a3e6474fc77f (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
/*
 * 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

/* Embedded Static RAM base address */
/* config: 0-64k: secure */
#define ESRAM_BASE (U8500_ESRAM_BASE + U8500_ESRAM_DMA_LCPA_OFFSET)

/*
 * Embedded ram size for CM (in Kb)
 * 5 banks of 128k: skip the first half bank (secure) and the last
 * one (used for MCDE/B2R2), but include DMA part (4k after the secure part)
 * to give access from DSP side
 */
#define ESRAM_SIZE 448
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 bool         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