compilation error

2010-02-12 Thread Niamathullah sharief
Hello,
 can anyone tell me while compilaing dbus-1.2.20 i am getting the
folllowing error
checking for XML_ParserCreate_MM in -lexpat... no
configure: error: Could not find expat.h, check config.log for failed attempts
what is wrong?what i should install?i installed libexpat also. still i
get the same error. please help me
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Moving board patches from DSS2 to linux-omap

2010-02-12 Thread Tomi Valkeinen
On Thu, 2010-02-11 at 19:52 +0100, ext Tony Lindgren wrote:
 * Tomi Valkeinen tomi.valkei...@nokia.com [100211 03:59]:
  On Thu, 2010-02-11 at 12:50 +0100, ext Mike Rapoport wrote:
   Tomi Valkeinen wrote:
Hi,

As discussed previously, board file changes in DSS2 tree cause conflicts
with linux-omap easily. There are currently three board file patches in
DSS2's for-next branch:

722a97e4594b2041bbf18d95a913ba6dfaca87f2 omap3: cm-t35: add DSS2 
display support
7a56267e775e469c64521179ccc958c8bb661dbf OMAP: AM3517: Enable DSS2 for 
AM3517EVM board
40e4e67c6dabcb9897b6823cce2297d6c3e78bbd OMAP: Enable DSS2 for OMAP3EVM 
board

The problem here is of course that DSS2 tree may contain unmerged panel
drivers, and those board file changes try to use these new panel
drivers.
 
 OK, Tomi, can you please set up a banch against mainline -rc7 with
 whatever board-*.c dss2 patches you want me to pull? I'll pull them
 into omap-for-linus, and rebase omap for-next on those.

Here:

git://gitorious.org/linux-omap-dss2/linux.git for-tony

I removed the defconfig changes from the patches, and compile tested.
I'll add the defconfig changes as separate patches in my tree, and I'll
push them to Linus only after the board changes from Tony's tree have
gone through.

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: compilation error

2010-02-12 Thread Gary Thomas

On 02/12/2010 03:13 AM, Niamathullah sharief wrote:

Hello,
  can anyone tell me while compilaing dbus-1.2.20 i am getting the
folllowing error
checking for XML_ParserCreate_MM in -lexpat... no
configure: error: Could not find expat.h, check config.log for failed attempts
what is wrong?what i should install?i installed libexpat also. still i
get the same error. please help me


As previously mentioned, this list is for discussion of the
Linux kernel on OMAP, not user/support questions.  You should
take them to a more appropriate list.

What higher level of software are you trying to run on your
OMAP board (distribution, if you want to call it that)?
Some examples might be:
  * OpenEmbedded, Poky, etc
  * 0xdroid, rowboat, etc
  * Ubuntu

Each of these projects has their own user-level support lists
and you'll find much better answers there.

--

Gary Thomas |  Consulting for the
MLB Associates  |Embedded world

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4 RFC]OMAP:GPIO: Make GPIO an early init device

2010-02-12 Thread Varadarajan, Charulatha
From: Charulatha V ch...@ti.com

This patch series splits OMAP GPIO into OMAP1 and OMAP2 components. 
Then coverts OMAP2 OMAP3 and OMAP4 GPIO module to use device registration
model and makes GPIO an early init device. This is in preparation for
the omap_device conversion of the GPIO portions.

This patch series requires early driver register support patch
sent by Thara Gopinath (http://patchwork.kernel.org/patch/77926/).
These patches are generated on top of pm branch. These patches are
boot tested on SDP 3430 and compile tested for OMAP 2420 and 2430.

Charulatha V (4):
  OMAP2: Fix compile errors
  OMAP GPIO: split omap1 and omap2+
  OMAP: Convert GPIO into a early driver
  OMAP GPIO: Convert all printk's to pr_* in gpio

 arch/arm/mach-omap1/Makefile  |2 +-
 arch/arm/mach-omap1/gpio.c| 1255 
 arch/arm/mach-omap2/Makefile  |2 +-
 arch/arm/mach-omap2/board-2430sdp.c   |3 +-
 arch/arm/mach-omap2/board-3430sdp.c   |3 +-
 arch/arm/mach-omap2/board-3630sdp.c   |3 +-
 arch/arm/mach-omap2/board-4430sdp.c   |3 +-
 arch/arm/mach-omap2/board-am3517evm.c |4 +-
 arch/arm/mach-omap2/board-apollon.c   |3 +-
 arch/arm/mach-omap2/board-ldp.c   |3 +-
 arch/arm/mach-omap2/board-omap3beagle.c   |3 +-
 arch/arm/mach-omap2/board-omap3evm.c  |3 +-
 arch/arm/mach-omap2/board-omap3pandora.c  |3 +-
 arch/arm/mach-omap2/board-omap3touchbook.c|3 +-
 arch/arm/mach-omap2/board-overo.c |3 +-
 arch/arm/mach-omap2/board-rx51.c  |3 +-
 arch/arm/mach-omap2/board-zoom2.c |3 +-
 arch/arm/mach-omap2/board-zoom3.c |3 +-
 arch/arm/mach-omap2/gpio.c| 2254 ++
 arch/arm/mach-omap2/io.c  |2 +
 arch/arm/mach-omap2/serial.c  |1 +
 arch/arm/plat-omap/Makefile   |2 +-
 arch/arm/plat-omap/gpio.c | 2521 -
 arch/arm/plat-omap/i2c.c  |2 +
 arch/arm/plat-omap/include/plat/gpio.h|  145 ++
 25 files changed, 3671 insertions(+), 2555 deletions(-)
 create mode 100644 arch/arm/mach-omap1/gpio.c
 create mode 100644 arch/arm/mach-omap2/gpio.c
 delete mode 100644 arch/arm/plat-omap/gpio.c

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4 RFC]OMAP2: Fix compile errors

2010-02-12 Thread Varadarajan, Charulatha
From: Rajendra Nayak rna...@ti.com

There are few compile errors for OMAP2 which are fixed by this patch

Signed-off-by: Rajendra Nayak rna...@ti.com
Signed-off-by: Charulatha V ch...@ti.com
---
 arch/arm/mach-omap2/board-2430sdp.c |2 +-
 arch/arm/mach-omap2/serial.c|1 +
 arch/arm/plat-omap/i2c.c|2 ++
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
b/arch/arm/mach-omap2/board-2430sdp.c
index d6f55ef..3f45d4b 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -146,7 +146,7 @@ static void __init omap_2430sdp_init_irq(void)
 {
omap_board_config = sdp2430_config;
omap_board_config_size = ARRAY_SIZE(sdp2430_config);
-   omap2_init_common_hw(NULL, NULL);
+   omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
omap_init_irq();
omap_gpio_init();
 }
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index e7b874f..a686948 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -570,6 +570,7 @@ DEVICE_ATTR(sleep_timeout, 0644, sleep_timeout_show, 
sleep_timeout_store);
 #define DEV_CREATE_FILE(dev, attr) WARN_ON(device_create_file(dev, attr))
 #else
 static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
+static void omap_uart_block_sleep(struct omap_uart_state *uart) {}
 #define DEV_CREATE_FILE(dev, attr)
 #endif /* CONFIG_PM */
 
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index fcb515d..6a617ca 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -99,6 +99,8 @@ static void omap_i2c_set_wfc_mpu_wkup_lat(struct device *dev, 
int val)
 {
omap_pm_set_max_mpu_wakeup_lat(dev, val);
 }
+#else
+static void omap_i2c_set_wfc_mpu_wkup_lat(struct device *dev, int val) {}
 #endif
 
 static void __init omap_set_i2c_constraint_func(
-- 
1.6.3.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4 RFC]OMAP:Convert GPIO into a early driver

2010-02-12 Thread Varadarajan, Charulatha
From: Charulatha V ch...@ti.com

This patch converts GPIO module into a platform driver by
making each GPIO Bank a device. This is done by providing
clock, interrupt and base address details through platform data.

This patch also initializes GPIO driver as a earlydriver. This is
so that GPIO devices are initialized very early on during bootup.

In board files, omap_init_irq is moved before omap2_init_common_hw
so that omap_init_irq is completed before early drivers uses irqs.

The device structures introduced in this patch would be later removed
when GPIO driver gets adapted to HWmod framework

Signed-off-by: Charulatha V ch...@ti.com
---
 arch/arm/mach-omap2/board-2430sdp.c|3 +-
 arch/arm/mach-omap2/board-3430sdp.c|3 +-
 arch/arm/mach-omap2/board-3630sdp.c|3 +-
 arch/arm/mach-omap2/board-4430sdp.c|3 +-
 arch/arm/mach-omap2/board-am3517evm.c  |4 +-
 arch/arm/mach-omap2/board-apollon.c|3 +-
 arch/arm/mach-omap2/board-ldp.c|3 +-
 arch/arm/mach-omap2/board-omap3beagle.c|3 +-
 arch/arm/mach-omap2/board-omap3evm.c   |3 +-
 arch/arm/mach-omap2/board-omap3pandora.c   |3 +-
 arch/arm/mach-omap2/board-omap3touchbook.c |3 +-
 arch/arm/mach-omap2/board-overo.c  |3 +-
 arch/arm/mach-omap2/board-rx51.c   |3 +-
 arch/arm/mach-omap2/board-zoom2.c  |3 +-
 arch/arm/mach-omap2/board-zoom3.c  |3 +-
 arch/arm/mach-omap2/gpio.c | 1230 +---
 arch/arm/mach-omap2/io.c   |2 +
 arch/arm/plat-omap/include/plat/gpio.h |  130 +++-
 18 files changed, 1085 insertions(+), 323 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
b/arch/arm/mach-omap2/board-2430sdp.c
index 3f45d4b..ad05cde 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -146,9 +146,8 @@ static void __init omap_2430sdp_init_irq(void)
 {
omap_board_config = sdp2430_config;
omap_board_config_size = ARRAY_SIZE(sdp2430_config);
-   omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
omap_init_irq();
-   omap_gpio_init();
+   omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 }
 
 static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index b4ffcff..820b34c 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -344,10 +344,9 @@ static void __init omap_3430sdp_init_irq(void)
omap_board_config_size = ARRAY_SIZE(sdp3430_config);
omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
omap3_pm_init_vc(omap3_setuptime_table);
+   omap_init_irq();
omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL, 
omap3_mpu_rate_table,
 omap3_dsp_rate_table, omap3_l3_rate_table);
-   omap_init_irq();
-   omap_gpio_init();
 }
 
 static int sdp3430_batt_table[] = {
diff --git a/arch/arm/mach-omap2/board-3630sdp.c 
b/arch/arm/mach-omap2/board-3630sdp.c
index 0b6dd04..fdc2762 100755
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -79,11 +79,10 @@ static void __init omap_sdp_init_irq(void)
 {
omap_board_config = sdp_config;
omap_board_config_size = ARRAY_SIZE(sdp_config);
+   omap_init_irq();
omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
 h8mbx00u0mer0em_sdrc_params,
  NULL, NULL, NULL);
-   omap_init_irq();
-   omap_gpio_init();
 }
 
 #ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index cc4c00d..ace6be7 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -69,12 +69,11 @@ static void __init omap_4430sdp_init_irq(void)
 {
omap_board_config = sdp4430_config;
omap_board_config_size = ARRAY_SIZE(sdp4430_config);
+   gic_init_irq();
omap2_init_common_hw(NULL, NULL);
 #ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(1);
 #endif
-   gic_init_irq();
-   omap_gpio_init();
 }
 
 
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 3966846..be8e750 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -45,10 +45,8 @@ static void __init am3517_evm_init_irq(void)
 {
omap_board_config = am3517_evm_config;
omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
-
-   omap2_init_common_hw(NULL, NULL);
omap_init_irq();
-   omap_gpio_init();
+   omap2_init_common_hw(NULL, NULL);
 }
 
 static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
