* [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP.
@ 2013-01-09 15:03 Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 1/5] ARM: OMAP2+: hwmod: add enable_preprogram hook Sebastien Guiriec
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Sebastien Guiriec @ 2013-01-09 15:03 UTC (permalink / raw)
To: linux-arm-kernel
v2:
- Add missing AESS memory banks.
- Update the serie base on comments related earlier serie:
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg69853.html
The location of the callback has been updated in order to fit with AESS.
Some call of PM runtime can be done by ASoC core when AESS is in RET so
we need to ensure that the additional callback is call on enable
also in order to have clock correctly stop.
v1:
ARM: OMAP4: Enable AESS IP.
This patch serie extends the the hwmod HWMOD_EXT_OPT_MAIN_CLK flag for the
AESS IP. This IP has additional register for Auto Gatting configuration. As
it is used only for Audio the driver is not always loaded. We can reuse the
same flag as McPDM to work around the HW problem due to bad reset value of
AESS Auto gatting configuration register.
If we try to setup and reset AESS during boot time without this serie the
next clocks will still remain enable.
omapconf abe cfg:
|--------------------------------------------------------------|
| ABE Clock Domain Configuration |
|--------------------------------|-----------------------------|
| Clock State Transition control | HW-Auto |
| Clock State | |
| ABE_24M_FCLK | GATED |
| ABE_ALWON_32K_CLK | GATED |
| ABE_SYSCLK | GATED |
| 24M_FCLK | GATED |
| ABE_ICLK2 | RUNNING |
| DPLL_ABE_X2_CLK | RUNNING |
| PAD_CLKS | GATED |
| SLIMBUS_CLK | GATED |
| OPP Divider | ABE_CLK = DPLL_ABE_X2_CLK/1 |
|--------------------------------------------------------------|
Paul Walmsley (3):
ARM: OMAP2+: hwmod: add enable_preprogram hook
ASoC: TI AESS: add autogating-enable function, callable from
architecture code
ARM: OMAP4+: AESS: enable internal auto-gating during initial setup
Sebastien Guiriec (2):
OMAP4: hwmod data: Enable AESS hwmod device
OMAP4: hwmod data: Update AESS data with memory bank area
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++++++
arch/arm/mach-omap2/omap_hwmod.h | 8 +++++
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 49 +++++++++++++++++++++++--
arch/arm/mach-omap2/omap_hwmod_reset.c | 52 +++++++++++++++++++++++++++
include/sound/aess.h | 53 ++++++++++++++++++++++++++++
6 files changed, 178 insertions(+), 4 deletions(-)
create mode 100644 arch/arm/mach-omap2/omap_hwmod_reset.c
create mode 100644 include/sound/aess.h
--
1.7.10.4
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/5] ARM: OMAP2+: hwmod: add enable_preprogram hook
2013-01-09 15:03 [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
@ 2013-01-09 15:03 ` Sebastien Guiriec
2013-01-09 15:07 ` Felipe Balbi
2013-01-09 15:03 ` [PATCH v2 2/5] ASoC: TI AESS: add autogating-enable function, callable from architecture code Sebastien Guiriec
` (4 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Sebastien Guiriec @ 2013-01-09 15:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Paul Walmsley <paul@pwsan.com>
After setup/enable, some IP blocks need some additional setting to
indicate the PRCM that they are inactive until they are configured.
Some examples on OMAP4 include the AESS and FSUSB IP blocks.
To fix this cleanly, this patch adds another optional function
pointer, setup_preprogram, to the IP block's hwmod data. The function
that is pointed to is called by the hwmod code immediately after the
IP block is reset.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
Cc: P?ter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++++++++++++++
arch/arm/mach-omap2/omap_hwmod.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 4653efb..f37d22c 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2053,6 +2053,23 @@ static int _omap4_get_context_lost(struct omap_hwmod *oh)
}
/**
+ * _enable_preprogram - Pre-program an IP block during the _enable() process
+ * @oh: struct omap_hwmod *
+ *
+ * Some IP blocks (such as AESS) require some additional programming
+ * after enable before they can enter idle. If a function pointer to
+ * do so is present in the hwmod data, then call it and pass along the
+ * return value; otherwise, return 0.
+ */
+static int __init _enable_preprogram(struct omap_hwmod *oh)
+{
+ if (!oh->class->enable_preprogram)
+ return 0;
+
+ return oh->class->enable_preprogram(oh);
+}
+
+/**
* _enable - enable an omap_hwmod
* @oh: struct omap_hwmod *
*
@@ -2156,6 +2173,7 @@ static int _enable(struct omap_hwmod *oh)
_update_sysc_cache(oh);
_enable_sysc(oh);
}
+ r = _enable_preprogram(oh);
} else {
if (soc_ops.disable_module)
soc_ops.disable_module(oh);
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 3ae852a..41066b4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -501,6 +501,7 @@ struct omap_hwmod_omap4_prcm {
* @rev: revision of the IP class
* @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
* @reset: ptr to fn to be executed in place of the standard hwmod reset fn
+ * @enable_preprogram: ptr to fn to be executed during device enable
*
* Represent the class of a OMAP hardware "modules" (e.g. timer,
* smartreflex, gpio, uart...)
@@ -524,6 +525,7 @@ struct omap_hwmod_class {
u32 rev;
int (*pre_shutdown)(struct omap_hwmod *oh);
int (*reset)(struct omap_hwmod *oh);
+ int (*enable_preprogram)(struct omap_hwmod *oh);
};
/**
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] ASoC: TI AESS: add autogating-enable function, callable from architecture code
2013-01-09 15:03 [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 1/5] ARM: OMAP2+: hwmod: add enable_preprogram hook Sebastien Guiriec
@ 2013-01-09 15:03 ` Sebastien Guiriec
2013-01-09 15:41 ` Mark Brown
2013-01-09 15:03 ` [PATCH v2 3/5] ARM: OMAP4+: AESS: enable internal auto-gating during initial setup Sebastien Guiriec
` (3 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Sebastien Guiriec @ 2013-01-09 15:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Paul Walmsley <paul@pwsan.com>
Add a basic header file for the TI AESS IP block, located in the OMAP4
Audio Back-End subsystem.
Currently, this header file only contains a function to enable the
AESS internal clock auto-gating. This will be used by a subsequent
patch to ensure that the AESS won't block the entire chip
low-power-idle mode. We wish to be able to place the AESS into idle
even when no AESS driver has been compiled in.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: P?ter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
include/sound/aess.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 include/sound/aess.h
diff --git a/include/sound/aess.h b/include/sound/aess.h
new file mode 100644
index 0000000..cee0d09
--- /dev/null
+++ b/include/sound/aess.h
@@ -0,0 +1,53 @@
+/*
+ * AESS IP block reset
+ *
+ * Copyright (C) 2012 Texas Instruments, Inc.
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+#ifndef __SOUND_AESS_H__
+#define __SOUND_AESS_H__
+
+#include <linux/kernel.h>
+#include <linux/io.h>
+
+/*
+ * AESS_AUTO_GATING_ENABLE_OFFSET: offset in bytes of the AESS IP
+ * block's AESS_AUTO_GATING_ENABLE__1 register from the IP block's
+ * base address
+ */
+#define AESS_AUTO_GATING_ENABLE_OFFSET 0x07c
+
+/* Register bitfields in the AESS_AUTO_GATING_ENABLE__1 register */
+#define AESS_AUTO_GATING_ENABLE_SHIFT 0
+
+/**
+ * aess_enable_autogating - enable AESS internal autogating
+ * @oh: struct omap_hwmod *
+ *
+ * Enable internal autogating on the AESS. This allows the AESS to
+ * indicate that it is idle to the OMAP PRCM. Returns 0.
+ */
+static inline void aess_enable_autogating(void __iomem *base)
+{
+ u32 v;
+
+ /* Set AESS_AUTO_GATING_ENABLE__1.ENABLE to allow idle entry */
+ v = 1 << AESS_AUTO_GATING_ENABLE_SHIFT;
+ writel(v, base + AESS_AUTO_GATING_ENABLE_OFFSET);
+}
+
+#endif /* __SOUND_AESS_H__ */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/5] ARM: OMAP4+: AESS: enable internal auto-gating during initial setup
2013-01-09 15:03 [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 1/5] ARM: OMAP2+: hwmod: add enable_preprogram hook Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 2/5] ASoC: TI AESS: add autogating-enable function, callable from architecture code Sebastien Guiriec
@ 2013-01-09 15:03 ` Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 4/5] OMAP4: hwmod data: Enable AESS hwmod device Sebastien Guiriec
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Sebastien Guiriec @ 2013-01-09 15:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Paul Walmsley <paul@pwsan.com>
Enable the AESS auto-gating control bit during AESS hwmod setup. This
fixes the following boot warning on OMAP4:
omap_hwmod: aess: _wait_target_disable failed
Without this patch, the AESS IP block does not indicate to the PRCM
that it is idle after it is reset. This prevents some types of SoC
power management until something sets the auto-gating control bit.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
Cc: P?ter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-omap2/omap_hwmod.h | 6 ++++
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 1 +
arch/arm/mach-omap2/omap_hwmod_reset.c | 52 ++++++++++++++++++++++++++++
4 files changed, 60 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/mach-omap2/omap_hwmod_reset.c
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 947cafe..d88788f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -8,7 +8,7 @@ obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
omap_device.o sram.o
omap-2-3-common = irq.o
-hwmod-common = omap_hwmod.o \
+hwmod-common = omap_hwmod.o omap_hwmod_reset.o \
omap_hwmod_common_data.o
clock-common = clock.o clock_common_data.o \
clkt_dpll.o clkt_clksel.o
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 41066b4..6ec73cb 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -673,6 +673,12 @@ extern void __init omap_hwmod_init(void);
const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
/*
+ *
+ */
+
+extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
+
+/*
* Chip variant-specific hwmod init routines - XXX should be converted
* to use initcalls once the initial boot ordering is straightened out
*/
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 584acf9..13e397f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -322,6 +322,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_aess_sysc = {
static struct omap_hwmod_class omap44xx_aess_hwmod_class = {
.name = "aess",
.sysc = &omap44xx_aess_sysc,
+ .enable_preprogram = omap_hwmod_aess_preprogram,
};
/* aess */
diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
new file mode 100644
index 0000000..bba43fa
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
@@ -0,0 +1,52 @@
+/*
+ * OMAP IP block custom reset and preprogramming stubs
+ *
+ * Copyright (C) 2012 Texas Instruments, Inc.
+ * Paul Walmsley
+ *
+ * A small number of IP blocks need custom reset and preprogramming
+ * functions. The stubs in this file provide a standard way for the
+ * hwmod code to call these functions, which are to be located under
+ * drivers/.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+#include <linux/kernel.h>
+
+#include <sound/aess.h>
+
+#include "omap_hwmod.h"
+
+/**
+ * omap_hwmod_aess_preprogram - enable AESS internal autogating
+ * @oh: struct omap_hwmod *
+ *
+ * The AESS will not IdleAck to the PRCM until its internal autogating
+ * is enabled. Since internal autogating is disabled by default after
+ * AESS reset, we must enable autogating after the hwmod code resets
+ * the AESS. Returns 0.
+ */
+int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
+{
+ void __iomem *va;
+
+ va = omap_hwmod_get_mpu_rt_va(oh);
+ if (!va)
+ return -EINVAL;
+
+ aess_enable_autogating(va);
+
+ return 0;
+}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 4/5] OMAP4: hwmod data: Enable AESS hwmod device
2013-01-09 15:03 [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
` (2 preceding siblings ...)
2013-01-09 15:03 ` [PATCH v2 3/5] ARM: OMAP4+: AESS: enable internal auto-gating during initial setup Sebastien Guiriec
@ 2013-01-09 15:03 ` Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 5/5] OMAP4: hwmod data: Update AESS data with memory bank area Sebastien Guiriec
2013-01-18 14:47 ` [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
5 siblings, 0 replies; 11+ messages in thread
From: Sebastien Guiriec @ 2013-01-09 15:03 UTC (permalink / raw)
To: linux-arm-kernel
Enable AESS data in hwmod in order to be able to probe
audio driver.
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 13e397f..6d22fd0 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -6279,7 +6279,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
&omap44xx_l3_main_1__l3_main_3,
&omap44xx_l3_main_2__l3_main_3,
&omap44xx_l4_cfg__l3_main_3,
- /* &omap44xx_aess__l4_abe, */
+ &omap44xx_aess__l4_abe,
&omap44xx_dsp__l4_abe,
&omap44xx_l3_main_1__l4_abe,
&omap44xx_mpu__l4_abe,
@@ -6288,8 +6288,8 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
&omap44xx_l4_cfg__l4_wkup,
&omap44xx_mpu__mpu_private,
&omap44xx_l4_cfg__ocp_wp_noc,
- /* &omap44xx_l4_abe__aess, */
- /* &omap44xx_l4_abe__aess_dma, */
+ &omap44xx_l4_abe__aess,
+ &omap44xx_l4_abe__aess_dma,
&omap44xx_l3_main_2__c2c,
&omap44xx_l4_wkup__counter_32k,
&omap44xx_l4_cfg__ctrl_module_core,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/5] OMAP4: hwmod data: Update AESS data with memory bank area
2013-01-09 15:03 [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
` (3 preceding siblings ...)
2013-01-09 15:03 ` [PATCH v2 4/5] OMAP4: hwmod data: Enable AESS hwmod device Sebastien Guiriec
@ 2013-01-09 15:03 ` Sebastien Guiriec
2013-02-10 19:19 ` Paul Walmsley
2013-01-18 14:47 ` [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
5 siblings, 1 reply; 11+ messages in thread
From: Sebastien Guiriec @ 2013-01-09 15:03 UTC (permalink / raw)
To: linux-arm-kernel
Add AESS memory bank data in hwmod in order to provide memory
address information to the driver.
Signed-off-by: sebastien Guiriec <s-guiriec@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 42 ++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 6d22fd0..631611c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -4246,6 +4246,27 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp_wp_noc = {
static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = {
{
+ .name = "dmem",
+ .pa_start = 0x40180000,
+ .pa_end = 0x4018ffff
+ },
+ {
+ .name = "cmem",
+ .pa_start = 0x401a0000,
+ .pa_end = 0x401a1fff
+ },
+ {
+ .name = "smem",
+ .pa_start = 0x401c0000,
+ .pa_end = 0x401c5fff
+ },
+ {
+ .name = "pmem",
+ .pa_start = 0x401e0000,
+ .pa_end = 0x401e1fff
+ },
+ {
+ .name = "mpu",
.pa_start = 0x401f1000,
.pa_end = 0x401f13ff,
.flags = ADDR_TYPE_RT
@@ -4264,6 +4285,27 @@ static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess = {
static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = {
{
+ .name = "dmem_dma",
+ .pa_start = 0x49080000,
+ .pa_end = 0x4908ffff
+ },
+ {
+ .name = "cmem_dma",
+ .pa_start = 0x490a0000,
+ .pa_end = 0x490a1fff
+ },
+ {
+ .name = "smem_dma",
+ .pa_start = 0x490c0000,
+ .pa_end = 0x490c5fff
+ },
+ {
+ .name = "pmem_dma",
+ .pa_start = 0x490e0000,
+ .pa_end = 0x490e1fff
+ },
+ {
+ .name = "dma",
.pa_start = 0x490f1000,
.pa_end = 0x490f13ff,
.flags = ADDR_TYPE_RT
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 1/5] ARM: OMAP2+: hwmod: add enable_preprogram hook
2013-01-09 15:03 ` [PATCH v2 1/5] ARM: OMAP2+: hwmod: add enable_preprogram hook Sebastien Guiriec
@ 2013-01-09 15:07 ` Felipe Balbi
0 siblings, 0 replies; 11+ messages in thread
From: Felipe Balbi @ 2013-01-09 15:07 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jan 09, 2013 at 04:03:07PM +0100, Sebastien Guiriec wrote:
> From: Paul Walmsley <paul@pwsan.com>
>
> After setup/enable, some IP blocks need some additional setting to
> indicate the PRCM that they are inactive until they are configured.
> Some examples on OMAP4 include the AESS and FSUSB IP blocks.
>
> To fix this cleanly, this patch adds another optional function
> pointer, setup_preprogram, to the IP block's hwmod data. The function
the function pointer is called enable_preprogram.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130109/45c8d6c1/attachment.sig>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] ASoC: TI AESS: add autogating-enable function, callable from architecture code
2013-01-09 15:03 ` [PATCH v2 2/5] ASoC: TI AESS: add autogating-enable function, callable from architecture code Sebastien Guiriec
@ 2013-01-09 15:41 ` Mark Brown
0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2013-01-09 15:41 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jan 09, 2013 at 04:03:08PM +0100, Sebastien Guiriec wrote:
> From: Paul Walmsley <paul@pwsan.com>
>
> Add a basic header file for the TI AESS IP block, located in the OMAP4
> Audio Back-End subsystem.
Acked-by: Mark Brown <broonie'opensource.wolfsonmicro.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130109/d881fa8d/attachment-0001.sig>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP.
2013-01-09 15:03 [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
` (4 preceding siblings ...)
2013-01-09 15:03 ` [PATCH v2 5/5] OMAP4: hwmod data: Update AESS data with memory bank area Sebastien Guiriec
@ 2013-01-18 14:47 ` Sebastien Guiriec
2013-01-21 1:54 ` Paul Walmsley
5 siblings, 1 reply; 11+ messages in thread
From: Sebastien Guiriec @ 2013-01-18 14:47 UTC (permalink / raw)
To: linux-arm-kernel
Paul, Benoit,
Any comments before I resend the serie with the minor comment for Felipe?
Sebastien
On 01/09/2013 04:03 PM, Sebastien Guiriec wrote:
> v2:
> - Add missing AESS memory banks.
> - Update the serie base on comments related earlier serie:
> http://www.mail-archive.com/linux-omap at vger.kernel.org/msg69853.html
>
> The location of the callback has been updated in order to fit with AESS.
> Some call of PM runtime can be done by ASoC core when AESS is in RET so
> we need to ensure that the additional callback is call on enable
> also in order to have clock correctly stop.
>
> v1:
> ARM: OMAP4: Enable AESS IP.
>
> This patch serie extends the the hwmod HWMOD_EXT_OPT_MAIN_CLK flag for the
> AESS IP. This IP has additional register for Auto Gatting configuration. As
> it is used only for Audio the driver is not always loaded. We can reuse the
> same flag as McPDM to work around the HW problem due to bad reset value of
> AESS Auto gatting configuration register.
>
> If we try to setup and reset AESS during boot time without this serie the
> next clocks will still remain enable.
>
> omapconf abe cfg:
> |--------------------------------------------------------------|
> | ABE Clock Domain Configuration |
> |--------------------------------|-----------------------------|
> | Clock State Transition control | HW-Auto |
> | Clock State | |
> | ABE_24M_FCLK | GATED |
> | ABE_ALWON_32K_CLK | GATED |
> | ABE_SYSCLK | GATED |
> | 24M_FCLK | GATED |
> | ABE_ICLK2 | RUNNING |
> | DPLL_ABE_X2_CLK | RUNNING |
> | PAD_CLKS | GATED |
> | SLIMBUS_CLK | GATED |
> | OPP Divider | ABE_CLK = DPLL_ABE_X2_CLK/1 |
> |--------------------------------------------------------------|
>
> Paul Walmsley (3):
> ARM: OMAP2+: hwmod: add enable_preprogram hook
> ASoC: TI AESS: add autogating-enable function, callable from
> architecture code
> ARM: OMAP4+: AESS: enable internal auto-gating during initial setup
>
> Sebastien Guiriec (2):
> OMAP4: hwmod data: Enable AESS hwmod device
> OMAP4: hwmod data: Update AESS data with memory bank area
>
> arch/arm/mach-omap2/Makefile | 2 +-
> arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++++++
> arch/arm/mach-omap2/omap_hwmod.h | 8 +++++
> arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 49 +++++++++++++++++++++++--
> arch/arm/mach-omap2/omap_hwmod_reset.c | 52 +++++++++++++++++++++++++++
> include/sound/aess.h | 53 ++++++++++++++++++++++++++++
> 6 files changed, 178 insertions(+), 4 deletions(-)
> create mode 100644 arch/arm/mach-omap2/omap_hwmod_reset.c
> create mode 100644 include/sound/aess.h
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP.
2013-01-18 14:47 ` [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
@ 2013-01-21 1:54 ` Paul Walmsley
0 siblings, 0 replies; 11+ messages in thread
From: Paul Walmsley @ 2013-01-21 1:54 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 18 Jan 2013, Sebastien Guiriec wrote:
> Paul, Benoit,
>
> Any comments before I resend the serie with the minor comment for Felipe?
Not from me. The series has been queued for 3.9 with Felipe's comment
fix; thanks Felipe.
- Paul
From: Paul Walmsley <paul@pwsan.com>
Date: Sun, 20 Jan 2013 18:52:09 -0700
Subject: [PATCH] ARM: OMAP2+: hwmod: add enable_preprogram hook
After setup/enable, some IP blocks need some additional setting to
indicate the PRCM that they are inactive until they are configured.
Some examples on OMAP4 include the AESS and FSUSB IP blocks.
To fix this cleanly, this patch adds another optional function
pointer, enable_preprogram, to the IP block's hwmod data. The function
that is pointed to is called by the hwmod code immediately after the
IP block is reset.
This version of the patch includes a patch description fix from Felipe.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
Cc: P?ter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++++++++++++++
arch/arm/mach-omap2/omap_hwmod.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 4653efb..f37d22c 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2053,6 +2053,23 @@ static int _omap4_get_context_lost(struct omap_hwmod *oh)
}
/**
+ * _enable_preprogram - Pre-program an IP block during the _enable() process
+ * @oh: struct omap_hwmod *
+ *
+ * Some IP blocks (such as AESS) require some additional programming
+ * after enable before they can enter idle. If a function pointer to
+ * do so is present in the hwmod data, then call it and pass along the
+ * return value; otherwise, return 0.
+ */
+static int __init _enable_preprogram(struct omap_hwmod *oh)
+{
+ if (!oh->class->enable_preprogram)
+ return 0;
+
+ return oh->class->enable_preprogram(oh);
+}
+
+/**
* _enable - enable an omap_hwmod
* @oh: struct omap_hwmod *
*
@@ -2156,6 +2173,7 @@ static int _enable(struct omap_hwmod *oh)
_update_sysc_cache(oh);
_enable_sysc(oh);
}
+ r = _enable_preprogram(oh);
} else {
if (soc_ops.disable_module)
soc_ops.disable_module(oh);
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 3ae852a..41066b4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -501,6 +501,7 @@ struct omap_hwmod_omap4_prcm {
* @rev: revision of the IP class
* @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
* @reset: ptr to fn to be executed in place of the standard hwmod reset fn
+ * @enable_preprogram: ptr to fn to be executed during device enable
*
* Represent the class of a OMAP hardware "modules" (e.g. timer,
* smartreflex, gpio, uart...)
@@ -524,6 +525,7 @@ struct omap_hwmod_class {
u32 rev;
int (*pre_shutdown)(struct omap_hwmod *oh);
int (*reset)(struct omap_hwmod *oh);
+ int (*enable_preprogram)(struct omap_hwmod *oh);
};
/**
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/5] OMAP4: hwmod data: Update AESS data with memory bank area
2013-01-09 15:03 ` [PATCH v2 5/5] OMAP4: hwmod data: Update AESS data with memory bank area Sebastien Guiriec
@ 2013-02-10 19:19 ` Paul Walmsley
0 siblings, 0 replies; 11+ messages in thread
From: Paul Walmsley @ 2013-02-10 19:19 UTC (permalink / raw)
To: linux-arm-kernel
Hi
On Wed, 9 Jan 2013, Sebastien Guiriec wrote:
> Add AESS memory bank data in hwmod in order to provide memory
> address information to the driver.
>
> Signed-off-by: sebastien Guiriec <s-guiriec@ti.com>
Due to the cleanup of the CLKCTRL leaf clocks, this one has been updated
to change the AESS main clock to be aess_fclk, and it's also been moved to
precede the patch that enables the AESS hwmod.
- Paul
From: Sebastien Guiriec <s-guiriec@ti.com>
Date: Sun, 10 Feb 2013 11:22:24 -0700
Subject: [PATCH] ARM: OMAP4: hwmod data: Update AESS data with memory bank
area
Add AESS memory bank data in hwmod in order to provide memory address
information to the driver.
This version also changes the AESS main clock to use a
non-CLKCTRL-based functional clock. These are being removed from the
clock data, since they should be handled by the IP block integration
code. Without this change, the kernel crashes during boot. Thanks to
Tony Lindgren for reporting this during a test merge.
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
[paul at pwsan.com: updated to change the AESS main_clk]
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 44 +++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index c9c251e..a30c113 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -349,7 +349,7 @@ static struct omap_hwmod omap44xx_aess_hwmod = {
.clkdm_name = "abe_clkdm",
.mpu_irqs = omap44xx_aess_irqs,
.sdma_reqs = omap44xx_aess_sdma_reqs,
- .main_clk = "aess_fck",
+ .main_clk = "aess_fclk",
.prcm = {
.omap4 = {
.clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET,
@@ -4250,6 +4250,27 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp_wp_noc = {
static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = {
{
+ .name = "dmem",
+ .pa_start = 0x40180000,
+ .pa_end = 0x4018ffff
+ },
+ {
+ .name = "cmem",
+ .pa_start = 0x401a0000,
+ .pa_end = 0x401a1fff
+ },
+ {
+ .name = "smem",
+ .pa_start = 0x401c0000,
+ .pa_end = 0x401c5fff
+ },
+ {
+ .name = "pmem",
+ .pa_start = 0x401e0000,
+ .pa_end = 0x401e1fff
+ },
+ {
+ .name = "mpu",
.pa_start = 0x401f1000,
.pa_end = 0x401f13ff,
.flags = ADDR_TYPE_RT
@@ -4268,6 +4289,27 @@ static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess = {
static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = {
{
+ .name = "dmem_dma",
+ .pa_start = 0x49080000,
+ .pa_end = 0x4908ffff
+ },
+ {
+ .name = "cmem_dma",
+ .pa_start = 0x490a0000,
+ .pa_end = 0x490a1fff
+ },
+ {
+ .name = "smem_dma",
+ .pa_start = 0x490c0000,
+ .pa_end = 0x490c5fff
+ },
+ {
+ .name = "pmem_dma",
+ .pa_start = 0x490e0000,
+ .pa_end = 0x490e1fff
+ },
+ {
+ .name = "dma",
.pa_start = 0x490f1000,
.pa_end = 0x490f13ff,
.flags = ADDR_TYPE_RT
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-02-10 19:19 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 15:03 [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 1/5] ARM: OMAP2+: hwmod: add enable_preprogram hook Sebastien Guiriec
2013-01-09 15:07 ` Felipe Balbi
2013-01-09 15:03 ` [PATCH v2 2/5] ASoC: TI AESS: add autogating-enable function, callable from architecture code Sebastien Guiriec
2013-01-09 15:41 ` Mark Brown
2013-01-09 15:03 ` [PATCH v2 3/5] ARM: OMAP4+: AESS: enable internal auto-gating during initial setup Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 4/5] OMAP4: hwmod data: Enable AESS hwmod device Sebastien Guiriec
2013-01-09 15:03 ` [PATCH v2 5/5] OMAP4: hwmod data: Update AESS data with memory bank area Sebastien Guiriec
2013-02-10 19:19 ` Paul Walmsley
2013-01-18 14:47 ` [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP Sebastien Guiriec
2013-01-21 1:54 ` Paul Walmsley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).