aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/sep/sep_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/sep/sep_driver.c')
-rw-r--r--drivers/staging/sep/sep_driver.c91
1 files changed, 70 insertions, 21 deletions
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c
index 046be74e665..d2f8a7d03ad 100644
--- a/drivers/staging/sep/sep_driver.c
+++ b/drivers/staging/sep/sep_driver.c
@@ -99,59 +99,108 @@ static DEFINE_MUTEX(ioctl_mutex);
static DEFINE_SPINLOCK(snd_rply_lck);
static unsigned long snd_rply_lck_flag;
+
/**
* sep_load_firmware - copy firmware cache/resident
* @sep: device we are loading
*
* This functions copies the cache and resident from their source
* location into destination shared memory.
+ * @sep: pointer to struct sep_device
*/
static int sep_load_firmware(struct sep_device *sep)
{
const struct firmware *fw;
- char *cache_name = "sep/cache.image.bin";
- char *res_name = "sep/resident.image.bin";
- int error;
+ char *cache_name = "cache.image.bin";
+ char *res_name = "resident.image.bin";
+ char *extapp_name = "extapp.image.bin";
- edbg("SEP Driver:rar_virtual is %p\n", sep->rar_addr);
- edbg("SEP Driver:rar_bus is %08llx\n", (unsigned long long)sep->rar_bus);
+ int error = 0;
+ unsigned int work1, work2, work3;
+
+ /* set addresses and load resident */
+ sep->resident_bus = sep->rar_bus;
+ sep->resident_addr = sep->rar_addr;
+
+ error = request_firmware(&fw, res_name, &sep->pdev->dev);
+ if (error) {
+ dev_warn(&sep->pdev->dev, "cant request resident fw\n");
+ return error;
+ }
+
+ memcpy(sep->resident_addr, (void *)fw->data, fw->size);
+ sep->resident_size = fw->size;
+ release_firmware(fw);
+
+ dev_dbg(&sep->pdev->dev, "resident virtual is %p\n",
+ sep->resident_addr);
+ dev_dbg(&sep->pdev->dev, "residnet bus is %08llx\n",
+ (unsigned long long)sep->resident_bus);
+ dev_dbg(&sep->pdev->dev, "resident size is %08x\n",
+ sep->resident_size);
+
+ /* set addresses for dcache (no loading needed) */
+ work1 = (unsigned int)sep->resident_bus;
+ work2 = (unsigned int)sep->resident_size;
+ work3 = (work1 + work2 + (1024 * 4)) & 0xfffff000;
+ sep->dcache_bus = (dma_addr_t)work3;
+
+ work1 = (unsigned int)sep->resident_addr;
+ work2 = (unsigned int)sep->resident_size;
+ work3 = (work1 + work2 + (1024 * 4)) & 0xfffff000;
+ sep->dcache_addr = (void *)work3;
+
+ sep->dcache_size = 1024 * 128;
+
+ /* set addresses and load cache */
+ sep->cache_bus = sep->dcache_bus + sep->dcache_size;
+ sep->cache_addr = sep->dcache_addr + sep->dcache_size;
- /* load cache */
error = request_firmware(&fw, cache_name, &sep->pdev->dev);
if (error) {
- edbg("SEP Driver:cant request cache fw\n");
+ dev_warn(&sep->pdev->dev, "cant request cache fw\n");
return error;
}
- edbg("SEP Driver:cache %08Zx@%p\n", fw->size, (void *) fw->data);
- memcpy(sep->rar_addr, (void *)fw->data, fw->size);
+ memcpy(sep->cache_addr, (void *)fw->data, fw->size);
sep->cache_size = fw->size;
release_firmware(fw);
- sep->resident_bus = sep->rar_bus + sep->cache_size;
- sep->resident_addr = sep->rar_addr + sep->cache_size;
+ dev_dbg(&sep->pdev->dev, "cache virtual is %p\n",
+ sep->cache_addr);
+ dev_dbg(&sep->pdev->dev, "cache bus is %08llx\n",
+ (unsigned long long)sep->cache_bus);
+ dev_dbg(&sep->pdev->dev, "cache size is %08x\n",
+ sep->cache_size);
- /* load resident */
- error = request_firmware(&fw, res_name, &sep->pdev->dev);
+ /* set addresses and load extapp */
+ sep->extapp_bus = sep->cache_bus + (1024 * 370);
+ sep->extapp_addr = sep->cache_addr + (1024 * 370);
+
+ error = request_firmware(&fw, extapp_name, &sep->pdev->dev);
if (error) {
- edbg("SEP Driver:cant request res fw\n");
+ dev_warn(&sep->pdev->dev, "cant request extapp fw\n");
return error;
}
- edbg("sep: res %08Zx@%p\n", fw->size, (void *)fw->data);
- memcpy(sep->resident_addr, (void *) fw->data, fw->size);
- sep->resident_size = fw->size;
+ memcpy(sep->extapp_addr, (void *)fw->data, fw->size);
+ sep->extapp_size = fw->size;
release_firmware(fw);
- edbg("sep: resident v %p b %08llx cache v %p b %08llx\n",
- sep->resident_addr, (unsigned long long)sep->resident_bus,
- sep->rar_addr, (unsigned long long)sep->rar_bus);
- return 0;
+ dev_dbg(&sep->pdev->dev, "extapp virtual is %p\n",
+ sep->extapp_addr);
+ dev_dbg(&sep->pdev->dev, "extapp bus is %08llx\n",
+ (unsigned long long)sep->extapp_bus);
+ dev_dbg(&sep->pdev->dev, "extapp size is %08x\n",
+ sep->extapp_size);
+
+ return error;
}
MODULE_FIRMWARE("sep/cache.image.bin");
MODULE_FIRMWARE("sep/resident.image.bin");
+MODULE_FIRMWARE("sep/extapp.image.bin");
/**
* sep_map_and_alloc_shared_area - allocate shared block