Re: Boot fail on OMAP3430SDP

2010-06-30 Thread Tony Lindgren
* Gadiyar, Anand gadi...@ti.com [100629 19:07]:
 Aguirre, Sergio wrote:
  Sripathy, Vishwanath wrote:
   Here is the log from Early printk.
   
  
  snip
  
   Could not get gpios_ick
   Could not get gpios_fck
  
  Probably Tony will be the best to answer this, but... This 
  code shouldn't get executed I think (the one producing above prints)..
  
  Above clocks are declared for omap2 only (in 
  arch/arm/mach-omap2/clock24[20,30]_data.c), and even this 
  clk_get calls are inside of a supposedly omap2 only execution in 
  arch/arm/plat-omap/gpio.c:
  
  static int __init _omap_gpio_init(void)
  {
  ...
  ...
  #if defined(CONFIG_ARCH_OMAP2)
  if (cpu_class_is_omap2()) {
 
 
 Isn't cpu_class_is_omap2() valid for OMAP3 as well?

Yeah. The above should be just if (cpu_is_omap24xx()) instead.
But that's just a warning and should not matter for the boot
issue.

To me it looks like the early_printk works, but the 8250 serial
console never gets initialized?

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 6/6] omap2/3/4: Add Kconfig option to compile in typical omap features

2010-06-30 Thread Tony Lindgren
* Shilimkar, Santosh santosh.shilim...@ti.com [100629 17:40]:
  
  With your series OMAP4 build breaks because of PM and SMP dependencies.
  To ensure that build doesn't break on OMAP4, I needed below change. With
  This change I tried your series and it boots OK on OMAP4430 SDP

Hmm the build does not break for me?
 
 Also tested the multi-omap build on OMAP3430 SDP and OMAP4430 SDP. Both boots 
 OK.
 
  diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
  index 84fecd0..f48f275 100644
  --- a/arch/arm/mach-omap2/Kconfig
  +++ b/arch/arm/mach-omap2/Kconfig
  @@ -7,8 +7,8 @@ config ARCH_OMAP2PLUS_TYPICAL
  default y
  select AEABI
  select REGULATOR
  -   select PM
  -   select PM_RUNTIME
  +   select PM if !ARCH_OMAP4
  +   select PM_RUNTIME if !ARCH_OMAP4
  select VFP
  select NEON if ARCH_OMAP3 || ARCH_OMAP4
  select SERIAL_8250

Let's rather fix whatever the issue is for booting (or building?)
omap4 with CONFIG_PM and CONFIG_PM_RUNTIME. If we can't implement
PM yet for omap4, we can just return early if cpu_is_omap44xx.

CONFIG_SMP we can't enable as that requires various ARM changes
to work on unicore systems. But hopefully we can enable that too
at some point with select SMP if ARCH_OMAP4.

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: [RFC][PATCH] omap3: Unify omap2_set_globals_3[43,6x]x functions

2010-06-30 Thread Tony Lindgren
* Mike Rapoport m...@compulab.co.il [100630 08:20]:
 Sergio Aguirre wrote:
 The only difference between them is the physical address of the
 uart4 port, which is only present in 36xx chips.
 
 We don't really need to care about keeping these 2 functions, since
 the decision to use uart4 is more cleanly done later when we do have
 access to omap_revision variable.
 
 Signed-off-by: Sergio Aguirre saagui...@ti.com
 ---
  arch/arm/mach-omap2/board-3430sdp.c|2 +-
  arch/arm/mach-omap2/board-3630sdp.c|2 +-
  arch/arm/mach-omap2/board-am3517evm.c  |2 +-
  arch/arm/mach-omap2/board-cm-t35.c |2 +-
  arch/arm/mach-omap2/board-devkit8000.c |2 +-
  arch/arm/mach-omap2/board-igep0020.c   |2 +-
  arch/arm/mach-omap2/board-ldp.c|2 +-
  arch/arm/mach-omap2/board-omap3beagle.c|2 +-
  arch/arm/mach-omap2/board-omap3evm.c   |2 +-
  arch/arm/mach-omap2/board-omap3pandora.c   |2 +-
  arch/arm/mach-omap2/board-omap3stalker.c   |2 +-
  arch/arm/mach-omap2/board-omap3touchbook.c |2 +-
  arch/arm/mach-omap2/board-overo.c  |2 +-
  arch/arm/mach-omap2/board-rx51.c   |2 +-
  arch/arm/mach-omap2/board-zoom2.c  |2 +-
  arch/arm/mach-omap2/board-zoom3.c  |2 +-
  arch/arm/plat-omap/common.c|   10 ++
  arch/arm/plat-omap/include/plat/common.h   |3 +--
  18 files changed, 19 insertions(+), 26 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
 b/arch/arm/mach-omap2/board-3430sdp.c
 index dd9c031..4961f3b 100644
 --- a/arch/arm/mach-omap2/board-3430sdp.c
 +++ b/arch/arm/mach-omap2/board-3430sdp.c
 @@ -805,7 +805,7 @@ static void __init omap_3430sdp_init(void)
  static void __init omap_3430sdp_map_io(void)
  {
 -omap2_set_globals_343x();
 +omap2_set_globals_3xxx();
  omap34xx_map_common_io();
  }
 
 Maybe we should take it one step further and replace board_map_io
 functions with common omap3_map_io?

Could be done yeah. If special handling is needed, it can still
be done in the board-*.c files. Care to do a patch for that?

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: [RFC][PATCH] board-omap3beagle: Remove duplicate DVI reset gpio handling

2010-06-30 Thread Koen Kooi

Op 29 jun 2010, om 22:32 heeft Sergio Aguirre het volgende geschreven:

 Following commit missed to remove this:
 
  commit 044d32ffbcb4a1d400088e3575508f46c0a9face
  Author: Koen Kooi koen.k...@gmail.com
  Date:   Thu Apr 22 10:23:42 2010 +0200
 
  board-omap3-beagle: add DSS2 support
 
 Signed-off-by: Sergio Aguirre saagui...@ti.com
 Cc: Koen Kooi koen.k...@gmail.com

Looks good to me:

Acked-by: Koen Kooi koen.k...@gmail.com

As a side note, the beagleboard xM uses a different pin for that.

regards,

Koen


 ---
 arch/arm/mach-omap2/board-omap3beagle.c |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
 b/arch/arm/mach-omap2/board-omap3beagle.c
 index 7b95cc1..867a4ad 100644
 --- a/arch/arm/mach-omap2/board-omap3beagle.c
 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
 @@ -169,6 +169,8 @@ static void __init beagle_display_init(void)
 {
   int r;
 
 + omap_mux_init_gpio(beagle_dvi_device.reset_gpio, OMAP_PIN_INPUT);
 +
   r = gpio_request(beagle_dvi_device.reset_gpio, DVI reset);
   if (r  0) {
   printk(KERN_ERR Unable to get DVI reset GPIO\n);
 @@ -491,11 +493,6 @@ static void __init omap3_beagle_init(void)
   ARRAY_SIZE(omap3_beagle_devices));
   omap_serial_init();
 
 - omap_mux_init_gpio(170, OMAP_PIN_INPUT);
 - gpio_request(170, DVI_nPD);
 - /* REVISIT leave DVI powered down until it's needed ... */
 - gpio_direction_output(170, true);
 -
   usb_musb_init(musb_board_data);
   usb_ehci_init(ehci_pdata);
   omap3beagle_flash_init();
 -- 
 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


RE: [PATCH 6/6] omap2/3/4: Add Kconfig option to compile in typical omap features

2010-06-30 Thread Shilimkar, Santosh
 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Wednesday, June 30, 2010 11:47 AM
 To: Shilimkar, Santosh
 Cc: linux-arm-ker...@lists.infradead.org; linux-omap@vger.kernel.org
 Subject: Re: [PATCH 6/6] omap2/3/4: Add Kconfig option to compile in
 typical omap features
 
 * Shilimkar, Santosh santosh.shilim...@ti.com [100629 17:40]:
   
   With your series OMAP4 build breaks because of PM and SMP
 dependencies.
   To ensure that build doesn't break on OMAP4, I needed below change.
 With
   This change I tried your series and it boots OK on OMAP4430 SDP
 
 Hmm the build does not break for me?

Looks like I am missing something here. How do you build OMAP4 alone with
these new changes ??
 
  Also tested the multi-omap build on OMAP3430 SDP and OMAP4430 SDP. Both
 boots OK.
 
   diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
   index 84fecd0..f48f275 100644
   --- a/arch/arm/mach-omap2/Kconfig
   +++ b/arch/arm/mach-omap2/Kconfig
   @@ -7,8 +7,8 @@ config ARCH_OMAP2PLUS_TYPICAL
   default y
   select AEABI
   select REGULATOR
   -   select PM
   -   select PM_RUNTIME
   +   select PM if !ARCH_OMAP4
   +   select PM_RUNTIME if !ARCH_OMAP4
   select VFP
   select NEON if ARCH_OMAP3 || ARCH_OMAP4
   select SERIAL_8250
 
 Let's rather fix whatever the issue is for booting (or building?)
 omap4 with CONFIG_PM and CONFIG_PM_RUNTIME. If we can't implement
 PM yet for omap4, we can just return early if cpu_is_omap44xx.
 
 CONFIG_SMP we can't enable as that requires various ARM changes
 to work on unicore systems. But hopefully we can enable that too
 at some point with select SMP if ARCH_OMAP4.
 

--
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: [RFC][PATCH] omap3: Unify omap2_set_globals_3[43,6x]x functions

2010-06-30 Thread Mike Rapoport

Tony Lindgren wrote:

* Mike Rapoport m...@compulab.co.il [100630 08:20]:

Sergio Aguirre wrote:

The only difference between them is the physical address of the
uart4 port, which is only present in 36xx chips.

We don't really need to care about keeping these 2 functions, since
the decision to use uart4 is more cleanly done later when we do have
access to omap_revision variable.

Signed-off-by: Sergio Aguirre saagui...@ti.com
---
arch/arm/mach-omap2/board-3430sdp.c|2 +-
arch/arm/mach-omap2/board-3630sdp.c|2 +-
arch/arm/mach-omap2/board-am3517evm.c  |2 +-
arch/arm/mach-omap2/board-cm-t35.c |2 +-
arch/arm/mach-omap2/board-devkit8000.c |2 +-
arch/arm/mach-omap2/board-igep0020.c   |2 +-
arch/arm/mach-omap2/board-ldp.c|2 +-
arch/arm/mach-omap2/board-omap3beagle.c|2 +-
arch/arm/mach-omap2/board-omap3evm.c   |2 +-
arch/arm/mach-omap2/board-omap3pandora.c   |2 +-
arch/arm/mach-omap2/board-omap3stalker.c   |2 +-
arch/arm/mach-omap2/board-omap3touchbook.c |2 +-
arch/arm/mach-omap2/board-overo.c  |2 +-
arch/arm/mach-omap2/board-rx51.c   |2 +-
arch/arm/mach-omap2/board-zoom2.c  |2 +-
arch/arm/mach-omap2/board-zoom3.c  |2 +-
arch/arm/plat-omap/common.c|   10 ++
arch/arm/plat-omap/include/plat/common.h   |3 +--
18 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index dd9c031..4961f3b 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -805,7 +805,7 @@ static void __init omap_3430sdp_init(void)
static void __init omap_3430sdp_map_io(void)
{
-   omap2_set_globals_343x();
+   omap2_set_globals_3xxx();
omap34xx_map_common_io();
}

Maybe we should take it one step further and replace board_map_io
functions with common omap3_map_io?


Could be done yeah. If special handling is needed, it can still
be done in the board-*.c files. Care to do a patch for that?


no problem.


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



--
Sincerely yours,
Mike.
--
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 6/6] omap2/3/4: Add Kconfig option to compile in typical omap features

2010-06-30 Thread Tony Lindgren
* Shilimkar, Santosh santosh.shilim...@ti.com [100630 09:41]:
  -Original Message-
  From: Tony Lindgren [mailto:t...@atomide.com]
  Sent: Wednesday, June 30, 2010 11:47 AM
  To: Shilimkar, Santosh
  Cc: linux-arm-ker...@lists.infradead.org; linux-omap@vger.kernel.org
  Subject: Re: [PATCH 6/6] omap2/3/4: Add Kconfig option to compile in
  typical omap features
  
  * Shilimkar, Santosh santosh.shilim...@ti.com [100629 17:40]:

With your series OMAP4 build breaks because of PM and SMP
  dependencies.
To ensure that build doesn't break on OMAP4, I needed below change.
  With
This change I tried your series and it boots OK on OMAP4430 SDP
  
  Hmm the build does not break for me?
 
 Looks like I am missing something here. How do you build OMAP4 alone with
 these new changes ??

Use your old config file, or just unselect CONFIG_ARCH_OMAP2
and CONFIG_ARCH_OMAP3. Note that if you now do:

$ yes  | ARCH=arm make oldconfig

with your old omap4 only config file, then by default the
typical features get added by default. So what you probably
want to do is (untested):

$ echo # CONFIG_ARCH_OMAP2PLUS_TYPICAL is not set  .config
$ yes  | ARCH=arm make oldconfig

Then it should not change your old config file.

To see how the boards and features show up, you can also play
with it with make xconfig:

System Type - TI OMAP2/3/4 Specific Features

Uncheck TI OMAP2 and TI OMAP3 so only TI OMAP4 is selected.

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: [RFC][PATCH] board-omap3beagle: Remove duplicate DVI reset gpio handling

2010-06-30 Thread Tomi Valkeinen
On Tue, 2010-06-29 at 22:32 +0200, ext Sergio Aguirre wrote:
 Following commit missed to remove this:
 
   commit 044d32ffbcb4a1d400088e3575508f46c0a9face
   Author: Koen Kooi koen.k...@gmail.com
   Date:   Thu Apr 22 10:23:42 2010 +0200
 
   board-omap3-beagle: add DSS2 support
 
 Signed-off-by: Sergio Aguirre saagui...@ti.com
 Cc: Koen Kooi koen.k...@gmail.com
 ---
  arch/arm/mach-omap2/board-omap3beagle.c |7 ++-
  1 files changed, 2 insertions(+), 5 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
 b/arch/arm/mach-omap2/board-omap3beagle.c
 index 7b95cc1..867a4ad 100644
 --- a/arch/arm/mach-omap2/board-omap3beagle.c
 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
 @@ -169,6 +169,8 @@ static void __init beagle_display_init(void)
  {
   int r;
  
 + omap_mux_init_gpio(beagle_dvi_device.reset_gpio, OMAP_PIN_INPUT);

It's a reset gpio (actually power up/down, if I recall right), it should
be configured as output, shouldn't it?

 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


[PATCH 0/1] Prefetch support for DMA transfer

2010-06-30 Thread Samu Onkalo
Add support for Prefetech mode in destination synchronized DMA transfer.
This enables DMA controller to fetch data from memory in advance.
When the destination HW block requests new data block, it can be send out
faster compared to read from memory. This may prevent stalls in target
HW block. 

Samu Onkalo (1):
  omap: dma: Support for prefetch in destination synchronized transfer

 arch/arm/plat-omap/dma.c  |   11 +++
 arch/arm/plat-omap/include/plat/dma.h |1 +
 2 files changed, 8 insertions(+), 4 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/1] omap: dma: Support for prefetch in destination synchronized transfer

2010-06-30 Thread Samu Onkalo
Omap DMA controller can prefetch data in advance in case of
destination synchronized data transfer. This may increase
performance when target HW block doesn't have fifo.
Data is waiting for transfer request in DMA fifo instead of read from memory.

Signed-off-by: Samu Onkalo samu.p.onk...@nokia.com
---
 arch/arm/plat-omap/dma.c  |   11 +++
 arch/arm/plat-omap/include/plat/dma.h |1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index f7f571e..ec7eddf 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -290,7 +290,7 @@ void omap_set_dma_transfer_params(int lch, int data_type, 
int elem_count,
val = dma_read(CCR(lch));
 
/* DMA_SYNCHRO_CONTROL_UPPER depends on the channel number */
-   val = ~((3  19) | 0x1f);
+   val = ~((1  23) | (3  19) | 0x1f);
val |= (dma_trigger  ~0x1f)  14;
val |= dma_trigger  0x1f;
 
@@ -304,11 +304,14 @@ void omap_set_dma_transfer_params(int lch, int data_type, 
int elem_count,
else
val = ~(1  18);
 
-   if (src_or_dst_synch)
+   if (src_or_dst_synch == OMAP_DMA_DST_SYNC_PREFETCH) {
+   val = ~(1  24);  /* dest synch */
+   val |= (1  23);   /* Prefetch */
+   } else if (src_or_dst_synch) {
val |= 1  24; /* source synch */
-   else
+   } else {
val = ~(1  24);  /* dest synch */
-
+   }
dma_write(val, CCR(lch));
}
 
diff --git a/arch/arm/plat-omap/include/plat/dma.h 
b/arch/arm/plat-omap/include/plat/dma.h
index 02232ca..af3a039 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -345,6 +345,7 @@
 #define OMAP_DMA_SYNC_BLOCK0x02
 #define OMAP_DMA_SYNC_PACKET   0x03
 
+#define OMAP_DMA_DST_SYNC_PREFETCH 0x02
 #define OMAP_DMA_SRC_SYNC  0x01
 #define OMAP_DMA_DST_SYNC  0x00
 
-- 
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] omap3: introduce omap3_map_io

2010-06-30 Thread Mike Rapoport
Hi Tony,
Here's the patch. It applies on top of Sergio's patch Unify 
omap2_set_globals_3[43,6x]x functions.

---
Most OMAP3-based boards use exactly the same code for .map_io method in
the machine_desc structure.
This patch introduces omap3_map_io and updates board-* files to use it
as .map_io method.

Signed-off-by: Mike Rapoport m...@compulab.co.il
CC: Sergio Aguirre saagui...@ti.com
CC: Tony Lindgren t...@atomide.com
CC: Kevin Hilman khil...@deeprootsystems.com
---
 arch/arm/mach-omap2/board-3430sdp.c|8 +---
 arch/arm/mach-omap2/board-3630sdp.c|8 +---
 arch/arm/mach-omap2/board-am3517evm.c  |8 +---
 arch/arm/mach-omap2/board-cm-t35.c |8 +---
 arch/arm/mach-omap2/board-devkit8000.c |8 +---
 arch/arm/mach-omap2/board-igep0020.c   |8 +---
 arch/arm/mach-omap2/board-ldp.c|8 +---
 arch/arm/mach-omap2/board-omap3beagle.c|8 +---
 arch/arm/mach-omap2/board-omap3evm.c   |8 +---
 arch/arm/mach-omap2/board-omap3pandora.c   |8 +---
 arch/arm/mach-omap2/board-omap3stalker.c   |8 +---
 arch/arm/mach-omap2/board-omap3touchbook.c |8 +---
 arch/arm/mach-omap2/board-overo.c  |8 +---
 arch/arm/mach-omap2/board-zoom2.c  |8 +---
 arch/arm/mach-omap2/board-zoom3.c  |8 +---
 arch/arm/plat-omap/common.c|6 ++
 arch/arm/plat-omap/include/plat/common.h   |2 ++
 17 files changed, 23 insertions(+), 105 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 4961f3b..ecdd2c3 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -803,18 +803,12 @@ static void __init omap_3430sdp_init(void)
usb_ehci_init(ehci_pdata);
 }
 
-static void __init omap_3430sdp_map_io(void)
-{
-   omap2_set_globals_3xxx();
-   omap34xx_map_common_io();
-}
-
 MACHINE_START(OMAP_3430SDP, OMAP3430 3430SDP board)
/* Maintainer: Syed Khasim - Texas Instruments Inc */
.phys_io= 0x4800,
.io_pg_offst= ((0xfa00)  18)  0xfffc,
.boot_params= 0x8100,
-   .map_io = omap_3430sdp_map_io,
+   .map_io = omap3_map_io,
.reserve= omap_reserve,
.init_irq   = omap_3430sdp_init_irq,
.init_machine   = omap_3430sdp_init,
diff --git a/arch/arm/mach-omap2/board-3630sdp.c 
b/arch/arm/mach-omap2/board-3630sdp.c
index 72c2130..59860df 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -66,12 +66,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata 
__initconst = {
.reset_gpio_port[2]  = -EINVAL
 };
 
-static void __init omap_sdp_map_io(void)
-{
-   omap2_set_globals_3xxx();
-   omap34xx_map_common_io();
-}
-
 static struct omap_board_config_kernel sdp_config[] __initdata = {
 };
 
@@ -107,7 +101,7 @@ MACHINE_START(OMAP_3630SDP, OMAP 3630SDP board)
.phys_io= 0x4800,
.io_pg_offst= ((0xfa00)  18)  0xfffc,
.boot_params= 0x8100,
-   .map_io = omap_sdp_map_io,
+   .map_io = omap3_map_io,
.reserve= omap_reserve,
.init_irq   = omap_sdp_init_irq,
.init_machine   = omap_sdp_init,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 4356424..4d0f585 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -461,17 +461,11 @@ static void __init am3517_evm_init(void)
am3517_evm_ethernet_init(am3517_evm_emac_pdata);
 }
 
-static void __init am3517_evm_map_io(void)
-{
-   omap2_set_globals_3xxx();
-   omap34xx_map_common_io();
-}
-
 MACHINE_START(OMAP3517EVM, OMAP3517/AM3517 EVM)
.phys_io= 0x4800,
.io_pg_offst= ((0xd800)  18)  0xfffc,
.boot_params= 0x8100,
-   .map_io = am3517_evm_map_io,
+   .map_io = omap3_map_io,
.reserve= omap_reserve,
.init_irq   = am3517_evm_init_irq,
.init_machine   = am3517_evm_init,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 6ce30b3..b910f72 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -708,12 +708,6 @@ static void __init cm_t35_init_irq(void)
omap_gpio_init();
 }
 
-static void __init cm_t35_map_io(void)
-{
-   omap2_set_globals_3xxx();
-   omap34xx_map_common_io();
-}
-
 static struct omap_board_mux board_mux[] __initdata = {
/* nCS and IRQ for CM-T35 ethernet */
OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0),
@@ -836,7 +830,7 @@ MACHINE_START(CM_T35, Compulab CM-T35)
.phys_io= 0x4800,
.io_pg_offst= ((0xd800)  18)  0xfffc,
.boot_params= 0x8100,
-   .map_io = 

Re: [PATCH] OMAP2:OMAPFB: Fix error path

2010-06-30 Thread Tomi Valkeinen
Hi,

Please send the patch as plaintext, without any HTML content.

Also, use the same patch subject as other patches for omapfb, in this
case OMAP: DSS2: OMAPFB: ..., and include a bit more verbose
description.

 Tomi


On Tue, 2010-06-29 at 22:29 +0200, ext Afzal Mohammed wrote:
 
 
 sysfs file removed in error path of omapfb_create_framebuffers()
 
 
 Signed-off-by: Afzal Mohammed lazfa...@gmail.com
 ---
  drivers/video/omap2/omapfb/omapfb-main.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 
 diff --git a/drivers/video/omap2/omapfb/omapfb-main.c
 b/drivers/video/omap2/omapfb/omapfb-main.c
 index 4b4506d..2319b81 100644
 --- a/drivers/video/omap2/omapfb/omapfb-main.c
 +++ b/drivers/video/omap2/omapfb/omapfb-main.c
 @@ -1945,6 +1945,7 @@ static int omapfb_create_framebuffers(struct
 omapfb2_device *fbdev)
   r = omapfb_overlay_enable(ovl, 1);
  
   if (r) {
 + omapfb_remove_sysfs(fbdev);
   dev_err(fbdev-dev,
   failed to enable overlay\n);
   return r;
 -- 
 1.7.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


Re: OMAP3 display patches

2010-06-30 Thread Tomi Valkeinen
On Tue, 2010-06-29 at 14:20 +0200, ext Nagarajan, Rajkumar wrote:
 Tomi,
 
 Would you please check if there are no further comments and can you please 
 pull the following patches in?
 
 https://patchwork.kernel.org/patch/106498/

What exactly is the purpose of this patch? The patch description doesn't
really tell me anything. The input size is supposed to come from omapfb
(or V4L2).

It also seems to add a module parameter, without even mentioning it in
the description.

There's also a typo in the description (sysfx).

 https://patchwork.kernel.org/patch/106670/

See Ville's comment about this.

I'd also like to have the sysfs files to be created only when they are
actually applicable, ie. pre_multiplication_alpha would be created only
for 3630, and for overlays that support it.

However, no other DSS sysfs file support this currently, and I'm not
sure what it would mean to support this.

 https://patchwork.kernel.org/patch/107547/

See Ville's and Koen's comments about this.

 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: ARM defconfig files

2010-06-30 Thread Uwe Kleine-König
Hi Linus,

I think my mail hit your inbox during your vacation.  As this is quite
important for the ARM people and there isn't much time left, can you
please comment?

Thanks in advance
Uwe

On Mon, Jun 14, 2010 at 10:32:14AM +0200, Uwe Kleine-König wrote:
 Hello,
 
 [Added linux-arm-kernel ML to Cc, note that it's moderated for
 non-subscribers.]
 
 On Thu, Jun 03, 2010 at 11:21:59AM -0700, Linus Torvalds wrote:
  
  
  On Thu, 3 Jun 2010, Daniel Walker wrote:
   
   I don't see how we can do without defconfigs altogether tho. I mean , if
   you want to run a Beagle board or a Nexus one we can't just give the
   users a slim ARM config and let them troll through 1000's of drivers
   trying to find just those ones that work on their given board.
  
  Well, you also don't need the full defconfig's with the kernel.
  
  Right now they are just noise. They actually _hide_ things, because 
  diffstat (and dirstat) information becomes pointless, and the diffs become 
  totally unreadable by any human (trust me - when the choice is between 
  search for next relevant diff or blast it, I can't be bothered with 
  walking through this crap, quite often the choice is the latter).
 I wrote a script that throws out all unneeded lines in all arm
 defconfigs that don't influence the resulting .config for .34 and
 .35-rc1 and compared .34-.35-rc with .34-reduced-.35-rc1-reduced.
 
 Here are the results:
 
   $ git diff --dirstat v2.6.34 v2.6.35-rc1 arch/arm
 11.8% arch/arm/configs/
 10.0% arch/arm/mach-msm/
 10.8% arch/arm/mach-omap2/
  4.8% arch/arm/mach-pxa/
  4.5% arch/arm/mach-s5pc100/
  3.3% arch/arm/mach-s5pv210/
  4.4% arch/arm/mach-spear3xx/
  3.1% arch/arm/mach-ux500/
  5.1% arch/arm/plat-s5pc1xx/
  3.1% arch/arm/plat-samsung/
 38.2% arch/arm/
 
   $ git diff --dirstat arm/defconfig/reduced-v2.6.34 
 arm/defconfig/reduced-v2.6.35-rc1 arch/arm
  3.1% arch/arm/mach-davinci/
 11.3% arch/arm/mach-msm/
 12.2% arch/arm/mach-omap2/
  5.4% arch/arm/mach-pxa/
  5.1% arch/arm/mach-s5pc100/
  3.7% arch/arm/mach-s5pv210/
  5.0% arch/arm/mach-spear3xx/
  3.5% arch/arm/mach-ux500/
  5.8% arch/arm/plat-s5pc1xx/
  3.5% arch/arm/plat-samsung/
 40.9% arch/arm/
 
   $ git diff --dirstat=0 arm/defconfig/reduced-v2.6.34 
 arm/defconfig/reduced-v2.6.35-rc1 arch/arm | grep config
  1.1% arch/arm/configs/
 
   $ git diff --shortstat v2.6.35-rc1 arm/defconfig/reduced-v2.6.35-rc1
177 files changed, 652 insertions(+), 194157 deletions(-)
 
 (The insertions above are only moved lines I think, I didn't check them
 all.)
 
 The branches arm/defconfig/reduced-v2.6.34 and
 arm/defconfig/reduced-v2.6.35-rc1 are available at my repo at
 git://git.pengutronix.de/git/ukl/linux-2.6.git .  (There is a gitweb at
 http://git.pengutronix.de/?p=ukl/linux-2.6.git)
 
 So maintaining these minimal defconfigs would have reduced the defconfig
 noise from 11.8% down to 1.1%.  And probably it could be considerably
 reduced further with constructs like:
 
   config HAVE_MTD_NAND_MXC
   bool
 
   config MTD_NAND_MXC
   tristate MXC NAND support
   ...
   default m if HAVE_MTD_NAND_MXC
   help
 ...
 
   ...
   config MACH_MX27ADS
   ...
   select HAVE_MTD_NAND_MXC
 
 .  Compared with selecting everything in Kconfig files this approach
 allows further tweaking of a config.  (E.g. I have a mx27ads machine,
 but I don't need nand support.)  Compared with the SAT-Solver it's an
 idea that works today.
 
 One downside of this approach (when done with my script only) is that
 too much is removed.  E.g. in mx3_defconfig CONFIG_ARCH_MX3 is removed.
 This is OK from a logical POV but then changing the default of the
 corresponding choice (and I intend to do that in the near future) would
 break this defconfig.
 
 I can share my script and I'm willing to support maintaining the
 minimality of the defconfig files if they are an acceptable (maybe
 intermediate) step for Linus.
 
 Together with the efforts to reduce the number of defconfigs as thought
 about in other mails of this thread the situation should become quite
 better for Linus.  (I'm currently working on merging support for all
 Freescale SoCs into a single mach- directory and so merge mx1_defconfig,
 mx21_defconfig, mx27_defconfig, mx31pdk_defconfig, mx3_defconfig and
 mx51_defconfig.)
 
 Linus: I would really appreciate if you wouldn't remove all (or nearly
 all) defconfig files.  I think you would force a quicker solution to
 this problem, but during that time the ARM community would loose compile
 coverage.
 
 Thoughts on this?
 
 Best regards
 Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | 

Re: [PATCH 1/2] arm: Replace CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6

2010-06-30 Thread Tony Lindgren
* Nicolas Pitre n...@fluxnic.net [100629 22:14]:
 On Tue, 29 Jun 2010, Tony Lindgren wrote:
 
  Also, can we detect somehow the hardware that uses CONFIG_TLS_REG_EMUL?
  Might be possible to remove that Kconfig option too later on..
 
 Well... I don't think we _should_ try to detect it as it is not widely 
 available if at all.

OK
 
 And there is actually a bug with __kuser_get_tls because if ever 
 CONFIG_TLS_REG_EMUL is selected then a call to __kuser_get_tls is 
 currently doing nothing while it should actually use the mrc 
 instruction.

I've changed it to initialize to mrc if (tls_emu || has_tls).

 Could this be a tristate instead?  There are actually 3 cases:
 
 1) We know the TLS reg is _always_ available i.e. ARMv6K, ARMV7 and 
above.  In that case the test on elf_hwcap is redundant and wasteful.
 
 2) We know the TLS reg is _never_ available i.e. pre-ARMv6.  The test on 
elf_hwcap is again redundant and wasteful.
 
 3) We're unsure as the actual CPU is known only at run time.
 
 Case #1 will become the common case in the future.  Case #2 is still 
 widely relevant for deployed systems in the field, and some popular 
 ARMv5TE based SOCs are still produced right now.  So instead of 
 replacing #1 and #2 with #3, I think you should add #3 to the other 
 cases instead.

OK. I've implemented this logic in new file tls.h.

   #ifdef CONFIG_MMU
  mcr p15, 0, r6, c3, c0, 0   @ Set domain register
  @@ -1009,16 +1011,13 @@ kuser_cmpxchg_fixup:
*/
   
   __kuser_get_tls:   @ 0x0fe0
  -
  -#if !defined(CONFIG_HAS_TLS_REG)  !defined(CONFIG_TLS_REG_EMUL)
  -   ldr r0, [pc, #(16 - 8)] @ TLS stored at 0x0ff0
  -#else
  -   mrc p15, 0, r0, c13, c0, 3  @ read TLS register
  -#endif
  +   nop @ read TLS, set in kuser_get_tls_init
  usr_ret lr
  -
  -   .rep5
  -   .word   0   @ pad up to __kuser_helper_version
  +   mrc p15, 0, r0, c13, c0, 3  @ 0x0fe8 hardware TLS code
  +   ldr r0, [pc, #(16 - 8)] @ 0x0fec software TLS code
  +   .word   0   @ 0x0ff0 software TLS value
  +   nop @ pad up to __kuser_helper_version
  +   nop
  .endr
 
 This looks obscur.  The idea of patching the appropriate instruction at 
 runtime here is a good one.  However I'd simply keep the ldr version in 
 place otherwise the pc displacement doesn't match anymore when 
 disassembling.  And simply overwrite it with the mrc version when 
 necessary.

OK, changed to use the ldr by default.
 
 BTW you left a stray .endr here.

Oops. I've put back the .rep .endrep instead of the nops now.
 
  +   if id  4)  0xfff) == 0xb36)  (((id  20)  3) == 0))
  +   elf_hwcap = ~HWCAP_TLS;
 
 You should probably test for the vendor ID as well (ARM in this case).

