Re: [PATCH 11/11] staging: ti dspbridge: enable driver building

2010-07-04 Thread Felipe Contreras
On Thu, Jun 24, 2010 at 1:41 AM, Greg KH g...@kroah.com wrote:
 The default is always 'n' so you don't need this.

 Also, this enables the driver to be built on x86, which fails horribly,
 and I don't think is what you really want to have happen :)

 So I need some more Kconfig changes here, care to redo just this one
 patch?  I've applied all the others and they will show up in linux-next
 tomorrow.

I fixed all that stuff some time ago:
http://article.gmane.org/gmane.linux.ports.arm.omap/36065

But the patches were ignored.

I might rebase them if nobody beats me to it.

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


[PATCH] staging: ti dspbridge: remove contributor leftovers

2010-07-04 Thread Felipe Contreras
The old history (before git) had these two character ids that never
stood any chance to identify anybody.

Nobody from that list was moved to the good list of contributors, so
let's get rid of it.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 .../staging/tidspbridge/Documentation/CONTRIBUTORS |   37 
 1 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/tidspbridge/Documentation/CONTRIBUTORS 
b/drivers/staging/tidspbridge/Documentation/CONTRIBUTORS
index b40e7a6..86f5787 100644
--- a/drivers/staging/tidspbridge/Documentation/CONTRIBUTORS
+++ b/drivers/staging/tidspbridge/Documentation/CONTRIBUTORS
@@ -43,40 +43,3 @@ Please keep the following list in alphabetical order.
Armando Uribe de Leon
Nischal Varide
Wenbiao Wang
-
-
-
-The following list was taken from file Revision History, if you recognize your
-alias or did any contribution to the project please let us now, so we can
-proper credit your work.
-
-   ag
-   ap
-   cc
-   db
-   dh4
-   dr
-   hp
-   jg
-   kc
-   kln
-   kw
-   ge
-   gv
-   map
-   mf
-   mk
-   mr
-   nn
-   rajesh
-   rg
-   rr
-   rt
-   sb
-   sg
-   sh
-   sp
-   srid
-   swa
-   vp
-   ww
-- 
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 00/13] staging: ti dspbridge: deh rewrite

2010-07-04 Thread Felipe Contreras
Hi,

Investigating the MMU fault corruption issue I found a lot of areas of
improvements of the exception handling code.

Moreover, even though the obvious memory corruption is fixed on kernel side,
there are still some rare cases where corruption in user-space might be
possible if some buffers are still mapped. This came up in a discussion with
Fernando Lugo, and we both agreed on a fix (patch #7).

The rest is mostly reorganization.

(This is basically the same as the old one, but rebased to staging tree)

Felipe Contreras (13):
  staging: ti dspbridge: deh: trivial cleanups
  staging: ti dspbridge: mmufault: trivial cleanups
  staging: ti dspbridge: deh: free dummy page immediately
  staging: ti dspbridge: remove unused code
  staging: ti dspbridge: mmu: add hw_mmu_tlb_flush_all()
  staging: ti dspbridge: deh: ensure only tlb #0 is enabled
  staging: ti dspbridge: deh: refactor in mmu_fault_print_stack()
  staging: ti dspbridge: deh: remove get_info
  staging: ti dspbridge: deh: remove err_info
  staging: ti dspbridge: access deh directly
  staging: ti dspbridge: move mmufault to deh
  staging: ti dspbridge: deh: tidying up
  staging: ti dspbridge: deh: update copyright notice

 drivers/staging/tidspbridge/Makefile   |2 +-
 drivers/staging/tidspbridge/core/_deh.h|2 +-
 drivers/staging/tidspbridge/core/_tiomap.h |6 +-
 drivers/staging/tidspbridge/core/mmu_fault.c   |  139 
 drivers/staging/tidspbridge/core/mmu_fault.h   |   36 --
 drivers/staging/tidspbridge/core/tiomap3430.c  |   17 +-
 drivers/staging/tidspbridge/core/ue_deh.c  |  336 +---
 drivers/staging/tidspbridge/hw/hw_mmu.c|6 +
 drivers/staging/tidspbridge/hw/hw_mmu.h|2 +
 .../staging/tidspbridge/include/dspbridge/dbdefs.h |1 -
 .../tidspbridge/include/dspbridge/dspdefs.h|   75 -
 .../staging/tidspbridge/include/dspbridge/dspdeh.h |   20 +-
 drivers/staging/tidspbridge/pmgr/dev.c |   17 +-
 drivers/staging/tidspbridge/rmgr/node.c|5 +-
 drivers/staging/tidspbridge/rmgr/proc.c|   29 +--
 15 files changed, 184 insertions(+), 509 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/core/mmu_fault.c
 delete mode 100644 drivers/staging/tidspbridge/core/mmu_fault.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 01/13] staging: ti dspbridge: deh: trivial cleanups

2010-07-04 Thread Felipe Contreras
No functional changes.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/ue_deh.c |   72 ++---
 1 files changed, 25 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index 64e9366..ee2d23a 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -52,11 +52,6 @@
 #include dspbridge/io_sm.h
 
 
-static struct hw_mmu_map_attrs_t map_attrs = { HW_LITTLE_ENDIAN,
-   HW_ELEM_SIZE16BIT,
-   HW_MMU_CPUES
-};
-
 static void *dummy_va_addr;
 
 int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
@@ -71,23 +66,20 @@ int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
 *  the base image. */
/* Get Bridge context info. */
dev_get_bridge_context(hdev_obj, hbridge_context);
-   DBC_ASSERT(hbridge_context);
-   dummy_va_addr = NULL;
/* Allocate IO manager object: */
deh_mgr = kzalloc(sizeof(struct deh_mgr), GFP_KERNEL);
if (!deh_mgr) {
status = -ENOMEM;
-   goto leave;
+   goto err;
}
 
/* Create an NTFY object to manage notifications */
deh_mgr-ntfy_obj = kmalloc(sizeof(struct ntfy_object), GFP_KERNEL);
-   if (deh_mgr-ntfy_obj) {
-   ntfy_init(deh_mgr-ntfy_obj);
-   } else {
+   if (!deh_mgr-ntfy_obj) {
status = -ENOMEM;
goto err;
}
+   ntfy_init(deh_mgr-ntfy_obj);
 
/* Create a MMUfault DPC */
tasklet_init(deh_mgr-dpc_tasklet, mmu_fault_dpc, (u32) deh_mgr);
@@ -100,22 +92,17 @@ int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
deh_mgr-err_info.dw_val3 = 0L;
 
/* Install ISR function for DSP MMU fault */
-   if ((request_irq(INT_DSP_MMU_IRQ, mmu_fault_isr, 0,
-   DspBridge\tiommu fault,
-   (void *)deh_mgr)) == 0)
-   status = 0;
-   else
-   status = -EPERM;
+   status = request_irq(INT_DSP_MMU_IRQ, mmu_fault_isr, 0,
+   DspBridge\tiommu fault, deh_mgr);
+   if (status  0)
+   goto err;
 
-err:
-   if (DSP_FAILED(status)) {
-   /* If create failed, cleanup */
-   bridge_deh_destroy(deh_mgr);
-   deh_mgr = NULL;
-   }
-leave:
*ret_deh_mgr = deh_mgr;
+   return 0;
 
+err:
+   bridge_deh_destroy(deh_mgr);
+   *ret_deh_mgr = NULL;
return status;
 }
 
