aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorZiyan <jaraidaniel@gmail.com>2015-05-01 18:23:56 +0200
committerZiyan <jaraidaniel@gmail.com>2015-05-01 18:23:56 +0200
commit5eee0b4d3f7b5bf9abb66b2191d8190e2aae2333 (patch)
treedcc929c505edb0d9f2d9647dc28eeab639476d39 /arch/arm
parent7b3037e9b35620164f48ae08e187b62c2ecba463 (diff)
downloadkernel_samsung_tuna-5eee0b4d3f7b5bf9abb66b2191d8190e2aae2333.zip
kernel_samsung_tuna-5eee0b4d3f7b5bf9abb66b2191d8190e2aae2333.tar.gz
kernel_samsung_tuna-5eee0b4d3f7b5bf9abb66b2191d8190e2aae2333.tar.bz2
[TEST] revert rpc/rpmsg changes
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/remoteproc.c162
-rw-r--r--arch/arm/plat-omap/Kconfig11
-rw-r--r--arch/arm/plat-omap/devices.c48
-rw-r--r--arch/arm/plat-omap/include/plat/dsp.h2
-rw-r--r--arch/arm/plat-omap/include/plat/remoteproc.h101
-rw-r--r--arch/arm/plat-omap/include/plat/rpres.h2
-rw-r--r--arch/arm/plat-omap/omap_rpmsg.c129
7 files changed, 41 insertions, 414 deletions
diff --git a/arch/arm/mach-omap2/remoteproc.c b/arch/arm/mach-omap2/remoteproc.c
index 07600ea..b8ae36f 100644
--- a/arch/arm/mach-omap2/remoteproc.c
+++ b/arch/arm/mach-omap2/remoteproc.c
@@ -20,85 +20,17 @@
#include <linux/slab.h>
#include <linux/remoteproc.h>
#include <linux/memblock.h>
-#include <plat/common.h>
#include <plat/omap_device.h>
#include <plat/omap_hwmod.h>
#include <plat/remoteproc.h>
#include <plat/dsp.h>
#include <plat/io.h>
#include "cm2_44xx.h"
-#include "cm1_44xx.h"
#include "cm-regbits-44xx.h"
#define OMAP4430_CM_M3_M3_CLKCTRL (OMAP4430_CM2_BASE + OMAP4430_CM2_CORE_INST \
+ OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET)
-#define OMAP4430_CM_DSP_DSP_CLKCTRL (OMAP4430_CM1_BASE \
- + OMAP4430_CM1_TESLA_INST + OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET)
-
-#define CONTROL_DSP_BOOTADDR (0x4A002304)
-
-static void dump_ipu_registers(struct rproc *rproc)
-{
- unsigned long flags;
- char buf[64];
- struct pt_regs regs;
-
- if (!rproc->cdump_buf1)
- return;
-
- remoteproc_fill_pt_regs(&regs,
- (struct exc_regs *)rproc->cdump_buf1);
-
- pr_info("REGISTER DUMP FOR REMOTEPROC %s\n", rproc->name);
- pr_info("PC is at %08lx\n", instruction_pointer(&regs));
- pr_info("LR is at %08lx\n", regs.ARM_lr);
- pr_info("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n"
- "sp : %08lx ip : %08lx fp : %08lx\n",
- regs.ARM_pc, regs.ARM_lr, regs.ARM_cpsr,
- regs.ARM_sp, regs.ARM_ip, regs.ARM_fp);
- pr_info("r10: %08lx r9 : %08lx r8 : %08lx\n",
- regs.ARM_r10, regs.ARM_r9,
- regs.ARM_r8);
- pr_info("r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n",
- regs.ARM_r7, regs.ARM_r6,
- regs.ARM_r5, regs.ARM_r4);
- pr_info("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
- regs.ARM_r3, regs.ARM_r2,
- regs.ARM_r1, regs.ARM_r0);
-
- flags = regs.ARM_cpsr;
- buf[0] = flags & PSR_N_BIT ? 'N' : 'n';
- buf[1] = flags & PSR_Z_BIT ? 'Z' : 'z';
- buf[2] = flags & PSR_C_BIT ? 'C' : 'c';
- buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
- buf[4] = '\0';
-
- pr_info("Flags: %s IRQs o%s FIQs o%s\n",
- buf, interrupts_enabled(&regs) ? "n" : "ff",
- fast_interrupts_enabled(&regs) ? "n" : "ff");
-}
-
-static void dump_dsp_registers(struct rproc *rproc)
-{
- struct exc_dspRegs *regs;
-
- regs = (struct exc_dspRegs *)rproc->cdump_buf0;
-
- pr_info("REGISTER DUMP FOR REMOTEPROC %s\n", rproc->name);
- pr_info("PC is at %08x\n", regs->IRP);
- pr_info("SP is at %08x\n", regs->b15);
- pr_info("pc : [<%08x>] sp : [<%08x>]", regs->IRP, regs->b15);
-}
-
-static struct rproc_ops ipu_ops = {
- .dump_registers = dump_ipu_registers,
-};
-
-static struct rproc_ops dsp_ops = {
- .dump_registers = dump_dsp_registers,
-};
-
static struct omap_rproc_timers_info ipu_timers[] = {
{ .id = 3 },
{ .id = 4 },
@@ -108,30 +40,13 @@ static struct omap_rproc_timers_info ipu_timers[] = {
#endif
};
-static struct omap_rproc_timers_info dsp_timers[] = {
- { .id = 5 },
-#ifdef CONFIG_REMOTEPROC_WATCHDOG
- { .id = 6 },
-#endif
-};
-
static struct omap_rproc_pdata omap4_rproc_data[] = {
{
.name = "dsp",
.iommu_name = "tesla",
.firmware = "tesla-dsp.bin",
.oh_name = "dsp_c0",
- .clkdm_name = "tesla_clkdm",
- .timers = dsp_timers,
- .timers_cnt = ARRAY_SIZE(dsp_timers),
- .idle_addr = OMAP4430_CM_DSP_DSP_CLKCTRL,
- .idle_mask = OMAP4430_STBYST_MASK,
- .suspend_addr = 0xad6e134c,
- .suspend_mask = ~0,
- .sus_timeout = 5000,
- .sus_mbox_name = "mailbox-2",
- .boot_reg = CONTROL_DSP_BOOTADDR,
- .ops = &dsp_ops,
+ .clkdm_name = "dsp_clkdm",
},
{
.name = "ipu",
@@ -148,7 +63,6 @@ static struct omap_rproc_pdata omap4_rproc_data[] = {
.suspend_mask = ~0,
.sus_timeout = 5000,
.sus_mbox_name = "mailbox-1",
- .ops = &ipu_ops,
},
};
@@ -161,49 +75,37 @@ static struct omap_device_pm_latency omap_rproc_latency[] = {
static struct rproc_mem_pool *omap_rproc_get_pool(const char *name)
{
struct rproc_mem_pool *pool = NULL;
- phys_addr_t paddr1;
- phys_addr_t paddr2;
- u32 len1;
- u32 len2;
- /* get ipu mempool */
+ /* check for ipu currently. dsp will be handled later */
if (!strcmp("ipu", name)) {
- paddr1 = omap_ipu_get_mempool_base(
+ phys_addr_t paddr1 = omap_ipu_get_mempool_base(
OMAP_RPROC_MEMPOOL_STATIC);
- paddr2 = omap_ipu_get_mempool_base(
+ phys_addr_t paddr2 = omap_ipu_get_mempool_base(
OMAP_RPROC_MEMPOOL_DYNAMIC);
- len1 = omap_ipu_get_mempool_size(OMAP_RPROC_MEMPOOL_STATIC);
- len2 = omap_ipu_get_mempool_size(OMAP_RPROC_MEMPOOL_DYNAMIC);
- /* get dsp mempool*/
- } else if (!strcmp("dsp", name)) {
- paddr1 = omap_dsp_get_mempool_tbase(
- OMAP_RPROC_MEMPOOL_STATIC);
- paddr2 = omap_dsp_get_mempool_tbase(
- OMAP_RPROC_MEMPOOL_DYNAMIC);
- len1 = omap_dsp_get_mempool_tsize(OMAP_RPROC_MEMPOOL_STATIC);
- len2 = omap_dsp_get_mempool_tsize(OMAP_RPROC_MEMPOOL_DYNAMIC);
- } else
- return pool;
-
- if (!paddr1 && !paddr2) {
- pr_err("%s - no carveout memory is available at all\n", name);
- return pool;
- }
- if (!paddr1 || !len1)
- pr_warn("%s - static memory is unavailable: 0x%x, 0x%x\n",
- name, paddr1, len1);
- if (!paddr2 || !len2)
- pr_warn("%s - carveout memory is unavailable: 0x%x, 0x%x\n",
- name, paddr2, len2);
+ u32 len1 = omap_ipu_get_mempool_size(OMAP_RPROC_MEMPOOL_STATIC);
+ u32 len2 = omap_ipu_get_mempool_size(OMAP_RPROC_MEMPOOL_DYNAMIC);
- pool = kzalloc(sizeof(*pool), GFP_KERNEL);
- if (pool) {
- pool->st_base = paddr1;
- pool->st_size = len1;
- pool->mem_base = paddr2;
- pool->mem_size = len2;
- pool->cur_base = paddr2;
- pool->cur_size = len2;
+ if (!paddr1 && !paddr2) {
+ pr_err("no carveout memory available at all for "
+ "remotproc\n");
+ return pool;
+ }
+ if (!paddr1 || !len1)
+ pr_warn("static memory is unavailable: 0x%x, 0x%x\n",
+ paddr1, len1);
+ if (!paddr2 || !len2)
+ pr_warn("carveout memory is unavailable: 0x%x, 0x%x\n",
+ paddr2, len2);
+
+ pool = kzalloc(sizeof(*pool), GFP_KERNEL);
+ if (pool) {
+ pool->st_base = paddr1;
+ pool->st_size = len1;
+ pool->mem_base = paddr2;
+ pool->mem_size = len2;
+ pool->cur_base = paddr2;
+ pool->cur_size = len2;
+ }
}
return pool;
@@ -225,17 +127,7 @@ static int __init omap_rproc_init(void)
const char *oh_name_opt = omap4_rproc_data[i].oh_name_opt;
oh_count = 0;
- if (omap_total_ram_size() == SZ_512M) {
- if (!strcmp("ipu", omap4_rproc_data[i].name))
- omap4_rproc_data[i].firmware =
- "ducati-m3.512MB.bin";
- else if (!strcmp("dsp", omap4_rproc_data[i].name))
- omap4_rproc_data[i].firmware =
- "tesla-dsp.512MB.bin";
- }
-
oh[0] = omap_hwmod_lookup(oh_name);
-
if (!oh[0]) {
pr_err("could not look up %s\n", oh_name);
continue;
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 1d374bb..c41d948 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -273,21 +273,12 @@ config OMAP_TEMP_SENSOR
# this carveout should probably become generic and not omap specific
config OMAP_REMOTEPROC_MEMPOOL_SIZE
hex "Physical carveout memory pool size (Byte)"
- depends on OMAP_REMOTE_PROC_IPU
+ depends on OMAP_REMOTE_PROC
default 0x700000
help
Allocate specified size of memory at boot time so we can ioremap
it safely.
-config OMAP_REMOTEPROC_MEMPOOL_SIZE_DSP
- hex "Physical carveout memory pool size for DSP (Byte)"
- depends on OMAP_REMOTE_PROC_DSP
- default 0x400000
- help
- Allocate specified size of memory at boot time so we can ioremap
- it safely. This memory will be used for the DSP remote processor
- only.
-
choice
prompt "OMAP PM layer selection"
depends on ARCH_OMAP
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 548cd19..70d8f8d 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -235,19 +235,14 @@ static void omap_init_uwire(void)
static inline void omap_init_uwire(void) {}
#endif
-#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) \
- || defined(CONFIG_OMAP_REMOTE_PROC_DSP)
+#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
static phys_addr_t omap_dsp_phys_mempool_base;
static phys_addr_t omap_dsp_phys_mempool_size;
void __init omap_dsp_reserve_sdram_memblock(void)
{
-#if defined(CONFIG_OMAP_REMOTE_PROC_DSP)
- phys_addr_t size = CONFIG_OMAP_REMOTEPROC_MEMPOOL_SIZE_DSP;
-#else
phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
-#endif
phys_addr_t paddr;
if (!size)
@@ -265,9 +260,7 @@ void __init omap_dsp_reserve_sdram_memblock(void)
omap_dsp_phys_mempool_base = paddr;
omap_dsp_phys_mempool_size = size;
}
-#endif
-#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
phys_addr_t omap_dsp_get_mempool_base(void)
{
return omap_dsp_phys_mempool_base;
@@ -281,44 +274,7 @@ phys_addr_t omap_dsp_get_mempool_size(void)
EXPORT_SYMBOL(omap_dsp_get_mempool_size);
#endif
-#if defined(CONFIG_OMAP_REMOTE_PROC_DSP)
-static phys_addr_t omap_dsp_phys_st_mempool_base;
-static phys_addr_t omap_dsp_phys_st_mempool_size;
-
-void __init omap_dsp_set_static_mempool(u32 start, u32 size)
-{
- omap_dsp_phys_st_mempool_base = start;
- omap_dsp_phys_st_mempool_size = size;
-}
-
-phys_addr_t omap_dsp_get_mempool_tbase(enum omap_rproc_mempool_type type)
-{
- switch (type) {
- case OMAP_RPROC_MEMPOOL_STATIC:
- return omap_dsp_phys_st_mempool_base;
- case OMAP_RPROC_MEMPOOL_DYNAMIC:
- return omap_dsp_phys_mempool_base;
- default:
- return 0;
- }
-}
-EXPORT_SYMBOL(omap_dsp_get_mempool_tbase);
-
-phys_addr_t omap_dsp_get_mempool_tsize(enum omap_rproc_mempool_type type)
-{
- switch (type) {
- case OMAP_RPROC_MEMPOOL_STATIC:
- return omap_dsp_phys_st_mempool_size;
- case OMAP_RPROC_MEMPOOL_DYNAMIC:
- return omap_dsp_phys_mempool_size;
- default:
- return 0;
- }
-}
-EXPORT_SYMBOL(omap_dsp_get_mempool_tsize);
-#endif
-
-#if defined(CONFIG_OMAP_REMOTE_PROC_IPU)
+#if defined(CONFIG_OMAP_REMOTE_PROC)
static phys_addr_t omap_ipu_phys_mempool_base;
static u32 omap_ipu_phys_mempool_size;
static phys_addr_t omap_ipu_phys_st_mempool_base;
diff --git a/arch/arm/plat-omap/include/plat/dsp.h b/arch/arm/plat-omap/include/plat/dsp.h
index 6bf52c4..14f1228 100644
--- a/arch/arm/plat-omap/include/plat/dsp.h
+++ b/arch/arm/plat-omap/include/plat/dsp.h
@@ -26,7 +26,7 @@ struct omap_dsp_platform_data {
extern void omap_dsp_reserve_sdram_memblock(void);
phys_addr_t omap_dsp_get_mempool_size(void);
phys_addr_t omap_dsp_get_mempool_base(void);
-#elif !defined(CONFIG_OMAP_REMOTE_PROC_DSP)
+#else
static inline void omap_dsp_reserve_sdram_memblock(void) { }
static inline phys_addr_t omap_dsp_get_mempool_size(void) { return 0; }
static inline phys_addr_t omap_dsp_get_mempool_base(void) { return 0; }
diff --git a/arch/arm/plat-omap/include/plat/remoteproc.h b/arch/arm/plat-omap/include/plat/remoteproc.h
index e1a823a..3de2a38 100644
--- a/arch/arm/plat-omap/include/plat/remoteproc.h
+++ b/arch/arm/plat-omap/include/plat/remoteproc.h
@@ -41,9 +41,9 @@ struct omap_rproc_timers_info {
* @clkdm_name: name of clock domain in which this device is located
* @clkdm: clock domain in which this device is located
* @ops: platform-specific start/stop rproc handlers
+ * @memory_maps: table of da-to-pa iommu memory maps
* @memory_pool: platform-specific pool data
* @omap_rproc_timers_info: optional, timer(s) rproc can use
- * @boot_reg: optional, control register for storing boot address
*/
struct omap_rproc_pdata {
const char *name;
@@ -61,7 +61,6 @@ struct omap_rproc_pdata {
u32 suspend_addr;
u32 suspend_mask;
unsigned sus_timeout;
- u32 boot_reg;
char *sus_mbox_name;
u8 timers_cnt;
};
@@ -71,26 +70,7 @@ enum omap_rproc_mempool_type {
OMAP_RPROC_MEMPOOL_DYNAMIC
};
-#if defined(CONFIG_OMAP_REMOTE_PROC_DSP)
-extern void omap_dsp_reserve_sdram_memblock(void);
-phys_addr_t omap_dsp_get_mempool_tsize(enum omap_rproc_mempool_type type);
-phys_addr_t omap_dsp_get_mempool_tbase(enum omap_rproc_mempool_type type);
-void omap_dsp_set_static_mempool(u32 start, u32 size);
-#else
-static inline phys_addr_t omap_dsp_get_mempool_tsize
- (enum omap_rproc_mempool_type type)
-{
- return 0;
-}
-static inline phys_addr_t omap_dsp_get_mempool_tbase(
- enum omap_rproc_mempool_type type)
-{
- return 0;
-}
-static inline void omap_dsp_set_static_mempool(u32 start, u32 size) { }
-#endif
-
-#if defined(CONFIG_OMAP_REMOTE_PROC_IPU)
+#if defined(CONFIG_OMAP_REMOTE_PROC)
void omap_ipu_reserve_sdram_memblock(void);
u32 omap_ipu_get_mempool_size(enum omap_rproc_mempool_type type);
phys_addr_t omap_ipu_get_mempool_base(enum omap_rproc_mempool_type type);
@@ -145,83 +125,6 @@ struct exc_regs {
u32 AFSR;
};
-struct exc_dspRegs {
- u32 ILC;
- u32 RILC;
- u32 AMR;
- u32 SSR;
- u32 IRP;
- u32 NRP;
- u32 ITSR;
- u32 NTSR;
- u32 EFR;
- u32 IERR;
- u32 b30;
- u32 b31;
- u32 b28;
- u32 b29;
- u32 b26;
- u32 b27;
- u32 b24;
- u32 b25;
- u32 b22;
- u32 b23;
- u32 b20;
- u32 b21;
- u32 b18;
- u32 b19;
- u32 b16;
- u32 b17;
- u32 b14;
- u32 b15;
- u32 b12;
- u32 b13;
- u32 b10;
- u32 b11;
- u32 b8;
- u32 b9;
- u32 b6;
- u32 b7;
- u32 b4;
- u32 b5;
- u32 b2;
- u32 b3;
- u32 b0;
- u32 b1;
- u32 a30;
- u32 a31;
- u32 a28;
- u32 a29;
- u32 a26;
- u32 a27;
- u32 a24;
- u32 a25;
- u32 a22;
- u32 a23;
- u32 a20;
- u32 a21;
- u32 a18;
- u32 a19;
- u32 a16;
- u32 a17;
- u32 a14;
- u32 a15;
- u32 a12;
- u32 a13;
- u32 a10;
- u32 a11;
- u32 a8;
- u32 a9;
- u32 a6;
- u32 a7;
- u32 a4;
- u32 a5;
- u32 a2;
- u32 a3;
- u32 a0;
- u32 a1;
-};
-
static inline void remoteproc_fill_pt_regs(struct pt_regs *regs,
struct exc_regs *xregs)
{
diff --git a/arch/arm/plat-omap/include/plat/rpres.h b/arch/arm/plat-omap/include/plat/rpres.h
index 08ca599..0dfb781 100644
--- a/arch/arm/plat-omap/include/plat/rpres.h
+++ b/arch/arm/plat-omap/include/plat/rpres.h
@@ -54,6 +54,4 @@ struct rpres {
struct rpres *rpres_get(const char *);
void rpres_put(struct rpres *);
int rpres_set_constraints(struct rpres *, enum rpres_constraint type, long val);
-unsigned long rpres_get_max_freq(struct rpres *obj);
-
#endif /* _PLAT_OMAP_RPRES_H */
diff --git a/arch/arm/plat-omap/omap_rpmsg.c b/arch/arm/plat-omap/omap_rpmsg.c
index 8d85393..8ece479 100644
--- a/arch/arm/plat-omap/omap_rpmsg.c
+++ b/arch/arm/plat-omap/omap_rpmsg.c
@@ -60,9 +60,6 @@ struct omap_rpmsg_vproc {
int base_vq_id;
int num_of_vqs;
struct rpmsg_channel_info *hardcoded_chnls;
- unsigned long bootcstr_freq;
- unsigned int bootcstr_type;
- bool bootcstr_set;
};
#define to_omap_rpdev(vd) container_of(vd, struct omap_rpmsg_vproc, vdev)
@@ -100,7 +97,6 @@ struct omap_rpmsg_vq_info {
/* The total IPC space needed to communicate with a remote processor */
#define RPMSG_IPC_MEM (RPMSG_BUFS_SPACE + 2 * RPMSG_RING_SIZE)
-#if defined(CONFIG_OMAP_REMOTE_PROC_IPU) || defined(CONFIG_OMAP_REMOTE_PROC_DSP)
/* provide drivers with platform-specific details */
static void omap_rpmsg_get(struct virtio_device *vdev, unsigned int request,
void *buf, unsigned len)
@@ -142,11 +138,6 @@ static void omap_rpmsg_get(struct virtio_device *vdev, unsigned int request,
BUG_ON(len != sizeof(rpdev->hardcoded_chnls));
memcpy(buf, &rpdev->hardcoded_chnls, len);
break;
- case VPROC_RPROC_REF:
- /* user data is at stake so bugs here cannot be tolerated */
- BUG_ON(len != sizeof(rpdev->rproc));
- memcpy(buf, &rpdev->rproc, len);
- break;
default:
dev_err(&vdev->dev, "invalid request: %d\n", request);
}
@@ -198,16 +189,6 @@ static int omap_rpmsg_mbox_callback(struct notifier_block *this,
case RP_MBOX_ECHO_REPLY:
pr_info("received echo reply from %s !\n", rpdev->rproc_name);
break;
- case RP_MSG_BOOTINIT_DONE:
- if (rpdev->bootcstr_set) {
- int val =
- (rpdev->bootcstr_type == RPROC_CONSTRAINT_SCALE) ?
- 0 : -1;
- rproc_set_constraints(rpdev->rproc,
- rpdev->bootcstr_type, val);
- rpdev->bootcstr_set = false;
- }
- break;
case RP_MBOX_PENDING_MSG:
/*
* a new inbound message is waiting in our own vring (index 0).
@@ -274,26 +255,6 @@ static int rpmsg_rproc_pos_suspend(struct omap_rpmsg_vproc *rpdev)
return NOTIFY_DONE;
}
-static int rpmsg_rproc_load_error(struct omap_rpmsg_vproc *rpdev)
-{
- mutex_lock(&rpdev->lock);
- if (rpdev->mbox) {
- omap_mbox_put(rpdev->mbox, &rpdev->nb);
- rpdev->mbox = NULL;
- }
-
- if (rpdev->bootcstr_set) {
- int val = (rpdev->bootcstr_type == RPROC_CONSTRAINT_SCALE) ?
- 0 : -1;
- rproc_set_constraints(rpdev->rproc,
- rpdev->bootcstr_type, val);
- rpdev->bootcstr_set = false;
- }
- mutex_unlock(&rpdev->lock);
-
- return NOTIFY_DONE;
-}
-
static int rpmsg_rproc_resume(struct omap_rpmsg_vproc *rpdev)
{
mutex_lock(&rpdev->lock);
@@ -314,20 +275,6 @@ static int rpmsg_rproc_secure(struct omap_rpmsg_vproc *rpdev, bool s)
return NOTIFY_DONE;
}
-static int rpmsg_rproc_preload(struct omap_rpmsg_vproc *rpdev)
-{
- mutex_lock(&rpdev->lock);
- if (rpdev->bootcstr_freq) {
- rpdev->bootcstr_set = !rproc_set_constraints(rpdev->rproc,
- rpdev->bootcstr_type, rpdev->bootcstr_freq);
- if (!rpdev->bootcstr_set)
- pr_debug("bumping the frequency for rproc %s failed\n",
- rpdev->rproc_name);
- }
- mutex_unlock(&rpdev->lock);
- return NOTIFY_DONE;
-}
-
static int rpmsg_rproc_events(struct notifier_block *this,
unsigned long type, void *data)
{
@@ -341,14 +288,10 @@ static int rpmsg_rproc_events(struct notifier_block *this,
return rpmsg_rproc_suspend(rpdev);
case RPROC_POS_SUSPEND:
return rpmsg_rproc_pos_suspend(rpdev);
- case RPROC_LOAD_ERROR:
- return rpmsg_rproc_load_error(rpdev);
case RPROC_RESUME:
return rpmsg_rproc_resume(rpdev);
case RPROC_SECURE:
return rpmsg_rproc_secure(rpdev, !!data);
- case RPROC_PRELOAD:
- return rpmsg_rproc_preload(rpdev);
}
return NOTIFY_DONE;
}
@@ -422,17 +365,8 @@ static void omap_rpmsg_del_vqs(struct virtio_device *vdev)
if (rpdev->mbox)
omap_mbox_put(rpdev->mbox, &rpdev->nb);
- if (rpdev->rproc) {
- if (rpdev->bootcstr_set) {
- int val =
- (rpdev->bootcstr_type == RPROC_CONSTRAINT_SCALE) ?
- 0 : -1;
- rproc_set_constraints(rpdev->rproc,
- rpdev->bootcstr_type, val);
- rpdev->bootcstr_set = false;
- }
+ if (rpdev->rproc)
rproc_put(rpdev->rproc);
- }
iounmap(rpdev->buf_mapped);
}
@@ -510,7 +444,6 @@ static int omap_rpmsg_find_vqs(struct virtio_device *vdev, unsigned nvqs,
err = -EINVAL;
goto put_mbox;
}
-
/* register for remoteproc events */
rpdev->rproc_nb.notifier_call = rpmsg_rproc_events;
rproc_event_register(rpdev->rproc, &rpdev->rproc_nb);
@@ -558,7 +491,6 @@ static void omap_rpmsg_finalize_features(struct virtio_device *vdev)
/* Give virtio_ring a chance to accept features */
vring_transport_features(vdev);
}
-#endif
static void omap_rpmsg_vproc_release(struct device *dev)
{
@@ -585,7 +517,6 @@ static void rpmsg_reset_work(struct work_struct *work)
}
}
-#if defined(CONFIG_OMAP_REMOTE_PROC_IPU) || defined(CONFIG_OMAP_REMOTE_PROC_DSP)
static struct virtio_config_ops omap_rpmsg_config_ops = {
.get_features = omap_rpmsg_get_features,
.finalize_features = omap_rpmsg_finalize_features,
@@ -596,9 +527,7 @@ static struct virtio_config_ops omap_rpmsg_config_ops = {
.set_status = omap_rpmsg_set_status,
.get_status = omap_rpmsg_get_status,
};
-#endif
-#ifdef CONFIG_OMAP_REMOTE_PROC_IPU
static struct rpmsg_channel_info omap_ipuc0_hardcoded_chnls[] = {
{ "rpmsg-resmgr", 100, RPMSG_ADDR_ANY },
{ "rpmsg-server-sample", 137, RPMSG_ADDR_ANY },
@@ -609,18 +538,8 @@ static struct rpmsg_channel_info omap_ipuc1_hardcoded_chnls[] = {
{ "rpmsg-resmgr", 100, RPMSG_ADDR_ANY },
{ },
};
-#endif
-
-#ifdef CONFIG_OMAP_REMOTE_PROC_DSP
-static struct rpmsg_channel_info omap_dsp_hardcoded_chnls[] = {
- { "rpmsg-resmgr", 100, RPMSG_ADDR_ANY },
- { "rpmsg-server-sample", 137, RPMSG_ADDR_ANY },
- { },
-};
-#endif
static struct omap_rpmsg_vproc omap_rpmsg_vprocs[] = {
-#ifdef CONFIG_OMAP_REMOTE_PROC_IPU
/* ipu_c0's rpmsg backend */
{
.vdev.id.device = VIRTIO_ID_RPMSG,
@@ -630,8 +549,6 @@ static struct omap_rpmsg_vproc omap_rpmsg_vprocs[] = {
.base_vq_id = 0,
.hardcoded_chnls = omap_ipuc0_hardcoded_chnls,
.slave_next = &omap_rpmsg_vprocs[1],
- .bootcstr_freq = 400000000,
- .bootcstr_type = RPROC_CONSTRAINT_BANDWIDTH,
},
/* ipu_c1's rpmsg backend */
{
@@ -643,52 +560,22 @@ static struct omap_rpmsg_vproc omap_rpmsg_vprocs[] = {
.hardcoded_chnls = omap_ipuc1_hardcoded_chnls,
.slave_reset = true,
},
-#endif
-#ifdef CONFIG_OMAP_REMOTE_PROC_DSP
- {
- .vdev.id.device = VIRTIO_ID_RPMSG,
- .vdev.config = &omap_rpmsg_config_ops,
- .mbox_name = "mailbox-2",
- .rproc_name = "dsp",
- .base_vq_id = 4,
- .hardcoded_chnls = omap_dsp_hardcoded_chnls,
- .bootcstr_freq = 465500000,
- .bootcstr_type = RPROC_CONSTRAINT_SCALE,
- },
-#endif
};
static int __init omap_rpmsg_ini(void)
{
- int i, ret = 0, mret = 0;
- phys_addr_t paddr = 0;
- phys_addr_t psize = 0;
- bool set_ipu = true;
+ int i, ret = 0;
+ phys_addr_t paddr = omap_ipu_get_mempool_base(
+ OMAP_RPROC_MEMPOOL_STATIC);
+ phys_addr_t psize = omap_ipu_get_mempool_size(
+ OMAP_RPROC_MEMPOOL_STATIC);
for (i = 0; i < ARRAY_SIZE(omap_rpmsg_vprocs); i++) {
struct omap_rpmsg_vproc *rpdev = &omap_rpmsg_vprocs[i];
- if (!strcmp(rpdev->rproc_name, "ipu")) {
- /* ok to require all vprocs for a rproc be together */
- if (set_ipu) {
- paddr = omap_ipu_get_mempool_base(
- OMAP_RPROC_MEMPOOL_STATIC);
- psize = omap_ipu_get_mempool_size(
- OMAP_RPROC_MEMPOOL_STATIC);
- set_ipu = false;
- }
- } else if (!strcmp(rpdev->rproc_name, "dsp")) {
- paddr = omap_dsp_get_mempool_tbase(
- OMAP_RPROC_MEMPOOL_DYNAMIC);
- psize = omap_dsp_get_mempool_tsize(
- OMAP_RPROC_MEMPOOL_DYNAMIC);
- } else
- break;
-
if (psize < RPMSG_IPC_MEM) {
pr_err("out of carveout memory: %d (%d)\n", psize, i);
- mret = -ENOMEM;
- continue;
+ return -ENOMEM;
}
/*
@@ -716,7 +603,7 @@ static int __init omap_rpmsg_ini(void)
}
}
- return ret | mret;
+ return ret;
}
module_init(omap_rpmsg_ini);