linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] staging: tidspbridge fixes for 3.7
@ 2012-10-24 22:09 Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 1/6] staging: tidspbridge: request the right irq for mmu Omar Ramirez Luna
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Victor Manuel Jaquez Leal, devel, linux-kernel, Omar Ramirez Luna

With 3.7-rc1 changes:

- New irq numbering in OMAP3 broke the driver request for a mmu irq,
  until this is migrated to the common iommu framework we can only
  hardcode the new number.
- _raw_* accessors changed a type of one of their parameters with patch
  "195bbca ARM: 7500/1: io: avoid writeback addressing modes for
  __raw_ accessors", so the build system was filled with warnings from
  the old parameter usage.

Omar Ramirez Luna (6):
  staging: tidspbridge: request the right irq for mmu
  staging: tidspbridge: drop const from custom mmu implementation
  staging: tidspbridge: change type to __iomem for per and core
    addresses
  staging: tidspbridge: ioremap dsp sync addr
  staging: tidspbridge: ioremap physical address of the stack segment
    in shm
  staging: tidspbridge: delete unused mmu functions

 drivers/staging/tidspbridge/core/tiomap3430.c      |   37 +++++--
 drivers/staging/tidspbridge/hw/hw_mmu.c            |  115 ++++----------------
 drivers/staging/tidspbridge/hw/hw_mmu.h            |   31 +++---
 .../tidspbridge/include/dspbridge/cfgdefs.h        |    4 +-
 .../tidspbridge/include/dspbridge/host_os.h        |    4 +-
 drivers/staging/tidspbridge/rmgr/drv.c             |    8 +-
 drivers/staging/tidspbridge/rmgr/node.c            |   21 +++-
 7 files changed, 83 insertions(+), 137 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/6] staging: tidspbridge: request the right irq for mmu
  2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
@ 2012-10-24 22:09 ` Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 2/6] staging: tidspbridge: drop const from custom mmu implementation Omar Ramirez Luna
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Victor Manuel Jaquez Leal, devel, linux-kernel, Omar Ramirez Luna

Requested irq for mmu is currently conflicting with a DMA irq
due to recent changes to irq header files, now the offset for the
start of the interrupt controller numbering has changed.

This should be removed during a future migration to omap-iommu,
for now it is hardcoded.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
---

Intended for 3.7 due to code changes during rc1.

 .../tidspbridge/include/dspbridge/host_os.h        |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tidspbridge/include/dspbridge/host_os.h b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
index ed00d3d..5e2f4d8 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/host_os.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
@@ -47,8 +47,8 @@
 #include <asm/cacheflush.h>
 #include <linux/dma-mapping.h>
 
-/* TODO -- Remove, once BP defines them */
-#define INT_DSP_MMU_IRQ        28
+/* TODO -- Remove, once omap-iommu is used */
+#define INT_DSP_MMU_IRQ        (28 + NR_IRQS)
 
 #define PRCM_VDD1 1
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/6] staging: tidspbridge: drop const from custom mmu implementation
  2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 1/6] staging: tidspbridge: request the right irq for mmu Omar Ramirez Luna
@ 2012-10-24 22:09 ` Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 3/6] staging: tidspbridge: change type to __iomem for per and core addresses Omar Ramirez Luna
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Victor Manuel Jaquez Leal, devel, linux-kernel, Omar Ramirez Luna

Custom mmu functions receive a 'const void __iomem *', all the
callers pass a 'void __iomem *', so drop the const to fix the
warnings like:

warning: passing argument 2 of '__raw_writel' discards qualifiers from pointer target type
../io.h:88: note: expected 'volatile void *' but argument is of type 'const void *'

Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
---

Intended for 3.7 due to code changes during rc1.

 drivers/staging/tidspbridge/hw/hw_mmu.c |   40 +++++++++++++++----------------
 drivers/staging/tidspbridge/hw/hw_mmu.h |   28 +++++++++++-----------
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/tidspbridge/hw/hw_mmu.c b/drivers/staging/tidspbridge/hw/hw_mmu.c
index 71cb822..a159450 100644
--- a/drivers/staging/tidspbridge/hw/hw_mmu.c
+++ b/drivers/staging/tidspbridge/hw/hw_mmu.c
@@ -78,7 +78,7 @@ static hw_status mmu_flush_entry(const void __iomem *base_address);
  * INPUTS:
  *
  *       Identifier      : base_address
- *       TypE		: const u32
+ *       Type		 : void __iomem *
  *       Description     : Base Address of instance of MMU module
  *
  *       Identifier      : page_sz
@@ -112,7 +112,7 @@ static hw_status mmu_flush_entry(const void __iomem *base_address);
  *
  * METHOD:	       	: Check the Input parameters and set the CAM entry.
  */
