USB Ethernet gadget seems doesn't work with current mainline

2010-11-05 Thread Enric Balletbò i Serra
Hello all,

With current mainline and stable 2.6.35.y branch I've some strange
features with USB ethernet gadget ...

  r...@igep0020:~# uname -a
  Linux igep0020 2.6.37-rc1+ #1 Fri Nov 5 09:22:53 CET 2010 armv7l
unknown unknown GNU/Linux

  r...@igep0020:~# ifconfig
  usb0  Link encap:Ethernet  HWaddr 5A:A9:54:25:4C:04
  inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
  inet6 addr: fe80::58a9:54ff:fe25:4c04/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:0 (0.0 B)  TX bytes:4951 (4.8 KiB)

Pinging seems not work

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 0 packets received, 100% packet loss

Curiously if I unplug and plug the USB cable, and ping again ...

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  64 bytes from 192.168.7.1: seq=0 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=1 ttl=64 time=0.489 ms
  64 bytes from 192.168.7.1: seq=2 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=3 ttl=64 time=0.366 ms
  64 bytes from 192.168.7.1: seq=4 ttl=64 time=0.396 ms

  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 5 packets received, 0% packet loss
 round-trip min/avg/max = 0.366/0.409/0.489 ms

Works, anyone knows if the ethernet gadget is broken in current
mainline or have observed this feature ?

Thanks in advance,
   Enric
--
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: USB Ethernet gadget seems doesn't work with current mainline

2010-11-05 Thread Grazvydas Ignotas
hi,

On Fri, Nov 5, 2010 at 10:39 AM, Enric Balletbò i Serra
eballe...@gmail.com wrote:
 Hello all,

 With current mainline and stable 2.6.35.y branch I've some strange
 features with USB ethernet gadget ...

  r...@igep0020:~# uname -a
  Linux igep0020 2.6.37-rc1+ #1 Fri Nov 5 09:22:53 CET 2010 armv7l
 unknown unknown GNU/Linux

  r...@igep0020:~# ifconfig
  usb0      Link encap:Ethernet  HWaddr 5A:A9:54:25:4C:04
          inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::58a9:54ff:fe25:4c04/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:4951 (4.8 KiB)

 Pinging seems not work

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 0 packets received, 100% packet loss

 Curiously if I unplug and plug the USB cable, and ping again ...

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  64 bytes from 192.168.7.1: seq=0 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=1 ttl=64 time=0.489 ms
  64 bytes from 192.168.7.1: seq=2 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=3 ttl=64 time=0.366 ms
  64 bytes from 192.168.7.1: seq=4 ttl=64 time=0.396 ms

  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 5 packets received, 0% packet loss
  round-trip min/avg/max = 0.366/0.409/0.489 ms

 Works, anyone knows if the ethernet gadget is broken in current
 mainline or have observed this feature ?

Please try this patch:
http://marc.info/?l=linux-usbm=128576496614332w=2

Report back if it works, maybe then that patch will finally get merged..
--
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: USB Ethernet gadget seems doesn't work with current mainline

2010-11-05 Thread Ming Lei
2010/11/5 Grazvydas Ignotas nota...@gmail.com:
 hi,

 On Fri, Nov 5, 2010 at 10:39 AM, Enric Balletbò i Serra
 eballe...@gmail.com wrote:
 Hello all,

 With current mainline and stable 2.6.35.y branch I've some strange
 features with USB ethernet gadget ...

  r...@igep0020:~# uname -a
  Linux igep0020 2.6.37-rc1+ #1 Fri Nov 5 09:22:53 CET 2010 armv7l
 unknown unknown GNU/Linux

  r...@igep0020:~# ifconfig
  usb0      Link encap:Ethernet  HWaddr 5A:A9:54:25:4C:04
          inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::58a9:54ff:fe25:4c04/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:4951 (4.8 KiB)

 Pinging seems not work

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 0 packets received, 100% packet loss

 Curiously if I unplug and plug the USB cable, and ping again ...

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  64 bytes from 192.168.7.1: seq=0 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=1 ttl=64 time=0.489 ms
  64 bytes from 192.168.7.1: seq=2 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=3 ttl=64 time=0.366 ms
  64 bytes from 192.168.7.1: seq=4 ttl=64 time=0.396 ms

  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 5 packets received, 0% packet loss
  round-trip min/avg/max = 0.366/0.409/0.489 ms

 Works, anyone knows if the ethernet gadget is broken in current
 mainline or have observed this feature ?

 Please try this patch:
 http://marc.info/?l=linux-usbm=128576496614332w=2

 Report back if it works, maybe then that patch will finally get merged..


No, the patch is not merged to now.

Felipe,  seems it is time to send out this musb bugfix patches.


thanks,
-- 
Lei Ming
--
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: USB Ethernet gadget seems doesn't work with current mainline

2010-11-05 Thread Enric Balletbò i Serra
Hi,

2010/11/5 Ming Lei tom.leim...@gmail.com:
 2010/11/5 Grazvydas Ignotas nota...@gmail.com:
 hi,

 On Fri, Nov 5, 2010 at 10:39 AM, Enric Balletbò i Serra
 eballe...@gmail.com wrote:
 Hello all,

 With current mainline and stable 2.6.35.y branch I've some strange
 features with USB ethernet gadget ...

  r...@igep0020:~# uname -a
  Linux igep0020 2.6.37-rc1+ #1 Fri Nov 5 09:22:53 CET 2010 armv7l
 unknown unknown GNU/Linux

  r...@igep0020:~# ifconfig
  usb0      Link encap:Ethernet  HWaddr 5A:A9:54:25:4C:04
          inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::58a9:54ff:fe25:4c04/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:4951 (4.8 KiB)

 Pinging seems not work

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 0 packets received, 100% packet loss

 Curiously if I unplug and plug the USB cable, and ping again ...

  r...@igep0020:~# ping -c5 192.168.7.1
  PING 192.168.7.1 (192.168.7.1): 56 data bytes
  64 bytes from 192.168.7.1: seq=0 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=1 ttl=64 time=0.489 ms
  64 bytes from 192.168.7.1: seq=2 ttl=64 time=0.397 ms
  64 bytes from 192.168.7.1: seq=3 ttl=64 time=0.366 ms
  64 bytes from 192.168.7.1: seq=4 ttl=64 time=0.396 ms

  --- 192.168.7.1 ping statistics ---
  5 packets transmitted, 5 packets received, 0% packet loss
  round-trip min/avg/max = 0.366/0.409/0.489 ms

 Works, anyone knows if the ethernet gadget is broken in current
 mainline or have observed this feature ?

 Please try this patch:
 http://marc.info/?l=linux-usbm=128576496614332w=2

 Report back if it works, maybe then that patch will finally get merged..


 No, the patch is not merged to now.

 Felipe,  seems it is time to send out this musb bugfix patches.

Thanks, the patch is working for me in mainline on my IGEP's board.

Also the issue is fixed on my linux-2.6.35.y branch applying the patch
and cherry-picking

f11d893de444965dfd3e55f726533ae1df5c6471 usb: musb: support ISO high
bandwidth for gadget mode
b0fca50f5a94a268ed02cfddf8051ed9343f usb gadget: don't save bind
callback in struct usb_gadget_driver

Cheers,
   Enric
--
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] USB ehci-omap: Remove second kfree() call on the same object

2010-11-05 Thread Felipe Balbi

On Mon, Oct 25, 2010 at 03:56:54PM -0500, Matthias Kaehlcke wrote:

Remove second kfree() call on the same object in the error path of
ehci_hcd_omap_probe()

Signed-off-by: Matthias Kaehlcke matth...@kaehlcke.net


applied, thanks

--
balbi
--
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 RFC] usb: musb: fail unaligned DMA transfers on v1.8 and above

2010-11-05 Thread Felipe Balbi

On Sun, Oct 31, 2010 at 12:25:59AM -0500, Gadiyar, Anand wrote:

The Inventra DMA engine in version 1.8 and later of the MUSB
controller cannot handle DMA addresses that are not aligned
to a 4 byte boundary. It ends up ignoring the last two bits
programmed in the DMA_ADDR register. This is a deliberate
design change in the controller and is documented in the
programming guide.

Earlier versions of the controller could handle these
accesses just fine.

Fail dma_channel_program if we see an unaligned address when
using the newer controllers, so that the caller can carry out
the transfer using PIO mode.
(Current callers already have this backup path in place).

Signed-off-by: Anand Gadiyar gadi...@ti.com
Cc: Felipe Balbi ba...@ti.com
Cc: Ming Lei tom.leim...@gmail.com
Cc: Ajay Kumar Gupta ajay.gu...@ti.com
Cc: Mike Frysinger vap...@gentoo.org


please fix comment from Sergei and resend without RFC.

--
balbi
--
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: USB Ethernet gadget seems doesn't work with current mainline

2010-11-05 Thread Felipe Balbi

On Fri, Nov 05, 2010 at 05:09:57AM -0500, Ming Lei wrote:

2010/11/5 Grazvydas Ignotas nota...@gmail.com:

hi,

On Fri, Nov 5, 2010 at 10:39 AM, Enric Balletbò i Serra
eballe...@gmail.com wrote:

Hello all,

With current mainline and stable 2.6.35.y branch I've some strange
features with USB ethernet gadget ...

 r...@igep0020:~# uname -a
 Linux igep0020 2.6.37-rc1+ #1 Fri Nov 5 09:22:53 CET 2010 armv7l
unknown unknown GNU/Linux

 r...@igep0020:~# ifconfig
 usb0      Link encap:Ethernet  HWaddr 5A:A9:54:25:4C:04
         inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
         inet6 addr: fe80::58a9:54ff:fe25:4c04/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)  TX bytes:4951 (4.8 KiB)

Pinging seems not work

 r...@igep0020:~# ping -c5 192.168.7.1
 PING 192.168.7.1 (192.168.7.1): 56 data bytes
 --- 192.168.7.1 ping statistics ---
 5 packets transmitted, 0 packets received, 100% packet loss

Curiously if I unplug and plug the USB cable, and ping again ...

 r...@igep0020:~# ping -c5 192.168.7.1
 PING 192.168.7.1 (192.168.7.1): 56 data bytes
 64 bytes from 192.168.7.1: seq=0 ttl=64 time=0.397 ms
 64 bytes from 192.168.7.1: seq=1 ttl=64 time=0.489 ms
 64 bytes from 192.168.7.1: seq=2 ttl=64 time=0.397 ms
 64 bytes from 192.168.7.1: seq=3 ttl=64 time=0.366 ms
 64 bytes from 192.168.7.1: seq=4 ttl=64 time=0.396 ms

 --- 192.168.7.1 ping statistics ---
 5 packets transmitted, 5 packets received, 0% packet loss
 round-trip min/avg/max = 0.366/0.409/0.489 ms

Works, anyone knows if the ethernet gadget is broken in current
mainline or have observed this feature ?


Please try this patch:
http://marc.info/?l=linux-usbm=128576496614332w=2

Report back if it works, maybe then that patch will finally get merged..



No, the patch is not merged to now.

Felipe,  seems it is time to send out this musb bugfix patches.


already queued.

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


OMAP3 Feature list buggy

2010-11-05 Thread Arno Steffen
There is a copy/paste bug in arch/arm/plat-omaop/include/control:

Please replace:

#define OMAP3_IVA_MASK  (1  OMAP3_SGX_SHIFT)

by:

#define OMAP3_IVA_MASK  (1  OMAP3_IVA_SHIFT)

Best regards
Arno
--
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 v2 00/12] staging: tidspbridge: various cleanups

2010-11-05 Thread Ionut Nicu
This set of patches replaces some of the redundant components of
the tidspbridge driver, such as:

* wrapper functions for kmalloc/kfree
* custom bitmap implementation
* custom linked list implementation (list_head wrapper)

with the standard linux kernel interfaces.

The patches also do some code reorganization for increasing readability.
Most of the changes reduce the code indentation level and simplify the code.
No functional changes were done.

There are many places in this driver that need this kind of cleanup, but
these patches only fix the functions that were touched while converting
the code to use linux bitmap and list_head.

Changes since v1:

* Split the bitmap patch into multiple patches
* Split the list_head patch into multiple patches

Ionut Nicu (12):
  staging: tidspbridge: remove gs memory allocator
  staging: tidspbridge: remove utildefs
  staging: tidspbridge: switch to linux bitmap API
  staging: tidspbridge: remove gb bitmap implementation
  staging: tidspbridge: rmgr/node.c code cleanup
  staging: tidspbridge: convert core to list_head
  staging: tidspbridge: convert pmgr to list_head
  staging: tidspbridge: convert rmgr to list_head
  staging: tidspbridge: remove custom linked list
  staging: tidspbridge: core code cleanup
  staging: tidspbridge: pmgr code cleanup
  staging: tidspbridge: rmgr code cleanup

 drivers/staging/tidspbridge/Makefile   |2 +-
 drivers/staging/tidspbridge/TODO   |1 -
 drivers/staging/tidspbridge/core/_msg_sm.h |   12 +-
 drivers/staging/tidspbridge/core/chnl_sm.c |  634 +++-
 drivers/staging/tidspbridge/core/io_sm.c   |  266 +++
 drivers/staging/tidspbridge/core/msg_sm.c  |  601 ++-
 drivers/staging/tidspbridge/gen/gb.c   |  166 -
 drivers/staging/tidspbridge/gen/gh.c   |   38 +-
 drivers/staging/tidspbridge/gen/gs.c   |   88 ---
 .../tidspbridge/include/dspbridge/_chnl_sm.h   |8 +-
 .../tidspbridge/include/dspbridge/cmmdefs.h|1 -
 drivers/staging/tidspbridge/include/dspbridge/gb.h |   79 --
 drivers/staging/tidspbridge/include/dspbridge/gs.h |   59 --
 .../staging/tidspbridge/include/dspbridge/list.h   |  225 --
 .../staging/tidspbridge/include/dspbridge/sync.h   |1 +
 .../tidspbridge/include/dspbridge/utildefs.h   |   39 -
 drivers/staging/tidspbridge/pmgr/cmm.c |  531 +-
 drivers/staging/tidspbridge/pmgr/dev.c |   73 +--
 drivers/staging/tidspbridge/rmgr/drv.c |  238 ++
 drivers/staging/tidspbridge/rmgr/node.c|  773 +---
 drivers/staging/tidspbridge/rmgr/proc.c|2 -
 drivers/staging/tidspbridge/rmgr/rmm.c |  313 -
 22 files changed, 1449 insertions(+), 2701 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/gen/gb.c
 delete mode 100644 drivers/staging/tidspbridge/gen/gs.c
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/gb.h
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/gs.h
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/list.h
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/utildefs.h

-- 
1.7.2.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 v2 01/12] staging: tidspbridge: remove gs memory allocator

2010-11-05 Thread Ionut Nicu
Remove unnecessary wrappers for linux kernel memory
allocation primitives.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/Makefile   |2 +-
 drivers/staging/tidspbridge/gen/gb.c   |   11 +--
 drivers/staging/tidspbridge/gen/gh.c   |   38 ++---
 drivers/staging/tidspbridge/gen/gs.c   |   88 
 drivers/staging/tidspbridge/include/dspbridge/gs.h |   59 -
 5 files changed, 15 insertions(+), 183 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/gen/gs.c
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/gs.h

diff --git a/drivers/staging/tidspbridge/Makefile 
b/drivers/staging/tidspbridge/Makefile
index 50decc2..aaf397f 100644
--- a/drivers/staging/tidspbridge/Makefile
+++ b/drivers/staging/tidspbridge/Makefile
@@ -1,6 +1,6 @@
 obj-$(CONFIG_TIDSPBRIDGE)  += bridgedriver.o
 
-libgen = gen/gb.o gen/gs.o gen/gh.o gen/uuidutil.o
+libgen = gen/gb.o gen/gh.o gen/uuidutil.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/dsp-mmu.o \
core/ue_deh.o core/wdt.o core/dsp-clock.o core/sync.o
diff --git a/drivers/staging/tidspbridge/gen/gb.c 
b/drivers/staging/tidspbridge/gen/gb.c
index 9f59023..3c0e04c 100644
--- a/drivers/staging/tidspbridge/gen/gb.c
+++ b/drivers/staging/tidspbridge/gen/gb.c
@@ -19,7 +19,6 @@
 /*  --- DSP/BIOS Bridge */
 #include linux/types.h
 /*  --- This */