@@ -147,33 +134,32 @@ int bridge_deh_register_notify(struct deh_mgr *deh_mgr, 
u32 event_mask,
u32 notify_type,
struct dsp_notification *hnotification)
 {
-   int status = 0;
-
if (!deh_mgr)
return -EFAULT;
 
if (event_mask)
-   status = ntfy_register(deh_mgr-ntfy_obj, hnotification,
-   event_mask, notify_type);
+   return ntfy_register(deh_mgr-ntfy_obj, hnotification,
+   event_mask, notify_type);
else
-   status = ntfy_unregister(deh_mgr-ntfy_obj, hnotification);
-
-   return status;
+   return ntfy_unregister(deh_mgr-ntfy_obj, hnotification);
 }
 
 void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo)
 {
struct bridge_dev_context *dev_context;
-   int status = 0;
u32 hw_mmu_max_tlb_count = 31;
struct cfg_hostres *resources;
-   hw_status hw_status_obj;
+   struct hw_mmu_map_attrs_t map_attrs = {
+   .endianism = HW_LITTLE_ENDIAN,
+   .element_size = HW_ELEM_SIZE16BIT,
+   .mixed_size = HW_MMU_CPUES,
+   };
 
if (!deh_mgr)
return;
 
dev_info(bridge, %s: device exception\n, __func__);
-   dev_context = (struct bridge_dev_context *)deh_mgr-hbridge_context;
+   dev_context = deh_mgr-hbridge_context;
resources = dev_context-resources;
 
switch (ulEventMask) {
@@ -200,8 +186,6 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
(unsigned int) deh_mgr-err_info.dw_val2,
(unsigned int) fault_addr);
dummy_va_addr = (void*)__get_free_page(GFP_ATOMIC);
-   dev_context = (struct bridge_dev_context *)
-   deh_mgr-hbridge_context;
 
print_dsp_trace_buffer(dev_context);
dump_dl_modules(dev_context);
@@ -216,13 +200,10 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
dev_context-num_tlb_entries =
dev_context-fixed_tlb_entries;
}
-   if (DSP_SUCCEEDED(status)) {
-   hw_status_obj =
-   

[PATCH 02/13] staging: ti dspbridge: mmufault: trivial cleanups

2010-07-04 Thread Felipe Contreras
No functional changes.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/mmu_fault.c |  102 +-
 1 files changed, 34 insertions(+), 68 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/mmu_fault.c 
b/drivers/staging/tidspbridge/core/mmu_fault.c
index 5c0124f..42fe23f 100644
--- a/drivers/staging/tidspbridge/core/mmu_fault.c
+++ b/drivers/staging/tidspbridge/core/mmu_fault.c
@@ -40,11 +40,8 @@
 #include _tiomap.h
 #include mmu_fault.h
 
-static u32 dmmu_event_mask;
 u32 fault_addr;
 
-static bool mmu_check_if_fault(struct bridge_dev_context *dev_context);
-
 /*
  *   mmu_fault_dpc 
  *  Deferred procedure call to handle DSP MMU fault.
@@ -53,9 +50,10 @@ void mmu_fault_dpc(IN unsigned long pRefData)
 {
struct deh_mgr *hdeh_mgr = (struct deh_mgr *)pRefData;
 
-   if (hdeh_mgr)
-   bridge_deh_notify(hdeh_mgr, DSP_MMUFAULT, 0L);
+   if (!hdeh_mgr)
+   return;
 
+   bridge_deh_notify(hdeh_mgr, DSP_MMUFAULT, 0L);
 }
 
 /*
@@ -64,76 +62,44 @@ void mmu_fault_dpc(IN unsigned long pRefData)
  */
 irqreturn_t mmu_fault_isr(int irq, IN void *pRefData)
 {
-   struct deh_mgr *deh_mgr_obj = (struct deh_mgr *)pRefData;
-   struct bridge_dev_context *dev_context;
+   struct deh_mgr *deh_mgr_obj = pRefData;
struct cfg_hostres *resources;
+   u32 dmmu_event_mask;
 
-   DBC_REQUIRE(irq == INT_DSP_MMU_IRQ);
-   DBC_REQUIRE(deh_mgr_obj);
-
-   if (deh_mgr_obj) {
-
-   dev_context =
-   (struct bridge_dev_context *)deh_mgr_obj-hbridge_context;
-
-   resources = dev_context-resources;
+   if (!deh_mgr_obj)
+   return IRQ_HANDLED;
 
-   if (!resources) {
-   dev_dbg(bridge, %s: Failed to get Host Resources\n,
+   resources = deh_mgr_obj-hbridge_context-resources;
+   if (!resources) {
+   dev_dbg(bridge, %s: Failed to get Host Resources\n,
__func__);
-   return IRQ_HANDLED;
-   }
-   if (mmu_check_if_fault(dev_context)) {
-   printk(KERN_INFO * DSPMMU FAULT * IRQStatus 
-  0x%x\n, dmmu_event_mask);
-   printk(KERN_INFO * DSPMMU FAULT * fault_addr 
-  0x%x\n, fault_addr);
-   /*
-* Schedule a DPC directly. In the future, it may be
-* necessary to check if DSP MMU fault is intended for
-* Bridge.
-*/
-   tasklet_schedule(deh_mgr_obj-dpc_tasklet);
-
-   /* Reset err_info structure before use. */
-   deh_mgr_obj-err_info.dw_err_mask = DSP_MMUFAULT;
-   deh_mgr_obj-err_info.dw_val1 = fault_addr  16;
-   deh_mgr_obj-err_info.dw_val2 = fault_addr  0x;
-   deh_mgr_obj-err_info.dw_val3 = 0L;
-   /* Disable the MMU events, else once we clear it will
-* start to raise INTs again */
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-HW_MMU_TRANSLATION_FAULT);
-   } else {
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-HW_MMU_ALL_INTERRUPTS);
-   }
+   return IRQ_HANDLED;
}
-   return IRQ_HANDLED;
-}
 
-/*
- *   mmu_check_if_fault 
- *  Check to see if MMU Fault is valid TLB miss from DSP
- *  Note: This function is called from an ISR
- */
-static bool mmu_check_if_fault(struct bridge_dev_context *dev_context)
-{
-
-   bool ret = false;
-   hw_status hw_status_obj;
-   struct cfg_hostres *resources = dev_context-resources;
-
-   if (!resources) {
-   dev_dbg(bridge, %s: Failed to get Host Resources in\n,
-   __func__);
-   return ret;
-   }
-   hw_status_obj =
-   hw_mmu_event_status(resources-dw_dmmu_base, dmmu_event_mask);
+   hw_mmu_event_status(resources-dw_dmmu_base, dmmu_event_mask);
if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) {
hw_mmu_fault_addr_read(resources-dw_dmmu_base, fault_addr);
-   ret = true;
+   dev_info(bridge, %s: status=0x%x, fault_addr=0x%x\n, __func__,
+   dmmu_event_mask, fault_addr);
+   /*
+* Schedule a DPC directly. In the future, it may be
+* necessary to check if DSP MMU fault is intended for
+* Bridge.
+*/
+   tasklet_schedule(deh_mgr_obj-dpc_tasklet);
+
+   /* Reset err_info structure before use. */
+   

[PATCH 03/13] staging: ti dspbridge: deh: free dummy page immediately

2010-07-04 Thread Felipe Contreras
There's no need to keep it around. DSP should stop trying to access
system memory.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/ue_deh.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index ee2d23a..50868a4 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -52,8 +52,6 @@
 #include dspbridge/io_sm.h
 
 
-static void *dummy_va_addr;
-
 int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
struct dev_object *hdev_obj)
 {
@@ -154,6 +152,7 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
.element_size = HW_ELEM_SIZE16BIT,
.mixed_size = HW_MMU_CPUES,
};
+   void *dummy_va_addr;
 
if (!deh_mgr)
return;
@@ -214,6 +213,9 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
HW_MMU_TRANSLATION_FAULT);
dump_dsp_stack(dev_context);
dsp_clk_disable(DSP_CLK_GPT8);
+
+   hw_mmu_disable(resources-dw_dmmu_base);
+   free_page((unsigned long)dummy_va_addr);
break;
 #ifdef CONFIG_BRIDGE_NTFY_PWRERR
