Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ba941c8 authored by Neeti Desai's avatar Neeti Desai
Browse files

msm: ocmem: Do not use data mover for clearing ocmem memory



In the non secure environment the data mover is used to clear
the ocmem memory. The ocmem driver no longer uses the data
mover for this operation.

Change-Id: I2dc4f421b1a1a81d3205bd57fe66092512e287aa
Signed-off-by: default avatarNeeti Desai <neetid@codeaurora.org>
parent 7198e5fb
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -227,7 +227,6 @@ int process_shrink(int, struct ocmem_handle *, unsigned long);
int process_dump(int, struct ocmem_handle *, unsigned long);
int ocmem_rdm_transfer(int, struct ocmem_map_list *,
				unsigned long, int);
int ocmem_clear(unsigned long, unsigned long);
unsigned long process_quota(int);
int ocmem_memory_off(int, unsigned long, unsigned long);
int ocmem_memory_on(int, unsigned long, unsigned long);
+9 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ struct ocmem_hw_region {
static struct ocmem_hw_region *region_ctrl;
static struct mutex region_ctrl_lock;
static void *ocmem_base;
static void *ocmem_vbase;

#define OCMEM_V1_MACROS 8
#define OCMEM_V1_MACRO_SZ (SZ_64K)
@@ -562,6 +563,13 @@ static void ocmem_gfx_mpu_remove(void)
	ocmem_write(0x0, ocmem_base + OC_GFX_MPU_END);
}

int ocmem_clear(unsigned long start, unsigned long size)
{
	memset((ocmem_vbase + start), 0x4D4D434F, size);
	mb();
	return 0;
}

static int do_lock(enum ocmem_client id, unsigned long offset,
			unsigned long len, enum region_mode mode)
{
@@ -1144,6 +1152,7 @@ int ocmem_core_init(struct platform_device *pdev)

	pdata = platform_get_drvdata(pdev);
	ocmem_base = pdata->reg_base;
	ocmem_vbase = pdata->vbase;

	rc = ocmem_enable_core_clock();

+1 −33
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -149,38 +149,6 @@ static irqreturn_t ocmem_dm_irq_handler(int irq, void *dev_id)
	return IRQ_HANDLED;
}

#ifdef CONFIG_MSM_OCMEM_NONSECURE
int ocmem_clear(unsigned long start, unsigned long size)
{
	INIT_COMPLETION(dm_clear_event);
	/* Clear DM Mask */
	ocmem_write(DM_MASK_RESET, dm_base + DM_INTR_MASK);
	/* Clear DM Interrupts */
	ocmem_write(DM_INTR_RESET, dm_base + DM_INTR_CLR);
	/* DM CLR offset */
	ocmem_write(start, dm_base + DM_CLR_OFFSET);
	/* DM CLR size */
	ocmem_write(size, dm_base + DM_CLR_SIZE);
	/* Wipe out memory as "OCMM" */
	ocmem_write(0x4D4D434F, dm_base + DM_CLR_PATTERN);
	/* The offset, size and pattern for clearing must be set
	 * before triggering the clearing engine
	 */
	mb();
	/* Trigger Data Clear */
	ocmem_write(DM_CLR_ENABLE, dm_base + DM_CLR_TRIGGER);

	wait_for_completion(&dm_clear_event);

	return 0;
}
#else
int ocmem_clear(unsigned long start, unsigned long size)
{
	return 0;
}
#endif

/* Lock during transfers */
int ocmem_rdm_transfer(int id, struct ocmem_map_list *clist,
			unsigned long start, int direction)