OK, added.
 
  +}
  +#else
  +static inline void feat_v6_fixup(void)
  +{
  +}
  +#endif
 
 I think the #ifdef is unnecessary here.  This is __init code anyway, so 
 this could as well be always compiled in.

Removed.
 
  diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
  index 1621e53..85dd001 100644
  --- a/arch/arm/kernel/traps.c
  +++ b/arch/arm/kernel/traps.c
  @@ -518,16 +518,19 @@ asmlinkage int arm_syscall(int no, struct pt_regs 
  *regs)
   
  case NR(set_tls):
  thread-tp_value = regs-ARM_r0;
  -#if defined(CONFIG_HAS_TLS_REG)
  -   asm (mcr p15, 0, %0, c13, c0, 3 : : r (regs-ARM_r0) );
  -#elif !defined(CONFIG_TLS_REG_EMUL)
  -   /*
  -* User space must never try to access this directly.
  -* Expect your app to break eventually if you do so.
  -* The user helper at 0x0fe0 must be used instead.
  -* (see entry-armv.S for details)
  -*/
  -   *((unsigned int *)0x0ff0) = regs-ARM_r0;
  +#if !defined(CONFIG_TLS_REG_EMUL)
  +   if (elf_hwcap  HWCAP_TLS) {
  +   asm (mcr p15, 0, %0, c13, c0, 3
  +   : : r (regs-ARM_r0));
  +   } else {
  +   /*
  +* User space must never try to access this directly.
  +* Expect your app to break eventually if you do so.
  +* The user helper at 0x0fe0 must be used instead.
  +* (see entry-armv.S for details)
  +*/
  +   *((unsigned int *)0x0ff0) = regs-ARM_r0;
  +   }
   #endif
 
 The same comment as for __kuser_get_tls would apply here.  However, 
 instead of duplicating the code block, you could define a macro, such as 
 has_tls_reg(), that would be either 0, 1, or ((elf_hwcap  HWCAP_TLS).

Now using tls_emu and has_tls defines.
 
  return 0;
   
  @@ -743,6 +746,21 @@ void __init trap_init(void)
  return;
   }
   
  +#if defined(CONFIG_TLS_REG_EMUL)
  +static void __init 

RE: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch

2010-06-30 Thread Tomi Valkeinen
On Tue, 2010-06-29 at 16:13 +0200, ext Nagarajan, Rajkumar wrote:
 
  -Original Message-
  From: Tomi Valkeinen [mailto:tomi.valkei...@nokia.com] 
  Sent: Thursday, June 24, 2010 4:21 PM
  To: Nagarajan, Rajkumar
  Cc: linux-omap@vger.kernel.org
  Subject: Re: [PATCH] OMAP: DSS: Fix for dsi_pll to dpll4 clk switch
  
  On Thu, 2010-06-17 at 07:12 +0200, ext Nagarajan, Rajkumar wrote:
   When switching between clocks, The new functional clock is
   effective when the next vertical blanking interval occurs.
   GOLCD bit has to be set for the new clock to take effect.
  
  Where did you encounter this problem?
  
 Raj: The below experiments will make you to understand the significance of 
 the patch:
 
 1. Select dsi_pll as default clock.
 2. After the zoom3 display comes up,switch the default screen on LCD to TV 
 using below commands.
   echo 0  /sys/devices/platform/omapdss/overlay0/enabled
   echo 720,574  /sys/devices/platform/omapdss/overlay0/input_size
   echo 720,574  /sys/devices/platform/omapdss/overlay0/output_size
   echo tv   /sys/devices/platform/omapdss/overlay0/manager
   echo 1  /sys/devices/platform/omapdss/display1/enabled
   echo 1  /sys/devices/platform/omapdss/overlay0/enabled
 3. Now the display is appearing on TV.So, Now switch the display back to LCD 
 using the below commands.
   echo 0  /sys/devices/platform/omapdss/overlay0/enabled
   echo 800,480  /sys/devices/platform/omapdss/overlay0/input_size
   echo 800,480  /sys/devices/platform/omapdss/overlay0/output_size
   echo lcd   /sys/devices/platform/omapdss/overlay0/manager
   echo 1  /sys/devices/platform/omapdss/display1/enabled
   echo 1  /sys/devices/platform/omapdss/overlay0/enabled
 4. Now the display will not appear on LCD,if the patch is not included.
 But,the display will appear on LCD, if the patch is included.

The LCD is never turned off in the sequence above. Was that supposed to
be there somewhere?

   Signed-off-by: Kishore Y kishor...@ti.com
   Signed-off-by: Mukund Mittal mmit...@ti.com
   Signed-off-by: Rajkumar N rajkumar.nagara...@ti.com
   ---
drivers/video/omap2/dss/dpi.c |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
   
   diff --git a/drivers/video/omap2/dss/dpi.c 
  b/drivers/video/omap2/dss/dpi.c
   index 960e977..5d778d6 100644
   --- a/drivers/video/omap2/dss/dpi.c
   +++ b/drivers/video/omap2/dss/dpi.c
   @@ -214,10 +214,15 @@ void 
  omapdss_dpi_display_disable(struct omap_dss_device *dssdev)

#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
 dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK);
   + dispc_go(OMAP_DSS_CHANNEL_LCD);
  
  I don't think GO does anything here, as the channel has already been
  disabled.
 Raj:This is the actual fix.So, the above experiment that I explained will be 
 the usecase to understand the need of this statement.

So, how does the OMAP DSS HW actually work then? My understanding was
that GO bit doesn't do anything if the channel is disabled. It's only
used when the channel is enabled.

Setting the GO bit should make the new register changes to be effective
after next VFP. If the channel is disabled, there's no VFP, thus it
shouldn't do anything...?

Also related to using DSI PLL, there's an OMAP bug that causes glitches
on TV-out if DSI PLL is used for DISPC fclk, basically making DSI PLL
unusable for DISPC fclk. Have you encountered this?

 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


[GIT PULL] omap fixes for 2.6.35-rc3

2010-06-30 Thread Tony Lindgren
Hi Linus,

Please pull omap fixes from:

git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git 
omap-fixes-for-linus

These all should match your major bugs or regressions criteria for
various omaps :)

Regards,

Tony


The following changes since commit 7e27d6e778cd87b6f2415515d7127eba53fe5d02:

  Linux 2.6.35-rc3 (2010-06-11 19:14:04 -0700)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git 
omap-fixes

Amit Kucheria (1):
  omap: fix build failure due to missing include dma-mapping.h

Benoit Cousson (1):
  OMAP: hwmod: Fix the missing braces

Kevin Hilman (2):
  omap: GPIO: fix auto-disable of debounce clock
  OMAP3: PM: fix IO daisy chain enable to use PM_WKEN reg

Santosh Shilimkar (2):
  omap: Stalker board: switch over to gpio_set_debounce
  OMAP4: clock: Fix multi-omap boot with reset un-used clocks

Satish (1):
  omap iommu: Fix Memory leak

Tero Kristo (1):
  omap: DMTIMER: Ack pending interrupt always when stopping a timer

Tony Lindgren (1):
  Merge branch 'for_2.6.35rc' of git://git.pwsan.com/linux-2.6 into 
omap-fixes-for-linus

 arch/arm/mach-omap2/board-omap3stalker.c |4 +---
 arch/arm/mach-omap2/clock44xx_data.c |2 ++
 arch/arm/mach-omap2/omap_hwmod.c |9 ++---
 arch/arm/mach-omap2/pm34xx.c |4 ++--
 arch/arm/mach-omap2/usb-ehci.c   |2 ++
 arch/arm/plat-omap/dmtimer.c |6 +++---
 arch/arm/plat-omap/gpio.c|1 +
 arch/arm/plat-omap/iovmm.c   |4 +++-
 8 files changed, 20 insertions(+), 12 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 00/16] omap mux updates for 2.6.36 merge window

2010-06-30 Thread Tony Lindgren
Hi all,

This series converts the remaining mach-omap2 code to use the
new mux framework that's already in use for omap3. After this
series we still need to add the mux data for omap4.

Regards,

Tony

---

Tony Lindgren (16):
  omap: mux: Fix omap_mux_init_gpio for omap24xx
  omap: mux: Renumber package defines to make room for older 24xx packages
  omap: mux: Allow compiling in new mux code on all mach-omap2 systems
  omap: mux: Remove unncessary parens from mux34xx.c
  omap: mux: Add data for 2420
  omap: mux: Add data for 2430
  omap: mux: Select SIP package for H4
  omap: mux: Select POP package for Apollon
  omap: mux: Select POP package for N8X0
  omap: mux: Select POP package for 2430SDP
  omap: mux: Make omap2 FS USB code use new mux functions
  omap: mux: Do keypad muxing in board-*.c files
  omap: mux: Mux Apollon LCD power in board-apollon.c
  omap: mux: Mux 2430 USB0HS_STP in board-2430.c
  omap: mux: Convert 2420 platform init code to use new mux code
  omap: mux: Remove old mux code


 arch/arm/mach-omap1/board-fsample.c  |   12 
 arch/arm/mach-omap1/board-h2.c   |   13 
 arch/arm/mach-omap1/board-h3.c   |   13 
 arch/arm/mach-omap1/board-perseus2.c |   12 
 arch/arm/mach-omap2/Kconfig  |   10 
 arch/arm/mach-omap2/Makefile |2 
 arch/arm/mach-omap2/board-2430sdp.c  |   15 
 arch/arm/mach-omap2/board-3630sdp.c  |1 
 arch/arm/mach-omap2/board-apollon.c  |   28 +
 arch/arm/mach-omap2/board-generic.c  |1 
 arch/arm/mach-omap2/board-h4.c   |   36 +
 arch/arm/mach-omap2/board-n8x0.c |   11 
 arch/arm/mach-omap2/board-rx51-peripherals.c |1 
 arch/arm/mach-omap2/board-rx51-video.c   |1 
 arch/arm/mach-omap2/devices.c|   25 -
 arch/arm/mach-omap2/i2c.c|   27 -
 arch/arm/mach-omap2/io.c |2 
 arch/arm/mach-omap2/mcbsp.c  |   13 
 arch/arm/mach-omap2/mux.c|  308 --
 arch/arm/mach-omap2/mux.h|   28 +
 arch/arm/mach-omap2/mux2420.c|  688 +++
 arch/arm/mach-omap2/mux2420.h|  282 +
 arch/arm/mach-omap2/mux2430.c|  791 ++
 arch/arm/mach-omap2/mux2430.h|  370 
 arch/arm/mach-omap2/mux34xx.c|8 
 arch/arm/mach-omap2/pm24xx.c |1 
 arch/arm/mach-omap2/usb-ehci.c   |1 
 arch/arm/mach-omap2/usb-fs.c |   33 +
 arch/arm/mach-omap2/usb-musb.c   |1 
 arch/arm/mach-omap2/usb-tusb6010.c   |   14 
 arch/arm/plat-omap/devices.c |   61 --
 arch/arm/plat-omap/include/plat/mux.h|  220 ---
 arch/arm/plat-omap/mux.c |2 
 drivers/usb/musb/omap2430.c  |4 
 drivers/video/omap/lcd_apollon.c |3 
 35 files changed, 2359 insertions(+), 679 deletions(-)
 create mode 100644 arch/arm/mach-omap2/mux2420.c
 create mode 100644 arch/arm/mach-omap2/mux2420.h
 create mode 100644 arch/arm/mach-omap2/mux2430.c
 create mode 100644 arch/arm/mach-omap2/mux2430.h

-- 
Signature
--
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 01/16] omap: mux: Fix omap_mux_init_gpio for omap24xx

2010-06-30 Thread Tony Lindgren
Looks like 24xx uses mode3 instead of mode4 for muxable GPIO pins.
This will be needed when 24xx mux code is converted to use the new
mux functions.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/mux.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 8b3d269..76b5bf7 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -43,6 +43,7 @@
 
 #define OMAP_MUX_BASE_OFFSET   0x30/* Offset from CTRL_BASE */
 #define OMAP_MUX_BASE_SZ   0x5ca
+#define MUXABLE_GPIO_MODE3 BIT(0)
 
 struct omap_mux_entry {
struct omap_mux mux;
@@ -51,6 +52,7 @@ struct omap_mux_entry {
 
 static unsigned long mux_phys;
 static void __iomem *mux_base;
+static u8 omap_mux_flags;
 
 u16 omap_mux_read(u16 reg)
 {
@@ -394,7 +396,10 @@ int __init omap_mux_init_gpio(int gpio, int val)
 
old_mode = omap_mux_read(m-reg_offset);
mux_mode = val  ~(OMAP_MUX_NR_MODES - 1);
-   mux_mode |= OMAP_MUX_MODE4;
+   if (omap_mux_flags  MUXABLE_GPIO_MODE3)
+   mux_mode |= OMAP_MUX_MODE3;
+   else
+   mux_mode |= OMAP_MUX_MODE4;
printk(KERN_DEBUG mux: Setting signal 
%s.gpio%i 0x%04x - 0x%04x\n,
m-muxnames[0], gpio, old_mode, mux_mode);
@@ -1032,6 +1037,9 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size,
return -ENODEV;
}
 
+   if (cpu_is_omap24xx())
+   omap_mux_flags = MUXABLE_GPIO_MODE3;
+
omap_mux_init_package(superset, package_subset, package_balls);
omap_mux_init_list(superset);
omap_mux_init_signals(board_mux);

--
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 02/16] omap: mux: Renumber package defines to make room for older 24xx packages

2010-06-30 Thread Tony Lindgren
Only POP and SIP are known to exist for 2420, 2430 seems to only have
SIP package available.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/mux.h |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 480abc5..46315f2 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -56,10 +56,12 @@
 
 /* Flags for omap_mux_init */
 #define OMAP_PACKAGE_MASK  0x
-#define OMAP_PACKAGE_CBP   4   /* 515-pin 0.40 0.50 */
-#define OMAP_PACKAGE_CUS   3   /* 423-pin 0.65 */
-#define OMAP_PACKAGE_CBB   2   /* 515-pin 0.40 0.50 */
-#define OMAP_PACKAGE_CBC   1   /* 515-pin 0.50 0.65 */
+#define OMAP_PACKAGE_CBP   6   /* 515-pin 0.40 0.50 */
+#define OMAP_PACKAGE_CUS   5   /* 423-pin 0.65 */
+#define OMAP_PACKAGE_CBB   4   /* 515-pin 0.40 0.50 */
+#define OMAP_PACKAGE_CBC   3   /* 515-pin 0.50 0.65 */
+#define OMAP_PACKAGE_ZAC   2   /* 24xx 447-pin POP */
+#define OMAP_PACKAGE_ZAF   1   /* 2420 447-pin SIP */
 
 
 #define OMAP_MUX_NR_MODES  8   /* Available modes */

--
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 03/16] omap: mux: Allow compiling in new mux code on all mach-omap2 systems

2010-06-30 Thread Tony Lindgren
Allow compiling in new mux code on all mach-omap2 systems

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/mux.c |2 +-
 arch/arm/mach-omap2/mux.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 76b5bf7..197e295 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -372,7 +372,7 @@ int __init omap2_mux_init(void)
 
 
/**/
 
-#ifdef CONFIG_ARCH_OMAP3
+#ifdef CONFIG_ARCH_OMAP2PLUS
 static LIST_HEAD(muxmodes);
 static DEFINE_MUTEX(muxmode_mutex);
 
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 46315f2..937a8ca 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -104,7 +104,7 @@ struct omap_board_mux {
u16 value;
 };
 
-#if defined(CONFIG_OMAP_MUX)  defined(CONFIG_ARCH_OMAP3)
+#if defined(CONFIG_OMAP_MUX)
 
 /**
  * omap_mux_init_gpio - initialize a signal based on the GPIO number

--
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 04/16] omap: mux: Remove unncessary parens from mux34xx.c

2010-06-30 Thread Tony Lindgren
Remove unncessary parens from mux34xx.c

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/mux34xx.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c
index 2ff4dce..f64d7ee 100644
--- a/arch/arm/mach-omap2/mux34xx.c
+++ b/arch/arm/mach-omap2/mux34xx.c
@@ -2032,19 +2032,19 @@ int __init omap3_mux_init(struct omap_board_mux 
*board_subset, int flags)
struct omap_ball *package_balls;
 
switch (flags  OMAP_PACKAGE_MASK) {
-   case (OMAP_PACKAGE_CBC):
+   case OMAP_PACKAGE_CBC:
package_subset = omap3_cbc_subset;
package_balls = omap3_cbc_ball;
break;
-   case (OMAP_PACKAGE_CBB):
+   case OMAP_PACKAGE_CBB:
package_subset = omap3_cbb_subset;
package_balls = omap3_cbb_ball;
break;
-   case (OMAP_PACKAGE_CUS):
+   case OMAP_PACKAGE_CUS:
package_subset = omap3_cus_subset;
package_balls = omap3_cus_ball;
break;
-   case (OMAP_PACKAGE_CBP):
+   case OMAP_PACKAGE_CBP:
package_subset = omap36xx_cbp_subset;
package_balls = omap36xx_cbp_ball;
break;

--
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 05/16] omap: mux: Add data for 2420

2010-06-30 Thread Tony Lindgren
Add data for 2420. Big thanks to Paul Walmsley p...@pwsan.com
for generating usable mux data out of TRMs.

Cc: Benoit Cousson b-cous...@ti.com
Signed-off-by: Paul Walmsley p...@pwsan.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Kconfig   |6 
 arch/arm/mach-omap2/Makefile  |1 
 arch/arm/mach-omap2/mux.h |8 
 arch/arm/mach-omap2/mux2420.c |  688 +
 arch/arm/mach-omap2/mux2420.h |  282 +
 5 files changed, 985 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/mux2420.c
 create mode 100644 arch/arm/mach-omap2/mux2420.h

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b31b6f1..d3932d3 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -17,6 +17,12 @@ config ARCH_OMAP3430
depends on ARCH_OMAP3
select ARCH_OMAP_OTG
 
+config OMAP_PACKAGE_ZAF
+   bool
+
+config OMAP_PACKAGE_ZAC
+   bool
+
 config OMAP_PACKAGE_CBC
bool
 
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 0416643..b7e5537 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -36,6 +36,7 @@ AFLAGS_sram243x.o :=-Wa,-march=armv6
 AFLAGS_sram34xx.o  :=-Wa,-march=armv7-a
 
 # Pin multiplexing
+obj-$(CONFIG_ARCH_OMAP2420)+= mux2420.o
 obj-$(CONFIG_ARCH_OMAP3)   += mux34xx.o
 
 # SMS/SDRC
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 937a8ca..e14cd4d 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -7,6 +7,7 @@
  * published by the Free Software Foundation.
  */
 
+#include mux2420.h
 #include mux34xx.h
 
 #define OMAP_MUX_TERMINATOR0x