-#include dspbridge/gs.h
 #include dspbridge/gb.h
 
 struct gb_t_map {
@@ -52,17 +51,17 @@ struct gb_t_map *gb_create(u32 len)
 {
struct gb_t_map *map;
u32 i;
-   map = (struct gb_t_map *)gs_alloc(sizeof(struct gb_t_map));
+   map = kzalloc(sizeof(struct gb_t_map), GFP_KERNEL);
if (map != NULL) {
map-len = len;
map-wcnt = len / BITS_PER_LONG + 1;
-   map-words = (u32 *) gs_alloc(map-wcnt * sizeof(u32));
+   map-words = kzalloc(map-wcnt * sizeof(u32), GFP_KERNEL);
if (map-words != NULL) {
for (i = 0; i  map-wcnt; i++)
map-words[i] = 0L;
 
} else {
-   gs_frees(map, sizeof(struct gb_t_map));
+   kfree(map);
map = NULL;
}
}
@@ -78,8 +77,8 @@ struct gb_t_map *gb_create(u32 len)
 
 void gb_delete(struct gb_t_map *map)
 {
-   gs_frees(map-words, map-wcnt * sizeof(u32));
-   gs_frees(map, sizeof(struct gb_t_map));
+   kfree(map-words);
+   kfree(map);
 }
 
 /*
diff --git a/drivers/staging/tidspbridge/gen/gh.c 
b/drivers/staging/tidspbridge/gen/gh.c
index f72d943..cd72503 100644
--- a/drivers/staging/tidspbridge/gen/gh.c
+++ b/drivers/staging/tidspbridge/gen/gh.c
@@ -17,9 +17,6 @@
 #include linux/types.h
 
 #include dspbridge/host_os.h
-
-#include dspbridge/gs.h
-
 #include dspbridge/gh.h
 
 struct element {
@@ -37,8 +34,6 @@ struct gh_t_hash_tab {
 };
 
 static void noop(void *p);
-static s32 cur_init;
-static void myfree(void *ptr, s32 size);
 
 /*
  *   gh_create 
@@ -51,8 +46,7 @@ struct gh_t_hash_tab *gh_create(u16 max_bucket, u16 val_size,
 {
struct gh_t_hash_tab *hash_tab;
u16 i;
-   hash_tab =
-   (struct gh_t_hash_tab *)gs_alloc(sizeof(struct gh_t_hash_tab));
+   hash_tab = kzalloc(sizeof(struct gh_t_hash_tab), GFP_KERNEL);
if (hash_tab == NULL)
return NULL;
hash_tab-max_bucket = max_bucket;
@@ -62,7 +56,7 @@ struct gh_t_hash_tab *gh_create(u16 max_bucket, u16 val_size,
hash_tab-delete = delete == NULL ? noop : delete;
 
hash_tab-buckets = (struct element **)
-   gs_alloc(sizeof(struct element *) * max_bucket);
+   kzalloc(sizeof(struct element *) * max_bucket, GFP_KERNEL);
if (hash_tab-buckets == NULL) {
gh_delete(hash_tab);
return NULL;
@@ -89,17 +83,14 @@ void gh_delete(struct gh_t_hash_tab *hash_tab)
 elem = next) {
next = elem-next;
(*hash_tab-delete) (elem-data);
-   myfree(elem,
-  sizeof(struct element) - 1 +
-  hash_tab-val_size);
+   kfree(elem);
}
}
 
-   myfree(hash_tab-buckets, sizeof(struct element *)
-  * hash_tab-max_bucket);
+   kfree(hash_tab-buckets);
}
 
-   myfree(hash_tab, sizeof(struct gh_t_hash_tab));
+   kfree(hash_tab);
}
 }
 
@@ -109,9 +100,7 @@ 

[PATCH v2 03/12] staging: tidspbridge: switch to linux bitmap API

2010-11-05 Thread Ionut Nicu
Replace the tidspbridge generic bitmap operations
with the linux standard bitmap implementation.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/node.c |  166 ++-
 1 files changed, 74 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/node.c 
b/drivers/staging/tidspbridge/rmgr/node.c
index a660247..e48ddba 100644
--- a/drivers/staging/tidspbridge/rmgr/node.c
+++ b/drivers/staging/tidspbridge/rmgr/node.c
@@ -17,6 +17,7 @@
  */
 
 #include linux/types.h
+#include linux/bitmap.h
 /*  --- Host OS */
 #include dspbridge/host_os.h
 
@@ -50,7 +51,6 @@
 #include dspbridge/dspioctl.h
 
 /*  --- Others */
-#include dspbridge/gb.h
 #include dspbridge/uuidutil.h
 
 /*  --- This */
@@ -131,11 +131,14 @@ struct node_mgr {
struct lst_list *node_list; /* List of all allocated nodes */
u32 num_nodes;  /* Number of nodes in node_list */
u32 num_created;/* Number of nodes *created* on DSP */
-   struct gb_t_map *pipe_map;  /* Pipe connection bit map */
-   struct gb_t_map *pipe_done_map; /* Pipes that are half free */
-   struct gb_t_map *chnl_map;  /* Channel allocation bit map */
-   struct gb_t_map *dma_chnl_map;  /* DMA Channel allocation bit map */
-   struct gb_t_map *zc_chnl_map;   /* Zero-Copy Channel alloc bit map */
+   DECLARE_BITMAP(pipe_map, MAXPIPES); /* Pipe connection bitmap */
+   DECLARE_BITMAP(pipe_done_map, MAXPIPES); /* Pipes that are half free */
+   /* Channel allocation bitmap */
+   DECLARE_BITMAP(chnl_map, CHNL_MAXCHANNELS);
+   /* DMA Channel allocation bitmap */
+   DECLARE_BITMAP(dma_chnl_map, CHNL_MAXCHANNELS);
+   /* Zero-Copy Channel alloc bitmap */
+   DECLARE_BITMAP(zc_chnl_map, CHNL_MAXCHANNELS);
struct ntfy_object *ntfy_obj;   /* Manages registered notifications */
struct mutex node_mgr_lock; /* For critical sections */
u32 ul_fxn_addrs[NUMRMSFXNS];   /* RMS function addresses */
@@ -820,8 +823,8 @@ int node_connect(struct node_object *node1, u32 stream1,
struct node_object *dev_node_obj;
struct node_object *hnode;
struct stream_chnl *pstream;
-   u32 pipe_id = GB_NOBITS;
-   u32 chnl_id = GB_NOBITS;
+   u32 pipe_id;
+   u32 chnl_id;
s8 chnl_mode;
u32 dw_length;
int status = 0;
@@ -924,10 +927,11 @@ int node_connect(struct node_object *node1, u32 stream1,
   (node2_type == NODE_TASK
  || node2_type == NODE_DAISSOCKET))) {
/* Find available pipe */
-   pipe_id = gb_findandset(hnode_mgr-pipe_map);
-   if (pipe_id == GB_NOBITS) {
+   pipe_id = find_first_zero_bit(hnode_mgr-pipe_map, MAXPIPES);
+   if (pipe_id == MAXPIPES) {
status = -ECONNREFUSED;
} else {
+   set_bit(pipe_id, hnode_mgr-pipe_map);
node1-outputs[stream1].type = NODECONNECT;
node2-inputs[stream2].type = NODECONNECT;
node1-outputs[stream1].dev_id = pipe_id;
@@ -944,7 +948,7 @@ int node_connect(struct node_object *node1, u32 stream1,
 
output-sz_device = NULL;
input-sz_device = NULL;
-   gb_clear(hnode_mgr-pipe_map, pipe_id);
+   clear_bit(pipe_id, hnode_mgr-pipe_map);
status = -ENOMEM;
} else {
/* Copy /dbpipepipId name to device names */
@@ -969,34 +973,47 @@ int node_connect(struct node_object *node1, u32 stream1,
 *  called for this node. */
if (pattrs) {
if (pattrs-strm_mode == STRMMODE_RDMA) {
-   chnl_id =
-   gb_findandset(hnode_mgr-dma_chnl_map);
+   chnl_id = find_first_zero_bit(
+   hnode_mgr-dma_chnl_map,
+   CHNL_MAXCHANNELS);
/* dma chans are 2nd transport chnl set
 * ids(e.g. 16-31) */
-   (chnl_id != GB_NOBITS) ?
-   (chnl_id =
-chnl_id +
-hnode_mgr-ul_num_chnls) : chnl_id;
+   if (chnl_id != CHNL_MAXCHANNELS) {
+   set_bit(chnl_id,
+   hnode_mgr-dma_chnl_map);
+   chnl_id = chnl_id +
+  

[PATCH v2 04/12] staging: tidspbridge: remove gb bitmap implementation

2010-11-05 Thread Ionut Nicu
Now that all users of gb have been converted to the
standard linux bitmap API, we can remove it from the
gen library.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/Makefile   |2 +-
 drivers/staging/tidspbridge/gen/gb.c   |  165 
 drivers/staging/tidspbridge/include/dspbridge/gb.h |   79 --
 3 files changed, 1 insertions(+), 245 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/gen/gb.c
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/gb.h

diff --git a/drivers/staging/tidspbridge/Makefile 
b/drivers/staging/tidspbridge/Makefile
index aaf397f..6080e7e 100644
--- a/drivers/staging/tidspbridge/Makefile
+++ b/drivers/staging/tidspbridge/Makefile
@@ -1,6 +1,6 @@
 obj-$(CONFIG_TIDSPBRIDGE)  += bridgedriver.o
 
-libgen = gen/gb.o gen/gh.o gen/uuidutil.o
+libgen = gen/gh.o gen/uuidutil.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/dsp-mmu.o \
core/ue_deh.o core/wdt.o core/dsp-clock.o core/sync.o
diff --git a/drivers/staging/tidspbridge/gen/gb.c 
b/drivers/staging/tidspbridge/gen/gb.c
deleted file mode 100644
index 3c0e04c..000
--- a/drivers/staging/tidspbridge/gen/gb.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * gb.c
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Generic bitmap operations.
- *
- * Copyright (C) 2005-2006 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/*  --- DSP/BIOS Bridge */
-#include linux/types.h
-/*  --- This */
-#include dspbridge/gb.h
-
-struct gb_t_map {
-   u32 len;
-   u32 wcnt;
-   u32 *words;
-};
-
-/*
- *   gb_clear 
- *  purpose:
- *  Clears a bit in the bit map.
- */
-
-void gb_clear(struct gb_t_map *map, u32 bitn)
-{
-   u32 mask;
-
-   mask = 1L  (bitn % BITS_PER_LONG);
-   map-words[bitn / BITS_PER_LONG] = ~mask;
-}
-
-/*
- *   gb_create 
- *  purpose:
- *  Creates a bit map.
- */
-
-struct gb_t_map *gb_create(u32 len)
-{
-   struct gb_t_map *map;
-   u32 i;
-   map = kzalloc(sizeof(struct gb_t_map), GFP_KERNEL);
-   if (map != NULL) {
-   map-len = len;
-   map-wcnt = len / BITS_PER_LONG + 1;
-   map-words = kzalloc(map-wcnt * sizeof(u32), GFP_KERNEL);
-   if (map-words != NULL) {
-   for (i = 0; i  map-wcnt; i++)
-   map-words[i] = 0L;
-
-   } else {
-   kfree(map);
-   map = NULL;
-   }
-   }
-
-   return map;
-}
-
-/*
- *   gb_delete 
- *  purpose:
- *  Frees a bit map.
- */
-
-void gb_delete(struct gb_t_map *map)
-{
-   kfree(map-words);
-   kfree(map);
-}
-
-/*
- *   gb_findandset 
- *  purpose:
- *  Finds a free bit and sets it.
- */
-u32 gb_findandset(struct gb_t_map *map)
-{
-   u32 bitn;
-
-   bitn = gb_minclear(map);
-
-   if (bitn != GB_NOBITS)
-   gb_set(map, bitn);
-
-   return bitn;
-}
-
-/*
- *   gb_minclear 
- *  purpose:
- *  returns the location of the first unset bit in the bit map.
- */
-u32 gb_minclear(struct gb_t_map *map)
-{
-   u32 bit_location = 0;
-   u32 bit_acc = 0;
-   u32 i;
-   u32 bit;
-   u32 *word;
-
-   for (word = map-words, i = 0; i  map-wcnt; word++, i++) {
-   if (~*word) {
-   for (bit = 0; bit  BITS_PER_LONG; bit++, bit_acc++) {
-   if (bit_acc == map-len)
-   return GB_NOBITS;
-
-   if (~*word  (1L  bit)) {
-   bit_location = i * BITS_PER_LONG + bit;
-   return bit_location;
-   }
-
-   }
-   } else {
-   bit_acc += BITS_PER_LONG;
-   }
-   }
-
-   return GB_NOBITS;
-}
-
-/*
- *   gb_set 
- *  purpose:
- *  Sets a bit in the bit map.
- */
-
-void gb_set(struct gb_t_map *map, u32 bitn)
-{
-   u32 mask;
-
-   mask = 1L  (bitn % BITS_PER_LONG);
-   map-words[bitn / BITS_PER_LONG] |= mask;
-}
-
-/*
- *   gb_test 
- *  purpose:
- *  Returns true if the bit is set in the specified location.
- */
-
-bool gb_test(struct gb_t_map *map, u32 

[PATCH v2 05/12] staging: tidspbridge: rmgr/node.c code cleanup

2010-11-05 Thread Ionut Nicu
Reorganized some code in rmgr/node.c to increase its
readability. Most of the changes reduce the code
indentation level and simplifiy the code. No functional
changes were done.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/node.c |  607 +++
 1 files changed, 284 insertions(+), 323 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/node.c 
b/drivers/staging/tidspbridge/rmgr/node.c
index e48ddba..f660d1f 100644
--- a/drivers/staging/tidspbridge/rmgr/node.c
+++ b/drivers/staging/tidspbridge/rmgr/node.c
@@ -234,9 +234,9 @@ struct node_object {
 
 /* Default buffer attributes */
 static struct dsp_bufferattr node_dfltbufattrs = {
-   0,  /* cb_struct */
-   1,  /* segment_id */
-   0,  /* buf_alignment */
+   .cb_struct = 0,
+   .segment_id = 1,
+   .buf_alignment = 0,
 };
 
 static void delete_node(struct node_object *hnode,
@@ -282,8 +282,7 @@ enum node_state node_get_state(void *hnode)
struct node_object *pnode = (struct node_object *)hnode;
if (!pnode)
return -1;
-   else
-   return pnode-node_state;
+   return pnode-node_state;
 }
 
 /*
@@ -817,6 +816,7 @@ int node_connect(struct node_object *node1, u32 stream1,
char *pstr_dev_name = NULL;
enum node_type node1_type = NODE_TASK;
enum node_type node2_type = NODE_TASK;
+   enum dsp_strmmode strm_mode;
struct node_strmdef *pstrm_def;
struct node_strmdef *input = NULL;
struct node_strmdef *output = NULL;
@@ -830,60 +830,50 @@ int node_connect(struct node_object *node1, u32 stream1,
int status = 0;
DBC_REQUIRE(refs  0);
 
-   if ((node1 != (struct node_object *)DSP_HGPPNODE  !node1) ||
-   (node2 != (struct node_object *)DSP_HGPPNODE  !node2))
-   status = -EFAULT;
+   if (!node1 || !node2)
+   return -EFAULT;
 
-   if (!status) {
-   /* The two nodes must be on the same processor */
-   if (node1 != (struct node_object *)DSP_HGPPNODE 
-   node2 != (struct node_object *)DSP_HGPPNODE 
-   node1-hnode_mgr != node2-hnode_mgr)
-   status = -EPERM;
-   /* Cannot connect a node to itself */
-   if (node1 == node2)
-   status = -EPERM;
+   /* The two nodes must be on the same processor */
+   if (node1 != (struct node_object *)DSP_HGPPNODE 
+   node2 != (struct node_object *)DSP_HGPPNODE 
+   node1-hnode_mgr != node2-hnode_mgr)
+   return -EPERM;
 
-   }
-   if (!status) {
-   /* node_get_type() will return NODE_GPP if hnode =
-* DSP_HGPPNODE. */
-   node1_type = node_get_type(node1);
-   node2_type = node_get_type(node2);
-   /* Check stream indices ranges */
-   if ((node1_type != NODE_GPP  node1_type != NODE_DEVICE 
-stream1 = MAX_OUTPUTS(node1)) || (node2_type != NODE_GPP
-  node2_type !=
- NODE_DEVICE
-  stream2 =
- MAX_INPUTS(node2)))
-   status = -EINVAL;
-   }
-   if (!status) {
-   /*
-*  Only the following types of connections are allowed:
-*  task/dais socket  ==  task/dais socket
-*  task/dais socket  ==  device
-*  task/dais socket  ==  GPP
-*
-*  ie, no message nodes, and at least one task or dais
-*  socket node.
-*/
-   if (node1_type == NODE_MESSAGE || node2_type == NODE_MESSAGE ||
-   (node1_type != NODE_TASK  node1_type != NODE_DAISSOCKET 
-node2_type != NODE_TASK  node2_type != NODE_DAISSOCKET))
-   status = -EPERM;
-   }
+   /* Cannot connect a node to itself */
+   if (node1 == node2)
+   return -EPERM;
+
+   /* node_get_type() will return NODE_GPP if hnode =
+* DSP_HGPPNODE. */
+   node1_type = node_get_type(node1);
+   node2_type = node_get_type(node2);
+   /* Check stream indices ranges */
+   if ((node1_type != NODE_GPP  node1_type != NODE_DEVICE 
+   stream1 = MAX_OUTPUTS(node1)) ||
+   (node2_type != NODE_GPP  node2_type != NODE_DEVICE 
+stream2 = MAX_INPUTS(node2)))
+   return -EINVAL;
+
+   /*
+*  Only the following types of connections are allowed:
+*  task/dais socket  ==  task/dais socket
+*  task/dais 

[PATCH v2 06/12] staging: tidspbridge: convert core to list_head

2010-11-05 Thread Ionut Nicu
Convert the core module of the tidspbridge driver
to use struct list_head instead of struct lst_list.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/core/_msg_sm.h |   12 +-
 drivers/staging/tidspbridge/core/chnl_sm.c |  245 +---
 drivers/staging/tidspbridge/core/io_sm.c   |  141 +---
 drivers/staging/tidspbridge/core/msg_sm.c  |  236 +++
 .../tidspbridge/include/dspbridge/_chnl_sm.h   |8 +-
 .../tidspbridge/include/dspbridge/cmmdefs.h|1 -
 .../staging/tidspbridge/include/dspbridge/sync.h   |1 +
 7 files changed, 264 insertions(+), 380 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/_msg_sm.h 
b/drivers/staging/tidspbridge/core/_msg_sm.h
index 556de5c..b78d1a6 100644
--- a/drivers/staging/tidspbridge/core/_msg_sm.h
+++ b/drivers/staging/tidspbridge/core/_msg_sm.h
@@ -20,7 +20,7 @@
 #ifndef _MSG_SM_
 #define _MSG_SM_
 
-#include dspbridge/list.h
+#include linux/list.h
 #include dspbridge/msgdefs.h
 
 /*
@@ -86,12 +86,12 @@ struct msg_mgr {
struct bridge_drv_interface *intf_fxns;
 
struct io_mgr *hio_mgr; /* IO manager */
-   struct lst_list *queue_list;/* List of MSG_QUEUEs */
+   struct list_head queue_list;/* List of MSG_QUEUEs */
spinlock_t msg_mgr_lock;/* For critical sections */
/* Signalled when MsgFrame is available */
struct sync_object *sync_event;
-   struct lst_list *msg_free_list; /* Free MsgFrames ready to be filled */
-   struct lst_list *msg_used_list; /* MsgFrames ready to go to DSP */
+   struct list_head msg_free_list; /* Free MsgFrames ready to be filled */
+   struct list_head msg_used_list; /* MsgFrames ready to go to DSP */
u32 msgs_pending;   /* # of queued messages to go to DSP */
u32 max_msgs;   /* Max # of msgs that fit in buffer */
msg_onexit on_exit; /* called when RMS_EXIT is received */
@@ -111,9 +111,9 @@ struct msg_queue {
struct msg_mgr *hmsg_mgr;
u32 max_msgs;   /* Node message depth */
u32 msgq_id;/* Node environment pointer */
-   struct lst_list *msg_free_list; /* Free MsgFrames ready to be filled */
+   struct list_head msg_free_list; /* Free MsgFrames ready to be filled */
/* Filled MsgFramess waiting to be read */
-   struct lst_list *msg_used_list;
+   struct list_head msg_used_list;
void *arg;  /* Handle passed to mgr on_exit callback */
struct sync_object *sync_event; /* Signalled when message is ready */
struct sync_object *sync_done;  /* For synchronizing cleanup */
diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index 662a5b5..83403bb 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -37,9 +37,9 @@
  *  which may cause timeouts and/or failure offunction sync_wait_on_event.
  *  This invariant condition is:
  *
- *  LST_Empty(pchnl-pio_completions) == pchnl-sync_event is reset
+ *  list_empty(pchnl-pio_completions) == pchnl-sync_event is reset
  *  and
- *  !LST_Empty(pchnl-pio_completions) == pchnl-sync_event is set.
+ *  !list_empty(pchnl-pio_completions) == pchnl-sync_event is set.
  */
 
 #include linux/types.h
@@ -73,11 +73,9 @@
 #define MAILBOX_IRQ INT_MAIL_MPU_IRQ
 
 /*  --- Function Prototypes */
-static struct lst_list *create_chirp_list(u32 chirps);
+static int create_chirp_list(struct list_head *list, u32 chirps);
 
-static void free_chirp_list(struct lst_list *chirp_list);
-
-static struct chnl_irp *make_new_chirp(void);
+static void free_chirp_list(struct list_head *list);
 
 static int search_free_channel(struct chnl_mgr *chnl_mgr_obj,
  u32 *chnl);
@@ -179,9 +177,12 @@ func_cont:
}
if (!status) {
/* Get a free chirp: */
-   chnl_packet_obj =
-   (struct chnl_irp *)lst_get_head(pchnl-free_packets_list);
-   if (chnl_packet_obj == NULL)
+   if (!list_empty(pchnl-free_packets_list)) {
+   chnl_packet_obj = list_first_entry(
+   pchnl-free_packets_list,
+   struct chnl_irp, link);
+   list_del(chnl_packet_obj-link);
+   } else
status = -EIO;
 
}
@@ -206,8 +207,7 @@ func_cont:
chnl_packet_obj-dw_arg = dw_arg;
chnl_packet_obj-status = (is_eos ? CHNL_IOCSTATEOS :
   CHNL_IOCSTATCOMPLETE);
-   lst_put_tail(pchnl-pio_requests,
-(struct list_head *)chnl_packet_obj);
+   list_add_tail(chnl_packet_obj-link, 

[PATCH v2 07/12] staging: tidspbridge: convert pmgr to list_head

2010-11-05 Thread Ionut Nicu
Convert the pmgr module of the tidspbridge driver
to use struct list_head instead of struct lst_list.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/pmgr/cmm.c |  230 ++--
 drivers/staging/tidspbridge/pmgr/dev.c |   59 +++-
 2 files changed, 93 insertions(+), 196 deletions(-)

diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c 
b/drivers/staging/tidspbridge/pmgr/cmm.c
index 8dbdd20..603ed55 100644
--- a/drivers/staging/tidspbridge/pmgr/cmm.c
+++ b/drivers/staging/tidspbridge/pmgr/cmm.c
@@ -12,7 +12,7 @@
  * describes a block of physically contiguous shared memory used for
  * future allocations by CMM.
  *
- * Memory is coelesced back to the appropriate heap when a buffer is
+ * Memory is coalesced back to the appropriate heap when a buffer is
  * freed.
  *
  * Notes:
@@ -30,6 +30,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 #include linux/types.h
+#include linux/list.h
 
 /*  --- DSP/BIOS Bridge */
 #include dspbridge/dbdefs.h
@@ -38,7 +39,6 @@
 #include dspbridge/dbc.h
 
 /*  --- OS Adaptation Layer */
-#include dspbridge/list.h
 #include dspbridge/sync.h
 
 /*  --- Platform Manager */
@@ -73,9 +73,9 @@ struct cmm_allocator {/* sma */
u32 ul_dsp_size;/* DSP seg size in bytes */
struct cmm_object *hcmm_mgr;/* back ref to parent mgr */
/* node list of available memory */
-   struct lst_list *free_list_head;
+   struct list_head free_list;
/* node list of memory in use */
-   struct lst_list *in_use_list_head;
+   struct list_head in_use_list;
 };
 
 struct cmm_xlator {/* Pa-Va translator object */
@@ -97,7 +97,7 @@ struct cmm_object {
 * Cmm Lock is used to serialize access mem manager for multi-threads.
 */
struct mutex cmm_lock;  /* Lock to access cmm mgr */
-   struct lst_list *node_free_list_head;   /* Free list of memory nodes */
+   struct list_head node_free_list;/* Free list of memory nodes */
u32 ul_min_block_size;  /* Min SM block; default 16 bytes */
u32 dw_page_size;   /* Memory Page size (1k/4k) */
/* GPP SM segment ptrs */
@@ -215,8 +215,7 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize,
pnode-client_proc = current-tgid;
 
/* put our node on InUse list */
-   lst_put_tail(allocator-in_use_list_head,
-(struct list_head *)pnode);
+   list_add_tail(pnode-link, allocator-in_use_list);
buf_pa = (void *)pnode-dw_pa;  /* physical address */
/* clear mem */
pbyte = (u8 *) pnode-dw_va;
@@ -265,18 +264,9 @@ int cmm_create(struct cmm_object **ph_cmm_mgr,
 * MEM_ALLOC_OBJECT */
 
/* create node free list */
-   cmm_obj-node_free_list_head =
-   kzalloc(sizeof(struct lst_list),
-   GFP_KERNEL);
-   if (cmm_obj-node_free_list_head == NULL) {
-   status = -ENOMEM;
-   cmm_destroy(cmm_obj, true);
-   } else {
-   INIT_LIST_HEAD(cmm_obj-
-  node_free_list_head-head);
-   mutex_init(cmm_obj-cmm_lock);
-   *ph_cmm_mgr = cmm_obj;
-   }
+   INIT_LIST_HEAD(cmm_obj-node_free_list);
+   mutex_init(cmm_obj-cmm_lock);
+   *ph_cmm_mgr = cmm_obj;
} else {
status = -ENOMEM;
}
@@ -294,7 +284,7 @@ int cmm_destroy(struct cmm_object *hcmm_mgr, bool force)
struct cmm_info temp_info;
int status = 0;
s32 slot_seg;
-   struct cmm_mnode *pnode;
+   struct cmm_mnode *node, *tmp;
 
DBC_REQUIRE(refs  0);
if (!hcmm_mgr) {
@@ -324,15 +314,10 @@ int cmm_destroy(struct cmm_object *hcmm_mgr, bool force)
}
}
}
-   if (cmm_mgr_obj-node_free_list_head != NULL) {
-   /* Free the free nodes */
-   while (!LST_IS_EMPTY(cmm_mgr_obj-node_free_list_head)) {
-   pnode = (struct cmm_mnode *)
-   lst_get_head(cmm_mgr_obj-node_free_list_head);
-   kfree(pnode);
-   }
-   /* delete NodeFreeList list */
-   kfree(cmm_mgr_obj-node_free_list_head);
+   list_for_each_entry_safe(node, tmp, cmm_mgr_obj-node_free_list,
+   link) {
+   list_del(node-link);
+   kfree(node);
}
mutex_unlock(cmm_mgr_obj-cmm_lock);
if (!status) {
@@ -366,7 +351,7 @@ int 

[PATCH v2 08/12] staging: tidspbridge: convert rmgr to list_head

2010-11-05 Thread Ionut Nicu
Convert the rmgr module of the tidspbridge driver
to use struct list_head instead of struct lst_list.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/drv.c  |  111 +--
 drivers/staging/tidspbridge/rmgr/node.c |   52 +--
 drivers/staging/tidspbridge/rmgr/proc.c |2 -
 drivers/staging/tidspbridge/rmgr/rmm.c  |   74 +++--
 4 files changed, 72 insertions(+), 167 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/drv.c 
b/drivers/staging/tidspbridge/rmgr/drv.c
index 91cc1685..18fae55 100644
--- a/drivers/staging/tidspbridge/rmgr/drv.c
+++ b/drivers/staging/tidspbridge/rmgr/drv.c
@@ -16,6 +16,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 #include linux/types.h
+#include linux/list.h
 
 /*  --- Host OS */
 #include dspbridge/host_os.h
@@ -26,9 +27,6 @@
 /*  --- Trace  Debug */
 #include dspbridge/dbc.h
 
-/*  --- OS Adaptation Layer */
-#include dspbridge/list.h
-
 /*  --- This */
 #include dspbridge/drv.h
 #include dspbridge/dev.h
@@ -42,8 +40,8 @@
 
 /*  --- Defines, Data Structures, Typedefs */
 struct drv_object {
-   struct lst_list *dev_list;
-   struct lst_list *dev_node_string;
+   struct list_head dev_list;
+   struct list_head dev_node_string;
 };
 
 /*
@@ -305,22 +303,8 @@ int drv_create(struct drv_object **drv_obj)
pdrv_object = kzalloc(sizeof(struct drv_object), GFP_KERNEL);
if (pdrv_object) {
/* Create and Initialize List of device objects */
-   pdrv_object-dev_list = kzalloc(sizeof(struct lst_list),
-   GFP_KERNEL);
-   if (pdrv_object-dev_list) {
-   /* Create and Initialize List of device Extension */
-   pdrv_object-dev_node_string =
-   kzalloc(sizeof(struct lst_list), GFP_KERNEL);
-   if (!(pdrv_object-dev_node_string)) {
-   status = -EPERM;
-   } else {
-   INIT_LIST_HEAD(pdrv_object-
-  dev_node_string-head);
-   INIT_LIST_HEAD(pdrv_object-dev_list-head);
-   }
-   } else {
-   status = -ENOMEM;
-   }
+   INIT_LIST_HEAD(pdrv_object-dev_list);
+   INIT_LIST_HEAD(pdrv_object-dev_node_string);
} else {
status = -ENOMEM;
}
@@ -337,8 +321,6 @@ int drv_create(struct drv_object **drv_obj)
if (!status) {
*drv_obj = pdrv_object;
} else {
-   kfree(pdrv_object-dev_list);
-   kfree(pdrv_object-dev_node_string);
/* Free the DRV Object */
kfree(pdrv_object);
}
@@ -375,13 +357,6 @@ int drv_destroy(struct drv_object *driver_obj)
DBC_REQUIRE(refs  0);
DBC_REQUIRE(pdrv_object);
 
-   /*
-*  Delete the List if it exists.Should not come here
-*  as the drv_remove_dev_object and the Last drv_request_resources
-*  removes the list if the lists are empty.
-*/
-   kfree(pdrv_object-dev_list);
-   kfree(pdrv_object-dev_node_string);
kfree(pdrv_object);
/* Update the DRV Object in the driver data */
if (drv_datap) {
@@ -413,7 +388,7 @@ int drv_get_dev_object(u32 index, struct drv_object 
*hdrv_obj,
DBC_REQUIRE(device_obj != NULL);
DBC_REQUIRE(index = 0);
DBC_REQUIRE(refs  0);
-   DBC_ASSERT(!(LST_IS_EMPTY(pdrv_obj-dev_list)));
+   DBC_ASSERT(!(list_empty(pdrv_obj-dev_list)));
 
dev_obj = (struct dev_object *)drv_get_first_dev_object();
for (i = 0; i  index; i++) {
@@ -444,9 +419,8 @@ u32 drv_get_first_dev_object(void)
 
if (drv_datap  drv_datap-drv_object) {
pdrv_obj = drv_datap-drv_object;
-   if ((pdrv_obj-dev_list != NULL) 
-   !LST_IS_EMPTY(pdrv_obj-dev_list))
-   dw_dev_object = (u32) lst_first(pdrv_obj-dev_list);
+   if (!list_empty(pdrv_obj-dev_list))
+   dw_dev_object = (u32) pdrv_obj-dev_list.next;
} else {
pr_err(%s: Failed to retrieve the object handle\n, __func__);
}
@@ -468,10 +442,9 @@ u32 drv_get_first_dev_extension(void)
 
if (drv_datap  drv_datap-drv_object) {
pdrv_obj = drv_datap-drv_object;
-   if ((pdrv_obj-dev_node_string != NULL) 
-   !LST_IS_EMPTY(pdrv_obj-dev_node_string)) {
+   if (!list_empty(pdrv_obj-dev_node_string)) {
dw_dev_extension =
-   (u32) 

[PATCH v2 09/12] staging: tidspbridge: remove custom linked list

2010-11-05 Thread Ionut Nicu
Now that all users of lst_list have been converted to the
standard linux list_head API, we can remove the associated
header file.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/TODO   |1 -
 .../staging/tidspbridge/include/dspbridge/list.h   |  225 
 2 files changed, 0 insertions(+), 226 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/list.h

diff --git a/drivers/staging/tidspbridge/TODO b/drivers/staging/tidspbridge/TODO
index 187363f..1c51e2d 100644
--- a/drivers/staging/tidspbridge/TODO
+++ b/drivers/staging/tidspbridge/TODO
@@ -6,7 +6,6 @@
 * Eliminate general services and libraries - use or extend existing kernel
   libraries instead (e.g. gcf/lcm in nldr.c, global helpers in gen/)
 * Eliminate direct manipulation of OMAP_SYSC_BASE
-* Eliminate list.h : seem like a redundant wrapper to existing kernel lists
 * Eliminate DSP_SUCCEEDED macros and their imposed redundant indentations
   (adopt the kernel way of checking for return values)
 * Audit interfaces exposed to user space
diff --git a/drivers/staging/tidspbridge/include/dspbridge/list.h 
b/drivers/staging/tidspbridge/include/dspbridge/list.h
deleted file mode 100644
index 6837b61..000
--- a/drivers/staging/tidspbridge/include/dspbridge/list.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * list.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Declarations of list management control structures and definitions
- * of inline list management functions.
- *
- * Copyright (C) 2008 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 LIST_
-#define LIST_
-
-#include dspbridge/host_os.h
-#include linux/list.h
-
-#define LST_IS_EMPTY(l)  list_empty((l)-head)
-
-struct lst_list {
-   struct list_head head;
-};
-
-/*
- *   lst_first 
- *  Purpose:
- *  Returns a pointer to the first element of the list, or NULL if the list
- *  is empty.
- *  Parameters:
- *  lst:  Pointer to list control structure.
- *  Returns:
- *  Pointer to first list element, or NULL.
- *  Requires:
- *  - LST initialized.
- *  - lst != NULL.
- *  Ensures:
- */
-static inline struct list_head *lst_first(struct lst_list *lst)
-{
-   if (lst  !list_empty(lst-head))
-   return lst-head.next;
-   return NULL;
-}
-
-/*
- *   lst_get_head 
- *  Purpose:
- *  Pops the head off the list and returns a pointer to it.
- *  Details:
- *  If the list is empty, returns NULL.
- *  Else, removes the element at the head of the list, making the next
- *  element the head of the list.
- *  The head is removed by making the tail element of the list point its
- *  next pointer at the next element after the head, and by making the
- *  prev pointer of the next element after the head point at the tail
- *  element.  So the next element after the head becomes the new head of
- *  the list.
- *  Parameters:
- *  lst:Pointer to list control structure of list whose head
- *  element is to be removed
- *  Returns:
- *  Pointer to element that was at the head of the list (success)
- *  NULL  No elements in list
- *  Requires:
- *  - LST initialized.
- *  - lst != NULL.
- *  Ensures:
- *  Notes:
- *  Because the tail of the list points forward (its next pointer) to
- *  the head of the list, and the head of the list points backward (its
- *  prev pointer) to the tail of the list, this list is circular.
- */
-static inline struct list_head *lst_get_head(struct lst_list *lst)
-{
-   struct list_head *elem_list;
-
-   if (!lst || list_empty(lst-head))
-   return NULL;
-
-   elem_list = lst-head.next;
-   lst-head.next = elem_list-next;
-   elem_list-next-prev = lst-head;
-
-   return elem_list;
-}
-
-/*
- *   lst_init_elem 
- *  Purpose:
- *  Initializes a list element to default (cleared) values
- *  Details:
- *  Parameters:
- *  elem_list:  Pointer to list element to be reset
- *  Returns:
- *  Requires:
- *  LST initialized.
- *  Ensures:
- *  Notes:
- *  This function must not be called to reset an element in the middle
- *  of a list chain -- that would break the chain.
- *
- */
-static inline void lst_init_elem(struct list_head *elem_list)
-{
-   if (elem_list) {
-   elem_list-next = NULL;
-   elem_list-prev = NULL;
-   }
-}
-
-/*
- *   lst_insert_before 
- *  Purpose:
- * Insert the element before 

[PATCH v2 10/12] staging: tidspbridge: core code cleanup

2010-11-05 Thread Ionut Nicu
Reorganized some code in the core module to increase its
readability. Most of the changes reduce the code
indentation level and simplifiy the code. No functional
changes were done.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/core/chnl_sm.c |  451 +---
 drivers/staging/tidspbridge/core/io_sm.c   |  191 ++---
 drivers/staging/tidspbridge/core/msg_sm.c  |  447 ---
 3 files changed, 498 insertions(+), 591 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index 83403bb..ba6313f 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -105,35 +105,31 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, 
void *host_buf,
is_eos = (byte_size == 0);
 
/* Validate args */
-   if (!host_buf || !pchnl) {
-   status = -EFAULT;
-   } else if (is_eos  CHNL_IS_INPUT(pchnl-chnl_mode)) {
-   status = -EPERM;
-   } else {
-   /*
-* Check the channel state: only queue chirp if channel state
-* allows it.
-*/
-   dw_state = pchnl-dw_state;
-   if (dw_state != CHNL_STATEREADY) {
-   if (dw_state  CHNL_STATECANCEL)
-   status = -ECANCELED;
-   else if ((dw_state  CHNL_STATEEOS) 
-CHNL_IS_OUTPUT(pchnl-chnl_mode))
-   status = -EPIPE;
-   else
-   /* No other possible states left */
-   DBC_ASSERT(0);
-   }
+   if (!host_buf || !pchnl)
+   return -EFAULT;
+
+   if (is_eos  CHNL_IS_INPUT(pchnl-chnl_mode))
+   return -EPERM;
+
+   /*
+* Check the channel state: only queue chirp if channel state
+* allows it.
+*/
+   dw_state = pchnl-dw_state;
+   if (dw_state != CHNL_STATEREADY) {
+   if (dw_state  CHNL_STATECANCEL)
+   return -ECANCELED;
+   if ((dw_state  CHNL_STATEEOS) 
+   CHNL_IS_OUTPUT(pchnl-chnl_mode))
+   return -EPIPE;
+   /* No other possible states left */
+   DBC_ASSERT(0);
}
 
dev_obj = dev_get_first();
dev_get_bridge_context(dev_obj, dev_ctxt);
if (!dev_ctxt)
-   status = -EFAULT;
-
-   if (status)
-   goto func_end;
+   return -EFAULT;
 
if (pchnl-chnl_type == CHNL_PCPY  pchnl-chnl_id  1  host_buf) {
if (!(host_buf  (void *)USERMODE_ADDR)) {
@@ -142,18 +138,16 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, 
void *host_buf,
}
/* if addr in user mode, then copy to kernel space */
host_sys_buf = kmalloc(buf_size, GFP_KERNEL);
-   if (host_sys_buf == NULL) {
-   status = -ENOMEM;
-   goto func_end;
-   }
+   if (host_sys_buf == NULL)
+   return -ENOMEM;
+
if (CHNL_IS_OUTPUT(pchnl-chnl_mode)) {
status = copy_from_user(host_sys_buf, host_buf,
-   buf_size);
+   buf_size);
if (status) {
kfree(host_sys_buf);
host_sys_buf = NULL;
-   status = -EFAULT;
-   goto func_end;
+   return -EFAULT;
}
}
}
@@ -167,65 +161,62 @@ func_cont:
omap_mbox_disable_irq(dev_ctxt-mbox, IRQ_RX);
if (pchnl-chnl_type == CHNL_PCPY) {
/* This is a processor-copy channel. */
-   if (!status  CHNL_IS_OUTPUT(pchnl-chnl_mode)) {
+   if (CHNL_IS_OUTPUT(pchnl-chnl_mode)) {
/* Check buffer size on output channels for fit. */
-   if (byte_size 
-   io_buf_size(pchnl-chnl_mgr_obj-hio_mgr))
+   if (byte_size  io_buf_size(
+   pchnl-chnl_mgr_obj-hio_mgr)) {
status = -EINVAL;
-
+   goto out;
+   }
}
}
-   if (!status) {
-   /* Get a free chirp: */
-   if (!list_empty(pchnl-free_packets_list)) {
-   chnl_packet_obj = list_first_entry(
-   pchnl-free_packets_list,
-   struct chnl_irp, link);
-   

[PATCH v2 11/12] staging: tidspbridge: pmgr code cleanup

2010-11-05 Thread Ionut Nicu
Reorganized some code in the pmgr module to increase
its readability. No functional changes were done.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/pmgr/cmm.c |  354 ++-
 drivers/staging/tidspbridge/pmgr/dev.c |   20 +--
 2 files changed, 166 insertions(+), 208 deletions(-)

diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c 
b/drivers/staging/tidspbridge/pmgr/cmm.c
index 603ed55..898f3de 100644
--- a/drivers/staging/tidspbridge/pmgr/cmm.c
+++ b/drivers/staging/tidspbridge/pmgr/cmm.c
@@ -250,26 +250,23 @@ int cmm_create(struct cmm_object **ph_cmm_mgr,
*ph_cmm_mgr = NULL;
/* create, zero, and tag a cmm mgr object */
cmm_obj = kzalloc(sizeof(struct cmm_object), GFP_KERNEL);
-   if (cmm_obj != NULL) {
-   if (mgr_attrts == NULL)
-   mgr_attrts = cmm_dfltmgrattrs; /* set defaults */
-
-   /* 4 bytes minimum */
-   DBC_ASSERT(mgr_attrts-ul_min_block_size = 4);
-   /* save away smallest block allocation for this cmm mgr */
-   cmm_obj-ul_min_block_size = mgr_attrts-ul_min_block_size;
-   cmm_obj-dw_page_size = PAGE_SIZE;
-
-   /* Note: DSP SM seg table(aDSPSMSegTab[]) zero'd by
-* MEM_ALLOC_OBJECT */
-
-   /* create node free list */
-   INIT_LIST_HEAD(cmm_obj-node_free_list);
-   mutex_init(cmm_obj-cmm_lock);
-   *ph_cmm_mgr = cmm_obj;
-   } else {
-   status = -ENOMEM;
-   }
+   if (!cmm_obj)
+   return -ENOMEM;
+
+   if (mgr_attrts == NULL)
+   mgr_attrts = cmm_dfltmgrattrs; /* set defaults */
+
+   /* 4 bytes minimum */
+   DBC_ASSERT(mgr_attrts-ul_min_block_size = 4);
+   /* save away smallest block allocation for this cmm mgr */
+   cmm_obj-ul_min_block_size = mgr_attrts-ul_min_block_size;
+   cmm_obj-dw_page_size = PAGE_SIZE;
+
+   /* create node free list */
+   INIT_LIST_HEAD(cmm_obj-node_free_list);
+   mutex_init(cmm_obj-cmm_lock);
+   *ph_cmm_mgr = cmm_obj;
+
return status;
 }
 
@@ -346,13 +343,12 @@ void cmm_exit(void)
  *  Purpose:
  *  Free the given buffer.
  */
-int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa,
-   u32 ul_seg_id)
+int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, u32 ul_seg_id)
 {
struct cmm_object *cmm_mgr_obj = (struct cmm_object *)hcmm_mgr;
int status = -EFAULT;
struct cmm_mnode *curr, *tmp;
-   struct cmm_allocator *allocator = NULL;
+   struct cmm_allocator *allocator;
struct cmm_attrs *pattrs;
 
DBC_REQUIRE(refs  0);
@@ -366,21 +362,22 @@ int cmm_free_buf(struct cmm_object *hcmm_mgr, void 
*buf_pa,
status = -EFAULT;
return status;
}
-   /* get the allocator for this segment id */
+
allocator = get_allocator(cmm_mgr_obj, ul_seg_id);
-   if (allocator != NULL) {
-   mutex_lock(cmm_mgr_obj-cmm_lock);
-   list_for_each_entry_safe(curr, tmp, allocator-in_use_list,
-   link) {
-   if (curr-dw_pa == (u32) buf_pa) {
-   list_del(curr-link);
-   add_to_free_list(allocator, curr);
-   status = 0;
-   break;
-   }
+   if (!allocator)
+   return status;
+
+   mutex_lock(cmm_mgr_obj-cmm_lock);
+   list_for_each_entry_safe(curr, tmp, allocator-in_use_list, link) {
+   if (curr-dw_pa == (u32) buf_pa) {
+   list_del(curr-link);
+   add_to_free_list(allocator, curr);
+   status = 0;
+   break;
}
-   mutex_unlock(cmm_mgr_obj-cmm_lock);
}
+   mutex_unlock(cmm_mgr_obj-cmm_lock);
+
return status;
 }
 
@@ -438,31 +435,30 @@ int cmm_get_info(struct cmm_object *hcmm_mgr,
for (ul_seg = 1; ul_seg = CMM_MAXGPPSEGS; ul_seg++) {
/* get the allocator object for this segment id */
altr = get_allocator(cmm_mgr_obj, ul_seg);
-   if (altr != NULL) {
-   cmm_info_obj-ul_num_gppsm_segs++;
-   cmm_info_obj-seg_info[ul_seg - 1].dw_seg_base_pa =
-   altr-shm_base - altr-ul_dsp_size;
-   cmm_info_obj-seg_info[ul_seg - 1].ul_total_seg_size =
-   altr-ul_dsp_size + altr-ul_sm_size;
-   cmm_info_obj-seg_info[ul_seg - 1].dw_gpp_base_pa =
-   altr-shm_base;
-   cmm_info_obj-seg_info[ul_seg - 1].ul_gpp_size =
-   altr-ul_sm_size;
-   cmm_info_obj-seg_info[ul_seg - 1].dw_dsp_base_va =
- 

[PATCH v2 12/12] staging: tidspbridge: rmgr code cleanup

2010-11-05 Thread Ionut Nicu
Reorganized some code in the rmgr module to increase
its readability. No functional changes were done.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/drv.c  |  171 +---
 drivers/staging/tidspbridge/rmgr/node.c |   82 +-
 drivers/staging/tidspbridge/rmgr/rmm.c  |  267 +--
 3 files changed, 229 insertions(+), 291 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/drv.c 
b/drivers/staging/tidspbridge/rmgr/drv.c
index 18fae55..4eff419 100644
--- a/drivers/staging/tidspbridge/rmgr/drv.c
+++ b/drivers/staging/tidspbridge/rmgr/drv.c
@@ -293,40 +293,28 @@ int drv_proc_update_strm_res(u32 num_bufs, void 
*strm_resources)
  */
 int drv_create(struct drv_object **drv_obj)
 {
-   int status = 0;
struct drv_object *pdrv_object = NULL;
struct drv_data *drv_datap = dev_get_drvdata(bridge);
 
DBC_REQUIRE(drv_obj != NULL);
DBC_REQUIRE(refs  0);
 
+   if (!drv_datap)
+   return -EFAULT;
+
pdrv_object = kzalloc(sizeof(struct drv_object), GFP_KERNEL);
-   if (pdrv_object) {
-   /* Create and Initialize List of device objects */
-   INIT_LIST_HEAD(pdrv_object-dev_list);
-   INIT_LIST_HEAD(pdrv_object-dev_node_string);
-   } else {
-   status = -ENOMEM;
-   }
-   /* Store the DRV Object in the driver data */
-   if (!status) {
-   if (drv_datap) {
-   drv_datap-drv_object = (void *)pdrv_object;
-   } else {
-   status = -EPERM;
-   pr_err(%s: Failed to store DRV object\n, __func__);
-   }
-   }
+   if (!pdrv_object)
+   return -ENOMEM;
 
-   if (!status) {
-   *drv_obj = pdrv_object;
-   } else {
-   /* Free the DRV Object */
-   kfree(pdrv_object);
-   }
+   /* Create and Initialize List of device objects */
+   INIT_LIST_HEAD(pdrv_object-dev_list);
+   INIT_LIST_HEAD(pdrv_object-dev_node_string);
 
-   DBC_ENSURE(status || pdrv_object);
-   return status;
+   /* Store the DRV Object in the driver data */
+   drv_datap-drv_object = (void *)pdrv_object;
+   *drv_obj = pdrv_object;
+
+   return 0;
 }
 
 /*
@@ -413,19 +401,19 @@ int drv_get_dev_object(u32 index, struct drv_object 
*hdrv_obj,
  */
 u32 drv_get_first_dev_object(void)
 {
-   u32 dw_dev_object = 0;
struct drv_object *pdrv_obj;
struct drv_data *drv_datap = dev_get_drvdata(bridge);
 
-   if (drv_datap  drv_datap-drv_object) {
-   pdrv_obj = drv_datap-drv_object;
-   if (!list_empty(pdrv_obj-dev_list))
-   dw_dev_object = (u32) pdrv_obj-dev_list.next;
-   } else {
+   if (!drv_datap || !drv_datap-drv_object) {
pr_err(%s: Failed to retrieve the object handle\n, __func__);
+   return 0;
}
 
-   return dw_dev_object;
+   pdrv_obj = drv_datap-drv_object;
+   if (list_empty(pdrv_obj-dev_list))
+   return 0;
+
+   return (u32) pdrv_obj-dev_list.next;
 }
 
 /*
@@ -436,21 +424,19 @@ u32 drv_get_first_dev_object(void)
  */
 u32 drv_get_first_dev_extension(void)
 {
-   u32 dw_dev_extension = 0;
struct drv_object *pdrv_obj;
struct drv_data *drv_datap = dev_get_drvdata(bridge);
 
-   if (drv_datap  drv_datap-drv_object) {
-   pdrv_obj = drv_datap-drv_object;
-   if (!list_empty(pdrv_obj-dev_node_string)) {
-   dw_dev_extension =
-   (u32) pdrv_obj-dev_node_string.next;
-   }
-   } else {
+   if (!drv_datap || !drv_datap-drv_object) {
pr_err(%s: Failed to retrieve the object handle\n, __func__);
+   return 0;
}
 
-   return dw_dev_extension;
+   pdrv_obj = drv_datap-drv_object;
+   if (list_empty(pdrv_obj-dev_node_string))
+   return 0;
+
+   return (u32) pdrv_obj-dev_node_string.next;
 }
 
 /*
@@ -462,26 +448,27 @@ u32 drv_get_first_dev_extension(void)
  */
 u32 drv_get_next_dev_object(u32 hdev_obj)
 {
-   u32 dw_next_dev_object = 0;
struct drv_object *pdrv_obj;
struct drv_data *drv_datap = dev_get_drvdata(bridge);
struct list_head *curr;
 
DBC_REQUIRE(hdev_obj != 0);
 
-   if (drv_datap  drv_datap-drv_object) {
-   pdrv_obj = drv_datap-drv_object;
-   if (!list_empty(pdrv_obj-dev_list)) {
-   curr = (struct list_head *)hdev_obj;
-   if (curr-next == pdrv_obj-dev_list)
-   return 0;
-   dw_next_dev_object = (u32) curr-next;
-   }
-   } else {
+   if (!drv_datap || !drv_datap-drv_object) {
pr_err(%s: Failed to retrieve the object handle\n, __func__);
+   

[PATCH v2 02/12] staging: tidspbridge: remove utildefs

2010-11-05 Thread Ionut Nicu
Remove a header file that was not very useful to
the dspbridge driver.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 .../tidspbridge/include/dspbridge/utildefs.h   |   39 
 drivers/staging/tidspbridge/pmgr/cmm.c |9 +
 2 files changed, 1 insertions(+), 47 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/utildefs.h

diff --git a/drivers/staging/tidspbridge/include/dspbridge/utildefs.h 
b/drivers/staging/tidspbridge/include/dspbridge/utildefs.h
deleted file mode 100644
index 8fe5414..000
--- a/drivers/staging/tidspbridge/include/dspbridge/utildefs.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * utildefs.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Global UTIL constants and types, shared between DSP API and DSPSYS.
- *
- * Copyright (C) 2005-2006 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#ifndef UTILDEFS_
-#define UTILDEFS_
-
-/* constants taken from configmg.h */
-#define UTIL_MAXMEMREGS 9
-#define UTIL_MAXIOPORTS 20
-#define UTIL_MAXIRQS7
-#define UTIL_MAXDMACHNLS7
-
-/* misc. constants */
-#define UTIL_MAXARGVS   10
-
-/* Platform specific important info */
-struct util_sysinfo {
-   /* Granularity of page protection; usually 1k or 4k */
-   u32 dw_page_size;
-   u32 dw_allocation_granularity;  /* VM granularity, usually 64K */
-   u32 dw_number_of_processors;/* Used as sanity check */
-};
-
-#endif /* UTILDEFS_ */
diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c 
b/drivers/staging/tidspbridge/pmgr/cmm.c
index 93a7c4f..8dbdd20 100644
--- a/drivers/staging/tidspbridge/pmgr/cmm.c
+++ b/drivers/staging/tidspbridge/pmgr/cmm.c
@@ -40,7 +40,6 @@
 /*  --- OS Adaptation Layer */
 #include dspbridge/list.h
 #include dspbridge/sync.h
-#include dspbridge/utildefs.h
 
 /*  --- Platform Manager */
 #include dspbridge/dev.h
@@ -245,7 +244,6 @@ int cmm_create(struct cmm_object **ph_cmm_mgr,
 {
struct cmm_object *cmm_obj = NULL;
int status = 0;
-   struct util_sysinfo sys_info;
 
DBC_REQUIRE(refs  0);
DBC_REQUIRE(ph_cmm_mgr != NULL);
@@ -261,12 +259,7 @@ int cmm_create(struct cmm_object **ph_cmm_mgr,
DBC_ASSERT(mgr_attrts-ul_min_block_size = 4);
/* save away smallest block allocation for this cmm mgr */
cmm_obj-ul_min_block_size = mgr_attrts-ul_min_block_size;
-   /* save away the systems memory page size */
-   sys_info.dw_page_size = PAGE_SIZE;
-   sys_info.dw_allocation_granularity = PAGE_SIZE;
-   sys_info.dw_number_of_processors = 1;
-
-   cmm_obj-dw_page_size = sys_info.dw_page_size;
+   cmm_obj-dw_page_size = PAGE_SIZE;
 
/* Note: DSP SM seg table(aDSPSMSegTab[]) zero'd by
 * MEM_ALLOC_OBJECT */
-- 
1.7.2.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 v2 0/3] staging: tidspbridge: bugfixes

2010-11-05 Thread Ionut Nicu
Changes since v1:

* Split the mgr_enum_node_info patch into two patches:
one that fixes the issue and one that reorganizes the
code.

Ionut Nicu (3):
  staging: tidspbridge: fix mgr_enum_node_info
  staging: tidspbridge: mgr_enum_node_info cleanup
  staging: tidspbridge: fix kernel oops in bridge_io_get_proc_load

 drivers/staging/tidspbridge/core/io_sm.c |   78 +++--
 drivers/staging/tidspbridge/rmgr/mgr.c   |   50 +++
 2 files changed, 48 insertions(+), 80 deletions(-)

-- 
1.7.2.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 v2 1/3] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Ionut Nicu
The current code was always returning a non-zero status value
to userspace applications when this ioctl was called.

The error code was ENODATA, which isn't actually an error,
it's always returned by dcd_enumerate_object() when it hits the
end of list.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/mgr.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c 
b/drivers/staging/tidspbridge/rmgr/mgr.c
index 0ea89a1..2eab6a5 100644
--- a/drivers/staging/tidspbridge/rmgr/mgr.c
+++ b/drivers/staging/tidspbridge/rmgr/mgr.c
@@ -169,6 +169,11 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
 
}
}
+
+   /* the last status is not 0, but neither an error */
+   if (status  0)
+   status = 0;
+
if (!status) {
if (node_id  (node_index - 1)) {
status = -EINVAL;
-- 
1.7.2.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 v2 2/3] staging: tidspbridge: mgr_enum_node_info cleanup

2010-11-05 Thread Ionut Nicu
Reorganized mgr_enum_node_info code to increase its
readability.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/mgr.c |   51 ++--
 1 files changed, 16 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c 
b/drivers/staging/tidspbridge/rmgr/mgr.c
index 2eab6a5..16410a5 100644
--- a/drivers/staging/tidspbridge/rmgr/mgr.c
+++ b/drivers/staging/tidspbridge/rmgr/mgr.c
@@ -134,8 +134,7 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
  u32 undb_props_size, u32 *pu_num_nodes)
 {
int status = 0;
-   struct dsp_uuid node_uuid, temp_uuid;
-   u32 temp_index = 0;
+   struct dsp_uuid node_uuid;
u32 node_index = 0;
struct dcd_genericobj gen_obj;
struct mgr_object *pmgr_obj = NULL;
@@ -149,24 +148,27 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
*pu_num_nodes = 0;
/* Get the Manager Object from the driver data */
if (!drv_datap || !drv_datap-mgr_object) {
-   status = -ENODATA;
pr_err(%s: Failed to retrieve the object handle\n, __func__);
-   goto func_cont;
-   } else {
-   pmgr_obj = drv_datap-mgr_object;
+   return -ENODATA;
}
+   pmgr_obj = drv_datap-mgr_object;
 
DBC_ASSERT(pmgr_obj);
/* Forever loop till we hit failed or no more items in the
 * Enumeration. We will exit the loop other than 0; */
-   while (status == 0) {
-   status = dcd_enumerate_object(temp_index++, DSP_DCDNODETYPE,
- temp_uuid);
-   if (status == 0) {
-   node_index++;
-   if (node_id == (node_index - 1))
-   node_uuid = temp_uuid;
-
+   while (!status) {
+   status = dcd_enumerate_object(node_index++, DSP_DCDNODETYPE,
+   node_uuid);
+   if (status)
+   break;
+   *pu_num_nodes = node_index;
+   if (node_id == (node_index - 1)) {
+   status = dcd_get_object_def(pmgr_obj-hdcd_mgr,
+   node_uuid, DSP_DCDNODETYPE, gen_obj);
+   if (status)
+   break;
+   /* Get the Obj def */
+   *pndb_props = gen_obj.obj_data.node_obj.ndb_props;
}
}
 
@@ -174,27 +176,6 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
if (status  0)
status = 0;
 
-   if (!status) {
-   if (node_id  (node_index - 1)) {
-   status = -EINVAL;
-   } else {
-   status = dcd_get_object_def(pmgr_obj-hdcd_mgr,
-   (struct dsp_uuid *)
-   node_uuid, DSP_DCDNODETYPE,
-   gen_obj);
-   if (!status) {
-   /* Get the Obj def */
-   *pndb_props =
-   gen_obj.obj_data.node_obj.ndb_props;
-   *pu_num_nodes = node_index;
-   }
-   }
-   }
-
-func_cont:
-   DBC_ENSURE((!status  *pu_num_nodes  0) ||
-  (status  *pu_num_nodes == 0));
-
return status;
 }
 
-- 
1.7.2.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 v2 3/3] staging: tidspbridge: fix kernel oops in bridge_io_get_proc_load

2010-11-05 Thread Ionut Nicu
The DSP shared memory area gets initialized only when
a COFF file is loaded.

If bridge_io_get_proc_load is called before loading a base
image into the DSP, the shared_mem member of the io manager
will be NULL, resulting in a kernel oops when it's dereferenced.

Also made some coding style changes to bridge_io_create.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/core/io_sm.c |   78 +++--
 1 files changed, 30 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index de2cc3b..bd407b6 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -164,57 +164,41 @@ int bridge_io_create(struct io_mgr **io_man,
struct dev_object *hdev_obj,
const struct io_attrs *mgr_attrts)
 {
-   int status = 0;
struct io_mgr *pio_mgr = NULL;
-   struct shm *shared_mem = NULL;
struct bridge_dev_context *hbridge_context = NULL;
struct cfg_devnode *dev_node_obj;
struct chnl_mgr *hchnl_mgr;
u8 dev_type;
 
/* Check requirements */
-   if (!io_man || !mgr_attrts || mgr_attrts-word_size == 0) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!io_man || !mgr_attrts || mgr_attrts-word_size == 0)
+   return -EFAULT;
+
+   *io_man = NULL;
+
dev_get_chnl_mgr(hdev_obj, hchnl_mgr);
-   if (!hchnl_mgr || hchnl_mgr-hio_mgr) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!hchnl_mgr || hchnl_mgr-hio_mgr)
+   return -EFAULT;
+
/*
 * Message manager will be created when a file is loaded, since
 * size of message buffer in shared memory is configurable in
 * the base image.
 */
dev_get_bridge_context(hdev_obj, hbridge_context);
-   if (!hbridge_context) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!hbridge_context)
+   return -EFAULT;
+
dev_get_dev_type(hdev_obj, dev_type);
-   /*
-* DSP shared memory area will get set properly when
-* a program is loaded. They are unknown until a COFF file is
-* loaded. I chose the value -1 because it was less likely to be
-* a valid address than 0.
-*/
-   shared_mem = (struct shm *)-1;
 
/* Allocate IO manager object */
pio_mgr = kzalloc(sizeof(struct io_mgr), GFP_KERNEL);
-   if (pio_mgr == NULL) {
-   status = -ENOMEM;
-   goto func_end;
-   }
+   if (!pio_mgr)
+   return -ENOMEM;
 
/* Initialize chnl_mgr object */
-#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
-   pio_mgr-pmsg = NULL;
-#endif
pio_mgr-hchnl_mgr = hchnl_mgr;
pio_mgr-word_size = mgr_attrts-word_size;
-   pio_mgr-shared_mem = shared_mem;
 
if (dev_type == DSP_UNIT) {
/* Create an IO DPC */
@@ -226,29 +210,24 @@ int bridge_io_create(struct io_mgr **io_man,
 
spin_lock_init(pio_mgr-dpc_lock);
 
-   status = dev_get_dev_node(hdev_obj, dev_node_obj);
+   if (dev_get_dev_node(hdev_obj, dev_node_obj)) {
+   bridge_io_destroy(pio_mgr);
+   return -EIO;
+   }
}
 
-   if (!status) {
-   pio_mgr-hbridge_context = hbridge_context;
-   pio_mgr-shared_irq = mgr_attrts-irq_shared;
-   if (dsp_wdt_init())
-   status = -EPERM;
-   } else {
-   status = -EIO;
-   }
-func_end:
-   if (status) {
-   /* Cleanup */
+   pio_mgr-hbridge_context = hbridge_context;
+   pio_mgr-shared_irq = mgr_attrts-irq_shared;
+   if (dsp_wdt_init()) {
bridge_io_destroy(pio_mgr);
-   if (io_man)
-   *io_man = NULL;
-   } else {
-   /* Return IO manager object to caller... */
-   hchnl_mgr-hio_mgr = pio_mgr;
-   *io_man = pio_mgr;
+   return -EPERM;
}
-   return status;
+
+   /* Return IO manager object to caller... */
+   hchnl_mgr-hio_mgr = pio_mgr;
+   *io_man = pio_mgr;
+
+   return 0;
 }
 
 /*
@@ -1532,6 +1511,9 @@ int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, void 
*pargs)
 int bridge_io_get_proc_load(struct io_mgr *hio_mgr,
struct dsp_procloadstat *proc_lstat)
 {
+   if (!hio_mgr-shared_mem)
+   return -EFAULT;
+
proc_lstat-curr_load =
hio_mgr-shared_mem-load_mon_info.curr_dsp_load;
proc_lstat-predicted_load =
-- 
1.7.2.3

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

Re: [PATCH v2 0/3] staging: tidspbridge: bugfixes

2010-11-05 Thread Greg KH
On Fri, Nov 05, 2010 at 05:15:45PM +0200, Ionut Nicu wrote:
 Changes since v1:
 
 * Split the mgr_enum_node_info patch into two patches:
 one that fixes the issue and one that reorganizes the
 code.

Are these for the .37 or .38 kernel?

thanks,

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


Re: [PATCH v2 00/12] staging: tidspbridge: various cleanups

2010-11-05 Thread Greg KH
On Fri, Nov 05, 2010 at 05:13:04PM +0200, Ionut Nicu wrote:
 This set of patches replaces some of the redundant components of
 the tidspbridge driver, such as:
 
 * wrapper functions for kmalloc/kfree
 * custom bitmap implementation
 * custom linked list implementation (list_head wrapper)
 
 with the standard linux kernel interfaces.
 
 The patches also do some code reorganization for increasing readability.
 Most of the changes reduce the code indentation level and simplify the code.
 No functional changes were done.
 
 There are many places in this driver that need this kind of cleanup, but
 these patches only fix the functions that were touched while converting
 the code to use linux bitmap and list_head.

This is for .38, right?

thanks,

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


Re: [PATCH v2 0/3] staging: tidspbridge: bugfixes

2010-11-05 Thread Ionut Nicu
Hi,

On Fri, 2010-11-05 at 08:43 -0700, Greg KH wrote:
 On Fri, Nov 05, 2010 at 05:15:45PM +0200, Ionut Nicu wrote:
  Changes since v1:
  
  * Split the mgr_enum_node_info patch into two patches:
  one that fixes the issue and one that reorganizes the
  code.
 
 Are these for the .37 or .38 kernel?
 

They're bug fixes, so I think they should get into .37. It's up to you
to decide.

Thanks,
Ionut.

--
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] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Felipe Contreras
On Fri, Nov 5, 2010 at 5:15 PM, Ionut Nicu ionut.n...@gmail.com wrote:
 The current code was always returning a non-zero status value
 to userspace applications when this ioctl was called.

 The error code was ENODATA, which isn't actually an error,
 it's always returned by dcd_enumerate_object() when it hits the
 end of list.

 Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
 Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro

You should leave the original author (me).

-- 
Felipe Contreras
--
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 00/12] staging: tidspbridge: various cleanups

2010-11-05 Thread Ionut Nicu
Hi,

On Fri, 2010-11-05 at 08:43 -0700, Greg KH wrote:
 On Fri, Nov 05, 2010 at 05:13:04PM +0200, Ionut Nicu wrote:
  This set of patches replaces some of the redundant components of
  the tidspbridge driver, such as:
  
  * wrapper functions for kmalloc/kfree
  * custom bitmap implementation
  * custom linked list implementation (list_head wrapper)
  
  with the standard linux kernel interfaces.
  
  The patches also do some code reorganization for increasing readability.
  Most of the changes reduce the code indentation level and simplify the code.
  No functional changes were done.
  
  There are many places in this driver that need this kind of cleanup, but
  these patches only fix the functions that were touched while converting
  the code to use linux bitmap and list_head.
 
 This is for .38, right?
 

Yes, the diff stat is quite big, so if they pass code review, they
should be considered for .38.

Thanks,
Ionut


--
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: feature: fix OMAP3_IVA_MASK

2010-11-05 Thread Nishanth Menon
From: Arno Steffen arno.stef...@googlemail.com

OMAP3_IVA_MASK should use OMAP3_IVA_SHIFT instead of OMAP3_SGX_SHIFT

Signed-off-by: Arno Steffen arno.stef...@googlemail.com
---
Sending on behalf of Arno - he pointed at the change and everything
except for the patch ;)
Reported here:
http://marc.info/?l=linux-omapm=128896969832702w=2

 arch/arm/mach-omap2/control.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index b6c6b7c..5325297 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -309,7 +309,7 @@
 #defineFEAT_SGX_NONE   2
 
 #define OMAP3_IVA_SHIFT12
-#define OMAP3_IVA_MASK (1  OMAP3_SGX_SHIFT)
+#define OMAP3_IVA_MASK (1  OMAP3_IVA_SHIFT)
 #defineFEAT_IVA0
 #defineFEAT_IVA_NONE   1
 
-- 
1.7.1

--
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] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Greg KH
On Fri, Nov 05, 2010 at 06:01:47PM +0200, Felipe Contreras wrote:
 On Fri, Nov 5, 2010 at 5:15 PM, Ionut Nicu ionut.n...@gmail.com wrote:
  The current code was always returning a non-zero status value
  to userspace applications when this ioctl was called.
 
  The error code was ENODATA, which isn't actually an error,
  it's always returned by dcd_enumerate_object() when it hits the
  end of list.
 
  Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
  Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
 
 You should leave the original author (me).

Ick, yes, that is very bad.

Ionut, please go re-read Documentation/SubmittingPatches for how to
properly attribute the original author of the patch.  Please resend all
of these patches after ensuring that you have the proper authors
credited.

thanks,

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


Re: [PATCH v2 1/3] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Ionut Nicu
On Fri, 2010-11-05 at 09:09 -0700, Greg KH wrote:
 On Fri, Nov 05, 2010 at 06:01:47PM +0200, Felipe Contreras wrote:
  On Fri, Nov 5, 2010 at 5:15 PM, Ionut Nicu ionut.n...@gmail.com wrote:
   The current code was always returning a non-zero status value
   to userspace applications when this ioctl was called.
  
   The error code was ENODATA, which isn't actually an error,
   it's always returned by dcd_enumerate_object() when it hits the
   end of list.
  
   Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
   Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
  
  You should leave the original author (me).
 
 Ick, yes, that is very bad.
 
 Ionut, please go re-read Documentation/SubmittingPatches for how to
 properly attribute the original author of the patch.  Please resend all
 of these patches after ensuring that you have the proper authors
 credited.
 

Oops. Sorry about that. I put my sign off on this patch because the fix
was also in v1 of this series, but it was combined with patch 3/3.

I definitely don't want to take credit for other people's work, so I
will re-submit this series.

Thanks,
Ionut. 



--
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] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Greg KH
On Fri, Nov 05, 2010 at 06:17:55PM +0200, Ionut Nicu wrote:
 On Fri, 2010-11-05 at 09:09 -0700, Greg KH wrote:
  On Fri, Nov 05, 2010 at 06:01:47PM +0200, Felipe Contreras wrote:
   On Fri, Nov 5, 2010 at 5:15 PM, Ionut Nicu ionut.n...@gmail.com wrote:
The current code was always returning a non-zero status value
to userspace applications when this ioctl was called.
   
The error code was ENODATA, which isn't actually an error,
it's always returned by dcd_enumerate_object() when it hits the
end of list.
   
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
   
   You should leave the original author (me).
  
  Ick, yes, that is very bad.
  
  Ionut, please go re-read Documentation/SubmittingPatches for how to
  properly attribute the original author of the patch.  Please resend all
  of these patches after ensuring that you have the proper authors
  credited.
  
 
 Oops. Sorry about that. I put my sign off on this patch because the fix
 was also in v1 of this series, but it was combined with patch 3/3.
 
 I definitely don't want to take credit for other people's work, so I
 will re-submit this series.

I now have to ask if your other series also all came from you, did it?
If not, please resend it as well.

thanks,

greg k-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 v3 1/3] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Ionut Nicu
The current code was always returning a non-zero status value
to userspace applications when this ioctl was called.

The error code was ENODATA, which isn't actually an error,
it's always returned by dcd_enumerate_object() when it hits the
end of list.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/rmgr/mgr.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c 
b/drivers/staging/tidspbridge/rmgr/mgr.c
index 0ea89a1..2eab6a5 100644
--- a/drivers/staging/tidspbridge/rmgr/mgr.c
+++ b/drivers/staging/tidspbridge/rmgr/mgr.c
@@ -169,6 +169,11 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
 
}
}
+
+   /* the last status is not 0, but neither an error */
+   if (status  0)
+   status = 0;
+
if (!status) {
if (node_id  (node_index - 1)) {
status = -EINVAL;
-- 
1.7.2.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 v3 2/3] staging: tidspbridge: mgr_enum_node_info cleanup

2010-11-05 Thread Ionut Nicu
Reorganized mgr_enum_node_info code to increase its
readability.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/mgr.c |   51 ++--
 1 files changed, 16 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c 
b/drivers/staging/tidspbridge/rmgr/mgr.c
index 2eab6a5..16410a5 100644
--- a/drivers/staging/tidspbridge/rmgr/mgr.c
+++ b/drivers/staging/tidspbridge/rmgr/mgr.c
@@ -134,8 +134,7 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
  u32 undb_props_size, u32 *pu_num_nodes)
 {
int status = 0;
-   struct dsp_uuid node_uuid, temp_uuid;
-   u32 temp_index = 0;
+   struct dsp_uuid node_uuid;
u32 node_index = 0;
struct dcd_genericobj gen_obj;
struct mgr_object *pmgr_obj = NULL;
@@ -149,24 +148,27 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
*pu_num_nodes = 0;
/* Get the Manager Object from the driver data */
if (!drv_datap || !drv_datap-mgr_object) {
-   status = -ENODATA;
pr_err(%s: Failed to retrieve the object handle\n, __func__);
-   goto func_cont;
-   } else {
-   pmgr_obj = drv_datap-mgr_object;
+   return -ENODATA;
}
+   pmgr_obj = drv_datap-mgr_object;
 
DBC_ASSERT(pmgr_obj);
/* Forever loop till we hit failed or no more items in the
 * Enumeration. We will exit the loop other than 0; */
-   while (status == 0) {
-   status = dcd_enumerate_object(temp_index++, DSP_DCDNODETYPE,
- temp_uuid);
-   if (status == 0) {
-   node_index++;
-   if (node_id == (node_index - 1))
-   node_uuid = temp_uuid;
-
+   while (!status) {
+   status = dcd_enumerate_object(node_index++, DSP_DCDNODETYPE,
+   node_uuid);
+   if (status)
+   break;
+   *pu_num_nodes = node_index;
+   if (node_id == (node_index - 1)) {
+   status = dcd_get_object_def(pmgr_obj-hdcd_mgr,
+   node_uuid, DSP_DCDNODETYPE, gen_obj);
+   if (status)
+   break;
+   /* Get the Obj def */
+   *pndb_props = gen_obj.obj_data.node_obj.ndb_props;
}
}
 
@@ -174,27 +176,6 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
if (status  0)
status = 0;
 
-   if (!status) {
-   if (node_id  (node_index - 1)) {
-   status = -EINVAL;
-   } else {
-   status = dcd_get_object_def(pmgr_obj-hdcd_mgr,
-   (struct dsp_uuid *)
-   node_uuid, DSP_DCDNODETYPE,
-   gen_obj);
-   if (!status) {
-   /* Get the Obj def */
-   *pndb_props =
-   gen_obj.obj_data.node_obj.ndb_props;
-   *pu_num_nodes = node_index;
-   }
-   }
-   }
-
-func_cont:
-   DBC_ENSURE((!status  *pu_num_nodes  0) ||
-  (status  *pu_num_nodes == 0));
-
return status;
 }
 
-- 
1.7.2.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 v3 3/3] staging: tidspbridge: fix kernel oops in bridge_io_get_proc_load

2010-11-05 Thread Ionut Nicu
The DSP shared memory area gets initialized only when
a COFF file is loaded.

If bridge_io_get_proc_load is called before loading a base
image into the DSP, the shared_mem member of the io manager
will be NULL, resulting in a kernel oops when it's dereferenced.

Also made some coding style changes to bridge_io_create.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/core/io_sm.c |   78 +++--
 1 files changed, 30 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index de2cc3b..bd407b6 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -164,57 +164,41 @@ int bridge_io_create(struct io_mgr **io_man,
struct dev_object *hdev_obj,
const struct io_attrs *mgr_attrts)
 {
-   int status = 0;
struct io_mgr *pio_mgr = NULL;
-   struct shm *shared_mem = NULL;
struct bridge_dev_context *hbridge_context = NULL;
struct cfg_devnode *dev_node_obj;
struct chnl_mgr *hchnl_mgr;
u8 dev_type;
 
/* Check requirements */
-   if (!io_man || !mgr_attrts || mgr_attrts-word_size == 0) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!io_man || !mgr_attrts || mgr_attrts-word_size == 0)
+   return -EFAULT;
+
+   *io_man = NULL;
+
dev_get_chnl_mgr(hdev_obj, hchnl_mgr);
-   if (!hchnl_mgr || hchnl_mgr-hio_mgr) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!hchnl_mgr || hchnl_mgr-hio_mgr)
+   return -EFAULT;
+
/*
 * Message manager will be created when a file is loaded, since
 * size of message buffer in shared memory is configurable in
 * the base image.
 */
dev_get_bridge_context(hdev_obj, hbridge_context);
-   if (!hbridge_context) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!hbridge_context)
+   return -EFAULT;
+
dev_get_dev_type(hdev_obj, dev_type);
-   /*
-* DSP shared memory area will get set properly when
-* a program is loaded. They are unknown until a COFF file is
-* loaded. I chose the value -1 because it was less likely to be
-* a valid address than 0.
-*/
-   shared_mem = (struct shm *)-1;
 
/* Allocate IO manager object */
pio_mgr = kzalloc(sizeof(struct io_mgr), GFP_KERNEL);
-   if (pio_mgr == NULL) {
-   status = -ENOMEM;
-   goto func_end;
-   }
+   if (!pio_mgr)
+   return -ENOMEM;
 
/* Initialize chnl_mgr object */
-#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
-   pio_mgr-pmsg = NULL;
-#endif
pio_mgr-hchnl_mgr = hchnl_mgr;
pio_mgr-word_size = mgr_attrts-word_size;
-   pio_mgr-shared_mem = shared_mem;
 
if (dev_type == DSP_UNIT) {
/* Create an IO DPC */
@@ -226,29 +210,24 @@ int bridge_io_create(struct io_mgr **io_man,
 
spin_lock_init(pio_mgr-dpc_lock);
 
-   status = dev_get_dev_node(hdev_obj, dev_node_obj);
+   if (dev_get_dev_node(hdev_obj, dev_node_obj)) {
+   bridge_io_destroy(pio_mgr);
+   return -EIO;
+   }
}
 
-   if (!status) {
-   pio_mgr-hbridge_context = hbridge_context;
-   pio_mgr-shared_irq = mgr_attrts-irq_shared;
-   if (dsp_wdt_init())
-   status = -EPERM;
-   } else {
-   status = -EIO;
-   }
-func_end:
-   if (status) {
-   /* Cleanup */
+   pio_mgr-hbridge_context = hbridge_context;
+   pio_mgr-shared_irq = mgr_attrts-irq_shared;
+   if (dsp_wdt_init()) {
bridge_io_destroy(pio_mgr);
-   if (io_man)
-   *io_man = NULL;
-   } else {
-   /* Return IO manager object to caller... */
-   hchnl_mgr-hio_mgr = pio_mgr;
-   *io_man = pio_mgr;
+   return -EPERM;
}
-   return status;
+
+   /* Return IO manager object to caller... */
+   hchnl_mgr-hio_mgr = pio_mgr;
+   *io_man = pio_mgr;
+
+   return 0;
 }
 
 /*
@@ -1532,6 +1511,9 @@ int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, void 
*pargs)
 int bridge_io_get_proc_load(struct io_mgr *hio_mgr,
struct dsp_procloadstat *proc_lstat)
 {
+   if (!hio_mgr-shared_mem)
+   return -EFAULT;
+
proc_lstat-curr_load =
hio_mgr-shared_mem-load_mon_info.curr_dsp_load;
proc_lstat-predicted_load =
-- 
1.7.2.3

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

Re: [PATCH] omap: dsp: remove shm from normal memory

2010-11-05 Thread Tony Lindgren
* Felipe Contreras felipe.contre...@gmail.com [101019 00:28]:
 Also, don't be picky about the location.

As this code is in CONFIG_TIDSPBRIDGE block and AFAIK that is
not working, this should probably wait for the next merge window?

Regards,

Tony

 
 Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
 ---
  arch/arm/plat-omap/devices.c |4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
 index 4c8f9b9..da10433 100644
 --- a/arch/arm/plat-omap/devices.c
 +++ b/arch/arm/plat-omap/devices.c
 @@ -285,12 +285,14 @@ void __init omap_dsp_reserve_sdram_memblock(void)
   if (!size)
   return;
  
 - paddr = __memblock_alloc_base(size, SZ_1M, MEMBLOCK_REAL_LIMIT);
 + paddr = memblock_alloc(size, SZ_1M);
   if (!paddr) {
   pr_err(%s: failed to reserve %x bytes\n,
   __func__, size);
   return;
   }
 + memblock_free(paddr, size);
 + memblock_remove(paddr, size);
  
   omap_dsp_phys_mempool_base = paddr;
  }
 -- 
 1.7.3.1.2.g7fe2b
 
--
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 3/4] cbus: tahvo: move platform_device to board file

2010-11-05 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [101001 05:29]:
 On Fri, Oct 01, 2010 at 07:33:38AM -0500, Balbi, Felipe wrote:
 @@ -255,9 +269,24 @@ static void __init n8x0_cbus_init(void)
  return;
  }
 
 -set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
 -retu_resource[0].start = gpio_to_irq(108);
 -platform_device_register(retu_device);
 
 hmmm, these three deleted lines look suspicious :-(
 
 Let these cook for a while, I'll get back to them in a day or two. CBUS
 is making me crazy :-p

Marking these as changes needed then in pw.k.o.

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 v3 1/3] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Nishanth Menon

Ionut Nicu wrote, on 11/05/2010 12:31 PM:

The current code was always returning a non-zero status value
to userspace applications when this ioctl was called.

The error code was ENODATA, which isn't actually an error,
it's always returned by dcd_enumerate_object() when it hits the
end of list.

Signed-off-by: Felipe Contrerasfelipe.contre...@gmail.com


please try this as well:
a) git rebase -i master (to rebase from master if your branch is off that)
b) change this commit to edit
c) git commit --amend --author Felipe Contreras 
felipe.contre...@gmail.com

to change the authorship
d) git rebase --continue

OR
edit the patch Manually and change:
From: Ionut Nicu ionut.n...@gmail.com
to
From: Felipe Contreras felipe.contre...@gmail.com

The From shows the authorship, that way, when you do a git send email, 
the proper acknowledgements are done :)


--
Regards,
Nishanth Menon
--
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 3/4] cbus: tahvo: move platform_device to board file

2010-11-05 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [101105 09:27]:
 * Felipe Balbi ba...@ti.com [101001 05:29]:
  On Fri, Oct 01, 2010 at 07:33:38AM -0500, Balbi, Felipe wrote:
  @@ -255,9 +269,24 @@ static void __init n8x0_cbus_init(void)
 return;
 }
  
  -  set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
  -  retu_resource[0].start = gpio_to_irq(108);
  -  platform_device_register(retu_device);
  
  hmmm, these three deleted lines look suspicious :-(
  
  Let these cook for a while, I'll get back to them in a day or two. CBUS
  is making me crazy :-p
 
 Marking these as changes needed then in pw.k.o.

Ah already archived and looking at the later set now,
never mind..

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


Re: [PATCH 0/4] Horray, more CBUS patches

2010-11-05 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [101019 00:29]:
 On Tue, Oct 19, 2010 at 02:38:25AM -0500, Jarkko Nikula wrote:
 On Tue, 19 Oct 2010 10:29:14 +0300
 Felipe Balbi ba...@ti.com wrote:
 
 I believe now everything is fine. Still, it's only
 compile tested with n770_defconfig and omap2plus_defconfig.
 
 Felipe Balbi (4):
   cbus: remove unneded includes
   cbus: retu: move platform_device to board file
   cbus: tahvo: move platform_device to board file
   cbus: tahvo-usb: move platform_device to board file
 
 omap2plus_defconfig doesn't include CONFIG_CBUS(_x) so you must enable
 them manually.
 
 I did that, don't worry

Adding these patches to the cbus branch.

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 2/2] arm: omap1: remove unused variables

2010-11-05 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [101019 00:22]:
 Get rid of the following warnings:
 
 arch/arm/mach-omap1/pm_bus.c: In function 'omap1_pm_runtime_resume':
 arch/arm/mach-omap1/pm_bus.c:51: warning: unused variable 'ret'
 arch/arm/mach-omap1/mailbox.c: In function 'omap1_mbox_probe':
 arch/arm/mach-omap1/mailbox.c:148: warning: unused variable 'i'

Assuming Hiroshi will queue up this one.

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] omap: dma: Add read-back to DMA interrupt handler to avoid spurious interrupts

2010-11-05 Thread Tony Lindgren
* Mathias Nyman mathias.ny...@nokia.com [101025 07:22]:
 Flush the writes to IRQSTATUS_L0 register in the DMA interrupt handler by 
 reading the register
 directly after write. This prevents the spurious DMA interrupts noted when 
 using VDD_OPP 1

Adding this to omap-fixes. For future arch/arm/*omap*/ patches,
please always Cc also linux-arm-kernel list. That way I can
apply the patch without a need to repost.

Regards,

Tony
 
 Signed-off-by: Mathias Nyman mathias.ny...@nokia.com
 ---
  arch/arm/plat-omap/dma.c |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
 index f5c5b8d..2c28265 100644
 --- a/arch/arm/plat-omap/dma.c
 +++ b/arch/arm/plat-omap/dma.c
 @@ -1983,6 +1983,8 @@ static int omap2_dma_handle_ch(int ch)
  
   dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch));
   dma_write(1  ch, IRQSTATUS_L0);
 + /* read back the register to flush the write */
 + dma_read(IRQSTATUS_L0);
  
   /* If the ch is not chained then chain_id will be -1 */
   if (dma_chan[ch].chain_id != -1) {
 -- 
 1.5.6.5
 
 --
 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
--
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 2.6.37-rc1] OMAP1: camera.h: readd missing include

2010-11-05 Thread Tony Lindgren
* Janusz Krzysztofik jkrzy...@tis.icnet.pl [101102 06:56]:
 #include media/omap1_camera.h directive, required for successfull 
 compilation of dependant boards (board-ams-delta for now), has been lost 
 somehow from arch/arm/mach-omap1/include/mach/camera.h on creation. Readd it.
 
 Created and tested against linux-2.6.37-rc1.

I've updated the description to use add instead of readd as it
never was there from Linux kernel change log point of view in
the first place:

OMAP1: camera.h: add missing include

#include media/omap1_camera.h directive is required to
compile the dependant boards (board-ams-delta for now).

Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl
[t...@atomide.com: updated comments]
Signed-off-by: Tony Lindgren t...@atomide.com

Also, for the future patches, please always Cc linux-arm-kernel
mailing list as well so I don't have to repost the patches
before merging.

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


[PATCH v4 0/3] staging: tidspbridge: bugfixes

2010-11-05 Thread Ionut Nicu
Changes since v1:

* Split the mgr_enum_node_info patch into two patches:
one that fixes the issue and one that reorganizes the
code.

Changes since v2:

* Set proper authorship on patch 1/3

Felipe Contreras (1):
  staging: tidspbridge: fix mgr_enum_node_info

Ionut Nicu (2):
  staging: tidspbridge: mgr_enum_node_info cleanup
  staging: tidspbridge: fix kernel oops in bridge_io_get_proc_load

 drivers/staging/tidspbridge/core/io_sm.c |   78 +++--
 drivers/staging/tidspbridge/rmgr/mgr.c   |   50 +++
 2 files changed, 48 insertions(+), 80 deletions(-)

-- 
1.7.2.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 v4 1/3] staging: tidspbridge: fix mgr_enum_node_info

2010-11-05 Thread Ionut Nicu
From: Felipe Contreras felipe.contre...@gmail.com

The current code was always returning a non-zero status value
to userspace applications when this ioctl was called.

The error code was ENODATA, which isn't actually an error,
it's always returned by dcd_enumerate_object() when it hits the
end of list.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/rmgr/mgr.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c 
b/drivers/staging/tidspbridge/rmgr/mgr.c
index 0ea89a1..2eab6a5 100644
--- a/drivers/staging/tidspbridge/rmgr/mgr.c
+++ b/drivers/staging/tidspbridge/rmgr/mgr.c
@@ -169,6 +169,11 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
 
}
}
+
+   /* the last status is not 0, but neither an error */
+   if (status  0)
+   status = 0;
+
if (!status) {
if (node_id  (node_index - 1)) {
status = -EINVAL;
-- 
1.7.2.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 v4 2/3] staging: tidspbridge: mgr_enum_node_info cleanup

2010-11-05 Thread Ionut Nicu
Reorganized mgr_enum_node_info code to increase its
readability.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/rmgr/mgr.c |   51 ++--
 1 files changed, 16 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c 
b/drivers/staging/tidspbridge/rmgr/mgr.c
index 2eab6a5..16410a5 100644
--- a/drivers/staging/tidspbridge/rmgr/mgr.c
+++ b/drivers/staging/tidspbridge/rmgr/mgr.c
@@ -134,8 +134,7 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
  u32 undb_props_size, u32 *pu_num_nodes)
 {
int status = 0;
-   struct dsp_uuid node_uuid, temp_uuid;
-   u32 temp_index = 0;
+   struct dsp_uuid node_uuid;
u32 node_index = 0;
struct dcd_genericobj gen_obj;
struct mgr_object *pmgr_obj = NULL;
@@ -149,24 +148,27 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
*pu_num_nodes = 0;
/* Get the Manager Object from the driver data */
if (!drv_datap || !drv_datap-mgr_object) {
-   status = -ENODATA;
pr_err(%s: Failed to retrieve the object handle\n, __func__);
-   goto func_cont;
-   } else {
-   pmgr_obj = drv_datap-mgr_object;
+   return -ENODATA;
}
+   pmgr_obj = drv_datap-mgr_object;
 
DBC_ASSERT(pmgr_obj);
/* Forever loop till we hit failed or no more items in the
 * Enumeration. We will exit the loop other than 0; */
-   while (status == 0) {
-   status = dcd_enumerate_object(temp_index++, DSP_DCDNODETYPE,
- temp_uuid);
-   if (status == 0) {
-   node_index++;
-   if (node_id == (node_index - 1))
-   node_uuid = temp_uuid;
-
+   while (!status) {
+   status = dcd_enumerate_object(node_index++, DSP_DCDNODETYPE,
+   node_uuid);
+   if (status)
+   break;
+   *pu_num_nodes = node_index;
+   if (node_id == (node_index - 1)) {
+   status = dcd_get_object_def(pmgr_obj-hdcd_mgr,
+   node_uuid, DSP_DCDNODETYPE, gen_obj);
+   if (status)
+   break;
+   /* Get the Obj def */
+   *pndb_props = gen_obj.obj_data.node_obj.ndb_props;
}
}
 
@@ -174,27 +176,6 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops 
*pndb_props,
if (status  0)
status = 0;
 
-   if (!status) {
-   if (node_id  (node_index - 1)) {
-   status = -EINVAL;
-   } else {
-   status = dcd_get_object_def(pmgr_obj-hdcd_mgr,
-   (struct dsp_uuid *)
-   node_uuid, DSP_DCDNODETYPE,
-   gen_obj);
-   if (!status) {
-   /* Get the Obj def */
-   *pndb_props =
-   gen_obj.obj_data.node_obj.ndb_props;
-   *pu_num_nodes = node_index;
-   }
-   }
-   }
-
-func_cont:
-   DBC_ENSURE((!status  *pu_num_nodes  0) ||
-  (status  *pu_num_nodes == 0));
-
return status;
 }
 
-- 
1.7.2.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 v4 3/3] staging: tidspbridge: fix kernel oops in bridge_io_get_proc_load

2010-11-05 Thread Ionut Nicu
The DSP shared memory area gets initialized only when
a COFF file is loaded.

If bridge_io_get_proc_load is called before loading a base
image into the DSP, the shared_mem member of the io manager
will be NULL, resulting in a kernel oops when it's dereferenced.

Also made some coding style changes to bridge_io_create.

Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro
---
 drivers/staging/tidspbridge/core/io_sm.c |   78 +++--
 1 files changed, 30 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index de2cc3b..bd407b6 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -164,57 +164,41 @@ int bridge_io_create(struct io_mgr **io_man,
struct dev_object *hdev_obj,
const struct io_attrs *mgr_attrts)
 {
-   int status = 0;
struct io_mgr *pio_mgr = NULL;
-   struct shm *shared_mem = NULL;
struct bridge_dev_context *hbridge_context = NULL;
struct cfg_devnode *dev_node_obj;
struct chnl_mgr *hchnl_mgr;
u8 dev_type;
 
/* Check requirements */
-   if (!io_man || !mgr_attrts || mgr_attrts-word_size == 0) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!io_man || !mgr_attrts || mgr_attrts-word_size == 0)
+   return -EFAULT;
+
+   *io_man = NULL;
+
dev_get_chnl_mgr(hdev_obj, hchnl_mgr);
-   if (!hchnl_mgr || hchnl_mgr-hio_mgr) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!hchnl_mgr || hchnl_mgr-hio_mgr)
+   return -EFAULT;
+
/*
 * Message manager will be created when a file is loaded, since
 * size of message buffer in shared memory is configurable in
 * the base image.
 */
dev_get_bridge_context(hdev_obj, hbridge_context);
-   if (!hbridge_context) {
-   status = -EFAULT;
-   goto func_end;
-   }
+   if (!hbridge_context)
+   return -EFAULT;
+
dev_get_dev_type(hdev_obj, dev_type);
-   /*
-* DSP shared memory area will get set properly when
-* a program is loaded. They are unknown until a COFF file is
-* loaded. I chose the value -1 because it was less likely to be
-* a valid address than 0.
-*/
-   shared_mem = (struct shm *)-1;
 
/* Allocate IO manager object */
pio_mgr = kzalloc(sizeof(struct io_mgr), GFP_KERNEL);
-   if (pio_mgr == NULL) {
-   status = -ENOMEM;
-   goto func_end;
-   }
+   if (!pio_mgr)
+   return -ENOMEM;
 
/* Initialize chnl_mgr object */
-#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
-   pio_mgr-pmsg = NULL;
-#endif
pio_mgr-hchnl_mgr = hchnl_mgr;
pio_mgr-word_size = mgr_attrts-word_size;
-   pio_mgr-shared_mem = shared_mem;
 
if (dev_type == DSP_UNIT) {
/* Create an IO DPC */
@@ -226,29 +210,24 @@ int bridge_io_create(struct io_mgr **io_man,
 
spin_lock_init(pio_mgr-dpc_lock);
 
-   status = dev_get_dev_node(hdev_obj, dev_node_obj);
+   if (dev_get_dev_node(hdev_obj, dev_node_obj)) {
+   bridge_io_destroy(pio_mgr);
+   return -EIO;
+   }
}
 
-   if (!status) {
-   pio_mgr-hbridge_context = hbridge_context;
-   pio_mgr-shared_irq = mgr_attrts-irq_shared;
-   if (dsp_wdt_init())
-   status = -EPERM;
-   } else {
-   status = -EIO;
-   }
-func_end:
-   if (status) {
-   /* Cleanup */
+   pio_mgr-hbridge_context = hbridge_context;
+   pio_mgr-shared_irq = mgr_attrts-irq_shared;
+   if (dsp_wdt_init()) {
bridge_io_destroy(pio_mgr);
-   if (io_man)
-   *io_man = NULL;
-   } else {
-   /* Return IO manager object to caller... */
-   hchnl_mgr-hio_mgr = pio_mgr;
-   *io_man = pio_mgr;
+   return -EPERM;
}
-   return status;
+
+   /* Return IO manager object to caller... */
+   hchnl_mgr-hio_mgr = pio_mgr;
+   *io_man = pio_mgr;
+
+   return 0;
 }
 
 /*
@@ -1532,6 +1511,9 @@ int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, void 
*pargs)
 int bridge_io_get_proc_load(struct io_mgr *hio_mgr,
struct dsp_procloadstat *proc_lstat)
 {
+   if (!hio_mgr-shared_mem)
+   return -EFAULT;
+
proc_lstat-curr_load =
hio_mgr-shared_mem-load_mon_info.curr_dsp_load;
proc_lstat-predicted_load =
-- 
1.7.2.3

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

Re: [PATCH] omap: dsp: remove shm from normal memory

2010-11-05 Thread Felipe Contreras
On Fri, Nov 5, 2010 at 6:34 PM, Tony Lindgren t...@atomide.com wrote:
 * Felipe Contreras felipe.contre...@gmail.com [101019 00:28]:
 Also, don't be picky about the location.

 As this code is in CONFIG_TIDSPBRIDGE block and AFAIK that is
 not working, this should probably wait for the next merge window?

I plan to send a patch to revert the iommu changes to staging so that
it does work... But this patch would be needed as well.

-- 
Felipe Contreras
--
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 0/3] staging: tidspbridge: bugfixes

2010-11-05 Thread Felipe Contreras
On Fri, Nov 5, 2010 at 6:00 PM, Ionut Nicu ionut.n...@mindbit.ro wrote:
 On Fri, 2010-11-05 at 08:43 -0700, Greg KH wrote:
 On Fri, Nov 05, 2010 at 05:15:45PM +0200, Ionut Nicu wrote:
  Changes since v1:
 
  * Split the mgr_enum_node_info patch into two patches:
  one that fixes the issue and one that reorganizes the
  code.

 Are these for the .37 or .38 kernel?

 They're bug fixes, so I think they should get into .37. It's up to you
 to decide.

Other than patch #2, I agree it would be better on .37.

-- 
Felipe Contreras
--
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] omap: dsp: remove shm from normal memory

2010-11-05 Thread Tony Lindgren
* Felipe Contreras felipe.contre...@gmail.com [101105 10:44]:
 On Fri, Nov 5, 2010 at 6:34 PM, Tony Lindgren t...@atomide.com wrote:
  * Felipe Contreras felipe.contre...@gmail.com [101019 00:28]:
  Also, don't be picky about the location.
 
  As this code is in CONFIG_TIDSPBRIDGE block and AFAIK that is
  not working, this should probably wait for the next merge window?
 
 I plan to send a patch to revert the iommu changes to staging so that
 it does work... But this patch would be needed as well.

OK. Let's wait and see what your minimal set of fixes to make it
work looks.

Regards,

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


Re: [PATCH] omap: dsp: remove shm from normal memory

2010-11-05 Thread Ramirez Luna, Omar
Hi Tony,

On Fri, Nov 5, 2010 at 12:53 PM, Felipe Contreras
felipe.contre...@gmail.com wrote:
 On Fri, Nov 5, 2010 at 6:34 PM, Tony Lindgren t...@atomide.com wrote:
 * Felipe Contreras felipe.contre...@gmail.com [101019 00:28]:
 Also, don't be picky about the location.

 As this code is in CONFIG_TIDSPBRIDGE block and AFAIK that is
 not working, this should probably wait for the next merge window?

 I plan to send a patch to revert the iommu changes to staging so that
 it does work... But this patch would be needed as well.

Would it be possible to include this series too (if nothing is
missing)? The only open question was whether to move iva2dsp.h
contents into dsp.h

tidspbridge: SCM layer violation fixes [1]

Patch 4 is to be sent through staging path, once these are pushed.

Regards,

Omar

---
[1] http://marc.info/?l=linux-omapm=128871356703161w=2
--
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] OMAP2: Devkit8000: Fix mmc regulator failure

2010-11-05 Thread Tony Lindgren
* Thomas Weber we...@corscience.de [101101 14:38]:
 This patch fixes the following error:
 
 regulator: VMMC1: 1850 -- 3150 mV at 3000 mV normal
 standby
 twl_reg twl_reg.6: can't register VMMC1, -22
 twl_reg: probe of twl_reg.6 failed with error -22

Adding this into omap-fixes.

Tony
 
 Signed-off-by: Thomas Weber we...@corscience.de
 ---
  arch/arm/mach-omap2/board-devkit8000.c |3 ---
  1 files changed, 0 insertions(+), 3 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
 b/arch/arm/mach-omap2/board-devkit8000.c
 index 067f437..53ac762 100644
 --- a/arch/arm/mach-omap2/board-devkit8000.c
 +++ b/arch/arm/mach-omap2/board-devkit8000.c
 @@ -242,9 +242,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
   mmc[0].gpio_cd = gpio + 0;
   omap2_hsmmc_init(mmc);
  
 - /* link regulators to MMC adapters */
 - devkit8000_vmmc1_supply.dev = mmc[0].dev;
 -
   /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
   gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
  
 -- 
 1.7.3.2
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] OMAP: DSS2: introduce generic panel display driver (try #3)

2010-11-05 Thread Bryan Wu
There are 4 duplicated DPI panel drivers in DSS2 display driver. They are
similar and a generic DPI panel driver can support all them with specific
panel configuration. And new DPI panel driver can be easily supported
by adding panel configurations into generic panel DPI driver.

This patchset introduces a generic panel DPI driver, remove 3 panel drivers and 
enable
generic panel DPI driver in board files. And it is based on 2.6.37-rc1.

This patch use unified the panel_data struct for nokia_dsi_panel_data with DPI
panel data. So panel-taal.c is updated as well.

Building with omap2plus_defconfig is successful.

Keep sharp_ls_panel, since it contains blacklight control code which will be
moved out later.

Bryan Wu (3):
  OMAP: use generic panel data in board files
  OMAP: DSS2: Add generic panel display driver
  OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers

 arch/arm/mach-omap2/board-3430sdp.c|   10 +-
 arch/arm/mach-omap2/board-am3517evm.c  |   19 +-
 arch/arm/mach-omap2/board-cm-t35.c |   19 +-
 arch/arm/mach-omap2/board-devkit8000.c |   22 +-
 arch/arm/mach-omap2/board-igep0020.c   |   10 +-
 arch/arm/mach-omap2/board-omap3beagle.c|   10 +-
 arch/arm/mach-omap2/board-omap3evm.c   |   10 +-
 arch/arm/mach-omap2/board-omap3stalker.c   |   19 +-
 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h  |   31 --
 arch/arm/plat-omap/include/plat/panel.h|   57 
 drivers/video/omap2/displays/Kconfig   |   22 +-
 drivers/video/omap2/displays/Makefile  |4 +-
 drivers/video/omap2/displays/panel-dpi.c   |  306 
 drivers/video/omap2/displays/panel-generic.c   |  174 ---
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 ---
 drivers/video/omap2/displays/panel-taal.c  |   26 +-
 .../video/omap2/displays/panel-toppoly-tdo35s.c|  164 ---
 17 files changed, 461 insertions(+), 607 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
 create mode 100644 arch/arm/plat-omap/include/plat/panel.h
 create mode 100644 drivers/video/omap2/displays/panel-dpi.c
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

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


[PATCH 1/3] OMAP: use generic panel data in board files

2010-11-05 Thread Bryan Wu
Introduce struct panel config data in panel.h, which will be used to match
the right panel configurations in generic DPI panel driver and other future
dsi panel drivers.

Still keep sharp_ls_panel, since the sharp_ls_panel driver contains blacklight
control driver code which will be moved out later. Then we can use generic DPI
driver for sharp_ls_panel.

Signed-off-by: Bryan Wu bryan...@canonical.com
---
 arch/arm/mach-omap2/board-3430sdp.c   |   10 +++-
 arch/arm/mach-omap2/board-am3517evm.c |   19 +--
 arch/arm/mach-omap2/board-cm-t35.c|   19 +--
 arch/arm/mach-omap2/board-devkit8000.c|   22 +---
 arch/arm/mach-omap2/board-igep0020.c  |   10 +++-
 arch/arm/mach-omap2/board-omap3beagle.c   |   10 +++-
 arch/arm/mach-omap2/board-omap3evm.c  |   10 +++-
 arch/arm/mach-omap2/board-omap3stalker.c  |   19 +--
 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h |   31 ---
 arch/arm/plat-omap/include/plat/panel.h   |   57 +
 drivers/video/omap2/displays/panel-taal.c |   26 --
 11 files changed, 148 insertions(+), 85 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
 create mode 100644 arch/arm/plat-omap/include/plat/panel.h

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 4e3742c..859b4e5 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -38,6 +38,7 @@
 #include plat/dma.h
 #include plat/gpmc.h
 #include plat/display.h
+#include plat/panel.h
 
 #include plat/gpmc-smc91x.h
 
@@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = {
.platform_disable   = sdp3430_panel_disable_lcd,
 };
 
+static struct panel_data dvi_panel = {
+   .name   = generic,
+};
+
 static struct omap_dss_device sdp3430_dvi_device = {
.name   = dvi,
-   .driver_name= generic_panel,
-   .type   = OMAP_DISPLAY_TYPE_DPI,
-   .phy.dpi.data_lines = 24,
+   .driver_name= dpi_panel,
+   .data   = dvi_panel,
.platform_enable= sdp3430_panel_enable_dvi,
.platform_disable   = sdp3430_panel_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 0739950..9b2b6ff 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -35,6 +35,7 @@
 #include plat/common.h
 #include plat/usb.h
 #include plat/display.h
+#include plat/panel.h
 
 #include mux.h
 #include control.h
@@ -303,11 +304,14 @@ static void am3517_evm_panel_disable_lcd(struct 
omap_dss_device *dssdev)
lcd_enabled = 0;
 }
 
+static struct panel_data lcd_panel = {
+   .name   = sharp_lq,
+};
+
 static struct omap_dss_device am3517_evm_lcd_device = {
-   .type   = OMAP_DISPLAY_TYPE_DPI,
.name   = lcd,
-   .driver_name= sharp_lq_panel,
-   .phy.dpi.data_lines = 16,
+   .driver_name= dpi_panel,
+   .data   = lcd_panel,
.platform_enable= am3517_evm_panel_enable_lcd,
.platform_disable   = am3517_evm_panel_disable_lcd,
 };
@@ -346,11 +350,14 @@ static void am3517_evm_panel_disable_dvi(struct 
omap_dss_device *dssdev)
dvi_enabled = 0;
 }
 
+static struct panel_data dvi_panel = {
+   .name   = generic,
+};
+
 static struct omap_dss_device am3517_evm_dvi_device = {
-   .type   = OMAP_DISPLAY_TYPE_DPI,
.name   = dvi,
-   .driver_name= generic_panel,
-   .phy.dpi.data_lines = 24,
+   .driver_name= dpi_panel,
+   .data   = dvi_panel,
.platform_enable= am3517_evm_panel_enable_dvi,
.platform_disable   = am3517_evm_panel_disable_dvi,
 };
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 63f764e..326aa15 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -46,6 +46,7 @@
 #include plat/gpmc.h
 #include plat/usb.h
 #include plat/display.h
+#include plat/panel.h
 #include plat/mcspi.h
 
 #include mach/hardware.h
@@ -351,20 +352,26 @@ static void cm_t35_panel_disable_tv(struct 
omap_dss_device *dssdev)
 {
 }
 
+static struct panel_data lcd_panel = {
+   .name   = toppoly_tdo35s,
+};
+
 static struct omap_dss_device cm_t35_lcd_device = {
.name   = lcd,
-   .driver_name= toppoly_tdo35s_panel,
-   .type   = OMAP_DISPLAY_TYPE_DPI,
-   .phy.dpi.data_lines = 18,
+   .driver_name= dpi_panel,
+   .data   = lcd_panel,
.platform_enable= cm_t35_panel_enable_lcd,

[PATCH 2/3] OMAP: DSS2: Add generic panel display driver

2010-11-05 Thread Bryan Wu
Generic panel driver includes the driver and 4 similar panel configurations. It
will match the panel name which is passed from platform data and setup the
right configurations.

With generic panel driver, we can remove those 4 duplicated panel display
drivers. In the future, it is simple for us just add new panel configuration
date in panel-generic.c to support new display panel.

Signed-off-by: Bryan Wu bryan...@canonical.com
---
 drivers/video/omap2/displays/Kconfig |8 +
 drivers/video/omap2/displays/Makefile|1 +
 drivers/video/omap2/displays/panel-dpi.c |  306 ++
 3 files changed, 315 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/omap2/displays/panel-dpi.c

diff --git a/drivers/video/omap2/displays/Kconfig 
b/drivers/video/omap2/displays/Kconfig
index 12327bb..9602d3f 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -1,6 +1,14 @@
 menu OMAP2/3 Display Device Drivers
 depends on OMAP2_DSS
 
+config PANEL_DPI
+tristate Generic DPI Panel
+help
+ Generic DPI panel driver.
+ Supports DVI output for Beagle and OMAP3 SDP.
+ Supports LCD Panel used in TI SDP3430 and EVM boards,
+ OMAP3517 EVM boards and CM-T35.
+
 config PANEL_GENERIC
 tristate Generic Panel
 help
diff --git a/drivers/video/omap2/displays/Makefile 
b/drivers/video/omap2/displays/Makefile
index aa38609..1265772 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,3 +1,4 @@
+obj-$(CONFIG_PANEL_DPI) += panel-dpi.o
 obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
 obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
diff --git a/drivers/video/omap2/displays/panel-dpi.c 
b/drivers/video/omap2/displays/panel-dpi.c
new file mode 100644
index 000..1007ecb
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-dpi.c
@@ -0,0 +1,306 @@
+/*
+ * Generic DPI Panels support
+ *
+ * Copyright (C) 2010 Canonical Ltd.
+ * Author: Bryan Wu bryan...@canonical.com
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Tomi Valkeinen tomi.valkei...@nokia.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/delay.h
+
+#include plat/panel.h
+
+struct panel_config {
+   struct omap_video_timings timings;
+
+   int acbi;   /* ac-bias pin transitions per interrupt */
+   /* Unit: line clocks */
+   int acb;/* ac-bias pin frequency */
+
+   enum omap_panel_config config;
+
+   /*
+* Used to match device to panel configuration
+* when use generic panel driver
+*/
+   const char *name;
+
+   int data_lines;
+};
+
+/* Panel configurations */
+static struct panel_config dpi_panels[] = {
+   /* Generic Panel */
+   {
+   {
+   .x_res  = 640,
+   .y_res  = 480,
+
+   .pixel_clock= 23500,
+
+   .hfp= 48,
+   .hsw= 32,
+   .hbp= 80,
+
+   .vfp= 3,
+   .vsw= 4,
+   .vbp= 7,
+   },
+   .acbi   = 0x0,
+   .acb= 0x0,
+   .config = OMAP_DSS_LCD_TFT,
+   .name   = generic,
+   .data_lines = 24,
+   },
+
+   /* Sharp LQ043T1DG01 */
+   {
+   {
+   .x_res  = 480,
+   .y_res  = 272,
+
+   .pixel_clock= 9000,
+
+   .hsw= 42,
+   .hfp= 3,
+   .hbp= 2,
+
+   .vsw= 11,
+   .vfp= 3,
+   .vbp= 2,
+   },
+   .acbi   = 0x0,
+   .acb= 0x0,
+   .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+   OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO,
+   .name   = 

[PATCH 3/3] OMAP: DSS2: remove generic DPI panel driver duplicated panel drivers

2010-11-05 Thread Bryan Wu
Still keep sharp_ls_panel driver, because it contains blacklight control driver.

Signed-off-by: Bryan Wu bryan...@canonical.com
---
 drivers/video/omap2/displays/Kconfig   |   18 --
 drivers/video/omap2/displays/Makefile  |3 -
 drivers/video/omap2/displays/panel-generic.c   |  174 
 .../video/omap2/displays/panel-sharp-lq043t1dg01.c |  165 ---
 .../video/omap2/displays/panel-toppoly-tdo35s.c|  164 --
 5 files changed, 0 insertions(+), 524 deletions(-)
 delete mode 100644 drivers/video/omap2/displays/panel-generic.c
 delete mode 100644 drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
 delete mode 100644 drivers/video/omap2/displays/panel-toppoly-tdo35s.c

diff --git a/drivers/video/omap2/displays/Kconfig 
b/drivers/video/omap2/displays/Kconfig
index 9602d3f..aab2819 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -9,12 +9,6 @@ config PANEL_DPI
  Supports LCD Panel used in TI SDP3430 and EVM boards,
  OMAP3517 EVM boards and CM-T35.
 
-config PANEL_GENERIC
-tristate Generic Panel
-help
- Generic panel driver.
- Used for DVI output for Beagle and OMAP3 SDP.
-
 config PANEL_SHARP_LS037V7DW01
 tristate Sharp LS037V7DW01 LCD Panel
 depends on OMAP2_DSS
@@ -22,24 +16,12 @@ config PANEL_SHARP_LS037V7DW01
 help
   LCD Panel used in TI's SDP3430 and EVM boards
 
-config PANEL_SHARP_LQ043T1DG01
-tristate Sharp LQ043T1DG01 LCD Panel
-depends on OMAP2_DSS
-help
-  LCD Panel used in TI's OMAP3517 EVM boards
-
 config PANEL_TAAL
 tristate Taal DSI Panel
 depends on OMAP2_DSS_DSI
 help
   Taal DSI command mode panel from TPO.
 
-config PANEL_TOPPOLY_TDO35S
-tristate Toppoly TDO35S LCD Panel support
-depends on OMAP2_DSS
-help
-  LCD Panel used in CM-T35
-
 config PANEL_TPO_TD043MTEA1
 tristate TPO TD043MTEA1 LCD Panel
 depends on OMAP2_DSS  SPI
diff --git a/drivers/video/omap2/displays/Makefile 
b/drivers/video/omap2/displays/Makefile
index 1265772..f0947a7 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,9 +1,6 @@
 obj-$(CONFIG_PANEL_DPI) += panel-dpi.o
-obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
 obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
-obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
 
 obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
-obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o
 obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o
diff --git a/drivers/video/omap2/displays/panel-generic.c 
b/drivers/video/omap2/displays/panel-generic.c
deleted file mode 100644
index 395a68d..000
--- a/drivers/video/omap2/displays/panel-generic.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Generic panel support
- *
- * Copyright (C) 2008 Nokia Corporation
- * Author: Tomi Valkeinen tomi.valkei...@nokia.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/delay.h
-
-#include plat/display.h
-
-static struct omap_video_timings generic_panel_timings = {
-   /* 640 x 480 @ 60 Hz  Reduced blanking VESA CVT 0.31M3-R */
-   .x_res  = 640,
-   .y_res  = 480,
-   .pixel_clock= 23500,
-   .hfp= 48,
-   .hsw= 32,
-   .hbp= 80,
-   .vfp= 3,
-   .vsw= 4,
-   .vbp= 7,
-};
-
-static int generic_panel_power_on(struct omap_dss_device *dssdev)
-{
-   int r;
-
-   if (dssdev-state == OMAP_DSS_DISPLAY_ACTIVE)
-   return 0;
-
-   r = omapdss_dpi_display_enable(dssdev);
-   if (r)
-   goto err0;
-
-   if (dssdev-platform_enable) {
-   r = dssdev-platform_enable(dssdev);
-   if (r)
-   goto err1;
-   }
-
-   return 0;
-err1:
-   omapdss_dpi_display_disable(dssdev);
-err0:
-   return r;
-}
-
-static void generic_panel_power_off(struct omap_dss_device *dssdev)
-{
-   if (dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
-   return;
-
-   if (dssdev-platform_disable)
-   dssdev-platform_disable(dssdev);
-
-   

U-boot: ARM: OMAP3/4: proposal: Cleanup MUX

2010-11-05 Thread Nishanth Menon

Folks,

Might be slightly off topic, hence posting separately instead of cross 
posting.


I just posted a proposal to mainline u-boot for cleaning up mux 
framework there - does any supported platform find this impossible to 
live with? I know for sure that OMAP4 muxing will be broken as a result 
- but we ought to get this fixed at some point.



Regards,
Nishanth Menon

 Original Message 
Subject: ARM: OMAP3/4: proposal: Cleanup MUX
Date: Fri, 05 Nov 2010 15:56:46 -0400
From: Nishanth Menon menon.nisha...@gmail.com
To: u-b...@lists.denx.de

Folks,
I would like to work on the following: Cleanup mux configurations done
in OMAP3 and 4 platforms. includes the following:
a) have isolate mux configurations per IP configuration, e.g. for EHCI,
we have a mux array definition for EHCI etc..
b) remove ALL mux configurations that are not relevant for u-boot
functionality - currently we do all muxing in u-boot(including stuff
like camera which obviously we dont use in u-boot).

any kernel breakages as a result of assumptions of muxing already done
is to be fixed in kernel itself - kernel *has* a mux framework for OMAP
and platforms files *should* be using that for kernel functionality that
they need. no point in carrying that burden in u-boot.

I would like to post this patches so that for the next merge window we
could pull this in and notify the linux-omap kernel guys to fix their
stuff if they depend on u-boot for mux configurations - it is high time
they stop being closely tied to U-boot and have capability to deal with
other bootloaders which may or maynot have capability for doing muxing -
it also saves us to add and maintain mux configurations for linux kernel
booting - u-boot is supposed to support multiple operating systems (not
just linux kernel).

--
Regards,
Nishanth Menon
--
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 3/6] TI816X: Update common OMAP machine specific sources

2010-11-05 Thread Tony Lindgren
* Pedanekar, Hemant hema...@ti.com [101022 10:58]:
 Tony Lindgren wrote on Friday, September 17, 2010 3:55 AM:
 
  * Hemant Pedanekar hema...@ti.com [100811 10:03]:
  This patch updates the common machine spcific source files with support
  for TI816X. 
  
  Note that the nr_irqs is overridden in INTC driver since the number of
  IRQs on TI816X are different (128) comapared to other OMAPs (96).
  
  snip
  
  --- a/arch/arm/mach-omap2/id.c
  +++ b/arch/arm/mach-omap2/id.c
  @@ -419,6 +441,9 @@ void __init omap2_check_revision(void)
 } else if (cpu_is_omap44xx()) {
 omap4_check_revision();
 return;
  +  } else if (cpu_is_ti816x()) {
  +  ti816x_check_revision();
  +  return;
 } else {
 pr_err(OMAP revision unknown, please fix!\n);
 }
  
  This does not look right, at this point you should just know
  the processor class set by the set_globals call.
  
  Please take a look at plat-omap/common.c and add an entry for
  omap2_set_globals_ti816x. This gets called very early from
  the board-*.c
  file, so you can initialize things.
 
 Tony,
 
 Do you mean following changes in the patch I sent earlier?

No, I'm mostly wondering how come you can't use cpu_is_omap34xx
for ti816x and then detect based on the values set in
omap2_set_globals. Then cpu_is_ti816x just becomes a set of
features.

In general, we should initialize more things in set_globals
if necessary rather than sprinkle cpu_is_omap tests all over
the place to add support for new omaps.

Regards,

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


RE: [PATCH 2/3] OMAP: DSS2: Add generic panel display driver

2010-11-05 Thread Taneja, Archit
Hi,

linux-omap-ow...@vger.kernel.org wrote:
 Generic panel driver includes the driver and 4 similar panel
 configurations. It will match the panel name which is passed
 from platform data and setup the right configurations.
 
 With generic panel driver, we can remove those 4 duplicated
 panel display drivers. In the future, it is simple for us
 just add new panel configuration date in panel-generic.c to
 support new display panel.
 
 Signed-off-by: Bryan Wu bryan...@canonical.com
 ---

[snip]

 +++ b/drivers/video/omap2/displays/panel-dpi.c
 @@ -0,0 +1,306 @@
 +/*
 + * Generic DPI Panels support
 + *
 + * Copyright (C) 2010 Canonical Ltd.
 + * Author: Bryan Wu bryan...@canonical.com
 + *
 + * Copyright (C) 2008 Nokia Corporation
 + * Author: Tomi Valkeinen tomi.valkei...@nokia.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/delay.h
 +
 +#include plat/panel.h
 +
 +struct panel_config {
 + struct omap_video_timings timings;
 +
 + int acbi;   /* ac-bias pin transitions per interrupt */ +   /* 
 Unit: line
 clocks */ +   int acb;/* ac-bias pin frequency */
 +
 + enum omap_panel_config config;
 +
 + /*
 +  * Used to match device to panel configuration
 +  * when use generic panel driver
 +  */
 + const char *name;
 +
 + int data_lines;
 +};

You can add the power_on_delay and power_off_delay members out here and
probably other panel specific things too.

The name panel-dpi.c is slightly misleading since this driver doesn't cover
all dpi panels. Probably something like genric-dpi-panel.c with functions like
generic_dpi_panel_power_on() would cover all the dummy dpi panels.

 +
 +/* Panel configurations */
 +static struct panel_config dpi_panels[] = {
 + /* Generic Panel */
 + {
 + {
 + .x_res  = 640,
 + .y_res  = 480,
 +
 + .pixel_clock= 23500,
 +
 + .hfp= 48,
 + .hsw= 32,
 + .hbp= 80,
 +
 + .vfp= 3,
 + .vsw= 4,
 + .vbp= 7,
 + },
 + .acbi   = 0x0,
 + .acb= 0x0,
 + .config = OMAP_DSS_LCD_TFT,
 + .name   = generic,
 + .data_lines = 24,
 + },
 +
 + /* Sharp LQ043T1DG01 */
 + {
 + {
 + .x_res  = 480,
 + .y_res  = 272,
 +
 + .pixel_clock= 9000,
 +
 + .hsw= 42,
 + .hfp= 3,
 + .hbp= 2,
 +
 + .vsw= 11,
 + .vfp= 3,
 + .vbp= 2,
 + },
 + .acbi   = 0x0,
 + .acb= 0x0,
 + .config = OMAP_DSS_LCD_TFT |
 OMAP_DSS_LCD_IVS |
 + OMAP_DSS_LCD_IHS |
 OMAP_DSS_LCD_IEO,
 + .name   = sharp_lq,
 + .data_lines = 16,
 + },
 +
 + /* Sharp LS037V7DW01 */
 + {
 + {
 + .x_res  = 480,
 + .y_res  = 640,
 +
 + .pixel_clock= 19200,
 +
 + .hsw= 2,
 + .hfp= 1,
 + .hbp= 28,
 +
 + .vsw= 1,
 + .vfp= 1,
 + .vbp= 1,
 + },
 + .acbi   = 0x0,
 + .acb= 0x28,
 + .config = OMAP_DSS_LCD_TFT |
 OMAP_DSS_LCD_IVS |
 + OMAP_DSS_LCD_IHS,
 + .name   = sharp_ls,
 + .data_lines = 16,
 + },
 +
 + /* Toppoly TDO35S */
 + {
 + {
 + .x_res  = 480,
 + .y_res  = 640,
 +
 + .pixel_clock= 26000,
 +
 + 

Re: [PATCH v5 1/5] omap gpmc: enable irq mode in gpmc

2010-11-05 Thread Tony Lindgren
* Ghorai, Sukumar s-gho...@ti.com [101028 07:02]:
 Tony,
 
  -Original Message-
  From: Ghorai, Sukumar
  Sent: Wednesday, September 29, 2010 12:08 PM
  To: 'Tony Lindgren'
  Cc: linux-omap@vger.kernel.org; linux-...@lists.infradead.org; linux-arm-
  ker...@lists.infradead.org
  Subject: RE: [PATCH v5 1/5] omap gpmc: enable irq mode in gpmc
  
  
 [..snip..]
 
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-
   omap2/board-3430sdp.c
index 67b95b5..549cd62 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -328,6 +328,7 @@ static void __init omap_3430sdp_init_irq(void)
omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
omap_init_irq();
+   gpmc_init();
omap_gpio_init();
 }
   ...
  
   You can avoid adding gpmc_init() by making it a subsys_initcall().
   Just make sure you return early from it with if (!cpu_class_is_omap2()).
  [Ghorai] will do
  
 [Ghorai] I was trying this and no success, as nand_init() get called before  
 subsys_initcall(gpmc_init);
 
 126 MACHINE_START(OMAP_ZOOM3, OMAP Zoom3 board) 
 ..
 130 .init_irq   = omap_zoom_init_irq,
 131 .init_machine   = omap_zoom_init,
 ..
 
 Step-(n):
   kernel_init() - customize_machine() 
  - omap_zoom_init() - gpmc_nand_init() - which call gpmc
 functions, that's crashing, as gpmc is not initialized.
 
 Step-(n+1):
   Followed by subsys_initcall(gpmc_init)
 
 So I will incorporate the other input and will re-submit.
 [..snip..]

I don't see why you could not make gpmc_nand_init happen later?
Also, some of these calls can be moved to omap2_init_common_hw()?

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


Re: [PATCH v2 06/12] staging: tidspbridge: convert core to list_head

2010-11-05 Thread Sapiens, Rene
Hi Ionut,

On Fri, Nov 5, 2010 at 9:13 AM, Ionut Nicu ionut.n...@gmail.com wrote:
 Convert the core module of the tidspbridge driver
 to use struct list_head instead of struct lst_list.


snip

        if (!status) {
                /* Get a free chirp: */
 -               chnl_packet_obj =
 -                   (struct chnl_irp *)lst_get_head(pchnl-free_packets_list);
 -               if (chnl_packet_obj == NULL)
 +               if (!list_empty(pchnl-free_packets_list)) {
 +                       chnl_packet_obj = list_first_entry(
 +                                       pchnl-free_packets_list,
 +                                       struct chnl_irp, link);
 +                       list_del(chnl_packet_obj-link);
 +               } else
                        status = -EIO;

What do you think if we close the braces, since the first conditional
has more than one statement?

snip

 @@ -286,18 +286,16 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj)
                }
        }
        /* Move all IOR's to IOC queue: */
 -       while (!LST_IS_EMPTY(pchnl-pio_requests)) {
 -               chnl_packet_obj =
 -                   (struct chnl_irp *)lst_get_head(pchnl-pio_requests);
 -               if (chnl_packet_obj) {
 -                       chnl_packet_obj-byte_size = 0;
 -                       chnl_packet_obj-status |= CHNL_IOCSTATCANCEL;
 -                       lst_put_tail(pchnl-pio_completions,
 -                                    (struct list_head *)chnl_packet_obj);
 -                       pchnl-cio_cs++;
 -                       pchnl-cio_reqs--;
 -                       DBC_ASSERT(pchnl-cio_reqs = 0);
 -               }
 +       while (!list_empty(pchnl-pio_requests)) {
 +               chnl_packet_obj = list_first_entry(pchnl-pio_requests,
 +                               struct chnl_irp, link);
 +               list_del(chnl_packet_obj-link);
 +               chnl_packet_obj-byte_size = 0;
 +               chnl_packet_obj-status |= CHNL_IOCSTATCANCEL;
 +               list_add_tail(chnl_packet_obj-link, 
 pchnl-pio_completions);
 +               pchnl-cio_cs++;
 +               pchnl-cio_reqs--;
 +               DBC_ASSERT(pchnl-cio_reqs = 0);

Why don't we use list_for_each_entry_safe() instead?

        }
  func_cont:
        spin_unlock_bh(chnl_mgr_obj-chnl_mgr_lock);

snip

 @@ -818,9 +804,19 @@ int bridge_chnl_open(struct chnl_object **chnl,
        /* Protect queues from io_dpc: */
        pchnl-dw_state = CHNL_STATECANCEL;
        /* Allocate initial IOR and IOC queues: */
 -       pchnl-free_packets_list = create_chirp_list(pattrs-uio_reqs);
 -       pchnl-pio_requests = create_chirp_list(0);
 -       pchnl-pio_completions = create_chirp_list(0);
 +       status = create_chirp_list(pchnl-free_packets_list,
 +                       pattrs-uio_reqs);
 +       if (status)
 +               goto func_end;
 +
 +       status = create_chirp_list(pchnl-pio_requests, 0);
 +       if (status)
 +               goto func_end;
 +
 +       status = create_chirp_list(pchnl-pio_completions, 0);
 +       if (status)
 +               goto func_end;
 +

With these goto you are not freeing the memory allocated for pchnl, please free
it at func_end.

Regards,
Rene
--
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/3] OMAP: use generic panel data in board files

2010-11-05 Thread Taneja, Archit
Hi,

linux-omap-ow...@vger.kernel.org wrote:
 Introduce struct panel config data in panel.h, which will be
 used to match the right panel configurations in generic DPI
 panel driver and other future dsi panel drivers.

 Still keep sharp_ls_panel, since the sharp_ls_panel driver
 contains blacklight control driver code which will be moved
 out later. Then we can use generic DPI driver for sharp_ls_panel.

 Signed-off-by: Bryan Wu bryan...@canonical.com
 ---
  arch/arm/mach-omap2/board-3430sdp.c   |   10 +++-
  arch/arm/mach-omap2/board-am3517evm.c |   19 +--
  arch/arm/mach-omap2/board-cm-t35.c|   19 +--
  arch/arm/mach-omap2/board-devkit8000.c|   22 +---
  arch/arm/mach-omap2/board-igep0020.c  |   10 +++-
  arch/arm/mach-omap2/board-omap3beagle.c   |   10 +++-
  arch/arm/mach-omap2/board-omap3evm.c  |   10 +++-
  arch/arm/mach-omap2/board-omap3stalker.c  |   19 +--
  arch/arm/plat-omap/include/plat/nokia-dsi-panel.h |   31 ---
  arch/arm/plat-omap/include/plat/panel.h   |   57
  + drivers/video/omap2/displays/panel-taal.c |
  26 -- 11 files changed, 148 insertions(+), 85 deletions(-)  delete
 mode 100644 arch/arm/plat-omap/include/plat/nokia-dsi-panel.h
  create mode 100644 arch/arm/plat-omap/include/plat/panel.h

I am not totally sure about the need of removal of nokia-dsi-panel.h
and the addition of a generic panel.h.

I guess the reason why nokia-dsi-panel.h was introduced (and others that
will be introduced in future) was to easily represent panel-specific data
across different boards that use the same panel.

For example, if there is a new panel which for some reson uses 2 pins, one
for switching off and one for switching on the panel, then it would make sense
to introduce a structure for this panel having members on_gpio and off_gpio, 
this
struct could then be passed and accessed through dssdev-data in the panel's 
probe
giving us the option to have different gpio numbers for different boards but 
finally
being accessed in the same way by the driver.

So, there isn't a need to generalize this struct and the corresponding header 
file
for all panels and make it available for all board files.

As far as the dummy panels are concerned, since the name is the only criteria 
to
differentiate the panel, I think passing the name to the data member of 
omap_dss_device
should itself be enough for the generic dpi driver to handle things.


 diff --git a/arch/arm/mach-omap2/board-3430sdp.c
 b/arch/arm/mach-omap2/board-3430sdp.c
 index 4e3742c..859b4e5 100644
 --- a/arch/arm/mach-omap2/board-3430sdp.c
 +++ b/arch/arm/mach-omap2/board-3430sdp.c
 @@ -38,6 +38,7 @@
  #include plat/dma.h
  #include plat/gpmc.h
  #include plat/display.h
 +#include plat/panel.h

  #include plat/gpmc-smc91x.h

 @@ -270,11 +271,14 @@ static struct omap_dss_device sdp3430_lcd_device = {
   .platform_disable   = sdp3430_panel_disable_lcd,
  };

 +static struct panel_data dvi_panel = {
 + .name   = generic,
 +};
 +
  static struct omap_dss_device sdp3430_dvi_device = { .name   
 = dvi,
 - .driver_name= generic_panel,
 - .type   = OMAP_DISPLAY_TYPE_DPI,
 - .phy.dpi.data_lines = 24,
 + .driver_name= dpi_panel,
 + .data   = dvi_panel,
   .platform_enable= sdp3430_panel_enable_dvi,
   .platform_disable   = sdp3430_panel_disable_dvi,
  };
 diff --git a/arch/arm/mach-omap2/board-am3517evm.c
 b/arch/arm/mach-omap2/board-am3517evm.c
 index 0739950..9b2b6ff 100644
 --- a/arch/arm/mach-omap2/board-am3517evm.c
 +++ b/arch/arm/mach-omap2/board-am3517evm.c
 @@ -35,6 +35,7 @@
  #include plat/common.h
  #include plat/usb.h
  #include plat/display.h
 +#include plat/panel.h

  #include mux.h
  #include control.h
 @@ -303,11 +304,14 @@ static void
 am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)  
 lcd_enabled =
  0; }

 +static struct panel_data lcd_panel = {
 + .name   = sharp_lq,
 +};
 +
  static struct omap_dss_device am3517_evm_lcd_device = {
 - .type   = OMAP_DISPLAY_TYPE_DPI,
   .name   = lcd,
 - .driver_name= sharp_lq_panel,
 - .phy.dpi.data_lines = 16,
 + .driver_name= dpi_panel,
 + .data   = lcd_panel,
   .platform_enable= am3517_evm_panel_enable_lcd,
   .platform_disable   = am3517_evm_panel_disable_lcd,  };
 @@ -346,11 +350,14 @@ static void
 am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)  
 dvi_enabled =
  0; }

 +static struct panel_data dvi_panel = {
 + .name   = generic,
 +};
 +
  static struct omap_dss_device am3517_evm_dvi_device = {
 - .type   = OMAP_DISPLAY_TYPE_DPI,
   .name   = dvi,
 - .driver_name

Re: [PATCH v5 0/3] OMAP2/3: DMA: FIFO drain errata fixes

2010-11-05 Thread Tony Lindgren
Hi Greg,

Considering below..

* Peter Ujfalusi peter.ujfal...@nokia.com [101021 02:56]:
 Sorry, I did missed this mail...
 
 On Saturday 09 October 2010 01:17:46 ext Tony Lindgren wrote:
 
  Guys, as we're so late into getting 2.6.36 tagged, I'm thinking about just
  queueing these for 2.6.37 for the following reasons:
  
  - The 24xx patch is a fix for commit c12abc0 that's was merged over a
year ago. We've lived with it for over a year now. What difference does
extra few more months make if we have it in 2.6.37 instead of 2.6.36?
  
  - The second 34xx fix seems to happen only when disabling DMA on the fly.
Again, we've had support for 34xx in the mainline kernel for a few
years, and we're not seeing unrecoverable issues with MMC or USB or
any other code calling omap_dma_stop().
  
  Sure these fix major issues with the DMA, but are these really critical
  for 2.6.36?
  
  So if you really want me to argue for merging these into 2.6.36, please let
  me know some oops causing cases or data corruption that happens without
  these patches.
 
 Well 2.6.36 is released.
 I still would like to see this to be part of the 2.6.36.1 release. We can 
 reproduce the DMA error in 2.6.36 with audio.
 
 Tony: can you make sure it is going to part of 2.6.36.1?

..are you interested in these two patches for stable kernels?

The two patches in question are the following mainline commits:

3e57f1626b5febe5cc99aa6870377deef3ae03cc
0e4905c0199d683497833be60a428c784d7575b8

Regards,

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


Re: [PATCH 1/2] arm: omap1: devices: need to return with a value

2010-11-05 Thread Tony Lindgren
* Uwe Kleine-König u.kleine-koe...@pengutronix.de [101019 00:53]:
 On Tue, Oct 19, 2010 at 10:30:54AM +0300, Felipe Balbi wrote:
  Get rid of the following warning:
  
  arch/arm/mach-omap1/devices.c: In function 'omap_init_wdt':
  arch/arm/mach-omap1/devices.c:298: warning: 'return' with
  no value, in function returning non-void
  
  Signed-off-by: Felipe Balbi ba...@ti.com
  ---
   arch/arm/mach-omap1/devices.c |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
  
  diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
  index 63d68cf..a037aba 100644
  --- a/arch/arm/mach-omap1/devices.c
  +++ b/arch/arm/mach-omap1/devices.c
  @@ -295,7 +295,7 @@ static struct platform_device omap_wdt_device = {
   static int __init omap_init_wdt(void)
   {
  if (!cpu_is_omap16xx())
  -   return;
  +   return -ENODEV;
   
  platform_device_register(omap_wdt_device);
  return 0;
 It's unrelated to this patch, but using
 
   return platform_device_register(omap_wdt_device);
 
 would be a bit cleaner.

Felipe, care to update this one?

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


Re: [PATCH 0/2] Combine zoom board-files

2010-11-05 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [101104 05:24]:
 Hi,
 
 On Wed, Oct 20, 2010 at 01:25:10AM -0500, Balbi, Felipe wrote:
 Those boards are so similar that they don't
 deserve separate board files.
 
 Felipe Balbi (2):
  arm: omap: combine zoom2 and zoom3 board-files
  arm: omap: zoom: substitute gpio number with symbolic name
 
 a gentle ping on these two patches. Here are patchwork links:
 
 [1] https://patchwork.kernel.org/patch/267491/
 [2] https://patchwork.kernel.org/patch/267501/
 
 they are also rebased on top of today's l-o and compile tested with
 omap2plus_defconfig, attached to this mail.

Looks good to me, but please can you please repost with also
linux-arm-kernel list Cc'd? That way I don't have to repost
before merging.

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: How to add an expansion board on IGEP v2 board.

2010-11-05 Thread Tony Lindgren
* Enric Balletbò i Serra eballe...@gmail.com [101027 01:23]:
 Hello all,
 
 I would ask some technical questions, maybe someone can help me. I
 would add support for a new expansion board for IGEP v2 board,
 
 The expansion board comes with a EEPROM, the EEPROM is used to
 identify the expansion board, my idea is create a new file for
 expansion board ( board-igep0020-expansion.c ) and
 
 * on board-igep0020.c
   - Add extern void __init igep2_expansion_init(void);
   - Call igep2_expansion_init on igep2_init()
 
 * on board-igep0020-expansion.c
   - Create  igep2_expansion_init, inside this funciton
 - Add e2prom device and read board id
 - If board ID exists then init all expansion devices
 
 I'm in the right way ? Comments ?

Sounds good to me. Runtime detection is the best way to go.

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: [PATCHv2 0/3] Various code improvements for IGEP v2 board.

2010-11-05 Thread Tony Lindgren
* Enric Balletbo i Serra eballe...@gmail.com [101023 09:40]:
 
 Hello,
 
 The comments of this post also apply to IGEP v2 board (thanks Laurent)
 
   http://www.mail-archive.com/linux-omap@vger.kernel.org/msg36402.html
 
 Changes since v1:
  - Split patch in a serie.
  - [1/3] onenand_setup = NULL, is a static variable, removed from code.
 
 This patch apply on top of tmlind/omap-for-linux branch.
 
 $ git diff --stat tmlind/omap-for-linus 
  arch/arm/mach-omap2/board-igep0020.c |   35 ++---
  1 files changed, 11 insertions(+), 24 deletions(-)

Thanks, I'll queue these for 2.6.38 merge window.

Regards,

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


Re: [Patch v4] OMAP: AM3517/05: Add craneboard support

2010-11-05 Thread Tony Lindgren
* srin...@mistralsolutions.com srin...@mistralsolutions.com [101029 00:19]:
 From: Srinath srin...@mistralsolutions.com
 
 Craneboard is a hardware development platform based on the
 Sitara AM3517 ARM Cortex - A8 microprocessor device. This is a
 low cost reference design.
 
 This patch adds basic board file. Detailed support will follow in
 subsequent patches.
 
   [1] http://www.ti.com/sitara
   [2] http://www.ti.com/arm
   [3] 
 http://tiexpressdsp.com/index.php?title=Applications_Processors_Crossreference
   [4] http://marc.info/?l=linux-omapm=125615009412281w=2
   [5] http://www.mistralsolutions.com/products/craneboard.php

Are all these links needed? To me it seems that [2] and [5]
should be enough?
 
 History and comments:
 http://marc.info/?l=linux-omapw=2r=1s=craneboardq=b

This history and comments link you can leave out, the official
history starts when it gets to the mainline kernel tree.

Anyways, please repost one more time with linux-arm-kernel
mailing list Cc'd so I don't have to repost your patch
before merging.

Regards,

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


Re: [PATCH] omap: mailbox: remove unreachable return

2010-11-05 Thread Tony Lindgren
* Omar Ramirez Luna omar.rami...@ti.com [101025 11:39]:
 Remove unreachable return statement.

Please repost one more time with linux-arm-kernel list also
Cc'd.

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


Re: [PATCH v2 06/12] staging: tidspbridge: convert core to list_head

2010-11-05 Thread Sapiens, Rene
Hi Ionut,

On Fri, Nov 5, 2010 at 9:13 AM, Ionut Nicu ionut.n...@gmail.com wrote:
 Convert the core module of the tidspbridge driver
 to use struct list_head instead of struct lst_list.

 Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro

snip

 diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
 b/drivers/staging/tidspbridge/core/io_sm.c
 index 194bada..9851f32 100644
 --- a/drivers/staging/tidspbridge/core/io_sm.c
 +++ b/drivers/staging/tidspbridge/core/io_sm.c

snip

 @@ -1106,47 +1103,38 @@ static void input_msg(struct io_mgr *pio_mgr, struct 
 msg_mgr *hmsg_mgr)
                                         * queued.
                                         */
                                        (*hmsg_mgr-on_exit) ((void *)
 -                                                          msg_queue_obj-arg,
 -                                                          msg.msg.dw_arg1);
 +                                                       msg_queue_obj-arg,
 +                                                       msg.msg.dw_arg1);
 +                                       break;
 +                               }
 +                               /*
 +                                * Not an exit acknowledgement, queue
 +                                * the message.
 +                                */
 +                               if 
 (!list_empty(msg_queue_obj-msg_free_list)) {

You are going beyond the 80 chars.

Regards,
Rene


Re: [PATCH v2 07/12] staging: tidspbridge: convert pmgr to list_head

2010-11-05 Thread Sapiens, Rene
Hi Ionut,

On Fri, Nov 5, 2010 at 9:13 AM, Ionut Nicu ionut.n...@gmail.com wrote:
 Convert the pmgr module of the tidspbridge driver
 to use struct list_head instead of struct lst_list.

snip

 + * Memory is coalesced back to the appropriate heap when a buffer is

What is being fixed here?

  * freed.
  *
  * Notes:

snip

 @@ -833,67 +768,44 @@ static void add_to_free_list(struct cmm_allocator 
 *allocator,
        DBC_REQUIRE(allocator != NULL);
        dw_this_pa = pnode-dw_pa;
        dw_next_pa = NEXT_PA(pnode);

i think it would be good to return with error if !allocator or !pnode
and remove the  resulting duplicated DBC_REQUIRE.

 -       mnode_obj = (struct cmm_mnode *)lst_first(allocator-free_list_head);
 -       while (mnode_obj) {
 +       list_for_each_entry(mnode_obj, allocator-free_list, link) {
                if (dw_this_pa == NEXT_PA(mnode_obj)) {

snip

 @@ -748,18 +736,16 @@ bool dev_init(void)
  */
  int dev_notify_clients(struct dev_object *hdev_obj, u32 ret)
  {
 -       int status = 0;
 -
        struct dev_object *dev_obj = hdev_obj;
 -       void *proc_obj;
 +       struct list_head *curr;

can we add a check for !dev_obj and !dev_obj-proc_list just to be
sure that we get always the correct pointer?

snip

 @@ -947,15 +933,17 @@ int dev_insert_proc_object(struct dev_object *hdev_obj,
        DBC_REQUIRE(refs  0);
        DBC_REQUIRE(dev_obj);
        DBC_REQUIRE(proc_obj != 0);
 -       DBC_REQUIRE(dev_obj-proc_list != NULL);
        DBC_REQUIRE(already_attached != NULL);

can we check for !hdev_obj, !already_attached even if we have the
DBC_REQUIRE?, maybe we can actually remove the DBC_REQUIRE that could
be redundant after applying this.

 -       if (!LST_IS_EMPTY(dev_obj-proc_list))
 +       if (!list_empty(dev_obj-proc_list))
                *already_attached = true;

snip

 @@ -986,15 +974,12 @@ int dev_remove_proc_object(struct dev_object *hdev_obj, 
 u32 proc_obj)

        DBC_REQUIRE(dev_obj);
        DBC_REQUIRE(proc_obj != 0);
 -       DBC_REQUIRE(dev_obj-proc_list != NULL);
 -       DBC_REQUIRE(!LST_IS_EMPTY(dev_obj-proc_list));
 +       DBC_REQUIRE(!list_empty(dev_obj-proc_list));


 The same comment as above.

Regards,
Rene
--
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 08/12] staging: tidspbridge: convert rmgr to list_head

2010-11-05 Thread Sapiens, Rene
Hi Ionut,

On Fri, Nov 5, 2010 at 9:13 AM, Ionut Nicu ionut.n...@gmail.com wrote:
 Convert the rmgr module of the tidspbridge driver
 to use struct list_head instead of struct lst_list.

 Signed-off-by: Ionut Nicu ionut.n...@mindbit.ro

snip

 diff --git a/drivers/staging/tidspbridge/rmgr/drv.c 
 b/drivers/staging/tidspbridge/rmgr/drv.c

snip

 @@ -492,16 +465,17 @@ u32 drv_get_next_dev_object(u32 hdev_obj)
        u32 dw_next_dev_object = 0;
        struct drv_object *pdrv_obj;
        struct drv_data *drv_datap = dev_get_drvdata(bridge);
 +       struct list_head *curr;

        DBC_REQUIRE(hdev_obj != 0);

can we remove the DBC_REQUIRE and always check for !hdev_obj?


        if (drv_datap  drv_datap-drv_object) {
                pdrv_obj = drv_datap-drv_object;
 -               if ((pdrv_obj-dev_list != NULL) 
 -                   !LST_IS_EMPTY(pdrv_obj-dev_list)) {
 -                       dw_next_dev_object = (u32) 
 lst_next(pdrv_obj-dev_list,
 -                                                           (struct list_head 
 *)
 -                                                           hdev_obj);
 +               if (!list_empty(pdrv_obj-dev_list)) {
 +                       curr = (struct list_head *)hdev_obj;
 +                       if (curr-next == pdrv_obj-dev_list)

Can we use list_is_last() instead?

 +                               return 0;
 +                       dw_next_dev_object = (u32) curr-next;

snip

 @@ -573,11 +548,8 @@ int drv_insert_dev_object(struct drv_object *driver_obj,
        DBC_REQUIRE(refs  0);
        DBC_REQUIRE(hdev_obj != NULL);
        DBC_REQUIRE(pdrv_object);
 -       DBC_ASSERT(pdrv_object-dev_list);
 -

As a comment for all the functions that are manipulating lists, can we
check the parameters that they receive?, this applies for some other
functions in these patches, old lst_* functions were internally validating
the having of a valid pointer, now i think that we have to add this to each
function.

 -       lst_put_tail(pdrv_object-dev_list, (struct list_head *)hdev_obj);

 -       DBC_ENSURE(!LST_IS_EMPTY(pdrv_object-dev_list));
 +       list_add_tail((struct list_head *)hdev_obj, pdrv_object-dev_list);

snip

 @@ -1571,15 +1566,9 @@ int node_enum_nodes(struct node_mgr *hnode_mgr, void 
 **node_tab,
                *pu_num_nodes = 0;
                status = -EINVAL;
        } else {
 -               hnode = (struct node_object *)lst_first(hnode_mgr-
 -                       node_list);
 -               for (i = 0; i  hnode_mgr-num_nodes; i++) {
 -                       DBC_ASSERT(hnode);
 -                       node_tab[i] = hnode;
 -                       hnode = (struct node_object *)lst_next
 -                               (hnode_mgr-node_list,
 -                               (struct list_head *)hnode);
 -               }
 +               i = 0;

just a comment, what if we initialize this i when declared and
remove this line.

 +               list_for_each_entry(hnode, hnode_mgr-node_list, list_elem)
 +                       node_tab[i++] = hnode;
                *pu_allocated = *pu_num_nodes = hnode_mgr-num_nodes;
        }

snip

 diff --git a/drivers/staging/tidspbridge/rmgr/rmm.c 
 b/drivers/staging/tidspbridge/rmgr/rmm.c

snip

 @@ -145,20 +141,17 @@ int rmm_alloc(struct rmm_target_obj *target, u32 segid, 
 u32 size,
                if (new_sect == NULL) {
                        status = -ENOMEM;
                } else {
 -                       lst_init_elem((struct list_head *)new_sect);
                        new_sect-addr = addr;
                        new_sect-size = size;
                        new_sect-page = segid;
 -                       if (sect == NULL) {
 +                       if (sect == NULL)

I think that sect can't be NULL at this point... can be?
can we use: if (list_is_last(sect-list_elem, target-ovly_list)) instead?

                                /* Put new section at the end of the list */
 -                               lst_put_tail(target-ovly_list,
 -                                            (struct list_head *)new_sect);
 -                       } else {
 +                               list_add_tail(new_sect-list_elem,
 +                                               target-ovly_list);
 +                       else

snip

 @@ -333,24 +316,17 @@ bool rmm_free(struct rmm_target_obj *target, u32 segid, 
 u32 dsp_addr, u32 size,

        } else {
                /* Unreserve memory */
 -               sect = (struct rmm_ovly_sect *)lst_first(target-ovly_list);
 -               while (sect != NULL) {
 +               list_for_each_entry_safe(sect, tmp, target-ovly_list,
 +                               list_elem) {
                        if (dsp_addr == sect-addr) {
                                DBC_ASSERT(size == sect-size);
                                /* Remove from list */
 -                               lst_remove_elem(target-ovly_list,
 -                                               (struct 

Re: [PATCH 0/2] Combine zoom board-files

2010-11-05 Thread Felipe Balbi
Hi Tony,

On Fri, 5 Nov 2010 14:43:58 -0700, Tony Lindgren t...@atomide.com wrote:
 Looks good to me, but please can you please repost with also
 linux-arm-kernel list Cc'd? That way I don't have to repost
 before merging.

Sure, will do that first thing on monday. Sorry that I forgot.

-- 
balbi
--
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 v2 7/7] omap: mailbox: remove unreachable return

2010-11-05 Thread Omar Ramirez Luna
Remove unreachable return statement.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/mailbox.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 5e9ea0f..335eb2b 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -434,8 +434,6 @@ static int __devinit omap2_mbox_probe(struct 
platform_device *pdev)
return ret;
}
return 0;
-
-   return ret;
 }
 
 static int __devexit omap2_mbox_remove(struct platform_device *pdev)
-- 
1.7.1

--
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 v2 5/7] omap: mailbox: add omap_device latency information

2010-11-05 Thread Omar Ramirez Luna
From: Felipe Contreras felipe.contre...@gmail.com

So that we can enable the main clock.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/devices.c |   18 --
 arch/arm/mach-omap2/mailbox.c |   21 +
 arch/arm/plat-omap/include/plat/mailbox.h |6 ++
 3 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index d977572..dafc23a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -29,6 +29,7 @@
 #include plat/dma.h
 #include plat/omap_hwmod.h
 #include plat/omap_device.h
+#include plat/mailbox.h
 
 #include mux.h
 #include control.h
@@ -141,10 +142,19 @@ static inline void omap_init_camera(void)
 #endif
 
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
+static struct omap_device_pm_latency mbox_latencies[] = {
+   [0] = {
+   .activate_func = omap_device_enable_clocks,
+   .deactivate_func = omap_device_enable_clocks,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+   },
+};
+
 static inline void omap_init_mbox(void)
 {
struct omap_hwmod *oh;
struct omap_device *od;
+   struct omap_mbox_platform_data pdata;
 
oh = omap_hwmod_lookup(mailbox);
if (!oh) {
@@ -152,10 +162,14 @@ static inline void omap_init_mbox(void)
return;
}
 
+   pdata.device_enable = omap_device_enable;
+   pdata.device_disable = omap_device_idle;
+
od = omap_device_build(omap-mailbox, -1, oh,
-   NULL, 0,
-   NULL, 0,
+   pdata, sizeof(pdata),
+   mbox_latencies, ARRAY_SIZE(mbox_latencies),
0);
+
if (!od) {
pr_err(%s: could not build device\n, __func__);
return;
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 40ddeca..bf598a3 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -52,6 +52,7 @@
 #define OMAP4_MBOX_NR_REGS (OMAP4_MBOX_REG_SIZE / sizeof(u32))
 
 static void __iomem *mbox_base;
+static struct platform_device *mbox_pdev;
 
 struct omap_mbox2_fifo {
unsigned long msg;
@@ -70,8 +71,6 @@ struct omap_mbox2_priv {
unsigned long irqdisable;
 };
 
-static struct clk *mbox_ick_handle;
-
 static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
  omap_mbox_type_t irq);
 
@@ -90,14 +89,10 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
 {
u32 l;
unsigned long timeout;
+   struct omap_mbox_platform_data *pdata = mbox_pdev-dev.platform_data;
 
-   mbox_ick_handle = clk_get(NULL, mailboxes_ick);
-   if (IS_ERR(mbox_ick_handle)) {
-   printk(KERN_ERR Could not get mailboxes_ick: %ld\n,
-   PTR_ERR(mbox_ick_handle));
-   return PTR_ERR(mbox_ick_handle);
-   }
-   clk_enable(mbox_ick_handle);
+   if (pdata-device_enable)
+   pdata-device_enable(mbox_pdev);
 
if (cpu_is_omap44xx()) {
mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG);
@@ -143,9 +138,9 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
 
 static void omap2_mbox_shutdown(struct omap_mbox *mbox)
 {
-   clk_disable(mbox_ick_handle);
-   clk_put(mbox_ick_handle);
-   mbox_ick_handle = NULL;
+   struct omap_mbox_platform_data *pdata = mbox_pdev-dev.platform_data;
+   if (pdata-device_disable)
+   pdata-device_disable(mbox_pdev);
 }
 
 /* Mailbox FIFO handle functions */
@@ -427,6 +422,8 @@ static int __devinit omap2_mbox_probe(struct 
platform_device *pdev)
if (!mbox_base)
return -ENOMEM;
 
+   mbox_pdev = pdev;
+
ret = omap_mbox_register(pdev-dev, list);
if (ret) {
iounmap(mbox_base);
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h 
b/arch/arm/plat-omap/include/plat/mailbox.h
index 9976565..59443b1 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -11,6 +11,7 @@
 
 typedef u32 mbox_msg_t;
 struct omap_mbox;
+struct platform_device;
 
 typedef int __bitwise omap_mbox_irq_t;
 #define IRQ_TX ((__force omap_mbox_irq_t) 1)
@@ -59,6 +60,11 @@ struct omap_mbox {
void*priv;
 };
 
+struct omap_mbox_platform_data {
+   int (*device_enable)(struct platform_device *pdev);
+   int (*device_disable)(struct platform_device *pdev);
+};
+
 int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
 void omap_mbox_init_seq(struct omap_mbox *);
 
-- 
1.7.1

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

[PATCH v2 6/7] omap: mailbox: fix detection for previously supported chips

2010-11-05 Thread Omar Ramirez Luna
Fix the mailbox detection for OMAP3630 and 2430, also minor
cleanup on conditional ifdef's that could affect it.

Given that 2430 has an iva too include it, as the same steps
for omap3 apply.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/mailbox.c |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index bf598a3..5e9ea0f 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -276,7 +276,7 @@ static struct omap_mbox_ops omap2_mbox_ops = {
 
 /* FIXME: the following structs should be filled automatically by the user id 
*/
 
-#if defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_ARCH_OMAP2420)
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2)
 /* DSP */
 static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.tx_fifo = {
@@ -301,7 +301,7 @@ struct omap_mbox mbox_dsp_info = {
 };
 #endif
 
-#if defined(CONFIG_ARCH_OMAP3430)
+#if defined(CONFIG_ARCH_OMAP3)
 struct omap_mbox *omap3_mboxes[] = { mbox_dsp_info, NULL };
 #endif
 
@@ -389,15 +389,19 @@ static int __devinit omap2_mbox_probe(struct 
platform_device *pdev)
 
if (false)
;
-#if defined(CONFIG_ARCH_OMAP3430)
-   else if (cpu_is_omap3430()) {
+#if defined(CONFIG_ARCH_OMAP3)
+   else if (cpu_is_omap34xx()) {
list = omap3_mboxes;
 
list[0]-irq = platform_get_irq_byname(pdev, dsp);
}
 #endif
-#if defined(CONFIG_ARCH_OMAP2420)
-   else if (cpu_is_omap2420()) {
+#if defined(CONFIG_ARCH_OMAP2)
+   else if (cpu_is_omap2430()) {
+   list = omap2_mboxes;
+
+   list[0]-irq = platform_get_irq_byname(pdev, dsp);
+   } else if (cpu_is_omap2420()) {
list = omap2_mboxes;
 
list[0]-irq = platform_get_irq_byname(pdev, dsp);
-- 
1.7.1

--
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 v2 0/7] omap: mailbox: hwmod support and dependent cleanup patches

2010-11-05 Thread Omar Ramirez Luna
hwmod support for omap2 and omap3 chips, plus cleanups.

Tested on 3430 and 3630

** v2 **
- Added omap4 hwmod support.
- Moved mailbox_ick from hwmod to hwmod_if (omap 2/3)
- Declared sysc classes for omap 2/3

** v1 **
1. omap: mailbox: initial hwmod support for omap3
Changes were made to:
- Rebase to latest code.
- Detect the hwmod by filling prcm union for omap2, without
  this it was unable to build the hwmod at runtime.
- Replace magic number for defines.
- Use ioremap again instead of relying on the one made by hwmod,
  as noted in http://patchwork.kernel.org/patch/101661/

2. omap: mailbox: initial hwmod support for omap2
Was only compiled tested!! Unfortunately I don't have the HW for it.

4. omap: mailbox: fix detection for previously supported chips
Original patch was using features framework, but when compiled as a module
it was breaking, this patch uses cpu_is_omap34xx macro instead. This is
meant as a short term solution until proper cleanup is done, as suggested in:

http://marc.info/?l=linux-arm-kernelm=128534253231481w=2

Benoit Cousson (1):
  OMAP4: hwmod data: add mailbox data

Felipe Contreras (3):
  OMAP3: hwmod data: add mailbox data
  omap: mailbox: initial hwmod support
  omap: mailbox: add omap_device latency information

Omar Ramirez Luna (3):
  OMAP2: hwmod data: add mailbox data
  omap: mailbox: fix detection for previously supported chips
  omap: mailbox: remove unreachable return

 arch/arm/mach-omap2/devices.c  |  104 +++-
 arch/arm/mach-omap2/mailbox.c  |   39 +-
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   67 ++
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   66 ++
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   66 ++
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   63 +
 arch/arm/plat-omap/include/plat/mailbox.h  |6 ++
 7 files changed, 311 insertions(+), 100 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 v2 1/7] OMAP2: hwmod data: add mailbox data

2010-11-05 Thread Omar Ramirez Luna
hwmod data for omap2430 and 2420.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   67 
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   66 +++
 2 files changed, 133 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index a1a3dd6..76ad991 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -557,6 +557,72 @@ static struct omap_hwmod omap2420_i2c2_hwmod = {
.flags  = HWMOD_16BIT_REG,
 };
 
+/* mailbox */
+
+static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = {
+   .rev_offs   = 0x000,
+   .sysc_offs  = 0x010,
+   .syss_offs  = 0x014,
+   .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+   .sysc_fields= omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2420_mailbox_hwmod_class = {
+   .name = mailbox,
+   .sysc = omap2420_mailbox_sysc,
+};
+
+static struct omap_hwmod omap2420_mailbox_hwmod;
+
+static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = {
+   {
+   .pa_start   = OMAP24XX_MAILBOX_BASE,
+   .pa_end = OMAP24XX_MAILBOX_BASE + SZ_4K - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l4_core - mailbox */
+static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
+   .master = omap2420_l4_core_hwmod,
+   .slave  = omap2420_mailbox_hwmod,
+   .addr   = omap2420_mailbox_addrs,
+   .clk= mailboxes_ick,
+   .addr_cnt   = ARRAY_SIZE(omap2420_mailbox_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = {
+   omap2420_l4_core__mailbox,
+};
+
+static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
+   { .name = dsp, .irq = INT_24XX_MAIL_U0_MPU, },
+   { .name = iva, .irq = INT_24XX_MAIL_U3_MPU, },
+};
+
+static struct omap_hwmod omap2420_mailbox_hwmod = {
+   .name   = mailbox,
+   .class  = omap2420_mailbox_hwmod_class,
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
+   .module_offs = CORE_MOD,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
+   },
+   },
+   .mpu_irqs   = omap2420_mailbox_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap2420_mailbox_irqs),
+   .slaves = omap2420_mailbox_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
 static __initdata struct omap_hwmod *omap2420_hwmods[] = {
omap2420_l3_main_hwmod,
omap2420_l4_core_hwmod,
@@ -569,6 +635,7 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
omap2420_uart3_hwmod,
omap2420_i2c1_hwmod,
omap2420_i2c2_hwmod,
+   omap2420_mailbox_hwmod,
NULL,
 };
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c 
b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 7cf0d3a..991bd5b 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -569,6 +569,71 @@ static struct omap_hwmod omap2430_i2c2_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
+/* mailbox */
+
+static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = {
+   .rev_offs   = 0x000,
+   .sysc_offs  = 0x010,
+   .syss_offs  = 0x014,
+   .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+   .sysc_fields= omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2430_mailbox_hwmod_class = {
+   .name = mailbox,
+   .sysc = omap2430_mailbox_sysc,
+};
+
+static struct omap_hwmod omap2430_mailbox_hwmod;
+
+static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = {
+   {
+   .pa_start   = OMAP24XX_MAILBOX_BASE,
+   .pa_end = OMAP24XX_MAILBOX_BASE + SZ_4K - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l4_core - mailbox */
+static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = {
+   .master = omap2430_l4_core_hwmod,
+   .slave  = omap2430_mailbox_hwmod,
+   .addr   = omap2430_mailbox_addrs,
+   .clk= mailboxes_ick,
+   .addr_cnt   = 

[PATCH v2 2/7] OMAP3: hwmod data: add mailbox data

2010-11-05 Thread Omar Ramirez Luna
From: Felipe Contreras felipe.contre...@gmail.com

hwmod data for omap3 mailbox.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   66 
 1 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index ed6bf4a..60d977e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -736,6 +736,71 @@ static struct omap_hwmod omap3xxx_i2c3_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/* mailbox */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = {
+   .rev_offs   = 0x000,
+   .sysc_offs  = 0x010,
+   .syss_offs  = 0x014,
+   .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+   .sysc_fields= omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
+   .name = mailbox,
+   .sysc = omap3xxx_mailbox_sysc,
+};
+
+static struct omap_hwmod omap3xxx_mailbox_hwmod;
+
+static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = {
+   {
+   .pa_start   = OMAP34XX_MAILBOX_BASE,
+   .pa_end = OMAP34XX_MAILBOX_BASE + SZ_4K - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l4_core - mailbox */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = {
+   .master = omap3xxx_l4_core_hwmod,
+   .slave  = omap3xxx_mailbox_hwmod,
+   .addr   = omap3xxx_mailbox_addrs,
+   .clk= mailboxes_ick,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_mailbox_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = {
+   omap3xxx_l4_core__mailbox,
+};
+
+static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
+   { .name = dsp, .irq = INT_24XX_MAIL_U0_MPU, },
+};
+
+static struct omap_hwmod omap3xxx_mailbox_hwmod = {
+   .name   = mailbox,
+   .class  = omap3xxx_mailbox_hwmod_class,
+   .prcm   = {
+   .omap2 = {
+   .prcm_reg_id = 1,
+   .module_bit = OMAP3430_EN_MAILBOXES_SHIFT,
+   .module_offs = CORE_MOD,
+   .idlest_reg_id = 1,
+   .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
+   },
+   },
+   .mpu_irqs   = omap3xxx_mailbox_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap3xxx_mailbox_irqs),
+   .slaves = omap3xxx_mailbox_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
 static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
omap3xxx_l3_main_hwmod,
omap3xxx_l4_core_hwmod,
@@ -751,6 +816,7 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
omap3xxx_i2c1_hwmod,
omap3xxx_i2c2_hwmod,
omap3xxx_i2c3_hwmod,
+   omap3xxx_mailbox_hwmod,
NULL,
 };
 
-- 
1.7.1

--
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 v2 4/7] omap: mailbox: initial hwmod support

2010-11-05 Thread Omar Ramirez Luna
From: Felipe Contreras felipe.contre...@gmail.com

hwmod support for omap mailbox module.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/devices.c |  100 ++--
 1 files changed, 15 insertions(+), 85 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index eaf3799..d977572 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -141,95 +141,25 @@ static inline void omap_init_camera(void)
 #endif
 
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
-
-#define MBOX_REG_SIZE   0x120
-
-#ifdef CONFIG_ARCH_OMAP2
-static struct resource omap2_mbox_resources[] = {
-   {
-   .start  = OMAP24XX_MAILBOX_BASE,
-   .end= OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_24XX_MAIL_U0_MPU,
-   .flags  = IORESOURCE_IRQ,
-   .name   = dsp,
-   },
-   {
-   .start  = INT_24XX_MAIL_U3_MPU,
-   .flags  = IORESOURCE_IRQ,
-   .name   = iva,
-   },
-};
-static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
-#else
-#define omap2_mbox_resources   NULL
-#define omap2_mbox_resources_sz0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-static struct resource omap3_mbox_resources[] = {
-   {
-   .start  = OMAP34XX_MAILBOX_BASE,
-   .end= OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = INT_24XX_MAIL_U0_MPU,
-   .flags  = IORESOURCE_IRQ,
-   .name   = dsp,
-   },
-};
-static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
-#else
-#define omap3_mbox_resources   NULL
-#define omap3_mbox_resources_sz0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-
-#define OMAP4_MBOX_REG_SIZE0x130
-static struct resource omap4_mbox_resources[] = {
-   {
-   .start  = OMAP44XX_MAILBOX_BASE,
-   .end= OMAP44XX_MAILBOX_BASE +
-   OMAP4_MBOX_REG_SIZE - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = OMAP44XX_IRQ_MAIL_U0,
-   .flags  = IORESOURCE_IRQ,
-   .name   = mbox,
-   },
-};
-static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
-#else
-#define omap4_mbox_resources   NULL
-#define omap4_mbox_resources_sz0
-#endif
-
-static struct platform_device mbox_device = {
-   .name   = omap-mailbox,
-   .id = -1,
-};
-
 static inline void omap_init_mbox(void)
 {
-   if (cpu_is_omap24xx()) {
-   mbox_device.resource = omap2_mbox_resources;
-   mbox_device.num_resources = omap2_mbox_resources_sz;
-   } else if (cpu_is_omap34xx()) {
-   mbox_device.resource = omap3_mbox_resources;
-   mbox_device.num_resources = omap3_mbox_resources_sz;
-   } else if (cpu_is_omap44xx()) {
-   mbox_device.resource = omap4_mbox_resources;
-   mbox_device.num_resources = omap4_mbox_resources_sz;
-   } else {
-   pr_err(%s: platform not supported\n, __func__);
+   struct omap_hwmod *oh;
+   struct omap_device *od;
+
+   oh = omap_hwmod_lookup(mailbox);
+   if (!oh) {
+   pr_err(%s: unable to find hwmod\n, __func__);
+   return;
+   }
+
+   od = omap_device_build(omap-mailbox, -1, oh,
+   NULL, 0,
+   NULL, 0,
+   0);
+   if (!od) {
+   pr_err(%s: could not build device\n, __func__);
return;
}
-   platform_device_register(mbox_device);
 }
 #else
 static inline void omap_init_mbox(void) { }
-- 
1.7.1

--
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 v2 3/7] OMAP4: hwmod data: add mailbox data

2010-11-05 Thread Omar Ramirez Luna
From: Benoit Cousson b-cous...@ti.com

hwmod data for omap4 mailbox.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   63 
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 0d5c6eb..f7525e3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -1043,6 +1043,66 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/* mailbox */
+
+static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
+  SYSC_HAS_SOFTRESET),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = {
+   .name = mailbox,
+   .sysc = omap44xx_mailbox_sysc,
+};
+
+static struct omap_hwmod omap44xx_mailbox_hwmod;
+
+static struct omap_hwmod_addr_space omap44xx_mailbox_addrs[] = {
+   {
+   .pa_start   = OMAP44XX_MAILBOX_BASE,
+   .pa_end = OMAP44XX_MAILBOX_BASE + SZ_4K - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l4_cfg - mailbox */
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mailbox = {
+   .master = omap44xx_l4_cfg_hwmod,
+   .slave  = omap44xx_mailbox_hwmod,
+   .clk= l4_div_ck,
+   .addr   = omap44xx_mailbox_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap44xx_mailbox_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* mailbox slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_mailbox_slaves[] = {
+   omap44xx_l4_cfg__mailbox,
+};
+
+static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
+   { .name = mbox, .irq = 26 + OMAP44XX_IRQ_GIC_START, },
+};
+
+static struct omap_hwmod omap44xx_mailbox_hwmod = {
+   .name   = mailbox,
+   .class  = omap44xx_mailbox_hwmod_class,
+   .prcm   = {
+   .omap4 = {
+   .clkctrl_reg = OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL,
+   },
+   },
+   .mpu_irqs   = omap44xx_mailbox_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap44xx_mailbox_irqs),
+   .slaves = omap44xx_mailbox_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves),
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
 static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
/* dmm class */
omap44xx_dmm_hwmod,
@@ -1077,6 +1137,9 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
omap44xx_uart2_hwmod,
omap44xx_uart3_hwmod,
omap44xx_uart4_hwmod,
+
+   /* mailbox */
+   omap44xx_mailbox_hwmod,
NULL,
 };
 
-- 
1.7.1

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


[PATCH 3/6] OMAP4: hwmod data: add mmu hwmod for ducati and tesla

2010-11-05 Thread Omar Ramirez Luna
Add mmu hwmod data for ducati and tesla.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  105 
 1 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index f7525e3..1d5eace 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -22,6 +22,7 @@
 
 #include plat/omap_hwmod.h
 #include plat/cpu.h
+#include plat/iommu.h
 
 #include omap_hwmod_common_data.h
 
@@ -1103,6 +1104,106 @@ static struct omap_hwmod omap44xx_mailbox_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 };
 
+/* mmu */
+
+static struct omap_hwmod_class omap44xx_mmu_hwmod_class = {
+   .name = mmu,
+};
+
+/* ducati mmu */
+
+static struct omap_hwmod omap44xx_ducati_mmu_hwmod;
+
+static struct omap_hwmod_addr_space omap44xx_ducati_mmu_addrs[] = {
+   {
+   .pa_start   = OMAP4_MMU1_BASE,
+   .pa_end = OMAP4_MMU1_BASE + SZ_4K - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l3_main_1 - ducati mmu */
+static struct omap_hwmod_ocp_if omap44xx_l3_main_1__ducati_mmu = {
+   .master = omap44xx_l3_main_1_hwmod,
+   .slave  = omap44xx_ducati_mmu_hwmod,
+   .addr   = omap44xx_ducati_mmu_addrs,
+   .clk= dpll_mpu_m2_ck,
+   .addr_cnt   = ARRAY_SIZE(omap44xx_ducati_mmu_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* ducati mmu slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_ducati_mmu_slaves[] = {
+   omap44xx_l3_main_1__ducati_mmu,
+};
+
+static struct omap_hwmod_irq_info omap44xx_ducati_mmu_irqs[] = {
+   { .name = ducati, .irq = 100 + OMAP44XX_IRQ_GIC_START, },
+};
+
+static struct omap_mmu_dev_attr ducati_mmu_dev_attr = {
+   .nr_tlb_entries = 32,
+};
+
+static struct omap_hwmod omap44xx_ducati_mmu_hwmod = {
+   .name   = ducati,
+   .class  = omap44xx_mmu_hwmod_class,
+   .mpu_irqs   = omap44xx_ducati_mmu_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap44xx_ducati_mmu_irqs),
+   .slaves = omap44xx_ducati_mmu_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_ducati_mmu_slaves),
+   .dev_attr   = ducati_mmu_dev_attr,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* tesla mmu */
+
+static struct omap_hwmod omap44xx_tesla_mmu_hwmod;
+
+static struct omap_hwmod_addr_space omap44xx_tesla_mmu_addrs[] = {
+   {
+   .pa_start   = OMAP4_MMU2_BASE,
+   .pa_end = OMAP4_MMU2_BASE + SZ_4K - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l3_main_1 - tesla mmu */
+static struct omap_hwmod_ocp_if omap44xx_l3_main_1__tesla_mmu = {
+   .master = omap44xx_l3_main_1_hwmod,
+   .slave  = omap44xx_tesla_mmu_hwmod,
+   .addr   = omap44xx_tesla_mmu_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap44xx_tesla_mmu_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* tesla mmu slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_tesla_mmu_slaves[] = {
+   omap44xx_l3_main_1__tesla_mmu,
+};
+
+static struct omap_hwmod_irq_info omap44xx_tesla_mmu_irqs[] = {
+   { .name = tesla, .irq = 28 + OMAP44XX_IRQ_GIC_START, },
+};
+
+static struct omap_mmu_dev_attr tesla_mmu_dev_attr = {
+   .nr_tlb_entries = 32,
+};
+
+static struct omap_hwmod omap44xx_tesla_mmu_hwmod = {
+   .name   = tesla,
+   .class  = omap44xx_mmu_hwmod_class,
+   .mpu_irqs   = omap44xx_tesla_mmu_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap44xx_tesla_mmu_irqs),
+   .main_clk   = dsp_fck,
+   .slaves = omap44xx_tesla_mmu_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap44xx_tesla_mmu_slaves),
+   .dev_attr   = tesla_mmu_dev_attr,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
 static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
/* dmm class */
omap44xx_dmm_hwmod,
@@ -1140,6 +1241,10 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = 
{
 
/* mailbox */
omap44xx_mailbox_hwmod,
+
+   /* mmu */
+   omap44xx_ducati_mmu_hwmod,
+   omap44xx_tesla_mmu_hwmod,
NULL,
 };
 
-- 
1.7.1

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


[PATCH 2/6] OMAP3: hwmod data: Add mmu for iva2 and isp

2010-11-05 Thread Omar Ramirez Luna
Add mmu hwmod data for iva2 and isp.

Plus a define for the iva2 base register.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  103 
 arch/arm/plat-omap/include/plat/iommu.h|8 ++
 arch/arm/plat-omap/include/plat/omap34xx.h |2 +
 3 files changed, 113 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 60d977e..ff80efc 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -21,6 +21,7 @@
 #include plat/l4_3xxx.h
 #include plat/i2c.h
 #include plat/omap34xx.h
+#include plat/iommu.h
 
 #include omap_hwmod_common_data.h
 
@@ -801,6 +802,106 @@ static struct omap_hwmod omap3xxx_mailbox_hwmod = {
.omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/* mmu */
+
+static struct omap_hwmod_class omap3xxx_mmu_hwmod_class = {
+   .name = mmu,
+};
+
+/* isp mmu */
+
+static struct omap_hwmod omap3xxx_isp_mmu_hwmod;
+
+static struct omap_hwmod_addr_space omap3xxx_isp_mmu_addrs[] = {
+   {
+   .pa_start   = OMAP3430_ISP_MMU_BASE,
+   .pa_end = OMAP3430_ISP_MMU_BASE + SZ_256 - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l4_core - isp mmu */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__isp_mmu = {
+   .master = omap3xxx_l4_core_hwmod,
+   .slave  = omap3xxx_isp_mmu_hwmod,
+   .addr   = omap3xxx_isp_mmu_addrs,
+   .clk= cam_ick,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_isp_mmu_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* isp mmu slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_isp_mmu_slaves[] = {
+   omap3xxx_l4_core__isp_mmu,
+};
+
+static struct omap_hwmod_irq_info omap3xxx_isp_mmu_irqs[] = {
+   { .name = isp, .irq = INT_24XX_CAM_IRQ, },
+};
+
+static struct omap_mmu_dev_attr isp_mmu_dev_attr = {
+   .nr_tlb_entries = 8,
+};
+
+static struct omap_hwmod omap3xxx_isp_mmu_hwmod = {
+   .name   = isp,
+   .class  = omap3xxx_mmu_hwmod_class,
+   .mpu_irqs   = omap3xxx_isp_mmu_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap3xxx_isp_mmu_irqs),
+   .slaves = omap3xxx_isp_mmu_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap3xxx_isp_mmu_slaves),
+   .dev_attr   = isp_mmu_dev_attr,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
+/* iva2 mmu */
+
+static struct omap_hwmod omap3xxx_iva2_mmu_hwmod;
+
+static struct omap_hwmod_addr_space omap3xxx_iva2_mmu_addrs[] = {
+   {
+   .pa_start   = OMAP34XX_IVA2_MMU_BASE,
+   .pa_end = OMAP34XX_IVA2_MMU_BASE + SZ_256 - 1,
+   .flags  = ADDR_TYPE_RT,
+   },
+};
+
+/* l3_main - iva2 mmu */
+static struct omap_hwmod_ocp_if omap3xxx_l3_main__iva2_mmu = {
+   .master = omap3xxx_l3_main_hwmod,
+   .slave  = omap3xxx_iva2_mmu_hwmod,
+   .addr   = omap3xxx_iva2_mmu_addrs,
+   .addr_cnt   = ARRAY_SIZE(omap3xxx_iva2_mmu_addrs),
+   .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* iva2 mmu slave ports */
+static struct omap_hwmod_ocp_if *omap3xxx_iva2_mmu_slaves[] = {
+   omap3xxx_l3_main__iva2_mmu,
+};
+
+static struct omap_hwmod_irq_info omap3xxx_iva2_mmu_irqs[] = {
+   { .name = iva2, .irq = INT_24XX_DSP_MMU, },
+};
+
+static struct omap_mmu_dev_attr iva2_mmu_dev_attr = {
+   .nr_tlb_entries = 32,
+};
+
+static struct omap_hwmod omap3xxx_iva2_mmu_hwmod = {
+   .name   = iva2,
+   .class  = omap3xxx_mmu_hwmod_class,
+   .mpu_irqs   = omap3xxx_iva2_mmu_irqs,
+   .mpu_irqs_cnt   = ARRAY_SIZE(omap3xxx_iva2_mmu_irqs),
+   .main_clk   = iva2_ck,
+   .slaves = omap3xxx_iva2_mmu_slaves,
+   .slaves_cnt = ARRAY_SIZE(omap3xxx_iva2_mmu_slaves),
+   .dev_attr   = iva2_mmu_dev_attr,
+   .omap_chip  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+   .flags  = HWMOD_NO_IDLEST,
+};
+
 static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
omap3xxx_l3_main_hwmod,
omap3xxx_l4_core_hwmod,
@@ -817,6 +918,8 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
omap3xxx_i2c2_hwmod,
omap3xxx_i2c3_hwmod,
omap3xxx_mailbox_hwmod,
+   omap3xxx_isp_mmu_hwmod,
+   omap3xxx_iva2_mmu_hwmod,
NULL,
 };
 
diff --git a/arch/arm/plat-omap/include/plat/iommu.h 
b/arch/arm/plat-omap/include/plat/iommu.h
index 33c7d41..91a75a5 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -99,6 +99,14 @@ struct iommu_functions {
ssize_t (*dump_ctx)(struct iommu *obj, char *buf, ssize_t len);
 };
 
+/* omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod
+ * 

[PATCH 1/6] omap: iommu: remove redundant clock usage

2010-11-05 Thread Omar Ramirez Luna
iommu driver is meant to provide control of mmu hardware blocks
its current users (MMUs) are part of larger subsystems and do not
have a dedicated clock as the one they use is shared with the
entire subsystem, it doesn't make sense to enable/disable on each
register read/write operation as the driver using its interface
should also be handling the same clock.

iommu should only enable/disable the clock on mmu request/free from
the driver wanting to use it.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/iommu.c |   38 +-
 1 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 6cd151b..de992c8 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -108,7 +108,6 @@ static int iommu_enable(struct iommu *obj)
 
err = arch_iommu-enable(obj);
 
-   clk_disable(obj-clk);
return err;
 }
 
@@ -117,8 +116,6 @@ static void iommu_disable(struct iommu *obj)
if (!obj)
return;
 
-   clk_enable(obj-clk);
-
arch_iommu-disable(obj);
 
clk_disable(obj-clk);
@@ -237,20 +234,16 @@ static struct cr_regs __iotlb_read_cr(struct iommu *obj, 
int n)
  **/
 int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e)
 {
-   int err = 0;
struct iotlb_lock l;
struct cr_regs *cr;
 
if (!obj || !obj-nr_tlb_entries || !e)
return -EINVAL;
 
-   clk_enable(obj-clk);
-
iotlb_lock_get(obj, l);
if (l.base == obj-nr_tlb_entries) {
dev_warn(obj-dev, %s: preserve entries full\n, __func__);
-   err = -EBUSY;
-   goto out;
+   return -EBUSY;
}
if (!e-prsvd) {
int i;
@@ -262,8 +255,7 @@ int load_iotlb_entry(struct iommu *obj, struct iotlb_entry 
*e)
 
if (i == obj-nr_tlb_entries) {
dev_dbg(obj-dev, %s: full: no entry\n, __func__);
-   err = -EBUSY;
-   goto out;
+   return -EBUSY;
}
 
iotlb_lock_get(obj, l);
@@ -273,10 +265,8 @@ int load_iotlb_entry(struct iommu *obj, struct iotlb_entry 
*e)
}
 
cr = iotlb_alloc_cr(obj, e);
-   if (IS_ERR(cr)) {
-   clk_disable(obj-clk);
+   if (IS_ERR(cr))
return PTR_ERR(cr);
-   }
 
iotlb_load_cr(obj, cr);
kfree(cr);
@@ -287,9 +277,8 @@ int load_iotlb_entry(struct iommu *obj, struct iotlb_entry 
*e)
if (++l.vict == obj-nr_tlb_entries)
l.vict = l.base;
iotlb_lock_set(obj, l);
-out:
-   clk_disable(obj-clk);
-   return err;
+
+   return 0;
 }
 EXPORT_SYMBOL_GPL(load_iotlb_entry);
 
@@ -305,8 +294,6 @@ void flush_iotlb_page(struct iommu *obj, u32 da)
int i;
struct cr_regs cr;
 
-   clk_enable(obj-clk);
-
for_each_iotlb_cr(obj, obj-nr_tlb_entries, i, cr) {
u32 start;
size_t bytes;
@@ -324,7 +311,6 @@ void flush_iotlb_page(struct iommu *obj, u32 da)
iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
}
}
-   clk_disable(obj-clk);
 
if (i == obj-nr_tlb_entries)
dev_dbg(obj-dev, %s: no page for %08x\n, __func__, da);
@@ -359,15 +345,11 @@ void flush_iotlb_all(struct iommu *obj)
 {
struct iotlb_lock l;
 
-   clk_enable(obj-clk);
-
l.base = 0;
l.vict = 0;
iotlb_lock_set(obj, l);
 
iommu_write_reg(obj, 1, MMU_GFLUSH);
-
-   clk_disable(obj-clk);
 }
 EXPORT_SYMBOL_GPL(flush_iotlb_all);
 
@@ -382,9 +364,7 @@ EXPORT_SYMBOL_GPL(flush_iotlb_all);
  */
 void iommu_set_twl(struct iommu *obj, bool on)
 {
-   clk_enable(obj-clk);
arch_iommu-set_twl(obj, on);
-   clk_disable(obj-clk);
 }
 EXPORT_SYMBOL_GPL(iommu_set_twl);
 
@@ -395,12 +375,8 @@ ssize_t iommu_dump_ctx(struct iommu *obj, char *buf, 
ssize_t bytes)
if (!obj || !buf)
return -EINVAL;
 
-   clk_enable(obj-clk);
-
bytes = arch_iommu-dump_ctx(obj, buf, bytes);
 
-   clk_disable(obj-clk);
-
return bytes;
 }
 EXPORT_SYMBOL_GPL(iommu_dump_ctx);
@@ -412,7 +388,6 @@ static int __dump_tlb_entries(struct iommu *obj, struct 
cr_regs *crs, int num)
struct cr_regs tmp;
struct cr_regs *p = crs;
 
-   clk_enable(obj-clk);
iotlb_lock_get(obj, saved);
 
for_each_iotlb_cr(obj, num, i, tmp) {
@@ -422,7 +397,6 @@ static int __dump_tlb_entries(struct iommu *obj, struct 
cr_regs *crs, int num)
}
 
iotlb_lock_set(obj, saved);
-   clk_disable(obj-clk);
 
return  p - crs;
 }
@@ -795,9 +769,7 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
if (!err)
return IRQ_HANDLED;
 
-   clk_enable(obj-clk);
stat = iommu_report_fault(obj, da);
-   

[PATCH 4/6] omap: iommu: intial hwmod support

2010-11-05 Thread Omar Ramirez Luna
Use the defined hwmod data according to the devices
present on omap3 and omap4.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap-iommu.c|   77 ---
 arch/arm/plat-omap/include/plat/iommu.h |2 +-
 arch/arm/plat-omap/iommu.c  |2 +-
 3 files changed, 21 insertions(+), 60 deletions(-)

diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index f5a1aad..65460ef 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -14,12 +14,11 @@
 
 #include plat/iommu.h
 #include plat/irqs.h
+#include plat/omap_hwmod.h
+#include plat/omap_device.h
 
 struct iommu_device {
-   resource_size_t base;
-   int irq;
struct iommu_platform_data pdata;
-   struct resource res[2];
 };
 static struct iommu_device *devices;
 static int num_iommu_devices;
@@ -27,128 +26,90 @@ static int num_iommu_devices;
 #ifdef CONFIG_ARCH_OMAP3
 static struct iommu_device omap3_devices[] = {
{
-   .base = 0x480bd400,
-   .irq = 24,
.pdata = {
.name = isp,
-   .nr_tlb_entries = 8,
.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];
 #else
 #define omap3_devices  NULL
 #define NR_OMAP3_IOMMU_DEVICES 0
-#define omap3_iommu_pdev   NULL
 #endif
 
 #ifdef CONFIG_ARCH_OMAP4
 static struct iommu_device omap4_devices[] = {
{
-   .base = OMAP4_MMU1_BASE,
-   .irq = OMAP44XX_IRQ_DUCATI_MMU,
.pdata = {
.name = ducati,
-   .nr_tlb_entries = 32,
.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];
 #else
 #define omap4_devices  NULL
 #define NR_OMAP4_IOMMU_DEVICES 0
-#define omap4_iommu_pdev   NULL
 #endif
 
-static struct platform_device **omap_iommu_pdev;
-
 static int __init omap_iommu_init(void)
 {
-   int i, err;
-   struct resource res[] = {
-   { .flags = IORESOURCE_MEM },
-   { .flags = IORESOURCE_IRQ },
-   };
+   int i;
 
if (cpu_is_omap34xx()) {
devices = omap3_devices;
-   omap_iommu_pdev = omap3_iommu_pdev;
num_iommu_devices = NR_OMAP3_IOMMU_DEVICES;
} else if (cpu_is_omap44xx()) {
devices = omap4_devices;
-   omap_iommu_pdev = omap4_iommu_pdev;
num_iommu_devices = NR_OMAP4_IOMMU_DEVICES;
} else
return -ENODEV;
 
for (i = 0; i  num_iommu_devices; i++) {
-   struct platform_device *pdev;
-   const struct iommu_device *d = devices[i];
+   struct omap_hwmod *oh;
+   struct omap_device *od;
 
-   pdev = platform_device_alloc(omap-iommu, i);
-   if (!pdev) {
-   err = -ENOMEM;
-   goto err_out;
+   oh = omap_hwmod_lookup(devices[i].pdata.name);
+   if (!oh) {
+   pr_err(%s: hwmod not found\n, __func__);
+   return -ENODEV;
}
 
-   res[0].start = d-base;
-   res[0].end = d-base + MMU_REG_SIZE - 1;
-   res[1].start = res[1].end = d-irq;
+   devices[i].pdata.mmu_attr =
+   (struct omap_mmu_dev_attr *)oh-dev_attr;
 
-   err = platform_device_add_resources(pdev, res,
-   ARRAY_SIZE(res));
-   if (err)
-   goto err_out;
-   err = platform_device_add_data(pdev, d-pdata,
-  sizeof(d-pdata));
-   if (err)
-   goto err_out;
-   err = platform_device_add(pdev);
-   if (err)
-   goto err_out;
-   omap_iommu_pdev[i] = pdev;
+   od = omap_device_build(omap-iommu, i, oh,
+ 

[PATCH 5/6] omap: iommu: hwmod device enable/disable routines

2010-11-05 Thread Omar Ramirez Luna
Use omap device enable/disable routines.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap-iommu.c|   16 +++-
 arch/arm/plat-omap/include/plat/iommu.h |7 +--
 arch/arm/plat-omap/iommu.c  |   24 +++-
 3 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index 65460ef..0a76bce 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -28,14 +28,12 @@ static struct iommu_device omap3_devices[] = {
{
.pdata = {
.name = isp,
-   .clk_name = cam_ick,
},
},
 #if defined(CONFIG_MPU_BRIDGE_IOMMU)
{
.pdata = {
.name = iva2,
-   .clk_name = iva2_ck,
},
},
 #endif
@@ -51,14 +49,12 @@ static struct iommu_device omap4_devices[] = {
{
.pdata = {
.name = ducati,
-   .clk_name = ducati_ick,
},
},
 #if defined(CONFIG_MPU_TESLA_IOMMU)
{
.pdata = {
.name = tesla,
-   .clk_name = tesla_ick,
},
},
 #endif
@@ -69,6 +65,14 @@ static struct iommu_device omap4_devices[] = {
 #define NR_OMAP4_IOMMU_DEVICES 0
 #endif
 
+static struct omap_device_pm_latency iommu_latencies[] = {
+   [0] = {
+   .activate_func = omap_device_enable_clocks,
+   .deactivate_func = omap_device_enable_clocks,
+   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST
+   },
+};
+
 static int __init omap_iommu_init(void)
 {
int i;
@@ -94,10 +98,12 @@ static int __init omap_iommu_init(void)
 
devices[i].pdata.mmu_attr =
(struct omap_mmu_dev_attr *)oh-dev_attr;
+   devices[i].pdata.device_enable = omap_device_enable;
+   devices[i].pdata.device_disable = omap_device_idle;
 
od = omap_device_build(omap-iommu, i, oh,
devices[i].pdata, sizeof(devices[i].pdata),
-   NULL, 0,
+   iommu_latencies, ARRAY_SIZE(iommu_latencies),
0);
if (!od) {
pr_err(%s: error device build failed\n, __func__);
diff --git a/arch/arm/plat-omap/include/plat/iommu.h 
b/arch/arm/plat-omap/include/plat/iommu.h
index 9650309..fd8ffeb 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -13,6 +13,8 @@
 #ifndef __MACH_IOMMU_H
 #define __MACH_IOMMU_H
 
+struct platform_device;
+
 struct iotlb_entry {
u32 da;
u32 pa;
@@ -28,7 +30,6 @@ struct iotlb_entry {
 struct iommu {
const char  *name;
struct module   *owner;
-   struct clk  *clk;
void __iomem*regbase;
struct device   *dev;
 
@@ -109,8 +110,10 @@ struct omap_mmu_dev_attr {
 
 struct iommu_platform_data {
const char *name;
-   const char *clk_name;
struct omap_mmu_dev_attr *mmu_attr;
+
+   int (*device_enable)(struct platform_device *pdev);
+   int (*device_disable)(struct platform_device *pdev);
 };
 
 #if defined(CONFIG_ARCH_OMAP1)
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 0fc9d90..36b1b63 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -100,11 +100,17 @@ EXPORT_SYMBOL_GPL(iommu_arch_version);
 static int iommu_enable(struct iommu *obj)
 {
int err;
+   struct iommu_platform_data *pdata;
+   struct platform_device *pdev;
 
if (!obj)
return -EINVAL;
 
-   clk_enable(obj-clk);
+   pdev = container_of(obj-dev, struct platform_device, dev);
+   pdata = obj-dev-platform_data;
+
+   if (pdata-device_enable)
+   pdata-device_enable(pdev);
 
err = arch_iommu-enable(obj);
 
@@ -113,12 +119,19 @@ static int iommu_enable(struct iommu *obj)
 
 static void iommu_disable(struct iommu *obj)
 {
+   struct iommu_platform_data *pdata;
+   struct platform_device *pdev;
+
if (!obj)
return;
 
arch_iommu-disable(obj);
 
-   clk_disable(obj-clk);
+   pdev = container_of(obj-dev, struct platform_device, dev);
+   pdata = obj-dev-platform_data;
+
+   if (pdata-device_enable)
+   pdata-device_disable(pdev);
 }
 
 /*
@@ -886,10 +899,6 @@ static int __devinit omap_iommu_probe(struct 
platform_device *pdev)
if (!obj)
return -ENOMEM;
 
-   obj-clk = clk_get(pdev-dev, pdata-clk_name);
-   if (IS_ERR(obj-clk))
-   goto err_clk;
-
obj-nr_tlb_entries = pdata-mmu_attr-nr_tlb_entries;
obj-name = pdata-name;
obj-dev = pdev-dev;
@@ 

[PATCH 0/6] omap: iommu: hwmod support and code reorganization

2010-11-05 Thread Omar Ramirez Luna
Boot tested on omap 3430 and 3630, functionality on iva2 only.

Introduced hwmod data and support for omap3 (iva2 mmu  isp mmu) and
omap4 (ducati mmu  tesla mmu).

Minor cleanup due to this changes.

There is an issue (present without patches too):

Doing a cycle of insmod-rmmod to iommu module and then full
insmod of bridgedriver (with all dependencies) causes the next
read of iommu registers to dump an unhandled fault log; this,
because when rmmod of iommu is called it tries to clean the
iommu tables and flush any old entry prior to removing the driver,
however these reads/writes are attempted while the MMU is under
reset and will timeout on the L3 IVA target agent, which will leave
MMU unusable until the proper restore sequence to clear this L3
error is executed.

Fix would be to move page table allocation to iommu get and its
correspondent free to iommu put, however it will fall entirely
under iommu user responsibility, as it needs to clear the mmu
reset bit, before calling iommu functions that read/write into
mmu registers (which should apply only for first boot or on
baseimage reload); trading this restriction in order to keep
the same generic iommu code for all omap iommu devices.

This issue has been seen on omap3 iva2 mmu, same restriction should
apply for tesla mmu.

For discussion: should iommu handle mmu reset source directly?
This register is grouped into an IVA PRM register which handles
sequencer, iva2 mmu and dsp resets. As mentioned iommu handles
cam, iva2 mmu (OMAP3) and tesla, ducati mmu (OMAP4), only tesla
and iva2 should suffer from this restriction and according changes
should be needed to handle both cases on mach-omap2 code. This
also affects hwmod, since, if defined, it tries to read SYSC
registers at boot time when registering the hwmod and causing the
same issue.

Omar Ramirez Luna (6):
  omap: iommu: remove redundant clock usage
  OMAP3: hwmod data: Add mmu for iva2 and isp
  OMAP4: hwmod data: add mmu hwmod for ducati and tesla
  omap: iommu: intial hwmod support
  omap: iommu: hwmod device enable/disable routines
  omap: iommu: code reorganization and cleanup

 arch/arm/mach-omap2/omap-iommu.c   |  168 +---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  103 +
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |  105 +
 arch/arm/plat-omap/include/plat/iommu.h|   19 +++-
 arch/arm/plat-omap/include/plat/omap34xx.h |2 +
 arch/arm/plat-omap/iommu.c |   64 ---
 6 files changed, 299 insertions(+), 162 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 6/6] omap: iommu: code reorganization and cleanup

2010-11-05 Thread Omar Ramirez Luna
Since omap-iommu is now using hwmod, there are structures and
arrays that can be cleaned up to increase the readability of
the code.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/mach-omap2/omap-iommu.c|   95 +++
 arch/arm/plat-omap/include/plat/iommu.h |2 +-
 2 files changed, 34 insertions(+), 63 deletions(-)

diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index 0a76bce..135474b 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -17,53 +17,17 @@
 #include plat/omap_hwmod.h
 #include plat/omap_device.h
 
-struct iommu_device {
-   struct iommu_platform_data pdata;
+static char *omap3_devices[] = {
+   isp,
+   iva2,
+   NULL,
 };
-static struct iommu_device *devices;
-static int num_iommu_devices;
-
-#ifdef CONFIG_ARCH_OMAP3
-static struct iommu_device omap3_devices[] = {
-   {
-   .pdata = {
-   .name = isp,
-   },
-   },
-#if defined(CONFIG_MPU_BRIDGE_IOMMU)
-   {
-   .pdata = {
-   .name = iva2,
-   },
-   },
-#endif
-};
-#define NR_OMAP3_IOMMU_DEVICES ARRAY_SIZE(omap3_devices)
-#else
-#define omap3_devices  NULL
-#define NR_OMAP3_IOMMU_DEVICES 0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-static struct iommu_device omap4_devices[] = {
-   {
-   .pdata = {
-   .name = ducati,
-   },
-   },
-#if defined(CONFIG_MPU_TESLA_IOMMU)
-   {
-   .pdata = {
-   .name = tesla,
-   },
-   },
-#endif
+
+static char *omap4_devices[] = {
+   ducati,
+   tesla,
+   NULL,
 };
-#define NR_OMAP4_IOMMU_DEVICES ARRAY_SIZE(omap4_devices)
-#else
-#define omap4_devices  NULL
-#define NR_OMAP4_IOMMU_DEVICES 0
-#endif
 
 static struct omap_device_pm_latency iommu_latencies[] = {
[0] = {
@@ -73,36 +37,28 @@ static struct omap_device_pm_latency iommu_latencies[] = {
},
 };
 
-static int __init omap_iommu_init(void)
+static int __init omap_iommu_add(char **devices)
 {
int i;
 
-   if (cpu_is_omap34xx()) {
-   devices = omap3_devices;
-   num_iommu_devices = NR_OMAP3_IOMMU_DEVICES;
-   } else if (cpu_is_omap44xx()) {
-   devices = omap4_devices;
-   num_iommu_devices = NR_OMAP4_IOMMU_DEVICES;
-   } else
-   return -ENODEV;
-
-   for (i = 0; i  num_iommu_devices; i++) {
+   for (i = 0; devices[i]; i++) {
struct omap_hwmod *oh;
struct omap_device *od;
+   struct iommu_platform_data pdata;
 
-   oh = omap_hwmod_lookup(devices[i].pdata.name);
+   oh = omap_hwmod_lookup(devices[i]);
if (!oh) {
pr_err(%s: hwmod not found\n, __func__);
return -ENODEV;
}
 
-   devices[i].pdata.mmu_attr =
-   (struct omap_mmu_dev_attr *)oh-dev_attr;
-   devices[i].pdata.device_enable = omap_device_enable;
-   devices[i].pdata.device_disable = omap_device_idle;
+   pdata.name = devices[i];
+   pdata.mmu_attr = (struct omap_mmu_dev_attr *)oh-dev_attr;
+   pdata.device_enable = omap_device_enable;
+   pdata.device_disable = omap_device_idle;
 
od = omap_device_build(omap-iommu, i, oh,
-   devices[i].pdata, sizeof(devices[i].pdata),
+   pdata, sizeof(pdata),
iommu_latencies, ARRAY_SIZE(iommu_latencies),
0);
if (!od) {
@@ -110,8 +66,23 @@ static int __init omap_iommu_init(void)
return -EPERM;
}
}
+
return 0;
 }
+
+static int __init omap_iommu_init(void)
+{
+   int err;
+
+   if (cpu_is_omap34xx())
+   err = omap_iommu_add(omap3_devices);
+   else if (cpu_is_omap44xx())
+   err = omap_iommu_add(omap4_devices);
+   else
+   return -ENODEV;
+
+   return err;
+}
 module_init(omap_iommu_init);
 
 static void __exit omap_iommu_exit(void)
diff --git a/arch/arm/plat-omap/include/plat/iommu.h 
b/arch/arm/plat-omap/include/plat/iommu.h
index fd8ffeb..2205c3c 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -109,7 +109,7 @@ struct omap_mmu_dev_attr {
 };
 
 struct iommu_platform_data {
-   const char *name;
+   char *name;
struct omap_mmu_dev_attr *mmu_attr;
 
int (*device_enable)(struct platform_device *pdev);
-- 
1.7.1

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


Re: [PATCH 0/6] omap: iommu: hwmod support and code reorganization

2010-11-05 Thread Ramirez Luna, Omar
On Fri, Nov 5, 2010 at 8:19 PM, Omar Ramirez Luna omar.rami...@ti.com wrote:
 Boot tested on omap 3430 and 3630, functionality on iva2 only.

I meant functionally tested on iva2 only.

Regards,

Omar
--
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 v2] OMAP1: drop AMS_DELTA_FIQ config option

2010-11-05 Thread Janusz Krzysztofik
This patches removes a config option that was used to select a FIQ 
handler to be build for Amstrad Delta, as required by the on-board serio 
interface driver. Not having any problem reports received since it was 
introduced in 2.6.35, the FIQ handler can now be built and initialized by 
default, thus reqiring no extra config option.

This change was requested by Tony Lindgren, the OMAP subsystem maintainer.

Created and tested against linux-2.6.37-rc1

Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl
---
v1 - v2 changes:
- it does not make sense to split into 2 patches, fold together - requested by 
  Dmitry Torokhov - thanks.

 arch/arm/mach-omap1/Kconfig   |   11 +--
 arch/arm/mach-omap1/Makefile  |4 ++--
 arch/arm/mach-omap1/board-ams-delta.c |2 --
 drivers/input/serio/Kconfig   |1 -
 4 files changed, 3 insertions(+), 15 deletions(-)

--- linux-2.6.37-rc1/arch/arm/mach-omap1/board-ams-delta.c.orig 2010-11-01 
22:41:04.0 +0100
+++ linux-2.6.37-rc1/arch/arm/mach-omap1/board-ams-delta.c  2010-11-04 
21:25:33.0 +0100
@@ -307,9 +307,7 @@ static void __init ams_delta_init(void)
 #endif
platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
 
-#ifdef CONFIG_AMS_DELTA_FIQ
ams_delta_init_fiq();
-#endif
 
omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
 }
--- linux-2.6.37-rc1/arch/arm/mach-omap1/Makefile.orig  2010-11-01 
22:41:04.0 +0100
+++ linux-2.6.37-rc1/arch/arm/mach-omap1/Makefile   2010-11-04 
21:27:45.0 +0100
@@ -39,8 +39,8 @@ obj-$(CONFIG_MACH_OMAP_PALMTE)+= board
 obj-$(CONFIG_MACH_OMAP_PALMZ71)+= board-palmz71.o
 obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)+= board-nokia770.o
-obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o
-obj-$(CONFIG_AMS_DELTA_FIQ)+= ams-delta-fiq.o 
ams-delta-fiq-handler.o
+obj-$(CONFIG_MACH_AMS_DELTA)   += board-ams-delta.o ams-delta-fiq.o \
+  ams-delta-fiq-handler.o
 obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
 obj-$(CONFIG_MACH_HERALD)  += board-htcherald.o
 
--- linux-2.6.37-rc1/arch/arm/mach-omap1/Kconfig.orig   2010-11-01 
22:41:04.0 +0100
+++ linux-2.6.37-rc1/arch/arm/mach-omap1/Kconfig2010-11-04 
21:28:06.0 +0100
@@ -152,20 +152,11 @@ config MACH_NOKIA770
 config MACH_AMS_DELTA
bool Amstrad E3 (Delta)
depends on ARCH_OMAP1  ARCH_OMAP15XX
+   select FIQ
help
  Support for the Amstrad E3 (codename Delta) videophone. Say Y here
  if you have such a device.
 
-config AMS_DELTA_FIQ
-   bool Fast Interrupt Request (FIQ) support for the E3
-   depends on MACH_AMS_DELTA
-   select FIQ
-   help
- Provide a FIQ handler for the E3.
- This allows for fast handling of interrupts generated
- by the clock line of the E3 mailboard (or a PS/2 keyboard)
- connected to the GPIO based external keyboard port.
-
 config MACH_OMAP_GENERIC
bool Generic OMAP board
depends on ARCH_OMAP1  (ARCH_OMAP15XX || ARCH_OMAP16XX)
--- linux-2.6.37-rc1/drivers/input/serio/Kconfig.orig   2010-11-01 
22:41:51.0 +0100
+++ linux-2.6.37-rc1/drivers/input/serio/Kconfig2010-11-04 
21:28:55.0 +0100
@@ -214,7 +214,6 @@ config SERIO_AMS_DELTA
tristate Amstrad Delta (E3) mailboard support
depends on MACH_AMS_DELTA
default y
-   select AMS_DELTA_FIQ
---help---
  Say Y here if you have an E3 and want to use its mailboard,
  or any standard AT keyboard connected to the mailboard port.
--
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