-static hw_status mmu_set_cam_entry(const void __iomem *base_address,
+static hw_status mmu_set_cam_entry(void __iomem *base_address,
 				   const u32 page_sz,
 				   const u32 preserved_bit,
 				   const u32 valid_bit,
@@ -124,7 +124,7 @@ static hw_status mmu_set_cam_entry(const void __iomem *base_address,
  * INPUTS:
  *
  *       Identifier      : base_address
- *       Type	    	: const u32
+ *       Type		 : void __iomem *
  *       Description     : Base Address of instance of MMU module
  *
  *       Identifier      : physical_addr
@@ -157,7 +157,7 @@ static hw_status mmu_set_cam_entry(const void __iomem *base_address,
  *
  * METHOD:	       : Check the Input parameters and set the RAM entry.
  */
-static hw_status mmu_set_ram_entry(const void __iomem *base_address,
+static hw_status mmu_set_ram_entry(void __iomem *base_address,
 				   const u32 physical_addr,
 				   enum hw_endianism_t endianism,
 				   enum hw_element_size_t element_size,
@@ -165,7 +165,7 @@ static hw_status mmu_set_ram_entry(const void __iomem *base_address,
 
 /* HW FUNCTIONS */
 
-hw_status hw_mmu_enable(const void __iomem *base_address)
+hw_status hw_mmu_enable(void __iomem *base_address)
 {
 	hw_status status = 0;
 
@@ -174,7 +174,7 @@ hw_status hw_mmu_enable(const void __iomem *base_address)
 	return status;
 }
 
-hw_status hw_mmu_disable(const void __iomem *base_address)
+hw_status hw_mmu_disable(void __iomem *base_address)
 {
 	hw_status status = 0;
 
@@ -183,7 +183,7 @@ hw_status hw_mmu_disable(const void __iomem *base_address)
 	return status;
 }
 
-hw_status hw_mmu_num_locked_set(const void __iomem *base_address,
+hw_status hw_mmu_num_locked_set(void __iomem *base_address,
 				u32 num_locked_entries)
 {
 	hw_status status = 0;
@@ -193,7 +193,7 @@ hw_status hw_mmu_num_locked_set(const void __iomem *base_address,
 	return status;
 }
 
-hw_status hw_mmu_victim_num_set(const void __iomem *base_address,
+hw_status hw_mmu_victim_num_set(void __iomem *base_address,
 				u32 victim_entry_num)
 {
 	hw_status status = 0;
@@ -203,7 +203,7 @@ hw_status hw_mmu_victim_num_set(const void __iomem *base_address,
 	return status;
 }
 
-hw_status hw_mmu_event_ack(const void __iomem *base_address, u32 irq_mask)
+hw_status hw_mmu_event_ack(void __iomem *base_address, u32 irq_mask)
 {
 	hw_status status = 0;
 
@@ -212,7 +212,7 @@ hw_status hw_mmu_event_ack(const void __iomem *base_address, u32 irq_mask)
 	return status;
 }
 
-hw_status hw_mmu_event_disable(const void __iomem *base_address, u32 irq_mask)
+hw_status hw_mmu_event_disable(void __iomem *base_address, u32 irq_mask)
 {
 	hw_status status = 0;
 	u32 irq_reg;
@@ -224,7 +224,7 @@ hw_status hw_mmu_event_disable(const void __iomem *base_address, u32 irq_mask)
 	return status;
 }
 
-hw_status hw_mmu_event_enable(const void __iomem *base_address, u32 irq_mask)
+hw_status hw_mmu_event_enable(void __iomem *base_address, u32 irq_mask)
 {
 	hw_status status = 0;
 	u32 irq_reg;
@@ -236,7 +236,7 @@ hw_status hw_mmu_event_enable(const void __iomem *base_address, u32 irq_mask)
 	return status;
 }
 
-hw_status hw_mmu_event_status(const void __iomem *base_address, u32 *irq_mask)
+hw_status hw_mmu_event_status(void __iomem *base_address, u32 *irq_mask)
 {
 	hw_status status = 0;
 
@@ -245,7 +245,7 @@ hw_status hw_mmu_event_status(const void __iomem *base_address, u32 *irq_mask)
 	return status;
 }
 
-hw_status hw_mmu_fault_addr_read(const void __iomem *base_address, u32 *addr)
+hw_status hw_mmu_fault_addr_read(void __iomem *base_address, u32 *addr)
 {
 	hw_status status = 0;
 
@@ -255,7 +255,7 @@ hw_status hw_mmu_fault_addr_read(const void __iomem *base_address, u32 *addr)
 	return status;
 }
 
-hw_status hw_mmu_ttb_set(const void __iomem *base_address, u32 ttb_phys_addr)
+hw_status hw_mmu_ttb_set(void __iomem *base_address, u32 ttb_phys_addr)
 {
 	hw_status status = 0;
 	u32 load_ttb;
@@ -267,7 +267,7 @@ hw_status hw_mmu_ttb_set(const void __iomem *base_address, u32 ttb_phys_addr)
 	return status;
 }
 
-hw_status hw_mmu_twl_enable(const void __iomem *base_address)
+hw_status hw_mmu_twl_enable(void __iomem *base_address)
 {
 	hw_status status = 0;
 
@@ -276,7 +276,7 @@ hw_status hw_mmu_twl_enable(const void __iomem *base_address)
 	return status;
 }
 
-hw_status hw_mmu_twl_disable(const void __iomem *base_address)
+hw_status hw_mmu_twl_disable(void __iomem *base_address)
 {
 	hw_status status = 0;
 
@@ -323,7 +323,7 @@ hw_status hw_mmu_tlb_flush(const void __iomem *base_address, u32 virtual_addr,
 	return status;
 }
 
-hw_status hw_mmu_tlb_add(const void __iomem *base_address,
+hw_status hw_mmu_tlb_add(void __iomem *base_address,
 			 u32 physical_addr,
 			 u32 virtual_addr,
 			 u32 page_sz,
@@ -516,7 +516,7 @@ static hw_status mmu_flush_entry(const void __iomem *base_address)
 }
 
 /* mmu_set_cam_entry */
-static hw_status mmu_set_cam_entry(const void __iomem *base_address,
+static hw_status mmu_set_cam_entry(void __iomem *base_address,
 				   const u32 page_sz,
 				   const u32 preserved_bit,
 				   const u32 valid_bit,
@@ -536,7 +536,7 @@ static hw_status mmu_set_cam_entry(const void __iomem *base_address,
 }
 
 /* mmu_set_ram_entry */
-static hw_status mmu_set_ram_entry(const void __iomem *base_address,
+static hw_status mmu_set_ram_entry(void __iomem *base_address,
 				   const u32 physical_addr,
 				   enum hw_endianism_t endianism,
 				   enum hw_element_size_t element_size,
@@ -556,7 +556,7 @@ static hw_status mmu_set_ram_entry(const void __iomem *base_address,
 
 }
 
-void hw_mmu_tlb_flush_all(const void __iomem *base)
+void hw_mmu_tlb_flush_all(void __iomem *base)
 {
 	__raw_writel(1, base + MMU_GFLUSH);
 }
diff --git a/drivers/staging/tidspbridge/hw/hw_mmu.h b/drivers/staging/tidspbridge/hw/hw_mmu.h
index 1458a2c..1cdd082 100644
--- a/drivers/staging/tidspbridge/hw/hw_mmu.h
+++ b/drivers/staging/tidspbridge/hw/hw_mmu.h
@@ -42,44 +42,44 @@ struct hw_mmu_map_attrs_t {
 	bool donotlockmpupage;
 };
 
-extern hw_status hw_mmu_enable(const void __iomem *base_address);
+extern hw_status hw_mmu_enable(void __iomem *base_address);
 
-extern hw_status hw_mmu_disable(const void __iomem *base_address);
+extern hw_status hw_mmu_disable(void __iomem *base_address);
 
-extern hw_status hw_mmu_num_locked_set(const void __iomem *base_address,
+extern hw_status hw_mmu_num_locked_set(void __iomem *base_address,
 				       u32 num_locked_entries);
 
-extern hw_status hw_mmu_victim_num_set(const void __iomem *base_address,
+extern hw_status hw_mmu_victim_num_set(void __iomem *base_address,
 				       u32 victim_entry_num);
 
 /* For MMU faults */
-extern hw_status hw_mmu_event_ack(const void __iomem *base_address,
+extern hw_status hw_mmu_event_ack(void __iomem *base_address,
 				  u32 irq_mask);
 
-extern hw_status hw_mmu_event_disable(const void __iomem *base_address,
+extern hw_status hw_mmu_event_disable(void __iomem *base_address,
 				      u32 irq_mask);
 
-extern hw_status hw_mmu_event_enable(const void __iomem *base_address,
+extern hw_status hw_mmu_event_enable(void __iomem *base_address,
 				     u32 irq_mask);
 
-extern hw_status hw_mmu_event_status(const void __iomem *base_address,
+extern hw_status hw_mmu_event_status(void __iomem *base_address,
 				     u32 *irq_mask);
 
-extern hw_status hw_mmu_fault_addr_read(const void __iomem *base_address,
+extern hw_status hw_mmu_fault_addr_read(void __iomem *base_address,
 					u32 *addr);
 
 /* Set the TT base address */
-extern hw_status hw_mmu_ttb_set(const void __iomem *base_address,
+extern hw_status hw_mmu_ttb_set(void __iomem *base_address,
 				u32 ttb_phys_addr);
 
-extern hw_status hw_mmu_twl_enable(const void __iomem *base_address);
+extern hw_status hw_mmu_twl_enable(void __iomem *base_address);
 
-extern hw_status hw_mmu_twl_disable(const void __iomem *base_address);
+extern hw_status hw_mmu_twl_disable(void __iomem *base_address);
 
 extern hw_status hw_mmu_tlb_flush(const void __iomem *base_address,
 				  u32 virtual_addr, u32 page_sz);
 
-extern hw_status hw_mmu_tlb_add(const void __iomem *base_address,
+extern hw_status hw_mmu_tlb_add(void __iomem *base_address,
 				u32 physical_addr,
 				u32 virtual_addr,
 				u32 page_sz,
@@ -97,7 +97,7 @@ 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 virtual_addr, u32 page_size);
 
-void hw_mmu_tlb_flush_all(const void __iomem *base);
+void hw_mmu_tlb_flush_all(void __iomem *base);
 
 static inline u32 hw_mmu_pte_addr_l1(u32 l1_base, u32 va)
 {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/6] staging: tidspbridge: change type to __iomem for per and core addresses
  2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 1/6] staging: tidspbridge: request the right irq for mmu Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 2/6] staging: tidspbridge: drop const from custom mmu implementation Omar Ramirez Luna
@ 2012-10-24 22:09 ` Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 4/6] staging: tidspbridge: ioremap dsp sync addr Omar Ramirez Luna
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Victor Manuel Jaquez Leal, devel, linux-kernel, Omar Ramirez Luna

Currently per_pm_base and core_pm_base are declared as u32, however
_raw_* changed the data type, since:

195bbca ARM: 7500/1: io: avoid writeback addressing modes for __raw_ accessors

This should fix warnings for per and core accesses:

warning: passing argument 2 of '__raw_writel' makes pointer from integer without a cast
../io.h:88: note: expected 'volatile void *' but argument is of type 'u32'

Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
---

Intended for 3.7 due to code changes during rc1.

 .../tidspbridge/include/dspbridge/cfgdefs.h        |    4 ++--
 drivers/staging/tidspbridge/rmgr/drv.c             |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h
index 60a2781..b32c756 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h
@@ -53,8 +53,8 @@ struct cfg_hostres {
 	u32 chnl_buf_size;
 	u32 num_chnls;
 	void __iomem *per_base;
-	u32 per_pm_base;
-	u32 core_pm_base;
+	void __iomem *per_pm_base;
+	void __iomem *core_pm_base;
 	void __iomem *dmmu_base;
 };
 
diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c
index 6795205..db1da28 100644
--- a/drivers/staging/tidspbridge/rmgr/drv.c
+++ b/drivers/staging/tidspbridge/rmgr/drv.c
@@ -667,10 +667,10 @@ int drv_request_bridge_res_dsp(void **phost_resources)
 							 OMAP_DSP_MEM3_SIZE);
 		host_res->per_base = ioremap(OMAP_PER_CM_BASE,
 						OMAP_PER_CM_SIZE);
-		host_res->per_pm_base = (u32) ioremap(OMAP_PER_PRM_BASE,
-							 OMAP_PER_PRM_SIZE);
-		host_res->core_pm_base = (u32) ioremap(OMAP_CORE_PRM_BASE,
-							  OMAP_CORE_PRM_SIZE);
+		host_res->per_pm_base = ioremap(OMAP_PER_PRM_BASE,
+						OMAP_PER_PRM_SIZE);
+		host_res->core_pm_base = ioremap(OMAP_CORE_PRM_BASE,
+							OMAP_CORE_PRM_SIZE);
 		host_res->dmmu_base = ioremap(OMAP_DMMU_BASE,
 						 OMAP_DMMU_SIZE);
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/6] staging: tidspbridge: ioremap dsp sync addr
  2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
                   ` (2 preceding siblings ...)
  2012-10-24 22:09 ` [PATCH 3/6] staging: tidspbridge: change type to __iomem for per and core addresses Omar Ramirez Luna
@ 2012-10-24 22:09 ` Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 5/6] staging: tidspbridge: ioremap physical address of the stack segment in shm Omar Ramirez Luna
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Victor Manuel Jaquez Leal, devel, linux-kernel, Omar Ramirez Luna

Change the type of sync_addr to 'void __iomem *' and ioremap the
physical address in the shared memory so we can access it using
_raw_*. While at it, drop 'dw_' prefix.

Fix the warning associated with dsp's sync_addr:

warning: passing argument 2 of '__raw_writel' makes pointer from integer without a cast
../io.h:88: note: expected 'volatile void *' but argument is of type 'u32'

Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
---

Intended for 3.7 due to code changes during rc1.

 drivers/staging/tidspbridge/core/tiomap3430.c |   37 +++++++++++++++++--------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c
index 066a3ce..f619fb3 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -126,7 +126,8 @@ static int mem_map_vmalloc(struct bridge_dev_context *dev_context,
 				  u32 ul_num_bytes,
 				  struct hw_mmu_map_attrs_t *hw_attrs);
 
-bool wait_for_start(struct bridge_dev_context *dev_context, u32 dw_sync_addr);
+bool wait_for_start(struct bridge_dev_context *dev_context,
+			void __iomem *sync_addr);
 
 /*  ----------------------------------- Globals */
 
@@ -363,10 +364,11 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 {
 	int status = 0;
 	struct bridge_dev_context *dev_context = dev_ctxt;
-	u32 dw_sync_addr = 0;
+	void __iomem *sync_addr;
 	u32 ul_shm_base;	/* Gpp Phys SM base addr(byte) */
 	u32 ul_shm_base_virt;	/* Dsp Virt SM base addr */
 	u32 ul_tlb_base_virt;	/* Base of MMU TLB entry */
+	u32 shm_sync_pa;
 	/* Offset of shm_base_virt from tlb_base_virt */
 	u32 ul_shm_offset_virt;
 	s32 entry_ndx;
@@ -397,15 +399,22 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 	/* Kernel logical address */
 	ul_shm_base = dev_context->atlb_entry[0].gpp_va + ul_shm_offset_virt;
 
+	/* SHM physical sync address */
+	shm_sync_pa = dev_context->atlb_entry[0].gpp_pa + ul_shm_offset_virt +
+			SHMSYNCOFFSET;
+
 	/* 2nd wd is used as sync field */
-	dw_sync_addr = ul_shm_base + SHMSYNCOFFSET;
+	sync_addr = ioremap(shm_sync_pa, SZ_32);
+	if (!sync_addr)
+		return -ENOMEM;
+
 	/* Write a signature into the shm base + offset; this will
 	 * get cleared when the DSP program starts. */
 	if ((ul_shm_base_virt == 0) || (ul_shm_base == 0)) {
 		pr_err("%s: Illegal SM base\n", __func__);
 		status = -EPERM;
 	} else
-		__raw_writel(0xffffffff, dw_sync_addr);
+		__raw_writel(0xffffffff, sync_addr);
 
 	if (!status) {
 		resources = dev_context->resources;
@@ -419,8 +428,10 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 			 * function is made available.
 			 */
 			void __iomem *ctrl = ioremap(0x48002000, SZ_4K);
-			if (!ctrl)
+			if (!ctrl) {
+				iounmap(sync_addr);
 				return -ENOMEM;
+			}
 
 			(*pdata->dsp_prm_rmw_bits)(OMAP3430_RST1_IVA2_MASK,
 					OMAP3430_RST1_IVA2_MASK, OMAP3430_IVA2_MOD,
@@ -588,15 +599,15 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 		(*pdata->dsp_prm_rmw_bits)(OMAP3430_RST1_IVA2_MASK, 0,
 					OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
 
-		dev_dbg(bridge, "Waiting for Sync @ 0x%x\n", dw_sync_addr);
+		dev_dbg(bridge, "Waiting for Sync @ 0x%x\n", *(u32 *)sync_addr);
 		dev_dbg(bridge, "DSP c_int00 Address =  0x%x\n", dsp_addr);
 		if (dsp_debug)
-			while (__raw_readw(dw_sync_addr))
+			while (__raw_readw(sync_addr))
 				;
 
 		/* Wait for DSP to clear word in shared memory */
 		/* Read the Location */
-		if (!wait_for_start(dev_context, dw_sync_addr))
+		if (!wait_for_start(dev_context, sync_addr))
 			status = -ETIMEDOUT;
 
 		dev_get_symbol(dev_context->dev_obj, "_WDT_enable", &wdt_en);
@@ -612,7 +623,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 			/* Write the synchronization bit to indicate the
 			 * completion of OPP table update to DSP
 			 */
-			__raw_writel(0XCAFECAFE, dw_sync_addr);
+			__raw_writel(0XCAFECAFE, sync_addr);
 
 			/* update board state */
 			dev_context->brd_state = BRD_RUNNING;
@@ -621,6 +632,9 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 			dev_context->brd_state = BRD_UNKNOWN;
 		}
 	}
+
+	iounmap(sync_addr);
+
 	return status;
 }
 
@@ -1796,12 +1810,13 @@ static int mem_map_vmalloc(struct bridge_dev_context *dev_context,
  *  ======== wait_for_start ========
  *      Wait for the singal from DSP that it has started, or time out.
  */
-bool wait_for_start(struct bridge_dev_context *dev_context, u32 dw_sync_addr)
+bool wait_for_start(struct bridge_dev_context *dev_context,
+			void __iomem *sync_addr)
 {
 	u16 timeout = TIHELEN_ACKTIMEOUT;
 
 	/*  Wait for response from board */
-	while (__raw_readw(dw_sync_addr) && --timeout)
+	while (__raw_readw(sync_addr) && --timeout)
 		udelay(10);
 
 	/*  If timed out: return false */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/6] staging: tidspbridge: ioremap physical address of the stack segment in shm
  2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
                   ` (3 preceding siblings ...)
  2012-10-24 22:09 ` [PATCH 4/6] staging: tidspbridge: ioremap dsp sync addr Omar Ramirez Luna
@ 2012-10-24 22:09 ` Omar Ramirez Luna
  2012-10-24 22:09 ` [PATCH 6/6] staging: tidspbridge: delete unused mmu functions Omar Ramirez Luna
  2012-10-24 22:28 ` [PATCH 0/6] staging: tidspbridge fixes for 3.7 Greg Kroah-Hartman
  6 siblings, 0 replies; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Victor Manuel Jaquez Leal, devel, linux-kernel, Omar Ramirez Luna

Due to data type change, readl can no longer receive a u32.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
---

Intended for 3.7 due to code changes during rc1.

 drivers/staging/tidspbridge/rmgr/node.c |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c
index c2fc613..294e9b4 100644
--- a/drivers/staging/tidspbridge/rmgr/node.c
+++ b/drivers/staging/tidspbridge/rmgr/node.c
@@ -304,8 +304,7 @@ int node_allocate(struct proc_object *hprocessor,
 	u32 pul_value;
 	u32 dynext_base;
 	u32 off_set = 0;
-	u32 ul_stack_seg_addr, ul_stack_seg_val;
-	u32 ul_gpp_mem_base;
+	u32 ul_stack_seg_val;
 	struct cfg_hostres *host_res;
 	struct bridge_dev_context *pbridge_context;
 	u32 mapped_addr = 0;
@@ -581,6 +580,9 @@ func_cont:
 		if (strcmp((char *)
 			   pnode->dcd_props.obj_data.node_obj.ndb_props.
 			   stack_seg_name, STACKSEGLABEL) == 0) {
+			void __iomem *stack_seg;
+			u32 stack_seg_pa;
+
 			status =
 			    hnode_mgr->nldr_fxns.
 			    get_fxn_addr(pnode->nldr_node_obj, "DYNEXT_BEG",
@@ -608,14 +610,21 @@ func_cont:
 				goto func_end;
 			}
 
-			ul_gpp_mem_base = (u32) host_res->mem_base[1];
 			off_set = pul_value - dynext_base;
-			ul_stack_seg_addr = ul_gpp_mem_base + off_set;
-			ul_stack_seg_val = readl(ul_stack_seg_addr);
+			stack_seg_pa = host_res->mem_phys[1] + off_set;
+			stack_seg = ioremap(stack_seg_pa, SZ_32);
+			if (!stack_seg) {
+				status = -ENOMEM;
+				goto func_end;
+			}
+
+			ul_stack_seg_val = readl(stack_seg);
+
+			iounmap(stack_seg);
 
 			dev_dbg(bridge, "%s: StackSegVal = 0x%x, StackSegAddr ="
 				" 0x%x\n", __func__, ul_stack_seg_val,
-				ul_stack_seg_addr);
+				host_res->mem_base[1] + off_set);
 
 			pnode->create_args.asa.task_arg_obj.stack_seg =
 			    ul_stack_seg_val;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/6] staging: tidspbridge: delete unused mmu functions
  2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
                   ` (4 preceding siblings ...)
  2012-10-24 22:09 ` [PATCH 5/6] staging: tidspbridge: ioremap physical address of the stack segment in shm Omar Ramirez Luna
@ 2012-10-24 22:09 ` Omar Ramirez Luna
  2012-10-24 22:28 ` [PATCH 0/6] staging: tidspbridge fixes for 3.7 Greg Kroah-Hartman
  6 siblings, 0 replies; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 22:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Victor Manuel Jaquez Leal, devel, linux-kernel,
	Omar Ramirez Luna, Omar Ramirez Luna

From: Omar Ramirez Luna <omar.luna@linaro.org>

This should get rid of warnings of the type:

warning: passing argument 1 of '' discards qualifiers from pointer target type
 note: expected 'void *' but argument is of type 'const void *'

Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
---

Intended for 3.7 due to code changes during rc1.

 drivers/staging/tidspbridge/hw/hw_mmu.c |   75 -------------------------------
 drivers/staging/tidspbridge/hw/hw_mmu.h |    3 --
 2 files changed, 78 deletions(-)

diff --git a/drivers/staging/tidspbridge/hw/hw_mmu.c b/drivers/staging/tidspbridge/hw/hw_mmu.c
index a159450..50244a4 100644
--- a/drivers/staging/tidspbridge/hw/hw_mmu.c
+++ b/drivers/staging/tidspbridge/hw/hw_mmu.c
@@ -48,31 +48,6 @@ enum hw_mmu_page_size_t {
 };
 
 /*
- * FUNCTION	      : mmu_flush_entry
- *
- * INPUTS:
- *
- *       Identifier      : base_address
- *       Type		: const u32
- *       Description     : Base Address of instance of MMU module
- *
- * RETURNS:
- *
- *       Type		: hw_status
- *       Description     : 0		 -- No errors occurred
- *			 RET_BAD_NULL_PARAM     -- A Pointer
- *						Parameter was set to NULL
- *
- * PURPOSE:	      : Flush the TLB entry pointed by the
- *			lock counter register
- *			even if this entry is set protected
- *
- * METHOD:	       : Check the Input parameter and Flush a
- *			 single entry in the TLB.
- */
-static hw_status mmu_flush_entry(const void __iomem *base_address);
-
-/*
  * FUNCTION	      : mmu_set_cam_entry
  *
  * INPUTS:
@@ -285,44 +260,6 @@ hw_status hw_mmu_twl_disable(void __iomem *base_address)
 	return status;
 }
 
-hw_status hw_mmu_tlb_flush(const void __iomem *base_address, u32 virtual_addr,
-			   u32 page_sz)
-{
-	hw_status status = 0;
-	u32 virtual_addr_tag;
-	enum hw_mmu_page_size_t pg_size_bits;
-
-	switch (page_sz) {
-	case HW_PAGE_SIZE4KB:
-		pg_size_bits = HW_MMU_SMALL_PAGE;
-		break;
-
-	case HW_PAGE_SIZE64KB:
-		pg_size_bits = HW_MMU_LARGE_PAGE;
-		break;
-
-	case HW_PAGE_SIZE1MB:
-		pg_size_bits = HW_MMU_SECTION;
-		break;
-
-	case HW_PAGE_SIZE16MB:
-		pg_size_bits = HW_MMU_SUPERSECTION;
-		break;
-
-	default:
-		return -EINVAL;
-	}
-
-	/* Generate the 20-bit tag from virtual address */
-	virtual_addr_tag = ((virtual_addr & MMU_ADDR_MASK) >> 12);
-
-	mmu_set_cam_entry(base_address, pg_size_bits, 0, 0, virtual_addr_tag);
-
-	mmu_flush_entry(base_address);
-
-	return status;
-}
-
 hw_status hw_mmu_tlb_add(void __iomem *base_address,
 			 u32 physical_addr,
 			 u32 virtual_addr,
@@ -503,18 +440,6 @@ hw_status hw_mmu_pte_clear(const u32 pg_tbl_va, u32 virtual_addr, u32 page_size)
 	return status;
 }
 
-/* mmu_flush_entry */
-static hw_status mmu_flush_entry(const void __iomem *base_address)
-{
-	hw_status status = 0;
-	u32 flush_entry_data = 0x1;
-
-	/* write values to register */
-	MMUMMU_FLUSH_ENTRY_WRITE_REGISTER32(base_address, flush_entry_data);
-
-	return status;
-}
-
 /* mmu_set_cam_entry */
 static hw_status mmu_set_cam_entry(void __iomem *base_address,
 				   const u32 page_sz,
diff --git a/drivers/staging/tidspbridge/hw/hw_mmu.h b/drivers/staging/tidspbridge/hw/hw_mmu.h
index 1cdd082..1c50bb3 100644
--- a/drivers/staging/tidspbridge/hw/hw_mmu.h
+++ b/drivers/staging/tidspbridge/hw/hw_mmu.h
@@ -76,9 +76,6 @@ extern hw_status hw_mmu_twl_enable(void __iomem *base_address);
 
 extern hw_status hw_mmu_twl_disable(void __iomem *base_address);
 
-extern hw_status hw_mmu_tlb_flush(const void __iomem *base_address,
-				  u32 virtual_addr, u32 page_sz);
-
 extern hw_status hw_mmu_tlb_add(void __iomem *base_address,
 				u32 physical_addr,
 				u32 virtual_addr,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] staging: tidspbridge fixes for 3.7
  2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
                   ` (5 preceding siblings ...)
  2012-10-24 22:09 ` [PATCH 6/6] staging: tidspbridge: delete unused mmu functions Omar Ramirez Luna
@ 2012-10-24 22:28 ` Greg Kroah-Hartman
  2012-10-24 23:25   ` Omar Ramirez Luna
  6 siblings, 1 reply; 10+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-24 22:28 UTC (permalink / raw)
  To: Omar Ramirez Luna; +Cc: Victor Manuel Jaquez Leal, devel, linux-kernel

On Wed, Oct 24, 2012 at 05:09:14PM -0500, Omar Ramirez Luna wrote:
> With 3.7-rc1 changes:
> 
> - New irq numbering in OMAP3 broke the driver request for a mmu irq,
>   until this is migrated to the common iommu framework we can only
>   hardcode the new number.
> - _raw_* accessors changed a type of one of their parameters with patch
>   "195bbca ARM: 7500/1: io: avoid writeback addressing modes for
>   __raw_ accessors", so the build system was filled with warnings from
>   the old parameter usage.
> 
> Omar Ramirez Luna (6):
>   staging: tidspbridge: request the right irq for mmu
>   staging: tidspbridge: drop const from custom mmu implementation
>   staging: tidspbridge: change type to __iomem for per and core
>     addresses
>   staging: tidspbridge: ioremap dsp sync addr
>   staging: tidspbridge: ioremap physical address of the stack segment
>     in shm
>   staging: tidspbridge: delete unused mmu functions

Are the "fix up the compiler warning" patches really needed for 3.7?
Are they new in 3.7-rc1?  Or were they there before in 3.6?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] staging: tidspbridge fixes for 3.7
  2012-10-24 22:28 ` [PATCH 0/6] staging: tidspbridge fixes for 3.7 Greg Kroah-Hartman
@ 2012-10-24 23:25   ` Omar Ramirez Luna
  2012-10-24 23:35     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 10+ messages in thread
From: Omar Ramirez Luna @ 2012-10-24 23:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Victor Manuel Jaquez Leal, devel, linux-kernel

Hi,

On Wed, Oct 24, 2012 at 5:28 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Wed, Oct 24, 2012 at 05:09:14PM -0500, Omar Ramirez Luna wrote:
>> With 3.7-rc1 changes:
>>
>> - New irq numbering in OMAP3 broke the driver request for a mmu irq,
>>   until this is migrated to the common iommu framework we can only
>>   hardcode the new number.
>> - _raw_* accessors changed a type of one of their parameters with patch
>>   "195bbca ARM: 7500/1: io: avoid writeback addressing modes for
>>   __raw_ accessors", so the build system was filled with warnings from
>>   the old parameter usage.
>>
>> Omar Ramirez Luna (6):
>>   staging: tidspbridge: request the right irq for mmu
>>   staging: tidspbridge: drop const from custom mmu implementation
>>   staging: tidspbridge: change type to __iomem for per and core
>>     addresses
>>   staging: tidspbridge: ioremap dsp sync addr
>>   staging: tidspbridge: ioremap physical address of the stack segment
>>     in shm
>>   staging: tidspbridge: delete unused mmu functions
>
> Are the "fix up the compiler warning" patches really needed for 3.7?
> Are they new in 3.7-rc1?  Or were they there before in 3.6?

All are new in 3.7-rc1.

The "warning fixes" would be good to have and thought they could make
it given that the change was introduced during 3.7 rc cycle. So, the
warnings are not that critical.

Cheers,

Omar

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] staging: tidspbridge fixes for 3.7
  2012-10-24 23:25   ` Omar Ramirez Luna
@ 2012-10-24 23:35     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-24 23:35 UTC (permalink / raw)
  To: Omar Ramirez Luna; +Cc: Victor Manuel Jaquez Leal, devel, linux-kernel

On Wed, Oct 24, 2012 at 06:25:42PM -0500, Omar Ramirez Luna wrote:
> Hi,
> 
> On Wed, Oct 24, 2012 at 5:28 PM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > On Wed, Oct 24, 2012 at 05:09:14PM -0500, Omar Ramirez Luna wrote:
> >> With 3.7-rc1 changes:
> >>
> >> - New irq numbering in OMAP3 broke the driver request for a mmu irq,
> >>   until this is migrated to the common iommu framework we can only
> >>   hardcode the new number.
> >> - _raw_* accessors changed a type of one of their parameters with patch
> >>   "195bbca ARM: 7500/1: io: avoid writeback addressing modes for
> >>   __raw_ accessors", so the build system was filled with warnings from
> >>   the old parameter usage.
> >>
> >> Omar Ramirez Luna (6):
> >>   staging: tidspbridge: request the right irq for mmu
> >>   staging: tidspbridge: drop const from custom mmu implementation
> >>   staging: tidspbridge: change type to __iomem for per and core
> >>     addresses
> >>   staging: tidspbridge: ioremap dsp sync addr
> >>   staging: tidspbridge: ioremap physical address of the stack segment
> >>     in shm
> >>   staging: tidspbridge: delete unused mmu functions
> >
> > Are the "fix up the compiler warning" patches really needed for 3.7?
> > Are they new in 3.7-rc1?  Or were they there before in 3.6?
> 
> All are new in 3.7-rc1.
> 
> The "warning fixes" would be good to have and thought they could make
> it given that the change was introduced during 3.7 rc cycle. So, the
> warnings are not that critical.

Ok, good enough, I'll queue this up for 3.7.

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-10-24 23:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-24 22:09 [PATCH 0/6] staging: tidspbridge fixes for 3.7 Omar Ramirez Luna
2012-10-24 22:09 ` [PATCH 1/6] staging: tidspbridge: request the right irq for mmu Omar Ramirez Luna
2012-10-24 22:09 ` [PATCH 2/6] staging: tidspbridge: drop const from custom mmu implementation Omar Ramirez Luna
2012-10-24 22:09 ` [PATCH 3/6] staging: tidspbridge: change type to __iomem for per and core addresses Omar Ramirez Luna
2012-10-24 22:09 ` [PATCH 4/6] staging: tidspbridge: ioremap dsp sync addr Omar Ramirez Luna
2012-10-24 22:09 ` [PATCH 5/6] staging: tidspbridge: ioremap physical address of the stack segment in shm Omar Ramirez Luna
2012-10-24 22:09 ` [PATCH 6/6] staging: tidspbridge: delete unused mmu functions Omar Ramirez Luna
2012-10-24 22:28 ` [PATCH 0/6] staging: tidspbridge fixes for 3.7 Greg Kroah-Hartman
2012-10-24 23:25   ` Omar Ramirez Luna
2012-10-24 23:35     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).