case DSP_PWRERROR:
@@ -276,6 +278,4 @@ int bridge_deh_get_info(struct deh_mgr *deh_mgr,
 
 void bridge_deh_release_dummy_mem(void)
 {
-   free_page((unsigned long)dummy_va_addr);
-   dummy_va_addr = 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 04/13] staging: ti dspbridge: remove unused code

2010-07-04 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/_tiomap.h |6 +-
 drivers/staging/tidspbridge/core/tiomap3430.c  |2 --
 drivers/staging/tidspbridge/core/ue_deh.c  |   17 -
 .../staging/tidspbridge/include/dspbridge/dspdeh.h |1 -
 drivers/staging/tidspbridge/rmgr/proc.c|5 -
 5 files changed, 1 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/_tiomap.h 
b/drivers/staging/tidspbridge/core/_tiomap.h
index bf0164e..b754e49 100644
--- a/drivers/staging/tidspbridge/core/_tiomap.h
+++ b/drivers/staging/tidspbridge/core/_tiomap.h
@@ -339,11 +339,7 @@ struct bridge_dev_context {
 */
/* DMMU TLB entries */
struct bridge_ioctl_extproc atlb_entry[BRDIOCTL_NUMOFMMUTLB];
-   u32 dw_brd_state;   /* Last known board state. */
-   u32 ul_int_mask;/* int mask */
-   u16 io_base;/* Board I/O base */
-   u32 num_tlb_entries;/* DSP MMU TLB entry counter */
-   u32 fixed_tlb_entries;  /* Fixed DSPMMU TLB entry count */
+   u32 dw_brd_state;   /* Last known board state. */
 
/* TC Settings */
bool tc_word_swap_on;   /* Traffic Controller Word Swap */
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index ee9205b..d1fa560 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -837,7 +837,6 @@ static int bridge_dev_create(OUT struct bridge_dev_context
dev_context-atlb_entry[entry_ndx].ul_gpp_pa =
dev_context-atlb_entry[entry_ndx].ul_dsp_va = 0;
}
-   dev_context-num_tlb_entries = 0;
dev_context-dw_dsp_base_addr = (u32) MEM_LINEAR_ADDRESS((void *)
 (pConfig-
  dw_mem_base
@@ -940,7 +939,6 @@ static int bridge_dev_create(OUT struct bridge_dev_context
}
if (DSP_SUCCEEDED(status)) {
dev_context-hdev_obj = hdev_obj;
-   dev_context-ul_int_mask = 0;
/* Store current board state. */
dev_context-dw_brd_state = BRD_STOPPED;
dev_context-resources = resources;
diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index 50868a4..06167ed 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -109,8 +109,6 @@ int bridge_deh_destroy(struct deh_mgr *deh_mgr)
if (!deh_mgr)
return -EFAULT;
 
-   /* Release dummy VA buffer */
-   bridge_deh_release_dummy_mem();
/* If notification object exists, delete it */
if (deh_mgr-ntfy_obj) {
ntfy_delete(deh_mgr-ntfy_obj);
@@ -145,7 +143,6 @@ int bridge_deh_register_notify(struct deh_mgr *deh_mgr, u32 
event_mask,
 void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo)
 {
struct bridge_dev_context *dev_context;
-   u32 hw_mmu_max_tlb_count = 31;
struct cfg_hostres *resources;
struct hw_mmu_map_attrs_t map_attrs = {
.endianism = HW_LITTLE_ENDIAN,
@@ -189,16 +186,6 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
print_dsp_trace_buffer(dev_context);
dump_dl_modules(dev_context);
 
-   /*
-* Reset the dynamic mmu index to fixed count if it exceeds
-* 31. So that the dynmmuindex is always between the range of
-* standard/fixed entries and 31.
-*/
-   if (dev_context-num_tlb_entries 
-   hw_mmu_max_tlb_count) {
-   dev_context-num_tlb_entries =
-   dev_context-fixed_tlb_entries;
-   }
hw_mmu_tlb_add(resources-dw_dmmu_base,
virt_to_phys(dummy_va_addr), fault_addr,
HW_PAGE_SIZE4KB, 1,
@@ -275,7 +262,3 @@ int bridge_deh_get_info(struct deh_mgr *deh_mgr,
 
return 0;
 }
-
-void bridge_deh_release_dummy_mem(void)
-{
-}
diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h 
b/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
index 4394711..af19926 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
@@ -43,5 +43,4 @@ extern int bridge_deh_register_notify(struct deh_mgr *deh_mgr,
 extern void bridge_deh_notify(struct deh_mgr *deh_mgr,
u32 ulEventMask, u32 dwErrInfo);
 
-extern void bridge_deh_release_dummy_mem(void);
 #endif /* DSPDEH_ */
diff --git a/drivers/staging/tidspbridge/rmgr/proc.c 
b/drivers/staging/tidspbridge/rmgr/proc.c
index 

[PATCH 05/13] staging: ti dspbridge: mmu: add hw_mmu_tlb_flush_all()

2010-07-04 Thread Felipe Contreras
So that it can be used in more than one place.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/tiomap3430.c |9 +
 drivers/staging/tidspbridge/hw/hw_mmu.c   |6 ++
 drivers/staging/tidspbridge/hw/hw_mmu.h   |2 ++
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index d1fa560..1000c04 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -73,8 +73,6 @@
 #define PAGES_II_LVL_TABLE   512
 #define PHYS_TO_PAGE(phys)  pfn_to_page((phys)  PAGE_SHIFT)
 
-#define MMU_GFLUSH 0x60
-
 /* Forward Declarations: */
 static int bridge_brd_monitor(struct bridge_dev_context *dev_context);
 static int bridge_brd_read(struct bridge_dev_context *dev_context,
@@ -218,18 +216,13 @@ static struct bridge_drv_interface drv_interface_fxns = {
bridge_msg_set_queue_id,
 };
 
-static inline void tlb_flush_all(const void __iomem *base)
-{
-   __raw_writeb(__raw_readb(base + MMU_GFLUSH) | 1, base + MMU_GFLUSH);
-}
-
 static inline void flush_all(struct bridge_dev_context *dev_context)
 {
if (dev_context-dw_brd_state == BRD_DSP_HIBERNATION ||
dev_context-dw_brd_state == BRD_HIBERNATION)
wake_dsp(dev_context, NULL);
 
-   tlb_flush_all(dev_context-dw_dsp_mmu_base);
+   hw_mmu_tlb_flush_all(dev_context-dw_dsp_mmu_base);
 }
 
 static void bad_page_dump(u32 pa, struct page *pg)
diff --git a/drivers/staging/tidspbridge/hw/hw_mmu.c 
b/drivers/staging/tidspbridge/hw/hw_mmu.c
index 965b659..e593358 100644
--- a/drivers/staging/tidspbridge/hw/hw_mmu.c
+++ b/drivers/staging/tidspbridge/hw/hw_mmu.c
@@ -35,6 +35,7 @@
 #define MMU_SMALL_PAGE_MASK  0xF000
 
 #define MMU_LOAD_TLB   0x0001
+#define MMU_GFLUSH 0x60
 
 /*
  * hw_mmu_page_size_t: Enumerated Type used to specify the MMU Page Size(SLSS)
@@ -585,3 +586,8 @@ static hw_status mmu_set_ram_entry(const void __iomem 
*baseAddress,
return status;
 
 }
+
+void hw_mmu_tlb_flush_all(const void __iomem *base)
+{
+   __raw_writeb(1, base + MMU_GFLUSH);
+}
diff --git a/drivers/staging/tidspbridge/hw/hw_mmu.h 
b/drivers/staging/tidspbridge/hw/hw_mmu.h
index 9b13468..0436974 100644
--- a/drivers/staging/tidspbridge/hw/hw_mmu.h
+++ b/drivers/staging/tidspbridge/hw/hw_mmu.h
@@ -97,6 +97,8 @@ extern hw_status hw_mmu_pte_set(const u32 pg_tbl_va,
 extern hw_status hw_mmu_pte_clear(const u32 pg_tbl_va,
  u32 page_size, u32 virtualAddr);
 
+void hw_mmu_tlb_flush_all(const void __iomem *base);
+
 static inline u32 hw_mmu_pte_addr_l1(u32 L1_base, u32 va)
 {
u32 pte_addr;
-- 
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 06/13] staging: ti dspbridge: deh: ensure only tlb #0 is enabled

2010-07-04 Thread Felipe Contreras
We don't want the DSP to continue writing into other mapped pages, no
matter how unlikely.

Based on extensive discussion with Fernando Guzman Lugo.

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

diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index 06167ed..793e982 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -186,6 +186,14 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
print_dsp_trace_buffer(dev_context);
dump_dl_modules(dev_context);
 
+   /*
+* Before acking the MMU fault, let's make sure MMU can only
+* access entry #0. Then add a new entry so that the DSP OS
+* can continue in order to dump the stack.
+*/
+   hw_mmu_twl_disable(resources-dw_dmmu_base);
+   hw_mmu_tlb_flush_all(resources-dw_dmmu_base);
+
hw_mmu_tlb_add(resources-dw_dmmu_base,
virt_to_phys(dummy_va_addr), fault_addr,
HW_PAGE_SIZE4KB, 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


[PATCH 08/13] staging: ti dspbridge: deh: remove get_info

2010-07-04 Thread Felipe Contreras
Nobody is using it.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/tiomap3430.c  |1 -
 drivers/staging/tidspbridge/core/ue_deh.c  |   15 ---
 .../tidspbridge/include/dspbridge/dspdefs.h|   19 ---
 .../staging/tidspbridge/include/dspbridge/dspdeh.h |3 ---
 drivers/staging/tidspbridge/pmgr/dev.c |2 --
 drivers/staging/tidspbridge/rmgr/proc.c|6 --
 6 files changed, 0 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index 1000c04..ef4abb4 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -199,7 +199,6 @@ static struct bridge_drv_interface drv_interface_fxns = {
bridge_deh_destroy,
bridge_deh_notify,
bridge_deh_register_notify,
-   bridge_deh_get_info,
/* The following IO functions are provided by chnl_io.lib: */
bridge_io_create,
bridge_io_destroy,
diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index 1e506d7..a4940a8 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -262,18 +262,3 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
 */
dsp_wdt_enable(false);
 }
-
-int bridge_deh_get_info(struct deh_mgr *deh_mgr,
-   struct dsp_errorinfo *pErrInfo)
-{
-   if (!deh_mgr)
-   return -EFAULT;
-
-   /* Copy DEH error info structure to PROC error info structure. */
-   pErrInfo-dw_err_mask = deh_mgr-err_info.dw_err_mask;
-   pErrInfo-dw_val1 = deh_mgr-err_info.dw_val1;
-   pErrInfo-dw_val2 = deh_mgr-err_info.dw_val2;
-   pErrInfo-dw_val3 = deh_mgr-err_info.dw_val3;
-
-   return 0;
-}
diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h 
b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h
index 493f62e..49842a2 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h
@@ -775,24 +775,6 @@ typedef int(*fxn_deh_registernotify)
   u32 event_mask, u32 notify_type, struct dsp_notification *hnotification);
 
 /*
- *   bridge_deh_get_info 
- *  Purpose:
- *  Get DSP exception info.
- *  Parameters:
- *  phDehMgr:   Location to store DEH manager on output.
- *  pErrInfo:   Ptr to error info structure.
- *  Returns:
- *  0:Success.
- *  -EPERM:  Creation failed.
- *  Requires:
- *  phDehMgr != NULL;
- *  pErrorInfo != NULL;
- *  Ensures:
- */
-typedef int(*fxn_deh_getinfo) (struct deh_mgr *phDehMgr,
- struct dsp_errorinfo *pErrInfo);
-
-/*
  *   bridge_io_create 
  *  Purpose:
  *  Create an object that manages I/O between CHNL and msg_ctrl.
@@ -1082,7 +1064,6 @@ struct bridge_drv_interface {
fxn_deh_notify pfn_deh_notify;  /* Notify of DSP error */
/* register for deh notif. */
fxn_deh_registernotify pfn_deh_register_notify;
-   fxn_deh_getinfo pfn_deh_get_info;   /* register for deh notif. */
fxn_io_create pfn_io_create;/* Create IO manager */
fxn_io_destroy pfn_io_destroy;  /* Destroy IO manager */
fxn_io_onloaded pfn_io_on_loaded;   /* Notify of program loaded */
diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h 
b/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
index af19926..f2bfd89 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
@@ -32,9 +32,6 @@ extern int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
 
 extern int bridge_deh_destroy(struct deh_mgr *deh_mgr);
 
-extern int bridge_deh_get_info(struct deh_mgr *deh_mgr,
-   struct dsp_errorinfo *pErrInfo);
-
 extern int bridge_deh_register_notify(struct deh_mgr *deh_mgr,
u32 event_mask,
u32 notify_type,
diff --git a/drivers/staging/tidspbridge/pmgr/dev.c 
b/drivers/staging/tidspbridge/pmgr/dev.c
index 50a5d97..353b81a 100644
--- a/drivers/staging/tidspbridge/pmgr/dev.c
+++ b/drivers/staging/tidspbridge/pmgr/dev.c
@@ -1119,7 +1119,6 @@ static void store_interface_fxns(struct 
bridge_drv_interface *drv_fxns,
STORE_FXN(fxn_deh_destroy, pfn_deh_destroy);
STORE_FXN(fxn_deh_notify, pfn_deh_notify);
STORE_FXN(fxn_deh_registernotify, pfn_deh_register_notify);
-   STORE_FXN(fxn_deh_getinfo, pfn_deh_get_info);
STORE_FXN(fxn_io_create, pfn_io_create);
STORE_FXN(fxn_io_destroy, pfn_io_destroy);
STORE_FXN(fxn_io_onloaded, pfn_io_on_loaded);
@@ -1160,7 +1159,6 @@ static void store_interface_fxns(struct 

[PATCH 11/13] staging: ti dspbridge: move mmufault to deh

2010-07-04 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/Makefile |2 +-
 drivers/staging/tidspbridge/core/mmu_fault.c |   98 --
 drivers/staging/tidspbridge/core/mmu_fault.h |   34 -
 drivers/staging/tidspbridge/core/ue_deh.c|   50 +-
 4 files changed, 50 insertions(+), 134 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/core/mmu_fault.c
 delete mode 100644 drivers/staging/tidspbridge/core/mmu_fault.h

diff --git a/drivers/staging/tidspbridge/Makefile 
b/drivers/staging/tidspbridge/Makefile
index 6082ef0..6567172 100644
--- a/drivers/staging/tidspbridge/Makefile
+++ b/drivers/staging/tidspbridge/Makefile
@@ -5,7 +5,7 @@ libservices = services/sync.o services/cfg.o \
services/ntfy.o services/services.o
 libcore = core/chnl_sm.o core/msg_sm.o core/io_sm.o core/tiomap3430.o \
core/tiomap3430_pwr.o core/tiomap_io.o \
-   core/mmu_fault.o core/ue_deh.o core/wdt.o core/dsp-clock.o
+   core/ue_deh.o core/wdt.o core/dsp-clock.o
 libpmgr = pmgr/chnl.o pmgr/io.o pmgr/msg.o pmgr/cod.o pmgr/dev.o pmgr/dspapi.o 
\
pmgr/dmm.o pmgr/cmm.o pmgr/dbll.o
 librmgr = rmgr/dbdcd.o rmgr/disp.o rmgr/drv.o rmgr/mgr.o rmgr/node.o \
diff --git a/drivers/staging/tidspbridge/core/mmu_fault.c 
b/drivers/staging/tidspbridge/core/mmu_fault.c
deleted file mode 100644
index dadfbf5..000
--- a/drivers/staging/tidspbridge/core/mmu_fault.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * mmu_fault.c
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Implements DSP MMU fault handling functions.
- *
- * 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 dspbridge/std.h
-#include dspbridge/dbdefs.h
-
-/*  --- Trace  Debug */
-#include dspbridge/host_os.h
-#include dspbridge/dbc.h
-
-/*  --- OS Adaptation Layer */
-#include dspbridge/drv.h
-
-/*  --- Link Driver */
-#include dspbridge/dspdeh.h
-
-/*  Hardware Abstraction Layer */
-#include hw_defs.h
-#include hw_mmu.h
-
-/*  --- This */
-#include _deh.h
-#include dspbridge/cfg.h
-#include _tiomap.h
-#include mmu_fault.h
-
-/*
- *   mmu_fault_dpc 
- *  Deferred procedure call to handle DSP MMU fault.
- */
-void mmu_fault_dpc(IN unsigned long pRefData)
-{
-   struct deh_mgr *hdeh_mgr = (struct deh_mgr *)pRefData;
-
-   if (!hdeh_mgr)
-   return;
-
-   bridge_deh_notify(hdeh_mgr, DSP_MMUFAULT, 0L);
-}
-
-/*
- *   mmu_fault_isr 
- *  ISR to be triggered by a DSP MMU fault interrupt.
- */
-irqreturn_t mmu_fault_isr(int irq, IN void *pRefData)
-{
-   struct deh_mgr *deh_mgr_obj = pRefData;
-   struct cfg_hostres *resources;
-   u32 dmmu_event_mask;
-
-   if (!deh_mgr_obj)
-   return IRQ_HANDLED;
-
-   resources = deh_mgr_obj-hbridge_context-resources;
-   if (!resources) {
-   dev_dbg(bridge, %s: Failed to get Host Resources\n,
-   __func__);
-   return IRQ_HANDLED;
-   }
-
-   hw_mmu_event_status(resources-dw_dmmu_base, dmmu_event_mask);
-   if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) {
-   hw_mmu_fault_addr_read(resources-dw_dmmu_base, 
deh_mgr_obj-fault_addr);
-   dev_info(bridge, %s: status=0x%x, fault_addr=0x%x\n, __func__,
-   dmmu_event_mask, deh_mgr_obj-fault_addr);
-   /*
-* Schedule a DPC directly. In the future, it may be
-* necessary to check if DSP MMU fault is intended for
-* Bridge.
-*/
-   tasklet_schedule(deh_mgr_obj-dpc_tasklet);
-
-   /* Disable the MMU events, else once we clear it will
-* start to raise INTs again */
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-   HW_MMU_TRANSLATION_FAULT);
-   } else {
-   hw_mmu_event_disable(resources-dw_dmmu_base,
-   HW_MMU_ALL_INTERRUPTS);
-   }
-   return IRQ_HANDLED;
-}
diff --git a/drivers/staging/tidspbridge/core/mmu_fault.h 
b/drivers/staging/tidspbridge/core/mmu_fault.h
deleted file mode 100644
index 537e6e7..000
--- a/drivers/staging/tidspbridge/core/mmu_fault.h
+++ /dev/null

[PATCH 10/13] staging: ti dspbridge: access deh directly

2010-07-04 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/tiomap3430.c  |5 --
 .../tidspbridge/include/dspbridge/dspdefs.h|   56 
 drivers/staging/tidspbridge/pmgr/dev.c |   15 +
 drivers/staging/tidspbridge/rmgr/node.c|5 +-
 drivers/staging/tidspbridge/rmgr/proc.c|   18 +++
 5 files changed, 14 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index ef4abb4..60fca91 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -194,11 +194,6 @@ static struct bridge_drv_interface drv_interface_fxns = {
bridge_chnl_get_mgr_info,
bridge_chnl_idle,
bridge_chnl_register_notify,
-   /* The following DEH functions are provided by tihelen_ue_deh.c */
-   bridge_deh_create,
-   bridge_deh_destroy,
-   bridge_deh_notify,
-   bridge_deh_register_notify,
/* The following IO functions are provided by chnl_io.lib: */
bridge_io_create,
bridge_io_destroy,
diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h 
b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h
index 49842a2..536816b 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h
@@ -724,57 +724,6 @@ typedef int(*fxn_dev_ctrl) (struct bridge_dev_context 
*hDevContext,
 typedef int(*fxn_dev_destroy) (struct bridge_dev_context *hDevContext);
 
 /*
- *   bridge_deh_create 
- *  Purpose:
- *  Create an object that manages DSP exceptions from the GPP.
- *  Parameters:
- *  phDehMgr:   Location to store DEH manager on output.
- *  hdev_obj: Handle to DEV object.
- *  Returns:
- *  0:Success.
- *  -ENOMEM:Memory allocation failure.
- *  -EPERM:  Creation failed.
- *  Requires:
- *  hdev_obj != NULL;
- *  phDehMgr != NULL;
- *  Ensures:
- */
-typedef int(*fxn_deh_create) (OUT struct deh_mgr
-**phDehMgr, struct dev_object *hdev_obj);
-
-/*
- *   bridge_deh_destroy 
- *  Purpose:
- *  Destroy the DEH object.
- *  Parameters:
- *  hdeh_mgr:Handle to DEH manager object.
- *  Returns:
- *  0:Success.
- *  -EPERM:  Destroy failed.
- *  Requires:
- *  hdeh_mgr != NULL;
- *  Ensures:
- */
-typedef int(*fxn_deh_destroy) (struct deh_mgr *hdeh_mgr);
-
-/*
- *   bridge_deh_register_notify 
- *  Purpose:
- *  Register for DEH event notification.
- *  Parameters:
- *  hdeh_mgr:Handle to DEH manager object.
- *  Returns:
- *  0:Success.
- *  -EPERM:  Destroy failed.
- *  Requires:
- *  hdeh_mgr != NULL;
- *  Ensures:
- */
-typedef int(*fxn_deh_registernotify)
- (struct deh_mgr *hdeh_mgr,
-  u32 event_mask, u32 notify_type, struct dsp_notification *hnotification);
-
-/*
  *   bridge_io_create 
  *  Purpose:
  *  Create an object that manages I/O between CHNL and msg_ctrl.
@@ -1059,11 +1008,6 @@ struct bridge_drv_interface {
fxn_chnl_idle pfn_chnl_idle;/* Idle the channel */
/* Register for notif. */
fxn_chnl_registernotify pfn_chnl_register_notify;
-   fxn_deh_create pfn_deh_create;  /* Create DEH manager */
-   fxn_deh_destroy pfn_deh_destroy;/* Destroy DEH manager */
-   fxn_deh_notify pfn_deh_notify;  /* Notify of DSP error */
-   /* register for deh notif. */
-   fxn_deh_registernotify pfn_deh_register_notify;
fxn_io_create pfn_io_create;/* Create IO manager */
fxn_io_destroy pfn_io_destroy;  /* Destroy IO manager */
fxn_io_onloaded pfn_io_on_loaded;   /* Notify of program loaded */
diff --git a/drivers/staging/tidspbridge/pmgr/dev.c 
b/drivers/staging/tidspbridge/pmgr/dev.c
index 353b81a..2c31f31 100644
--- a/drivers/staging/tidspbridge/pmgr/dev.c
+++ b/drivers/staging/tidspbridge/pmgr/dev.c
@@ -48,6 +48,7 @@
 #include dspbridge/io.h
 #include dspbridge/msg.h
 #include dspbridge/cmm.h
+#include dspbridge/dspdeh.h
 
 /*  --- This */
 #include dspbridge/dev.h
@@ -237,8 +238,7 @@ int dev_create_device(OUT struct dev_object **phDevObject,
/* Only create DEH manager if we have an IO manager */
if (DSP_SUCCEEDED(status)) {
/* Instantiate the DEH module */
-   status = (*dev_obj-bridge_interface.pfn_deh_create)
-   (dev_obj-hdeh_mgr, dev_obj);
+   status = bridge_deh_create(dev_obj-hdeh_mgr, dev_obj);
}
/* Create DMM mgr . */
status = dmm_create(dev_obj-dmm_mgr,
@@ -373,8 +373,7 @@ int dev_destroy_device(struct dev_object *hdev_obj)
 
   

[PATCH 09/13] staging: ti dspbridge: deh: remove err_info

2010-07-04 Thread Felipe Contreras
We only use it to pass the MMU fault address.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/_deh.h|2 +-
 drivers/staging/tidspbridge/core/mmu_fault.c   |   11 +-
 drivers/staging/tidspbridge/core/mmu_fault.h   |2 -
 drivers/staging/tidspbridge/core/ue_deh.c  |   34 +++-
 .../staging/tidspbridge/include/dspbridge/dbdefs.h |1 -
 5 files changed, 8 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/_deh.h 
b/drivers/staging/tidspbridge/core/_deh.h
index 8da2212..32b84f3 100644
--- a/drivers/staging/tidspbridge/core/_deh.h
+++ b/drivers/staging/tidspbridge/core/_deh.h
@@ -26,7 +26,7 @@
 struct deh_mgr {
struct bridge_dev_context *hbridge_context; /* Bridge context. */
struct ntfy_object *ntfy_obj;   /* NTFY object */
-   struct dsp_errorinfo err_info;  /* DSP exception info. */
+   u32 fault_addr;
 
/* MMU Fault DPC */
struct tasklet_struct dpc_tasklet;
diff --git a/drivers/staging/tidspbridge/core/mmu_fault.c 
b/drivers/staging/tidspbridge/core/mmu_fault.c
index 42fe23f..dadfbf5 100644
--- a/drivers/staging/tidspbridge/core/mmu_fault.c
+++ b/drivers/staging/tidspbridge/core/mmu_fault.c
@@ -40,8 +40,6 @@
 #include _tiomap.h
 #include mmu_fault.h
 
-u32 fault_addr;
-
 /*
  *   mmu_fault_dpc 
  *  Deferred procedure call to handle DSP MMU fault.
@@ -78,9 +76,9 @@ irqreturn_t mmu_fault_isr(int irq, IN void *pRefData)
 
hw_mmu_event_status(resources-dw_dmmu_base, dmmu_event_mask);
if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) {
-   hw_mmu_fault_addr_read(resources-dw_dmmu_base, fault_addr);
+   hw_mmu_fault_addr_read(resources-dw_dmmu_base, 
deh_mgr_obj-fault_addr);
dev_info(bridge, %s: status=0x%x, fault_addr=0x%x\n, __func__,
-   dmmu_event_mask, fault_addr);
+   dmmu_event_mask, deh_mgr_obj-fault_addr);
/*
 * Schedule a DPC directly. In the future, it may be
 * necessary to check if DSP MMU fault is intended for
@@ -88,11 +86,6 @@ irqreturn_t mmu_fault_isr(int irq, IN void *pRefData)
 */
tasklet_schedule(deh_mgr_obj-dpc_tasklet);
 
-   /* Reset err_info structure before use. */
-   deh_mgr_obj-err_info.dw_err_mask = DSP_MMUFAULT;
-   deh_mgr_obj-err_info.dw_val1 = fault_addr  16;
-   deh_mgr_obj-err_info.dw_val2 = fault_addr  0x;
-   deh_mgr_obj-err_info.dw_val3 = 0L;
/* Disable the MMU events, else once we clear it will
 * start to raise INTs again */
hw_mmu_event_disable(resources-dw_dmmu_base,
diff --git a/drivers/staging/tidspbridge/core/mmu_fault.h 
b/drivers/staging/tidspbridge/core/mmu_fault.h
index 74db489..537e6e7 100644
--- a/drivers/staging/tidspbridge/core/mmu_fault.h
+++ b/drivers/staging/tidspbridge/core/mmu_fault.h
@@ -19,8 +19,6 @@
 #ifndef MMU_FAULT_
 #define MMU_FAULT_
 
-extern u32 fault_addr;
-
 /*
  *   mmu_fault_dpc 
  *  Deferred procedure call to handle DSP MMU fault.
diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index a4940a8..904b837 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -84,10 +84,6 @@ int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
 
/* Fill in context structure */
deh_mgr-hbridge_context = hbridge_context;
-   deh_mgr-err_info.dw_err_mask = 0L;
-   deh_mgr-err_info.dw_val1 = 0L;
-   deh_mgr-err_info.dw_val2 = 0L;
-   deh_mgr-err_info.dw_val3 = 0L;
 
/* Install ISR function for DSP MMU fault */
status = request_irq(INT_DSP_MMU_IRQ, mmu_fault_isr, 0,
@@ -140,7 +136,8 @@ int bridge_deh_register_notify(struct deh_mgr *deh_mgr, u32 
event_mask,
return ntfy_unregister(deh_mgr-ntfy_obj, hnotification);
 }
 
-static void mmu_fault_print_stack(struct bridge_dev_context *dev_context)
+static void mmu_fault_print_stack(struct bridge_dev_context *dev_context,
+   u32 fault_addr)
 {
struct cfg_hostres *resources;
struct hw_mmu_map_attrs_t map_attrs = {
@@ -192,50 +189,29 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
 
switch (ulEventMask) {
case DSP_SYSERROR:
-   /* reset err_info structure before use */
-   deh_mgr-err_info.dw_err_mask = DSP_SYSERROR;
-   deh_mgr-err_info.dw_val1 = 0L;
-   deh_mgr-err_info.dw_val2 = 0L;
-   deh_mgr-err_info.dw_val3 = 0L;
-   deh_mgr-err_info.dw_val1 = dwErrInfo;
dev_err(bridge, %s: %s, err_info = 0x%x\n,
__func__, DSP_SYSERROR, dwErrInfo);

[PATCH 12/13] staging: ti dspbridge: deh: tidying up

2010-07-04 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/_deh.h|1 -
 drivers/staging/tidspbridge/core/ue_deh.c  |  164 +---
 .../staging/tidspbridge/include/dspbridge/dspdeh.h |   15 +-
 3 files changed, 78 insertions(+), 102 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/_deh.h 
b/drivers/staging/tidspbridge/core/_deh.h
index 32b84f3..9fb727b 100644
--- a/drivers/staging/tidspbridge/core/_deh.h
+++ b/drivers/staging/tidspbridge/core/_deh.h
@@ -26,7 +26,6 @@
 struct deh_mgr {
struct bridge_dev_context *hbridge_context; /* Bridge context. */
struct ntfy_object *ntfy_obj;   /* NTFY object */
-   u32 fault_addr;
 
/* MMU Fault DPC */
struct tasklet_struct dpc_tasklet;
diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index 26aec91..ae6ee9f 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -16,78 +16,59 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-/*  --- Host OS */
-#include dspbridge/host_os.h
+#include linux/kernel.h
+#include linux/interrupt.h
+#include plat/dmtimer.h
 
-/*  --- DSP/BIOS Bridge */
-#include dspbridge/std.h
 #include dspbridge/dbdefs.h
-
-/*  --- Trace  Debug */
-#include dspbridge/dbc.h
-
-/*  --- OS Adaptation Layer */
-#include dspbridge/cfg.h
-#include dspbridge/clk.h
-#include dspbridge/ntfy.h
-#include dspbridge/drv.h
-
-/*  --- Link Driver */
 #include dspbridge/dspdeh.h
-
-/*  --- Platform Manager */
 #include dspbridge/dev.h
-#include dspbridge/dspapi.h
-#include dspbridge/wdt.h
-
-/*  Hardware Abstraction Layer */
-#include hw_defs.h
-#include hw_mmu.h
-
-/*  --- This */
 #include _tiomap.h
 #include _deh.h
-#include _tiomap_pwr.h
+
 #include dspbridge/io_sm.h
+#include dspbridge/drv.h
+#include dspbridge/wdt.h
 
+static u32 fault_addr;
 
 static void mmu_fault_dpc(unsigned long data)
 {
-   struct deh_mgr *hdeh_mgr = (void *)data;
+   struct deh_mgr *deh = (void *)data;
 
-   if (!hdeh_mgr)
+   if (!deh)
return;
 
-   bridge_deh_notify(hdeh_mgr, DSP_MMUFAULT, 0);
+   bridge_deh_notify(deh, DSP_MMUFAULT, 0);
 }
 
 static irqreturn_t mmu_fault_isr(int irq, void *data)
 {
-   struct deh_mgr *deh_mgr_obj = data;
+   struct deh_mgr *deh = data;
struct cfg_hostres *resources;
-   u32 dmmu_event_mask;
+   u32 event;
 
-   if (!deh_mgr_obj)
+   if (!deh)
return IRQ_HANDLED;
 
-   resources = deh_mgr_obj-hbridge_context-resources;
+   resources = deh-hbridge_context-resources;
if (!resources) {
dev_dbg(bridge, %s: Failed to get Host Resources\n,
__func__);
return IRQ_HANDLED;
}
 
-   hw_mmu_event_status(resources-dw_dmmu_base, dmmu_event_mask);
-   if (dmmu_event_mask == HW_MMU_TRANSLATION_FAULT) {
-   hw_mmu_fault_addr_read(resources-dw_dmmu_base, 
deh_mgr_obj-fault_addr);
-   dev_info(bridge, %s: status=0x%x, fault_addr=0x%x\n, __func__,
-   dmmu_event_mask, deh_mgr_obj-fault_addr);
+   hw_mmu_event_status(resources-dw_dmmu_base, event);
+   if (event == HW_MMU_TRANSLATION_FAULT) {
+   hw_mmu_fault_addr_read(resources-dw_dmmu_base, fault_addr);
+   dev_dbg(bridge, %s: event=0x%x, fault_addr=0x%x\n, __func__,
+   event, fault_addr);
/*
 * Schedule a DPC directly. In the future, it may be
 * necessary to check if DSP MMU fault is intended for
 * Bridge.
 */
-   tasklet_schedule(deh_mgr_obj-dpc_tasklet);
+   tasklet_schedule(deh-dpc_tasklet);
 
/* Disable the MMU events, else once we clear it will
 * start to raise INTs again */
@@ -100,11 +81,11 @@ static irqreturn_t mmu_fault_isr(int irq, void *data)
return IRQ_HANDLED;
 }
 
-int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
+int bridge_deh_create(struct deh_mgr **ret_deh,
struct dev_object *hdev_obj)
 {
-   int status = 0;
-   struct deh_mgr *deh_mgr;
+   int status;
+   struct deh_mgr *deh;
struct bridge_dev_context *hbridge_context = NULL;
 
/*  Message manager will be created when a file is loaded, since
@@ -113,79 +94,78 @@ int bridge_deh_create(struct deh_mgr **ret_deh_mgr,
/* Get Bridge context info. */
dev_get_bridge_context(hdev_obj, hbridge_context);
/* Allocate IO manager object: */
-   

[PATCH 13/13] staging: ti dspbridge: deh: update copyright notice

2010-07-04 Thread Felipe Contreras
Add myself... git blame seems to agree :)

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/_deh.h|1 +
 drivers/staging/tidspbridge/core/ue_deh.c  |1 +
 .../staging/tidspbridge/include/dspbridge/dspdeh.h |1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/_deh.h 
b/drivers/staging/tidspbridge/core/_deh.h
index 9fb727b..16723cd 100644
--- a/drivers/staging/tidspbridge/core/_deh.h
+++ b/drivers/staging/tidspbridge/core/_deh.h
@@ -6,6 +6,7 @@
  * Private header for DEH module.
  *
  * Copyright (C) 2005-2006 Texas Instruments, Inc.
+ * Copyright (C) 2010 Felipe Contreras
  *
  * 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
diff --git a/drivers/staging/tidspbridge/core/ue_deh.c 
b/drivers/staging/tidspbridge/core/ue_deh.c
index ae6ee9f..f73604f 100644
--- a/drivers/staging/tidspbridge/core/ue_deh.c
+++ b/drivers/staging/tidspbridge/core/ue_deh.c
@@ -6,6 +6,7 @@
  * Implements upper edge DSP exception handling (DEH) functions.
  *
  * Copyright (C) 2005-2006 Texas Instruments, Inc.
+ * Copyright (C) 2010 Felipe Contreras
  *
  * 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
diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h 
b/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
index eca56a5..d258ab6 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/dspdeh.h
@@ -10,6 +10,7 @@
  *   Function comment headers reside with the function typedefs in dspdefs.h.
  *
  * Copyright (C) 2005-2006 Texas Instruments, Inc.
+ * Copyright (C) 2010 Felipe Contreras
  *
  * 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
-- 
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 1/5] omap: OMAP_DSP is not in mainline, remove it

2010-07-04 Thread Felipe Contreras
Cc: Tony Lindgren t...@atomide.com
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 arch/arm/plat-omap/devices.c |   62 --
 1 files changed, 0 insertions(+), 62 deletions(-)

diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 95677d1..a3997ec 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -31,67 +31,6 @@
 #include plat/dsp_common.h
 #include plat/omap44xx.h
 
-#ifdefined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
-
-static struct dsp_platform_data dsp_pdata = {
-   .kdev_list = LIST_HEAD_INIT(dsp_pdata.kdev_list),
-};
-
-static struct resource omap_dsp_resources[] = {
-   {
-   .name   = dsp_mmu,
-   .start  = -1,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static struct platform_device omap_dsp_device = {
-   .name   = dsp,
-   .id = -1,
-   .num_resources  = ARRAY_SIZE(omap_dsp_resources),
-   .resource   = omap_dsp_resources,
-   .dev = {
-   .platform_data = dsp_pdata,
-   },
-};
-
-static inline void omap_init_dsp(void)
-{
-   struct resource *res;
-   int irq;
-
-   if (cpu_is_omap15xx())
-   irq = INT_1510_DSP_MMU;
-   else if (cpu_is_omap16xx())
-   irq = INT_1610_DSP_MMU;
-   else if (cpu_is_omap24xx())
-   irq = INT_24XX_DSP_MMU;
-
-   res = platform_get_resource_byname(omap_dsp_device,
-  IORESOURCE_IRQ, dsp_mmu);
-   res-start = irq;
-
-   platform_device_register(omap_dsp_device);
-}
-
-int dsp_kfunc_device_register(struct dsp_kfunc_device *kdev)
-{
-   static DEFINE_MUTEX(dsp_pdata_lock);
-
-   spin_lock_init(kdev-lock);
-
-   mutex_lock(dsp_pdata_lock);
-   list_add_tail(kdev-entry, dsp_pdata.kdev_list);
-   mutex_unlock(dsp_pdata_lock);
-
-   return 0;
-}
-EXPORT_SYMBOL(dsp_kfunc_device_register);
-
-#else
-static inline void omap_init_dsp(void) { }
-#endif /* CONFIG_OMAP_DSP */
-
 /*-*/
 #ifdefined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
 
@@ -419,7 +358,6 @@ static int __init omap_init_devices(void)
/* please keep these calls, and their implementations above,
 * in alphabetical order so they're easier to sort through.
 */
-   omap_init_dsp();
omap_init_kp();
omap_init_rng();
omap_init_mcpdm();
-- 
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/5] staging: ti dspbridge: prefix configs with TIDSPBRIDGE

2010-07-04 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/Kconfig|   18 +-
 drivers/staging/tidspbridge/core/io_sm.c   |2 +-
 drivers/staging/tidspbridge/core/tiomap3430_pwr.c  |   30 +-
 drivers/staging/tidspbridge/core/tiomap_io.c   |4 +-
 drivers/staging/tidspbridge/core/ue_deh.c  |2 +-
 drivers/staging/tidspbridge/core/wdt.c |4 +-
 .../tidspbridge/include/dspbridge/_chnl_sm.h   |2 +-
 .../staging/tidspbridge/include/dspbridge/dbc.h|2 +-
 .../staging/tidspbridge/include/dspbridge/drv.h|2 +-
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |2 +-
 drivers/staging/tidspbridge/rmgr/drv.c |2 +-
 drivers/staging/tidspbridge/rmgr/drv_interface.c   |   32 ++--
 drivers/staging/tidspbridge/rmgr/node.c|6 ++--
 drivers/staging/tidspbridge/rmgr/proc.c|8 ++--
 14 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/tidspbridge/Kconfig 
b/drivers/staging/tidspbridge/Kconfig
index 45372cd..6ce443a 100644
--- a/drivers/staging/tidspbridge/Kconfig
+++ b/drivers/staging/tidspbridge/Kconfig
@@ -14,7 +14,7 @@ menuconfig TIDSPBRIDGE
 
  This driver depends on OMAP Mailbox (OMAP_MBOX_FWK).
 
-config BRIDGE_DVFS
+config TIDSPBRIDGE_DVFS
bool Enable Bridge Dynamic Voltage and Frequency Scaling (DVFS)
depends on TIDSPBRIDGE  OMAP_PM_SRF  CPU_FREQ
default n
@@ -24,7 +24,7 @@ config BRIDGE_DVFS
  performance and power consumption to the current processing
  requirements.
 
-config BRIDGE_MEMPOOL_SIZE
+config TIDSPBRIDGE_MEMPOOL_SIZE
hex Physical memory pool size (Byte)
depends on TIDSPBRIDGE
default 0x60
@@ -32,20 +32,20 @@ config BRIDGE_MEMPOOL_SIZE
  Allocate specified size of memory at booting time to avoid allocation
  failure under heavy memory fragmentation after some use time.
 
-config BRIDGE_DEBUG
+config TIDSPBRIDGE_DEBUG
bool DSP Bridge Debug Support
depends on TIDSPBRIDGE
help
  Say Y to enable Bridge debugging capabilities
 
-config BRIDGE_RECOVERY
+config TIDSPBRIDGE_RECOVERY
bool DSP Recovery Support
depends on TIDSPBRIDGE
help
  In case of DSP fatal error, BRIDGE driver will try to
  recover itself.
 
-config BRIDGE_CACHE_LINE_CHECK
+config TIDSPBRIDGE_CACHE_LINE_CHECK
bool Check buffers to be 128 byte aligned
depends on TIDSPBRIDGE
default n
@@ -59,7 +59,7 @@ config BRIDGE_CACHE_LINE_CHECK
  This can lead to heap corruption. Say Y, to enforce the check for 128
  byte alignment, buffers failing this check will be rejected.
 
-config BRIDGE_WDT3
+config TIDSPBRIDGE_WDT3
bool Enable WDT3 interruptions
depends on TIDSPBRIDGE
default n
@@ -68,9 +68,9 @@ config BRIDGE_WDT3
  charge of refreshing the timer before overflow, if the DSP hangs MPU
  will caught the interrupt and try to recover DSP.
 
-config WDT_TIMEOUT
+config TIDSPBRIDGE_WDT_TIMEOUT
int DSP watchdog timer timeout (in secs)
-   depends on BRIDGE_WDT3
+   depends on TIDSPBRIDGE_WDT3
default 5
help
   Watchdog timer timeout value, after that time if the watchdog timer
@@ -79,7 +79,7 @@ config WDT_TIMEOUT
 comment Bridge Notifications
depends on TIDSPBRIDGE
 
-config BRIDGE_NTFY_PWRERR
+config TIDSPBRIDGE_NTFY_PWRERR
bool Notify DSP Power Error
depends on TIDSPBRIDGE
help
diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index 7fb840d..ee33abb 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -1731,7 +1731,7 @@ void io_intr_dsp2(IN struct io_mgr *pio_mgr, IN u16 
mb_val)
  */
 int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, void *pargs)
 {
-#ifdef CONFIG_BRIDGE_DVFS
+#ifdef CONFIG_TIDSPBRIDGE_DVFS
u32 i;
struct dspbridge_platform_data *pdata =
omap_dspbridge_dev-dev.platform_data;
diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c 
b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
index 00ebc0b..5df9421 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
@@ -52,7 +52,7 @@
 int handle_constraints_set(struct bridge_dev_context *dev_context,
  IN void *pargs)
 {
-#ifdef CONFIG_BRIDGE_DVFS
+#ifdef CONFIG_TIDSPBRIDGE_DVFS
u32 *constraint_val;
struct dspbridge_platform_data *pdata =
omap_dspbridge_dev-dev.platform_data;
@@ -65,7 +65,7 @@ int handle_constraints_set(struct bridge_dev_context 
*dev_context,
/* Set the new opp value */
if (pdata-dsp_set_min_opp)
(*pdata-dsp_set_min_opp) ((u32) *(constraint_val + 1));

[PATCH 4/5] staging: ti dspbridge: use _DEBUG for debug trace

2010-07-04 Thread Felipe Contreras
Obviously nobody was using DSP_TRACEBUF_DISABLED, since it wasn't even
standarized between TRACEBUF and TRACE_BUF.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/core/io_sm.c   |   16 
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index ee33abb..8909c41 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -114,7 +114,7 @@ struct io_mgr {
struct mgr_processorextinfo ext_proc_info;
struct cmm_object *hcmm_mgr;/* Shared Mem Mngr */
struct work_struct io_workq;/* workqueue */
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
u32 ul_trace_buffer_begin;  /* Trace message start address */
u32 ul_trace_buffer_end;/* Trace message end address */
u32 ul_trace_buffer_current;/* Trace message current address */
@@ -210,7 +210,7 @@ int bridge_io_create(OUT struct io_mgr **phIOMgr,
}
 
/* Initialize chnl_mgr object */
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
pio_mgr-pmsg = NULL;
 #endif
pio_mgr-hchnl_mgr = hchnl_mgr;
@@ -265,7 +265,7 @@ int bridge_io_destroy(struct io_mgr *hio_mgr)
/* Free IO DPC object */
tasklet_kill(hio_mgr-dpc_tasklet);
 
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
kfree(hio_mgr-pmsg);
 #endif
dsp_wdt_exit();
@@ -407,7 +407,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = -EFAULT;
}
if (DSP_SUCCEEDED(status)) {
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
status =
cod_get_sym_value(cod_man, DSP_TRACESEC_END, shm0_end);
 #else
@@ -752,7 +752,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
hmsg_mgr-max_msgs);
memset((void *)hio_mgr-shared_mem, 0, sizeof(struct shm));
 
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
/* Get the start address of trace buffer */
status = cod_get_sym_value(cod_man, SYS_PUTCBEG,
   hio_mgr-ul_trace_buffer_begin);
@@ -949,7 +949,7 @@ void io_dpc(IN OUT unsigned long pRefData)
(pio_mgr-intr_val  DEH_LIMIT)) {
/* Notify DSP/BIOS exception */
if (hdeh_mgr) {
-#ifndef DSP_TRACE_BUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
print_dsp_debug_trace(pio_mgr);
 #endif
bridge_deh_notify(hdeh_mgr, DSP_SYSERROR,
@@ -961,7 +961,7 @@ void io_dpc(IN OUT unsigned long pRefData)
if (msg_mgr_obj)
io_dispatch_msg(pio_mgr, msg_mgr_obj);
 #endif
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
if (pio_mgr-intr_val  MBX_DBG_SYSPRINTF) {
/* Notify DSP Trace message */
print_dsp_debug_trace(pio_mgr);
@@ -1810,7 +1810,7 @@ int bridge_io_get_proc_load(IN struct io_mgr *hio_mgr,
return 0;
 }
 
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
 void print_dsp_debug_trace(struct io_mgr *hio_mgr)
 {
u32 ul_new_message_length = 0, ul_gpp_cur_pointer;
diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h 
b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h
index c3557ef..6e67f10 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h
@@ -302,7 +302,7 @@ int dump_dsp_stack(struct bridge_dev_context 
*bridge_context);
 
 void dump_dl_modules(struct bridge_dev_context *bridge_context);
 
-#ifndef DSP_TRACEBUF_DISABLED
+#ifdef CONFIG_TIDSPBRIDGE_DEBUG
 void print_dsp_debug_trace(struct io_mgr *hio_mgr);
 #endif
 
-- 
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 5/5] staging: ti dspbridge: add _BACKTRACE config

2010-07-04 Thread Felipe Contreras
We only want this code when testing.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 drivers/staging/tidspbridge/Kconfig|7 +
 drivers/staging/tidspbridge/core/io_sm.c   |   26 ++-
 drivers/staging/tidspbridge/core/ue_deh.c  |6 
 drivers/staging/tidspbridge/gen/gh.c   |2 +
 .../staging/tidspbridge/include/dspbridge/dbll.h   |2 +
 drivers/staging/tidspbridge/include/dspbridge/gh.h |2 +
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |4 ++-
 .../staging/tidspbridge/include/dspbridge/nldr.h   |2 +
 .../staging/tidspbridge/include/dspbridge/node.h   |2 +
 drivers/staging/tidspbridge/pmgr/dbll.c|2 +
 drivers/staging/tidspbridge/rmgr/nldr.c|2 +
 drivers/staging/tidspbridge/rmgr/node.c|3 +-
 12 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/tidspbridge/Kconfig 
b/drivers/staging/tidspbridge/Kconfig
index 4d63b66..93de4f2 100644
--- a/drivers/staging/tidspbridge/Kconfig
+++ b/drivers/staging/tidspbridge/Kconfig
@@ -81,3 +81,10 @@ config TIDSPBRIDGE_NTFY_PWRERR
  Enable notifications to registered clients on the event of power 
errror
  trying to suspend bridge driver. Say Y, to signal this event as a 
fatal
  error, this will require a bridge restart to recover.
+
+config TIDSPBRIDGE_BACKTRACE
+   bool Dump backtraces on fatal errors
+   depends on TIDSPBRIDGE
+   help
+ Enable useful information to backtrace fatal errors. Say Y if you
+ want to dump information for testing purposes.
diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index 8909c41..1503968 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -114,7 +114,7 @@ struct io_mgr {
struct mgr_processorextinfo ext_proc_info;
struct cmm_object *hcmm_mgr;/* Shared Mem Mngr */
struct work_struct io_workq;/* workqueue */
-#ifdef CONFIG_TIDSPBRIDGE_DEBUG
+#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
u32 ul_trace_buffer_begin;  /* Trace message start address */
u32 ul_trace_buffer_end;/* Trace message end address */
u32 ul_trace_buffer_current;/* Trace message current address */
@@ -210,7 +210,7 @@ int bridge_io_create(OUT struct io_mgr **phIOMgr,
}
 
/* Initialize chnl_mgr object */
-#ifdef CONFIG_TIDSPBRIDGE_DEBUG
+#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
pio_mgr-pmsg = NULL;
 #endif
pio_mgr-hchnl_mgr = hchnl_mgr;
@@ -265,7 +265,7 @@ int bridge_io_destroy(struct io_mgr *hio_mgr)
/* Free IO DPC object */
tasklet_kill(hio_mgr-dpc_tasklet);
 
-#ifdef CONFIG_TIDSPBRIDGE_DEBUG
+#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
kfree(hio_mgr-pmsg);
 #endif
dsp_wdt_exit();
@@ -407,7 +407,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = -EFAULT;
}
if (DSP_SUCCEEDED(status)) {
-#ifdef CONFIG_TIDSPBRIDGE_DEBUG
+#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
status =
cod_get_sym_value(cod_man, DSP_TRACESEC_END, shm0_end);
 #else
@@ -752,7 +752,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr)
hmsg_mgr-max_msgs);
memset((void *)hio_mgr-shared_mem, 0, sizeof(struct shm));
 
-#ifdef CONFIG_TIDSPBRIDGE_DEBUG
+#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
/* Get the start address of trace buffer */
status = cod_get_sym_value(cod_man, SYS_PUTCBEG,
   hio_mgr-ul_trace_buffer_begin);
@@ -949,7 +949,7 @@ void io_dpc(IN OUT unsigned long pRefData)
(pio_mgr-intr_val  DEH_LIMIT)) {
/* Notify DSP/BIOS exception */
if (hdeh_mgr) {
-#ifdef CONFIG_TIDSPBRIDGE_DEBUG
+#ifdef CONFIG_TIDSPBRIDGE_BACKTRACE
print_dsp_debug_trace(pio_mgr);
 #endif
bridge_deh_notify(hdeh_mgr, DSP_SYSERROR,
@@ -1810,7 +1810,12 @@ int bridge_io_get_proc_load(IN struct io_mgr *hio_mgr,
return 0;
 }
 
-#ifdef CONFIG_TIDSPBRIDGE_DEBUG
+void io_sm_init(void)
+{
+   /* Do nothing */
+}
+
+#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG)
 void print_dsp_debug_trace(struct io_mgr *hio_mgr)
 {
u32 ul_new_message_length = 0, ul_gpp_cur_pointer;
@@ -1871,6 +1876,7 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr)
 }
 #endif
 
+#ifdef CONFIG_TIDSPBRIDGE_BACKTRACE
 /*
  *   print_dsp_trace_buffer 
  *  Prints the trace buffer returned from the DSP (if DBG_Trace is 
enabled).
@@ -2045,10 +2051,6 @@ 

Re: [RFC 1/6] omap: add iva2 hwmod support to omap3

2010-07-04 Thread Ohad Ben-Cohen
On Fri, Jul 2, 2010 at 8:43 AM, Cousson, Benoit b-cous...@ti.com wrote:
 On 7/2/2010 12:23 AM, Ohad Ben-Cohen wrote:
 From: Ohad Ben-Cohenoh...@ti.com

 Add preliminary iva2 hwmod support to omap3.
 We do not include iva2_clk; that will be part of a separate
 hwmod, which will be controlled by iommu.

 I think Kevin already sent a hwmod for IVA2... one week ago:


Thanks. I somehow missed the bulk of those patches.
I will of course rebase omap3 remoteproc on top of that now.



 [PATCH 13/13] OMAP3: hwmod data: add data for OMAP3 IVA2

 Signed-off-by: Ohad Ben-Cohenoh...@ti.com
 Signed-off-by: Hari Kanigerih-kanige...@ti.com
 ---
  arch/arm/mach-omap2/omap_hwmod_34xx.h        |   23 +++
  arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 +
  2 files changed, 24 insertions(+), 0 deletions(-)

 diff --git a/arch/arm/mach-omap2/omap_hwmod_34xx.h 
 b/arch/arm/mach-omap2/omap_hwmod_34xx.h
 index b6076b9..d363a95 100644
 --- a/arch/arm/mach-omap2/omap_hwmod_34xx.h
 +++ b/arch/arm/mach-omap2/omap_hwmod_34xx.h
 @@ -22,6 +22,7 @@
  #include prm-regbits-34xx.h

  static struct omap_hwmod omap34xx_mpu_hwmod;
 +static struct omap_hwmod omap34xx_iva2_hwmod;
  static struct omap_hwmod omap34xx_l3_hwmod;
  static struct omap_hwmod omap34xx_l4_core_hwmod;
  static struct omap_hwmod omap34xx_l4_per_hwmod;
 @@ -47,9 +48,17 @@ static struct omap_hwmod_ocp_if omap34xx_mpu__l3 = {
        .user   = OCP_USER_MPU,
  };

 +/* IVA2 -  L3 interface */
 +static struct omap_hwmod_ocp_if omap34xx_iva2__l3 = {
 +       .master =omap34xx_iva2_hwmod,
 +       .slave  =omap34xx_l3_hwmod,
 +       .user   = OCP_USER_IVA2,
 +};
 +
  /* Slave interfaces on the L3 interconnect */
  static struct omap_hwmod_ocp_if *omap34xx_l3_slaves[] = {
        omap34xx_mpu__l3,
 +       omap34xx_iva2__l3,
  };

  /* Master interfaces on the L3 interconnect */
 @@ -150,12 +159,26 @@ static struct omap_hwmod omap34xx_mpu_hwmod = {
        .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  };

 +/* Master interfaces on the IVA2 device */
 +static struct omap_hwmod_ocp_if *omap34xx_iva2_masters[] = {
 +       omap34xx_iva2__l3,
 +};
 +
 +/* IVA2 */
 +static struct omap_hwmod omap34xx_iva2_hwmod = {
 +       .name           = iva2_hwmod,

 Should be iva only.

 +       .masters        = omap34xx_iva2_masters,
 +       .masters_cnt    = ARRAY_SIZE(omap34xx_iva2_masters),
 +       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 +};
 +
  static __initdata struct omap_hwmod *omap34xx_hwmods[] = {
        omap34xx_l3_hwmod,
        omap34xx_l4_core_hwmod,
        omap34xx_l4_per_hwmod,
        omap34xx_l4_wkup_hwmod,
        omap34xx_mpu_hwmod,
 +       omap34xx_iva2_hwmod,
        NULL,
  };

 diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
 b/arch/arm/plat-omap/include/plat/omap_hwmod.h
 index 3393325..5e64992 100644
 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
 +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
 @@ -160,6 +160,7 @@ struct omap_hwmod_addr_space {
   */
  #define OCP_USER_MPU                  (1  0)
  #define OCP_USER_SDMA                 (1  1)
 +#define OCP_USER_IVA2                  (1  2)

 Are you going to use that information somewhere?
 In that case, you should populate the address space view from the DSP.

 Benoit


  /* omap_hwmod_ocp_if.flags bits */
  #define OCPIF_HAS_IDLEST              (1  0)

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


linux-next: manual merge of the omap tree with the arm tree

2010-07-04 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the omap tree got a conflict in
arch/arm/kernel/entry-armv.S between commit
df0698be14c6683606d5df2d83e3ae40f85ed0d9 (ARM: stack protector: change
the canary value per task) from the arm tree and commit
4481d0c7d25c9de9a3986c8b4c52389ca8bbf929 (arm: Replace
CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6) from the omap
tree.

Just context changes (I think).  I fixed it up (see below) and can carry
the fix as necessary.
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc arch/arm/kernel/entry-armv.S
index 2d14081,a6cfb17..000
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@@ -739,17 -740,7 +740,12 @@@ ENTRY(__switch_to
  #ifdef CONFIG_MMU
ldr r6, [r2, #TI_CPU_DOMAIN]
  #endif
- #if defined(CONFIG_HAS_TLS_REG)
-   mcr p15, 0, r3, c13, c0, 3  @ set TLS register
- #elif !defined(CONFIG_TLS_REG_EMUL)
-   mov r4, #0x0fff
-   str r3, [r4, #-15]  @ TLS val at 0x0ff0
- #endif
+   set_tls r3, r4, r5
 +#if defined(CONFIG_CC_STACKPROTECTOR)  !defined(CONFIG_SMP)
 +  ldr r7, [r2, #TI_TASK]
 +  ldr r8, =__stack_chk_guard
 +  ldr r7, [r7, #TSK_STACK_CANARY]
 +#endif
  #ifdef CONFIG_MMU
mcr p15, 0, r6, c3, c0, 0   @ Set domain register
  #endif
--
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: linux-next: manual merge of the omap tree with the arm tree

2010-07-04 Thread Nicolas Pitre
On Mon, 5 Jul 2010, Stephen Rothwell wrote:

 Hi all,
 
 Today's linux-next merge of the omap tree got a conflict in
 arch/arm/kernel/entry-armv.S between commit
 df0698be14c6683606d5df2d83e3ae40f85ed0d9 (ARM: stack protector: change
 the canary value per task) from the arm tree and commit
 4481d0c7d25c9de9a3986c8b4c52389ca8bbf929 (arm: Replace
 CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6) from the omap
 tree.
 
 Just context changes (I think).  I fixed it up (see below) and can carry
 the fix as necessary.

Yes, the fix is fine.  If you can carry it until either of those is 
merged upstream that would be great.



 -- 
 Cheers,
 Stephen Rothwells...@canb.auug.org.au
 
 diff --cc arch/arm/kernel/entry-armv.S
 index 2d14081,a6cfb17..000
 --- a/arch/arm/kernel/entry-armv.S
 +++ b/arch/arm/kernel/entry-armv.S
 @@@ -739,17 -740,7 +740,12 @@@ ENTRY(__switch_to
   #ifdef CONFIG_MMU
   ldr r6, [r2, #TI_CPU_DOMAIN]
   #endif
 - #if defined(CONFIG_HAS_TLS_REG)
 - mcr p15, 0, r3, c13, c0, 3  @ set TLS register
 - #elif !defined(CONFIG_TLS_REG_EMUL)
 - mov r4, #0x0fff
 - str r3, [r4, #-15]  @ TLS val at 0x0ff0
 - #endif
 + set_tls r3, r4, r5
  +#if defined(CONFIG_CC_STACKPROTECTOR)  !defined(CONFIG_SMP)
  +ldr r7, [r2, #TI_TASK]
  +ldr r8, =__stack_chk_guard
  +ldr r7, [r7, #TSK_STACK_CANARY]
  +#endif
   #ifdef CONFIG_MMU
   mcr p15, 0, r6, c3, c0, 0   @ Set domain register
   #endif
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 
--
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