aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-12-08 10:57:25 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-08 10:57:25 +0000
commit0d7732a7242f26e3f059e8dfa9fb359c7377f408 (patch)
treef6c1b321f2b4940dbb25c45b9e6b79dd761bb882
parent2dc091932217af99a7cc21b1f4fce7ba1274b9fe (diff)
downloadmrst-s0i3-test-0d7732a7242f26e3f059e8dfa9fb359c7377f408.tar.gz
mrst-s0i3-test-0d7732a7242f26e3f059e8dfa9fb359c7377f408.tar.xz
mrst-s0i3-test-0d7732a7242f26e3f059e8dfa9fb359c7377f408.zip
Signed-off-by: Mark A. Allyn <mark.a.allyn@intel.com>
-rw-r--r--drivers/staging/sep/sep_driver.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c
index d2f8a7d03ad..2bb381fc063 100644
--- a/drivers/staging/sep/sep_driver.c
+++ b/drivers/staging/sep/sep_driver.c
@@ -203,6 +203,22 @@ MODULE_FIRMWARE("sep/resident.image.bin");
MODULE_FIRMWARE("sep/extapp.image.bin");
/**
+ * sep_dump_message - dump the message that is pending
+ * @sep: sep device
+ *
+ * Dump out the message pending in the shared message area
+ */
+
+static void sep_dump_message(struct sep_device *sep)
+{
+ int count;
+ for (count = 0; count < 12 * 4; count += 4)
+ dev_dbg(&sep->pdev->dev,
+ "Word %d of the message is %x\n",
+ count, *((u32 *) (sep->shared_addr + count)));
+}
+
+/**
* sep_map_and_alloc_shared_area - allocate shared block
* @sep: security processor
* @size: size of shared area
@@ -211,20 +227,21 @@ MODULE_FIRMWARE("sep/extapp.image.bin");
* kernel and also the hardware interface via DMA.
*/
-static int sep_map_and_alloc_shared_area(struct sep_device *sep,
- unsigned long size)
+static int sep_map_and_alloc_shared_area(struct sep_device *sep)
{
/* shared_addr = ioremap_nocache(0xda00000,shared_area_size); */
- sep->shared_addr = dma_alloc_coherent(&sep->pdev->dev, size,
- &sep->shared_bus, GFP_KERNEL);
+ sep->shared_addr = dma_alloc_coherent(&sep->pdev->dev,
+ sep->shared_size,
+ &sep->shared_bus, GFP_KERNEL);
if (!sep->shared_addr) {
- edbg("sep_driver :shared memory dma_alloc_coherent failed\n");
+ dev_warn(&sep->pdev->dev,
+ "shared memory dma_alloc_coherent failed\n");
return -ENOMEM;
}
- /* set the bus address of the shared area */
- edbg("sep: shared_addr %ld bytes @%p (bus %08llx)\n",
- size, sep->shared_addr, (unsigned long long)sep->shared_bus);
+ dev_dbg(&sep->pdev->dev,
+ "sep: shared_addr %x bytes @%p (bus %x)\n",
+ sep->shared_size, sep->shared_addr, sep->shared_bus);
return 0;
}
@@ -236,9 +253,10 @@ static int sep_map_and_alloc_shared_area(struct sep_device *sep,
* processor must have finished with this and any final posted
* writes cleared before we do so.
*/
-static void sep_unmap_and_free_shared_area(struct sep_device *sep, int size)
+static void sep_unmap_and_free_shared_area(struct sep_device *sep)
{
- dma_free_coherent(&sep->pdev->dev, size,
+ dev_dbg(&sep->pdev->dev, "shared area unmap and free\n");
+ dma_free_coherent(&sep->pdev->dev, sep->shared_size,
sep->shared_addr, sep->shared_bus);
}
@@ -485,20 +503,6 @@ static unsigned long sep_set_time(struct sep_device *sep)
}
/**
- * sep_dump_message - dump the message that is pending
- * @sep: sep device
- *
- * Dump out the message pending in the shared message area
- */
-
-static void sep_dump_message(struct sep_device *sep)
-{
- int count;
- for (count = 0; count < 12 * 4; count += 4)
- edbg("Word %d of the message is %u\n", count, *((u32 *) (sep->shared_addr + count)));
-}
-
-/**
* sep_send_command_handler - kick off a command
* @sep: sep being signalled
*