@@ -173,6 +174,13 @@ void omap_mux_write(u16 val, u16 mux_offset);
 void omap_mux_write_array(struct omap_board_mux *board_mux);
 
 /**
+ * omap2420_mux_init() - initialize mux system with board specific set
+ * @board_mux: Board specific mux table
+ * @flags: OMAP package type used for the board
+ */
+int omap2420_mux_init(struct omap_board_mux *board_mux, int flags);
+
+/**
  * omap3_mux_init() - initialize mux system with board specific set
  * @board_mux: Board specific mux table
  * @flags: OMAP package type used for the board
diff --git a/arch/arm/mach-omap2/mux2420.c b/arch/arm/mach-omap2/mux2420.c
new file mode 100644
index 000..fdb04a7
--- /dev/null
+++ b/arch/arm/mach-omap2/mux2420.c
@@ -0,0 +1,688 @@
+/*
+ * Copyright (C) 2010 Nokia
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * This program 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.
+ */
+
+#include linux/module.h
+#include linux/init.h
+
+#include mux.h
+
+#ifdef CONFIG_OMAP_MUX
+
+#define _OMAP2420_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7)  
\
+{  \
+   .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \
+   .gpio   = (g),  \
+   .muxnames   = { m0, m1, m2, m3, m4, m5, m6, m7 },   \
+}
+
+#else
+
+#define _OMAP2420_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7)  
\
+{  \
+   .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \
+   .gpio   = (g),  \
+}
+
+#endif
+
+#define _OMAP2420_BALLENTRY(M0, bb, bt)
\
+{  \
+   .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \
+   .balls  = { bb, bt },   \
+}
+
+/*
+ * Superset of all mux modes for omap2420
+ */
+static struct omap_mux __initdata omap2420_muxmodes[] = {
+   _OMAP2420_MUXENTRY(CAM_D0, 54,
+   cam_d0, hw_dbg2, sti_dout, gpio_54,
+   NULL, NULL, etk_d2, NULL),
+   _OMAP2420_MUXENTRY(CAM_D1, 53,
+   cam_d1, hw_dbg3, sti_din, gpio_53,
+   NULL, NULL, etk_d3, NULL),
+   _OMAP2420_MUXENTRY(CAM_D2, 52,
+   cam_d2, hw_dbg4, mcbsp1_clkx, gpio_52,
+   NULL, NULL, etk_d4, NULL),
+   _OMAP2420_MUXENTRY(CAM_D3, 51,
+   cam_d3, hw_dbg5, mcbsp1_dr, gpio_51,
+   NULL, NULL, etk_d5, NULL),
+   _OMAP2420_MUXENTRY(CAM_D4, 50,
+   cam_d4, hw_dbg6, mcbsp1_fsr, gpio_50,
+   NULL, NULL, etk_d6, NULL),
+   _OMAP2420_MUXENTRY(CAM_D5, 49,
+   cam_d5, hw_dbg7, mcbsp1_clkr, gpio_49,
+   NULL, NULL, etk_d7, NULL),
+   _OMAP2420_MUXENTRY(CAM_D6, 0,
+   cam_d6, hw_dbg8, NULL, NULL,
+   NULL, NULL, etk_d8, 

[PATCH 06/16] omap: mux: Add data for 2430

2010-06-30 Thread Tony Lindgren
Add data for 2430. Big thanks to Paul Walmsley p...@pwsan.com
for generating usable mux data out of TRMs.

Cc: Benoit Cousson b-cous...@ti.com
Signed-off-by: Paul Walmsley p...@pwsan.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile  |1 
 arch/arm/mach-omap2/mux.h |8 
 arch/arm/mach-omap2/mux2430.c |  791 +
 arch/arm/mach-omap2/mux2430.h |  370 +++
 4 files changed, 1170 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/mux2430.c
 create mode 100644 arch/arm/mach-omap2/mux2430.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b7e5537..0f2f508 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -37,6 +37,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
 
 # Pin multiplexing
 obj-$(CONFIG_ARCH_OMAP2420)+= mux2420.o
+obj-$(CONFIG_ARCH_OMAP2430)+= mux2430.o
 obj-$(CONFIG_ARCH_OMAP3)   += mux34xx.o
 
 # SMS/SDRC
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index e14cd4d..a8e040c 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -8,6 +8,7 @@
  */
 
 #include mux2420.h
+#include mux2430.h
 #include mux34xx.h
 
 #define OMAP_MUX_TERMINATOR0x
@@ -181,6 +182,13 @@ void omap_mux_write_array(struct omap_board_mux 
*board_mux);
 int omap2420_mux_init(struct omap_board_mux *board_mux, int flags);
 
 /**
+ * omap2430_mux_init() - initialize mux system with board specific set
+ * @board_mux: Board specific mux table
+ * @flags: OMAP package type used for the board
+ */
+int omap2430_mux_init(struct omap_board_mux *board_mux, int flags);
+
+/**
  * omap3_mux_init() - initialize mux system with board specific set
  * @board_mux: Board specific mux table
  * @flags: OMAP package type used for the board
diff --git a/arch/arm/mach-omap2/mux2430.c b/arch/arm/mach-omap2/mux2430.c
new file mode 100644
index 000..7dcaaa8
--- /dev/null
+++ b/arch/arm/mach-omap2/mux2430.c
@@ -0,0 +1,791 @@
+/*
+ * Copyright (C) 2010 Nokia
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * This program 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.
+ */
+
+#include linux/module.h
+#include linux/init.h
+
+#include mux.h
+
+#ifdef CONFIG_OMAP_MUX
+
+#define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7)  
\
+{  \
+   .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \
+   .gpio   = (g),  \
+   .muxnames   = { m0, m1, m2, m3, m4, m5, m6, m7 },   \
+}
+
+#else
+
+#define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7)  
\
+{  \
+   .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \
+   .gpio   = (g),  \
+}
+
+#endif
+
+#define _OMAP2430_BALLENTRY(M0, bb, bt)
\
+{  \
+   .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \
+   .balls  = { bb, bt },   \
+}
+
+/*
+ * Superset of all mux modes for omap2430
+ */
+static struct omap_mux __initdata omap2430_muxmodes[] = {
+   _OMAP2430_MUXENTRY(CAM_D0, 133,
+   cam_d0, hw_dbg0, sti_dout, gpio_133,
+   NULL, NULL, etk_d2, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D10, 146,
+   cam_d10, NULL, NULL, gpio_146,
+   NULL, NULL, etk_d12, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D11, 145,
+   cam_d11, NULL, NULL, gpio_145,
+   NULL, NULL, etk_d13, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D1, 132,
+   cam_d1, hw_dbg1, sti_din, gpio_132,
+   NULL, NULL, etk_d3, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D2, 129,
+   cam_d2, hw_dbg2, mcbsp1_clkx, gpio_129,
+   NULL, NULL, etk_d4, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D3, 128,
+   cam_d3, hw_dbg3, mcbsp1_dr, gpio_128,
+   NULL, NULL, etk_d5, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D4, 143,
+   cam_d4, hw_dbg4, mcbsp1_fsr, gpio_143,
+   NULL, NULL, etk_d6, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D5, 112,
+   cam_d5, hw_dbg5, mcbsp1_clkr, gpio_112,
+   NULL, NULL, etk_d7, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D6, 137,
+   cam_d6, hw_dbg6, NULL, gpio_137,
+   NULL, NULL, etk_d8, safe_mode),
+   _OMAP2430_MUXENTRY(CAM_D7, 136,
+   cam_d7, hw_dbg7, NULL, gpio_136,
+   

[PATCH 07/16] omap: mux: Select SIP package for H4

2010-06-30 Thread Tony Lindgren
Select SIP package for H4

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Kconfig|1 +
 arch/arm/mach-omap2/board-h4.c |   12 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index d3932d3..b59cdb7 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -50,6 +50,7 @@ config MACH_OMAP2_TUSB6010
 config MACH_OMAP_H4
bool OMAP 2420 H4 board
depends on ARCH_OMAP2
+   select OMAP_PACKAGE_ZAF
select OMAP_DEBUG_DEVICES
 
 config MACH_OMAP_APOLLON
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 54a231c..8c58f51 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -42,6 +42,8 @@
 #include plat/dma.h
 #include plat/gpmc.h
 
+#include mux.h
+
 #define H4_FLASH_CS0
 #define H4_SMC91X_CS   1
 
@@ -338,8 +340,18 @@ static struct i2c_board_info __initdata 
h4_i2c_board_info[] = {
},
 };
 
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+   { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#else
+#define board_mux  NULL
+#endif
+
 static void __init omap_h4_init(void)
 {
+   omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF);
+
/*
 * Make sure the serial ports are muxed on at this point.
 * You have to mux them off in device drivers later on

--
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 08/16] omap: mux: Select POP package for Apollon

2010-06-30 Thread Tony Lindgren
Select POP package for Apollon

Cc: Kyungmin Park kyungmin.p...@samsung.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Kconfig |1 +
 arch/arm/mach-omap2/board-apollon.c |   12 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b59cdb7..269f84f 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -56,6 +56,7 @@ config MACH_OMAP_H4
 config MACH_OMAP_APOLLON
bool OMAP 2420 Apollon board
depends on ARCH_OMAP2
+   select OMAP_PACKAGE_ZAC
 
 config MACH_OMAP_2430SDP
bool OMAP 2430 SDP board
diff --git a/arch/arm/mach-omap2/board-apollon.c 
b/arch/arm/mach-omap2/board-apollon.c
index 987b24d..b86a879 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -42,6 +42,8 @@
 #include plat/gpmc.h
 #include plat/control.h
 
+#include mux.h
+
 /* LED  Switch macros */
 #define LED0_GPIO1313
 #define LED1_GPIO1414
@@ -309,10 +311,20 @@ static void __init apollon_usb_init(void)
omap2_usbfs_init(apollon_usb_config);
 }
 
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+   { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#else
+#define board_mux  NULL
+#endif
+
 static void __init omap_apollon_init(void)
 {
u32 v;
 
+   omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
+
apollon_led_init();
apollon_flash_init();
apollon_usb_init();

--
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 10/16] omap: mux: Select POP package for 2430SDP

2010-06-30 Thread Tony Lindgren
Select POP package for 2430SDP

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Kconfig |1 +
 arch/arm/mach-omap2/board-2430sdp.c |   11 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 4158368..f67f037 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -61,6 +61,7 @@ config MACH_OMAP_APOLLON
 config MACH_OMAP_2430SDP
bool OMAP 2430 SDP board
depends on ARCH_OMAP2
+   select OMAP_PACKAGE_ZAC
 
 config MACH_OMAP3_BEAGLE
bool OMAP3 BEAGLE board
diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
b/arch/arm/mach-omap2/board-2430sdp.c
index ec920c9..281aa13 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include plat/usb.h
 #include plat/gpmc-smc91x.h
 
+#include mux.h
 #include hsmmc.h
 
 #define SDP2430_CS0_BASE   0x0400
@@ -217,10 +218,20 @@ static struct omap_usb_config sdp2430_usb_config 
__initdata = {
.pins[0]= 3,
 };
 
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+   { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#else
+#define board_mux  NULL
+#endif
+
 static void __init omap_2430sdp_init(void)
 {
int ret;
 
+   omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
+
omap2430_i2c_init();
 
platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));

--
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 11/16] omap: mux: Make omap2 FS USB code use new mux functions

2010-06-30 Thread Tony Lindgren
Make omap2 FS USB code use new mux functions. Do not mux usb2_tllse0
as it has multiple options.

Cc: David Brownell dbrown...@users.sourceforge.net
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/usb-fs.c |   33 ++---
 1 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-fs.c b/arch/arm/mach-omap2/usb-fs.c
index a445519..a216d88 100644
--- a/arch/arm/mach-omap2/usb-fs.c
+++ b/arch/arm/mach-omap2/usb-fs.c
@@ -30,7 +30,6 @@
 #include asm/irq.h
 
 #include plat/control.h
-#include plat/mux.h
 #include plat/usb.h
 #include plat/board.h
 
@@ -40,6 +39,8 @@
 #define INT_USB_IRQ_HGEN   INT_24XX_USB_IRQ_HGEN
 #define INT_USB_IRQ_OTGINT_24XX_USB_IRQ_OTG
 
+#include mux.h
+
 #if defined(CONFIG_ARCH_OMAP2)
 
 #ifdef CONFIG_USB_GADGET_OMAP
@@ -209,13 +210,13 @@ static u32 __init omap2_usb0_init(unsigned nwires, 
unsigned is_device)
return 0;
 
if (is_device)
-   omap_cfg_reg(J20_24XX_USB0_PUEN);
+   omap_mux_init_signal(usb0_puen, 0);
 
-   omap_cfg_reg(K18_24XX_USB0_DAT);
-   omap_cfg_reg(K19_24XX_USB0_TXEN);
-   omap_cfg_reg(J14_24XX_USB0_SE0);
+   omap_mux_init_signal(usb0_dat, 0);
+   omap_mux_init_signal(usb0_txen, 0);
+   omap_mux_init_signal(usb0_se0, 0);
if (nwires != 3)
-   omap_cfg_reg(J18_24XX_USB0_RCV);
+   omap_mux_init_signal(usb0_rcv, 0);
 
switch (nwires) {
case 3:
@@ -228,8 +229,8 @@ static u32 __init omap2_usb0_init(unsigned nwires, unsigned 
is_device)
break;
case 6:
syscon1 = 3;
-   omap_cfg_reg(J19_24XX_USB0_VP);
-   omap_cfg_reg(K20_24XX_USB0_VM);
+   omap_mux_init_signal(usb0_vp, 0);
+   omap_mux_init_signal(usb0_vm, 0);
omap2_usb_devconf_set(0, USB_UNIDIR);
break;
default:
@@ -289,12 +290,12 @@ static u32 __init omap2_usb2_init(unsigned nwires, 
unsigned alt_pingroup)
if (alt_pingroup || nwires == 0)
return 0;
 
-   omap_cfg_reg(Y11_24XX_USB2_DAT);
-   omap_cfg_reg(AA10_24XX_USB2_SE0);
+   omap_mux_init_signal(usb2_dat, 0);
+   omap_mux_init_signal(usb2_se0, 0);
if (nwires  2)
-   omap_cfg_reg(AA12_24XX_USB2_TXEN);
+   omap_mux_init_signal(usb2_txen, 0);
if (nwires  3)
-   omap_cfg_reg(AA6_24XX_USB2_RCV);
+   omap_mux_init_signal(usb2_rcv, 0);
 
switch (nwires) {
case 2:
@@ -313,11 +314,13 @@ static u32 __init omap2_usb2_init(unsigned nwires, 
unsigned alt_pingroup)
omap2_usb_devconf_set(2, USB_BIDIR);
break;
case 5:
-   omap_cfg_reg(AA4_24XX_USB2_TLLSE0);
-   /* NOTE: board-specific code must override this setting if
-* this TLL link is not using DP/DM.  Something must also
+   /* NOTE: board-specific code must mux this setting depending
+* on TLL link using DP/DM.  Something must also
 * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED}
+* 2420: hdq_sio.usb2_tllse0 or vlynq_rx0.usb2_tllse0
+* 2430: hdq_sio.usb2_tllse0 or sdmmc2_dat0.usb2_tllse0
 */
+
syscon1 = 3;
omap2_usb2_enable_5pinunitll();
break;

--
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 12/16] omap: mux: Do keypad muxing in board-*.c files

2010-06-30 Thread Tony Lindgren
This way we get pin muxing out of plat-omap and can convert H4 to use the
new mux functions.

Note that it should be safe to assume we can mux all the keypad pins
except on H4 which may have Menelaus connected.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap1/board-fsample.c  |   12 +++
 arch/arm/mach-omap1/board-h2.c   |   13 +++
 arch/arm/mach-omap1/board-h3.c   |   13 +++
 arch/arm/mach-omap1/board-perseus2.c |   12 +++
 arch/arm/mach-omap2/board-h4.c   |   17 +
 arch/arm/plat-omap/devices.c |   61 --
 6 files changed, 67 insertions(+), 61 deletions(-)

diff --git a/arch/arm/mach-omap1/board-fsample.c 
b/arch/arm/mach-omap1/board-fsample.c
index 096f2ed..405ff7a 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -292,6 +292,18 @@ static void __init omap_fsample_init(void)
omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
 
+   /* Mux pins for keypad */
+   omap_cfg_reg(E2_7XX_KBR0);
+   omap_cfg_reg(J7_7XX_KBR1);
+   omap_cfg_reg(E1_7XX_KBR2);
+   omap_cfg_reg(F3_7XX_KBR3);
+   omap_cfg_reg(D2_7XX_KBR4);
+   omap_cfg_reg(C2_7XX_KBC0);
+   omap_cfg_reg(D3_7XX_KBC1);
+   omap_cfg_reg(E4_7XX_KBC2);
+   omap_cfg_reg(F4_7XX_KBC3);
+   omap_cfg_reg(E3_7XX_KBC4);
+
platform_add_devices(devices, ARRAY_SIZE(devices));
 
omap_board_config = fsample_config;
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 5f30188..ee46974 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -437,6 +437,19 @@ static void __init h2_init(void)
/* omap_cfg_reg(U19_ARMIO1); */ /* CD */
omap_cfg_reg(BALLOUT_V8_ARMIO3);/* WP */
 
+   /* Mux pins for keypad */
+   omap_cfg_reg(F18_1610_KBC0);
+   omap_cfg_reg(D20_1610_KBC1);
+   omap_cfg_reg(D19_1610_KBC2);
+   omap_cfg_reg(E18_1610_KBC3);
+   omap_cfg_reg(C21_1610_KBC4);
+   omap_cfg_reg(G18_1610_KBR0);
+   omap_cfg_reg(F19_1610_KBR1);
+   omap_cfg_reg(H14_1610_KBR2);
+   omap_cfg_reg(E20_1610_KBR3);
+   omap_cfg_reg(E19_1610_KBR4);
+   omap_cfg_reg(N19_1610_KBR5);
+
/* Irda */
 #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 0be1d3b..a228e9d 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -397,6 +397,19 @@ static void __init h3_init(void)
/* GPIO10 pullup/down register, Enable pullup on GPIO10 */
omap_cfg_reg(V2_1710_GPIO10);
 
+   /* Mux pins for keypad */
+   omap_cfg_reg(F18_1610_KBC0);
+   omap_cfg_reg(D20_1610_KBC1);
+   omap_cfg_reg(D19_1610_KBC2);
+   omap_cfg_reg(E18_1610_KBC3);
+   omap_cfg_reg(C21_1610_KBC4);
+   omap_cfg_reg(G18_1610_KBR0);
+   omap_cfg_reg(F19_1610_KBR1);
+   omap_cfg_reg(H14_1610_KBR2);
+   omap_cfg_reg(E20_1610_KBR3);
+   omap_cfg_reg(E19_1610_KBR4);
+   omap_cfg_reg(N19_1610_KBR5);
+
platform_add_devices(devices, ARRAY_SIZE(devices));
spi_register_board_info(h3_spi_board_info,
ARRAY_SIZE(h3_spi_board_info));
diff --git a/arch/arm/mach-omap1/board-perseus2.c 
b/arch/arm/mach-omap1/board-perseus2.c
index e854d57..5069034 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -260,6 +260,18 @@ static void __init omap_perseus2_init(void)
omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
 
+   /* Mux pins for keypad */
+   omap_cfg_reg(E2_7XX_KBR0);
+   omap_cfg_reg(J7_7XX_KBR1);
+   omap_cfg_reg(E1_7XX_KBR2);
+   omap_cfg_reg(F3_7XX_KBR3);
+   omap_cfg_reg(D2_7XX_KBR4);
+   omap_cfg_reg(C2_7XX_KBC0);
+   omap_cfg_reg(D3_7XX_KBC1);
+   omap_cfg_reg(E4_7XX_KBC2);
+   omap_cfg_reg(F4_7XX_KBC3);
+   omap_cfg_reg(E3_7XX_KBC4);
+
platform_add_devices(devices, ARRAY_SIZE(devices));
 
omap_board_config = perseus2_config;
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 8c58f51..cdcd4fb 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -363,11 +363,28 @@ static void __init omap_h4_init(void)
 #endif
 
 #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
+   omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP);
+   omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP);
+   omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP);
+   omap_mux_init_signal(mcbsp2_dr.gpio_11, OMAP_PULL_ENA | OMAP_PULL_UP);
if (omap_has_menelaus()) {
+   omap_mux_init_signal(sdrc_a14.gpio0,
+   OMAP_PULL_ENA | 

[PATCH 13/16] omap: mux: Mux Apollon LCD power in board-apollon.c

2010-06-30 Thread Tony Lindgren
Use the new mux function for that.

Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Tomi Valkeinen tomi.valkei...@nokia.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-apollon.c |3 +++
 drivers/video/omap/lcd_apollon.c|3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/board-apollon.c 
b/arch/arm/mach-omap2/board-apollon.c
index b86a879..bc67026 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -332,6 +332,9 @@ static void __init omap_apollon_init(void)
/* REVISIT: where's the correct place */
omap_cfg_reg(W19_24XX_SYS_NIRQ);
 
+   /* LCD PWR_EN */
+   omap_mux_init_signal(mcbsp2_dr.gpio_11, OMAP_PULL_ENA | OMAP_PULL_UP);
+
/* Use Interal loop-back in MMC/SDIO Module Input Clock selection */
v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
v |= (1  24);
diff --git a/drivers/video/omap/lcd_apollon.c b/drivers/video/omap/lcd_apollon.c
index 2be94eb..10459d8 100644
--- a/drivers/video/omap/lcd_apollon.c
+++ b/drivers/video/omap/lcd_apollon.c
@@ -25,7 +25,6 @@
 #include linux/platform_device.h
 
 #include mach/gpio.h
-#include plat/mux.h
 
 #include omapfb.h
 
@@ -34,8 +33,6 @@
 static int apollon_panel_init(struct lcd_panel *panel,
struct omapfb_device *fbdev)
 {
-   /* configure LCD PWR_EN */
-   omap_cfg_reg(M21_242X_GPIO11);
return 0;
 }
 

--
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 14/16] omap: mux: Mux 2430 USB0HS_STP in board-2430.c

2010-06-30 Thread Tony Lindgren
Use new mux functions for that. There are no other known 2430 boards
that need this mux.

Cc: Felipe Balbi felipe.ba...@nokia.com
Cc: David Brownell dbrown...@users.sourceforge.net
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-2430sdp.c |4 +++-
 drivers/usb/musb/omap2430.c |4 
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
b/arch/arm/mach-omap2/board-2430sdp.c
index 281aa13..71bf509 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -31,7 +31,6 @@
 #include asm/mach/map.h
 
 #include mach/gpio.h
-#include plat/mux.h
 #include plat/board.h
 #include plat/common.h
 #include plat/gpmc.h
@@ -238,7 +237,10 @@ static void __init omap_2430sdp_init(void)
omap_serial_init();
omap2_hsmmc_init(mmc);
omap2_usbfs_init(sdp2430_usb_config);
+
+   omap_mux_init_signal(usb0hs_stp, OMAP_PULL_ENA | OMAP_PULL_UP);
usb_musb_init(musb_board_data);
+
board_smc91x_init();
 
/* Turn off secondary LCD backlight */
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index e06d65e..5f04d3f 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -194,10 +194,6 @@ int __init musb_platform_init(struct musb *musb, void 
*board_data)
u32 l;
struct omap_musb_board_data *data = board_data;
 
-#if defined(CONFIG_ARCH_OMAP2430)
-   omap_cfg_reg(AE5_2430_USB0HS_STP);
-#endif
-
/* We require some kind of external transceiver, hooked
 * up through ULPI.  TWL4030-family PMICs include one,
 * which needs a driver, drivers aren't always needed.

--
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 16/16] omap: mux: Remove old mux code

2010-06-30 Thread Tony Lindgren
All mach-omap2 omaps should now use the new mux code.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-3630sdp.c  |1 
 arch/arm/mach-omap2/board-generic.c  |1 
 arch/arm/mach-omap2/board-rx51-peripherals.c |1 
 arch/arm/mach-omap2/board-rx51-video.c   |1 
 arch/arm/mach-omap2/io.c |2 
 arch/arm/mach-omap2/mux.c|  298 --
 arch/arm/mach-omap2/pm24xx.c |1 
 arch/arm/mach-omap2/usb-ehci.c   |1 
 arch/arm/mach-omap2/usb-musb.c   |1 
 arch/arm/plat-omap/include/plat/mux.h|  220 ---
 arch/arm/plat-omap/mux.c |2 
 11 files changed, 1 insertions(+), 528 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3630sdp.c 
b/arch/arm/mach-omap2/board-3630sdp.c
index 504d2bd..f267dc0 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -18,7 +18,6 @@
 #include plat/common.h
 #include plat/board.h
 #include plat/gpmc-smc91x.h
-#include plat/mux.h
 #include plat/usb.h
 
 #include mach/board-zoom.h
diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 16cc068..9a7f790 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -26,7 +26,6 @@
 #include asm/mach/map.h
 
 #include mach/gpio.h
-#include plat/mux.h
 #include plat/usb.h
 #include plat/board.h
 #include plat/common.h
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index abdf321..5ddf156 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -25,7 +25,6 @@
 #include linux/mmc/host.h
 
 #include plat/mcspi.h
-#include plat/mux.h
 #include plat/board.h
 #include plat/common.h
 #include plat/dma.h
diff --git a/arch/arm/mach-omap2/board-rx51-video.c 
b/arch/arm/mach-omap2/board-rx51-video.c
index b743a4f..5a1005b 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -16,7 +16,6 @@
 #include linux/mm.h
 
 #include asm/mach-types.h
-#include plat/mux.h
 #include plat/display.h
 #include plat/vram.h
 #include plat/mcspi.h
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 3cfb425..b12d715 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -28,7 +28,6 @@
 
 #include asm/mach/map.h
 
-#include plat/mux.h
 #include plat/sram.h
 #include plat/sdrc.h
 #include plat/gpmc.h
@@ -324,7 +323,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params 
*sdrc_cs0,
omap2430_hwmod_init();
else if (cpu_is_omap34xx())
omap3xxx_hwmod_init();
-   omap2_mux_init();
/* The OPP tables have to be registered before a clk init */
omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
 
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 197e295..be52fab 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -37,7 +37,6 @@
 #include asm/system.h
 
 #include plat/control.h
-#include plat/mux.h
 
 #include mux.h
 
@@ -78,301 +77,6 @@ void omap_mux_write_array(struct omap_board_mux *board_mux)
}
 }
 