diff --git a/arch/arm/mach-omap2/board-apollon.c 
b/arch/arm/mach-omap2/board-apollon.c
index d8934fe..75027d7 100644
--- 

[PATCH 4/4 RFC]OMAP:GPIO: Convert all printk's to pr_* in gpio

2010-02-12 Thread Varadarajan, Charulatha
From: Charulatha V ch...@ti.com

GPIO driver still uses printk's instead of using pr_*
This patch fixes all such instances.

Signed-off-by: Charulatha V ch...@ti.com
Signed-off-by: Rajendra Nayak rna...@ti.com
---
 arch/arm/mach-omap2/gpio.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 65b8edb..f28900f 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -824,7 +824,7 @@ static inline int gpio_valid(int gpio)
 static int check_gpio(int gpio)
 {
if (unlikely(gpio_valid(gpio)  0)) {
-   printk(KERN_ERR omap-gpio: invalid GPIO %d\n, gpio);
+   pr_err(omap-gpio: invalid GPIO %d\n, gpio);
dump_stack();
return -1;
}
@@ -937,7 +937,7 @@ void omap_set_gpio_debounce(int gpio, int enable)
}
 
if (!(bank-mod_usage  l)) {
-   printk(KERN_ERR GPIO %d not requested\n, gpio);
+   pr_err(GPIO %d not requested\n, gpio);
return;
}
 
@@ -974,7 +974,7 @@ void omap_set_gpio_debounce_time(int gpio, int enc_time)
reg = bank-base;
 
if (!bank-mod_usage) {
-   printk(KERN_ERR GPIO not requested\n);
+   pr_err(GPIO not requested\n);
return;
}
 
@@ -1209,7 +1209,7 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
unsigned long uninitialized_var(flags);
 
