diff options
author | Dan Murphy <dmurphy@ti.com> | 2011-10-19 07:29:42 -0500 |
---|---|---|
committer | Dan Murphy <dmurphy@ti.com> | 2011-10-19 07:29:42 -0500 |
commit | 0ce8b814f42cc1841aecfed1bb79e7eb65932b97 (patch) | |
tree | 257647c2cb637e50162b4e95a32bcf4030b58c59 /drivers/remoteproc | |
parent | 83c694e9c7eb67186638515294ccafaf3674e8f8 (diff) | |
parent | fc58fccef3311f884c87afb096d126f94698e128 (diff) | |
download | kernel_samsung_espresso10-0ce8b814f42cc1841aecfed1bb79e7eb65932b97.zip kernel_samsung_espresso10-0ce8b814f42cc1841aecfed1bb79e7eb65932b97.tar.gz kernel_samsung_espresso10-0ce8b814f42cc1841aecfed1bb79e7eb65932b97.tar.bz2 |
Merge branch 'android-omap-3.0' into p-android-omap-3.0
* android-omap-3.0:
gpu: pvr: Update to DDK 1.8@297401
remoteproc: Add version debugfs
omap: mailbox: reset mailbox every startup.
omap: remoteproc: wake up remoteproc clkdm when accessing iommu
OMAP4: PRCM debug: Don't print slaves in AUTO ON as sleep failure
net: wireless: Fix CFG80211_ALLOW_RECONNECT option for disconnect
Change-Id: I1fda9131117e08c9b053c13bdc7ec7ed93b3bfcf
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/omap_remoteproc.c | 18 | ||||
-rw-r--r-- | drivers/remoteproc/remoteproc.c | 35 |
2 files changed, 52 insertions, 1 deletions
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 777342e..5548917 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -249,6 +249,8 @@ int omap_rproc_deactivate(struct omap_device *od) #ifdef CONFIG_REMOTE_PROC_AUTOSUSPEND struct omap_rproc_priv *rpp = rproc->priv; #endif + if (pdata->clkdm) + clkdm_wakeup(pdata->clkdm); for (i = 0; i < od->hwmods_cnt; i++) { ret = omap_hwmod_shutdown(od->hwmods[i]); @@ -271,6 +273,9 @@ int omap_rproc_deactivate(struct omap_device *od) } #endif err: + if (pdata->clkdm) + clkdm_allow_idle(pdata->clkdm); + return ret; } @@ -287,6 +292,8 @@ static int omap_rproc_iommu_init(struct rproc *rproc, if (!rpp) return -ENOMEM; + if (pdata->clkdm) + clkdm_wakeup(pdata->clkdm); iommu_set_isr(pdata->iommu_name, omap_rproc_iommu_isr, rproc); iommu_set_secure(pdata->iommu_name, rproc->secure_mode, rproc->secure_ttb); @@ -312,12 +319,17 @@ static int omap_rproc_iommu_init(struct rproc *rproc, goto err_map; } } + if (pdata->clkdm) + clkdm_allow_idle(pdata->clkdm); + return 0; err_map: iommu_put(iommu); err_mmu: iommu_set_secure(pdata->iommu_name, false, NULL); + if (pdata->clkdm) + clkdm_allow_idle(pdata->clkdm); kfree(rpp); return ret; } @@ -481,10 +493,16 @@ out: static int omap_rproc_iommu_exit(struct rproc *rproc) { struct omap_rproc_priv *rpp = rproc->priv; + struct omap_rproc_pdata *pdata = rproc->dev->platform_data; + + if (pdata->clkdm) + clkdm_wakeup(pdata->clkdm); if (rpp->iommu) iommu_put(rpp->iommu); kfree(rpp); + if (pdata->clkdm) + clkdm_allow_idle(pdata->clkdm); return 0; } diff --git a/drivers/remoteproc/remoteproc.c b/drivers/remoteproc/remoteproc.c index 2ecbcef..ef9d0ff 100644 --- a/drivers/remoteproc/remoteproc.c +++ b/drivers/remoteproc/remoteproc.c @@ -103,6 +103,21 @@ static ssize_t rproc_name_read(struct file *filp, char __user *userbuf, return simple_read_from_buffer(userbuf, count, ppos, buf, i); } +static ssize_t rproc_version_read(struct file *filp, char __user *userbuf, + size_t count, loff_t *ppos) +{ + + struct rproc *rproc = filp->private_data; + char *pch; + int len; + pch = strstr(rproc->header, "version:"); + if (!pch) + return 0; + pch += strlen("version:") + 1; + len = rproc->header_len - (pch - rproc->header); + return simple_read_from_buffer(userbuf, count, ppos, pch, len); +} + static int rproc_open_generic(struct inode *inode, struct file *file) { file->private_data = inode->i_private; @@ -472,6 +487,12 @@ static const struct file_operations rproc_name_ops = { .llseek = generic_file_llseek, }; +static const struct file_operations rproc_version_ops = { + .read = rproc_version_read, + .open = rproc_open_generic, + .llseek = generic_file_llseek, +}; + DEBUGFS_READONLY_FILE(trace0, rproc->trace_buf0, rproc->trace_len0); DEBUGFS_READONLY_FILE(trace1, rproc->trace_buf1, rproc->trace_len1); DEBUGFS_READONLY_FILE(trace0_last, rproc->last_trace_buf0, @@ -1077,6 +1098,15 @@ static void rproc_loader_cont(const struct firmware *fw, void *context) } dev_info(dev, "BIOS image version is %d\n", image->version); + + rproc->header = kzalloc(image->header_len, GFP_KERNEL); + if (!rproc->header) { + dev_err(dev, "%s: kzalloc failed\n", __func__); + goto out; + } + memcpy(rproc->header, image->header, image->header_len); + rproc->header_len = image->header_len; + /* Ensure we recognize this BIOS version: */ if (image->version != RPROC_BIOS_VERSION) { dev_err(dev, "Expected BIOS version: %d!\n", @@ -1284,6 +1314,7 @@ void rproc_put(struct rproc *rproc) rproc_reset_poolmem(rproc); memset(rproc->memory_maps, 0, sizeof(rproc->memory_maps)); + kfree(rproc->header); /* * make sure rproc is really running before powering it off. @@ -1655,9 +1686,11 @@ int rproc_register(struct device *dev, const char *name, goto out; } - debugfs_create_file("name", 0400, rproc->dbg_dir, rproc, + debugfs_create_file("name", 0444, rproc->dbg_dir, rproc, &rproc_name_ops); + debugfs_create_file("version", 0444, rproc->dbg_dir, rproc, + &rproc_version_ops); out: return 0; } |