-#if defined(CONFIG_ARCH_OMAP2)  defined(CONFIG_OMAP_MUX)
-
-static struct omap_mux_cfg arch_mux_cfg;
-
-/* NOTE: See mux.h for the enumeration */
-
-static struct pin_config __initdata_or_module omap24xx_pins[] = {
-/*
- * description mux mux pullpulldebug
- * offset  modeena type
- */
-
-/* 24xx I2C */
-MUX_CFG_24XX(M19_24XX_I2C1_SCL,  0x111,  0,  0,  0,  1)
-MUX_CFG_24XX(L15_24XX_I2C1_SDA,  0x112,  0,  0,  0,  1)
-MUX_CFG_24XX(J15_24XX_I2C2_SCL,  0x113,  0,  0,  1,  1)
-MUX_CFG_24XX(H19_24XX_I2C2_SDA,  0x114,  0,  0,  0,  1)
-
-/* Menelaus interrupt */
-MUX_CFG_24XX(W19_24XX_SYS_NIRQ,  0x12c,  0,  1,  1,  1)
-
-/* 24xx clocks */
-MUX_CFG_24XX(W14_24XX_SYS_CLKOUT,0x137,  0,  1,  1,  1)
-
-/* 24xx GPMC chipselects, wait pin monitoring */
-MUX_CFG_24XX(E2_GPMC_NCS2,   0x08e,  0,  1,  1,  1)
-MUX_CFG_24XX(L2_GPMC_NCS7,   0x093,  0,  1,  1,  1)
-MUX_CFG_24XX(L3_GPMC_WAIT0,  0x09a,  0,  1,  1,  1)
-MUX_CFG_24XX(N7_GPMC_WAIT1,  0x09b,  0,  1,  1,  1)
-MUX_CFG_24XX(M1_GPMC_WAIT2,  0x09c,  0,  1,  1,  1)
-MUX_CFG_24XX(P1_GPMC_WAIT3,  0x09d,  0,  1,  1,  1)
-
-/* 24xx McBSP */
-MUX_CFG_24XX(Y15_24XX_MCBSP2_CLKX,   0x124,  1,  1,  0,  1)
-MUX_CFG_24XX(R14_24XX_MCBSP2_FSX,0x125,  1,  1,  0,  1)
-MUX_CFG_24XX(W15_24XX_MCBSP2_DR, 0x126,  1,  1,  0,  1)
-MUX_CFG_24XX(V15_24XX_MCBSP2_DX, 0x127,  1,  1,  0,  1)
-
-/* 

Re: [PATCH 14/16] omap: mux: Mux 2430 USB0HS_STP in board-2430.c

2010-06-30 Thread Felipe Balbi

hi,

On Wed, Jun 30, 2010 at 02:07:23PM +0200, ext Tony Lindgren wrote:

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index e06d65e..5f04d3f 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -194,10 +194,6 @@ int __init musb_platform_init(struct musb *musb, void 
*board_data)
u32 l;
struct omap_musb_board_data *data = board_data;

-#if defined(CONFIG_ARCH_OMAP2430)
-   omap_cfg_reg(AE5_2430_USB0HS_STP);
-#endif


there's a patch from Anand taking care of this hunk, could you send only 
the hunk on board-2430sdp.c ?


this part on omap2430.c will go on next merge window.

--
balbi

DefectiveByDesign.org
--
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 14/16] omap: mux: Mux 2430 USB0HS_STP in board-2430.c

2010-06-30 Thread Tony Lindgren
* Felipe Balbi felipe.ba...@nokia.com [100630 15:26]:
 hi,
 
 On Wed, Jun 30, 2010 at 02:07:23PM +0200, ext Tony Lindgren wrote:
 diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
 index e06d65e..5f04d3f 100644
 --- a/drivers/usb/musb/omap2430.c
 +++ b/drivers/usb/musb/omap2430.c
 @@ -194,10 +194,6 @@ int __init musb_platform_init(struct musb *musb, void 
 *board_data)
  u32 l;
  struct omap_musb_board_data *data = board_data;
 
 -#if defined(CONFIG_ARCH_OMAP2430)
 -omap_cfg_reg(AE5_2430_USB0HS_STP);
 -#endif
 
 there's a patch from Anand taking care of this hunk, could you send
 only the hunk on board-2430sdp.c ?
 
 this part on omap2430.c will go on next merge window.

OK, updated patch below.

Regards,

Tony
From: Tony Lindgren t...@atomide.com
Date: Wed, 30 Jun 2010 13:39:43 +0300
Subject: [PATCH] omap: mux: Mux 2430 USB0HS_STP in board-2430.c

Use new mux functions for that. There are no other known 2430 boards
that need this mux.

Cc: Felipe Balbi felipe.ba...@nokia.com
Cc: David Brownell dbrown...@users.sourceforge.net
Signed-off-by: Tony Lindgren t...@atomide.com

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 281aa13..71bf509 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -31,7 +31,6 @@
 #include asm/mach/map.h
 
 #include mach/gpio.h
-#include plat/mux.h
 #include plat/board.h
 #include plat/common.h
 #include plat/gpmc.h
@@ -238,7 +237,10 @@ static void __init omap_2430sdp_init(void)
 	omap_serial_init();
 	omap2_hsmmc_init(mmc);
 	omap2_usbfs_init(sdp2430_usb_config);
+
+	omap_mux_init_signal(usb0hs_stp, OMAP_PULL_ENA | OMAP_PULL_UP);
 	usb_musb_init(musb_board_data);
+
 	board_smc91x_init();
 
 	/* Turn off secondary LCD backlight */


Re: [PATCH 1/2] arm: Replace CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6

2010-06-30 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [100630 14:02]:
 * Nicolas Pitre n...@fluxnic.net [100629 22:14]:
 
 Updated patch below.

And a bug crept in..

 + .macro set_tls_v6, tp, tmp1, tmp2
 + ldr \tmp1, =elf_hwcap
 + ldr \tmp1, [\tmp1, #0]
 + mov \tmp2, #0x0fff
 + tst \tmp2, #HWCAP_TLS   @ hardware TLS available?
 + mcrne   p15, 0, \tp, c13, c0, 3 @ yes, set TLS register
 + streq   \tp, [\tmp2, #-15]  @ set TLS value at 0x0ff0
 + .endm

The tst \tmp2, #HWCAP_TLS should of course use \tmp1.

Also fixed a warning about adding parentheses around comparison
if (id  0x410f) != 0x4107).

Again, updated patch below.

Tony
From 248ee34cd03cb4f0040445d0e07831f4227f13e3 Mon Sep 17 00:00:00 2001
From: Tony Lindgren t...@atomide.com
Date: Tue, 29 Jun 2010 13:34:53 +0300
Subject: [PATCH] arm: Replace CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6

The TLS register is only available on ARM1136 r1p0 and later.
Set HWCAP_TLS flags if hardware TLS is available and test for
it if CONFIG_CPU_32v6K is not set for V6.

Note that we set the TLS instruction in __kuser_get_tls
dynamically as suggested by Jamie Lokier ja...@shareable.org.

Also the __switch_to code is optimized out in most cases as
suggested by Nicolas Pitre n...@fluxnic.net.

Signed-off-by: Tony Lindgren t...@atomide.com

diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
index f7bd52b..c1062c3 100644
--- a/arch/arm/include/asm/hwcap.h
+++ b/arch/arm/include/asm/hwcap.h
@@ -19,6 +19,7 @@
 #define HWCAP_NEON	4096
 #define HWCAP_VFPv3	8192
 #define HWCAP_VFPv3D16	16384
+#define HWCAP_TLS	32768
 
 #if defined(__KERNEL__)  !defined(__ASSEMBLY__)
 /*
diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
new file mode 100644
index 000..e565f33
--- /dev/null
+++ b/arch/arm/include/asm/tls.h
@@ -0,0 +1,46 @@
+#ifndef __ASMARM_TLS_H
+#define __ASMARM_TLS_H
+
+#ifdef __ASSEMBLY__
+	.macro set_tls_none, tp, tmp1, tmp2
+	.endm
+
+	.macro set_tls_v6k, tp, tmp1, tmp2
+	mcr	p15, 0, \tp, c13, c0, 3		@ set TLS register
+	.endm
+
+	.macro set_tls_v6, tp, tmp1, tmp2
+	ldr	\tmp1, =elf_hwcap
+	ldr	\tmp1, [\tmp1, #0]
+	mov	\tmp2, #0x0fff
+	tst	\tmp1, #HWCAP_TLS		@ hardware TLS available?
+	mcrne	p15, 0, \tp, c13, c0, 3		@ yes, set TLS register
+	streq	\tp, [\tmp2, #-15]		@ set TLS value at 0x0ff0
+	.endm
+
+	.macro set_tls_software, tp, tmp1, tmp2
+	mov	\tmp1, #0x0fff
+	str	\tp, [\tmp1, #-15]		@ set TLS value at 0x0ff0
+	.endm
+#endif
+
+#ifdef CONFIG_TLS_REG_EMUL
+#define tls_emu		1
+#define has_tls		1
+#define set_tls		set_tls_none
+#elif __LINUX_ARM_ARCH__ = 7 ||	\
+	(__LINUX_ARM_ARCH__ == 6  defined(CONFIG_CPU_32v6K))
+#define tls_emu		0
+#define has_tls		1
+#define set_tls		set_tls_v6k
+#elif __LINUX_ARM_ARCH__ == 6
+#define tls_emu		0
+#define has_tls		(elf_hwcap  HWCAP_TLS)
+#define set_tls		set_tls_v6
+#else
+#define tls_emu		0
+#define has_tls		0
+#define set_tls		set_tls_software
+#endif
+
+#endif	/* __ASMARM_TLS_H */
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 7ee48e7..a6cfb17 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -22,6 +22,7 @@
 #include asm/thread_notify.h
 #include asm/unwind.h
 #include asm/unistd.h
+#include asm/tls.h
 
 #include entry-header.S
 
@@ -739,12 +740,7 @@ ENTRY(__switch_to)
 #ifdef CONFIG_MMU
 	ldr	r6, [r2, #TI_CPU_DOMAIN]
 #endif
-#if defined(CONFIG_HAS_TLS_REG)
-	mcr	p15, 0, r3, c13, c0, 3		@ set TLS register
-#elif !defined(CONFIG_TLS_REG_EMUL)
-	mov	r4, #0x0fff
-	str	r3, [r4, #-15]			@ TLS val at 0x0ff0
-#endif
+	set_tls	r3, r4, r5
 #ifdef CONFIG_MMU
 	mcr	p15, 0, r6, c3, c0, 0		@ Set domain register
 #endif
@@ -1009,17 +1005,12 @@ kuser_cmpxchg_fixup:
  */
 
 __kuser_get_tls:@ 0x0fe0
-
-#if !defined(CONFIG_HAS_TLS_REG)  !defined(CONFIG_TLS_REG_EMUL)
-	ldr	r0, [pc, #(16 - 8)]		@ TLS stored at 0x0ff0
-#else
-	mrc	p15, 0, r0, c13, c0, 3		@ read TLS register
-#endif
+	ldr	r0, [pc, #(16 - 8)]	@ read TLS, set in kuser_get_tls_init
 	usr_ret	lr
-
-	.rep	5
-	.word	0			@ pad up to __kuser_helper_version
-	.endr
+	mrc	p15, 0, r0, c13, c0, 3	@ 0x0fe8 hardware TLS code
+	.rep	4
+	.word	0			@ 0x0ff0 software TLS value, then
+	.endr@ pad up to __kuser_helper_version
 
 /*
  * Reference declaration:
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 122d999..6e2c6f9 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -269,6 +269,21 @@ static void __init cacheid_init(void)
 extern struct proc_info_list *lookup_processor_type(unsigned int);
 extern struct machine_desc *lookup_machine_type(unsigned int);
 
+static void __init feat_v6_fixup(void)
+{
+	int id = read_cpuid_id();
+
+	if ((id  0x410f) != 0x4107)
+		return;
+
+	/*
+	 * HWCAP_TLS is available only on 1136 r1p0 and later,
+	 * see also kuser_get_tls_init.
+	 */
+	if id  4)  0xfff) == 0xb36)  (((id  

[PATCH 1/2] OMAP4: Add GPIO LED support

2010-06-30 Thread Hemanth V
From c17be0bcb4c92df5b5aabdad9034ff7ef427f618 Mon Sep 17 00:00:00 2001
From: Hemanth V heman...@ti.com
Date: Wed, 30 Jun 2010 18:03:09 +0530
Subject: [PATCH] OMAP4: Add GPIO LED support

This patch adds support for GPIO LEDs present on OMAP4
SDP and Blaze boards. This basically adds platform data
required by leds-gpio driver

Signed-off-by: Hemanth V heman...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   50 +++
 1 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 4bb2c5d..b213032 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -21,6 +21,7 @@
 #include linux/spi/spi.h
 #include linux/i2c/twl.h
 #include linux/regulator/machine.h
+#include linux/leds.h

 #include mach/hardware.h
 #include mach/omap4-common.h
@@ -40,6 +41,54 @@
 #define ETH_KS8851_POWER_ON48
 #define ETH_KS8851_QUART   138

+static struct gpio_led sdp4430_gpio_leds[] = {
+   {
+   .name   = omap4:green:debug0,
+   .gpio   = 61,
+   },
+   {
+   .name   = omap4:green:debug1,
+   .gpio   = 30,
+   },
+   {
+   .name   = omap4:green:debug2,
+   .gpio   = 7,
+   },
+   {
+   .name   = omap4:green:debug3,
+   .gpio   = 8,
+   },
+   {
+   .name   = omap4:green:debug4,
+   .gpio   = 50,
+   },
+   {
+   .name   = omap4:blue:user,
+   .gpio   = 169,
+   },
+   {
+   .name   = omap4:red:user,
+   .gpio   = 170,
+   },
+   {
+   .name   = omap4:green:user,
+   .gpio   = 139,
+   },
+
+};
+
+static struct gpio_led_platform_data sdp4430_led_data = {
+   .leds   = sdp4430_gpio_leds,
+   .num_leds   = ARRAY_SIZE(sdp4430_gpio_leds),
+};
+
+static struct platform_device sdp4430_leds_gpio = {
+   .name   = leds-gpio,
+   .id = -1,
+   .dev= {
+   .platform_data = sdp4430_led_data,
+   },
+};
 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
{
.modalias   = ks8851,
@@ -112,6 +161,7 @@ static struct platform_device sdp4430_lcd_device = {

 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_lcd_device,
+   sdp4430_leds_gpio,
 };

 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
-- 
1.5.6.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 2/2] OMAP4: Add support for PWM LED

2010-06-30 Thread Hemanth V
From 713727188b99465341767eedaa42004862261211 Mon Sep 17 00:00:00 2001
From: Hemanth V heman...@ti.com
Date: Wed, 30 Jun 2010 18:16:33 +0530
Subject: [PATCH] OMAP4: Add support for PWM LED

TWL6030 supports PWM (Pulse Width Modulator) which is used
to control charging LED. This allows for controlling brightness
This patch implements the APIs needed by leds-pwm driver.

Signed-off-by: Hemanth V heman...@ti.com
---
 arch/arm/mach-omap2/Kconfig |1 +
 arch/arm/mach-omap2/Makefile|2 +
 arch/arm/mach-omap2/board-4430sdp.c |   25 +
 arch/arm/mach-omap2/twl6030_pwm.c   |  168 +++
 4 files changed, 196 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/twl6030_pwm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b31b6f1..da10997 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -156,6 +156,7 @@ config MACH_OMAP_3630SDP
 config MACH_OMAP_4430SDP
bool OMAP 4430 SDP board
depends on ARCH_OMAP4
+   select HAVE_PWM

 config OMAP3_EMU
bool OMAP3 debugging peripherals
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 6c6d7c6..778affc 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -161,3 +161,5 @@ obj-y   += $(nand-m) 
$(nand-y)

 smc91x-$(CONFIG_SMC91X):= gpmc-smc91x.o
 obj-y  += $(smc91x-m) $(smc91x-y)
+
+obj-$(CONFIG_LEDS_PWM) += twl6030_pwm.o
diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index b213032..b901b9d 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -22,6 +22,7 @@
 #include linux/i2c/twl.h
 #include linux/regulator/machine.h
 #include linux/leds.h
+#include linux/leds_pwm.h

 #include mach/hardware.h
 #include mach/omap4-common.h
@@ -89,6 +90,29 @@ static struct platform_device sdp4430_leds_gpio = {
.platform_data = sdp4430_led_data,
},
 };
+
+static struct led_pwm sdp4430_pwm_leds[] = {
+   {
+   .name = omap4:green:chrg,
+   .pwm_id = 1,
+   .max_brightness = 255,
+   .pwm_period_ns = 7812500,
+   },
+};
+
+static struct led_pwm_platform_data sdp4430_pwm_data = {
+   .num_leds = 1,
+   .leds = sdp4430_pwm_leds,
+};
+
+static struct platform_device sdp4430_leds_pwm = {
+   .name   = leds_pwm,
+   .id = -1,
+   .dev= {
+   .platform_data = sdp4430_pwm_data,
+   },
+};
+
 static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
{
.modalias   = ks8851,
@@ -162,6 +186,7 @@ static struct platform_device sdp4430_lcd_device = {
 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_lcd_device,
sdp4430_leds_gpio,
+   sdp4430_leds_pwm,
 };

 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
diff --git a/arch/arm/mach-omap2/twl6030_pwm.c 
b/arch/arm/mach-omap2/twl6030_pwm.c
new file mode 100644
index 000..5140a92
--- /dev/null
+++ b/arch/arm/mach-omap2/twl6030_pwm.c
@@ -0,0 +1,168 @@
+/*
+ * twl6030_pwm.c
+ * Driver for PHOENIX (TWL6030) Pulse Width Modulator
+ *
+ * Copyright (C) 2010 Texas Instruments
+ * Author: Hemanth V heman...@ti.com
+ *
+ * This program 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 program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; 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, see http://www.gnu.org/licenses/.
+ */
+
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/i2c/twl.h
+#include linux/slab.h
+
+#define LED_PWM_CTRL1  0xF4
+#define LED_PWM_CTRL2  0xF5
+
+/* Max value for CTRL1 register */
+#define PWM_CTRL1_MAX  255
+
+/* Pull down disable */
+#define PWM_CTRL2_DIS_PD   (1  6)
+
+/* Current control 0, 1, 2.5, 5 mA */
+#define PWM_CTRL2_CURR_00  (0  4)
+#define PWM_CTRL2_CURR_01  (1  4)
+#define PWM_CTRL2_CURR_02  (2  4)
+#define PWM_CTRL2_CURR_05  (3  4)
+
+/* LED supply source */
+#define PWM_CTRL2_SRC_VBUS (0  2)
+#define PWM_CTRL2_SRC_VAC  (1  2)
+#define PWM_CTRL2_SRC_EXT  (2  2)
+
+/* LED modes */
+#define PWM_CTRL2_MODE_HW  (0  0)
+#define PWM_CTRL2_MODE_SW  (1  0)
+#define PWM_CTRL2_MODE_DIS (2  0)
+
+#define PWM_CTRL2_MODE_MASK0x3
+
+struct pwm_device {
+   const char *label;
+   unsigned int pwm_id;
+};
+
+int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
+{
+   u8 duty_cycle;
+  

[PATCH] OMAP:DSS2:OMAPFB: Fix probe error path

2010-06-30 Thread Afzal Mohammed
If enabling fb0 fails in omapfb_create_framebuffers(), remove
sysfs file before returning to probe. This is required to complete
the cleanup in the above mentioned error case.

Signed-off-by: Afzal Mohammed lazfa...@gmail.com
---
 drivers/video/omap2/omapfb/omapfb-main.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c 
b/drivers/video/omap2/omapfb/omapfb-main.c
index 4b4506d..2319b81 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1945,6 +1945,7 @@ static int omapfb_create_framebuffers(struct 
omapfb2_device *fbdev)
r = omapfb_overlay_enable(ovl, 1);
 
if (r) {
+   omapfb_remove_sysfs(fbdev);
dev_err(fbdev-dev,
failed to enable overlay\n);
return r;
-- 
1.7.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


[RFC][PATCH 1/1] ARM: Add initial hibernation support

2010-06-30 Thread Hiroshi DOYU
From: Hiroshi DOYU hiroshi.d...@nokia.com

Hibernation (a.k.a: Suspend-To-Disk) support for ARM

Based on the original work from Romit and Raghu at TI. The original
patch(*1) was sent to LOML by Teerth Reddy tee...@ti.com

*1: https://patchwork.kernel.org/patch/96442/

Signed-off-by: Hiroshi DOYU hiroshi.d...@nokia.com
---
 arch/arm/Kconfig|4 +
 arch/arm/include/asm/memory.h   |1 +
 arch/arm/include/asm/suspend.h  |6 +
 arch/arm/kernel/Makefile|1 +
 arch/arm/kernel/hibernate.c |  234 +++
 arch/arm/kernel/hibernate_asm.S |  135 ++
 arch/arm/kernel/vmlinux.lds.S   |3 +-
 7 files changed, 383 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/suspend.h
 create mode 100644 arch/arm/kernel/hibernate.c
 create mode 100644 arch/arm/kernel/hibernate_asm.S

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1f254bd..c19a206 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -189,6 +189,10 @@ config VECTORS_BASE
help
  The base address of exception vectors.
 
+config ARCH_HIBERNATION_POSSIBLE
+   def_bool y
+   depends on CPU_V7  !SMP
+
 source init/Kconfig
 
 source kernel/Kconfig.freezer
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 4312ee5..cd49706 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -194,6 +194,7 @@ static inline void *phys_to_virt(unsigned long x)
  */
 #define __pa(x)__virt_to_phys((unsigned long)(x))
 #define __va(x)((void *)__phys_to_virt((unsigned 
long)(x)))
+#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
 #define pfn_to_kaddr(pfn)  __va((pfn)  PAGE_SHIFT)
 
 /*
diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
new file mode 100644
index 000..8857c79
--- /dev/null
+++ b/arch/arm/include/asm/suspend.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARM_SUSPEND_H
+#define __ASM_ARM_SUSPEND_H
+
+static inline int arch_prepare_suspend(void) { return 0; }
+
+#endif /* __ASM_ARM_SUSPEND_H */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 26d302c..38a0b10 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
 obj-$(CONFIG_KGDB) += kgdb.o
 obj-$(CONFIG_ARM_UNWIND)   += unwind.o
 obj-$(CONFIG_HAVE_TCM) += tcm.o
+obj-$(CONFIG_HIBERNATION)   += hibernate.o hibernate_asm.o
 
 obj-$(CONFIG_CRUNCH)   += crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o   := -Wa,-mcpu=ep9312
diff --git a/arch/arm/kernel/hibernate.c b/arch/arm/kernel/hibernate.c
new file mode 100644
index 000..692c720
--- /dev/null
+++ b/arch/arm/kernel/hibernate.c
@@ -0,0 +1,234 @@
+/*
+ * Hibernation support specific for ARM
+ *
+ * Copyright (C) 2010 Nokia Corporation
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Copyright (C) 2006 Rafael J. Wysocki r...@sisk.pl
+ *
+ * Contact: Hiroshi DOYU hiroshi.d...@nokia.com
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#include linux/module.h
+#include linux/mm.h
+
+/*
+ * Image of the saved processor state
+ *
+ * coprocessor 15 registers(RW)
+ */
+struct saved_context {
+/*
+ * FIXME: Only support for Cortex A8 now
+ */
+   /* CR0 */
+   u32 cssr;   /* Cache Size Selection */
+   /* CR1 */
+   u32 cr; /* Control */
+   u32 cacr;   /* Coprocessor Access Control */
+   /* CR2 */
+   u32 ttb_0r; /* Translation Table Base 0 */
+   u32 ttb_1r; /* Translation Table Base 1 */
+   u32 ttbcr;  /* Translation Talbe Base Control */
+   /* CR3 */
+   u32 dacr;   /* Domain Access Control */
+   /* CR5 */
+   u32 d_fsr;  /* Data Fault Status */
+   u32 i_fsr;  /* Instruction Fault Status */
+   u32 d_afsr; /* Data Auxilirary Fault Status */   ;
+   u32 i_afsr; /* Instruction Auxilirary Fault Status */;
+   /* CR6 */
+   u32 d_far;  /* Data Fault Address */
+   u32 i_far;  /* Instruction Fault Address */
+   /* CR7 */
+   u32 par;/* Physical Address */
+   /* CR9 */   /* FIXME: Are they necessary? */
+   u32 pmcontrolr; /* Performance Monitor Control */
+   u32 cesr;   /* Count Enable Set */
+   u32 cecr;   /* Count Enable Clear */
+   u32 ofsr;   /* Overflow Flag Status */
+   u32 sir;/* Software Increment */
+   u32 pcsr;   /* Performance Counter Selection */
+   u32 ccr;/* Cycle Count */
+   u32 esr;/* Event Selection */
+   u32 pmcountr;   /* Performance Monitor Count */
+   u32 uer;/* User Enable */
+   u32 iesr;   /* Interrupt Enable Set */
+   u32 iecr;   /* Interrupt Enable Clear */
+   u32 l2clr;  /* L2 Cache Lockdown */
+   /* CR10 */
+   u32 

[RFC][PATCH 0/1] ARM: Add initial hibernation support

2010-06-30 Thread Hiroshi DOYU
This is the experimental patch to add hibernation (a.k.a:
Suspend-To-Disk) support for ARM architecutre.

Presently it seems to work with OMAP3, and apparently it still needs
more efforts to make it enough stable and to support other ARM
platforms cleanly but I am sending this patch to get some feedbacks at
its early phase to find out the further direction. It would be really
appreciated if you give some comment on this.

This patch is based on the one sent to loml(*1) by Teerth Reddy, which
was originally from Romit and Raghu at TI.

*1: https://patchwork.kernel.org/patch/96442/

Hiroshi DOYU (1):
  ARM: Add initial hibernation support

 arch/arm/Kconfig|4 +
 arch/arm/include/asm/memory.h   |1 +
 arch/arm/include/asm/suspend.h  |6 +
 arch/arm/kernel/Makefile|1 +
 arch/arm/kernel/hibernate.c |  234 +++
 arch/arm/kernel/hibernate_asm.S |  135 ++
 arch/arm/kernel/vmlinux.lds.S   |3 +-
 7 files changed, 383 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/suspend.h
 create mode 100644 arch/arm/kernel/hibernate.c
 create mode 100644 arch/arm/kernel/hibernate_asm.S

--
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 1/2] arm: Replace CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6

2010-06-30 Thread Nicolas Pitre
On Wed, 30 Jun 2010, Tony Lindgren wrote:

 * Tony Lindgren t...@atomide.com [100630 14:02]:
  * Nicolas Pitre n...@fluxnic.net [100629 22:14]:
  
  Updated patch below.
 
 And a bug crept in..
 
  +   .macro set_tls_v6, tp, tmp1, tmp2
  +   ldr \tmp1, =elf_hwcap
  +   ldr \tmp1, [\tmp1, #0]
  +   mov \tmp2, #0x0fff
  +   tst \tmp2, #HWCAP_TLS   @ hardware TLS available?
  +   mcrne   p15, 0, \tp, c13, c0, 3 @ yes, set TLS register
  +   streq   \tp, [\tmp2, #-15]  @ set TLS value at 0x0ff0
  +   .endm
 
 The tst   \tmp2, #HWCAP_TLS should of course use \tmp1.
 
 Also fixed a warning about adding parentheses around comparison
 if (id  0x410f) != 0x4107).

Here you probably want (id  0xff0f) and not (id  0x410f).

 Again, updated patch below.

I like it.  However, in proc-v6.S, you don't need to add a reference to 
feat_v6_fixup() to the __pj4_v6_proc_info block.  Simply adding 
HWCAP_TLS in that case should be fine as PJ4 always has the TLS reg.

With the above fixes, you can add

Reviewed-by: Nicolas Pitre nicolas.pi...@linaro.org


Nicolas
--
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 v5 0/3] omap3 nand: cleanup exiting platform related code

2010-06-30 Thread Ghorai, Sukumar
Tony,
Please let me know if any have input on following two series. 

http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30305.html
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30735.html

Regards,
Ghorai

 -Original Message-
 From: Ghorai, Sukumar
 Sent: Tuesday, June 15, 2010 6:57 PM
 To: 'Tony Lindgren'
 Cc: linux-omap@vger.kernel.org; linux-...@lists.infradead.org;
 t...@atomide.com; m...@compulab.co.il; 'Vimal Singh'
 Subject: RE: [PATCH v5 0/3] omap3 nand: cleanup exiting platform related
 code
 
 Tony,
 
  -Original Message-
  From: Vimal Singh [mailto:vimal.neww...@gmail.com]
  Sent: Tuesday, June 08, 2010 10:43 PM
  To: Ghorai, Sukumar
  Cc: linux-omap@vger.kernel.org; linux-...@lists.infradead.org;
  t...@atomide.com; m...@compulab.co.il
  Subject: Re: [PATCH v5 0/3] omap3 nand: cleanup exiting platform related
  code
 
  Reviewed-by: Vimal Singh vimal.neww...@gmail.com
 
  On Fri, Jun 4, 2010 at 1:10 PM, Sukumar Ghorai s-gho...@ti.com wrote:
     The following set of patches applies on top of for-next branch.
          http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-
  2.6.git
     Patches verified on: omap3430-SDP, omap3630-sdp, zoom3 and beagle
  board
  
     And these are the patches required to address the following input -
       1. The NAND driver needs to stop tinkering with the GPMC registers
          The omap General Purpose Memory Controller (GPMC) registers are
  omap
          specific, and not driver specific. Tinkering with these
 registers
  can
          cause issues with the other devices on the GPMC.
  
       2. Passing hardcoded GPMC_CS0_BASE needs to go from the board
 files
          Passing hardcoded GPMC virtual addressess is sure way to mess
 up
  things.
          This should all become unnecessary once the NAND drivers stops
  messing
          with the GPMC registers directly.
       Discussion: http://www.mail-archive.com/linux-
  o...@vger.kernel.org/msg27630.html
  
     Changes in this series -
                  Unused function removed.
  
    Functions related to ecc and prefetch engine are optimized.
    v4: http://www.mail-archive.com/linux-
  o...@vger.kernel.org/msg29458.html
  
    Few functionality was missing  like - There should be some locking as
  only
     one chipselect can use the ECC or prefetch engine at a time. If you
  have
     NAND in two chipselects, bad things would happen.
    v3: http://www.mail-archive.com/linux-
  o...@vger.kernel.org/msg28715.html
  
    Additionally, it was needed to implement more functions for the
  platform
    init code to use.
    v2: http://www.mail-archive.com/linux-
  o...@vger.kernel.org/msg28467.html
  
    v1: http://www.mail-archive.com/linux-
  o...@vger.kernel.org/msg28164.html
  
  
   Sukumar Ghorai (3):
          omap3 gpmc: functionality enhancement
          omap3 nand: cleanup virtual address usages
          omap3 nand: fix issue in board file to detect nand
    arch/arm/mach-omap2/board-cm-t35.c         |   20 +---
    arch/arm/mach-omap2/board-devkit8000.c     |   25 +---
    arch/arm/mach-omap2/board-omap3beagle.c    |   24 +---
    arch/arm/mach-omap2/board-omap3touchbook.c |   25 +---
    arch/arm/mach-omap2/board-overo.c          |   24 +---
    arch/arm/mach-omap2/board-sdp-flash.c      |    5 -
    arch/arm/mach-omap2/gpmc-nand.c            |   39 ++
    arch/arm/mach-omap2/gpmc.c                 |  228
  +---
    arch/arm/plat-omap/include/plat/gpmc.h     |   36 -
    arch/arm/plat-omap/include/plat/nand.h     |    6 +-
    drivers/mtd/nand/omap2.c                   |  229 ---
 --
  ---
    11 files changed, 320 insertions(+), 341 deletions(-)
 
 [Ghorai] Any comments or input on these patch?
 
  
   --
   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
  
 
 
 
  --
  Regards,
  Vimal Singh
--
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: [pm-wip/uart][PATCH] Serial: Avoid populating uart_list in early init phase

2010-06-30 Thread Govindraj

 Your inline patch is still getting mangled somehow.  It looks like
 you're using a webmail client (SquirrelMail) that seems to be altering
 the whitespace in the patch.  The attached .zip worked fine.  Please
 spend some time figuring out how to use git send-email directly


Have been trying to setup git-send quite some time, but firewall is blocking.
Will try to get this enabled somehow.

 However, I just discovered another snag...

 I did some more testing on Zoom3 and discovered that because we do the
 HWMOD_INIT_NO_IDLE, and omap_serial_init[_port] is never called on Zoom3
 (since it only uses debug board UART) the UART hwmods are left active
 are never disabled (since they are not used.)  This prevents retention :(


Yes I was able to reproduce this as said.

But I was trying to set this option from flags field from uart_hmwod
in omap_hwmod data file as below

.flags  = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),

But strangely it doesn't work, but works only when we set the flag
from serial_early_init phase
any idea why so?

It was hitting retention for zoom2 with earlier suggested changes as
below: [ttyS3-console]

diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c
b/arch/arm/mach-omap2/board-zoom-debugboard.c
index 1d7f827..9307f58 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -96,7 +96,7 @@ static struct plat_serial8250_port serial_platform_data[] = {

 static struct platform_device zoom_debugboard_serial_device = {
.name   = serial8250,
-   .id = PLAT8250_DEV_PLATFORM,
+   .id = PLAT8250_DEV_PLATFORM + 4,
.dev= {
.platform_data  = serial_platform_data,
},
diff --git a/arch/arm/mach-omap2/board-zoom2.c
b/arch/arm/mach-omap2/board-zoom2.c
index 803ef14..c858b43 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -80,6 +80,7 @@ static struct omap_board_mux board_mux[] __initdata = {
 static void __init omap_zoom2_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+   omap_serial_init();
zoom_peripherals_init();
zoom_debugboard_init();
 }


---
Regards,
Govindraj.R
--
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 v5] OMAP: Fix for bus width which improves SD card's peformance.

2010-06-30 Thread kishore kadiyala
Hi Andrew,

If no further comments on this patch, can this be taken?

Regards,
Kishore

On Tue, Jun 15, 2010 at 1:37 PM, kishore kadiyala
kishorek.kadiy...@gmail.com wrote:
 From: Kishore Kadiyala kishore.kadiy...@ti.com

 This patch improves low speeds for SD cards.
 OMAP-MMC controller's can support maximum bus width of '8'.
 when bus width is mentioned as 8 in controller data,the SD
 stack will check whether bus width is 4 and if not it will
 set bus width to 1 and there by degrading performance.
 This patch fixes the issue and improves the performance of
 SD cards.

 Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com
 Signed-off-by: Venkatraman S svenk...@ti.com
 Signed-off-by: Nishanth Menon n...@ti.com
 Acked-by: Madhusudhan Chikkature madhu...@ti.com
 Tested-by: Jarkko Nikula jhnik...@gmail.com
 ---
 In V5 : Rebasing on 2.6.35-rc3
 In V4 : Updated with Nishanth's comments and appened his Signed-off
        http://marc.info/?t=12716914936r=1w=2
 In V3 : Updated  with Madhu's comments  and appended Tested by Nikula
 In V2 : Appended Signed-off by Venkat and Ack by Madhu

 Here are my experiment numbers, on a Class 6 SDHC card:
 Read peformance is increased by 220%
 Write Performance is increased by 52%

  drivers/mmc/host/omap_hsmmc.c |   17 +++--
  1 files changed, 15 insertions(+), 2 deletions(-)

 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
 index b032828..a0c8515 100644
 --- a/drivers/mmc/host/omap_hsmmc.c
 +++ b/drivers/mmc/host/omap_hsmmc.c
 @@ -2096,10 +2096,23 @@ static int __init omap_hsmmc_probe(struct
        mmc-caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
                     MMC_CAP_WAIT_WHILE_BUSY;

 -       if (mmc_slot(host).wires = 8)
 +       switch (mmc_slot(host).wires) {
 +       case 8:
                mmc-caps |= MMC_CAP_8_BIT_DATA;
 -       else if (mmc_slot(host).wires = 4)
 +               /* Fall through */
 +       case 4:
                mmc-caps |= MMC_CAP_4_BIT_DATA;
 +               break;
 +       case 1:
 +               /* Nothing to crib here */
 +       case 0:
 +               /* Assuming nothing was given by board, Core use's 1-Bit */
 +               break;
 +       default:
 +               /* Completely unexpected.. Core goes with 1-Bit Width */
 +               dev_crit(mmc_dev(host-mmc), Invalid width %d\n used!
 +                       using 1 instead\n, mmc_slot(host).wires);
 +       }

        if (mmc_slot(host).nonremovable)
                mmc-caps |= MMC_CAP_NONREMOVABLE;
 --
 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 03/33] Removing dead OMAP_MUX_ERRORS

2010-06-30 Thread Christoph Egger
OMAP_MUX_ERRORS doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap1/mux.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 8434137..1ddb02c 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -439,12 +439,7 @@ int __init_or_module omap1_cfg_reg(const struct pin_config 
*cfg)
   cfg-pull_name, cfg-pull_reg, pull_orig, pull);
}
 #endif
-
-#ifdef CONFIG_OMAP_MUX_ERRORS
-   return warn ? -ETXTBSY : 0;
-#else
return 0;
-#endif
 }
 
 int __init omap1_mux_init(void)
-- 
1.7.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 05/33] Removing dead OMAP_IR

2010-06-30 Thread Christoph Egger
OMAP_IR doesn't exist in Kconfig, therefore removing all references
for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap1/board-h2.c |   18 --
 arch/arm/mach-omap2/board-h4.c |4 
 2 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index d1100e4..d7640d3 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -292,15 +292,6 @@ static struct platform_device h2_kp_device = {
 
 #define H2_IRDA_FIRSEL_GPIO_PIN17
 
-#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
-static int h2_transceiver_mode(struct device *dev, int state)
-{
-   /* SIR when low, else MIR/FIR when HIGH */
-   gpio_set_value(H2_IRDA_FIRSEL_GPIO_PIN, !(state  IR_SIRMODE));
-   return 0;
-}
-#endif
-
 static struct omap_irda_config h2_irda_data = {
.transceiver_cap= IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
.rx_channel = OMAP_DMA_UART3_RX,
@@ -437,15 +428,6 @@ static void __init h2_init(void)
/* omap_cfg_reg(U19_ARMIO1); */ /* CD */
omap_cfg_reg(BALLOUT_V8_ARMIO3);/* WP */
 
-   /* Irda */
-#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
-   omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
-   if (gpio_request(H2_IRDA_FIRSEL_GPIO_PIN, IRDA mode)  0)
-   BUG();
-   gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0);
-   h2_irda_data.transceiver_mode = h2_transceiver_mode;
-#endif
-
platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
omap_board_config = h2_config;
omap_board_config_size = ARRAY_SIZE(h2_config);
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 0665f2c..ce4292b 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -345,10 +345,6 @@ static void __init omap_h4_init(void)
 * You have to mux them off in device drivers later on
 * if not needed.
 */
-#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
-   omap_cfg_reg(K15_24XX_UART3_TX);
-   omap_cfg_reg(K14_24XX_UART3_RX);
-#endif
 
 #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
if (omap_has_menelaus()) {
-- 
1.7.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 11/33] Removing dead OMAP_DSP

2010-06-30 Thread Christoph Egger
OMAP_DSP doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap1/board-nokia770.c |  132 --
 arch/arm/mach-omap1/devices.c|   37 ---
 arch/arm/mach-omap1/mcbsp.c  |3 -
 arch/arm/plat-omap/devices.c |   62 
 arch/arm/plat-omap/include/plat/dsp_common.h |   40 
 5 files changed, 0 insertions(+), 274 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/plat/dsp_common.h

diff --git a/arch/arm/mach-omap1/board-nokia770.c 
b/arch/arm/mach-omap1/board-nokia770.c
index 71e1a3f..825b4c8 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -242,138 +242,6 @@ static inline void nokia770_mmc_init(void)
 }
 #endif
 
-#ifdefined(CONFIG_OMAP_DSP)
-/*
- * audio power control
- */
-#defineHEADPHONE_GPIO  14
-#defineAMPLIFIER_CTRL_GPIO 58
-
-static struct clk *dspxor_ck;
-static DEFINE_MUTEX(audio_pwr_lock);
-/*
- * audio_pwr_state
- * +--+-+---+
- * |-1|down|power-up request - 0  |
- * +--+-+---+
- * | 0|up  |power-down(1) request - 1 |
- * |  ||power-down(2) request - (ignore)  
|
- * +--+-+---+
- * | 1|up, |power-up request - 0  |
- * |  |received down(1) request|power-down(2) request - -1
|
- * +--+-+---+
- */
-static int audio_pwr_state = -1;
-
-static inline void aic23_power_up(void)
-{
-}
-static inline void aic23_power_down(void)
-{
-}
-
-/*
- * audio_pwr_up / down should be called under audio_pwr_lock
- */
-static void nokia770_audio_pwr_up(void)
-{
-   clk_enable(dspxor_ck);
-
-   /* Turn on codec */
-   aic23_power_up();
-
-   if (gpio_get_value(HEADPHONE_GPIO))
-   /* HP not connected, turn on amplifier */
-   gpio_set_value(AMPLIFIER_CTRL_GPIO, 1);
-   else
-   /* HP connected, do not turn on amplifier */
-   printk(HP connected\n);
-}
-
-static void codec_delayed_power_down(struct work_struct *work)
-{
-   mutex_lock(audio_pwr_lock);
-   if (audio_pwr_state == -1)
-   aic23_power_down();
-   clk_disable(dspxor_ck);
-   mutex_unlock(audio_pwr_lock);
-}
-
-static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down);
-
-static void nokia770_audio_pwr_down(void)
-{
-   /* Turn off amplifier */
-   gpio_set_value(AMPLIFIER_CTRL_GPIO, 0);
-
-   /* Turn off codec: schedule delayed work */
-   schedule_delayed_work(codec_power_down_work, HZ / 20); /* 50ms */
-}
-
-static int
-nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
-{
-   mutex_lock(audio_pwr_lock);
-   if (audio_pwr_state == -1)
-   nokia770_audio_pwr_up();
-   /* force audio_pwr_state = 0, even if it was 1. */
-   audio_pwr_state = 0;
-   mutex_unlock(audio_pwr_lock);
-   return 0;
-}
-
-static int
-nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
-{
-   mutex_lock(audio_pwr_lock);
-   switch (stage) {
-   case 1:
-   if (audio_pwr_state == 0)
-   audio_pwr_state = 1;
-   break;
-   case 2:
-   if (audio_pwr_state == 1) {
-   nokia770_audio_pwr_down();
-   audio_pwr_state = -1;
-   }
-   break;
-   }
-   mutex_unlock(audio_pwr_lock);
-   return 0;
-}
-
-static struct dsp_kfunc_device nokia770_audio_device = {
-   .name= audio,
-   .type= DSP_KFUNC_DEV_TYPE_AUDIO,
-   .enable  = nokia770_audio_pwr_up_request,
-   .disable = nokia770_audio_pwr_down_request,
-};
-
-static __init int omap_dsp_init(void)
-{
-   int ret;
-
-   dspxor_ck = clk_get(0, dspxor_ck);
-   if (IS_ERR(dspxor_ck)) {
-   printk(KERN_ERR couldn't acquire dspxor_ck\n);
-   return PTR_ERR(dspxor_ck);
-   }
-
-   ret = dsp_kfunc_device_register(nokia770_audio_device);
-   if (ret) {
-   printk(KERN_ERR
-  KFUNC device registration faild: %s\n,
-  nokia770_audio_device.name);
-   goto out;
-   }
-   return 0;
- out:
-   return ret;
-}
-#else
-#define omap_dsp_init()do {} while (0)
-#endif /* CONFIG_OMAP_DSP */
-
 static void __init omap_nokia770_init(void)
 {
platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
diff --git a/arch/arm/mach-omap1/devices.c 

[PATCH 12/33] Removing dead OMAP_STI

2010-06-30 Thread Christoph Egger
OMAP_STI doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap1/devices.c |   35 -
 arch/arm/mach-omap2/devices.c |   57 -
 2 files changed, 0 insertions(+), 92 deletions(-)

diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index c00d602..aa07256 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -193,42 +193,7 @@ static inline void omap_init_spi100k(void)
 
 /*-*/
 
-#if defined(CONFIG_OMAP_STI)
-
-#define OMAP1_STI_BASE 0xfffea000
-#define OMAP1_STI_CHANNEL_BASE (OMAP1_STI_BASE + 0x400)
-
-static struct resource sti_resources[] = {
-   {
-   .start  = OMAP1_STI_BASE,
-   .end= OMAP1_STI_BASE + SZ_1K - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = OMAP1_STI_CHANNEL_BASE,
-   .end= OMAP1_STI_CHANNEL_BASE + SZ_1K - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_1610_STI,
-   .flags  = IORESOURCE_IRQ,
-   }
-};
-
-static struct platform_device sti_device = {
-   .name   = sti,
-   .id = -1,
-   .num_resources  = ARRAY_SIZE(sti_resources),
-   .resource   = sti_resources,
-};
-
-static inline void omap_init_sti(void)
-{
-   platform_device_register(sti_device);
-}
-#else
 static inline void omap_init_sti(void) {}
-#endif
 
 /*-*/
 
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 03e6c9e..b9c1f98 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -230,64 +230,7 @@ static inline void omap_init_mbox(void)
 static inline void omap_init_mbox(void) { }
 #endif /* CONFIG_OMAP_MBOX_FWK */
 
-#if defined(CONFIG_OMAP_STI)
-
-#if defined(CONFIG_ARCH_OMAP2)
-
-#define OMAP2_STI_BASE 0x48068000
-#define OMAP2_STI_CHANNEL_BASE 0x5400
-#define OMAP2_STI_IRQ  4
-
-static struct resource sti_resources[] = {
-   {
-   .start  = OMAP2_STI_BASE,
-   .end= OMAP2_STI_BASE + 0x7ff,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = OMAP2_STI_CHANNEL_BASE,
-   .end= OMAP2_STI_CHANNEL_BASE + SZ_64K - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = OMAP2_STI_IRQ,
-   .flags  = IORESOURCE_IRQ,
-   }
-};
-#elif defined(CONFIG_ARCH_OMAP3)
-
-#define OMAP3_SDTI_BASE0x5450
-#define OMAP3_SDTI_CHANNEL_BASE0x5460
-
-static struct resource sti_resources[] = {
-   {
-   .start  = OMAP3_SDTI_BASE,
-   .end= OMAP3_SDTI_BASE + 0xFFF,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = OMAP3_SDTI_CHANNEL_BASE,
-   .end= OMAP3_SDTI_CHANNEL_BASE + SZ_1M - 1,
-   .flags  = IORESOURCE_MEM,
-   }
-};
-
-#endif
-
-static struct platform_device sti_device = {
-   .name   = sti,
-   .id = -1,
-   .num_resources  = ARRAY_SIZE(sti_resources),
-   .resource   = sti_resources,
-};
-
-static inline void omap_init_sti(void)
-{
-   platform_device_register(sti_device);
-}
-#else
 static inline void omap_init_sti(void) {}
-#endif
 
 #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
 
-- 
1.7.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 13/33] Replacing LEDS_OMAP_DEBUG with OMAP_DEBUG_LEDS

2010-06-30 Thread Christoph Egger
LEDS_OMAP_DEBUG doesn't exist in Kconfig, therefore replacing all
references for it with OMAP_DEBUG_LEDS from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/plat-omap/Kconfig  |2 +-
 arch/arm/plat-omap/debug-leds.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 78b49a6..a5337c8 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -51,7 +51,7 @@ config OMAP_DEBUG_DEVICES
 config OMAP_DEBUG_LEDS
bool
depends on OMAP_DEBUG_DEVICES
-   default y if LEDS || LEDS_OMAP_DEBUG
+   default y if LEDS
 
 config OMAP_RESET_CLOCKS
bool Reset unused clocks during boot
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c
index 53fcef7..fc05b10 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -39,7 +39,7 @@ static struct h2p2_dbg_fpga __iomem   *fpga;
 static u16 led_state, hw_led_state;
 
 
-#ifdef CONFIG_LEDS_OMAP_DEBUG
+#ifdef CONFIG_OMAP_DEBUG_LEDS
 #define new_led_api()  1
 #else
 #define new_led_api()  0
-- 
1.7.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 16/33] Removing dead APM

2010-06-30 Thread Christoph Egger
APM doesn't exist in Kconfig, therefore removing all references for it
from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap1/board-palmte.c |   84 
 1 files changed, 0 insertions(+), 84 deletions(-)

diff --git a/arch/arm/mach-omap1/board-palmte.c 
b/arch/arm/mach-omap1/board-palmte.c
index 569b4c9..23bb0c9 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -213,90 +213,6 @@ static struct omap_lcd_config palmte_lcd_config __initdata 
= {
.ctrl_name  = internal,
 };
 
-#ifdef CONFIG_APM
-/*
- * Values measured in 10 minute intervals averaged over 10 samples.
- * May differ slightly from device to device but should be accurate
- * enough to give basic idea of battery life left and trigger
- * potential alerts.
- */
-static const int palmte_battery_sample[] = {
-   2194, 2157, 2138, 2120,
-   2104, 2089, 2075, 2061,
-   2048, 2038, 2026, 2016,
-   2008, 1998, 1989, 1980,
-   1970, 1958, 1945, 1928,
-   1910, 1888, 1860, 1827,
-   1791, 1751, 1709, 1656,
-};
-
-#define INTERVAL   10
-#define BATTERY_HIGH_TRESHOLD  66
-#define BATTERY_LOW_TRESHOLD   33
-
-static void palmte_get_power_status(struct apm_power_info *info, int *battery)
-{
-   int charging, batt, hi, lo, mid;
-
-   charging = !gpio_get_value(PALMTE_DC_GPIO);
-   batt = battery[0];
-   if (charging)
-   batt -= 60;
-
-   hi = ARRAY_SIZE(palmte_battery_sample);
-   lo = 0;
-
-   info-battery_flag = 0;
-   info-units = APM_UNITS_MINS;
-
-   if (batt  palmte_battery_sample[lo]) {
-   info-battery_life = 100;
-   info-time = INTERVAL * ARRAY_SIZE(palmte_battery_sample);
-   } else if (batt = palmte_battery_sample[hi - 1]) {
-   info-battery_life = 0;
-   info-time = 0;
-   } else {
-   while (hi  lo + 1) {
-   mid = (hi + lo)  1;
-   if (batt = palmte_battery_sample[mid])
-   lo = mid;
-   else
-   hi = mid;
-   }
-
-   mid = palmte_battery_sample[lo] - palmte_battery_sample[hi];
-   hi = palmte_battery_sample[lo] - batt;
-   info-battery_life = 100 - (100 * lo + 100 * hi / mid) /
-   ARRAY_SIZE(palmte_battery_sample);
-   info-time = INTERVAL * (ARRAY_SIZE(palmte_battery_sample) -
-   lo) - INTERVAL * hi / mid;
-   }
-
-   if (charging) {
-   info-ac_line_status = APM_AC_ONLINE;
-   info-battery_status = APM_BATTERY_STATUS_CHARGING;
-   info-battery_flag |= APM_BATTERY_FLAG_CHARGING;
-   } else {
-   info-ac_line_status = APM_AC_OFFLINE;
-   if (info-battery_life  BATTERY_HIGH_TRESHOLD)
-   info-battery_status = APM_BATTERY_STATUS_HIGH;
-   else if (info-battery_life  BATTERY_LOW_TRESHOLD)
-   info-battery_status = APM_BATTERY_STATUS_LOW;
-   else
-   info-battery_status = APM_BATTERY_STATUS_CRITICAL;
-   }
-
-   if (info-battery_life  BATTERY_HIGH_TRESHOLD)
-   info-battery_flag |= APM_BATTERY_FLAG_HIGH;
-   else if (info-battery_life  BATTERY_LOW_TRESHOLD)
-   info-battery_flag |= APM_BATTERY_FLAG_LOW;
-   else
-   info-battery_flag |= APM_BATTERY_FLAG_CRITICAL;
-}
-#else
-#define palmte_get_power_statusNULL
-#endif
-
 static struct omap_board_config_kernel palmte_config[] __initdata = {
{ OMAP_TAG_LCD, palmte_lcd_config },
 };
-- 
1.7.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 17/33] Removing dead SX1_OLD_FLASH

