aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c10
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c10
-rw-r--r--arch/arm/mach-omap2/remoteproc.c2
-rw-r--r--arch/arm/plat-omap/omap_rpmsg.c8
-rw-r--r--drivers/remoteproc/remoteproc.c2
-rw-r--r--drivers/rpmsg/rpmsg_omx.c64
-rw-r--r--sound/soc/codecs/twl6040.c59
7 files changed, 100 insertions, 55 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 379818e..c60aa83 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -68,8 +68,10 @@
#define PHYS_ADDR_SMC_SIZE (SZ_1M * 3)
#define PHYS_ADDR_SMC_MEM (0x80000000 + SZ_1G - PHYS_ADDR_SMC_SIZE)
-#define PHYS_ADDR_DUCATI_SIZE (SZ_1M * 101)
-#define PHYS_ADDR_DUCATI_MEM (PHYS_ADDR_SMC_MEM - PHYS_ADDR_DUCATI_SIZE)
+#define OMAP_ION_HEAP_SECURE_INPUT_SIZE (SZ_1M * 30)
+#define PHYS_ADDR_DUCATI_SIZE (SZ_1M * 103)
+#define PHYS_ADDR_DUCATI_MEM (PHYS_ADDR_SMC_MEM - PHYS_ADDR_DUCATI_SIZE - \
+ OMAP_ION_HEAP_SECURE_INPUT_SIZE)
static const int sdp4430_keymap[] = {
KEY(0, 0, KEY_E),
@@ -874,7 +876,9 @@ static void __init omap_4430sdp_reserve(void)
/* do the static reservations first */
memblock_remove(PHYS_ADDR_SMC_MEM, PHYS_ADDR_SMC_SIZE);
memblock_remove(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE);
- omap_ipu_set_static_mempool(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE);
+ /* ipu needs to recognize secure input buffer area as well */
+ omap_ipu_set_static_mempool(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE +
+ OMAP_ION_HEAP_SECURE_INPUT_SIZE);
omap_reserve();
}
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 1cae155..76fccce 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -63,8 +63,10 @@
#define PHYS_ADDR_SMC_SIZE (SZ_1M * 3)
#define PHYS_ADDR_SMC_MEM (0x80000000 + SZ_1G - PHYS_ADDR_SMC_SIZE)
-#define PHYS_ADDR_DUCATI_SIZE (SZ_1M * 101)
-#define PHYS_ADDR_DUCATI_MEM (PHYS_ADDR_SMC_MEM - PHYS_ADDR_DUCATI_SIZE)
+#define OMAP_ION_HEAP_SECURE_INPUT_SIZE (SZ_1M * 30)
+#define PHYS_ADDR_DUCATI_SIZE (SZ_1M * 103)
+#define PHYS_ADDR_DUCATI_MEM (PHYS_ADDR_SMC_MEM - PHYS_ADDR_DUCATI_SIZE - \
+ OMAP_ION_HEAP_SECURE_INPUT_SIZE)
/* wl127x BT, FM, GPS connectivity chip */
static int wl1271_gpios[] = {46, -1, -1};
@@ -719,7 +721,9 @@ static void __init omap4_panda_reserve(void)
/* do the static reservations first */
memblock_remove(PHYS_ADDR_SMC_MEM, PHYS_ADDR_SMC_SIZE);
memblock_remove(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE);
- omap_ipu_set_static_mempool(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE);
+ /* ipu needs to recognize secure input buffer area as well */
+ omap_ipu_set_static_mempool(PHYS_ADDR_DUCATI_MEM, PHYS_ADDR_DUCATI_SIZE +
+ OMAP_ION_HEAP_SECURE_INPUT_SIZE);
omap_reserve();
}
diff --git a/arch/arm/mach-omap2/remoteproc.c b/arch/arm/mach-omap2/remoteproc.c
index b8900ce..3c0da55 100644
--- a/arch/arm/mach-omap2/remoteproc.c
+++ b/arch/arm/mach-omap2/remoteproc.c
@@ -46,7 +46,7 @@ static struct omap_rproc_pdata omap4_rproc_data[] = {
.oh_name_opt = "ipu_c1",
.idle_addr = OMAP4430_CM_M3_M3_CLKCTRL,
.idle_mask = OMAP4430_STBYST_MASK,
- .suspend_addr = 0xb98f02d8,
+ .suspend_addr = 0xb7ff02d8,
.suspend_mask = ~0,
.sus_timeout = 5000,
.sus_mbox_name = "mailbox-1",
diff --git a/arch/arm/plat-omap/omap_rpmsg.c b/arch/arm/plat-omap/omap_rpmsg.c
index 3540afc..340f10b 100644
--- a/arch/arm/plat-omap/omap_rpmsg.c
+++ b/arch/arm/plat-omap/omap_rpmsg.c
@@ -456,9 +456,9 @@ static int __init omap_rpmsg_ini(void)
{
int i, ret = 0;
phys_addr_t paddr = omap_ipu_get_mempool_base(
- OMAP_RPROC_MEMPOOL_DYNAMIC);
+ OMAP_RPROC_MEMPOOL_STATIC);
phys_addr_t psize = omap_ipu_get_mempool_size(
- OMAP_RPROC_MEMPOOL_DYNAMIC);
+ OMAP_RPROC_MEMPOOL_STATIC);
for (i = 0; i < ARRAY_SIZE(omap_rpmsg_vprocs); i++) {
struct omap_rpmsg_vproc *rpdev = &omap_rpmsg_vprocs[i];
@@ -468,6 +468,10 @@ static int __init omap_rpmsg_ini(void)
return -ENOMEM;
}
+ /*
+ * vring buffers are expected to be present at the beginning
+ * of the chosen remoteproc pool
+ */
rpdev->buf_addr = paddr;
rpdev->buf_size = RPMSG_BUFS_SPACE;
rpdev->vring[0] = paddr + RPMSG_BUFS_SPACE;
diff --git a/drivers/remoteproc/remoteproc.c b/drivers/remoteproc/remoteproc.c
index 8d7caa1..c90738a 100644
--- a/drivers/remoteproc/remoteproc.c
+++ b/drivers/remoteproc/remoteproc.c
@@ -323,7 +323,7 @@ static int rproc_check_poolmem(struct rproc *rproc, u32 size, phys_addr_t pa)
return -ENOSPC;
}
if ((pa < pool->st_base) ||
- ((pa + size) >= (pool->st_base + pool->st_size))) {
+ ((pa + size) > (pool->st_base + pool->st_size))) {
pr_warn("section lies outside the remoteproc carveout\n");
return -ENOSPC;
}
diff --git a/drivers/rpmsg/rpmsg_omx.c b/drivers/rpmsg/rpmsg_omx.c
index 60171a9..5a870cd 100644
--- a/drivers/rpmsg/rpmsg_omx.c
+++ b/drivers/rpmsg/rpmsg_omx.c
@@ -92,8 +92,29 @@ static DEFINE_SPINLOCK(rpmsg_omx_services_lock);
#endif
#endif
+/*
+ * TODO: Need to do this using lookup with rproc, but rproc is not
+ * visible to rpmsg_omx
+ */
+#define TILER_START 0x60000000
+#define TILER_END 0x80000000
+#define ION_1D_START 0xBDF00000
+#define ION_1D_END 0xBFD00000
+#define ION_1D_VA 0x88000000
+static u32 _rpmsg_pa_to_da(u32 pa)
+{
+ if (pa >= TILER_START && pa < TILER_END)
+ return pa;
+ else if (pa >= ION_1D_START && pa < ION_1D_END)
+ return (pa - ION_1D_START + ION_1D_VA);
+ else
+ return 0;
+}
+
static u32 _rpmsg_omx_buffer_lookup(struct rpmsg_omx_instance *omx, long buffer)
{
+ phys_addr_t pa;
+ u32 va;
#ifdef CONFIG_ION_OMAP
struct ion_handle *handle;
ion_phys_addr_t paddr;
@@ -102,8 +123,10 @@ static u32 _rpmsg_omx_buffer_lookup(struct rpmsg_omx_instance *omx, long buffer)
/* is it an ion handle? */
handle = (struct ion_handle *)buffer;
- if (!ion_phys(omx->ion_client, handle, &paddr, &unused))
- return (u32)paddr;
+ if (!ion_phys(omx->ion_client, handle, &paddr, &unused)) {
+ pa = (phys_addr_t) paddr;
+ goto to_va;
+ }
#ifdef CONFIG_PVR_SGX
/* how about an sgx buffer wrapping an ion handle? */
@@ -111,12 +134,21 @@ static u32 _rpmsg_omx_buffer_lookup(struct rpmsg_omx_instance *omx, long buffer)
struct ion_client *pvr_ion_client;
fd = buffer;
handle = PVRSRVExportFDToIONHandle(fd, &pvr_ion_client);
- if (handle && !ion_phys(pvr_ion_client, handle, &paddr, &unused))
- return (u32)paddr;
+ if (handle &&
+ !ion_phys(pvr_ion_client, handle, &paddr, &unused)) {
+ pa = (phys_addr_t)paddr;
+ goto to_va;
+ }
}
#endif
#endif
- return tiler_virt2phys(buffer);
+ pa = (phys_addr_t) tiler_virt2phys(buffer);
+
+#ifdef CONFIG_ION_OMAP
+to_va:
+#endif
+ va = _rpmsg_pa_to_da(pa);
+ return va;
}
static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
@@ -125,7 +157,7 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
long *buffer;
char *data;
enum rpc_omx_map_info_type maptype;
- u32 pa = 0;
+ u32 da = 0;
data = (char *)((struct omx_packet *)packet)->data;
maptype = *((enum rpc_omx_map_info_type *)data);
@@ -141,10 +173,9 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
offset = *(int *)((int)data + sizeof(maptype));
buffer = (long *)((int)data + offset);
- pa = _rpmsg_omx_buffer_lookup(omx, *buffer);
-
- if (pa) {
- *buffer = pa;
+ da = _rpmsg_omx_buffer_lookup(omx, *buffer);
+ if (da) {
+ *buffer = da;
ret = 0;
}
@@ -152,10 +183,9 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
buffer = (long *)((int)data + offset + sizeof(*buffer));
if (*buffer != 0) {
ret = -EIO;
- pa = _rpmsg_omx_buffer_lookup(omx, *buffer);
-
- if (pa) {
- *buffer = pa;
+ da = _rpmsg_omx_buffer_lookup(omx, *buffer);
+ if (da) {
+ *buffer = da;
ret = 0;
}
}
@@ -165,9 +195,9 @@ static int _rpmsg_omx_map_buf(struct rpmsg_omx_instance *omx, char *packet)
buffer = (long *)((int)data + offset + 2*sizeof(*buffer));
if (*buffer != 0) {
ret = -EIO;
- pa = _rpmsg_omx_buffer_lookup(omx, *buffer);
- if (pa) {
- *buffer = pa;
+ da = _rpmsg_omx_buffer_lookup(omx, *buffer);
+ if (da) {
+ *buffer = da;
ret = 0;
}
}
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 879bd6e..d10f988 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1338,6 +1338,33 @@ static int twl6040_add_widgets(struct snd_soc_codec *codec)
return 0;
}
+/* set of rates for each pll: low-power and high-performance */
+
+static unsigned int lp_rates[] = {
+ 8000,
+ 11250,
+ 16000,
+ 22500,
+ 32000,
+ 44100,
+ 48000,
+ 88200,
+ 96000,
+};
+
+static struct snd_pcm_hw_constraint_list lp_constraints = {
+ .count = ARRAY_SIZE(lp_rates),
+ .list = lp_rates,
+};
+
+static unsigned int hp_rates[] = {
+ 8000,
+ 16000,
+ 32000,
+ 48000,
+ 96000,
+};
+
static int twl6040_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
@@ -1356,6 +1383,8 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec,
twl6040_enable(twl6040);
priv->codec_powered = 1;
+ priv->sysclk_constraints = &lp_constraints;
+
/* initialize vdd/vss registers with reg_cache */
twl6040_init_vdd_regs(codec);
@@ -1377,32 +1406,6 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec,
return 0;
}
-/* set of rates for each pll: low-power and high-performance */
-
-static unsigned int lp_rates[] = {
- 8000,
- 11250,
- 16000,
- 22500,
- 32000,
- 44100,
- 48000,
- 88200,
- 96000,
-};
-
-static struct snd_pcm_hw_constraint_list lp_constraints = {
- .count = ARRAY_SIZE(lp_rates),
- .list = lp_rates,
-};
-
-static unsigned int hp_rates[] = {
- 8000,
- 16000,
- 32000,
- 48000,
- 96000,
-};
static struct snd_pcm_hw_constraint_list hp_constraints = {
.count = ARRAY_SIZE(hp_rates),
@@ -1641,9 +1644,9 @@ static int twl6040_probe(struct snd_soc_codec *codec)
else
priv->ep_step = 1;
- /* default is high-performance mode */
+ /* default is low-power mode */
priv->headset_mode = 1;
- priv->sysclk_constraints = &hp_constraints;
+ priv->sysclk_constraints = &lp_constraints;
priv->workqueue = create_singlethread_workqueue("twl6040-codec");
if (!priv->workqueue) {