if (bank-non_wakeup_gpios  (1  gpio)) {
-   printk(KERN_ERR Unable to modify wakeup on 
+   pr_err(Unable to modify wakeup on 
non-wakeup GPIO%d\n,
(bank - gpio_bank) * 32 + gpio);
return -EINVAL;
@@ -1535,7 +1535,7 @@ static int __init omap3_gpio_pads_init(void)
GFP_KERNEL);
 
if (gpio_pads == NULL) {
-   printk(KERN_ERR FATAL: Failed to allocate gpio_pads\n);
+   pr_err(FATAL: Failed to allocate gpio_pads\n);
return -ENOMEM;
}
 
@@ -2002,7 +2002,7 @@ static int __devinit omap_gpio_probe(struct 
platform_device *pdev)
int id, i;
 
if (!pdev || !pdata) {
-   printk(KERN_ERR GPIO device initialize without
+   pr_err(GPIO device initialize without
platform data\n);
return -EINVAL;
}
@@ -2018,7 +2018,7 @@ static int __devinit omap_gpio_probe(struct 
platform_device *pdev)
 
id = pdev-id;
if (id  gpio_bank_count) {
-   printk(KERN_ERR Invalid GPIO device id (%d)\n, id);
+   pr_err(Invalid GPIO device id (%d)\n, id);
return -EINVAL;
}
 
@@ -2031,14 +2031,14 @@ static int __devinit omap_gpio_probe(struct 
platform_device *pdev)
 
bank-ick = clk_get(NULL, pdata-ick_name);
if (IS_ERR(bank-ick))
-   printk(KERN_ERR Could not get %s\n, pdata-ick_name);
+   pr_err(Could not get %s\n, pdata-ick_name);
else
clk_enable(bank-ick);
 
if (cpu_is_omap24xx()) {
bank-fck = clk_get(NULL, pdata-fck_name);
if (IS_ERR(bank-fck))
-   printk(KERN_ERR Could not get %s\n, pdata-fck_name);
+   pr_err(Could not get %s\n, pdata-fck_name);
else
clk_enable(bank-fck);
}
@@ -2048,19 +2048,19 @@ static int __devinit omap_gpio_probe(struct 
platform_device *pdev)
/* Static mapping, never released */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (unlikely(!res)) {
-   printk(KERN_ERR GPIO Bank %i Invalid mem resource\n, id);
+   pr_err(GPIO Bank %i Invalid mem resource\n, id);
return -ENODEV;
}
 
bank-base = ioremap(res-start, resource_size(res));
if (!bank-base) {
-   printk(KERN_ERR Could not ioremap gpio bank%i\n, id);
+   pr_err(Could not ioremap gpio bank%i\n, id);
return -ENOMEM;
}
 
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (unlikely(!res)) {
-   printk(KERN_ERR GPIO Bank %i Invalid irq resource\n, id);
+   pr_err(GPIO Bank %i Invalid irq resource\n, id);
return -ENODEV;
}
 
@@ -2126,7 +2126,7 @@ static int __devinit omap_gpio_probe(struct 
platform_device *pdev)
if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
bank-dbck = clk_get(NULL, pdata-dbck_name);
if (IS_ERR(bank-dbck))
-   printk(KERN_ERR Could not get %s\n, pdata-dbck_name);
+   pr_err(Could not get %s\n, pdata-dbck_name);
}
 
/* Enable autoidle for the OCP interface */
-- 
1.6.3.3

--
To unsubscribe from this list: send the line 

[PATCH 1/2 RFC]OMAP3430: hwmod: add GPIO hwmods

2010-02-12 Thread Varadarajan, Charulatha
From: Charulatha V ch...@ti.com

Add hwmod structures for GPIO module on OMAP3430.

Signed-off-by: Charulatha V ch...@ti.com
Signed-off-by: Rajendra Nayak rna...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_34xx.h |  410 +
 1 files changed, 410 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_34xx.h 
b/arch/arm/mach-omap2/omap_hwmod_34xx.h
index 2e629dc..b22b458 100644
--- a/arch/arm/mach-omap2/omap_hwmod_34xx.h
+++ b/arch/arm/mach-omap2/omap_hwmod_34xx.h
@@ -18,6 +18,7 @@
 #include mach/irqs.h
 #include plat/cpu.h
 #include plat/dma.h
+#include plat/gpio.h
 
 #include prm-regbits-34xx.h
 
@@ -25,6 +26,12 @@ static struct omap_hwmod omap34xx_mpu_hwmod;
 static struct omap_hwmod omap34xx_l3_hwmod;
 static struct omap_hwmod omap34xx_l4_core_hwmod;
 static struct omap_hwmod omap34xx_l4_per_hwmod;
+static struct omap_hwmod omap34xx_gpio1_hwmod;
+static struct omap_hwmod omap34xx_gpio2_hwmod;
+static struct omap_hwmod omap34xx_gpio3_hwmod;
+static struct omap_hwmod omap34xx_gpio4_hwmod;
+static struct omap_hwmod omap34xx_gpio5_hwmod;
+static struct omap_hwmod omap34xx_gpio6_hwmod;
 
 /* L3 - L4_CORE interface */
 static struct omap_hwmod_ocp_if omap34xx_l3__l4_core = {
@@ -70,6 +77,168 @@ static struct omap_hwmod omap34xx_l3_hwmod = {
 
 static struct omap_hwmod omap34xx_l4_wkup_hwmod;
 
+/*
+ * GPIO1 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio1_addr_space[] = {
+   {
+   .pa_start   = OMAP34XX_GPIO1_BASE,
+   .pa_end = OMAP34XX_GPIO1_BASE + OMAP3_GPIO_AS_LEN - 1,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* GPIO1 - L4_WKUP interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_wkup__gpio1 = {
+   .master = omap34xx_l4_wkup_hwmod,
+   .slave  = omap34xx_gpio1_hwmod,
+   .clkdev_dev_id  = NULL,
+   .clkdev_con_id  = gpio1_ick,
+   .addr   = omap34xx_gpio1_addr_space,
+   .addr_cnt   = ARRAY_SIZE(omap34xx_gpio1_addr_space),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio1_slaves[] = {
+   omap34xx_l4_wkup__gpio1,
+};
+
+/*
+ * GPIO2 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio2_addr_space[] = {
+   {
+   .pa_start   = OMAP34XX_GPIO2_BASE,
+   .pa_end = OMAP34XX_GPIO2_BASE + OMAP3_GPIO_AS_LEN - 1,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* GPIO2 - L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio2 = {
+   .master = omap34xx_l4_per_hwmod,
+   .slave  = omap34xx_gpio2_hwmod,
+   .clkdev_dev_id  = NULL,
+   .clkdev_con_id  = gpio2_ick,
+   .addr   = omap34xx_gpio2_addr_space,
+   .addr_cnt   = ARRAY_SIZE(omap34xx_gpio2_addr_space),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio2_slaves[] = {
+   omap34xx_l4_per__gpio2,
+};
+
+/*
+ * GPIO3 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio3_addr_space[] = {
+   {
+   .pa_start   = OMAP34XX_GPIO3_BASE,
+   .pa_end = OMAP34XX_GPIO3_BASE + OMAP3_GPIO_AS_LEN - 1,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* GPIO3 - L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio3 = {
+   .master = omap34xx_l4_per_hwmod,
+   .slave  = omap34xx_gpio3_hwmod,
+   .clkdev_dev_id  = NULL,
+   .clkdev_con_id  = gpio3_ick,
+   .addr   = omap34xx_gpio3_addr_space,
+   .addr_cnt   = ARRAY_SIZE(omap34xx_gpio3_addr_space),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+static struct omap_hwmod_ocp_if *omap34xx_gpio3_slaves[] = {
+   omap34xx_l4_per__gpio3,
+};
+
+/*
+ * GPIO4 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio4_addr_space[] = {
+   {
+   .pa_start   = OMAP34XX_GPIO4_BASE,
+   .pa_end = OMAP34XX_GPIO4_BASE + OMAP3_GPIO_AS_LEN - 1,
+   .flags  = ADDR_TYPE_RT
+   },
+};
+
+/* GPIO4 - L4_PER interface */
+static struct omap_hwmod_ocp_if omap34xx_l4_per__gpio4 = {
+   .master = omap34xx_l4_per_hwmod,
+   .slave  = omap34xx_gpio4_hwmod,
+   .clkdev_dev_id  = NULL,
+   .clkdev_con_id  = gpio4_ick,
+   .addr   = omap34xx_gpio4_addr_space,
+   .addr_cnt   = ARRAY_SIZE(omap34xx_gpio4_addr_space),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_gpio4_slaves[] = {
+   omap34xx_l4_per__gpio4,
+};
+
+/*
+ * GPIO5 interface data
+ */
+
+static struct omap_hwmod_addr_space omap34xx_gpio5_addr_space[] = {
+   {
+   .pa_start   = OMAP34XX_GPIO5_BASE,
+   .pa_end = OMAP34XX_GPIO5_BASE + 

[PATCH 2/2 RFC]OMAP3430: hwmod: Adapt GPIO to use HWMOD FW

2010-02-12 Thread Varadarajan, Charulatha
From: Charulatha V ch...@ti.com

HWmod framework is used for OMAP3430 GPIO driver.

Signed-off-by: Charulatha V ch...@ti.com
---
 arch/arm/mach-omap2/gpio.c |  901 
 arch/arm/plat-omap/include/plat/gpio.h |   25 +-
 2 files changed, 123 insertions(+), 803 deletions(-)

diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index f28900f..7b00a1e 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -31,689 +31,15 @@
 #include asm/mach/irq.h
 #include plat/powerdomain.h
 #include plat/mux.h
+#include plat/omap_hwmod.h
+#include plat/omap_device.h
 
-/*
- * OMAP242X GPIO1 interface data
- */
-static struct __initdata resource omap242x_gpio1_resources[] = {
-   {
-   .start  = OMAP242X_GPIO1_BASE,
-   .end= OMAP242X_GPIO1_BASE + OMAP2_GPIO_AS_LEN - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_24XX_GPIO_BANK1,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio1_config = {
-   .ick_name = gpios_ick,
-   .fck_name = gpios_fck,
-   .virtual_irq_start = IH_GPIO_BASE,
-};
-
-static struct __initdata platform_device omap242x_gpio1 = {
-   .name   = omap-gpio,
-   .id = 0,
-   .dev= {
-   .platform_data = omap242x_gpio1_config,
-   },
-   .num_resources = ARRAY_SIZE(omap242x_gpio1_resources),
-   .resource = omap242x_gpio1_resources,
-};
-
-/*
- * OMAP242X GPIO2 interface data
- */
-static struct __initdata resource omap242x_gpio2_resources[] = {
-   {
-   .start  = OMAP242X_GPIO2_BASE,
-   .end= OMAP242X_GPIO2_BASE + OMAP2_GPIO_AS_LEN - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_24XX_GPIO_BANK2,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio2_config = {
-   .ick_name = gpios_ick,
-   .fck_name = gpios_fck,
-   .virtual_irq_start = IH_GPIO_BASE + 32,
-};
-
-static struct __initdata platform_device omap242x_gpio2 = {
-   .name   = omap-gpio,
-   .id = 1,
-   .dev= {
-   .platform_data = omap242x_gpio2_config,
-   },
-   .num_resources = ARRAY_SIZE(omap242x_gpio2_resources),
-   .resource = omap242x_gpio2_resources,
-};
-
-/*
- * OMAP242X GPIO3 interface data
- */
-static struct __initdata resource omap242x_gpio3_resources[] = {
-   {
-   .start  = OMAP242X_GPIO3_BASE,
-   .end= OMAP242X_GPIO3_BASE + OMAP2_GPIO_AS_LEN - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_24XX_GPIO_BANK3,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio3_config = {
-   .ick_name = gpios_ick,
-   .fck_name = gpios_fck,
-   .virtual_irq_start = IH_GPIO_BASE + 64,
-};
-
-static struct __initdata platform_device omap242x_gpio3 = {
-   .name   = omap-gpio,
-   .id = 2,
-   .dev= {
-   .platform_data = omap242x_gpio3_config,
+struct omap_device_pm_latency omap_gpio_latency[] = {
+   [0] = {
+   .deactivate_func = omap_device_idle_hwmods,
+   .activate_func   = omap_device_enable_hwmods,
+   .flags   = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
-   .num_resources = ARRAY_SIZE(omap242x_gpio3_resources),
-   .resource = omap242x_gpio3_resources,
-};
-
-/*
- * OMAP242X GPIO4 interface data
- */
-static struct __initdata resource omap242x_gpio4_resources[] = {
-   {
-   .start  = OMAP242X_GPIO4_BASE,
-   .end= OMAP242X_GPIO4_BASE + OMAP2_GPIO_AS_LEN - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_24XX_GPIO_BANK4,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static struct __initdata omap_gpio_platform_data omap242x_gpio4_config = {
-   .ick_name = gpios_ick,
-   .fck_name = gpios_fck,
-   .virtual_irq_start = IH_GPIO_BASE + 96,
-};
-
-static struct __initdata platform_device omap242x_gpio4 = {
-   .name   = omap-gpio,
-   .id = 3,
-   .dev= {
-   .platform_data = omap242x_gpio4_config,
-   },
-   .num_resources = ARRAY_SIZE(omap242x_gpio4_resources),
-   .resource = omap242x_gpio4_resources,
-};
-
-/*
- * OMAP243X GPIO1 interface data
- */
-static struct __initdata resource omap243x_gpio1_resources[] = {
-   {
-   .start  = OMAP243X_GPIO1_BASE,
-   .end= OMAP243X_GPIO1_BASE + OMAP2_GPIO_AS_LEN - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_24XX_GPIO_BANK1,
-   

omap3 camera interface driver

2010-02-12 Thread Weng, Wending
Hi Hiremath,

I used to work with BSP from TI, there is driver for camera 
interface. Now I switched to 2.6.33.rc3, don't see any omap3 camera interface 
driver, could you tell me the status of this driver? Thanks.

Software Engineer
Wending
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] dspbridge: proc: double free on error path

2010-02-12 Thread Phil Carmody

First a bit of a cleanup of what was clearly some legacy 'handle'
usage, and then a new quicker escape route for an error path to
avoid a double free.

It's tempting to get a bit more invasive, as there's a lot of
quite dodgy looking code (e.g. casting away const) in the areas
around my changes, but they'll have to wait for another time.


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] dspbridge: proc: it's a pointer, not a handle

2010-02-12 Thread Phil Carmody
From: Phil Carmody ext-phil.2.carm...@nokia.com

If there's one thing worse than systems hungarian notation,
it's misleading systems hungarian notation. And you don't
need 2 copies of the pointer.

Signed-off-by: Phil Carmody ext-phil.2.carm...@nokia.com
---
 drivers/dsp/bridge/rmgr/proc.c |   25 +++--
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 2ccbc9b..7bc1bcd 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -313,7 +313,6 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
DSP_STATUS status = DSP_EFAIL;
u32 dwAutoStart = 0;/* autostart flag */
struct PROC_OBJECT *pProcObject;
-   struct PROC_OBJECT *hProcObject;
char szExecFile[MAXCMDLINELEN];
char *argv[2];
struct MGR_OBJECT *hMgrObject = NULL;
@@ -345,19 +344,18 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
GT_0trace(PROC_DebugMask, GT_1CLASS, NTFY Created \n);
pProcObject-hDevObject = hDevObject;
pProcObject-hMgrObject = hMgrObject;
-   hProcObject = pProcObject;
status = DEV_GetIntfFxns(hDevObject, pProcObject-pIntfFxns);
if (DSP_SUCCEEDED(status)) {
status = DEV_GetWMDContext(hDevObject,
pProcObject-hWmdContext);
if (DSP_FAILED(status)) {
-   MEM_FreeObject(hProcObject);
+   MEM_FreeObject(pProcObject);
GT_0trace(PROC_DebugMask, GT_7CLASS,
 PROC_AutoStart: Failed 
 to get WMD Context \n);
}
} else {
-   MEM_FreeObject(hProcObject);
+   MEM_FreeObject(pProcObject);
GT_0trace(PROC_DebugMask, GT_7CLASS,
 PROC_AutoStart: Failed to 
 get IntFxns \n);
@@ -366,7 +364,7 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
goto func_cont;
 
/* Stop the Device, put it into standby mode */
-   status = PROC_Stop(hProcObject);
+   status = PROC_Stop(pProcObject);
 
if (DSP_FAILED(status))
goto func_cont;
@@ -388,9 +386,9 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
argv[0] = szExecFile;
argv[1] = NULL;
/* ...and try to load it: */
-   status = PROC_Load(hProcObject, 1, (CONST char **)argv, NULL);
+   status = PROC_Load(pProcObject, 1, (CONST char **)argv, NULL);
if (DSP_SUCCEEDED(status)) {
-   status = PROC_Start(hProcObject);
+   status = PROC_Start(pProcObject);
if (DSP_SUCCEEDED(status)) {
GT_0trace(PROC_DebugMask, GT_1CLASS,
  PROC_AutoStart: Processor started 
@@ -409,9 +407,9 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
 No Exec file found \n);
}
 func_cont:
-   kfree(hProcObject-g_pszLastCoff);
-   hProcObject-g_pszLastCoff = NULL;
-   MEM_FreeObject(hProcObject);
+   kfree(pProcObject-g_pszLastCoff);
+   pProcObject-g_pszLastCoff = NULL;
+   MEM_FreeObject(pProcObject);
 func_end:
GT_1trace(PROC_DebugMask, GT_ENTER,
 Exiting PROC_AutoStart, status:0x%x\n, status);
@@ -1742,7 +1740,7 @@ func_end:
  *  This does a WMD_BRD_Stop, DEV_Destroy2 and WMD_BRD_Monitor.
  *  In DEV_Destroy2 we delete the node manager.
  *  Parameters:
- *  hProcObject:Handle to Processor Object
+ *  pProcObject:Pointer to Processor Object
  *  Returns:
  *  DSP_SOK:   Processor placed in monitor mode.
  *  !DSP_SOK:   Failed to place processor in monitor mode.
@@ -1751,10 +1749,9 @@ func_end:
  *  Ensures:
  *  Success:   ProcObject state is PROC_IDLE
  */
-static DSP_STATUS PROC_Monitor(struct PROC_OBJECT *hProcObject)
+static DSP_STATUS PROC_Monitor(struct PROC_OBJECT *pProcObject)
 {
DSP_STATUS status = DSP_EFAIL;
-   struct PROC_OBJECT *pProcObject = (struct PROC_OBJECT *)hProcObject;
struct MSG_MGR *hMsgMgr;
 #ifdef CONFIG_BRIDGE_DEBUG
BRD_STATUS uBrdState;
@@ -1764,7 +1761,7 @@ static DSP_STATUS PROC_Monitor(struct PROC_OBJECT 
*hProcObject)
DBC_Require(MEM_IsValidHandle(pProcObject, PROC_SIGNATURE));
 
GT_1trace(PROC_DebugMask, GT_ENTER, Entered PROC_Monitor, args:\n\t
-hProcessor: 0x%x\n, hProcObject);
+hProcessor: 0x%x\n, pProcObject);
/* This is needed only when Device is loaded when it is
 * already 'ACTIVE' */
/* Destory the Node Manager, MSG Manager */
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to 

[PATCH 2/2] dspbridge: proc: fix a double-free on 2 error paths

2010-02-12 Thread Phil Carmody
From: Phil Carmody ext-phil.2.carm...@nokia.com

We free in the tail cleanup, so don't free before jumping there.

Signed-off-by: Phil Carmody ext-phil.2.carm...@nokia.com
---
 drivers/dsp/bridge/rmgr/proc.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 7bc1bcd..e89077b 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -349,13 +349,11 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
status = DEV_GetWMDContext(hDevObject,
pProcObject-hWmdContext);
if (DSP_FAILED(status)) {
-   MEM_FreeObject(pProcObject);
GT_0trace(PROC_DebugMask, GT_7CLASS,
 PROC_AutoStart: Failed 
 to get WMD Context \n);
}
} else {
-   MEM_FreeObject(pProcObject);
GT_0trace(PROC_DebugMask, GT_7CLASS,
 PROC_AutoStart: Failed to 
 get IntFxns \n);
@@ -377,6 +375,10 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
 CFG_GetAutoStart DSP_FAILED \n);
goto func_cont;
}
+
+   /* paranoid - must be able to kfree this on remaining error paths */
+   pProcObject-g_pszLastCoff = NULL;
+
/* Get the default executable for this board... */
DEV_GetDevType(hDevObject, (u32 *)devType);
pProcObject-uProcessor = devType;
@@ -406,9 +408,9 @@ DSP_STATUS PROC_AutoStart(struct CFG_DEVNODE *hDevNode,
GT_0trace(PROC_DebugMask, GT_7CLASS, PROC_AutoStart: 
 No Exec file found \n);
}
-func_cont:
kfree(pProcObject-g_pszLastCoff);
pProcObject-g_pszLastCoff = NULL;
+func_cont:
MEM_FreeObject(pProcObject);
 func_end:
GT_1trace(PROC_DebugMask, GT_ENTER,
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv4] OMAP3: Serial: Improved sleep logic

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

This patch contains following improvements:
- Only RX interrupt will now kick the sleep prevent timer
- TX fifo status is checked before disabling clocks, this will prevent
  on-going transmission to be cut
- Smartidle is now enabled/disabled only while switching clocks, as having
  smartidle enabled while RX/TX prevents any wakeups from being
  received from UART module
- Sleep prevent timer is changed to use ktime_get() instead of a jiffy timer
  as jiffy timers are not valid within idle loop (tick scheduler is stopped)
- Added RX ignore timer for ignoring the first character received during
  first millisecond of wakeup, this prevents garbage character to be receive
  in low sleep states

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/serial.c |   79 +++--
 1 files changed, 52 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 5f3035e..4be9ace 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -29,6 +29,8 @@
 #include plat/clock.h
 #include plat/control.h
 
+#include asm/div64.h
+
 #include prm.h
 #include pm.h
 #include prm-regbits-34xx.h
@@ -42,13 +44,14 @@
  * disabled via sysfs. This also causes that any deeper omap sleep states are
  * blocked. 
  */
-#define DEFAULT_TIMEOUT 0
+#define DEFAULT_TIMEOUT (0LL * NSEC_PER_SEC)
 
 struct omap_uart_state {
int num;
int can_sleep;
-   struct timer_list timer;
-   u32 timeout;
+   ktime_t expire_time;
+   ktime_t garbage_time;
+   u64 timeout;
 
void __iomem *wk_st;
void __iomem *wk_en;
@@ -243,6 +246,9 @@ static inline void omap_uart_save_context(struct 
omap_uart_state *uart) {}
 static inline void omap_uart_restore_context(struct omap_uart_state *uart) {}
 #endif /* CONFIG_PM  CONFIG_ARCH_OMAP3 */
 
+static void omap_uart_smart_idle_enable(struct omap_uart_state *uart,
+   int enable);
+
 static inline void omap_uart_enable_clocks(struct omap_uart_state *uart)
 {
if (uart-clocked)
@@ -250,8 +256,12 @@ static inline void omap_uart_enable_clocks(struct 
omap_uart_state *uart)
 
clk_enable(uart-ick);
clk_enable(uart-fck);
+   omap_uart_smart_idle_enable(uart, 0);
uart-clocked = 1;
omap_uart_restore_context(uart);
+
+   /* Set up garbage timer to ignore RX during first 1ms */
+   uart-garbage_time = ktime_add_ns(ktime_get(), NSEC_PER_MSEC);
 }
 
 #ifdef CONFIG_PM
@@ -263,6 +273,7 @@ static inline void omap_uart_disable_clocks(struct 
omap_uart_state *uart)
 
omap_uart_save_context(uart);
uart-clocked = 0;
+   omap_uart_smart_idle_enable(uart, 1);
clk_disable(uart-ick);
clk_disable(uart-fck);
 }
@@ -320,12 +331,9 @@ static void omap_uart_block_sleep(struct omap_uart_state 
*uart)
 {
omap_uart_enable_clocks(uart);
 
-   omap_uart_smart_idle_enable(uart, 0);
uart-can_sleep = 0;
if (uart-timeout)
-   mod_timer(uart-timer, jiffies + uart-timeout);
-   else
-   del_timer(uart-timer);
+   uart-expire_time = ktime_add_ns(ktime_get(), uart-timeout);
 }
 
 static void omap_uart_allow_sleep(struct omap_uart_state *uart)
@@ -338,16 +346,7 @@ static void omap_uart_allow_sleep(struct omap_uart_state 
*uart)
if (!uart-clocked)
return;
 
-   omap_uart_smart_idle_enable(uart, 1);
uart-can_sleep = 1;
-   del_timer(uart-timer);
-}
-
-static void omap_uart_idle_timer(unsigned long data)
-{
-   struct omap_uart_state *uart = (struct omap_uart_state *)data;
-
-   omap_uart_allow_sleep(uart);
 }
 
 void omap_uart_prepare_idle(int num)
@@ -355,8 +354,14 @@ void omap_uart_prepare_idle(int num)
struct omap_uart_state *uart;
 
list_for_each_entry(uart, uart_list, node) {
+   if (num == uart-num  !uart-can_sleep  uart-timeout)
+   if (ktime_get().tv64  uart-expire_time.tv64)
+   uart-can_sleep = 1;
+
if (num == uart-num  uart-can_sleep) {
-   omap_uart_disable_clocks(uart);
+   if (serial_read_reg(uart-p, UART_LSR) 
+   UART_LSR_TEMT)
+   omap_uart_disable_clocks(uart);
return;
}
}
@@ -404,6 +409,10 @@ int omap_uart_can_sleep(void)
if (!uart-clocked)
continue;
 
+   if (!uart-can_sleep  uart-timeout 
+   ktime_get().tv64  uart-expire_time.tv64)
+   uart-can_sleep = 1;
+
if (!uart-can_sleep) {
can_sleep = 0;
continue;
@@ -428,10 +437,22 @@ int omap_uart_can_sleep(void)
 static irqreturn_t omap_uart_interrupt(int irq, void *dev_id)
 {

[PATCHv6 2/9] OMAP3: PM: Added support for INACTIVE and ON states in omap_sram_idle

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

Previously omap_sram_idle() did not know about the difference between ON and
INACTIVE states, which complicated the state handling in these cases. Now,
the following changes are done in the idle logic:

- Check for IO-chain arming is changed to reflect desired state (RET)
- UART clocks will be disabled if we attempt to enter INACTIVE (this allows
  the state change to actually happen)

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/pm34xx.c |   23 ---
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index f20d3d8..c2d80fc 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -383,9 +383,10 @@ void omap_sram_idle(void)
pwrdm_clear_all_prev_pwrst(core_pwrdm);
pwrdm_clear_all_prev_pwrst(per_pwrdm);
 
-   mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
+   mpu_next_state = omap3_pwrdm_read_next_pwrst(mpu_pwrdm);
switch (mpu_next_state) {
case PWRDM_POWER_ON:
+   case PWRDM_POWER_INACTIVE:
case PWRDM_POWER_RET:
/* No need to save context */
save_state = 0;
@@ -403,11 +404,11 @@ void omap_sram_idle(void)
 
/* NEON control */
if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
-   pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
+   omap3_pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
 
/* PER */
-   per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
-   core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
+   per_next_state = omap3_pwrdm_read_next_pwrst(per_pwrdm);
+   core_next_state = omap3_pwrdm_read_next_pwrst(core_pwrdm);
if (per_next_state  PWRDM_POWER_ON) {
omap2_gpio_prepare_for_idle(per_next_state);
if (per_next_state == PWRDM_POWER_OFF) {
@@ -452,9 +453,11 @@ void omap_sram_idle(void)
OMAP3430_GR_MOD,
OMAP3_PRM_VOLTCTRL_OFFSET);
}
-   /* Enable IO-PAD and IO-CHAIN wakeups */
-   prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
-   omap3_enable_io_chain();
+   if (core_next_state = PWRDM_POWER_RET) {
+   /* Enable IO-PAD and IO-CHAIN wakeups */
+   prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
+   omap3_enable_io_chain();
+   }
}
omap3_intc_prepare_idle();
 
@@ -556,15 +559,13 @@ void omap_sram_idle(void)
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
-   if (core_next_state  PWRDM_POWER_ON) {
+   if (core_next_state = PWRDM_POWER_RET) {
prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
omap3_disable_io_chain();
}
 
 
pwrdm_post_transition();
-
-   omap2_clkdm_allow_idle(mpu_pwrdm-pwrdm_clkdms[0]);
 }
 
 int omap3_can_sleep(void)
@@ -730,7 +731,7 @@ static int omap3_pm_suspend(void)
 
/* Read current next_pwrsts */
list_for_each_entry(pwrst, pwrst_list, node)
-   pwrst-saved_state = pwrdm_read_next_pwrst(pwrst-pwrdm);
+   pwrst-saved_state = omap3_pwrdm_read_next_pwrst(pwrst-pwrdm);
/* Set ones wanted by suspend */
list_for_each_entry(pwrst, pwrst_list, node) {
if (set_pwrdm_state(pwrst-pwrdm, pwrst-next_state))
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv6 3/9] OMAP3: CPUidle: Fixed support for ON / INACTIVE states

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

New powerdomain support code for INACTIVE state removes the need to control
clockdomains directly from cpuidle. Also, cpuidle state definitions can now
directly support ON / INACTIVE simplifying the implementation.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/cpuidle34xx.c |   36 ++--
 1 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c 
b/arch/arm/mach-omap2/cpuidle34xx.c
index 1cfa5a6..86f580b 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -91,20 +91,6 @@ static int omap3_idle_bm_check(void)
return 0;
 }
 
-static int _cpuidle_allow_idle(struct powerdomain *pwrdm,
-   struct clockdomain *clkdm)
-{
-   omap2_clkdm_allow_idle(clkdm);
-   return 0;
-}
-
-static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
-   struct clockdomain *clkdm)
-{
-   omap2_clkdm_deny_idle(clkdm);
-   return 0;
-}
-
 /**
  * omap3_enter_idle - Programs OMAP3 to enter the specified state
  * @dev: cpuidle device
@@ -135,25 +121,15 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
core_state = PWRDM_POWER_RET;
}
 
-   pwrdm_set_next_pwrst(mpu_pd, mpu_state);
-   pwrdm_set_next_pwrst(core_pd, core_state);
+   omap3_pwrdm_set_next_pwrst(mpu_pd, mpu_state);
+   omap3_pwrdm_set_next_pwrst(core_pd, core_state);
 
if (omap_irq_pending() || need_resched())
goto return_sleep_time;
 
-   if (cx-type == OMAP3_STATE_C1) {
-   pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle);
-   pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
-   }
-
/* Execute ARM wfi */
omap_sram_idle();
 
-   if (cx-type == OMAP3_STATE_C1) {
-   pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
-   pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle);
-   }
-
 return_sleep_time:
getnstimeofday(ts_postidle);
ts_idle = timespec_sub(ts_postidle, ts_preidle);
@@ -246,8 +222,8 @@ void omap_init_power_states(void)
cpuidle_params_table[OMAP3_STATE_C2].wake_latency;
omap3_power_states[OMAP3_STATE_C2].threshold =
cpuidle_params_table[OMAP3_STATE_C2].threshold;
-   omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON;
-   omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON;
+   omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_INACTIVE;
+   omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_INACTIVE;
omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID;
 
/* C3 . MPU CSWR + Core inactive */
@@ -261,7 +237,7 @@ void omap_init_power_states(void)
omap3_power_states[OMAP3_STATE_C3].threshold =
cpuidle_params_table[OMAP3_STATE_C3].threshold;
omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET;
-   omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON;
+   omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_INACTIVE;
omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID |
CPUIDLE_FLAG_CHECK_BM;
 
@@ -276,7 +252,7 @@ void omap_init_power_states(void)
omap3_power_states[OMAP3_STATE_C4].threshold =
cpuidle_params_table[OMAP3_STATE_C4].threshold;
omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF;
-   omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON;
+   omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_INACTIVE;
omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID |
CPUIDLE_FLAG_CHECK_BM;
 
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv6 5/9] OMAP3: Clock: Added IDLEST definitions for SGX

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

Added definitions for OMAP3430ES2_ST_SGX_SHIFT and OMAP3430ES2_ST_SGX_MASK
as these were missing.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/cm-regbits-34xx.h |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h 
b/arch/arm/mach-omap2/cm-regbits-34xx.h
index 6923deb..60f9b16 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -379,6 +379,10 @@
 #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT 1
 #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_MASK  (1  1)
 
+/* CM_IDLEST_SGX */
+#define OMAP3430ES2_ST_SGX_SHIFT   1
+#define OMAP3430ES2_ST_SGX_MASK(1  1)
+
 /* CM_ICLKEN_SGX */
 #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT 0
 #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_MASK  (1  0)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv6 4/9] OMAP3: PM: Removed pwrdm state hacking from omap_sram_idle

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

Following hacks will be moved inside cpuidle in subsequent patch:

- CAM domain prevents idle completely
- PER should not go OFF if core remains active

This simplifies the design and allows cpuidle to keep better track of which
power states system will actually enter.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/pm34xx.c |   19 ++-
 1 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index c2d80fc..cdbedcf 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -93,7 +93,6 @@ static int (*_omap_save_secure_sram)(u32 *addr);
 
 static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
 static struct powerdomain *core_pwrdm, *per_pwrdm;
-static struct powerdomain *cam_pwrdm;
 
 static struct prm_setup_vc prm_setup = {
.clksetup = 0xff,
@@ -373,7 +372,6 @@ void omap_sram_idle(void)
int core_next_state = PWRDM_POWER_ON;
int core_prev_state, per_prev_state;
u32 sdrc_pwr = 0;
-   int per_state_modified = 0;
 
if (!_omap_sram_idle)
return;
@@ -411,20 +409,11 @@ void omap_sram_idle(void)
core_next_state = omap3_pwrdm_read_next_pwrst(core_pwrdm);
if (per_next_state  PWRDM_POWER_ON) {
omap2_gpio_prepare_for_idle(per_next_state);
-   if (per_next_state == PWRDM_POWER_OFF) {
-   if (core_next_state == PWRDM_POWER_ON) {
-   per_next_state = PWRDM_POWER_RET;
-   pwrdm_set_next_pwrst(per_pwrdm, per_next_state);
-   per_state_modified = 1;
-   } else
-   omap3_per_save_context();
-   }
+   if (per_next_state == PWRDM_POWER_OFF)
+   omap3_per_save_context();
omap_uart_prepare_idle(2);
}
 
-   if (pwrdm_read_pwrst(cam_pwrdm) == PWRDM_POWER_ON)
-   omap2_clkdm_deny_idle(mpu_pwrdm-pwrdm_clkdms[0]);
-
/*
 * Disable smartreflex before entering WFI.
 * Only needed if we are going to enter retention or off.
@@ -554,8 +543,6 @@ void omap_sram_idle(void)
}
omap2_gpio_resume_after_idle();
omap_uart_resume_idle(2);
-   if (per_state_modified)
-   pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF);
}
 
/* Disable IO-PAD and IO-CHAIN wakeup */
@@ -564,7 +551,6 @@ void omap_sram_idle(void)
omap3_disable_io_chain();
}
 
-
pwrdm_post_transition();
 }
 
@@ -1239,7 +1225,6 @@ static int __init omap3_pm_init(void)
neon_pwrdm = pwrdm_lookup(neon_pwrdm);
per_pwrdm = pwrdm_lookup(per_pwrdm);
core_pwrdm = pwrdm_lookup(core_pwrdm);
-   cam_pwrdm = pwrdm_lookup(cam_pwrdm);
 
neon_clkdm = clkdm_lookup(neon_clkdm);
mpu_clkdm = clkdm_lookup(mpu_clkdm);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv6 6/9] OMAP: Powerdomains: Add support for checking if pwrdm/clkdm can idle

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

pwrdm_can_idle(pwrdm) will check if the specified powerdomain can enter
idle. This is done by checking all clockdomains under the powerdomain
if they can idle also.

omap2_clkdm_can_idle(clkdm) will check if the specified clockdomain can
enter idle. This checks the functional clocks and idle status bits of the
domain according to following rules:
1) functional clock check
  * get FCLK register content
  * ignore all clocks defined in idle_def.fclk_ignore
  * if any active functional clocks remain, domain can't idle
2) idle status check
  * get IDLEST register content
  * inverse it (any non-idle blocks are now as 1)
  * mask against idle_def.idlest_mask
  * if any bits remain high, domain can't idle

These calls can be used e.g. inside cpuidle to decide which power states
core and mpu should enter during idle, as there are certain dependencies
between wakeup capabilities and reset logic.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/clockdomain.c |   32 
 arch/arm/mach-omap2/clockdomains.h|  106 +
 arch/arm/mach-omap2/powerdomain.c |   20 +
 arch/arm/plat-omap/include/plat/clockdomain.h |   17 
 arch/arm/plat-omap/include/plat/powerdomain.h |1 +
 5 files changed, 176 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomain.c 
b/arch/arm/mach-omap2/clockdomain.c
index a38a615..9ebff51 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -867,6 +867,38 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
return 0;
 }
 
+
+/**
+ * omap2_clkdm_can_idle - check if clockdomain has any active clocks or not
+ * @clkdm: struct clockdomain *
+ *
+ * Checks if the clockdomain has any active clock or not, i.e. whether it
+ * can enter idle. Returns -EINVAL if clkdm is NULL; 0 if unable to idle;
+ * 1 if can idle.
+ */
+int omap2_clkdm_can_idle(struct clockdomain *clkdm)
+{
+   int i;
+
+   if (!clkdm)
+   return -EINVAL;
+
+   for (i = 0; i  clkdm-clk_reg_num; i++) {
+   u32 idlest, fclk;
+
+   fclk = cm_read_mod_reg(clkdm-pwrdm.ptr-prcm_offs,
+   CM_FCLKEN + 4 * i);
+   if (fclk  ~clkdm-idle_def[i].fclk_ignore)
+   return 0;
+
+   idlest = cm_read_mod_reg(clkdm-pwrdm.ptr-prcm_offs,
+   CM_IDLEST + 4 * i);
+   if (~idlest  clkdm-idle_def[i].idlest_mask)
+   return 0;
+   }
+   return 1;
+}
+
 /**
  * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm
  * @clkdm: struct clockdomain *
diff --git a/arch/arm/mach-omap2/clockdomains.h 
b/arch/arm/mach-omap2/clockdomains.h
index 8fc19ff..5e29de8 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -663,6 +663,12 @@ static struct clockdomain iva2_clkdm = {
.wkdep_srcs = iva2_wkdeps,
.clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+   .clk_reg_num= 1,
+   .idle_def   = {
+   [0] = {
+   .idlest_mask = OMAP3430_ST_IVA2,
+   },
+   },
 };
 
 static struct clockdomain gfx_3430es1_clkdm = {
@@ -686,6 +692,12 @@ static struct clockdomain sgx_clkdm = {
.sleepdep_srcs  = gfx_sgx_sleepdeps,
.clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
.omap_chip  = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
+   .clk_reg_num= 1,
+   .idle_def   = {
+   [0] = {
+   .idlest_mask = OMAP3430ES2_ST_SGX_SHIFT,
+   },
+   },
 };
 
 /*
@@ -717,6 +729,57 @@ static struct clockdomain core_l3_3xxx_clkdm = {
.dep_bit= OMAP3430_EN_CORE_SHIFT,
.clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+   .clk_reg_num= 3,
+   .idle_def   = {
+   [0] = {
+   /* UARTs are controlled by idle loop so ignore */
+   .fclk_ignore = OMAP3430_EN_UART2 |
+   OMAP3430_EN_UART1,
+   /*
+* Reason for IDLEST ignores:
+* - SDRC and OMAPCTRL controlled by HW
+* - HSOTGUSB_IDLE bit is autoidled by HW
+* - MAILBOX is controlled by HW
+*/
+   .idlest_mask =
+   OMAP3430ES2_ST_MMC3_MASK |
+   OMAP3430_ST_ICR_MASK |
+   OMAP3430_ST_AES2_MASK |
+   OMAP3430_ST_SHA12_MASK |
+   OMAP3430_ST_DES2_MASK |
+   OMAP3430_ST_MMC2_MASK |
+   

[PATCHv6 9/9] OMAP3: PM: Added support for suspending to INACTIVE state

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

With the new support functions this is now possible. Suspending to INACTIVE
is useful for testing purposes.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/pm34xx.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index cdbedcf..41d6cc3 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -633,11 +633,12 @@ int set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
if (pwrdm == NULL || IS_ERR(pwrdm))
return -EINVAL;
 
-   while (!(pwrdm-pwrsts  (1  state))) {
-   if (state == PWRDM_POWER_OFF)
-   return ret;
-   state--;
-   }
+   if (state != PWRDM_POWER_INACTIVE)
+   while (!(pwrdm-pwrsts  (1  state))) {
+   if (state == PWRDM_POWER_OFF)
+   return ret;
+   state--;
+   }
 
cur_state = pwrdm_read_next_pwrst(pwrdm);
if (cur_state == state)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv6 7/9] OMAP3: CPUidle: Added peripheral pwrdm checks into bm check

2010-02-12 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

Following checks are made (and their reasoning):

- If CAM domain is active, prevent idle completely
  * CAM pwrdm does not have HW wakeup capability
- If PER is likely to remain on, prevent PER off
  * Saves on unnecessary context save/restore
- If CORE domain is active, prevent PER off-mode
  * PER off in this case would prevent wakeups from PER completely
- Only allow CORE off, if all peripheral domains are off
  * CORE off will cause a chipwide reset

Also, enabled CHECK_BM flag for C2, as this is needed for the camera case.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
---
 arch/arm/mach-omap2/cpuidle34xx.c |  104 ++---
 1 files changed, 97 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c 
b/arch/arm/mach-omap2/cpuidle34xx.c
index 86f580b..914022f 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -58,7 +58,8 @@ struct omap3_processor_cx {
 
 struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES];
 struct omap3_processor_cx current_cx_state;
-struct powerdomain *mpu_pd, *core_pd;
+static struct powerdomain *mpu_pd, *core_pd, *per_pd;
+static struct powerdomain *sgx_pd, *usb_pd, *cam_pd, *dss_pd;
 
 /*
  * The latencies/thresholds for various C states have
@@ -153,14 +154,96 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
   struct cpuidle_state *state)
 {
struct cpuidle_state *new_state = state;
-
-   if ((state-flags  CPUIDLE_FLAG_CHECK_BM)  omap3_idle_bm_check()) {
-   BUG_ON(!dev-safe_state);
-   new_state = dev-safe_state;
+   u32 per_state = 0, saved_per_state = 0, cam_state, usb_state;
+   u32 iva2_state, sgx_state, dss_state, new_core_state;
+   struct omap3_processor_cx *cx;
+   int ret;
+
+   if (state-flags  CPUIDLE_FLAG_CHECK_BM) {
+   if (omap3_idle_bm_check()) {
+   BUG_ON(!dev-safe_state);
+   new_state = dev-safe_state;
+   goto select_state;
+   }
+   cx = cpuidle_get_statedata(state);
+   new_core_state = cx-core_state;
+
+   /* Check if CORE is active, if yes, fallback to inactive */
+   if (!pwrdm_can_idle(core_pd))
+   new_core_state = PWRDM_POWER_INACTIVE;
+
+   /*
+* Prevent idle completely if CAM is active.
+* CAM does not have wakeup capability in OMAP3.
+*/
+   cam_state = pwrdm_read_pwrst(cam_pd);
+   if (cam_state == PWRDM_POWER_ON) {
+   new_state = dev-safe_state;
+   goto select_state;
+   }
+
+   /*
+* Check if PER can idle or not. If we are not likely
+* to idle, deny PER off. This prevents unnecessary
+* context save/restore.
+*/
+   saved_per_state = omap3_pwrdm_read_next_pwrst(per_pd);
+   if (pwrdm_can_idle(per_pd)) {
+   per_state = saved_per_state;
+   /*
+* Prevent PER off if CORE is active as this
+* would disable PER wakeups completely
+*/
+   if (per_state == PWRDM_POWER_OFF 
+   new_core_state  PWRDM_POWER_RET)
+   per_state = PWRDM_POWER_RET;
+
+   } else if (saved_per_state == PWRDM_POWER_OFF)
+   per_state = PWRDM_POWER_RET;
+   else
+   per_state = saved_per_state;
+
+   /*
+* If we are attempting CORE off, check if any other
+* powerdomains are at retention or higher. CORE off causes
+* chipwide reset which would reset these domains also.
+*/
+   if (new_core_state == PWRDM_POWER_OFF) {
+   dss_state = pwrdm_read_pwrst(dss_pd);
+   iva2_state = pwrdm_read_pwrst(iva2_pd);
+   sgx_state = pwrdm_read_pwrst(sgx_pd);
+   usb_state = pwrdm_read_pwrst(usb_pd);
+
+   if (cam_state  PWRDM_POWER_OFF ||
+   dss_state  PWRDM_POWER_OFF ||
+   iva2_state  PWRDM_POWER_OFF ||
+   per_state  PWRDM_POWER_OFF ||
+   sgx_state  PWRDM_POWER_OFF ||
+   usb_state  PWRDM_POWER_OFF)
+   new_core_state = PWRDM_POWER_RET;
+   }
+
+   /* Fallback to new target core state */
+   while (cx-core_state  new_core_state) {
+   state--;
+   cx = cpuidle_get_statedata(state);
+   }
+   

[Resend: Patch] DSPBRIDGE: Remove conditional check from the InputMsg function

2010-02-12 Thread Hebbar, Shivananda
From: Shivananda Hebbar x0heb...@ti.com

This patch removes conditional check for uMaxMsgs for the below reasons.
1)1st conditional check.
MPU Bridge stops processing messages from DSP, if uMaxMsgs (currently 8) are 
sent in one shot. The check (=) will make it to return from function without 
processing any messages. So DSP will be waiting forever to get the ack from MPU 
saying that MPU has read the messages. If this happens, the communication from 
DSP to MPU is broken forever.
2)2nd conditional check
- This patch also removes unnecessary check because DSP never sends messages 
more than uMaxMsgs.

Discovered-by: Bhavin Shah bs...@ti.com
Signed-off-by: Shivananda Hebbar x0heb...@ti.com
---
 drivers/dsp/bridge/wmd/io_sm.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c 
index 39b37a6..b2092a2 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -1328,7 +1328,7 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct 
MSG_MGR *hMsgMgr)
fInputEmpty = IO_GetValue(pIOMgr-hWmdContext, struct MSG, pCtrl,
 bufEmpty);
uMsgs = IO_GetValue(pIOMgr-hWmdContext, struct MSG, pCtrl, size);
-   if (fInputEmpty || uMsgs = hMsgMgr-uMaxMsgs)
+   if (fInputEmpty)
goto func_end;
 
pMsgInput = pIOMgr-pMsgInput;
@@ -1356,9 +1356,6 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct 
MSG_MGR *hMsgMgr)
 * input locations have been set up. If all nodes were
 * cleaned up, hMsgMgr-uMaxMsgs should be 0.
 */
-   if (hMsgQueue  uMsgs  hMsgMgr-uMaxMsgs)
-   goto func_end;
-
while (hMsgQueue != NULL) {
if (msg.dwId == hMsgQueue-dwId) {
/* Found it */
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: compilation error

2010-02-12 Thread Koen Kooi

Op 12 feb 2010, om 13:20 heeft Gary Thomas het volgende geschreven:

 On 02/12/2010 03:13 AM, Niamathullah sharief wrote:
 Hello,
 can anyone tell me while compilaing dbus-1.2.20 i am getting the
 folllowing error
 checking for XML_ParserCreate_MM in -lexpat... no
 configure: error: Could not find expat.h, check config.log for failed 
 attempts
 what is wrong?what i should install?i installed libexpat also. still i
 get the same error. please help me
 
 As previously mentioned, this list is for discussion of the
 Linux kernel on OMAP, not user/support questions.  You should
 take them to a more appropriate list.
 
 What higher level of software are you trying to run on your
 OMAP board (distribution, if you want to call it that)?
 Some examples might be:
 * OpenEmbedded, Poky, etc

I must point out that OpenEmbedded is not a distro, it's a tool to make distros 
(e.g. like 'make', 'deb-build', 'portage', etc).

A distro that works well on OMAP3, built by OE, is angstrom.

regards,

Koen--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Moving board patches from DSS2 to linux-omap

2010-02-12 Thread Tony Lindgren
* Tomi Valkeinen tomi.valkei...@nokia.com [100212 02:38]:
 On Thu, 2010-02-11 at 19:52 +0100, ext Tony Lindgren wrote:
  * Tomi Valkeinen tomi.valkei...@nokia.com [100211 03:59]:
   On Thu, 2010-02-11 at 12:50 +0100, ext Mike Rapoport wrote:
Tomi Valkeinen wrote:
 Hi,
 
 As discussed previously, board file changes in DSS2 tree cause 
 conflicts
 with linux-omap easily. There are currently three board file patches 
 in
 DSS2's for-next branch:
 
 722a97e4594b2041bbf18d95a913ba6dfaca87f2 omap3: cm-t35: add DSS2 
 display support
 7a56267e775e469c64521179ccc958c8bb661dbf OMAP: AM3517: Enable DSS2 
 for AM3517EVM board
 40e4e67c6dabcb9897b6823cce2297d6c3e78bbd OMAP: Enable DSS2 for 
 OMAP3EVM board
 
 The problem here is of course that DSS2 tree may contain unmerged 
 panel
 drivers, and those board file changes try to use these new panel
 drivers.
  
  OK, Tomi, can you please set up a banch against mainline -rc7 with
  whatever board-*.c dss2 patches you want me to pull? I'll pull them
  into omap-for-linus, and rebase omap for-next on those.
 
 Here:
 
 git://gitorious.org/linux-omap-dss2/linux.git for-tony
 
 I removed the defconfig changes from the patches, and compile tested.
 I'll add the defconfig changes as separate patches in my tree, and I'll
 push them to Linus only after the board changes from Tony's tree have
 gone through.

Great, thanks, I've pulled it into omap-for-linus branch. Note that we
need to wait for Russell to merge the arm changes first and then I
need merge with that before I can send a pull request because of the
addruart changes that affect most of our multi-omap patches.

So you may want to send the defconfig changes as a separate fix later on
if that allows you to keep your dss2 mergeable without having to worry
about the merging of arm and omap trees.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PATCH[V2 1/3]: Update Platform files for SPI

2010-02-12 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [100209 15:03]:
 * Grant Likely grant.lik...@secretlab.ca [100209 14:38]:
  On Tue, Feb 9, 2010 at 3:25 PM, Tony Lindgren t...@atomide.com wrote:
   * Hemanth V heman...@ti.com [100203 02:19]:
   From ee48142ddc43129a21676dbb56a83e3e7d8063de Mon Sep 17 00:00:00 2001
   From: Hemanth V heman...@ti.com
   Date: Fri, 27 Nov 2009 14:22:30 +0530
   Subject: [PATCH] Update platform files
  
   This patch updates platform files for
   fifo, slave support
  
   Signed-off-by: Hemanth V heman...@ti.com
  
   This should get merged via the spi-devel list with the other patches.
  
   Acked-by: Tony Lindgren t...@atomide.com
  
  Personally, I prefer not to carry arch/* changes in my next-spi
  branch, since it means that my pull requests are less obvious for
  Linus and there is greater chance of conflict.
  
  But if you still really want me to merge it through my tree, (or if
  getting the patches out of order will break things) then I'll pick it
  up.  Just let me know.
 
 OK, if you ack it, I'll add the header into omap for-next. That
 might break git bisect for some configurations depending in which
 order the patches get pulled by Linus..
 
 I guess eventually this header should not live under plat.

Hemanth, the patch is missing line breaks so it won't apply:

http://patchwork.kernel.org/patch/76675/

Please resend, I'm not editing patches manually any longer thanks.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2 RFC]OMAP3430: hwmod FW for GPIO

2010-02-12 Thread Paul Walmsley
On Fri, 12 Feb 2010, Varadarajan, Charulatha wrote:

 This patch series makes the OMAP3430 GPIO module
 use hwmod framework.
 
 This patch series applies on top of pm branch
 and it requires my previous patch set which converts
 GPIO into an early init device. 
 
 They are boot tested on SDP 3430 and compile tested
 for OMAP 2420 and 2430.
 
 Charulatha V (2):
   OMAP3: hwmod: add GPIO hwmods for OMAP3430
   OMAP3: hwmod: Adapt HWMOD FW for GPIO OMAP3430
 
  arch/arm/mach-omap2/gpio.c |  901 
 
  arch/arm/mach-omap2/omap_hwmod_34xx.h  |  410 +++
  arch/arm/plat-omap/include/plat/gpio.h |   25 +-

NAK.  Your series just broke GPIO for all non-OMAP3430 chips.


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/6] Mailbox: Fix some issues in mailbox module

2010-02-12 Thread Guzman Lugo, Fernando
From a7b162f3af04bbfa39c439c47b8499962410a9c9 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Fri, 12 Feb 2010 19:35:05 -0600
Subject: [PATCH 0/6] Mailbox: Fix some issues in mailbox module

This set of patches fix some issue I found when I was working
with mailbox module.

Fernando Guzman Lugo (6):
  Mailbox: free mailbox interrupt before freeing blk queue
  Mailbox: flush pending deferred works before freeing blk queue
  Mailbox: change mailbox version print to pr_debug
  Mailbox: Check valid registered callback before calling
  Mailbox: sleeping function called from invalid context fix
  Mailbox: disable mailbox interrupt when request queue

 arch/arm/mach-omap2/mailbox.c |2 +-
 arch/arm/plat-omap/mailbox.c  |   48 
 2 files changed, 30 insertions(+), 20 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] Mailbox: free mailbox interrupt before freeing blk queue

2010-02-12 Thread Guzman Lugo, Fernando
From 4993c3740c532553035a175024a5b2067c11afc4 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Fri, 12 Feb 2010 19:02:32 -0600
Subject: [PATCH] Mailbox: free mailbox interrupt before freeing blk queue

Free interrupt before freeing blk_queue to avoid
any attempt of access to blk_queue after it was freed.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/mailbox.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 8e90633..e6cc4b0 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -296,11 +296,10 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
 
 static void omap_mbox_fini(struct omap_mbox *mbox)
 {
+   free_irq(mbox-irq, mbox);
mbox_queue_free(mbox-txq);
mbox_queue_free(mbox-rxq);
 
-   free_irq(mbox-irq, mbox);
-
if (unlikely(mbox-ops-shutdown)) {
write_lock(mboxes_lock);
if (mbox_configured  0)
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] Mailbox: flush pending deferred works before freeing blk queue

2010-02-12 Thread Guzman Lugo, Fernando
From 0c844957e17257f19f7ef3f51ac860275ce89440 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Fri, 12 Feb 2010 19:07:14 -0600
Subject: [PATCH] Mailbox: flush pending deferred works before freeing blk queue

flush pending deferred works before freeing blk_queue to prevent
any attempt of access to blk_queue after it was freed

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/mailbox.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index e6cc4b0..3e2f961 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -297,6 +297,8 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
 static void omap_mbox_fini(struct omap_mbox *mbox)
 {
free_irq(mbox-irq, mbox);
+   tasklet_kill(mbox-txq-tasklet);
+   flush_work(mbox-rxq-work);
mbox_queue_free(mbox-txq);
mbox_queue_free(mbox-rxq);
 
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6] Mailbox: change mailbox version print to pr_debug

2010-02-12 Thread Guzman Lugo, Fernando
From 60e21e76773de379deb41ff166f9679b7078276f Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Wed, 10 Feb 2010 17:08:20 -0600
Subject: [PATCH] Mailbox: change mailbox version print to pr_debug

it is not useful printing the version every time mailbox is used
instead change it to pr_debug in case someone needs to see the
version can enable the print.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/mach-omap2/mailbox.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 2c9fd1c..1078767 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -113,7 +113,7 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
}
 
l = mbox_read_reg(MAILBOX_REVISION);
-   pr_info(omap mailbox rev %d.%d\n, (l  0xf0)  4, (l  0x0f));
+   pr_debug(omap mailbox rev %d.%d\n, (l  0xf0)  4, (l  0x0f));
 
l = SMARTIDLE | AUTOIDLE;
mbox_write_reg(l, MAILBOX_SYSCONFIG);
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/6] Mailbox: Check valid registered callback before calling

2010-02-12 Thread Guzman Lugo, Fernando
From 6b31bcca42598217bd46dd5719c50d37fa9ffc3a Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Wed, 27 Jan 2010 20:04:02 -0600
Subject: [PATCH] Mailbox: Check valid registered callback before calling

This patch checks if the mailbox user has assinged a valid
callback fuction before calling it.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/mailbox.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 3e2f961..8136ee3 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -144,7 +144,8 @@ static void mbox_rx_work(struct work_struct *work)
 
msg = (mbox_msg_t)rq-special;
blk_end_request_all(rq, 0);
-   mbox-rxq-callback((void *)msg);
+   if (mbox-rxq-callback)
+   mbox-rxq-callback((void *)msg);
}
 }
 
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] Mailbox: sleeping function called from invalid context fix

2010-02-12 Thread Guzman Lugo, Fernando
From e06b2716824f225747c4dc83ed2623d0160ae132 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Fri, 29 Jan 2010 17:12:24 -0600
Subject: [PATCH] Mailbox: sleeping function called from invalid context fix

This patch fixes this bug:
BUG: sleeping function called from invalid context
Inside omap2_mbox_startup is called clk_get_sys that can sleep,
therefore omap2_mbox_startup can sleep but it is call in an atomic
context . So the spinlock is change for a semaphore.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/mailbox.c |   30 +++---
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 8136ee3..d8bfa45 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -29,7 +29,7 @@
 #include plat/mailbox.h
 
 static struct omap_mbox *mboxes;
-static DEFINE_RWLOCK(mboxes_lock);
+static DECLARE_RWSEM(mboxes_sem);
 
 static int mbox_configured;
 
@@ -248,16 +248,16 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
struct omap_mbox_queue *mq;
 
if (likely(mbox-ops-startup)) {
-   write_lock(mboxes_lock);
+   down_write(mboxes_sem);
if (!mbox_configured)
ret = mbox-ops-startup(mbox);
 
if (unlikely(ret)) {
-   write_unlock(mboxes_lock);
+   up_write(mboxes_sem);
return ret;
}
mbox_configured++;
-   write_unlock(mboxes_lock);
+   up_write(mboxes_sem);
}
 
ret = request_irq(mbox-irq, mbox_interrupt, IRQF_SHARED,
@@ -304,12 +304,12 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
mbox_queue_free(mbox-rxq);
 
if (unlikely(mbox-ops-shutdown)) {
-   write_lock(mboxes_lock);
+   down_write(mboxes_sem);
if (mbox_configured  0)
mbox_configured--;
if (!mbox_configured)
mbox-ops-shutdown(mbox);
-   write_unlock(mboxes_lock);
+   up_write(mboxes_sem);
}
 }
 
@@ -330,14 +330,14 @@ struct omap_mbox *omap_mbox_get(const char *name)
struct omap_mbox *mbox;
int ret;
 
-   read_lock(mboxes_lock);
+   down_read(mboxes_sem);
mbox = *(find_mboxes(name));
if (mbox == NULL) {
-   read_unlock(mboxes_lock);
+   up_read(mboxes_sem);
return ERR_PTR(-ENOENT);
}
 
-   read_unlock(mboxes_lock);
+   up_read(mboxes_sem);
 
ret = omap_mbox_startup(mbox);
if (ret)
@@ -363,15 +363,15 @@ int omap_mbox_register(struct device *parent, struct 
omap_mbox *mbox)
if (mbox-next)
return -EBUSY;
 
-   write_lock(mboxes_lock);
+   down_write(mboxes_sem);
tmp = find_mboxes(mbox-name);
if (*tmp) {
ret = -EBUSY;
-   write_unlock(mboxes_lock);
+   up_write(mboxes_sem);
goto err_find;
}
*tmp = mbox;
-   write_unlock(mboxes_lock);
+   up_write(mboxes_sem);
 
return 0;
 
@@ -384,18 +384,18 @@ int omap_mbox_unregister(struct omap_mbox *mbox)
 {
struct omap_mbox **tmp;
 
-   write_lock(mboxes_lock);
+   down_write(mboxes_sem);
tmp = mboxes;
while (*tmp) {
if (mbox == *tmp) {
*tmp = mbox-next;
mbox-next = NULL;
-   write_unlock(mboxes_lock);
+   up_write(mboxes_sem);
return 0;
}
tmp = (*tmp)-next;
}
-   write_unlock(mboxes_lock);
+   up_write(mboxes_sem);
 
return -EINVAL;
 }
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] DSPBRIDGE: Replace custom mailbox implementation with kernel mailbox module

2010-02-12 Thread Guzman Lugo, Fernando
From d287e11cdb126f2c9b4be8d6d6f958ffdf7ff716 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Fri, 12 Feb 2010 19:55:55 -0600
Subject: [PATCH] DSPBRIDGE: Replace custom mailbox implementation with
kernel mailbox module

This set of patches removes dspbridge mailbox implementation and migrates to
use kernel mailbox module.


NOTE: Instability was found in stress tests, which were fixed with this set of 
patches:

http://marc.info/?l=linux-omapm=126602506112846w=2
It is recommended to apply them first.


Fernando Guzman Lugo (3):
  DSPBRIDGE: Change dspbridge for open source mailbox implementation
  DSPBRIDGE: Remove hw_mbox.c and hw_mbox.h not needed anymore
  DSPBRIDGE: Remove chnl_sm.h and tiomap_sm.c

 arch/arm/plat-omap/include/dspbridge/cfgdefs.h |1 -
 arch/arm/plat-omap/include/dspbridge/chnl_sm.h |  154 ---
 arch/arm/plat-omap/include/dspbridge/clk.h |3 +-
 arch/arm/plat-omap/include/dspbridge/drv.h |3 -
 arch/arm/plat-omap/include/dspbridge/host_os.h |2 +-
 arch/arm/plat-omap/include/dspbridge/io_sm.h   |7 +-
 drivers/dsp/bridge/Makefile|4 +-
 drivers/dsp/bridge/hw/hw_mbox.c|  248 --
 drivers/dsp/bridge/hw/hw_mbox.h|  326 
 drivers/dsp/bridge/rmgr/drv.c  |9 -
 drivers/dsp/bridge/services/clk.c  |1 -
 drivers/dsp/bridge/wmd/_tiomap.h   |   22 ++-
 drivers/dsp/bridge/wmd/chnl_sm.c   |   26 ++-
 drivers/dsp/bridge/wmd/io_sm.c |  209 ++--
 drivers/dsp/bridge/wmd/tiomap3430.c|   52 +++--
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c|   26 +--
 drivers/dsp/bridge/wmd/tiomap_io.c |   71 +
 drivers/dsp/bridge/wmd/tiomap_sm.c |  192 --
 drivers/dsp/bridge/wmd/ue_deh.c|4 +-
 19 files changed, 237 insertions(+), 1123 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/chnl_sm.h
 delete mode 100644 drivers/dsp/bridge/hw/hw_mbox.c
 delete mode 100644 drivers/dsp/bridge/hw/hw_mbox.h
 delete mode 100644 drivers/dsp/bridge/wmd/tiomap_sm.c
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] DSPBRIDGE: Change dspbridge for open source mailbox implementation

2010-02-12 Thread Guzman Lugo, Fernando
From 627fb103cb73202128b8c5d2a51c879c52ebf076 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Fri, 12 Feb 2010 02:26:58 -0600
Subject: [PATCH] DSPBRIDGE: Change dspbridge for open source mailbox 
implementation

This patch removes our dspbridge for opensource mailbox
implementation.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cfgdefs.h |1 -
 arch/arm/plat-omap/include/dspbridge/clk.h |3 +-
 arch/arm/plat-omap/include/dspbridge/drv.h |3 -
 arch/arm/plat-omap/include/dspbridge/host_os.h |2 +-
 arch/arm/plat-omap/include/dspbridge/io_sm.h   |7 +-
 drivers/dsp/bridge/Makefile|2 +-
 drivers/dsp/bridge/rmgr/drv.c  |9 -
 drivers/dsp/bridge/services/clk.c  |1 -
 drivers/dsp/bridge/wmd/_tiomap.h   |4 +-
 drivers/dsp/bridge/wmd/chnl_sm.c   |   26 +++-
 drivers/dsp/bridge/wmd/io_sm.c |  196 ---
 drivers/dsp/bridge/wmd/tiomap3430.c|   49 ---
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c|   13 +-
 drivers/dsp/bridge/wmd/tiomap_sm.c |  109 +
 drivers/dsp/bridge/wmd/ue_deh.c|4 +-
 15 files changed, 143 insertions(+), 286 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h 
b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
index 55c6634..9e204f4 100644
--- a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
@@ -70,7 +70,6 @@
u32 dwPerPmBase;
u32 dwCorePmBase;
void __iomem *dwWdTimerDspBase;
-   void __iomem *dwMboxBase;
void __iomem *dwDmmuBase;
void __iomem *dwSysCtrlBase;
} ;
diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index 9a0fb0f..08a647b 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -22,8 +22,7 @@
/* Generic TIMER object: */
struct TIMER_OBJECT;
enum SERVICES_ClkId {
-   SERVICESCLK_iva2_ck = 0,
-   SERVICESCLK_mailbox_ick,
+   SERVICESCLK_iva2_ck,
SERVICESCLK_gpt5_fck,
SERVICESCLK_gpt5_ick,
SERVICESCLK_gpt6_fck,
diff --git a/arch/arm/plat-omap/include/dspbridge/drv.h 
b/arch/arm/plat-omap/include/dspbridge/drv.h
index b6a5fd2..6709935 100644
--- a/arch/arm/plat-omap/include/dspbridge/drv.h
+++ b/arch/arm/plat-omap/include/dspbridge/drv.h
@@ -69,9 +69,6 @@
 #define OMAP_SYSC_BASE 0x48002000
 #define OMAP_SYSC_SIZE 0x1000

-#define OMAP_MBOX_BASE 0x48094000
-#define OMAP_MBOX_SIZE 0x1000
-
 #define OMAP_DMMU_BASE 0x5D00
 #define OMAP_DMMU_SIZE 0x1000

diff --git a/arch/arm/plat-omap/include/dspbridge/host_os.h 
b/arch/arm/plat-omap/include/dspbridge/host_os.h
index 066c4d7..b8f4d97 100644
--- a/arch/arm/plat-omap/include/dspbridge/host_os.h
+++ b/arch/arm/plat-omap/include/dspbridge/host_os.h
@@ -46,12 +46,12 @@
 #include dspbridge/dbtype.h
 #include mach/clock.h
 #include linux/clk.h
+#include mach/mailbox.h
 #include linux/pagemap.h
 #include asm/cacheflush.h
 #include linux/dma-mapping.h

 /* TODO -- Remove, once BP defines them */
-#define INT_MAIL_MPU_IRQ26
 #define INT_DSP_MMU_IRQ28

 struct dspbridge_platform_data {
diff --git a/arch/arm/plat-omap/include/dspbridge/io_sm.h 
b/arch/arm/plat-omap/include/dspbridge/io_sm.h
index 8eae7af..cc365ec 100644
--- a/arch/arm/plat-omap/include/dspbridge/io_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/io_sm.h
@@ -43,9 +43,6 @@
 #define IO_SetLong(pContext, type, base, field, value)  (base-field = value)
 #define IO_GetLong(pContext, type, base, field) (base-field)

-#define IO_DisableInterrupt(h)  CHNLSM_DisableInterrupt(h)
-#define IO_EnableInterrupt(h)   CHNLSM_EnableInterrupt(h)
-#define IO_CALLISR(h, pFlag, pwMBRegVal)   CHNLSM_ISR(h, pFlag, pwMBRegVal)

 /*
  *   IO_CancelChnl 
@@ -80,7 +77,7 @@
extern void IO_DPC(IN OUT unsigned long pRefData);

 /*
- *   IO_ISR 
+ *   io_mbox_msg 
  *  Purpose:
  *  Main interrupt handler for the shared memory WMD channel manager.
  *  Calls the WMD's CHNLSM_ISR to determine if this interrupt is ours, then
@@ -97,7 +94,7 @@
  *  Interrupts are disabled and EOI for this interrupt has been sent.
  *  Ensures:
  */
-   irqreturn_t IO_ISR(int irq, IN void *pRefData);
+   void io_mbox_msg(u32 msg);
 /*
  *   IO_RequestChnl 
  *  Purpose:
diff --git a/drivers/dsp/bridge/Makefile b/drivers/dsp/bridge/Makefile
index 8aeb6a5..b44a8f3 100644
--- a/drivers/dsp/bridge/Makefile
+++ b/drivers/dsp/bridge/Makefile
@@ -15,7 +15,7 @@ librmgr = rmgr/dbdcd.o rmgr/disp.o rmgr/drv.o rmgr/mgr.o 
rmgr/node.o \
rmgr/nldr.o 

[PATCH 2/3] DSPBRIDGE: Remove hw_mbox.c and hw_mbox.h not needed anymore

2010-02-12 Thread Guzman Lugo, Fernando
From 5451312f78b6631c9cfacfde10928f481e60b65c Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Wed, 27 Jan 2010 20:12:38 -0600
Subject: [PATCH] DSPBRIDGE: Remove hw_mbox.c and hw_mbox.h not needed anymore

Because of mailbox migration now the files hw_mbox.c
and hw_mbox.h are not needed anymore.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/hw/hw_mbox.c |  248 -
 drivers/dsp/bridge/hw/hw_mbox.h |  326 ---
 2 files changed, 0 insertions(+), 574 deletions(-)
 delete mode 100644 drivers/dsp/bridge/hw/hw_mbox.c
 delete mode 100644 drivers/dsp/bridge/hw/hw_mbox.h

diff --git a/drivers/dsp/bridge/hw/hw_mbox.c b/drivers/dsp/bridge/hw/hw_mbox.c
deleted file mode 100644
index 5268b58..000
--- a/drivers/dsp/bridge/hw/hw_mbox.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * hw_mbox.c
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Mailbox messaging  configuration API definitions
- *
- * Copyright (C) 2007 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#include GlobalTypes.h
-#include MLBRegAcM.h
-#include hw_defs.h
-#include hw_mbox.h
-
-/* width in bits of MBOX Id */
-#define HW_MBOX_ID_WIDTH  2
-
-/* SYSCONFIG: register bit definition */
-#define AUTOIDLE   (1  0)
-#define SMARTIDLE  (2  3)
-
-struct MAILBOX_CONTEXT mboxsetting = {
-   .sysconfig = SMARTIDLE | AUTOIDLE,
-};
-
-HW_STATUS HW_MBOX_initSettings(void __iomem *baseAddress)
-{
-   MLBMAILBOX_SYSCONFIGWriteRegister32(baseAddress, SMARTIDLE | AUTOIDLE);
-   return RET_OK;
-}
-
-/* Saves the mailbox context */
-HW_STATUS HW_MBOX_saveSettings(void __iomem *baseAddress)
-{
-   HW_STATUS status = RET_OK;
-
-   mboxsetting.sysconfig = MLBMAILBOX_SYSCONFIGReadRegister32(baseAddress);
-   /* Get current enable status */
-   mboxsetting.irqEnable0 = MLBMAILBOX_IRQENABLE___0_3ReadRegister32
-(baseAddress, HW_MBOX_U0_ARM);
-   mboxsetting.irqEnable1 = MLBMAILBOX_IRQENABLE___0_3ReadRegister32
-(baseAddress, HW_MBOX_U1_DSP1);
-   return status;
-}
-
-/* Restores the mailbox context */
-HW_STATUS HW_MBOX_restoreSettings(void __iomem *baseAddress)
-{
-HW_STATUS status = RET_OK;
-   /* Restor IRQ enable status */
-   MLBMAILBOX_IRQENABLE___0_3WriteRegister32(baseAddress, HW_MBOX_U0_ARM,
-mboxsetting.irqEnable0);
-   MLBMAILBOX_IRQENABLE___0_3WriteRegister32(baseAddress, HW_MBOX_U1_DSP1,
-mboxsetting.irqEnable1);
-   /* Restore Sysconfig register */
-   MLBMAILBOX_SYSCONFIGWriteRegister32(baseAddress, mboxsetting.sysconfig);
-   return status;
-}
-
-/* Reads a u32 from the sub module message box Specified. if there are no
- * messages in the mailbox then and error is returned. */
-HW_STATUS HW_MBOX_MsgRead(const void __iomem *baseAddress,
-   const HW_MBOX_Id_t mailBoxId, u32 *const pReadValue)
-{
-   HW_STATUS status = RET_OK;
-
-   /* Check input parameters */
-   CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
-   CHECK_INPUT_PARAM(pReadValue, NULL, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
-   CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
-  RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
-   /* Read 32-bit message in mail box */
-   *pReadValue = MLBMAILBOX_MESSAGE___0_15ReadRegister32(baseAddress,
-(u32)mailBoxId);
-
-   return status;
-}
-
-/* Writes a u32 from the sub module message box Specified. */
-HW_STATUS HW_MBOX_MsgWrite(const void __iomem *baseAddress,
-   const HW_MBOX_Id_t mailBoxId, const u32 writeValue)
-{
-   HW_STATUS status = RET_OK;
-
-   /* Check input parameters */
-   CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
-   RES_INVALID_INPUT_PARAM);
-   CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
-   RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
-   /* Write 32-bit value to mailbox */
-   MLBMAILBOX_MESSAGE___0_15WriteRegister32(baseAddress, (u32)mailBoxId,
-   (u32)writeValue);
-
-   return status;
-}
-
-/* Gets number of messages in a specified mailbox. */
-HW_STATUS HW_MBOX_NumMsgGet(const 

[PATCH 3/3] DSPBRIDGE: Remove chnl_sm.h and tiomap_sm.c

2010-02-12 Thread Guzman Lugo, Fernando
From d287e11cdb126f2c9b4be8d6d6f958ffdf7ff716 Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo x0095...@ti.com
Date: Fri, 22 Jan 2010 21:46:42 -0600
Subject: [PATCH] DSPBRIDGE: Remove chnl_sm.h and tiomap_sm.c

Because of mailbox migration all the functions in tiomap_sm.c except
one and their prototypes in chnl_sm.h are not needed anymore,
so that function was changed to tiomap_io.c and changed the name
to remove camelcasing

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/chnl_sm.h |  154 
 drivers/dsp/bridge/Makefile|2 +-
 drivers/dsp/bridge/wmd/_tiomap.h   |   18 +++
 drivers/dsp/bridge/wmd/io_sm.c |   13 +-
 drivers/dsp/bridge/wmd/tiomap3430.c|3 +-
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c|   13 +-
 drivers/dsp/bridge/wmd/tiomap_io.c |   71 +++
 drivers/dsp/bridge/wmd/tiomap_sm.c |  101 
 8 files changed, 103 insertions(+), 272 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/chnl_sm.h
 delete mode 100644 drivers/dsp/bridge/wmd/tiomap_sm.c

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h 
b/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
deleted file mode 100644
index e1e3f06..000
--- a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * chnl_sm.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Prototypes for channel lower edge functions for a Bridge mini driver
- * implementing data transfer via shared memory.
- *
- * Notes:
- *   These lower edge functions must be implemented by the WMD writer.
- *   Currently, CHNLSM_Read() and CHNLSM_Write() are not called, but must
- *   be defined to link.
- *
- * Copyright (C) 2005-2006 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#ifndef CHNLSM_
-#define CHNLSM_
-
-#include dspbridge/wmd.h
-
-/*
- *   CHNLSM_DisableInterrupt 
- *  Purpose:
- *  Disable interrupts from the DSP board to the PC.
- *  Parameters:
- *  hDevContext:Handle to mini-driver defined device info.
- *  Returns:
- *  Requires:
- *  Ensures:
- */
-   extern DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT*
-   hDevContext);
-
-/*
- *   CHNLSM_EnableInterrupt 
- *  Purpose:
- *  Enable interrupts from the DSP board to the PC.
- *  Parameters:
- *  hDevContext:Handle to mini-driver defined device info.
- *  Returns:
- *  Requires:
- *  Ensures:
- */
-   extern DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT*
-  hDevContext);
-
-/*
- *   CHNLSM_InterruptDSP2 
- *  Purpose:
- *  Set interrupt value  send an interrupt to the DSP processor(s).
- *  This is typicaly used when mailbox interrupt mechanisms allow data
- *  to be associated with interrupt such as for OMAP's CMD/DATA regs.
- *  Parameters:
- *  hDevContext:Handle to mini-driver defined device info.
- *  wMbVal: Value associated with interrupt(e.g. mailbox value).
- *  Returns:
- *  DSP_SOK:Interrupt sent;
- *  else:   Unable to send interrupt.
- *  Requires:
- *  Ensures:
- */
-   extern DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT*
-hDevContext, u16 wMbVal);
-
-/*
- *   CHNLSM_ISR 
- *  Purpose:
- *  Mini-driver's ISR, called by WCD when the board interrupts the host.
- *  Parameters:
- *  hDevContext:Handle to the mini-driver defined device info.
- *  pfSchedDPC: Set to TRUE to schedule a deferred procedure call
- *  to advance the channel protocol.  The channel class
- *  library will call the WMD's CHNLSM_DPC routine during
- *  its own DPC, before dispatching I/O.
- *  The channel class library should ignore *pfSchedDPC 
when
- *  CHNLSM_ISR returns FALSE.
- *  pwMBRegVal: Value of mailbox register.
- *  Returns:
- *  TRUE if this interrupt is was generated by the DSP board.
- *  FALSE otherwise.
- *  Requires:
- *  Interrupts to the host processor are disabled on entry.
- *  Must only call functions which are in page locked memory.
- *  Must only call asynchronous OS services.
- *  The EOI for this interrupt has already been sent to the PIC.
- *  Ensures:
- *  If the