2010-06-30 Thread Christoph Egger
SX1_OLD_FLASH doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap1/board-sx1.c |   26 --
 1 files changed, 0 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 2fb1e5f..1de809d 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -295,31 +295,6 @@ static struct physmap_flash_data sx1_flash_data = {
.nr_parts   = ARRAY_SIZE(sx1_partitions),
 };
 
-#ifdef CONFIG_SX1_OLD_FLASH
-/* MTD Intel StrataFlash - old flashes */
-static struct resource sx1_old_flash_resource[] = {
-   [0] = {
-   .start  = OMAP_CS0_PHYS,/* Physical */
-   .end= OMAP_CS0_PHYS + SZ_16M - 1,,
-   .flags  = IORESOURCE_MEM,
-   },
-   [1] = {
-   .start  = OMAP_CS1_PHYS,
-   .end= OMAP_CS1_PHYS + SZ_8M - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-};
-
-static struct platform_device sx1_flash_device = {
-   .name   = physmap-flash,
-   .id = 0,
-   .dev= {
-   .platform_data  = sx1_flash_data,
-   },
-   .num_resources  = 2,
-   .resource   = sx1_old_flash_resource,
-};
-#else
 /* MTD Intel 4000 flash - new flashes */
 static struct resource sx1_new_flash_resource = {
.start  = OMAP_CS0_PHYS,
@@ -336,7 +311,6 @@ static struct platform_device sx1_flash_device = {
.num_resources  = 1,
.resource   = sx1_new_flash_resource,
 };
-#endif
 
 /*--- USB -*/
 
-- 
1.7.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 18/33] Removing dead OMAP_ARM_96MHZ

2010-06-30 Thread Christoph Egger
OMAP_ARM_96MHZ doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap1/opp_data.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap1/opp_data.c b/arch/arm/mach-omap1/opp_data.c
index 75a5465..060df86 100644
--- a/arch/arm/mach-omap1/opp_data.c
+++ b/arch/arm/mach-omap1/opp_data.c
@@ -45,9 +45,6 @@ struct mpu_rate omap1_rate_table[] = {
 #if defined(CONFIG_OMAP_ARM_120MHZ)
{ 12000, 1200, 12000, 0x010a, 0x2510 }, /* 1/1/1/2/4/4 */
 #endif
-#if defined(CONFIG_OMAP_ARM_96MHZ)
-   {  9600, 1200,  9600, 0x0005, 0x2410 }, /* 1/1/1/1/2/2 */
-#endif
 #if defined(CONFIG_OMAP_ARM_60MHZ)
{  6000, 1200,  6000, 0x0005, 0x2290 }, /* 1/1/1/1/2/2 */
 #endif
-- 
1.7.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 19/33] Removing dead MACH_OMAP_H4_OTG

2010-06-30 Thread Christoph Egger
MACH_OMAP_H4_OTG doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap2/board-h4.c |   17 -
 1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index ce4292b..85d7fb8 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -277,22 +277,6 @@ static struct omap_usb_config h4_usb_config __initdata = {
.pins[1]= 4,
 #endif
 
-#ifdef CONFIG_MACH_OMAP_H4_OTG
-   /* S1.10 ON -- USB OTG port
-* usb0 switched to Mini-AB port and isp1301 transceiver;
-* S2.POS3 = OFF, S2.POS4 = ON ... to allow battery charging
-*/
-   .otg= 1,
-   .pins[0]= 4,
-#ifdef CONFIG_USB_GADGET_OMAP
-   /* use OTG cable, or standard A-to-MiniB */
-   .hmc_mode   = 0x14, /* 0:dev/otg 1:host 2:disable */
-#elif  defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-   /* use OTG cable, or NONSTANDARD (B-to-MiniB) */
-   .hmc_mode   = 0x11, /* 0:host 1:host 2:disable */
-#endif /* XX */
-
-#else
/* S1.10 OFF -- usb download port
 * usb0 switched to Mini-B port and isp1105 transceiver;
 * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
@@ -301,7 +285,6 @@ static struct omap_usb_config h4_usb_config __initdata = {
.pins[0]= 3,
 /* .hmc_mode   = 0x14,*/   /* 0:dev 1:host 2:disable */
.hmc_mode   = 0x00, /* 0:dev|otg 1:disable 2:disable */
-#endif
 };
 
 static struct omap_board_config_kernel h4_config[] = {
-- 
1.7.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 20/33] Removing dead MACH_OMAP2_H4_USB1

2010-06-30 Thread Christoph Egger
MACH_OMAP2_H4_USB1 doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap2/board-h4.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 85d7fb8..f0c2701 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -272,11 +272,6 @@ static struct omap_lcd_config h4_lcd_config __initdata = {
 };
 
 static struct omap_usb_config h4_usb_config __initdata = {
-#ifdef CONFIG_MACH_OMAP2_H4_USB1
-   /* NOTE:  usb1 could also be used with 3 wire signaling */
-   .pins[1]= 4,
-#endif
-
/* S1.10 OFF -- usb download port
 * usb0 switched to Mini-B port and isp1105 transceiver;
 * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
-- 
1.7.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 21/33] Removing dead OMAP2_VENC_OUT_TYPE_SVIDEO, OMAP2_VENC_OUT_TYPE_COMPOSITE

2010-06-30 Thread Christoph Egger
OMAP2_VENC_OUT_TYPE_SVIDEO, OMAP2_VENC_OUT_TYPE_COMPOSITE doesn't
exist in Kconfig, therefore removing all references for it from the
source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap2/board-omap3stalker.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3stalker.c 
b/arch/arm/mach-omap2/board-omap3stalker.c
index f848ba8..b38afd5 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -181,11 +181,6 @@ static struct omap_dss_device omap3_stalker_tv_device = {
.name   = tv,
.driver_name= venc,
.type   = OMAP_DISPLAY_TYPE_VENC,
-#if defined(CONFIG_OMAP2_VENC_OUT_TYPE_SVIDEO)
-   .phy.venc.type  = OMAP_DSS_VENC_TYPE_SVIDEO,
-#elif defined(CONFIG_OMAP2_VENC_OUT_TYPE_COMPOSITE)
-   .u.venc.type= OMAP_DSS_VENC_TYPE_COMPOSITE,
-#endif
.platform_enable= omap3_stalker_enable_tv,
.platform_disable   = omap3_stalker_disable_tv,
 };
-- 
1.7.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 22/33] Removing dead MPU_{BRIDGE,TESLA}_IOMMU

2010-06-30 Thread Christoph Egger
MPU_{BRIDGE,TESLA}_IOMMU doesn't exist in Kconfig, therefore removing
all references for it from the source code.

Signed-off-by: Christoph Egger sicce...@cs.fau.de
---
 arch/arm/mach-omap2/omap-iommu.c |   22 --
 1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index eb9bee7..3aa3fe9 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -35,17 +35,6 @@ static struct iommu_device omap3_devices[] = {
.clk_name = cam_ick,
},
},
-#if defined(CONFIG_MPU_BRIDGE_IOMMU)
-   {
-   .base = 0x5d00,
-   .irq = 28,
-   .pdata = {
-   .name = iva2,
-   .nr_tlb_entries = 32,
-   .clk_name = iva2_ck,
-   },
-   },
-#endif
 };
 #define NR_OMAP3_IOMMU_DEVICES ARRAY_SIZE(omap3_devices)
 static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES];
@@ -66,17 +55,6 @@ static struct iommu_device omap4_devices[] = {
.clk_name = ducati_ick,
},
},
-#if defined(CONFIG_MPU_TESLA_IOMMU)
-   {
-   .base = OMAP4_MMU2_BASE,
-   .irq = INT_44XX_DSP_MMU,
-   .pdata = {
-   .name = tesla,
-   .nr_tlb_entries = 32,
-   .clk_name = tesla_ick,
-   },
-   },
-#endif
 };
 #define NR_OMAP4_IOMMU_DEVICES ARRAY_SIZE(omap4_devices)
 static struct platform_device *omap4_iommu_pdev[NR_OMAP4_IOMMU_DEVICES];
-- 
1.7.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


RE: [RFC][PATCH] board-omap3beagle: Remove duplicate DVI reset gpio handling

2010-06-30 Thread Aguirre, Sergio
Hi Tomi,

 -Original Message-
 From: Tomi Valkeinen [mailto:tomi.valkei...@nokia.com]
 Sent: Wednesday, June 30, 2010 3:41 AM
 To: Aguirre, Sergio
 Cc: linux-omap@vger.kernel.org; Tony Lindgren; Koen Kooi
 Subject: Re: [RFC][PATCH] board-omap3beagle: Remove duplicate DVI reset
 gpio handling
 
 On Tue, 2010-06-29 at 22:32 +0200, ext Sergio Aguirre wrote:
  Following commit missed to remove this:
 
commit 044d32ffbcb4a1d400088e3575508f46c0a9face
Author: Koen Kooi koen.k...@gmail.com
Date:   Thu Apr 22 10:23:42 2010 +0200
 
board-omap3-beagle: add DSS2 support
 
  Signed-off-by: Sergio Aguirre saagui...@ti.com
  Cc: Koen Kooi koen.k...@gmail.com
  ---
   arch/arm/mach-omap2/board-omap3beagle.c |7 ++-
   1 files changed, 2 insertions(+), 5 deletions(-)
 
  diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-
 omap2/board-omap3beagle.c
  index 7b95cc1..867a4ad 100644
  --- a/arch/arm/mach-omap2/board-omap3beagle.c
  +++ b/arch/arm/mach-omap2/board-omap3beagle.c
  @@ -169,6 +169,8 @@ static void __init beagle_display_init(void)
   {
  int r;
 
  +   omap_mux_init_gpio(beagle_dvi_device.reset_gpio, OMAP_PIN_INPUT);
 
 It's a reset gpio (actually power up/down, if I recall right), it should
 be configured as output, shouldn't it?

You're probably right :)

I just shuffled around the same code, which I guessed that works already. 
(right beagleboard guys?).

Regards,
Sergio

 
  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: [PATCH 22/33] Removing dead MPU_{BRIDGE,TESLA}_IOMMU

2010-06-30 Thread Hiroshi DOYU
From: ext Christoph Egger sicce...@cs.fau.de
Subject: [PATCH 22/33] Removing dead MPU_{BRIDGE,TESLA}_IOMMU
Date: Wed, 30 Jun 2010 18:01:01 +0200

 MPU_{BRIDGE,TESLA}_IOMMU doesn't exist in Kconfig, therefore removing
 all references for it from the source code.

Coming soon, I guess. Hari?

 Signed-off-by: Christoph Egger sicce...@cs.fau.de
 ---
  arch/arm/mach-omap2/omap-iommu.c |   22 --
  1 files changed, 0 insertions(+), 22 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/omap-iommu.c 
 b/arch/arm/mach-omap2/omap-iommu.c
 index eb9bee7..3aa3fe9 100644
 --- a/arch/arm/mach-omap2/omap-iommu.c
 +++ b/arch/arm/mach-omap2/omap-iommu.c
 @@ -35,17 +35,6 @@ static struct iommu_device omap3_devices[] = {
   .clk_name = cam_ick,
   },
   },
 -#if defined(CONFIG_MPU_BRIDGE_IOMMU)
 - {
 - .base = 0x5d00,
 - .irq = 28,
 - .pdata = {
 - .name = iva2,
 - .nr_tlb_entries = 32,
 - .clk_name = iva2_ck,
 - },
 - },
 -#endif
  };
  #define NR_OMAP3_IOMMU_DEVICES ARRAY_SIZE(omap3_devices)
  static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES];
 @@ -66,17 +55,6 @@ static struct iommu_device omap4_devices[] = {
   .clk_name = ducati_ick,
   },
   },
 -#if defined(CONFIG_MPU_TESLA_IOMMU)
 - {
 - .base = OMAP4_MMU2_BASE,
 - .irq = INT_44XX_DSP_MMU,
 - .pdata = {
 - .name = tesla,
 - .nr_tlb_entries = 32,
 - .clk_name = tesla_ick,
 - },
 - },
 -#endif
  };
  #define NR_OMAP4_IOMMU_DEVICES ARRAY_SIZE(omap4_devices)
  static struct platform_device *omap4_iommu_pdev[NR_OMAP4_IOMMU_DEVICES];
 -- 
 1.7.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


Re: [PATCH 16/33] Removing dead APM

2010-06-30 Thread Marek Vasut
Dne St 30. června 2010 17:59:06 Christoph Egger napsal(a):
 APM doesn't exist in Kconfig, therefore removing all references for it
 from the source code.

Tony, do you know Andrzej Zaborowski's new email address? Maybe he should be 
CCed here
 
 Signed-off-by: Christoph Egger sicce...@cs.fau.de
 ---
  arch/arm/mach-omap1/board-palmte.c |   84
  1 files changed, 0 insertions(+), 84
 deletions(-)
 
 diff --git a/arch/arm/mach-omap1/board-palmte.c
 b/arch/arm/mach-omap1/board-palmte.c index 569b4c9..23bb0c9 100644
 --- a/arch/arm/mach-omap1/board-palmte.c
 +++ b/arch/arm/mach-omap1/board-palmte.c
 @@ -213,90 +213,6 @@ static struct omap_lcd_config palmte_lcd_config
 __initdata = { .ctrl_name = internal,
  };
 
 -#ifdef CONFIG_APM
 -/*
 - * Values measured in 10 minute intervals averaged over 10 samples.
 - * May differ slightly from device to device but should be accurate
 - * enough to give basic idea of battery life left and trigger
 - * potential alerts.
 - */
 -static const int palmte_battery_sample[] = {
 - 2194, 2157, 2138, 2120,
 - 2104, 2089, 2075, 2061,
 - 2048, 2038, 2026, 2016,
 - 2008, 1998, 1989, 1980,
 - 1970, 1958, 1945, 1928,
 - 1910, 1888, 1860, 1827,
 - 1791, 1751, 1709, 1656,
 -};
 -
 -#define INTERVAL 10
 -#define BATTERY_HIGH_TRESHOLD66
 -#define BATTERY_LOW_TRESHOLD 33
 -
 -static void palmte_get_power_status(struct apm_power_info *info, int
 *battery) -{
 - int charging, batt, hi, lo, mid;
 -
 - charging = !gpio_get_value(PALMTE_DC_GPIO);
 - batt = battery[0];
 - if (charging)
 - batt -= 60;
 -
 - hi = ARRAY_SIZE(palmte_battery_sample);
 - lo = 0;
 -
 - info-battery_flag = 0;
 - info-units = APM_UNITS_MINS;
 -
 - if (batt  palmte_battery_sample[lo]) {
 - info-battery_life = 100;
 - info-time = INTERVAL * ARRAY_SIZE(palmte_battery_sample);
 - } else if (batt = palmte_battery_sample[hi - 1]) {
 - info-battery_life = 0;
 - info-time = 0;
 - } else {
 - while (hi  lo + 1) {
 - mid = (hi + lo)  1;
 - if (batt = palmte_battery_sample[mid])
 - lo = mid;
 - else
 - hi = mid;
 - }
 -
 - mid = palmte_battery_sample[lo] - palmte_battery_sample[hi];
 - hi = palmte_battery_sample[lo] - batt;
 - info-battery_life = 100 - (100 * lo + 100 * hi / mid) /
 - ARRAY_SIZE(palmte_battery_sample);
 - info-time = INTERVAL * (ARRAY_SIZE(palmte_battery_sample) -
 - lo) - INTERVAL * hi / mid;
 - }
 -
 - if (charging) {
 - info-ac_line_status = APM_AC_ONLINE;
 - info-battery_status = APM_BATTERY_STATUS_CHARGING;
 - info-battery_flag |= APM_BATTERY_FLAG_CHARGING;
 - } else {
 - info-ac_line_status = APM_AC_OFFLINE;
 - if (info-battery_life  BATTERY_HIGH_TRESHOLD)
 - info-battery_status = APM_BATTERY_STATUS_HIGH;
 - else if (info-battery_life  BATTERY_LOW_TRESHOLD)
 - info-battery_status = APM_BATTERY_STATUS_LOW;
 - else
 - info-battery_status = APM_BATTERY_STATUS_CRITICAL;
 - }
 -
 - if (info-battery_life  BATTERY_HIGH_TRESHOLD)
 - info-battery_flag |= APM_BATTERY_FLAG_HIGH;
 - else if (info-battery_life  BATTERY_LOW_TRESHOLD)
 - info-battery_flag |= APM_BATTERY_FLAG_LOW;
 - else
 - info-battery_flag |= APM_BATTERY_FLAG_CRITICAL;
 -}
 -#else
 -#define palmte_get_power_status  NULL
 -#endif
 -
  static struct omap_board_config_kernel palmte_config[] __initdata = {
   { OMAP_TAG_LCD, palmte_lcd_config },
  };
--
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 17/33] Removing dead SX1_OLD_FLASH

2010-06-30 Thread Marek Vasut
Dne St 30. června 2010 17:59:25 Christoph Egger napsal(a):
 SX1_OLD_FLASH doesn't exist in Kconfig, therefore removing all
 references for it from the source code.

There were two models of the phone made, you can toggle between old and new 
version. Maybe better documentation won't hurt.
 
 Signed-off-by: Christoph Egger sicce...@cs.fau.de
 ---
  arch/arm/mach-omap1/board-sx1.c |   26 --
  1 files changed, 0 insertions(+), 26 deletions(-)
 
 diff --git a/arch/arm/mach-omap1/board-sx1.c
 b/arch/arm/mach-omap1/board-sx1.c index 2fb1e5f..1de809d 100644
 --- a/arch/arm/mach-omap1/board-sx1.c
 +++ b/arch/arm/mach-omap1/board-sx1.c
 @@ -295,31 +295,6 @@ static struct physmap_flash_data sx1_flash_data = {
   .nr_parts   = ARRAY_SIZE(sx1_partitions),
  };
 
 -#ifdef CONFIG_SX1_OLD_FLASH
 -/* MTD Intel StrataFlash - old flashes */
 -static struct resource sx1_old_flash_resource[] = {
 - [0] = {
 - .start  = OMAP_CS0_PHYS,/* Physical */
 - .end= OMAP_CS0_PHYS + SZ_16M - 1,,
 - .flags  = IORESOURCE_MEM,
 - },
 - [1] = {
 - .start  = OMAP_CS1_PHYS,
 - .end= OMAP_CS1_PHYS + SZ_8M - 1,
 - .flags  = IORESOURCE_MEM,
 - },
 -};
 -
 -static struct platform_device sx1_flash_device = {
 - .name   = physmap-flash,
 - .id = 0,
 - .dev= {
 - .platform_data  = sx1_flash_data,
 - },
 - .num_resources  = 2,
 - .resource   = sx1_old_flash_resource,
 -};
 -#else
  /* MTD Intel 4000 flash - new flashes */
  static struct resource sx1_new_flash_resource = {
   .start  = OMAP_CS0_PHYS,
 @@ -336,7 +311,6 @@ static struct platform_device sx1_flash_device = {
   .num_resources  = 1,
   .resource   = sx1_new_flash_resource,
  };
 -#endif
 
  /*--- USB -*/
--
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 22/33] Removing dead MPU_{BRIDGE,TESLA}_IOMMU

2010-06-30 Thread Kanigeri, Hari

 -Original Message-
 From: Hiroshi DOYU [mailto:hiroshi.d...@nokia.com]
 Sent: Wednesday, June 30, 2010 1:24 PM
 To: sicce...@cs.fau.de; Kanigeri, Hari
 Cc: t...@atomide.com; li...@arm.linux.org.uk; linux-omap@vger.kernel.org;
 linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org;
 va...@i4.informatik.uni-erlangen.de
 Subject: Re: [PATCH 22/33] Removing dead MPU_{BRIDGE,TESLA}_IOMMU
 
 From: ext Christoph Egger sicce...@cs.fau.de
 Subject: [PATCH 22/33] Removing dead MPU_{BRIDGE,TESLA}_IOMMU
 Date: Wed, 30 Jun 2010 18:01:01 +0200
 
  MPU_{BRIDGE,TESLA}_IOMMU doesn't exist in Kconfig, therefore removing
  all references for it from the source code.
 
 Coming soon, I guess. Hari?

Coming soon for both Bridge and Tesla. As I am writing this email, Fernando is 
preparing the Bridge patches to migrate to iommu.

Thank you,
Best regards,
Hari
--
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-06-30 Thread Grant Likely
On Thu, Feb 18, 2010 at 11:29 AM, Grant Likely
grant.lik...@secretlab.ca wrote:
 On Thu, Feb 18, 2010 at 10:09 AM, Tony Lindgren t...@atomide.com wrote:
 * Grant Likely grant.lik...@secretlab.ca [100218 08:26]:
 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

 Tony, do you want me to add your acked-by to patches 2  3?

 No thanks, I've only looked at them briefly.

 Okay, thanks.

 Hemanth, I'm going to drop this series for the moment.  I'd like to
 see some feedback/acks from current users and maintainers of the
 omap2_mcspi driver before I merge support, especially now when the
 merge window is about to open and it hasn't gotten any linux-next
 exposure.

 Also, what is your feeling about patch 3/3, spi slave support.  spi
 slave usage model is still a matter under debate, but that patch
 doesn't touch core spi code, so I'm okay to merge it as a
 driver-specific feature.  However, I'm not convinced that it is
 actually a useful patch to merge yet, so I'll defer to you on this
 one.  Thoughts?

 Up to you to decide. But here's my experience so far..

 Based on my experience if temporary hacks are merged, then nobody
 bothers to clean them up properly afterwards and the clean-up task
 unfairly falls on the maintainer.

 So IMHO, hacks like that are better floating on the mailing list
 until they're properly done. It's best to concentrate on getting
 the core things done right to make long term support easier.

 Right, I agree.  I'll ignore patch 3 entirely until I at least see a
 patch for an in-tree user.

Hi Hemanth.  Could you please respin patches 1 and 2 against
2.6.35-rc3?  The current patches do not apply anymore.

Thanks,
g.
--
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 03/33] Removing dead OMAP_MUX_ERRORS

2010-06-30 Thread Kirill A. Shutemov
On Wed, Jun 30, 2010 at 05:54:42PM +0200, Christoph Egger wrote:
 OMAP_MUX_ERRORS doesn't exist in Kconfig, therefore removing all
 references for it from the source code.

IIUC, CONFIG_OMAP_MUX_WARNINGS should be used here instead of it.

 Signed-off-by: Christoph Egger sicce...@cs.fau.de
 ---
  arch/arm/mach-omap1/mux.c |5 -
  1 files changed, 0 insertions(+), 5 deletions(-)
 
 diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
 index 8434137..1ddb02c 100644
 --- a/arch/arm/mach-omap1/mux.c
 +++ b/arch/arm/mach-omap1/mux.c
 @@ -439,12 +439,7 @@ int __init_or_module omap1_cfg_reg(const struct 
 pin_config *cfg)
  cfg-pull_name, cfg-pull_reg, pull_orig, pull);
   }
  #endif
 -
 -#ifdef CONFIG_OMAP_MUX_ERRORS
 - return warn ? -ETXTBSY : 0;
 -#else
   return 0;
 -#endif
  }
  
  int __init omap1_mux_init(void)
 -- 
 1.7.0.4
 
 
 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
 Kirill A. Shutemov
--
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 10/13] OMAP: create omap_devices for MPU, DSP, L3

2010-06-30 Thread Kevin Hilman
Gopinath, Thara th...@ti.com writes:

[...]

+static int __init omap_common_pm_init(void)
+{
+omap_init_processor_devices();
+omap_pm_if_init();
+
+return 0;
+}
+device_initcall(omap_common_pm_init);


 But I guess opp layer is still getting initialized before this. Esp if
 the board files are initializing the opp structures. Or do you have a
 patch to fix it in some other branch ?


The common OPP init will be done in this function as well (see current
PM branch.)  Board files no longer do OPP init (by default) as it is
handled by common code.  Only boards that add OPPs need to call the init
function, and we'll have to figure out way to handle that late.

Kevin

--
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: [RFC 1/3] mm: iommu: An API to unify IOMMU, CPU and device memory management

2010-06-30 Thread Randy Dunlap
On Tue, 29 Jun 2010 22:55:48 -0700 Zach Pfeffer wrote:

 This patch contains the documentation for the API, termed the Virtual
 Contiguous Memory Manager. Its use would allow all of the IOMMU to VM,
 VM to device and device to IOMMU interoperation code to be refactored
 into platform independent code.
 
 Comments, suggestions and criticisms are welcome and wanted.
 
 Signed-off-by: Zach Pfeffer zpfef...@codeaurora.org
 ---
  Documentation/vcm.txt |  583 
 +
  1 files changed, 583 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/vcm.txt
 
 diff --git a/Documentation/vcm.txt b/Documentation/vcm.txt
 new file mode 100644
 index 000..d29c757
 --- /dev/null
 +++ b/Documentation/vcm.txt
 @@ -0,0 +1,583 @@
 +What is this document about?
 +
 +
 +This document covers how to use the Virtual Contiguous Memory Manager
 +(VCMM), how the first implmentation works with a specific low-level
 +Input/Output Memory Management Unit (IOMMU) and the way the VCMM is used
 +from user-space. It also contains a section that describes why something
 +like the VCMM is needed in the kernel.
 +
 +If anything in this document is wrong please send patches to the

is wrong,

 +maintainer of this file, listed at the bottom of the document.
 +
 +
 +The Virtual Contiguous Memory Manager
 +=
 +
 +The VCMM was built to solve the system-wide memory mapping issues that
 +occur when many bus-masters have IOMMUs.
 +
 +An IOMMU maps device addresses to physical addresses. It also insulates
 +the system from spurious or malicious device bus transactions and allows
 +fine-grained mapping attribute control. The Linux kernel core does not
 +contain a generic API to handle IOMMU mapped memory; device driver writers
 +must implement device specific code to interoperate with the Linux kernel
 +core. As the number of IOMMUs increases, coordinating the many address
 +spaces mapped by all discrete IOMMUs becomes difficult without in-kernel
 +support.
 +
 +The VCMM API enables device independent IOMMU control, virtual memory
 +manager (VMM) interoperation and non-IOMMU enabled device interoperation
 +by treating devices with or without IOMMUs and all CPUs with or without
 +MMUs, their mapping contexts and their mappings using common
 +abstractions. Physical hardware is given a generic device type and mapping
 +contexts are abstracted into Virtual Contiguous Memory (VCM)
 +regions. Users reserve memory from VCMs and back their reservations
 +with physical memory.
 +
 +Why the VCMM is Needed
 +--
 +
 +Driver writers who control devices with IOMMUs must contend with device
 +control and memory management. Driver writers have a large device driver
 +API that they can leverage to control their devices, but they are lacking
 +a unified API to help them program mappings into IOMMUs and share those
 +mappings with other devices and CPUs in the system.
 +
 +Sharing is complicated by Linux's CPU centric VMM. The CPU centric model

 CPU-centric  CPU-centric

 +generally makes sense because average hardware only contains a MMU for the
 +CPU and possibly a graphics MMU. If every device in the system has one or
 +more MMUs the CPU centric memory management (MM) programming model breaks

 ditto

 +down.
 +
 +Abstracting IOMMU device programming into a common API has already begun
 +in the Linux kernel. It was built to abstract the difference between AMDs

AMD's
(or just AMD)

 +and Intels IOMMUs to support x86 virtualization on both platforms. The

   Intel's (or just Intel)

 +interface is listed in kernel/include/linux/iommu.h. It contains

  drop kernel/

 +interfaces for mapping and unmapping as well as domain management. This
 +interface has not gained widespread use outside the x86; PA-RISC, Alpha
 +and SPARC architectures and ARM and PowerPC platforms all use their own
 +mapping modules to control their IOMMUs. The VCMM contains an IOMMU
 +programming layer, but since its abstraction supports map management
 +independent of device control, the layer is not used directly. This
 +higher-level view enables a new kernel service, not just an IOMMU
 +interoperation layer.
 +
 +The General Idea: Map Management using Graphs
 +-
 +
 +Looking at mapping from a system-wide perspective reveals a general graph
 +problem. The VCMMs API is built to manage the general mapping graph. Each

VMCC's

 +node that talks to memory, either through an MMU or directly (physically
 +mapped) can be thought of as the device-end of a mapping edge. The other
 +edge is the physical memory (or intermediate virtual space) that is
 +mapped.
 +
 +In the direct mapped case the device is assigned a 

[PATCHv3 1/9] dspbridge: replace iommu custom for opensource implementation

2010-06-30 Thread Fernando Guzman Lugo
This patch replace the call to custom dsp mmu implemenation
for the once on iommu module.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/_tiomap.h|   16 +
 drivers/dsp/bridge/core/io_sm.c  |  114 ++--
 drivers/dsp/bridge/core/tiomap3430.c |  501 +-
 drivers/dsp/bridge/core/ue_deh.c |   10 -
 4 files changed, 118 insertions(+), 523 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index bf0164e..d13677a 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -23,6 +23,8 @@
 #include plat/clockdomain.h
 #include mach-omap2/prm-regbits-34xx.h
 #include mach-omap2/cm-regbits-34xx.h
+#include plat/iommu.h
+#include plat/iovmm.h
 #include dspbridge/devdefs.h
 #include hw_defs.h
 #include dspbridge/dspioctl.h/* for bridge_ioctl_extproc defn */
@@ -330,6 +332,7 @@ struct bridge_dev_context {
u32 dw_internal_size;   /* Internal memory size */
 
struct omap_mbox *mbox; /* Mail box handle */
+   struct iommu *dsp_mmu;  /* iommu for iva2 handler */
 
struct cfg_hostres *resources;  /* Host Resources */
 
@@ -374,4 +377,17 @@ extern s32 dsp_debug;
  */
 int sm_interrupt_dsp(struct bridge_dev_context *dev_context, u16 mb_val);
 
+static inline void dsp_iotlb_init(struct iotlb_entry *e, u32 da, u32 pa,
+   u32 pgsz)
+{
+   e-da = da;
+   e-pa = pa;
+   e-valid = 1;
+   e-prsvd = 1;
+   e-pgsz = pgsz  MMU_CAM_PGSZ_MASK;
+   e-endian = MMU_RAM_ENDIAN_LITTLE;
+   e-elsz = MMU_RAM_ELSZ_32;
+   e-mixed = 0;
+}
+
 #endif /* _TIOMAP_ */
diff --git a/drivers/dsp/bridge/core/io_sm.c b/drivers/dsp/bridge/core/io_sm.c
index 7fb840d..1f47f8b 100644
--- a/drivers/dsp/bridge/core/io_sm.c
+++ b/drivers/dsp/bridge/core/io_sm.c
@@ -290,6 +290,8 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
struct cod_manager *cod_man;
struct chnl_mgr *hchnl_mgr;
struct msg_mgr *hmsg_mgr;
+   struct iommu *mmu;
+   struct iotlb_entry e;
u32 ul_shm_base;
u32 ul_shm_base_offset;
u32 ul_shm_limit;
@@ -312,7 +314,6 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
struct bridge_ioctl_extproc ae_proc[BRDIOCTL_NUMOFMMUTLB];
struct cfg_hostres *host_res;
struct bridge_dev_context *pbridge_context;
-   u32 map_attrs;
u32 shm0_end;
u32 ul_dyn_ext_base;
u32 ul_seg1_size = 0;
@@ -336,6 +337,21 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = -EFAULT;
goto func_end;
}
+
+   mmu = pbridge_context-dsp_mmu;
+
+   if (mmu)
+   iommu_put(mmu);
+   mmu = iommu_get(iva2);
+
+   if (IS_ERR_OR_NULL(mmu)) {
+   pr_err(Error in iommu_get\n);
+   pbridge_context-dsp_mmu = NULL;
+   status = -EFAULT;
+   goto func_end;
+   }
+   pbridge_context-dsp_mmu = mmu;
+
status = dev_get_cod_mgr(hio_mgr-hdev_obj, cod_man);
if (!cod_man) {
status = -EFAULT;
@@ -477,55 +493,16 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
gpp_va_curr = ul_gpp_va;
num_bytes = ul_seg1_size;
 
-   /*
-* Try to fit into TLB entries. If not possible, push them to page
-* tables. It is quite possible that if sections are not on
-* bigger page boundary, we may end up making several small pages.
-* So, push them onto page tables, if that is the case.
-*/
-   map_attrs = 0x;
-   map_attrs = DSP_MAPLITTLEENDIAN;
-   map_attrs |= DSP_MAPPHYSICALADDR;
-   map_attrs |= DSP_MAPELEMSIZE32;
-   map_attrs |= DSP_MAPDONOTLOCK;
-
-   while (num_bytes) {
-   /*
-* To find the max. page size with which both PA  VA are
-* aligned.
-*/
-   all_bits = pa_curr | va_curr;
-   dev_dbg(bridge, all_bits %x, pa_curr %x, va_curr %x, 
-   num_bytes %x\n, all_bits, pa_curr, va_curr,
-   num_bytes);
-   for (i = 0; i  4; i++) {
-   if ((num_bytes = page_size[i])  ((all_bits 
-(page_size[i] -
- 1)) == 0)) {
-   status =
-   hio_mgr-intf_fxns-
-   pfn_brd_mem_map(hio_mgr-hbridge_context,
-   pa_curr, va_curr,
-   page_size[i], map_attrs,
-   NULL);
-   if (DSP_FAILED(status))
-   goto func_end;
- 

[PATCHv3 3/9] dspbridge: rename bridge_brd_mem_map/unmap to a proper name

2010-06-30 Thread Fernando Guzman Lugo
Now these functions only map user space addresses to dsp virtual
addresses, so now the functions have a more meaningful name

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |   44 
 drivers/dsp/bridge/core/_tiomap.h  |   25 +++
 drivers/dsp/bridge/core/tiomap3430.c   |   52 ++--
 drivers/dsp/bridge/pmgr/dev.c  |2 -
 drivers/dsp/bridge/rmgr/proc.c |   12 +++--
 5 files changed, 53 insertions(+), 82 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 493f62e..4f56ae6 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -162,48 +162,6 @@ typedef int(*fxn_brd_memwrite) (struct bridge_dev_context
   u32 ulMemType);
 
 /*
- *   bridge_brd_mem_map 
- *  Purpose:
- *  Map a MPU memory region to a DSP/IVA memory space
- *  Parameters:
- *  hDevContext:Handle to Bridge driver defined device info.
- *  ul_mpu_addr:  MPU memory region start address.
- *  ulVirtAddr: DSP/IVA memory region u8 address.
- *  ul_num_bytes: Number of bytes to map.
- *  map_attrs:   Mapping attributes (e.g. endianness).
- *  Returns:
- *  0:Success.
- *  -EPERM:  Other, unspecified error.
- *  Requires:
- *  hDevContext != NULL;
- *  Ensures:
- */
-typedef int(*fxn_brd_memmap) (struct bridge_dev_context
-* hDevContext, u32 ul_mpu_addr,
-u32 ulVirtAddr, u32 ul_num_bytes,
-u32 ulMapAttrs,
-struct page **mapped_pages);
-
-/*
- *   bridge_brd_mem_un_map 
- *  Purpose:
- *  UnMap an MPU memory region from DSP/IVA memory space
- *  Parameters:
- *  hDevContext:Handle to Bridge driver defined device info.
- *  ulVirtAddr: DSP/IVA memory region u8 address.
- *  ul_num_bytes: Number of bytes to unmap.
- *  Returns:
- *  0:Success.
- *  -EPERM:  Other, unspecified error.
- *  Requires:
- *  hDevContext != NULL;
- *  Ensures:
- */
-typedef int(*fxn_brd_memunmap) (struct bridge_dev_context
-  * hDevContext,
-  u32 ulVirtAddr, u32 ul_num_bytes);
-
-/*
  *   bridge_brd_stop 
  *  Purpose:
  *  Bring board to the BRD_STOPPED state.
@@ -1061,8 +1019,6 @@ struct bridge_drv_interface {
fxn_brd_setstate pfn_brd_set_state; /* Sets the Board State */
fxn_brd_memcopy pfn_brd_mem_copy;   /* Copies DSP Memory */
fxn_brd_memwrite pfn_brd_mem_write; /* Write DSP Memory w/o halt */
-   fxn_brd_memmap pfn_brd_mem_map; /* Maps MPU mem to DSP mem */
-   fxn_brd_memunmap pfn_brd_mem_un_map;/* Unmaps MPU mem to DSP mem */
fxn_chnl_create pfn_chnl_create;/* Create channel manager. */
fxn_chnl_destroy pfn_chnl_destroy;  /* Destroy channel manager. */
fxn_chnl_open pfn_chnl_open;/* Create a new channel. */
diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index 6a822c6..4aa2358 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -396,4 +396,29 @@ static inline void dsp_iotlb_init(struct iotlb_entry *e, 
u32 da, u32 pa,
e-mixed = 0;
 }
 
+/**
+ * user_to_dsp_map() - maps user to dsp virtual address
+ * @mmu:   Pointer to iommu handle.
+ * @uva:   Virtual user space address.
+ * @da DSP address
+ * @size   Buffer size to map.
+ * @usr_pgsstruct page array pointer where the user pages will be stored
+ *
+ * This function maps a user space buffer into DSP virtual address.
+ *
+ */
+
+int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
+   struct page **usr_pgs);
+
+/**
+ * user_to_dsp_unmap() - unmaps DSP virtual buffer.
+ * @mmu:   Pointer to iommu handle.
+ * @da DSP address
+ *
+ * This function unmaps a user space buffer into DSP virtual address.
+ *
+ */
+int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+
 #endif /* _TIOMAP_ */
diff --git a/drivers/dsp/bridge/core/tiomap3430.c 
b/drivers/dsp/bridge/core/tiomap3430.c
index 89d4936..88f5167 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
@@ -98,12 +98,6 @@ static int bridge_brd_mem_copy(struct bridge_dev_context 
*hDevContext,
 static int bridge_brd_mem_write(struct bridge_dev_context *dev_context,
IN u8 *pbHostBuf, u32 dwDSPAddr,
u32 ul_num_bytes, u32 ulMemType);
-static int bridge_brd_mem_map(struct bridge_dev_context 

[PATCHv3 0/9] dspbridge: iommu migration

2010-06-30 Thread Fernando Guzman Lugo
This set of patches remove the dspbridge custom mmu implementation
and use iommu module instead.


NOTE: in order to dspbridge can work properly the patch
0001-iovmm-add-superpages-support-to-fixed-da-address.patch
is needed (specifically iommu_kmap calls need this patch).

Fernando Guzman Lugo (9):
  dspbridge: replace iommu custom for opensource implementation
  dspbridge: move shared memory iommu maps to tiomap3430.c
  dspbridge: rename bridge_brd_mem_map/unmap to a proper name
  dspbridge: remove custom mmu code from tiomap3430.c
  dspbridge: add mmufault support
  dspbridge: remove hw directory
  dspbridge: move all iommu related code to a new file
  dspbridge: add map support for big buffers
  dspbridge: cleanup bridge_dev_context and cfg_hostres structures

 arch/arm/plat-omap/include/dspbridge/cfgdefs.h  |1 -
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h  |   90 ++
 arch/arm/plat-omap/include/dspbridge/dspdefs.h  |   44 -
 arch/arm/plat-omap/include/dspbridge/dspdeh.h   |1 -
 arch/arm/plat-omap/include/dspbridge/dspioctl.h |7 -
 drivers/dsp/bridge/Makefile |5 +-
 drivers/dsp/bridge/core/_deh.h  |3 -
 drivers/dsp/bridge/core/_tiomap.h   |   15 +-
 drivers/dsp/bridge/core/dsp-mmu.c   |  229 
 drivers/dsp/bridge/core/io_sm.c |  185 +---
 drivers/dsp/bridge/core/mmu_fault.c |  139 ---
 drivers/dsp/bridge/core/mmu_fault.h |   36 -
 drivers/dsp/bridge/core/tiomap3430.c| 1297 ---
 drivers/dsp/bridge/core/tiomap3430_pwr.c|  183 +---
 drivers/dsp/bridge/core/tiomap_io.c |   16 +-
 drivers/dsp/bridge/core/ue_deh.c|   87 +--
 drivers/dsp/bridge/hw/EasiGlobal.h  |   41 -
 drivers/dsp/bridge/hw/GlobalTypes.h |  308 --
 drivers/dsp/bridge/hw/MMUAccInt.h   |   76 --
 drivers/dsp/bridge/hw/MMURegAcM.h   |  226 
 drivers/dsp/bridge/hw/hw_defs.h |   60 --
 drivers/dsp/bridge/hw/hw_mmu.c  |  587 --
 drivers/dsp/bridge/hw/hw_mmu.h  |  161 ---
 drivers/dsp/bridge/pmgr/dev.c   |2 -
 drivers/dsp/bridge/rmgr/drv.c   |4 -
 drivers/dsp/bridge/rmgr/node.c  |4 +-
 drivers/dsp/bridge/rmgr/proc.c  |   19 +-
 27 files changed, 599 insertions(+), 3227 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 create mode 100644 drivers/dsp/bridge/core/dsp-mmu.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.h
 delete mode 100644 drivers/dsp/bridge/hw/EasiGlobal.h
 delete mode 100644 drivers/dsp/bridge/hw/GlobalTypes.h
 delete mode 100644 drivers/dsp/bridge/hw/MMUAccInt.h
 delete mode 100644 drivers/dsp/bridge/hw/MMURegAcM.h
 delete mode 100644 drivers/dsp/bridge/hw/hw_defs.h
 delete mode 100644 drivers/dsp/bridge/hw/hw_mmu.c
 delete mode 100644 drivers/dsp/bridge/hw/hw_mmu.h

--
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


[PATCHv3 7/9] dspbridge: move all iommu related code to a new file

2010-06-30 Thread Fernando Guzman Lugo
This patch moves all the code related to iommu in the
dsp-mmu.c file

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h |   90 ++
 arch/arm/plat-omap/include/dspbridge/dspdeh.h  |1 -
 drivers/dsp/bridge/Makefile|2 +-
 drivers/dsp/bridge/core/_deh.h |3 -
 drivers/dsp/bridge/core/_tiomap.h  |   41 +-
 drivers/dsp/bridge/core/dsp-mmu.c  |  218 
 drivers/dsp/bridge/core/mmu_fault.c|   76 
 drivers/dsp/bridge/core/mmu_fault.h|   35 
 drivers/dsp/bridge/core/tiomap3430.c   |  111 +
 drivers/dsp/bridge/core/ue_deh.c   |   68 +---
 drivers/dsp/bridge/rmgr/proc.c |6 +-
 11 files changed, 318 insertions(+), 333 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 create mode 100644 drivers/dsp/bridge/core/dsp-mmu.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.h

diff --git a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h 
b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
new file mode 100644
index 000..266f38b
--- /dev/null
+++ b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
@@ -0,0 +1,90 @@
+/*
+ * dsp-mmu.h
+ *
+ * DSP-BIOS Bridge driver support functions for TI OMAP processors.
+ *
+ * DSP iommu.
+ *
+ * Copyright (C) 2005-2010 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 _DSP_MMU_
+#define _DSP_MMU_
+
+#include plat/iommu.h
+#include plat/iovmm.h
+
+/**
+ * dsp_iotlb_init() - initialize dsp mmu entry
+ * @e: Pointer tbl entry.
+ * @da DSP address
+ * @pa:physical address.
+ * @pgsz   page size to map.
+ *
+ * This function initializes a dsp mmu entry in order to be used with
+ * iommu functions.
+ */
+static inline void dsp_iotlb_init(struct iotlb_entry *e, u32 da, u32 pa,
+   u32 pgsz)
+{
+   e-da = da;
+   e-pa = pa;
+   e-valid = 1;
+   e-prsvd = 1;
+   e-pgsz = pgsz  MMU_CAM_PGSZ_MASK;
+   e-endian = MMU_RAM_ENDIAN_LITTLE;
+   e-elsz = MMU_RAM_ELSZ_32;
+   e-mixed = 0;
+}
+
+/**
+ * dsp_mmu_init() - initialize dsp_mmu module and returns a handle
+ *
+ * This function initialize dsp mmu module and returns a struct iommu
+ * handle to use it for dsp maps.
+ *
+ */
+struct iommu *dsp_mmu_init(void);
+
+/**
+ * dsp_mmu_exit() - destroy dsp mmu module
+ * @mmu:   Pointer to iommu handle.
+ *
+ * This function destroys dsp mmu module.
+ *
+ */
+void dsp_mmu_exit(struct iommu *mmu);
+
+/**
+ * user_to_dsp_map() - maps user to dsp virtual address
+ * @mmu:   Pointer to iommu handle.
+ * @uva:   Virtual user space address.
+ * @da DSP address
+ * @size   Buffer size to map.
+ * @usr_pgsstruct page array pointer where the user pages will be stored
+ *
+ * This function maps a user space buffer into DSP virtual address.
+ *
+ */
+int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
+   struct page **usr_pgs);
+
+/**
+ * user_to_dsp_unmap() - unmaps DSP virtual buffer.
+ * @mmu:   Pointer to iommu handle.
+ * @da DSP address
+ *
+ * This function unmaps a user space buffer into DSP virtual address.
+ *
+ */
+int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+
+#endif
diff --git a/arch/arm/plat-omap/include/dspbridge/dspdeh.h 
b/arch/arm/plat-omap/include/dspbridge/dspdeh.h
index 4394711..af19926 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdeh.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdeh.h
@@ -43,5 +43,4 @@ extern int bridge_deh_register_notify(struct deh_mgr *deh_mgr,
 extern void bridge_deh_notify(struct deh_mgr *deh_mgr,
u32 ulEventMask, u32 dwErrInfo);
 
-extern void bridge_deh_release_dummy_mem(void);
 #endif /* DSPDEH_ */
diff --git a/drivers/dsp/bridge/Makefile b/drivers/dsp/bridge/Makefile
index 66ca10a..9f32055 100644
--- a/drivers/dsp/bridge/Makefile
+++ b/drivers/dsp/bridge/Makefile
@@ -5,7 +5,7 @@ libservices = services/sync.o services/cfg.o \
services/ntfy.o services/services.o
 libcore = core/chnl_sm.o core/msg_sm.o core/io_sm.o core/tiomap3430.o \
core/tiomap3430_pwr.o core/tiomap_io.o \
-   core/mmu_fault.o core/ue_deh.o core/wdt.o core/dsp-clock.o
+   core/dsp-mmu.o core/ue_deh.o core/wdt.o core/dsp-clock.o
 libpmgr = pmgr/chnl.o pmgr/io.o 

[PATCHv3 5/9] dspbridge: add mmufault support

2010-06-30 Thread Fernando Guzman Lugo
With changes for iommu migration mmu fault report and dsp track
dump is broken, this patch fixes that.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/mmu_fault.c  |   93 ++---
 drivers/dsp/bridge/core/mmu_fault.h  |5 +-
 drivers/dsp/bridge/core/tiomap3430.c |2 +
 drivers/dsp/bridge/core/ue_deh.c |   31 +---
 4 files changed, 34 insertions(+), 97 deletions(-)

diff --git a/drivers/dsp/bridge/core/mmu_fault.c 
b/drivers/dsp/bridge/core/mmu_fault.c
index 5c0124f..d991c6a 100644
--- a/drivers/dsp/bridge/core/mmu_fault.c
+++ b/drivers/dsp/bridge/core/mmu_fault.c
@@ -23,9 +23,12 @@
 /*  --- Trace  Debug */
 #include dspbridge/host_os.h
 #include dspbridge/dbc.h
+#include plat/iommu.h
 
 /*  --- OS Adaptation Layer */
 #include dspbridge/drv.h
+#include dspbridge/dev.h
+
 
 /*  --- Link Driver */
 #include dspbridge/dspdeh.h
@@ -40,11 +43,6 @@
 #include _tiomap.h
 #include mmu_fault.h
 
-static u32 dmmu_event_mask;
-u32 fault_addr;
-
-static bool mmu_check_if_fault(struct bridge_dev_context *dev_context);
-
 /*
  *   mmu_fault_dpc 
  *  Deferred procedure call to handle DSP MMU fault.
@@ -62,78 +60,21 @@ void mmu_fault_dpc(IN unsigned long pRefData)
  *   mmu_fault_isr 
  *  ISR to be triggered by a DSP MMU fault interrupt.
  */
-irqreturn_t mmu_fault_isr(int irq, IN void *pRefData)
-{
-   struct deh_mgr *deh_mgr_obj = (struct deh_mgr *)pRefData;
-   struct bridge_dev_context *dev_context;
-   struct cfg_hostres *resources;
-
-   DBC_REQUIRE(irq == INT_DSP_MMU_IRQ);
-   DBC_REQUIRE(deh_mgr_obj);
-
-   if (deh_mgr_obj) {
-
-   dev_context =
-   (struct bridge_dev_context *)deh_mgr_obj-hbridge_context;
-
-   resources = dev_context-resources;
-
-   if (!resources) {
-   dev_dbg(bridge, %s: Failed to get Host Resources\n,
-   __func__);
-   return IRQ_HANDLED;
-   }
-   if (mmu_check_if_fault(dev_context)) {
-   printk(KERN_INFO * DSPMMU FAULT * IRQStatus 
-  0x%x\n, dmmu_event_mask);
-   printk(KERN_INFO * DSPMMU FAULT * fault_addr 
-  0x%x\n, fault_addr);
-   /*
-* Schedule a DPC directly. In the future, it may be
-* necessary to check if DSP MMU fault is intended for
-* Bridge.
-*/
-   tasklet_schedule(deh_mgr_obj-dpc_tasklet);
-
-   /* Reset err_info structure before use. */
-   deh_mgr_obj-err_info.dw_err_mask = DSP_MMUFAULT;
-   deh_mgr_obj-err_info.dw_val1 = fault_addr  16;
-   deh_mgr_obj-err_info.dw_val2 = fault_addr  0x;
-   deh_mgr_obj-err_info.dw_val3 = 0L;
-   /* Disable the MMU events, else once we clear it will
-* start to raise INTs again */
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-HW_MMU_TRANSLATION_FAULT);
-   } else {
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-HW_MMU_ALL_INTERRUPTS);
-   }
-   }
-   return IRQ_HANDLED;
-}
+int mmu_fault_isr(struct iommu *mmu)
 
-/*
- *   mmu_check_if_fault 
- *  Check to see if MMU Fault is valid TLB miss from DSP
- *  Note: This function is called from an ISR
- */
-static bool mmu_check_if_fault(struct bridge_dev_context *dev_context)
 {
+   struct deh_mgr *dm;
+   u32 da;
+
+   dev_get_deh_mgr(dev_get_first(), dm);
+
+   if (!dm)
+   return -EPERM;
+
+   da = iommu_read_reg(mmu, MMU_FAULT_AD);
+   iommu_write_reg(mmu, 0, MMU_IRQENABLE);
+   dm-err_info.dw_val1 = da;
+   tasklet_schedule(dm-dpc_tasklet);
 
-   bool ret = false;
-   hw_status hw_status_obj;
-   struct cfg_hostres *resources = dev_context-resources;
-
-   if (!resources) {
-   dev_dbg(bridge, %s: Failed to get Host Resources in\n,
-   __func__);
-   return ret;
-   }
-   hw_status_obj =
-   hw_mmu_event_status(resources-dw_dmmu_base, dmmu_event_mask);
-   if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) {
-   hw_mmu_fault_addr_read(resources-dw_dmmu_base, fault_addr);
-   ret = true;
-   }
-   return ret;
+   return 0;
 }
diff --git a/drivers/dsp/bridge/core/mmu_fault.h 
b/drivers/dsp/bridge/core/mmu_fault.h
index 74db489..df3fba6 100644
--- a/drivers/dsp/bridge/core/mmu_fault.h

[PATCH] iovmm: add superpages support to fixed da address

2010-06-30 Thread Fernando Guzman Lugo
This patch adds superpages support to fixed ad address
inside iommu_kmap function.

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

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 936aef1..7cde09f 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -86,35 +86,45 @@ static size_t sgtable_len(const struct sg_table *sgt)
 }
 #define sgtable_ok(x)  (!!sgtable_len(x))
 
+
+static inline unsigned max_alignment(u32 addr)
+{
+   int i;
+   unsigned pagesize[] = { SZ_16M, SZ_1M, SZ_64K, SZ_4K, };
+   for (i = 0; i  ARRAY_SIZE(pagesize)  addr  (pagesize[i] - 1); i++)
+   ;
+   return (i  ARRAY_SIZE(pagesize)) ? pagesize[i] : 0;
+}
+
+
 /*
  * calculate the optimal number sg elements from total bytes based on
  * iommu superpages
  */
-static unsigned int sgtable_nents(size_t bytes)
+static unsigned int sgtable_nents(size_t bytes, u32 da, u32 pa)
 {
-   int i;
-   unsigned int nr_entries;
-   const unsigned long pagesize[] = { SZ_16M, SZ_1M, SZ_64K, SZ_4K, };
+   unsigned int nr_entries = 0, ent_sz;
 
if (!IS_ALIGNED(bytes, PAGE_SIZE)) {
pr_err(%s: wrong size %08x\n, __func__, bytes);
return 0;
}
 
-   nr_entries = 0;
-   for (i = 0; i  ARRAY_SIZE(pagesize); i++) {
-   if (bytes = pagesize[i]) {
-   nr_entries += (bytes / pagesize[i]);
-   bytes %= pagesize[i];
-   }
+   while (bytes) {
+   ent_sz = max_alignment(da | pa);
+   ent_sz = min(ent_sz, (unsigned)iopgsz_max(bytes));
+   nr_entries++;
+   da += ent_sz;
+   pa += ent_sz;
+   bytes -= ent_sz;
}
-   BUG_ON(bytes);
 
return nr_entries;
 }
 
 /* allocate and initialize sg_table header(a kind of 'superblock') */
-static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags)
+static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags,
+   u32 da, u32 pa)
 {
unsigned int nr_entries;
int err;
@@ -126,9 +136,8 @@ static struct sg_table *sgtable_alloc(const size_t bytes, 
u32 flags)
if (!IS_ALIGNED(bytes, PAGE_SIZE))
return ERR_PTR(-EINVAL);
 
-   /* FIXME: IOVMF_DA_FIXED should support 'superpages' */
-   if ((flags  IOVMF_LINEAR)  (flags  IOVMF_DA_ANON)) {
-   nr_entries = sgtable_nents(bytes);
+   if (flags  IOVMF_LINEAR) {
+   nr_entries = sgtable_nents(bytes, da, pa);
if (!nr_entries)
return ERR_PTR(-EINVAL);
} else
@@ -403,7 +412,8 @@ static inline void sgtable_drain_vmalloc(struct sg_table 
*sgt)
BUG_ON(!sgt);
 }
 
-static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
+static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, u32 da,
+   size_t len)
 {
unsigned int i;
struct scatterlist *sg;
@@ -414,7 +424,8 @@ static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 
pa, size_t len)
for_each_sg(sgt-sgl, sg, sgt-nents, i) {
size_t bytes;
 
-   bytes = iopgsz_max(len);
+   bytes = max_alignment(da | pa);
+   bytes = min(bytes, (size_t)iopgsz_max(len));
 
BUG_ON(!iopgsz_ok(bytes));
 
@@ -423,6 +434,7 @@ static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 
pa, size_t len)
 * 'pa' is cotinuous(linear).
 */
pa += bytes;
+   da += bytes;
len -= bytes;
}
BUG_ON(len);
@@ -689,7 +701,7 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, 
u32 flags)
if (!va)
return -ENOMEM;
 
-   sgt = sgtable_alloc(bytes, flags);
+   sgt = sgtable_alloc(bytes, flags, da, 0);
if (IS_ERR(sgt)) {
da = PTR_ERR(sgt);
goto err_sgt_alloc;
@@ -740,11 +752,11 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 
pa, void *va,
 {
struct sg_table *sgt;
 
-   sgt = sgtable_alloc(bytes, flags);
+   sgt = sgtable_alloc(bytes, flags, da, pa);
if (IS_ERR(sgt))
return PTR_ERR(sgt);
 
-   sgtable_fill_kmalloc(sgt, pa, bytes);
+   sgtable_fill_kmalloc(sgt, pa, da, bytes);
 
da = map_iommu_region(obj, da, sgt, va, bytes, flags);
if (IS_ERR_VALUE(da)) {
-- 
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


[PATCHv3 9/9] dspbridge: cleanup bridge_dev_context and cfg_hostres structures

2010-06-30 Thread Fernando Guzman Lugo
this patch cleans up cfg_hostres and bridge_dev_context
structures of custom mmu code not needed anymore.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cfgdefs.h |1 -
 drivers/dsp/bridge/core/_tiomap.h  |5 -
 drivers/dsp/bridge/core/tiomap3430.c   |8 
 drivers/dsp/bridge/core/tiomap_io.c|2 +-
 drivers/dsp/bridge/rmgr/drv.c  |4 
 5 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h 
b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
index 38122db..dfb55cc 100644
--- a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
@@ -68,7 +68,6 @@ struct cfg_hostres {
void __iomem *dw_per_base;
u32 dw_per_pm_base;
u32 dw_core_pm_base;
-   void __iomem *dw_dmmu_base;
void __iomem *dw_sys_ctrl_base;
 };
 
diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index 8a9a822..82bce7d 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -323,7 +323,6 @@ struct bridge_dev_context {
 */
u32 dw_dsp_ext_base_addr;   /* See the comment above */
u32 dw_api_reg_base;/* API mem map'd registers */
-   void __iomem *dw_dsp_mmu_base;  /* DSP MMU Mapped registers */
u32 dw_api_clk_base;/* CLK Registers */
u32 dw_dsp_clk_m2_base; /* DSP Clock Module m2 */
u32 dw_public_rhea; /* Pub Rhea */
@@ -347,10 +346,6 @@ struct bridge_dev_context {
/* DMMU TLB entries */
struct bridge_ioctl_extproc atlb_entry[BRDIOCTL_NUMOFMMUTLB];
u32 dw_brd_state;   /* Last known board state. */
-   u32 ul_int_mask;/* int mask */
-   u16 io_base;/* Board I/O base */
-   u32 num_tlb_entries;/* DSP MMU TLB entry counter */
-   u32 fixed_tlb_entries;  /* Fixed DSPMMU TLB entry count */
 
/* TC Settings */
bool tc_word_swap_on;   /* Traffic Controller Word Swap */
diff --git a/drivers/dsp/bridge/core/tiomap3430.c 
b/drivers/dsp/bridge/core/tiomap3430.c
index aa6e999..83a9561 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
@@ -753,7 +753,6 @@ static int bridge_dev_create(OUT struct bridge_dev_context
dev_context-atlb_entry[entry_ndx].ul_gpp_pa =
dev_context-atlb_entry[entry_ndx].ul_dsp_va = 0;
}
-   dev_context-num_tlb_entries = 0;
dev_context-dw_dsp_base_addr = (u32) MEM_LINEAR_ADDRESS((void *)
 (pConfig-
  dw_mem_base
@@ -766,11 +765,7 @@ static int bridge_dev_create(OUT struct bridge_dev_context
 
if (DSP_SUCCEEDED(status)) {
dev_context-tc_word_swap_on = drv_datap-tc_wordswapon;
-   /* MMU address is obtained from the host
-* resources struct */
-   dev_context-dw_dsp_mmu_base = resources-dw_dmmu_base;
dev_context-hdev_obj = hdev_obj;
-   dev_context-ul_int_mask = 0;
/* Store current board state. */
dev_context-dw_brd_state = BRD_STOPPED;
dev_context-resources = resources;
@@ -887,8 +882,6 @@ static int bridge_dev_destroy(struct bridge_dev_context 
*hDevContext)
iounmap((void *)host_res-dw_mem_base[3]);
if (host_res-dw_mem_base[4])
iounmap((void *)host_res-dw_mem_base[4]);
-   if (host_res-dw_dmmu_base)
-   iounmap(host_res-dw_dmmu_base);
if (host_res-dw_per_base)
iounmap(host_res-dw_per_base);
if (host_res-dw_per_pm_base)
@@ -902,7 +895,6 @@ static int bridge_dev_destroy(struct bridge_dev_context 
*hDevContext)
host_res-dw_mem_base[2] = (u32) NULL;
host_res-dw_mem_base[3] = (u32) NULL;
host_res-dw_mem_base[4] = (u32) NULL;
-   host_res-dw_dmmu_base = NULL;
host_res-dw_sys_ctrl_base = NULL;
 
kfree(host_res);
diff --git a/drivers/dsp/bridge/core/tiomap_io.c 
b/drivers/dsp/bridge/core/tiomap_io.c
index 3c0d3a3..2f2f8c2 100644
--- a/drivers/dsp/bridge/core/tiomap_io.c
+++ b/drivers/dsp/bridge/core/tiomap_io.c
@@ -437,7 +437,7 @@ int sm_interrupt_dsp(struct bridge_dev_context 
*dev_context, u16 mb_val)
omap_mbox_restore_ctx(dev_context-mbox);
 
/* Access MMU SYS CONFIG register to generate a short wakeup */
-   __raw_readl(resources-dw_dmmu_base + 0x10);
+   iommu_read_reg(dev_context-dsp_mmu, MMU_SYSCONFIG);
 
dev_context-dw_brd_state = BRD_RUNNING;
} else if (dev_context-dw_brd_state == BRD_RETENTION) 

[PATCHv3 8/9] dspbridge: add map support for big buffers

2010-06-30 Thread Fernando Guzman Lugo
due to a restriction in scatter gather lists, it can
not be created a list for a buffer bigger than 1MB.
This patch is spliting big mappings into 1MB mappings.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h |2 +-
 drivers/dsp/bridge/core/dsp-mmu.c  |   55 ++-
 drivers/dsp/bridge/rmgr/proc.c |3 +-
 3 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h 
b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
index 266f38b..2e4bf6a 100644
--- a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
+++ b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
@@ -85,6 +85,6 @@ int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 
size,
  * This function unmaps a user space buffer into DSP virtual address.
  *
  */
-int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+int user_to_dsp_unmap(struct iommu *mmu, u32 da, unsigned size);
 
 #endif
diff --git a/drivers/dsp/bridge/core/dsp-mmu.c 
b/drivers/dsp/bridge/core/dsp-mmu.c
index e8da327..9a46206 100644
--- a/drivers/dsp/bridge/core/dsp-mmu.c
+++ b/drivers/dsp/bridge/core/dsp-mmu.c
@@ -133,7 +133,7 @@ int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 
size,
struct page **usr_pgs)
 {
int res, w;
-   unsigned pages, i;
+   unsigned pages, i, j = 0;
struct vm_area_struct *vma;
struct mm_struct *mm = current-mm;
struct sg_table *sgt;
@@ -162,24 +162,31 @@ int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, 
u32 size,
if (res  0)
return res;
 
-   sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
+   while (pages) {
+   sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
 
-   if (!sgt)
-   return -ENOMEM;
+   if (!sgt)
+   return -ENOMEM;
 
-   res = sg_alloc_table(sgt, pages, GFP_KERNEL);
+   res = sg_alloc_table(sgt,
+   min((unsigned)SG_MAX_SINGLE_ALLOC, pages), GFP_KERNEL);
+   pages -= min((unsigned)SG_MAX_SINGLE_ALLOC, pages);
 
-   if (res  0)
-   goto err_sg;
+   if (res  0)
+   goto err_sg;
+
+   for_each_sg(sgt-sgl, sg, sgt-nents, i)
+   sg_set_page(sg, usr_pgs[j++], PAGE_SIZE, 0);
 
-   for_each_sg(sgt-sgl, sg, sgt-nents, i)
-   sg_set_page(sg, usr_pgs[i], PAGE_SIZE, 0);
+   da = iommu_vmap(mmu, da, sgt, IOVMF_ENDIAN_LITTLE |
+   IOVMF_ELSZ_32);
 
-   da = iommu_vmap(mmu, da, sgt, IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32);
+   if (IS_ERR_VALUE(da)) {
+   res = (int)da;
+   goto err_map;
+   }
 
-   if (IS_ERR_VALUE(da)) {
-   res = (int)da;
-   goto err_map;
+   da += SG_MAX_SINGLE_ALLOC * PAGE_SIZE;
}
return 0;
 
@@ -198,21 +205,25 @@ err_sg:
  * This function unmaps a user space buffer into DSP virtual address.
  *
  */
-int user_to_dsp_unmap(struct iommu *mmu, u32 da)
+int user_to_dsp_unmap(struct iommu *mmu, u32 da, unsigned size)
 {
unsigned i;
struct sg_table *sgt;
struct scatterlist *sg;
+   const unsigned max_sz = SG_MAX_SINGLE_ALLOC * PAGE_SIZE;
 
-   sgt = iommu_vunmap(mmu, da);
-   if (!sgt)
-   return -EFAULT;
-
-   for_each_sg(sgt-sgl, sg, sgt-nents, i)
-   put_page(sg_page(sg));
+   while (size) {
+   size -= min(max_sz, size);
+   sgt = iommu_vunmap(mmu, da);
+   if (!sgt)
+   return -EFAULT;
 
-   sg_free_table(sgt);
-   kfree(sgt);
+   for_each_sg(sgt-sgl, sg, sgt-nents, i)
+   put_page(sg_page(sg));
 
+   sg_free_table(sgt);
+   kfree(sgt);
+   da += max_sz;
+   }
return 0;
 }
diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 4f10a41..997918e 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -1713,7 +1713,8 @@ int proc_un_map(void *hprocessor, void *map_addr,
/* Remove mapping from the page tables. */
if (DSP_SUCCEEDED(status)) {
status = user_to_dsp_unmap(
-   p_proc_object-hbridge_context-dsp_mmu, va_align);
+   p_proc_object-hbridge_context-dsp_mmu,
+   va_align, size_align);
}
 
mutex_unlock(proc_lock);
-- 
1.7.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


[PATCHv3 4/9] dspbridge: remove custom mmu code from tiomap3430.c

2010-06-30 Thread Fernando Guzman Lugo
This patch removes all the custom mmu code remaining in
tiomap3430.c which is not needed anymore.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/_tiomap.h|1 -
 drivers/dsp/bridge/core/tiomap3430.c |  470 --
 2 files changed, 0 insertions(+), 471 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index 4aa2358..c41fd8e 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -356,7 +356,6 @@ struct bridge_dev_context {
 
/* TC Settings */
bool tc_word_swap_on;   /* Traffic Controller Word Swap */
-   struct pg_table_attrs *pt_attrs;
u32 dsp_per_clks;
 };
 
diff --git a/drivers/dsp/bridge/core/tiomap3430.c 
b/drivers/dsp/bridge/core/tiomap3430.c
index 88f5167..96cceea 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
@@ -105,56 +105,9 @@ static int bridge_dev_create(OUT struct bridge_dev_context
 static int bridge_dev_ctrl(struct bridge_dev_context *dev_context,
  u32 dw_cmd, IN OUT void *pargs);
 static int bridge_dev_destroy(struct bridge_dev_context *dev_context);
-static u32 user_va2_pa(struct mm_struct *mm, u32 address);
-static int pte_update(struct bridge_dev_context *hDevContext, u32 pa,
-u32 va, u32 size,
-struct hw_mmu_map_attrs_t *map_attrs);
-static int pte_set(struct pg_table_attrs *pt, u32 pa, u32 va,
- u32 size, struct hw_mmu_map_attrs_t *attrs);
-static int mem_map_vmalloc(struct bridge_dev_context *hDevContext,
- u32 ul_mpu_addr, u32 ulVirtAddr,
- u32 ul_num_bytes,
- struct hw_mmu_map_attrs_t *hw_attrs);
 
 bool wait_for_start(struct bridge_dev_context *dev_context, u32 dw_sync_addr);
 
-/*  --- Globals */
-
-/* Attributes of L2 page tables for DSP MMU */
-struct page_info {
-   u32 num_entries;/* Number of valid PTEs in the L2 PT */
-};
-
-/* Attributes used to manage the DSP MMU page tables */
-struct pg_table_attrs {
-   spinlock_t pg_lock; /* Critical section object handle */
-
-   u32 l1_base_pa; /* Physical address of the L1 PT */
-   u32 l1_base_va; /* Virtual  address of the L1 PT */
-   u32 l1_size;/* Size of the L1 PT */
-   u32 l1_tbl_alloc_pa;
-   /* Physical address of Allocated mem for L1 table. May not be aligned */
-   u32 l1_tbl_alloc_va;
-   /* Virtual address of Allocated mem for L1 table. May not be aligned */
-   u32 l1_tbl_alloc_sz;
-   /* Size of consistent memory allocated for L1 table.
-* May not be aligned */
-
-   u32 l2_base_pa; /* Physical address of the L2 PT */
-   u32 l2_base_va; /* Virtual  address of the L2 PT */
-   u32 l2_size;/* Size of the L2 PT */
-   u32 l2_tbl_alloc_pa;
-   /* Physical address of Allocated mem for L2 table. May not be aligned */
-   u32 l2_tbl_alloc_va;
-   /* Virtual address of Allocated mem for L2 table. May not be aligned */
-   u32 l2_tbl_alloc_sz;
-   /* Size of consistent memory allocated for L2 table.
-* May not be aligned */
-
-   u32 l2_num_pages;   /* Number of allocated L2 PT */
-   /* Array [l2_num_pages] of L2 PT info structs */
-   struct page_info *pg_info;
-};
 
 /*
  *  This Bridge driver's function interface table.
@@ -210,32 +163,6 @@ static struct bridge_drv_interface drv_interface_fxns = {
bridge_msg_set_queue_id,
 };
 
-static inline void tlb_flush_all(const void __iomem *base)
-{
-   __raw_writeb(__raw_readb(base + MMU_GFLUSH) | 1, base + MMU_GFLUSH);
-}
-
-static inline void flush_all(struct bridge_dev_context *dev_context)
-{
-   if (dev_context-dw_brd_state == BRD_DSP_HIBERNATION ||
-   dev_context-dw_brd_state == BRD_HIBERNATION)
-   wake_dsp(dev_context, NULL);
-
-   tlb_flush_all(dev_context-dw_dsp_mmu_base);
-}
-
-static void bad_page_dump(u32 pa, struct page *pg)
-{
-   pr_emerg(DSPBRIDGE: MAP function: COUNT 0 FOR PA 0x%x\n, pa);
-   pr_emerg(Bad page state in process '%s'\n
-page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n
-Backtrace:\n,
-current-comm, pg, (int)(2 * sizeof(unsigned long)),
-(unsigned long)pg-flags, pg-mapping,
-page_mapcount(pg), page_count(pg));
-   dump_stack();
-}
-
 /*
  *   bridge_drv_entry 
  *  purpose:
@@ -637,7 +564,6 @@ static int bridge_brd_stop(struct bridge_dev_context 
*hDevContext)
 {
int status = 0;
struct bridge_dev_context *dev_context = hDevContext;
-   struct pg_table_attrs *pt_attrs;
u32 dsp_pwr_state;
int clk_status;
struct 

[PATCHv3 2/9] dspbridge: move shared memory iommu maps to tiomap3430.c

2010-06-30 Thread Fernando Guzman Lugo
Now the iommu map of shared memory segments are done in
bridge_brd_start and unmaped in bridge_brd_stop.

NOTE: video sequencer reset is not done in dspbridge anymore,
due to dspbridge does not manage it.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/_tiomap.h|6 +
 drivers/dsp/bridge/core/io_sm.c  |  117 ++--
 drivers/dsp/bridge/core/tiomap3430.c |  353 --
 drivers/dsp/bridge/core/tiomap_io.c  |   11 +-
 4 files changed, 237 insertions(+), 250 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index d13677a..6a822c6 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -310,6 +310,11 @@ static const struct bpwr_clk_t bpwr_clks[] = {
 
 #define CLEAR_BIT_INDEX(reg, index)   (reg = ~(1  (index)))
 
+struct shm_segs {
+   u32 seg0_da, seg0_pa, seg0_va, seg0_size;
+   u32 seg1_da, seg1_pa, seg1_va, seg1_size;
+};
+
 /* This Bridge driver's device context: */
 struct bridge_dev_context {
struct dev_object *hdev_obj;/* Handle to Bridge device object. */
@@ -333,6 +338,7 @@ struct bridge_dev_context {
 
struct omap_mbox *mbox; /* Mail box handle */
struct iommu *dsp_mmu;  /* iommu for iva2 handler */
+   struct shm_segs *sh_s;
 
struct cfg_hostres *resources;  /* Host Resources */
 
diff --git a/drivers/dsp/bridge/core/io_sm.c b/drivers/dsp/bridge/core/io_sm.c
index 1f47f8b..aca9854 100644
--- a/drivers/dsp/bridge/core/io_sm.c
+++ b/drivers/dsp/bridge/core/io_sm.c
@@ -290,8 +290,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
struct cod_manager *cod_man;
struct chnl_mgr *hchnl_mgr;
struct msg_mgr *hmsg_mgr;
-   struct iommu *mmu;
-   struct iotlb_entry e;
+   struct shm_segs *sm_sg;
u32 ul_shm_base;
u32 ul_shm_base_offset;
u32 ul_shm_limit;
@@ -317,14 +316,6 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
u32 shm0_end;
u32 ul_dyn_ext_base;
u32 ul_seg1_size = 0;
-   u32 pa_curr = 0;
-   u32 va_curr = 0;
-   u32 gpp_va_curr = 0;
-   u32 num_bytes = 0;
-   u32 all_bits = 0;
-   u32 page_size[] = { HW_PAGE_SIZE16MB, HW_PAGE_SIZE1MB,
-   HW_PAGE_SIZE64KB, HW_PAGE_SIZE4KB
-   };
 
status = dev_get_bridge_context(hio_mgr-hdev_obj, pbridge_context);
if (!pbridge_context) {
@@ -338,19 +329,12 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
goto func_end;
}
 
-   mmu = pbridge_context-dsp_mmu;
+   sm_sg = kmalloc(sizeof(*sm_sg), GFP_KERNEL);
 
-   if (mmu)
-   iommu_put(mmu);
-   mmu = iommu_get(iva2);
-
-   if (IS_ERR_OR_NULL(mmu)) {
-   pr_err(Error in iommu_get\n);
-   pbridge_context-dsp_mmu = NULL;
-   status = -EFAULT;
+   if (!sm_sg) {
+   status = -ENOMEM;
goto func_end;
}
-   pbridge_context-dsp_mmu = mmu;
 
status = dev_get_cod_mgr(hio_mgr-hdev_obj, cod_man);
if (!cod_man) {
@@ -488,74 +472,16 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
if (DSP_FAILED(status))
goto func_end;
 
-   pa_curr = ul_gpp_pa;
-   va_curr = ul_dyn_ext_base * hio_mgr-word_size;
-   gpp_va_curr = ul_gpp_va;
-   num_bytes = ul_seg1_size;
+   sm_sg-seg1_pa = ul_gpp_pa;
+   sm_sg-seg1_da = ul_dyn_ext_base;
+   sm_sg-seg1_va = ul_gpp_va;
+   sm_sg-seg1_size = ul_seg1_size;
+   sm_sg-seg0_pa = ul_gpp_pa + ul_pad_size + ul_seg1_size;
+   sm_sg-seg0_da = ul_dsp_va;
+   sm_sg-seg0_va = ul_gpp_va + ul_pad_size + ul_seg1_size;
+   sm_sg-seg0_size = ul_seg_size;
 
-   va_curr = iommu_kmap(mmu, va_curr, pa_curr, num_bytes,
-   IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32);
-   if (IS_ERR_VALUE(va_curr)) {
-   status = (int)va_curr;
-   goto func_end;
-   }
-
-   pa_curr += ul_pad_size + num_bytes;
-   va_curr += ul_pad_size + num_bytes;
-   gpp_va_curr += ul_pad_size + num_bytes;
-
-   /* Configure the TLB entries for the next cacheable segment */
-   num_bytes = ul_seg_size;
-   va_curr = ul_dsp_va * hio_mgr-word_size;
-   while (num_bytes) {
-   /*
-* To find the max. page size with which both PA  VA are
-* aligned.
-*/
-   all_bits = pa_curr | va_curr;
-   dev_dbg(bridge, all_bits for Seg1 %x, pa_curr %x, 
-   va_curr %x, num_bytes %x\n, all_bits, pa_curr,
-   va_curr, num_bytes);
-   for (i = 0; i  4; i++) {
-   if (!(num_bytes = page_size[i]) ||
-   !((all_bits  (page_size[i] - 1)) == 0))
-   continue;
-   if (ndx  

RE: [PATCHv3 0/9] dspbridge: iommu migration

2010-06-30 Thread Guzman Lugo, Fernando


Sorry wrong version of the patches. Please discard them.

Sorry for the spam,
Fernando.


 -Original Message-
 From: Guzman Lugo, Fernando
 Sent: Wednesday, June 30, 2010 7:00 PM
 To: linux-omap@vger.kernel.org; linux-ker...@vger.kernel.org
 Cc: o...@wizery.com; hiroshi.d...@nokia.com; ameya.pala...@nokia.com;
 felipe.contre...@nokia.com; Guzman Lugo, Fernando
 Subject: [PATCHv3 0/9] dspbridge: iommu migration
 
 This set of patches remove the dspbridge custom mmu implementation
 and use iommu module instead.
 
 
 NOTE: in order to dspbridge can work properly the patch
 0001-iovmm-add-superpages-support-to-fixed-da-address.patch
 is needed (specifically iommu_kmap calls need this patch).
 
 Fernando Guzman Lugo (9):
   dspbridge: replace iommu custom for opensource implementation
   dspbridge: move shared memory iommu maps to tiomap3430.c
   dspbridge: rename bridge_brd_mem_map/unmap to a proper name
   dspbridge: remove custom mmu code from tiomap3430.c
   dspbridge: add mmufault support
   dspbridge: remove hw directory
   dspbridge: move all iommu related code to a new file
   dspbridge: add map support for big buffers
   dspbridge: cleanup bridge_dev_context and cfg_hostres structures
 
  arch/arm/plat-omap/include/dspbridge/cfgdefs.h  |1 -
  arch/arm/plat-omap/include/dspbridge/dsp-mmu.h  |   90 ++
  arch/arm/plat-omap/include/dspbridge/dspdefs.h  |   44 -
  arch/arm/plat-omap/include/dspbridge/dspdeh.h   |1 -
  arch/arm/plat-omap/include/dspbridge/dspioctl.h |7 -
  drivers/dsp/bridge/Makefile |5 +-
  drivers/dsp/bridge/core/_deh.h  |3 -
  drivers/dsp/bridge/core/_tiomap.h   |   15 +-
  drivers/dsp/bridge/core/dsp-mmu.c   |  229 
  drivers/dsp/bridge/core/io_sm.c |  185 +---
  drivers/dsp/bridge/core/mmu_fault.c |  139 ---
  drivers/dsp/bridge/core/mmu_fault.h |   36 -
  drivers/dsp/bridge/core/tiomap3430.c| 1297 --
 -
  drivers/dsp/bridge/core/tiomap3430_pwr.c|  183 +---
  drivers/dsp/bridge/core/tiomap_io.c |   16 +-
  drivers/dsp/bridge/core/ue_deh.c|   87 +--
  drivers/dsp/bridge/hw/EasiGlobal.h  |   41 -
  drivers/dsp/bridge/hw/GlobalTypes.h |  308 --
  drivers/dsp/bridge/hw/MMUAccInt.h   |   76 --
  drivers/dsp/bridge/hw/MMURegAcM.h   |  226 
  drivers/dsp/bridge/hw/hw_defs.h |   60 --
  drivers/dsp/bridge/hw/hw_mmu.c  |  587 --
  drivers/dsp/bridge/hw/hw_mmu.h  |  161 ---
  drivers/dsp/bridge/pmgr/dev.c   |2 -
  drivers/dsp/bridge/rmgr/drv.c   |4 -
  drivers/dsp/bridge/rmgr/node.c  |4 +-
  drivers/dsp/bridge/rmgr/proc.c  |   19 +-
  27 files changed, 599 insertions(+), 3227 deletions(-)
  create mode 100644 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
  create mode 100644 drivers/dsp/bridge/core/dsp-mmu.c
  delete mode 100644 drivers/dsp/bridge/core/mmu_fault.c
  delete mode 100644 drivers/dsp/bridge/core/mmu_fault.h
  delete mode 100644 drivers/dsp/bridge/hw/EasiGlobal.h
  delete mode 100644 drivers/dsp/bridge/hw/GlobalTypes.h
  delete mode 100644 drivers/dsp/bridge/hw/MMUAccInt.h
  delete mode 100644 drivers/dsp/bridge/hw/MMURegAcM.h
  delete mode 100644 drivers/dsp/bridge/hw/hw_defs.h
  delete mode 100644 drivers/dsp/bridge/hw/hw_mmu.c
  delete mode 100644 drivers/dsp/bridge/hw/hw_mmu.h

--
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/9] dspbridge: iommu migration

2010-06-30 Thread Fernando Guzman Lugo
This set of patches remove the dspbridge custom mmu implementation
and use iommu module instead.


NOTE: in order to dspbridge can work properly the patch
0001-iovmm-add-superpages-support-to-fixed-da-address.patch
is needed (specifically iommu_kmap calls need this patch).

Fernando Guzman Lugo (9):
  dspbridge: replace iommu custom for opensource implementation
  dspbridge: move shared memory iommu maps to tiomap3430.c
  dspbridge: rename bridge_brd_mem_map/unmap to a proper name
  dspbridge: remove custom mmu code from tiomap3430.c
  dspbridge: add mmufault support
  dspbridge: remove hw directory
  dspbridge: move all iommu related code to a new file
  dspbridge: add map support for big buffers
  dspbridge: cleanup bridge_dev_context and cfg_hostres structures

 arch/arm/plat-omap/include/dspbridge/cfgdefs.h  |1 -
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h  |   90 ++
 arch/arm/plat-omap/include/dspbridge/dspdefs.h  |   44 -
 arch/arm/plat-omap/include/dspbridge/dspdeh.h   |1 -
 arch/arm/plat-omap/include/dspbridge/dspioctl.h |7 -
 drivers/dsp/bridge/Makefile |5 +-
 drivers/dsp/bridge/core/_deh.h  |3 -
 drivers/dsp/bridge/core/_tiomap.h   |   15 +-
 drivers/dsp/bridge/core/dsp-mmu.c   |  229 
 drivers/dsp/bridge/core/io_sm.c |  185 +---
 drivers/dsp/bridge/core/mmu_fault.c |  139 ---
 drivers/dsp/bridge/core/mmu_fault.h |   36 -
 drivers/dsp/bridge/core/tiomap3430.c| 1297 ---
 drivers/dsp/bridge/core/tiomap3430_pwr.c|  183 +---
 drivers/dsp/bridge/core/tiomap_io.c |   16 +-
 drivers/dsp/bridge/core/ue_deh.c|   87 +--
 drivers/dsp/bridge/hw/EasiGlobal.h  |   41 -
 drivers/dsp/bridge/hw/GlobalTypes.h |  308 --
 drivers/dsp/bridge/hw/MMUAccInt.h   |   76 --
 drivers/dsp/bridge/hw/MMURegAcM.h   |  226 
 drivers/dsp/bridge/hw/hw_defs.h |   60 --
 drivers/dsp/bridge/hw/hw_mmu.c  |  587 --
 drivers/dsp/bridge/hw/hw_mmu.h  |  161 ---
 drivers/dsp/bridge/pmgr/dev.c   |2 -
 drivers/dsp/bridge/rmgr/drv.c   |4 -
 drivers/dsp/bridge/rmgr/node.c  |4 +-
 drivers/dsp/bridge/rmgr/proc.c  |   19 +-
 27 files changed, 599 insertions(+), 3227 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 create mode 100644 drivers/dsp/bridge/core/dsp-mmu.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.h
 delete mode 100644 drivers/dsp/bridge/hw/EasiGlobal.h
 delete mode 100644 drivers/dsp/bridge/hw/GlobalTypes.h
 delete mode 100644 drivers/dsp/bridge/hw/MMUAccInt.h
 delete mode 100644 drivers/dsp/bridge/hw/MMURegAcM.h
 delete mode 100644 drivers/dsp/bridge/hw/hw_defs.h
 delete mode 100644 drivers/dsp/bridge/hw/hw_mmu.c
 delete mode 100644 drivers/dsp/bridge/hw/hw_mmu.h

--
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/9] dspbridge: rename bridge_brd_mem_map/unmap to a proper name

2010-06-30 Thread Fernando Guzman Lugo
Now these functions only map user space addresses to dsp virtual
addresses, so now the functions have a more meaningful name

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |   44 
 drivers/dsp/bridge/core/_tiomap.h  |   25 +++
 drivers/dsp/bridge/core/tiomap3430.c   |   52 ++--
 drivers/dsp/bridge/pmgr/dev.c  |2 -
 drivers/dsp/bridge/rmgr/proc.c |   12 +++--
 5 files changed, 53 insertions(+), 82 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 493f62e..4f56ae6 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -162,48 +162,6 @@ typedef int(*fxn_brd_memwrite) (struct bridge_dev_context
   u32 ulMemType);
 
 /*
- *   bridge_brd_mem_map 
- *  Purpose:
- *  Map a MPU memory region to a DSP/IVA memory space
- *  Parameters:
- *  hDevContext:Handle to Bridge driver defined device info.
- *  ul_mpu_addr:  MPU memory region start address.
- *  ulVirtAddr: DSP/IVA memory region u8 address.
- *  ul_num_bytes: Number of bytes to map.
- *  map_attrs:   Mapping attributes (e.g. endianness).
- *  Returns:
- *  0:Success.
- *  -EPERM:  Other, unspecified error.
- *  Requires:
- *  hDevContext != NULL;
- *  Ensures:
- */
-typedef int(*fxn_brd_memmap) (struct bridge_dev_context
-* hDevContext, u32 ul_mpu_addr,
-u32 ulVirtAddr, u32 ul_num_bytes,
-u32 ulMapAttrs,
-struct page **mapped_pages);
-
-/*
- *   bridge_brd_mem_un_map 
- *  Purpose:
- *  UnMap an MPU memory region from DSP/IVA memory space
- *  Parameters:
- *  hDevContext:Handle to Bridge driver defined device info.
- *  ulVirtAddr: DSP/IVA memory region u8 address.
- *  ul_num_bytes: Number of bytes to unmap.
- *  Returns:
- *  0:Success.
- *  -EPERM:  Other, unspecified error.
- *  Requires:
- *  hDevContext != NULL;
- *  Ensures:
- */
-typedef int(*fxn_brd_memunmap) (struct bridge_dev_context
-  * hDevContext,
-  u32 ulVirtAddr, u32 ul_num_bytes);
-
-/*
  *   bridge_brd_stop 
  *  Purpose:
  *  Bring board to the BRD_STOPPED state.
@@ -1061,8 +1019,6 @@ struct bridge_drv_interface {
fxn_brd_setstate pfn_brd_set_state; /* Sets the Board State */
fxn_brd_memcopy pfn_brd_mem_copy;   /* Copies DSP Memory */
fxn_brd_memwrite pfn_brd_mem_write; /* Write DSP Memory w/o halt */
-   fxn_brd_memmap pfn_brd_mem_map; /* Maps MPU mem to DSP mem */
-   fxn_brd_memunmap pfn_brd_mem_un_map;/* Unmaps MPU mem to DSP mem */
fxn_chnl_create pfn_chnl_create;/* Create channel manager. */
fxn_chnl_destroy pfn_chnl_destroy;  /* Destroy channel manager. */
fxn_chnl_open pfn_chnl_open;/* Create a new channel. */
diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index 6a822c6..4aa2358 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -396,4 +396,29 @@ static inline void dsp_iotlb_init(struct iotlb_entry *e, 
u32 da, u32 pa,
e-mixed = 0;
 }
 
+/**
+ * user_to_dsp_map() - maps user to dsp virtual address
+ * @mmu:   Pointer to iommu handle.
+ * @uva:   Virtual user space address.
+ * @da DSP address
+ * @size   Buffer size to map.
+ * @usr_pgsstruct page array pointer where the user pages will be stored
+ *
+ * This function maps a user space buffer into DSP virtual address.
+ *
+ */
+
+int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
+   struct page **usr_pgs);
+
+/**
+ * user_to_dsp_unmap() - unmaps DSP virtual buffer.
+ * @mmu:   Pointer to iommu handle.
+ * @da DSP address
+ *
+ * This function unmaps a user space buffer into DSP virtual address.
+ *
+ */
+int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+
 #endif /* _TIOMAP_ */
diff --git a/drivers/dsp/bridge/core/tiomap3430.c 
b/drivers/dsp/bridge/core/tiomap3430.c
index 89d4936..88f5167 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
@@ -98,12 +98,6 @@ static int bridge_brd_mem_copy(struct bridge_dev_context 
*hDevContext,
 static int bridge_brd_mem_write(struct bridge_dev_context *dev_context,
IN u8 *pbHostBuf, u32 dwDSPAddr,
u32 ul_num_bytes, u32 ulMemType);
-static int bridge_brd_mem_map(struct bridge_dev_context 

[PATCH 7/9] dspbridge: move all iommu related code to a new file

2010-06-30 Thread Fernando Guzman Lugo
This patch moves all the code related to iommu in the
dsp-mmu.c file

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h |   90 ++
 arch/arm/plat-omap/include/dspbridge/dspdeh.h  |1 -
 drivers/dsp/bridge/Makefile|2 +-
 drivers/dsp/bridge/core/_deh.h |3 -
 drivers/dsp/bridge/core/_tiomap.h  |   41 +-
 drivers/dsp/bridge/core/dsp-mmu.c  |  218 
 drivers/dsp/bridge/core/mmu_fault.c|   76 
 drivers/dsp/bridge/core/mmu_fault.h|   35 
 drivers/dsp/bridge/core/tiomap3430.c   |  111 +
 drivers/dsp/bridge/core/ue_deh.c   |   68 +---
 drivers/dsp/bridge/rmgr/proc.c |6 +-
 11 files changed, 318 insertions(+), 333 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 create mode 100644 drivers/dsp/bridge/core/dsp-mmu.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.h

diff --git a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h 
b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
new file mode 100644
index 000..266f38b
--- /dev/null
+++ b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
@@ -0,0 +1,90 @@
+/*
+ * dsp-mmu.h
+ *
+ * DSP-BIOS Bridge driver support functions for TI OMAP processors.
+ *
+ * DSP iommu.
+ *
+ * Copyright (C) 2005-2010 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 _DSP_MMU_
+#define _DSP_MMU_
+
+#include plat/iommu.h
+#include plat/iovmm.h
+
+/**
+ * dsp_iotlb_init() - initialize dsp mmu entry
+ * @e: Pointer tbl entry.
+ * @da DSP address
+ * @pa:physical address.
+ * @pgsz   page size to map.
+ *
+ * This function initializes a dsp mmu entry in order to be used with
+ * iommu functions.
+ */
+static inline void dsp_iotlb_init(struct iotlb_entry *e, u32 da, u32 pa,
+   u32 pgsz)
+{
+   e-da = da;
+   e-pa = pa;
+   e-valid = 1;
+   e-prsvd = 1;
+   e-pgsz = pgsz  MMU_CAM_PGSZ_MASK;
+   e-endian = MMU_RAM_ENDIAN_LITTLE;
+   e-elsz = MMU_RAM_ELSZ_32;
+   e-mixed = 0;
+}
+
+/**
+ * dsp_mmu_init() - initialize dsp_mmu module and returns a handle
+ *
+ * This function initialize dsp mmu module and returns a struct iommu
+ * handle to use it for dsp maps.
+ *
+ */
+struct iommu *dsp_mmu_init(void);
+
+/**
+ * dsp_mmu_exit() - destroy dsp mmu module
+ * @mmu:   Pointer to iommu handle.
+ *
+ * This function destroys dsp mmu module.
+ *
+ */
+void dsp_mmu_exit(struct iommu *mmu);
+
+/**
+ * user_to_dsp_map() - maps user to dsp virtual address
+ * @mmu:   Pointer to iommu handle.
+ * @uva:   Virtual user space address.
+ * @da DSP address
+ * @size   Buffer size to map.
+ * @usr_pgsstruct page array pointer where the user pages will be stored
+ *
+ * This function maps a user space buffer into DSP virtual address.
+ *
+ */
+int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
+   struct page **usr_pgs);
+
+/**
+ * user_to_dsp_unmap() - unmaps DSP virtual buffer.
+ * @mmu:   Pointer to iommu handle.
+ * @da DSP address
+ *
+ * This function unmaps a user space buffer into DSP virtual address.
+ *
+ */
+int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+
+#endif
diff --git a/arch/arm/plat-omap/include/dspbridge/dspdeh.h 
b/arch/arm/plat-omap/include/dspbridge/dspdeh.h
index 4394711..af19926 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdeh.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdeh.h
@@ -43,5 +43,4 @@ extern int bridge_deh_register_notify(struct deh_mgr *deh_mgr,
 extern void bridge_deh_notify(struct deh_mgr *deh_mgr,
u32 ulEventMask, u32 dwErrInfo);
 
-extern void bridge_deh_release_dummy_mem(void);
 #endif /* DSPDEH_ */
diff --git a/drivers/dsp/bridge/Makefile b/drivers/dsp/bridge/Makefile
index 66ca10a..9f32055 100644
--- a/drivers/dsp/bridge/Makefile
+++ b/drivers/dsp/bridge/Makefile
@@ -5,7 +5,7 @@ libservices = services/sync.o services/cfg.o \
services/ntfy.o services/services.o
 libcore = core/chnl_sm.o core/msg_sm.o core/io_sm.o core/tiomap3430.o \
core/tiomap3430_pwr.o core/tiomap_io.o \
-   core/mmu_fault.o core/ue_deh.o core/wdt.o core/dsp-clock.o
+   core/dsp-mmu.o core/ue_deh.o core/wdt.o core/dsp-clock.o
 libpmgr = pmgr/chnl.o pmgr/io.o 

[PATCH 8/9] dspbridge: add map support for big buffers

2010-06-30 Thread Fernando Guzman Lugo
due to a restriction in scatter gather lists, it can
not be created a list for a buffer bigger than 1MB.
This patch is spliting big mappings into 1MB mappings.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h |2 +-
 drivers/dsp/bridge/core/dsp-mmu.c  |   55 ++-
 drivers/dsp/bridge/rmgr/proc.c |3 +-
 3 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h 
b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
index 266f38b..2e4bf6a 100644
--- a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
+++ b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
@@ -85,6 +85,6 @@ int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 
size,
  * This function unmaps a user space buffer into DSP virtual address.
  *
  */
-int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+int user_to_dsp_unmap(struct iommu *mmu, u32 da, unsigned size);
 
 #endif
diff --git a/drivers/dsp/bridge/core/dsp-mmu.c 
b/drivers/dsp/bridge/core/dsp-mmu.c
index e8da327..9a46206 100644
--- a/drivers/dsp/bridge/core/dsp-mmu.c
+++ b/drivers/dsp/bridge/core/dsp-mmu.c
@@ -133,7 +133,7 @@ int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 
size,
struct page **usr_pgs)
 {
int res, w;
-   unsigned pages, i;
+   unsigned pages, i, j = 0;
struct vm_area_struct *vma;
struct mm_struct *mm = current-mm;
struct sg_table *sgt;
@@ -162,24 +162,31 @@ int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, 
u32 size,
if (res  0)
return res;
 
-   sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
+   while (pages) {
+   sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
 
-   if (!sgt)
-   return -ENOMEM;
+   if (!sgt)
+   return -ENOMEM;
 
-   res = sg_alloc_table(sgt, pages, GFP_KERNEL);
+   res = sg_alloc_table(sgt,
+   min((unsigned)SG_MAX_SINGLE_ALLOC, pages), GFP_KERNEL);
+   pages -= min((unsigned)SG_MAX_SINGLE_ALLOC, pages);
 
-   if (res  0)
-   goto err_sg;
+   if (res  0)
+   goto err_sg;
+
+   for_each_sg(sgt-sgl, sg, sgt-nents, i)
+   sg_set_page(sg, usr_pgs[j++], PAGE_SIZE, 0);
 
-   for_each_sg(sgt-sgl, sg, sgt-nents, i)
-   sg_set_page(sg, usr_pgs[i], PAGE_SIZE, 0);
+   da = iommu_vmap(mmu, da, sgt, IOVMF_ENDIAN_LITTLE |
+   IOVMF_ELSZ_32);
 
-   da = iommu_vmap(mmu, da, sgt, IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32);
+   if (IS_ERR_VALUE(da)) {
+   res = (int)da;
+   goto err_map;
+   }
 
-   if (IS_ERR_VALUE(da)) {
-   res = (int)da;
-   goto err_map;
+   da += SG_MAX_SINGLE_ALLOC * PAGE_SIZE;
}
return 0;
 
@@ -198,21 +205,25 @@ err_sg:
  * This function unmaps a user space buffer into DSP virtual address.
  *
  */
-int user_to_dsp_unmap(struct iommu *mmu, u32 da)
+int user_to_dsp_unmap(struct iommu *mmu, u32 da, unsigned size)
 {
unsigned i;
struct sg_table *sgt;
struct scatterlist *sg;
+   const unsigned max_sz = SG_MAX_SINGLE_ALLOC * PAGE_SIZE;
 
-   sgt = iommu_vunmap(mmu, da);
-   if (!sgt)
-   return -EFAULT;
-
-   for_each_sg(sgt-sgl, sg, sgt-nents, i)
-   put_page(sg_page(sg));
+   while (size) {
+   size -= min(max_sz, size);
+   sgt = iommu_vunmap(mmu, da);
+   if (!sgt)
+   return -EFAULT;
 
-   sg_free_table(sgt);
-   kfree(sgt);
+   for_each_sg(sgt-sgl, sg, sgt-nents, i)
+   put_page(sg_page(sg));
 
+   sg_free_table(sgt);
+   kfree(sgt);
+   da += max_sz;
+   }
return 0;
 }
diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 4f10a41..997918e 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -1713,7 +1713,8 @@ int proc_un_map(void *hprocessor, void *map_addr,
/* Remove mapping from the page tables. */
if (DSP_SUCCEEDED(status)) {
status = user_to_dsp_unmap(
-   p_proc_object-hbridge_context-dsp_mmu, va_align);
+   p_proc_object-hbridge_context-dsp_mmu,
+   va_align, size_align);
}
 
mutex_unlock(proc_lock);
-- 
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 9/9] dspbridge: cleanup bridge_dev_context and cfg_hostres structures

2010-06-30 Thread Fernando Guzman Lugo
this patch cleans up cfg_hostres and bridge_dev_context
structures of custom mmu code not needed anymore.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cfgdefs.h |1 -
 drivers/dsp/bridge/core/_tiomap.h  |5 -
 drivers/dsp/bridge/core/tiomap3430.c   |8 
 drivers/dsp/bridge/core/tiomap_io.c|2 +-
 drivers/dsp/bridge/rmgr/drv.c  |4 
 5 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h 
b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
index 38122db..dfb55cc 100644
--- a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
@@ -68,7 +68,6 @@ struct cfg_hostres {
void __iomem *dw_per_base;
u32 dw_per_pm_base;
u32 dw_core_pm_base;
-   void __iomem *dw_dmmu_base;
void __iomem *dw_sys_ctrl_base;
 };
 
diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index 8a9a822..82bce7d 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -323,7 +323,6 @@ struct bridge_dev_context {
 */
u32 dw_dsp_ext_base_addr;   /* See the comment above */
u32 dw_api_reg_base;/* API mem map'd registers */
-   void __iomem *dw_dsp_mmu_base;  /* DSP MMU Mapped registers */
u32 dw_api_clk_base;/* CLK Registers */
u32 dw_dsp_clk_m2_base; /* DSP Clock Module m2 */
u32 dw_public_rhea; /* Pub Rhea */
@@ -347,10 +346,6 @@ struct bridge_dev_context {
/* DMMU TLB entries */
struct bridge_ioctl_extproc atlb_entry[BRDIOCTL_NUMOFMMUTLB];
u32 dw_brd_state;   /* Last known board state. */
-   u32 ul_int_mask;/* int mask */
-   u16 io_base;/* Board I/O base */
-   u32 num_tlb_entries;/* DSP MMU TLB entry counter */
-   u32 fixed_tlb_entries;  /* Fixed DSPMMU TLB entry count */
 
/* TC Settings */
bool tc_word_swap_on;   /* Traffic Controller Word Swap */
diff --git a/drivers/dsp/bridge/core/tiomap3430.c 
b/drivers/dsp/bridge/core/tiomap3430.c
index aa6e999..83a9561 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
@@ -753,7 +753,6 @@ static int bridge_dev_create(OUT struct bridge_dev_context
dev_context-atlb_entry[entry_ndx].ul_gpp_pa =
dev_context-atlb_entry[entry_ndx].ul_dsp_va = 0;
}
-   dev_context-num_tlb_entries = 0;
dev_context-dw_dsp_base_addr = (u32) MEM_LINEAR_ADDRESS((void *)
 (pConfig-
  dw_mem_base
@@ -766,11 +765,7 @@ static int bridge_dev_create(OUT struct bridge_dev_context
 
if (DSP_SUCCEEDED(status)) {
dev_context-tc_word_swap_on = drv_datap-tc_wordswapon;
-   /* MMU address is obtained from the host
-* resources struct */
-   dev_context-dw_dsp_mmu_base = resources-dw_dmmu_base;
dev_context-hdev_obj = hdev_obj;
-   dev_context-ul_int_mask = 0;
/* Store current board state. */
dev_context-dw_brd_state = BRD_STOPPED;
dev_context-resources = resources;
@@ -887,8 +882,6 @@ static int bridge_dev_destroy(struct bridge_dev_context 
*hDevContext)
iounmap((void *)host_res-dw_mem_base[3]);
if (host_res-dw_mem_base[4])
iounmap((void *)host_res-dw_mem_base[4]);
-   if (host_res-dw_dmmu_base)
-   iounmap(host_res-dw_dmmu_base);
if (host_res-dw_per_base)
iounmap(host_res-dw_per_base);
if (host_res-dw_per_pm_base)
@@ -902,7 +895,6 @@ static int bridge_dev_destroy(struct bridge_dev_context 
*hDevContext)
host_res-dw_mem_base[2] = (u32) NULL;
host_res-dw_mem_base[3] = (u32) NULL;
host_res-dw_mem_base[4] = (u32) NULL;
-   host_res-dw_dmmu_base = NULL;
host_res-dw_sys_ctrl_base = NULL;
 
kfree(host_res);
diff --git a/drivers/dsp/bridge/core/tiomap_io.c 
b/drivers/dsp/bridge/core/tiomap_io.c
index 3c0d3a3..2f2f8c2 100644
--- a/drivers/dsp/bridge/core/tiomap_io.c
+++ b/drivers/dsp/bridge/core/tiomap_io.c
@@ -437,7 +437,7 @@ int sm_interrupt_dsp(struct bridge_dev_context 
*dev_context, u16 mb_val)
omap_mbox_restore_ctx(dev_context-mbox);
 
/* Access MMU SYS CONFIG register to generate a short wakeup */
-   __raw_readl(resources-dw_dmmu_base + 0x10);
+   iommu_read_reg(dev_context-dsp_mmu, MMU_SYSCONFIG);
 
dev_context-dw_brd_state = BRD_RUNNING;
} else if (dev_context-dw_brd_state == BRD_RETENTION) 

[PATCH 1/9] dspbridge: replace iommu custom for opensource implementation

2010-06-30 Thread Fernando Guzman Lugo
This patch replace the call to custom dsp mmu implemenation
for the once on iommu module.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/_tiomap.h|   16 +
 drivers/dsp/bridge/core/io_sm.c  |  114 ++--
 drivers/dsp/bridge/core/tiomap3430.c |  501 +-
 drivers/dsp/bridge/core/ue_deh.c |   10 -
 4 files changed, 118 insertions(+), 523 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index bf0164e..d13677a 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -23,6 +23,8 @@
 #include plat/clockdomain.h
 #include mach-omap2/prm-regbits-34xx.h
 #include mach-omap2/cm-regbits-34xx.h
+#include plat/iommu.h
+#include plat/iovmm.h
 #include dspbridge/devdefs.h
 #include hw_defs.h
 #include dspbridge/dspioctl.h/* for bridge_ioctl_extproc defn */
@@ -330,6 +332,7 @@ struct bridge_dev_context {
u32 dw_internal_size;   /* Internal memory size */
 
struct omap_mbox *mbox; /* Mail box handle */
+   struct iommu *dsp_mmu;  /* iommu for iva2 handler */
 
struct cfg_hostres *resources;  /* Host Resources */
 
@@ -374,4 +377,17 @@ extern s32 dsp_debug;
  */
 int sm_interrupt_dsp(struct bridge_dev_context *dev_context, u16 mb_val);
 
+static inline void dsp_iotlb_init(struct iotlb_entry *e, u32 da, u32 pa,
+   u32 pgsz)
+{
+   e-da = da;
+   e-pa = pa;
+   e-valid = 1;
+   e-prsvd = 1;
+   e-pgsz = pgsz  MMU_CAM_PGSZ_MASK;
+   e-endian = MMU_RAM_ENDIAN_LITTLE;
+   e-elsz = MMU_RAM_ELSZ_32;
+   e-mixed = 0;
+}
+
 #endif /* _TIOMAP_ */
diff --git a/drivers/dsp/bridge/core/io_sm.c b/drivers/dsp/bridge/core/io_sm.c
index 7fb840d..1f47f8b 100644
--- a/drivers/dsp/bridge/core/io_sm.c
+++ b/drivers/dsp/bridge/core/io_sm.c
@@ -290,6 +290,8 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
struct cod_manager *cod_man;
struct chnl_mgr *hchnl_mgr;
struct msg_mgr *hmsg_mgr;
+   struct iommu *mmu;
+   struct iotlb_entry e;
u32 ul_shm_base;
u32 ul_shm_base_offset;
u32 ul_shm_limit;
@@ -312,7 +314,6 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
struct bridge_ioctl_extproc ae_proc[BRDIOCTL_NUMOFMMUTLB];
struct cfg_hostres *host_res;
struct bridge_dev_context *pbridge_context;
-   u32 map_attrs;
u32 shm0_end;
u32 ul_dyn_ext_base;
u32 ul_seg1_size = 0;
@@ -336,6 +337,21 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = -EFAULT;
goto func_end;
}
+
+   mmu = pbridge_context-dsp_mmu;
+
+   if (mmu)
+   iommu_put(mmu);
+   mmu = iommu_get(iva2);
+
+   if (IS_ERR_OR_NULL(mmu)) {
+   pr_err(Error in iommu_get\n);
+   pbridge_context-dsp_mmu = NULL;
+   status = -EFAULT;
+   goto func_end;
+   }
+   pbridge_context-dsp_mmu = mmu;
+
status = dev_get_cod_mgr(hio_mgr-hdev_obj, cod_man);
if (!cod_man) {
status = -EFAULT;
@@ -477,55 +493,16 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
gpp_va_curr = ul_gpp_va;
num_bytes = ul_seg1_size;
 
-   /*
-* Try to fit into TLB entries. If not possible, push them to page
-* tables. It is quite possible that if sections are not on
-* bigger page boundary, we may end up making several small pages.
-* So, push them onto page tables, if that is the case.
-*/
-   map_attrs = 0x;
-   map_attrs = DSP_MAPLITTLEENDIAN;
-   map_attrs |= DSP_MAPPHYSICALADDR;
-   map_attrs |= DSP_MAPELEMSIZE32;
-   map_attrs |= DSP_MAPDONOTLOCK;
-
-   while (num_bytes) {
-   /*
-* To find the max. page size with which both PA  VA are
-* aligned.
-*/
-   all_bits = pa_curr | va_curr;
-   dev_dbg(bridge, all_bits %x, pa_curr %x, va_curr %x, 
-   num_bytes %x\n, all_bits, pa_curr, va_curr,
-   num_bytes);
-   for (i = 0; i  4; i++) {
-   if ((num_bytes = page_size[i])  ((all_bits 
-(page_size[i] -
- 1)) == 0)) {
-   status =
-   hio_mgr-intf_fxns-
-   pfn_brd_mem_map(hio_mgr-hbridge_context,
-   pa_curr, va_curr,
-   page_size[i], map_attrs,
-   NULL);
-   if (DSP_FAILED(status))
-   goto func_end;
- 

[PATCH 4/9] dspbridge: remove custom mmu code from tiomap3430.c

2010-06-30 Thread Fernando Guzman Lugo
This patch removes all the custom mmu code remaining in
tiomap3430.c which is not needed anymore.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/_tiomap.h|1 -
 drivers/dsp/bridge/core/tiomap3430.c |  470 --
 2 files changed, 0 insertions(+), 471 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index 4aa2358..c41fd8e 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -356,7 +356,6 @@ struct bridge_dev_context {
 
/* TC Settings */
bool tc_word_swap_on;   /* Traffic Controller Word Swap */
-   struct pg_table_attrs *pt_attrs;
u32 dsp_per_clks;
 };
 
diff --git a/drivers/dsp/bridge/core/tiomap3430.c 
b/drivers/dsp/bridge/core/tiomap3430.c
index 88f5167..96cceea 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
@@ -105,56 +105,9 @@ static int bridge_dev_create(OUT struct bridge_dev_context
 static int bridge_dev_ctrl(struct bridge_dev_context *dev_context,
  u32 dw_cmd, IN OUT void *pargs);
 static int bridge_dev_destroy(struct bridge_dev_context *dev_context);
-static u32 user_va2_pa(struct mm_struct *mm, u32 address);
-static int pte_update(struct bridge_dev_context *hDevContext, u32 pa,
-u32 va, u32 size,
-struct hw_mmu_map_attrs_t *map_attrs);
-static int pte_set(struct pg_table_attrs *pt, u32 pa, u32 va,
- u32 size, struct hw_mmu_map_attrs_t *attrs);
-static int mem_map_vmalloc(struct bridge_dev_context *hDevContext,
- u32 ul_mpu_addr, u32 ulVirtAddr,
- u32 ul_num_bytes,
- struct hw_mmu_map_attrs_t *hw_attrs);
 
 bool wait_for_start(struct bridge_dev_context *dev_context, u32 dw_sync_addr);
 
-/*  --- Globals */
-
-/* Attributes of L2 page tables for DSP MMU */
-struct page_info {
-   u32 num_entries;/* Number of valid PTEs in the L2 PT */
-};
-
-/* Attributes used to manage the DSP MMU page tables */
-struct pg_table_attrs {
-   spinlock_t pg_lock; /* Critical section object handle */
-
-   u32 l1_base_pa; /* Physical address of the L1 PT */
-   u32 l1_base_va; /* Virtual  address of the L1 PT */
-   u32 l1_size;/* Size of the L1 PT */
-   u32 l1_tbl_alloc_pa;
-   /* Physical address of Allocated mem for L1 table. May not be aligned */
-   u32 l1_tbl_alloc_va;
-   /* Virtual address of Allocated mem for L1 table. May not be aligned */
-   u32 l1_tbl_alloc_sz;
-   /* Size of consistent memory allocated for L1 table.
-* May not be aligned */
-
-   u32 l2_base_pa; /* Physical address of the L2 PT */
-   u32 l2_base_va; /* Virtual  address of the L2 PT */
-   u32 l2_size;/* Size of the L2 PT */
-   u32 l2_tbl_alloc_pa;
-   /* Physical address of Allocated mem for L2 table. May not be aligned */
-   u32 l2_tbl_alloc_va;
-   /* Virtual address of Allocated mem for L2 table. May not be aligned */
-   u32 l2_tbl_alloc_sz;
-   /* Size of consistent memory allocated for L2 table.
-* May not be aligned */
-
-   u32 l2_num_pages;   /* Number of allocated L2 PT */
-   /* Array [l2_num_pages] of L2 PT info structs */
-   struct page_info *pg_info;
-};
 
 /*
  *  This Bridge driver's function interface table.
@@ -210,32 +163,6 @@ static struct bridge_drv_interface drv_interface_fxns = {
bridge_msg_set_queue_id,
 };
 
-static inline void tlb_flush_all(const void __iomem *base)
-{
-   __raw_writeb(__raw_readb(base + MMU_GFLUSH) | 1, base + MMU_GFLUSH);
-}
-
-static inline void flush_all(struct bridge_dev_context *dev_context)
-{
-   if (dev_context-dw_brd_state == BRD_DSP_HIBERNATION ||
-   dev_context-dw_brd_state == BRD_HIBERNATION)
-   wake_dsp(dev_context, NULL);
-
-   tlb_flush_all(dev_context-dw_dsp_mmu_base);
-}
-
-static void bad_page_dump(u32 pa, struct page *pg)
-{
-   pr_emerg(DSPBRIDGE: MAP function: COUNT 0 FOR PA 0x%x\n, pa);
-   pr_emerg(Bad page state in process '%s'\n
-page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n
-Backtrace:\n,
-current-comm, pg, (int)(2 * sizeof(unsigned long)),
-(unsigned long)pg-flags, pg-mapping,
-page_mapcount(pg), page_count(pg));
-   dump_stack();
-}
-
 /*
  *   bridge_drv_entry 
  *  purpose:
@@ -637,7 +564,6 @@ static int bridge_brd_stop(struct bridge_dev_context 
*hDevContext)
 {
int status = 0;
struct bridge_dev_context *dev_context = hDevContext;
-   struct pg_table_attrs *pt_attrs;
u32 dsp_pwr_state;
int clk_status;
struct 

[PATCH 5/9] dspbridge: add mmufault support

2010-06-30 Thread Fernando Guzman Lugo
With changes for iommu migration mmu fault report and dsp track
dump is broken, this patch fixes that.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/mmu_fault.c  |   93 ++---
 drivers/dsp/bridge/core/mmu_fault.h  |5 +-
 drivers/dsp/bridge/core/tiomap3430.c |2 +
 drivers/dsp/bridge/core/ue_deh.c |   31 +---
 4 files changed, 34 insertions(+), 97 deletions(-)

diff --git a/drivers/dsp/bridge/core/mmu_fault.c 
b/drivers/dsp/bridge/core/mmu_fault.c
index 5c0124f..d991c6a 100644
--- a/drivers/dsp/bridge/core/mmu_fault.c
+++ b/drivers/dsp/bridge/core/mmu_fault.c
@@ -23,9 +23,12 @@
 /*  --- Trace  Debug */
 #include dspbridge/host_os.h
 #include dspbridge/dbc.h
+#include plat/iommu.h
 
 /*  --- OS Adaptation Layer */
 #include dspbridge/drv.h
+#include dspbridge/dev.h
+
 
 /*  --- Link Driver */
 #include dspbridge/dspdeh.h
@@ -40,11 +43,6 @@
 #include _tiomap.h
 #include mmu_fault.h
 
-static u32 dmmu_event_mask;
-u32 fault_addr;
-
-static bool mmu_check_if_fault(struct bridge_dev_context *dev_context);
-
 /*
  *   mmu_fault_dpc 
  *  Deferred procedure call to handle DSP MMU fault.
@@ -62,78 +60,21 @@ void mmu_fault_dpc(IN unsigned long pRefData)
  *   mmu_fault_isr 
  *  ISR to be triggered by a DSP MMU fault interrupt.
  */
-irqreturn_t mmu_fault_isr(int irq, IN void *pRefData)
-{
-   struct deh_mgr *deh_mgr_obj = (struct deh_mgr *)pRefData;
-   struct bridge_dev_context *dev_context;
-   struct cfg_hostres *resources;
-
-   DBC_REQUIRE(irq == INT_DSP_MMU_IRQ);
-   DBC_REQUIRE(deh_mgr_obj);
-
-   if (deh_mgr_obj) {
-
-   dev_context =
-   (struct bridge_dev_context *)deh_mgr_obj-hbridge_context;
-
-   resources = dev_context-resources;
-
-   if (!resources) {
-   dev_dbg(bridge, %s: Failed to get Host Resources\n,
-   __func__);
-   return IRQ_HANDLED;
-   }
-   if (mmu_check_if_fault(dev_context)) {
-   printk(KERN_INFO * DSPMMU FAULT * IRQStatus 
-  0x%x\n, dmmu_event_mask);
-   printk(KERN_INFO * DSPMMU FAULT * fault_addr 
-  0x%x\n, fault_addr);
-   /*
-* Schedule a DPC directly. In the future, it may be
-* necessary to check if DSP MMU fault is intended for
-* Bridge.
-*/
-   tasklet_schedule(deh_mgr_obj-dpc_tasklet);
-
-   /* Reset err_info structure before use. */
-   deh_mgr_obj-err_info.dw_err_mask = DSP_MMUFAULT;
-   deh_mgr_obj-err_info.dw_val1 = fault_addr  16;
-   deh_mgr_obj-err_info.dw_val2 = fault_addr  0x;
-   deh_mgr_obj-err_info.dw_val3 = 0L;
-   /* Disable the MMU events, else once we clear it will
-* start to raise INTs again */
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-HW_MMU_TRANSLATION_FAULT);
-   } else {
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-HW_MMU_ALL_INTERRUPTS);
-   }
-   }
-   return IRQ_HANDLED;
-}
+int mmu_fault_isr(struct iommu *mmu)
 
-/*
- *   mmu_check_if_fault 
- *  Check to see if MMU Fault is valid TLB miss from DSP
- *  Note: This function is called from an ISR
- */
-static bool mmu_check_if_fault(struct bridge_dev_context *dev_context)
 {
+   struct deh_mgr *dm;
+   u32 da;
+
+   dev_get_deh_mgr(dev_get_first(), dm);
+
+   if (!dm)
+   return -EPERM;
+
+   da = iommu_read_reg(mmu, MMU_FAULT_AD);
+   iommu_write_reg(mmu, 0, MMU_IRQENABLE);
+   dm-err_info.dw_val1 = da;
+   tasklet_schedule(dm-dpc_tasklet);
 
-   bool ret = false;
-   hw_status hw_status_obj;
-   struct cfg_hostres *resources = dev_context-resources;
-
-   if (!resources) {
-   dev_dbg(bridge, %s: Failed to get Host Resources in\n,
-   __func__);
-   return ret;
-   }
-   hw_status_obj =
-   hw_mmu_event_status(resources-dw_dmmu_base, dmmu_event_mask);
-   if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) {
-   hw_mmu_fault_addr_read(resources-dw_dmmu_base, fault_addr);
-   ret = true;
-   }
-   return ret;
+   return 0;
 }
diff --git a/drivers/dsp/bridge/core/mmu_fault.h 
b/drivers/dsp/bridge/core/mmu_fault.h
index 74db489..df3fba6 100644
--- a/drivers/dsp/bridge/core/mmu_fault.h

[PATCH 2/9] dspbridge: move shared memory iommu maps to tiomap3430.c

2010-06-30 Thread Fernando Guzman Lugo
Now the iommu map of shared memory segments are done in
bridge_brd_start and unmaped in bridge_brd_stop.

NOTE: video sequencer reset is not done in dspbridge anymore,
due to dspbridge does not manage it.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/core/_tiomap.h|6 +
 drivers/dsp/bridge/core/io_sm.c  |  117 ++--
 drivers/dsp/bridge/core/tiomap3430.c |  353 --
 drivers/dsp/bridge/core/tiomap_io.c  |   11 +-
 4 files changed, 237 insertions(+), 250 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h 
b/drivers/dsp/bridge/core/_tiomap.h
index d13677a..6a822c6 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
@@ -310,6 +310,11 @@ static const struct bpwr_clk_t bpwr_clks[] = {
 
 #define CLEAR_BIT_INDEX(reg, index)   (reg = ~(1  (index)))
 
+struct shm_segs {
+   u32 seg0_da, seg0_pa, seg0_va, seg0_size;
+   u32 seg1_da, seg1_pa, seg1_va, seg1_size;
+};
+
 /* This Bridge driver's device context: */
 struct bridge_dev_context {
struct dev_object *hdev_obj;/* Handle to Bridge device object. */
@@ -333,6 +338,7 @@ struct bridge_dev_context {
 
struct omap_mbox *mbox; /* Mail box handle */
struct iommu *dsp_mmu;  /* iommu for iva2 handler */
+   struct shm_segs *sh_s;
 
struct cfg_hostres *resources;  /* Host Resources */
 
diff --git a/drivers/dsp/bridge/core/io_sm.c b/drivers/dsp/bridge/core/io_sm.c
index 1f47f8b..aca9854 100644
--- a/drivers/dsp/bridge/core/io_sm.c
+++ b/drivers/dsp/bridge/core/io_sm.c
@@ -290,8 +290,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
struct cod_manager *cod_man;
struct chnl_mgr *hchnl_mgr;
struct msg_mgr *hmsg_mgr;
-   struct iommu *mmu;
-   struct iotlb_entry e;
+   struct shm_segs *sm_sg;
u32 ul_shm_base;
u32 ul_shm_base_offset;
u32 ul_shm_limit;
@@ -317,14 +316,6 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
u32 shm0_end;
u32 ul_dyn_ext_base;
u32 ul_seg1_size = 0;
-   u32 pa_curr = 0;
-   u32 va_curr = 0;
-   u32 gpp_va_curr = 0;
-   u32 num_bytes = 0;
-   u32 all_bits = 0;
-   u32 page_size[] = { HW_PAGE_SIZE16MB, HW_PAGE_SIZE1MB,
-   HW_PAGE_SIZE64KB, HW_PAGE_SIZE4KB
-   };
 
status = dev_get_bridge_context(hio_mgr-hdev_obj, pbridge_context);
if (!pbridge_context) {
@@ -338,19 +329,12 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
goto func_end;
}
 
-   mmu = pbridge_context-dsp_mmu;
+   sm_sg = kmalloc(sizeof(*sm_sg), GFP_KERNEL);
 
-   if (mmu)
-   iommu_put(mmu);
-   mmu = iommu_get(iva2);
-
-   if (IS_ERR_OR_NULL(mmu)) {
-   pr_err(Error in iommu_get\n);
-   pbridge_context-dsp_mmu = NULL;
-   status = -EFAULT;
+   if (!sm_sg) {
+   status = -ENOMEM;
goto func_end;
}
-   pbridge_context-dsp_mmu = mmu;
 
status = dev_get_cod_mgr(hio_mgr-hdev_obj, cod_man);
if (!cod_man) {
@@ -488,74 +472,16 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
if (DSP_FAILED(status))
goto func_end;
 
-   pa_curr = ul_gpp_pa;
-   va_curr = ul_dyn_ext_base * hio_mgr-word_size;
-   gpp_va_curr = ul_gpp_va;
-   num_bytes = ul_seg1_size;
+   sm_sg-seg1_pa = ul_gpp_pa;
+   sm_sg-seg1_da = ul_dyn_ext_base;
+   sm_sg-seg1_va = ul_gpp_va;
+   sm_sg-seg1_size = ul_seg1_size;
+   sm_sg-seg0_pa = ul_gpp_pa + ul_pad_size + ul_seg1_size;
+   sm_sg-seg0_da = ul_dsp_va;
+   sm_sg-seg0_va = ul_gpp_va + ul_pad_size + ul_seg1_size;
+   sm_sg-seg0_size = ul_seg_size;
 
-   va_curr = iommu_kmap(mmu, va_curr, pa_curr, num_bytes,
-   IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32);
-   if (IS_ERR_VALUE(va_curr)) {
-   status = (int)va_curr;
-   goto func_end;
-   }
-
-   pa_curr += ul_pad_size + num_bytes;
-   va_curr += ul_pad_size + num_bytes;
-   gpp_va_curr += ul_pad_size + num_bytes;
-
-   /* Configure the TLB entries for the next cacheable segment */
-   num_bytes = ul_seg_size;
-   va_curr = ul_dsp_va * hio_mgr-word_size;
-   while (num_bytes) {
-   /*
-* To find the max. page size with which both PA  VA are
-* aligned.
-*/
-   all_bits = pa_curr | va_curr;
-   dev_dbg(bridge, all_bits for Seg1 %x, pa_curr %x, 
-   va_curr %x, num_bytes %x\n, all_bits, pa_curr,
-   va_curr, num_bytes);
-   for (i = 0; i  4; i++) {
-   if (!(num_bytes = page_size[i]) ||
-   !((all_bits  (page_size[i] - 1)) == 0))
-   continue;
-   if (ndx  

RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

2010-06-30 Thread Gopinath, Thara


-Original Message-
From: Kevin Hilman [mailto:khil...@deeprootsystems.com]
Sent: Thursday, July 01, 2010 2:09 AM
To: Gopinath, Thara
Cc: linux-omap@vger.kernel.org; p...@pwsan.com
Subject: Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Gopinath, Thara th...@ti.com writes:

[...]

+static int __init omap_common_pm_init(void)
+{
+  omap_init_processor_devices();
+  omap_pm_if_init();
+
+  return 0;
+}
+device_initcall(omap_common_pm_init);


 But I guess opp layer is still getting initialized before this. Esp if
 the board files are initializing the opp structures. Or do you have a
 patch to fix it in some other branch ?


The common OPP init will be done in this function as well (see current
PM branch.)  Board files no longer do OPP init (by default) as it is
handled by common code.  Only boards that add OPPs need to call the init
function, and we'll have to figure out way to handle that late.

Yes you are correct. The common OPP init is done in this function. One other 
thing I am a bit worried about is the order of initializations. The order 
should be
Opp layer
Voltage layer
Smartreflex device layer.

Presently all three layers are device_initcalls. The sequence is maintained due 
to the way these drivers are compiled in. We need to make them work independent 
of the way the drivers are compiled.
One way is to have the omap_common_pm_init call into the inits of all these 
layers sequentially and
remove the separate init calls. Any other suggestion anyone?

Kevin, by the way your latest pm-sr branch with the above changes works. I 
tested it yesterday.

Regards
Thara
--
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 10/13] OMAP: create omap_devices for MPU, DSP, L3

2010-06-30 Thread Gopinath, Thara


-Original Message-
From: Shilimkar, Santosh
Sent: Thursday, July 01, 2010 9:46 AM
To: Gopinath, Thara; Kevin Hilman
Cc: linux-omap@vger.kernel.org; p...@pwsan.com
Subject: RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

 -Original Message-
 From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Gopinath, Thara
 Sent: Thursday, July 01, 2010 9:35 AM
 To: Kevin Hilman
 Cc: linux-omap@vger.kernel.org; p...@pwsan.com
 Subject: RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3



 -Original Message-
 From: Kevin Hilman [mailto:khil...@deeprootsystems.com]
 Sent: Thursday, July 01, 2010 2:09 AM
 To: Gopinath, Thara
 Cc: linux-omap@vger.kernel.org; p...@pwsan.com
 Subject: Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3
 
 Gopinath, Thara th...@ti.com writes:
 
 [...]
 
 +static int __init omap_common_pm_init(void)
 +{
 +  omap_init_processor_devices();
 +  omap_pm_if_init();
 +
 +  return 0;
 +}
 +device_initcall(omap_common_pm_init);
 
 
  But I guess opp layer is still getting initialized before this. Esp if
  the board files are initializing the opp structures. Or do you have a
  patch to fix it in some other branch ?
 
 
 The common OPP init will be done in this function as well (see current
 PM branch.)  Board files no longer do OPP init (by default) as it is
 handled by common code.  Only boards that add OPPs need to call the init
 function, and we'll have to figure out way to handle that late.

 Yes you are correct. The common OPP init is done in this function. One
 other thing I am a bit worried about is the order of initializations. The
 order should be
 Opp layer
 Voltage layer
 Smartreflex device layer.

 Presently all three layers are device_initcalls. The sequence is
 maintained due to the way these drivers are compiled in. We need to make
 them work independent of the way the drivers are compiled.
 One way is to have the omap_common_pm_init call into the inits of all
 these layers sequentially and
 remove the separate init calls. Any other suggestion anyone?

Grouping the initcalls is good idea but with this you can never be
able to build any of these as loadable modules.
This is valid only if any of above you plan to build as loadable module

I do not think we need to build voltage, opp and smartreflex as modules. I 
would consider them as system critical layers and should be part of the basic 
kernel. Do you see a use case where these layers need to be modules? Also all 
these layers are stand alone libraries. Not registered with any bus or 
anything. So we will have to do some work if we need to load them as modules.

Regards
Thara
--
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