[PATCH] ARM: OMAP: Fix dependency for OMAP_DEBUG_LEDS

2012-10-07 Thread Axel Lin
This fixes below build error:
  LD  init/built-in.o
arch/arm/plat-omap/built-in.o: In function `fpga_probe':
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/built-in.o:arch/arm/plat-omap/debug-leds.c:113: more 
undefined references to `led_classdev_register' follow
make: *** [vmlinux] Error 1

Signed-off-by: Axel Lin axel@ingics.com
---
Hi Bryan,
I think this issue is introduced by commit dafbead
ARM: mach-omap1: retire custom LED code.

Regards,
Axel

 arch/arm/plat-omap/Kconfig |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index ca83a76..3281377 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -42,7 +42,7 @@ config OMAP_DEBUG_DEVICES
  For debug cards on TI reference boards.
 
 config OMAP_DEBUG_LEDS
-   def_bool y if NEW_LEDS
+   default y if LEDS_CLASS
depends on OMAP_DEBUG_DEVICES
 
 config POWER_AVS_OMAP
-- 
1.7.9.5



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


Re: [PATCH] ARM: OMAP: Fix dependency for OMAP_DEBUG_LEDS

2012-10-07 Thread Russell King - ARM Linux
On Sun, Oct 07, 2012 at 04:00:37PM +0800, Axel Lin wrote:
  config OMAP_DEBUG_LEDS
 - def_bool y if NEW_LEDS
 + default y if LEDS_CLASS
   depends on OMAP_DEBUG_DEVICES

This change is wrong.  You're making this config entry untyped.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] ARM: OMAP: Fix dependency for OMAP_DEBUG_LEDS

2012-10-07 Thread Axel Lin
This fixes below build error when CONFIG_LEDS_CLASS is not set.

  LD  init/built-in.o
arch/arm/plat-omap/built-in.o: In function `fpga_probe':
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/debug-leds.c:113: undefined reference to 
`led_classdev_register'
arch/arm/plat-omap/built-in.o:arch/arm/plat-omap/debug-leds.c:113: more 
undefined references to `led_classdev_register' follow
make: *** [vmlinux] Error 1

Signed-off-by: Axel Lin axel@ingics.com
---
 arch/arm/plat-omap/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index ca83a76..c262781 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -43,6 +43,7 @@ config OMAP_DEBUG_DEVICES
 
 config OMAP_DEBUG_LEDS
def_bool y if NEW_LEDS
+   select LEDS_CLASS
depends on OMAP_DEBUG_DEVICES
 
 config POWER_AVS_OMAP
-- 
1.7.9.5



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


Re: [PATCH v2 1/5] [media] omap3isp: Fix compilation error in ispreg.h

2012-10-07 Thread Mauro Carvalho Chehab
Em Tue, 2 Oct 2012 09:31:58 -0700
Tony Lindgren t...@atomide.com escreveu:

 * Ido Yariv i...@wizery.com [121001 15:48]:
  Commit c49f34bc (ARM: OMAP2+ Move SoC specific headers to be local to
  mach-omap2) moved omap34xx.h to mach-omap2. This broke omap3isp, as it
  includes omap34xx.h.
  
  Instead of moving omap34xx to platform_data, simply add the two
  definitions the driver needs and remove the include altogether.
  
  Signed-off-by: Ido Yariv i...@wizery.com
 
 I'm assuming that Mauro picks this one up, sorry
 for breaking it.

Picked, thanks. 

With regards to the other patches in this series, IMHO, it
makes more sense to go through arm omap tree, so, for the
patches on this series that touch at drivers/media/platform/*:

Acked-by: Mauro Carvalho Chehab mche...@redhat.com

 
 Acked-by: Tony Lindgren t...@atomide.com
 
  ---
   drivers/media/platform/omap3isp/ispreg.h | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)
  
  diff --git a/drivers/media/platform/omap3isp/ispreg.h 
  b/drivers/media/platform/omap3isp/ispreg.h
  index 084ea77..e2c57f3 100644
  --- a/drivers/media/platform/omap3isp/ispreg.h
  +++ b/drivers/media/platform/omap3isp/ispreg.h
  @@ -27,13 +27,13 @@
   #ifndef OMAP3_ISP_REG_H
   #define OMAP3_ISP_REG_H
   
  -#include plat/omap34xx.h
  -
  -
   #define CM_CAM_MCLK_HZ 17280   /* Hz */
   
   /* ISP Submodules offset */
   
  +#define L4_34XX_BASE   0x4800
  +#define OMAP3430_ISP_BASE  (L4_34XX_BASE + 0xBC000)
  +
   #define OMAP3ISP_REG_BASE  OMAP3430_ISP_BASE
   #define OMAP3ISP_REG(offset)   (OMAP3ISP_REG_BASE + (offset))
   
  -- 
  1.7.11.4
  
  --
  To unsubscribe from this list: send the line unsubscribe linux-omap in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html




Cheers,
Mauro
--
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] ARM: OMAP2+: remove duplicated include from board-omap3stalker.c

2012-10-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Remove duplicated include.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 arch/arm/mach-omap2/board-omap3stalker.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3stalker.c 
b/arch/arm/mach-omap2/board-omap3stalker.c
index c7f3d02..731235e 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -48,11 +48,6 @@
 #include video/omap-panel-tfp410.h
 
 #include linux/platform_data/spi-omap2-mcspi.h
-#include linux/input/matrix_keypad.h
-#include linux/spi/spi.h
-#include linux/interrupt.h
-#include linux/smsc911x.h
-#include linux/i2c/at24.h
 
 #include sdram-micron-mt46h32m32lf-6.h
 #include mux.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] ARM: OMAP: fix return value check in realtime_counter_init()

2012-10-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

In case of error, the function clk_get() returns ERR_PTR()
and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 arch/arm/mach-omap2/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 8847d6e..44f9aa7 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -378,7 +378,7 @@ static void __init realtime_counter_init(void)
return;
}
sys_clk = clk_get(NULL, sys_clkin_ck);
-   if (!sys_clk) {
+   if (IS_ERR(sys_clk)) {
pr_err(%s: failed to get system clock handle\n, __func__);
iounmap(base);
return;

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


[PATCH v3 0/3] OMAP 3 CSI-2 configuration

2012-10-07 Thread Sakari Ailus
Hi all,

This is an update to an old patchset for CSI-2 configuration for OMAP 3430
and 3630r. The patches have been tested on the 3630 only so far, and I don't
plan to test them on 3430 in the near future.

I changed quite a few things after a discussion with Tony a few days ago.
The ISP driver now maps the relevant register from the control block and
uses it directly. Which register is required is determined by the ISP
revision: this is theoretically wrong, but since we only support OMAP 3430
and 3630 which have different ISPs it should be all right. If we need to
support more OMAPs in the future we could revisit how that's being
determined.

Comments, questions and other kind of feedback is very welcome.

Kind regards,

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/3] omap3isp: Add CSI configuration registers from control block to ISP resources

2012-10-07 Thread Sakari Ailus
Add the registers used to configure the CSI-2 receiver PHY on OMAP3430 and
3630 and map them in the ISP driver. The register is part of the control
block but it only is needed by the ISP driver.

Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
---
 arch/arm/mach-omap2/devices.c |   10 ++
 drivers/media/platform/omap3isp/isp.c |6 --
 drivers/media/platform/omap3isp/isp.h |2 ++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c00c689..9e4d5da 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -201,6 +201,16 @@ static struct resource omap3isp_resources[] = {
.flags  = IORESOURCE_MEM,
},
{
+   .start  = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE,
+   .end= OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE 
+ 3,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = OMAP343X_CTRL_BASE + 
OMAP3630_CONTROL_CAMERA_PHY_CTRL,
+   .end= OMAP343X_CTRL_BASE + 
OMAP3630_CONTROL_CAMERA_PHY_CTRL + 3,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
.start  = INT_34XX_CAM_IRQ,
.flags  = IORESOURCE_IRQ,
}
diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index d7aa513..88fba2c 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -100,7 +100,8 @@ static const struct isp_res_mapping isp_res_maps[] = {
   1  OMAP3_ISP_IOMEM_RESZ |
   1  OMAP3_ISP_IOMEM_SBL |
   1  OMAP3_ISP_IOMEM_CSI2A_REGS1 |
-  1  OMAP3_ISP_IOMEM_CSIPHY2,
+  1  OMAP3_ISP_IOMEM_CSIPHY2 |
+  1  OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE,
},
{
.isp_rev = ISP_REVISION_15_0,
@@ -117,7 +118,8 @@ static const struct isp_res_mapping isp_res_maps[] = {
   1  OMAP3_ISP_IOMEM_CSI2A_REGS2 |
   1  OMAP3_ISP_IOMEM_CSI2C_REGS1 |
   1  OMAP3_ISP_IOMEM_CSIPHY1 |
-  1  OMAP3_ISP_IOMEM_CSI2C_REGS2,
+  1  OMAP3_ISP_IOMEM_CSI2C_REGS2 |
+  1  OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL,
},
 };
 
diff --git a/drivers/media/platform/omap3isp/isp.h 
b/drivers/media/platform/omap3isp/isp.h
index 8be7487..6fed222 100644
--- a/drivers/media/platform/omap3isp/isp.h
+++ b/drivers/media/platform/omap3isp/isp.h
@@ -72,6 +72,8 @@ enum isp_mem_resources {
OMAP3_ISP_IOMEM_CSI2C_REGS1,
OMAP3_ISP_IOMEM_CSIPHY1,
OMAP3_ISP_IOMEM_CSI2C_REGS2,
+   OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE,
+   OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL,
OMAP3_ISP_IOMEM_LAST
 };
 
-- 
1.7.2.5

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


[PATCH v3 3/3] omap3isp: Configure CSI-2 phy based on platform data

2012-10-07 Thread Sakari Ailus
Configure CSI-2 phy based on platform data in the ISP driver. For that, the
new V4L2_CID_IMAGE_SOURCE_PIXEL_RATE control is used. Previously the same
was configured from the board code.

This patch is dependent on omap3: Provide means for changing CSI2 PHY
configuration.

Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/media/platform/omap3isp/isp.h   |3 -
 drivers/media/platform/omap3isp/ispcsiphy.c |  140 +-
 drivers/media/platform/omap3isp/ispcsiphy.h |   10 --
 3 files changed, 70 insertions(+), 83 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.h 
b/drivers/media/platform/omap3isp/isp.h
index 6fed222..accb3b0 100644
--- a/drivers/media/platform/omap3isp/isp.h
+++ b/drivers/media/platform/omap3isp/isp.h
@@ -129,9 +129,6 @@ struct isp_reg {
 
 struct isp_platform_callback {
u32 (*set_xclk)(struct isp_device *isp, u32 xclk, u8 xclksel);
-   int (*csiphy_config)(struct isp_csiphy *phy,
-struct isp_csiphy_dphy_cfg *dphy,
-struct isp_csiphy_lanes_cfg *lanes);
 };
 
 /*
diff --git a/drivers/media/platform/omap3isp/ispcsiphy.c 
b/drivers/media/platform/omap3isp/ispcsiphy.c
index f13bfbd..4ac1081 100644
--- a/drivers/media/platform/omap3isp/ispcsiphy.c
+++ b/drivers/media/platform/omap3isp/ispcsiphy.c
@@ -119,36 +119,6 @@ static void csiphy_routing_cfg(struct isp_csiphy *phy, u32 
iface, bool on,
 }
 
 /*
- * csiphy_lanes_config - Configuration of CSIPHY lanes.
- *
- * Updates HW configuration.
- * Called with phy-mutex taken.
- */
-static void csiphy_lanes_config(struct isp_csiphy *phy)
-{
-   unsigned int i;
-   u32 reg;
-
-   reg = isp_reg_readl(phy-isp, phy-cfg_regs, ISPCSI2_PHY_CFG);
-
-   for (i = 0; i  phy-num_data_lanes; i++) {
-   reg = ~(ISPCSI2_PHY_CFG_DATA_POL_MASK(i + 1) |
-ISPCSI2_PHY_CFG_DATA_POSITION_MASK(i + 1));
-   reg |= (phy-lanes.data[i].pol 
-   ISPCSI2_PHY_CFG_DATA_POL_SHIFT(i + 1));
-   reg |= (phy-lanes.data[i].pos 
-   ISPCSI2_PHY_CFG_DATA_POSITION_SHIFT(i + 1));
-   }
-
-   reg = ~(ISPCSI2_PHY_CFG_CLOCK_POL_MASK |
-ISPCSI2_PHY_CFG_CLOCK_POSITION_MASK);
-   reg |= phy-lanes.clk.pol  ISPCSI2_PHY_CFG_CLOCK_POL_SHIFT;
-   reg |= phy-lanes.clk.pos  ISPCSI2_PHY_CFG_CLOCK_POSITION_SHIFT;
-
-   isp_reg_writel(phy-isp, reg, phy-cfg_regs, ISPCSI2_PHY_CFG);
-}
-
-/*
  * csiphy_power_autoswitch_enable
  * @enable: Sets or clears the autoswitch function enable flag.
  */
@@ -193,43 +163,28 @@ static int csiphy_set_power(struct isp_csiphy *phy, u32 
power)
 }
 
 /*
- * csiphy_dphy_config - Configure CSI2 D-PHY parameters.
- *
- * Called with phy-mutex taken.
+ * TCLK values are OK at their reset values
  */
-static void csiphy_dphy_config(struct isp_csiphy *phy)
-{
-   u32 reg;
-
-   /* Set up ISPCSIPHY_REG0 */
-   reg = isp_reg_readl(phy-isp, phy-phy_regs, ISPCSIPHY_REG0);
-
-   reg = ~(ISPCSIPHY_REG0_THS_TERM_MASK |
-ISPCSIPHY_REG0_THS_SETTLE_MASK);
-   reg |= phy-dphy.ths_term  ISPCSIPHY_REG0_THS_TERM_SHIFT;
-   reg |= phy-dphy.ths_settle  ISPCSIPHY_REG0_THS_SETTLE_SHIFT;
-
-   isp_reg_writel(phy-isp, reg, phy-phy_regs, ISPCSIPHY_REG0);
-
-   /* Set up ISPCSIPHY_REG1 */
-   reg = isp_reg_readl(phy-isp, phy-phy_regs, ISPCSIPHY_REG1);
-
-   reg = ~(ISPCSIPHY_REG1_TCLK_TERM_MASK |
-ISPCSIPHY_REG1_TCLK_MISS_MASK |
-ISPCSIPHY_REG1_TCLK_SETTLE_MASK);
-   reg |= phy-dphy.tclk_term  ISPCSIPHY_REG1_TCLK_TERM_SHIFT;
-   reg |= phy-dphy.tclk_miss  ISPCSIPHY_REG1_TCLK_MISS_SHIFT;
-   reg |= phy-dphy.tclk_settle  ISPCSIPHY_REG1_TCLK_SETTLE_SHIFT;
+#define TCLK_TERM  0
+#define TCLK_MISS  1
+#define TCLK_SETTLE14
 
-   isp_reg_writel(phy-isp, reg, phy-phy_regs, ISPCSIPHY_REG1);
-}
-
-static int csiphy_config(struct isp_csiphy *phy,
-struct isp_csiphy_dphy_cfg *dphy,
-struct isp_csiphy_lanes_cfg *lanes)
+static int omap3isp_csiphy_config(struct isp_csiphy *phy)
 {
+   struct isp_csi2_device *csi2 = phy-csi2;
+   struct isp_pipeline *pipe = to_isp_pipeline(csi2-subdev.entity);
+   struct isp_v4l2_subdevs_group *subdevs = pipe-external-host_priv;
+   struct isp_csiphy_lanes_cfg *lanes;
+   int csi2_ddrclk_khz;
unsigned int used_lanes = 0;
unsigned int i;
+   u32 reg;
+
+   if (subdevs-interface == ISP_INTERFACE_CCP2B_PHY1
+   || subdevs-interface == ISP_INTERFACE_CCP2B_PHY2)
+   lanes = subdevs-bus.ccp2.lanecfg;
+   else
+   lanes = subdevs-bus.csi2.lanecfg;
 
/* Clock and data lanes verification */
for (i = 0; i  phy-num_data_lanes; i++) {
@@ -248,10 +203,56 @@ static int csiphy_config(struct isp_csiphy *phy,
if 

[PATCH v3 2/3] omap3isp: Add PHY routing configuration

2012-10-07 Thread Sakari Ailus
Add PHY routing configuration for both 3430 and 3630. Also add register bit
definitions of CSIRXFE and CAMERA_PHY_CTRL registers on OMAP 3430 and 3630,
respectively.

Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
---
 drivers/media/platform/omap3isp/ispcsiphy.c |   86 +++
 drivers/media/platform/omap3isp/ispreg.h|   22 +++
 2 files changed, 108 insertions(+), 0 deletions(-)

diff --git a/drivers/media/platform/omap3isp/ispcsiphy.c 
b/drivers/media/platform/omap3isp/ispcsiphy.c
index 348f67e..f13bfbd 100644
--- a/drivers/media/platform/omap3isp/ispcsiphy.c
+++ b/drivers/media/platform/omap3isp/ispcsiphy.c
@@ -32,6 +32,92 @@
 #include ispreg.h
 #include ispcsiphy.h
 
+static void csiphy_routing_cfg_3630(struct isp_csiphy *phy, u32 iface,
+   bool ccp2_strobe)
+{
+   u32 cam_phy_ctrl =
+   isp_reg_readl(phy-isp,
+ OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, 0);
+   u32 shift, mode;
+
+   switch (iface) {
+   case ISP_INTERFACE_CCP2B_PHY1:
+   cam_phy_ctrl =
+   ~OMAP3630_CONTROL_CAMERA_PHY_CTRL_CSI1_RX_SEL_PHY2;
+   shift = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY1_SHIFT;
+   break;
+   case ISP_INTERFACE_CSI2C_PHY1:
+   shift = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY1_SHIFT;
+   mode = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_DPHY;
+   break;
+   case ISP_INTERFACE_CCP2B_PHY2:
+   cam_phy_ctrl |=
+   OMAP3630_CONTROL_CAMERA_PHY_CTRL_CSI1_RX_SEL_PHY2;
+   shift = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY2_SHIFT;
+   break;
+   case ISP_INTERFACE_CSI2A_PHY2:
+   shift = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY2_SHIFT;
+   mode = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_DPHY;
+   break;
+   default:
+   pr_warn(bad iface %d\n, iface);
+   return;
+   }
+
+   /* Select data/clock or data/strobe mode for CCP2 */
+   switch (iface) {
+   case ISP_INTERFACE_CCP2B_PHY1:
+   case ISP_INTERFACE_CCP2B_PHY2:
+   if (ccp2_strobe)
+   mode = 
OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_CCP2_DATA_STROBE;
+   else
+   mode = 
OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_CCP2_DATA_CLOCK;
+   }
+
+   cam_phy_ctrl =
+   ~(OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_MASK  shift);
+   cam_phy_ctrl |= mode  shift;
+
+   isp_reg_writel(phy-isp, cam_phy_ctrl,
+  OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL, 0);
+}
+
+static void csiphy_routing_cfg_3430(struct isp_csiphy *phy, u32 iface, bool on,
+   bool ccp2_strobe)
+{
+   uint32_t csirxfe = OMAP343X_CONTROL_CSIRXFE_PWRDNZ
+   | OMAP343X_CONTROL_CSIRXFE_RESET;
+
+   /* Nothing to configure here. */
+   if (iface == ISP_INTERFACE_CSI2A_PHY2)
+   return;
+
+   if (iface != ISP_INTERFACE_CCP2B_PHY1)
+   return;
+
+   if (!on) {
+   isp_reg_writel(phy-isp, 0,
+  OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, 0);
+   return;
+   }
+
+   if (ccp2_strobe)
+   csirxfe |= OMAP343X_CONTROL_CSIRXFE_SELFORM;
+
+   isp_reg_writel(phy-isp, csirxfe,
+  OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE, 0);
+}
+
+static void csiphy_routing_cfg(struct isp_csiphy *phy, u32 iface, bool on,
+  bool ccp2_strobe)
+{
+   if (phy-isp-mmio_base[OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL]
+on)
+   return csiphy_routing_cfg_3630(phy, iface, ccp2_strobe);
+   if (phy-isp-mmio_base[OMAP3_ISP_IOMEM_343X_CONTROL_CSIRXFE])
+   return csiphy_routing_cfg_3430(phy, iface, on, ccp2_strobe);
+}
+
 /*
  * csiphy_lanes_config - Configuration of CSIPHY lanes.
  *
diff --git a/drivers/media/platform/omap3isp/ispreg.h 
b/drivers/media/platform/omap3isp/ispreg.h
index 084ea77..66d2b42 100644
--- a/drivers/media/platform/omap3isp/ispreg.h
+++ b/drivers/media/platform/omap3isp/ispreg.h
@@ -1583,4 +1583,26 @@
 #define ISPCSIPHY_REG2_CCP2_SYNC_PATTERN_MASK  \
(0x7f  ISPCSIPHY_REG2_CCP2_SYNC_PATTERN_SHIFT)
 
+/* 
-
+ * CONTROL registers for CSI-2 phy routing
+ */
+
+/* OMAP343X_CONTROL_CSIRXFE */
+#define OMAP343X_CONTROL_CSIRXFE_CSIB_INV  (1  7)
+#define OMAP343X_CONTROL_CSIRXFE_RESENABLE (1  8)
+#define OMAP343X_CONTROL_CSIRXFE_SELFORM   (1  10)
+#define OMAP343X_CONTROL_CSIRXFE_PWRDNZ(1  12)
+#define OMAP343X_CONTROL_CSIRXFE_RESET (1  13)
+
+/* OMAP3630_CONTROL_CAMERA_PHY_CTRL */
+#define OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY1_SHIFT2
+#define 

Re: [PATCH 0/4] cpufreq: OMAP: fixes for v3.7-rc2

2012-10-07 Thread Rafael J. Wysocki
On Wednesday 03 of October 2012 16:00:25 Kevin Hilman wrote:
 From: Kevin Hilman khil...@ti.com
 
 Here's a series with a couple bug fixes and a couple fixes that
 make this driver support newer OMAP-based SoCs.
 
 The 'get_cpu_device' patch is needed due to a change in the OMAP
 OMAP PM core code which enforces use of get_cpu_device() instead of
 a deprecated OMAP-specific API.
 
 The usage of plat/*.h headers breaks single zImage, so platforms are
 cleaning up and/or removing plat/*.h so the driver needs to be fixed
 accordingly.
 
 This series is based on the merge of Rafael's pm-for-3.7-rc1 tag into
 Linus' master branch: commit 16642a2e7be23bbda013fc32d8f6c68982eab603.
 
 Tested CPUfreq on OMAP platforms: 3430/n900, 3530/Overo,
 3730/OveroSTORM, 3730/Beagle-XM, 4430/Panda.
 
 Rafael, if you're OK with this series, I'll get a pull request
 ASAP so it can be included for v3.7-rc2.

The patches are fine by me, but there may be a bit of a timing issue with
them, because I'll be travelling between October 12 and October 21 inclusive
and I won't be pushing stuff to kernel.org during that time.

So I think it would be better to merge this material through the arm-soc tree,
if that's not a problem.  If you decide to do so, please feel free to add my
ACK to the patches.

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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] usb: otg: isp1301_omap: fix potential NULL pointer dereference

2012-10-07 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

The dereference should be moved below the NULL test.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/usb/otg/isp1301_omap.c | 32 +++-
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
index ceee211..3a1f8e2 100644
--- a/drivers/usb/otg/isp1301_omap.c
+++ b/drivers/usb/otg/isp1301_omap.c
@@ -1279,9 +1279,13 @@ static int isp1301_otg_enable(struct isp1301 *isp)
 static int
 isp1301_set_host(struct usb_otg *otg, struct usb_bus *host)
 {
-   struct isp1301  *isp = container_of(otg-phy, struct isp1301, phy);
+   struct isp1301 *isp;
 
-   if (!otg || isp != the_transceiver)
+   if (!otg)
+   return -ENODEV;
+
+   isp = container_of(otg-phy, struct isp1301, phy);
+   if (isp != the_transceiver)
return -ENODEV;
 
if (!host) {
@@ -1335,9 +1339,13 @@ isp1301_set_host(struct usb_otg *otg, struct usb_bus 
*host)
 static int
 isp1301_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget)
 {
-   struct isp1301  *isp = container_of(otg-phy, struct isp1301, phy);
+   struct isp1301 *isp;
+
+   if (!otg)
+   return -ENODEV;
 
-   if (!otg || isp != the_transceiver)
+   isp = container_of(otg-phy, struct isp1301, phy);
+   if (isp != the_transceiver)
return -ENODEV;
 
if (!gadget) {
@@ -1415,11 +1423,14 @@ isp1301_set_power(struct usb_phy *dev, unsigned mA)
 static int
 isp1301_start_srp(struct usb_otg *otg)
 {
-   struct isp1301  *isp = container_of(otg-phy, struct isp1301, phy);
+   struct isp1301  *isp;
u32 otg_ctrl;
 
-   if (!otg || isp != the_transceiver
-   || isp-phy.state != OTG_STATE_B_IDLE)
+   if (!otg)
+   return -ENODEV;
+
+   isp = container_of(otg-phy, struct isp1301, phy);
+   if (isp != the_transceiver || isp-phy.state != OTG_STATE_B_IDLE)
return -ENODEV;
 
otg_ctrl = omap_readl(OTG_CTRL);
@@ -1443,10 +1454,13 @@ static int
 isp1301_start_hnp(struct usb_otg *otg)
 {
 #ifdef CONFIG_USB_OTG
-   struct isp1301  *isp = container_of(otg-phy, struct isp1301, phy);
+   struct isp1301 *isp;
u32 l;
 
-   if (!otg || isp != the_transceiver)
+   if (!otg)
+   return -ENODEV;
+   isp = container_of(otg-phy, struct isp1301, phy);
+   if (isp != the_transceiver)
return -ENODEV;
if (otg-default_a  (otg-host == NULL || !otg-host-b_hnp_enable))
return -ENOTCONN;

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


Re: ARM: OMAP: fix new sparse warnings

2012-10-07 Thread Paul Walmsley

Here's an updated version of this one that drops the debug-devices.c 
change.   That will be dealt with in a separate patch.


- Paul

From: Paul Walmsley p...@pwsan.com
Date: Sun, 7 Oct 2012 13:10:00 -0600
Subject: [PATCH] ARM: OMAP: omap3evm: fix new sparse warning

Commit e54adb1e79762d3591459e5b0e9b9ff578e33fdb (ARM: OMAP: omap3evm:
cleanup revision bits) adds a new sparse[1] warning:

arch/arm/mach-omap2/board-omap3evm.c:90:4: warning: symbol 'get_omap3_evm_rev' 
was not declared. Should it be static?

This symbol no longer appears to be used outside this file, so mark it
static and remove the export.

...

1. https://sparse.wiki.kernel.org/index.php/Main_Page

Signed-off-by: Paul Walmsley p...@pwsan.com
Cc: Igor Grinberg grinb...@compulab.co.il
Cc: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-omap3evm.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index c64e565..184ef21 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -88,11 +88,10 @@ enum {
 
 static u8 omap3_evm_version;
 
-u8 get_omap3_evm_rev(void)
+static u8 get_omap3_evm_rev(void)
 {
return omap3_evm_version;
 }
-EXPORT_SYMBOL(get_omap3_evm_rev);
 
 static void __init omap3_evm_get_revision(void)
 {
-- 
1.7.10.4

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


[PATCH] ARM: OMAP: move old debug-devices.c and debug-leds.c to be OMAP2+ only for now

2012-10-07 Thread Paul Walmsley

Commit 801475ccb2b2c1928b22aec4b9e5285d9e347602 (ARM: OMAP: move
debug_card_init() function) results in the following new sparse[1]
warning:

arch/arm/plat-omap/debug-devices.c:71:12: warning: symbol 'debug_card_init' was 
not declared. Should it be static?

Normally this could be fixed by including the appropriate header file
in plat-omap/debug-devices.c, but the header file now exists only in
mach-omap2/, so this would require a sideways include and is thus
impractical.  It turns out that only code in mach-omap2/ currently
uses the debug-devices.c and debug-leds.c files, so move them there.
In the long term, these devices should be created by DT, and the code
should be moved into drivers/ somewhere.

While doing this migration, improve the Kconfig help text and fix
some checkpatch/CodingStyle issues.

...

1. https://sparse.wiki.kernel.org/index.php/Main_Page

Signed-off-by: Paul Walmsley p...@pwsan.com
Cc: Igor Grinberg grinb...@compulab.co.il
Cc: Tony Lindgren t...@atomide.com
---

 arch/arm/mach-omap2/Kconfig|   13 +
 arch/arm/mach-omap2/Makefile   |6 ++
 arch/arm/{plat-omap = mach-omap2}/debug-devices.c |7 +--
 arch/arm/{plat-omap = mach-omap2}/debug-leds.c|7 ++-
 arch/arm/plat-omap/Kconfig |9 -
 arch/arm/plat-omap/Makefile|2 --
 6 files changed, 26 insertions(+), 18 deletions(-)
 rename arch/arm/{plat-omap = mach-omap2}/debug-devices.c (93%)
 rename arch/arm/{plat-omap = mach-omap2}/debug-leds.c (96%)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index a6219ea..3ba2d5f 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -370,6 +370,19 @@ config MACH_OMAP4_PANDA
select OMAP_PACKAGE_CBS
select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
+config OMAP_DEBUG_DEVICES
+   bool
+   help
+ Partial support for some peripherals on some debug daughtercards
+ that can be attached to some older TI reference boards.
+
+config OMAP_DEBUG_LEDS
+   def_bool y if NEW_LEDS
+   depends on OMAP_DEBUG_DEVICES
+   help
+ Enables the use of some debugging LEDs that are present on the
+ debug daughtercards on some older TI reference boards.
+
 config OMAP3_EMU
bool OMAP3 debugging peripherals
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fe40d9e..12fc983 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -280,3 +280,9 @@ emac-$(CONFIG_TI_DAVINCI_EMAC)  := am35xx-emac.o
 obj-y  += $(emac-m) $(emac-y)
 
 obj-y  += common-board-devices.o twl-common.o
+
+
+# Debug devices available on some TI board daughtercards -- optional
+
+obj-$(CONFIG_OMAP_DEBUG_DEVICES)   += debug-devices.o
+obj-$(CONFIG_OMAP_DEBUG_LEDS)  += debug-leds.o
diff --git a/arch/arm/plat-omap/debug-devices.c 
b/arch/arm/mach-omap2/debug-devices.c
similarity index 93%
rename from arch/arm/plat-omap/debug-devices.c
rename to arch/arm/mach-omap2/debug-devices.c
index c7a4c09..00407af1 100644
--- a/arch/arm/plat-omap/debug-devices.c
+++ b/arch/arm/mach-omap2/debug-devices.c
@@ -17,7 +17,10 @@
 
 #include mach/hardware.h
 
-/* Many OMAP development platforms reuse the same debug board; these
+#include debug-devices.h
+
+/*
+ * Many OMAP development platforms reuse the same debug board; these
  * platforms include H2, H3, H4, and Perseus2.
  */
 
@@ -80,7 +83,7 @@ int __init debug_card_init(u32 addr, unsigned gpio)
 
status = gpio_request(gpio, SMC91x irq);
if (status  0) {
-   printk(KERN_ERR GPIO%d unavailable for smc91x IRQ\n, gpio);
+   pr_err(GPIO%d unavailable for smc91x IRQ\n, gpio);
return status;
}
gpio_direction_input(gpio);
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/mach-omap2/debug-leds.c
similarity index 96%
rename from arch/arm/plat-omap/debug-leds.c
rename to arch/arm/mach-omap2/debug-leds.c
index ea29bbe..c12350b 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/mach-omap2/debug-leds.c
@@ -146,11 +146,8 @@ static struct platform_driver led_driver = {
 
 static int __init fpga_init(void)
 {
-   if (machine_is_omap_h4()
-   || machine_is_omap_h3()
-   || machine_is_omap_h2()
-   || machine_is_omap_perseus2()
-   )
+   if (machine_is_omap_h4() || machine_is_omap_h3() ||
+   machine_is_omap_h2() || machine_is_omap_perseus2())
return platform_driver_register(led_driver);
return 0;
 }
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index ca83a76..4ae003f 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -36,15 +36,6 @@ endchoice
 
 comment OMAP Feature 

RE: [PATCH v2 0/7] uio_pruss cleanup and platform support

2012-10-07 Thread Hebbar, Gururaja
On Sat, Oct 06, 2012 at 02:58:26, Porter, Matt wrote:
 On Fri, Oct 05, 2012 at 04:43:56AM +, Hebbar, Gururaja wrote:
  Matt,
  
  On Wed, Oct 03, 2012 at 20:30:58, Porter, Matt wrote:
   On Fri, Sep 28, 2012 at 03:37:45PM -0400, Matt Porter wrote:
Changes since v1:
- Replaced uio_pruss private SRAM API use with genalloc
- Added DA850 platform device and clock support
- Added DA850 L3 RAM gen_pool support
- Split out DT binding

This series enables uio_pruss on both DA850 and AM33xx. The driver
previously was not enabled by any platform and the private SRAM API
was accessing an invalid SRAM bank for use on DA850. For AM33xx,
DT, pinctrl, and runtime PM support are added since AM33xx only
boots via DT.
   
   I'm dropping AM33xx/OMAP support from v3 for this series 
  
  Just for my clarification, I believe you will be taking up AM33xx/OMAP 
  SRAM support later once you have completed supporting DaVinci. Right?
 
 There's no SRAM support for uio_pruss to be handled for AM33xx, 

Sorry for not being clearer.

I was referring to adding SRAM support for McASP module on AM335x platform.


 but I
 will be posting a separate series with the DT portion and some alternate
 hard reset handling implementation. I find the private OMAP reset api to
 be very ugly but we might have to go with that for now. I didn't want
 the OMAP hard reset portion to hold up the more important part of this
 cleanup.
 
 -Matt
 
   since the
   focus has turned to fixing Davinci SRAM to provide genalloc support
   and the associated use of that in the driver.
   
   I'll have a separate series with AM33xx support since dealing cleanly
   with external resets on OMAP is a bigger issue.
   
   -Matt
   ___
   Davinci-linux-open-source mailing list
   davinci-linux-open-sou...@linux.davincidsp.com
   http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
   
  
  
  Regards, 
  Gururaja
  ___
  Davinci-linux-open-source mailing list
  davinci-linux-open-sou...@linux.davincidsp.com
  http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
 


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


Re: [PATCH 3/3] ARM: OMAP: ocp2scp: create omap device for ocp2scp

2012-10-07 Thread kishon

Hi,

On Saturday 06 October 2012 04:00 AM, Sergei Shtylyov wrote:

Hello.

On 05-10-2012 12:07, Kishon Vijay Abraham I wrote:


Platfrom device for ocp2scp is created using omap_device_build in
devices file. This is used for both omap4(musb) and omap5(dwc3).

Signed-off-by: Kishon Vijay Abraham Ikis...@ti.com
---
  arch/arm/mach-omap2/devices.c |   72
+
  1 file changed, 72 insertions(+)

diff --git a/arch/arm/mach-omap2/devices.c
b/arch/arm/mach-omap2/devices.c
index c8c2117..e2ba505 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c

[...]

@@ -613,6 +614,76 @@ static void omap_init_vout(void)

[...]


+static void omap_init_ocp2scp(void)
+{
+struct omap_hwmod*oh;
+struct platform_device*pdev;
+intbus_id = -1, dev_cnt = 0, i;
+struct omap_ocp2scp_dev*ocp2scp_dev;
+const char*oh_name, *name;
+struct omap_ocp2scp_platform_data *pdata;
+
+oh_name = ocp2scp_usb_phy;
+name= omap-ocp2scp;
+
+oh = omap_hwmod_lookup(oh_name);
+if (!oh) {
+pr_err(%s: could not find omap_hwmod for %s\n, __func__,
+oh_name);
+return;
+}
+
+pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+if (!pdata) {
+pr_err(%s: No memory for ocp2scp pdata\n, __func__);
+return;
+}
+
+ocp2scp_dev = oh-dev_attr;
+dev_cnt = count_ocp2scp_devices(ocp2scp_dev);
+
+if (!dev_cnt) {
+pr_err(%s: No devices connected to ocp2scp\n, __func__);
+return;


Don't you leak 'pdata' here?


+}
+
+pdata-devices = kzalloc(sizeof(struct omap_ocp2scp_dev *)
+* dev_cnt, GFP_KERNEL);
+if (!pdata-devices) {
+pr_err(%s: No memory for ocp2scp pdata devices\n, __func__);
+return;
+}
+
+for (i = 0; i  dev_cnt; i++, ocp2scp_dev++)
+pdata-devices[i] = ocp2scp_dev;
+
+pdata-dev_cnt= dev_cnt;
+
+pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata),
NULL,
+0, false);
+if (IS_ERR(pdev)) {
+pr_err(Could not build omap_device for %s %s\n,
+name, oh_name);
+return;


Don't you leak 'pdata' and 'pdata-devices' here?


Will re-post the patch fixing it.

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


[PATCH v2 00/14] OMAP-GPMC related cleanup for common zImage

2012-10-07 Thread Afzal Mohammed
Hi,

This version(v2) of gpmc related cleanup for common zImage compared to
initial version, resolves build error upon selecting BCH CONFIG option.
Also a trivial patch on gpmc header removal from nand driver has been
squashed with patch that removes nand driver dependency on gpmc header
file.

This series cleans up omap-gpmc related code so that omap can
be a part of common zImage.

This series moves gpmc.h from plat-omap/include/plat to mach-omap2
so that header file is local.

Patches 1-4 qualifies as -rc material.

Patch 1 is an already posted one, has been pulled into this series.

Patches 5-6 removes necessity of cpu.h from onenand driver based
on Tony's suggestion.

Patches 7  8 cleans up the already moved platform data header files
to contain only platform data. Also gpmc-nand information is moved
to nand platform data header.

Patches 9-13 makes nand driver independent of gpmc header file

And the final patch localizes gpmc header.

This has been tested on omap3evm.

This series is available
@ git://gitorious.org/x0148406-public/linux-kernel.git gpmc-czimage-v2
and is based on
linux-next (next-20121005)
and is dependent on
http://marc.info/?l=linux-omapm=134945131602622w=2

Regards
Afzal


Afzal Mohammed (14):
  ARM: OMAP2+: gpmc: annotate exit sections properly
  mtd: onenand: omap: cleanup gpmc dependency
  mtd: nand: omap: free region as per resource size
  mtd: nand: omap: read nand using register address
  ARM: OMAP2+: onenand: connected soc info in pdata
  mtd: onenand: omap: use pdata info instead of cpu_is
  ARM: OMAP2+: onenand: header cleanup
  ARM: OMAP2+: nand: header cleanup
  mtd: nand: omap: bring in gpmc nand macros
  ARM: OMAP2+: nand: bch capability check
  ARM: OMAP2+: gpmc: nand register helper bch update
  mtd: nand: omap: handle gpmc bch[48]
  ARM: OMAP2+: gpmc: remove exported nand functions
  ARM: OMAP2+: gpmc: localize gpmc header

 arch/arm/mach-omap2/board-2430sdp.c |   2 +-
 arch/arm/mach-omap2/board-3430sdp.c |   2 +-
 arch/arm/mach-omap2/board-apollon.c |   2 +-
 arch/arm/mach-omap2/board-cm-t35.c  |   5 +-
 arch/arm/mach-omap2/board-cm-t3517.c|   5 +-
 arch/arm/mach-omap2/board-devkit8000.c  |   2 +-
 arch/arm/mach-omap2/board-flash.c   |   7 +-
 arch/arm/mach-omap2/board-flash.h   |   2 +-
 arch/arm/mach-omap2/board-h4.c  |   2 +-
 arch/arm/mach-omap2/board-igep0020.c|   3 +-
 arch/arm/mach-omap2/board-ldp.c |   2 +-
 arch/arm/mach-omap2/board-n8x0.c|   1 +
 arch/arm/mach-omap2/board-omap3beagle.c |   2 +-
 arch/arm/mach-omap2/board-omap3logic.c  |   2 +-
 arch/arm/mach-omap2/board-omap3pandora.c|   3 +-
 arch/arm/mach-omap2/board-omap3stalker.c|   2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c  |   2 +-
 arch/arm/mach-omap2/board-overo.c   |   2 +-
 arch/arm/mach-omap2/board-rm680.c   |   3 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c|   3 +-
 arch/arm/mach-omap2/board-rx51.c|   2 +-
 arch/arm/mach-omap2/board-zoom-debugboard.c |   2 +-
 arch/arm/mach-omap2/common-board-devices.c  |   1 -
 arch/arm/mach-omap2/gpmc-nand.c |  81 +++--
 arch/arm/mach-omap2/gpmc-nand.h |  27 ++
 arch/arm/mach-omap2/gpmc-onenand.c  |   9 +-
 arch/arm/mach-omap2/gpmc-onenand.h  |  24 ++
 arch/arm/mach-omap2/gpmc-smc91x.c   |   2 +-
 arch/arm/mach-omap2/gpmc-smsc911x.c |   2 +-
 arch/arm/mach-omap2/gpmc.c  | 459 ++--
 arch/arm/mach-omap2/gpmc.h  | 154 
 arch/arm/mach-omap2/pm34xx.c|   2 +-
 arch/arm/mach-omap2/usb-tusb6010.c  |   2 +-
 arch/arm/plat-omap/include/plat/gpmc.h  | 209 ---
 drivers/mtd/nand/omap2.c| 125 +--
 drivers/mtd/onenand/omap2.c |   9 +-
 include/linux/platform_data/mtd-nand-omap2.h|  46 ++-
 include/linux/platform_data/mtd-onenand-omap2.h |  20 +-
 38 files changed, 472 insertions(+), 758 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.h
 create mode 100644 arch/arm/mach-omap2/gpmc-onenand.h
 create mode 100644 arch/arm/mach-omap2/gpmc.h
 delete mode 100644 arch/arm/plat-omap/include/plat/gpmc.h

-- 
1.7.12

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


[PATCH v2 02/14] mtd: onenand: omap: cleanup gpmc dependency

2012-10-07 Thread Afzal Mohammed
requesting, freeing gpmc cs is now handled fully
by gpmc, remove left out gpmc dependency as well
as unnecessary include of gpmc.h

Signed-off-by: Afzal Mohammed af...@ti.com
---
 drivers/mtd/onenand/omap2.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 1961be9..d7ef2c9 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -38,7 +38,6 @@
 #include linux/regulator/consumer.h
 
 #include asm/mach/flash.h
-#include plat/gpmc.h
 #include linux/platform_data/mtd-onenand-omap2.h
 #include asm/gpio.h
 
@@ -803,7 +802,6 @@ static int __devexit omap2_onenand_remove(struct 
platform_device *pdev)
}
iounmap(c-onenand.base);
release_mem_region(c-phys_base, c-mem_size);
-   gpmc_cs_free(c-gpmc_cs);
kfree(c);
 
return 0;
-- 
1.7.12

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


[PATCH v2 03/14] mtd: nand: omap: free region as per resource size

2012-10-07 Thread Afzal Mohammed
memory as is now obtained via resource, upon freeing use
resource size. This also helps get rid of one macro.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 drivers/mtd/nand/omap2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 5b31386..4c33135 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1513,7 +1513,7 @@ static int omap_nand_remove(struct platform_device *pdev)
/* Release NAND device, its internal structures and partitions */
nand_release(info-mtd);
iounmap(info-nand.IO_ADDR_R);
-   release_mem_region(info-phys_base, NAND_IO_SIZE);
+   release_mem_region(info-phys_base, info-mem_size);
kfree(info);
return 0;
 }
-- 
1.7.12

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


[PATCH v2 01/14] ARM: OMAP2+: gpmc: annotate exit sections properly

2012-10-07 Thread Afzal Mohammed
compiler complained,
`gpmc_remove' referenced in section `.data' of arch/arm/mach-omap2/built-in.o: 
defined in discarded section `.exit.text' of arch/arm/mach-omap2/built-in.o

Annotate gpmc_remove function and dependents with __devexit.

Reported-by: Tony Lindgren t...@atomide.com
Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/gpmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 2cbdcb9..163458d 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -886,7 +886,7 @@ static int gpmc_setup_irq(void)
return request_irq(gpmc_irq, gpmc_handle_irq, 0, gpmc, NULL);
 }
 
-static __exit int gpmc_free_irq(void)
+static __devexit int gpmc_free_irq(void)
 {
int i;
 
@@ -992,7 +992,7 @@ static __devinit int gpmc_probe(struct platform_device 
*pdev)
return 0;
 }
 
-static __exit int gpmc_remove(struct platform_device *pdev)
+static __devexit int gpmc_remove(struct platform_device *pdev)
 {
gpmc_free_irq();
gpmc_mem_exit();
-- 
1.7.12

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


[PATCH v2 04/14] mtd: nand: omap: read nand using register address

2012-10-07 Thread Afzal Mohammed
Now that gpmc-nand registers are available in driver, use it
to read nand data.

65b97cf  mtd: nand: omap2: handle nand on gpmc modified all
other instances. After initial versions of that patch, a new
change added reading nand data using gpmc exposed function.
In the final version this change was not taken care.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 drivers/mtd/nand/omap2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 4c33135..abfc602 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -996,7 +996,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip 
*chip)
cond_resched();
}
 
-   status = gpmc_nand_read(info-gpmc_cs, GPMC_NAND_DATA);
+   status = readb(info-reg.gpmc_nand_data);
return status;
 }
 
-- 
1.7.12

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


[PATCH v2 05/14] ARM: OMAP2+: onenand: connected soc info in pdata

2012-10-07 Thread Afzal Mohammed
onenand driver needs to know whether soc is falling under
34xx family to properly handle onenand. But driver is not
supposed to do cpu_is_* check, hence educate platform data
with this information. Driver can make use of it to avoid
cpu_is_* check.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/gpmc-onenand.c  | 5 +
 include/linux/platform_data/mtd-onenand-omap2.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/gpmc-onenand.c 
b/arch/arm/mach-omap2/gpmc-onenand.c
index 544d501..f0b677a 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -409,6 +409,11 @@ void __init gpmc_onenand_init(struct 
omap_onenand_platform_data *_onenand_data)
gpmc_onenand_data-flags |= ONENAND_SYNC_READ;
}
 
+   if (cpu_is_omap34xx())
+   gpmc_onenand_data-flags |= ONENAND_IN_OMAP34XX;
+   else
+   gpmc_onenand_data-flags = ~ONENAND_IN_OMAP34XX;
+
err = gpmc_cs_request(gpmc_onenand_data-cs, ONENAND_IO_SIZE,
(unsigned long *)gpmc_onenand_resource.start);
if (err  0) {
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h 
b/include/linux/platform_data/mtd-onenand-omap2.h
index 21bb0ff..ef9c60d 100644
--- a/include/linux/platform_data/mtd-onenand-omap2.h
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
@@ -14,6 +14,7 @@
 
 #define ONENAND_SYNC_READ  (1  0)
 #define ONENAND_SYNC_READWRITE (1  1)
+#defineONENAND_IN_OMAP34XX (1  2)
 
 struct omap_onenand_platform_data {
int cs;
-- 
1.7.12

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


[PATCH v2 06/14] mtd: onenand: omap: use pdata info instead of cpu_is

2012-10-07 Thread Afzal Mohammed
platform data now contains a field to indicate whether
soc belongs to omap34xx family, use it instead of
cpu_is_* check.

This helps in removing dependency of platform specific
header file - cpu.h

Signed-off-by: Afzal Mohammed af...@ti.com
---
 drivers/mtd/onenand/omap2.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index d7ef2c9..959f465 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -42,7 +42,6 @@
 #include asm/gpio.h
 
 #include plat/dma.h
-#include plat/cpu.h
 
 #define DRIVER_NAME omap2-onenand
 
@@ -62,6 +61,7 @@ struct omap2_onenand {
int freq;
int (*setup)(void __iomem *base, int *freq_ptr);
struct regulator *regulator;
+   u8 flags;
 };
 
 static void omap2_onenand_dma_cb(int lch, u16 ch_status, void *data)
@@ -154,7 +154,7 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int 
state)
if (!(syscfg  ONENAND_SYS_CFG1_IOBE)) {
syscfg |= ONENAND_SYS_CFG1_IOBE;
write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
-   if (cpu_is_omap34xx())
+   if (c-flags  ONENAND_IN_OMAP34XX)
/* Add a delay to let GPIO settle */
syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
}
@@ -638,6 +638,7 @@ static int __devinit omap2_onenand_probe(struct 
platform_device *pdev)
 
init_completion(c-irq_done);
init_completion(c-dma_done);
+   c-flags = pdata-flags;
c-gpmc_cs = pdata-cs;
c-gpio_irq = pdata-gpio_irq;
c-dma_channel = pdata-dma_channel;
@@ -728,7 +729,7 @@ static int __devinit omap2_onenand_probe(struct 
platform_device *pdev)
this = c-onenand;
if (c-dma_channel = 0) {
this-wait = omap2_onenand_wait;
-   if (cpu_is_omap34xx()) {
+   if (c-flags  ONENAND_IN_OMAP34XX) {
this-read_bufferram = omap3_onenand_read_bufferram;
this-write_bufferram = omap3_onenand_write_bufferram;
} else {
-- 
1.7.12

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


[PATCH v2 07/14] ARM: OMAP2+: onenand: header cleanup

2012-10-07 Thread Afzal Mohammed
For common arm zImage existing onenand header file
in platform specific location was moved to generic
platform data location, but it contained more than
platform data, remove it. New local header has been
created for exposing functions.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/board-flash.c   |  1 +
 arch/arm/mach-omap2/board-igep0020.c|  1 +
 arch/arm/mach-omap2/board-n8x0.c|  1 +
 arch/arm/mach-omap2/board-rm680.c   |  1 +
 arch/arm/mach-omap2/board-rx51-peripherals.c|  1 +
 arch/arm/mach-omap2/gpmc-onenand.c  |  1 +
 arch/arm/mach-omap2/gpmc-onenand.h  | 24 
 include/linux/platform_data/mtd-onenand-omap2.h | 19 +++
 8 files changed, 33 insertions(+), 16 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc-onenand.h

diff --git a/arch/arm/mach-omap2/board-flash.c 
b/arch/arm/mach-omap2/board-flash.c
index f8b30cb..de68fdf 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -25,6 +25,7 @@
 
 #include common.h
 #include board-flash.h
+#include gpmc-onenand.h
 
 #define REG_FPGA_REV   0x10
 #define REG_FPGA_DIP_SWITCH_INPUT2 0x60
diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index f6b3ed0..83c6efa 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -43,6 +43,7 @@
 #include common-board-devices.h
 #include board-flash.h
 #include control.h
+#include gpmc-onenand.h
 
 #define IGEP2_SMSC911X_CS   5
 #define IGEP2_SMSC911X_GPIO 176
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index d95f727..92b1916 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -32,6 +32,7 @@
 #include plat/mmc.h
 
 #include mux.h
+#include gpmc-onenand.h
 
 #define TUSB6010_ASYNC_CS  1
 #define TUSB6010_SYNC_CS   4
diff --git a/arch/arm/mach-omap2/board-rm680.c 
b/arch/arm/mach-omap2/board-rm680.c
index 45997bf..154cf33 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -33,6 +33,7 @@
 #include hsmmc.h
 #include sdram-nokia.h
 #include common-board-devices.h
+#include gpmc-onenand.h
 
 static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
REGULATOR_SUPPLY(vmmc, omap_hsmmc.1),
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index ed85fb8..aa6a2a4 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -54,6 +54,7 @@
 #include mux.h
 #include hsmmc.h
 #include common-board-devices.h
+#include gpmc-onenand.h
 
 #define SYSTEM_REV_B_USES_VAUX30x1699
 #define SYSTEM_REV_S_USES_VAUX3 0x8
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c 
b/arch/arm/mach-omap2/gpmc-onenand.c
index f0b677a..29671cc 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -23,6 +23,7 @@
 #include plat/gpmc.h
 
 #include soc.h
+#include gpmc-onenand.h
 
 #defineONENAND_IO_SIZE SZ_128K
 
diff --git a/arch/arm/mach-omap2/gpmc-onenand.h 
b/arch/arm/mach-omap2/gpmc-onenand.h
new file mode 100644
index 000..216f23a
--- /dev/null
+++ b/arch/arm/mach-omap2/gpmc-onenand.h
@@ -0,0 +1,24 @@
+/*
+ *  arch/arm/mach-omap2/gpmc-onenand.h
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#ifndef__OMAP2_GPMC_ONENAND_H
+#define__OMAP2_GPMC_ONENAND_H
+
+#include linux/platform_data/mtd-onenand-omap2.h
+
+#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
+extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
+#else
+#define board_onenand_data NULL
+static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
+{
+}
+#endif
+
+#endif
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h 
b/include/linux/platform_data/mtd-onenand-omap2.h
index ef9c60d..685af7e 100644
--- a/include/linux/platform_data/mtd-onenand-omap2.h
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
@@ -9,6 +9,9 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef__MTD_ONENAND_OMAP2_H
+#define__MTD_ONENAND_OMAP2_H
+
 #include linux/mtd/mtd.h
 #include linux/mtd/partitions.h
 
@@ -27,20 +30,4 @@ struct omap_onenand_platform_data {
u8  regulator_can_sleep;
u8  skip_initial_unlocking;
 };
-
-#define ONENAND_MAX_PARTITIONS 8
-
-#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
-   defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
-
-extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
-
-#else
-
-#define board_onenand_data NULL
-
-static inline void 

[PATCH v2 08/14] ARM: OMAP2+: nand: header cleanup

2012-10-07 Thread Afzal Mohammed
For common arm zImage existing nand header file
in platform specific location was moved to generic
platform data location, but it contained more than
platform data, remove it. New local header has been
created for exposing functions.

Also move gpmc-nand platform data to platform header
meant for nand from gpmc header file

Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/board-cm-t35.c   |  3 +-
 arch/arm/mach-omap2/board-cm-t3517.c |  3 +-
 arch/arm/mach-omap2/board-flash.c|  4 +--
 arch/arm/mach-omap2/board-omap3pandora.c |  3 +-
 arch/arm/mach-omap2/common-board-devices.c   |  1 -
 arch/arm/mach-omap2/gpmc-nand.c  | 54 +++-
 arch/arm/mach-omap2/gpmc-nand.h  | 27 ++
 arch/arm/mach-omap2/gpmc.c   |  2 ++
 arch/arm/plat-omap/include/plat/gpmc.h   | 28 ++-
 include/linux/platform_data/mtd-nand-omap2.h | 41 ++---
 10 files changed, 98 insertions(+), 68 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.h

diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 376d26e..fef68de 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -53,6 +53,7 @@
 #include sdram-micron-mt46h32m32lf-6.h
 #include hsmmc.h
 #include common-board-devices.h
+#include gpmc-nand.h
 
 #define CM_T35_GPIO_PENDOWN57
 #define SB_T35_USB_HUB_RESET_GPIO  167
@@ -181,7 +182,7 @@ static struct omap_nand_platform_data cm_t35_nand_data = {
 
 static void __init cm_t35_init_nand(void)
 {
-   if (gpmc_nand_init(cm_t35_nand_data)  0)
+   if (gpmc_nand_init(cm_t35_nand_data, NULL)  0)
pr_err(CM-T35: Unable to register NAND device\n);
 }
 #else
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c 
b/arch/arm/mach-omap2/board-cm-t3517.c
index 59c0a45..3a19e80 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -49,6 +49,7 @@
 #include control.h
 #include common-board-devices.h
 #include am35xx-emac.h
+#include gpmc-nand.h
 
 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
 static struct gpio_led cm_t3517_leds[] = {
@@ -240,7 +241,7 @@ static struct omap_nand_platform_data cm_t3517_nand_data = {
 
 static void __init cm_t3517_init_nand(void)
 {
-   if (gpmc_nand_init(cm_t3517_nand_data)  0)
+   if (gpmc_nand_init(cm_t3517_nand_data, NULL)  0)
pr_err(CM-T3517: NAND initialization failed\n);
 }
 #else
diff --git a/arch/arm/mach-omap2/board-flash.c 
b/arch/arm/mach-omap2/board-flash.c
index de68fdf..776e57a 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -26,6 +26,7 @@
 #include common.h
 #include board-flash.h
 #include gpmc-onenand.h
+#include gpmc-nand.h
 
 #define REG_FPGA_REV   0x10
 #define REG_FPGA_DIP_SWITCH_INPUT2 0x60
@@ -139,10 +140,9 @@ __init board_nand_init(struct mtd_partition *nand_parts, 
u8 nr_parts, u8 cs,
board_nand_data.parts   = nand_parts;
board_nand_data.nr_parts= nr_parts;
board_nand_data.devsize = nand_type;
-   board_nand_data.gpmc_t  = gpmc_t;
 
board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
-   gpmc_nand_init(board_nand_data);
+   gpmc_nand_init(board_nand_data, gpmc_t);
 }
 #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
 
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c 
b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4a..f286b4b 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -50,6 +50,7 @@
 #include sdram-micron-mt46h32m32lf-6.h
 #include hsmmc.h
 #include common-board-devices.h
+#include gpmc-nand.h
 
 #define PANDORA_WIFI_IRQ_GPIO  21
 #define PANDORA_WIFI_NRESET_GPIO   23
@@ -602,7 +603,7 @@ static void __init omap3pandora_init(void)
omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
usbhs_init(usbhs_bdata);
usb_musb_init(NULL);
-   gpmc_nand_init(pandora_nand_data);
+   gpmc_nand_init(pandora_nand_data, NULL);
 
/* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal(sdrc_cke0, OMAP_PIN_OUTPUT);
diff --git a/arch/arm/mach-omap2/common-board-devices.c 
b/arch/arm/mach-omap2/common-board-devices.c
index 90e0597..ad85609 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -25,7 +25,6 @@
 #include linux/spi/ads7846.h
 
 #include linux/platform_data/spi-omap2-mcspi.h
-#include linux/platform_data/mtd-nand-omap2.h
 
 #include common.h
 #include common-board-devices.h
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 4eceaca..c1b9b1d 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -20,6 +20,10 @@
 #include plat/gpmc.h
 
 

[PATCH v2 09/14] mtd: nand: omap: bring in gpmc nand macros

2012-10-07 Thread Afzal Mohammed
Bring onto driver the macros defined in gpmc.h that are
not necessary outside driver, helps in removing inclusion
of gpmc.h too. Also remove GPMC prefix on those macros to
make clear it's independence with gpmc header.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 drivers/mtd/nand/omap2.c | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index abfc602..f0a1b1d 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -110,6 +110,11 @@
 #defineECC1RESULTSIZE  0x1
 #defineECCCLEAR0x100
 #defineECC10x1
+#definePREFETCH_FIFOTHRESHOLD_MAX  0x40
+#definePREFETCH_FIFOTHRESHOLD(val) ((val)  8)
+#definePREFETCH_STATUS_COUNT(val)  (val  0x3fff)
+#definePREFETCH_STATUS_FIFO_CNT(val)   ((val  24)  0x7F)
+#defineSTATUS_BUFF_EMPTY   0x0001
 
 /* oob info generated runtime depending on ecc algorithm and layout selected */
 static struct nand_ecclayout omap_oobinfo;
@@ -269,7 +274,7 @@ static void omap_write_buf8(struct mtd_info *mtd, const 
u_char *buf, int len)
/* wait until buffer is available for write */
do {
status = readl(info-reg.gpmc_status) 
-   GPMC_STATUS_BUFF_EMPTY;
+   STATUS_BUFF_EMPTY;
} while (!status);
}
 }
@@ -307,7 +312,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const 
u_char * buf, int len)
/* wait until buffer is available for write */
do {
status = readl(info-reg.gpmc_status) 
-   GPMC_STATUS_BUFF_EMPTY;
+   STATUS_BUFF_EMPTY;
} while (!status);
}
 }
@@ -348,7 +353,7 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char 
*buf, int len)
} else {
do {
r_count = readl(info-reg.gpmc_prefetch_status);
-   r_count = GPMC_PREFETCH_STATUS_FIFO_CNT(r_count);
+   r_count = PREFETCH_STATUS_FIFO_CNT(r_count);
r_count = r_count  2;
ioread32_rep(info-nand.IO_ADDR_R, p, r_count);
p += r_count;
@@ -395,7 +400,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
} else {
while (len) {
w_count = readl(info-reg.gpmc_prefetch_status);
-   w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count);
+   w_count = PREFETCH_STATUS_FIFO_CNT(w_count);
w_count = w_count  1;
for (i = 0; (i  w_count)  len; i++, len -= 2)
iowrite16(*p++, info-nand.IO_ADDR_W);
@@ -407,7 +412,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
do {
cpu_relax();
val = readl(info-reg.gpmc_prefetch_status);
-   val = GPMC_PREFETCH_STATUS_COUNT(val);
+   val = PREFETCH_STATUS_COUNT(val);
} while (val  (tim++  limit));
 
/* disable and stop the PFPW engine */
@@ -493,7 +498,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info 
*mtd, void *addr,
do {
cpu_relax();
val = readl(info-reg.gpmc_prefetch_status);
-   val = GPMC_PREFETCH_STATUS_COUNT(val);
+   val = PREFETCH_STATUS_COUNT(val);
} while (val  (tim++  limit));
 
/* disable and stop the PFPW engine */
@@ -556,7 +561,7 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev)
u32 bytes;
 
bytes = readl(info-reg.gpmc_prefetch_status);
-   bytes = GPMC_PREFETCH_STATUS_FIFO_CNT(bytes);
+   bytes = PREFETCH_STATUS_FIFO_CNT(bytes);
bytes = bytes   0xFFFC; /* io in multiple of 4 bytes */
if (info-iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
if (this_irq == info-gpmc_irq_count)
@@ -682,7 +687,7 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd,
limit = (loops_per_jiffy *  msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
do {
val = readl(info-reg.gpmc_prefetch_status);
-   val = GPMC_PREFETCH_STATUS_COUNT(val);
+   val = PREFETCH_STATUS_COUNT(val);
cpu_relax();
} while (val  (tim++  limit));
 
-- 
1.7.12

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


[PATCH v2 10/14] ARM: OMAP2+: nand: bch capability check

2012-10-07 Thread Afzal Mohammed
Capability of bch schemes could be discovered using soc
revision checks. If soc revision indicates that selected
ecc scheme is not supported bail out.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/gpmc-nand.c | 24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index c1b9b1d..7983d54 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -90,6 +90,27 @@ static int omap2_nand_gpmc_retime(
return 0;
 }
 
+static bool __init gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
+{
+   /* support only OMAP3 class */
+   if (!cpu_is_omap34xx()) {
+   pr_err(BCH ecc is not supported on this CPU\n);
+   return 0;
+   }
+
+   /*
+* For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x=1.
+* Other chips may be added if confirmed to work.
+*/
+   if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) 
+   (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) {
+   pr_err(BCH 4-bit mode is not supported on this CPU\n);
+   return 0;
+   }
+
+   return 1;
+}
+
 int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
  struct gpmc_timings *gpmc_t)
 {
@@ -128,6 +149,9 @@ int __init gpmc_nand_init(struct omap_nand_platform_data 
*gpmc_nand_data,
 
gpmc_update_nand_reg(gpmc_nand_data-reg, gpmc_nand_data-cs);
 
+   if (!gpmc_hwecc_bch_capable(gpmc_nand_data-ecc_opt))
+   return -EINVAL;
+
err = platform_device_register(gpmc_nand_device);
if (err  0) {
dev_err(dev, Unable to register NAND device\n);
-- 
1.7.12

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


[PATCH v2 11/14] ARM: OMAP2+: gpmc: nand register helper bch update

2012-10-07 Thread Afzal Mohammed
Update helper function that provides gpmc-nand register
details for nand driver with bch register information.
Using this nand driver can be made self sufficient to
handle remaining gpmc-nand operations by itself instead
of relying on gpmc exported nand functions.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/gpmc.c   | 18 +-
 include/linux/platform_data/mtd-nand-omap2.h |  7 ++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 3a73196..eb577c5 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -61,6 +61,9 @@
 #define GPMC_ECC_SIZE_CONFIG   0x1fc
 #define GPMC_ECC1_RESULT0x200
 #define GPMC_ECC_BCH_RESULT_0   0x240   /* not available on OMAP2 */
+#defineGPMC_ECC_BCH_RESULT_1   0x244   /* not available on OMAP2 */
+#defineGPMC_ECC_BCH_RESULT_2   0x248   /* not available on OMAP2 */
+#defineGPMC_ECC_BCH_RESULT_3   0x24c   /* not available on OMAP2 */
 
 /* GPMC ECC control settings */
 #define GPMC_ECC_CTRL_ECCCLEAR 0x100
@@ -84,6 +87,7 @@
 
 #define GPMC_CS0_OFFSET0x60
 #define GPMC_CS_SIZE   0x30
+#defineGPMC_BCH_SIZE   0x10
 
 #define GPMC_MEM_START 0x
 #define GPMC_MEM_END   0x3FFF
@@ -779,6 +783,8 @@ EXPORT_SYMBOL(gpmc_prefetch_reset);
 
 void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
 {
+   int i;
+
reg-gpmc_status = gpmc_base + GPMC_STATUS;
reg-gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET +
GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs;
@@ -794,7 +800,17 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int 
cs)
reg-gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL;
reg-gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG;
reg-gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT;
-   reg-gpmc_bch_result0 = gpmc_base + GPMC_ECC_BCH_RESULT_0;
+
+   for (i = 0; i  GPMC_BCH_NUM_REMAINDER; i++) {
+   reg-gpmc_bch_result0[i] = gpmc_base + GPMC_ECC_BCH_RESULT_0 +
+  GPMC_BCH_SIZE * i;
+   reg-gpmc_bch_result1[i] = gpmc_base + GPMC_ECC_BCH_RESULT_1 +
+  GPMC_BCH_SIZE * i;
+   reg-gpmc_bch_result2[i] = gpmc_base + GPMC_ECC_BCH_RESULT_2 +
+  GPMC_BCH_SIZE * i;
+   reg-gpmc_bch_result3[i] = gpmc_base + GPMC_ECC_BCH_RESULT_3 +
+  GPMC_BCH_SIZE * i;
+   }
 }
 
 int gpmc_get_client_irq(unsigned irq_config)
diff --git a/include/linux/platform_data/mtd-nand-omap2.h 
b/include/linux/platform_data/mtd-nand-omap2.h
index e1965fe..24d32ca 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -13,6 +13,8 @@
 
 #include linux/mtd/partitions.h
 
+#defineGPMC_BCH_NUM_REMAINDER  8
+
 enum nand_io {
NAND_OMAP_PREFETCH_POLLED = 0,  /* prefetch polled mode, default */
NAND_OMAP_POLLED,   /* polled mode, without prefetch */
@@ -43,7 +45,10 @@ struct gpmc_nand_regs {
void __iomem*gpmc_ecc_control;
void __iomem*gpmc_ecc_size_config;
void __iomem*gpmc_ecc1_result;
-   void __iomem*gpmc_bch_result0;
+   void __iomem*gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
+   void __iomem*gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
+   void __iomem*gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
+   void __iomem*gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
 };
 
 struct omap_nand_platform_data {
-- 
1.7.12

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


[PATCH v2 12/14] mtd: nand: omap: handle gpmc bch[48]

2012-10-07 Thread Afzal Mohammed
gpmc-nand bch registers are now available in driver,
make use of it to handle bch[48] instead of relying
on gpmc exported functions.

And so nand driver no longer needs gpmc header, remove it.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 drivers/mtd/nand/omap2.c | 100 +--
 1 file changed, 89 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index f0a1b1d..3282b15 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -28,7 +28,6 @@
 #endif
 
 #include plat/dma.h
-#include plat/gpmc.h
 #include linux/platform_data/mtd-nand-omap2.h
 
 #defineDRIVER_NAME omap2-nand
@@ -106,6 +105,7 @@
 #defineCS_MASK 0x7
 #defineENABLE_PREFETCH (0x1  7)
 #defineDMA_MPU_MODE_SHIFT  2
+#defineECCSIZE0_SHIFT  12
 #defineECCSIZE1_SHIFT  22
 #defineECC1RESULTSIZE  0x1
 #defineECCCLEAR0x100
@@ -1034,19 +1034,45 @@ static int omap_dev_ready(struct mtd_info *mtd)
 static void omap3_enable_hwecc_bch(struct mtd_info *mtd, int mode)
 {
int nerrors;
-   unsigned int dev_width;
+   unsigned int dev_width, nsectors;
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
   mtd);
struct nand_chip *chip = mtd-priv;
+   u32 val;
 
nerrors = (info-nand.ecc.bytes == 13) ? 8 : 4;
dev_width = (chip-options  NAND_BUSWIDTH_16) ? 1 : 0;
+   nsectors = 1;
/*
 * Program GPMC to perform correction on one 512-byte sector at a time.
 * Using 4 sectors at a time (i.e. ecc.size = 2048) is also possible and
 * gives a slight (5%) performance gain (but requires additional code).
 */
-   (void)gpmc_enable_hwecc_bch(info-gpmc_cs, mode, dev_width, 1, nerrors);
+
+   writel(ECC1, info-reg.gpmc_ecc_control);
+
+   /*
+* When using BCH, sector size is hardcoded to 512 bytes.
+* Here we are using wrapping mode 6 both for reading and writing, with:
+*  size0 = 0  (no additional protected byte in spare area)
+*  size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
+*/
+   val = (32  ECCSIZE1_SHIFT) | (0  ECCSIZE0_SHIFT);
+   writel(val, info-reg.gpmc_ecc_size_config);
+
+   /* BCH configuration */
+   val = ((1 16) | /* enable BCH */
+  (((nerrors == 8) ? 1 : 0)  12) | /* 8 or 4 bits */
+  (0x06   8) | /* wrap mode = 6 */
+  (dev_width  7) | /* bus width */
+  (((nsectors-1)  0x7)   4) | /* number of sectors */
+  (info-gpmc_cs  1) | /* ECC CS */
+  (0x1));/* enable ECC */
+
+   writel(val, info-reg.gpmc_ecc_config);
+
+   /* clear ecc and enable bits */
+   writel(ECCCLEAR | ECC1, info-reg.gpmc_ecc_control);
 }
 
 /**
@@ -1060,7 +1086,32 @@ static int omap3_calculate_ecc_bch4(struct mtd_info 
*mtd, const u_char *dat,
 {
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
   mtd);
-   return gpmc_calculate_ecc_bch4(info-gpmc_cs, dat, ecc_code);
+   unsigned long nsectors, val1, val2;
+   int i;
+
+   nsectors = ((readl(info-reg.gpmc_ecc_config)  4)  0x7) + 1;
+
+   for (i = 0; i  nsectors; i++) {
+
+   /* Read hw-computed remainder */
+   val1 = readl(info-reg.gpmc_bch_result0[i]);
+   val2 = readl(info-reg.gpmc_bch_result1[i]);
+
+   /*
+* Add constant polynomial to remainder, in order to get an ecc
+* sequence of 0xFFs for a buffer filled with 0xFFs; and
+* left-justify the resulting polynomial.
+*/
+   *ecc_code++ = 0x28 ^ ((val2  12)  0xFF);
+   *ecc_code++ = 0x13 ^ ((val2   4)  0xFF);
+   *ecc_code++ = 0xcc ^ (((val2  0xF)  4)|((val1  28)  0xF));
+   *ecc_code++ = 0x39 ^ ((val1  20)  0xFF);
+   *ecc_code++ = 0x96 ^ ((val1  12)  0xFF);
+   *ecc_code++ = 0xac ^ ((val1  4)  0xFF);
+   *ecc_code++ = 0x7f ^ ((val1  0xF)  4);
+   }
+
+   return 0;
 }
 
 /**
@@ -1074,7 +1125,39 @@ static int omap3_calculate_ecc_bch8(struct mtd_info 
*mtd, const u_char *dat,
 {
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
   mtd);
-   return gpmc_calculate_ecc_bch8(info-gpmc_cs, dat, ecc_code);
+   unsigned long nsectors, val1, val2, val3, val4;
+   int i;
+
+   nsectors = ((readl(info-reg.gpmc_ecc_config)  4)  0x7) + 1;
+
+   for (i = 0; i  nsectors; i++) {
+
+  

[PATCH v2 13/14] ARM: OMAP2+: gpmc: remove exported nand functions

2012-10-07 Thread Afzal Mohammed
nand driver handles gpmc-nand block fully, hence no more
users for these exported nand functions, remove it.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/gpmc.c | 432 -
 arch/arm/plat-omap/include/plat/gpmc.h |  31 ---
 2 files changed, 463 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index eb577c5..1121248 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -150,7 +150,6 @@ static struct resource  gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
 static DEFINE_SPINLOCK(gpmc_mem_lock);
 static unsigned int gpmc_cs_map;   /* flag for cs which are initialized */
-static int gpmc_ecc_used = -EINVAL;/* cs using ecc engine */
 static struct device *gpmc_dev;
 static int gpmc_irq;
 static resource_size_t phys_base, mem_size;
@@ -171,22 +170,6 @@ static u32 gpmc_read_reg(int idx)
return __raw_readl(gpmc_base + idx);
 }
 
-static void gpmc_cs_write_byte(int cs, int idx, u8 val)
-{
-   void __iomem *reg_addr;
-
-   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
-   __raw_writeb(val, reg_addr);
-}
-
-static u8 gpmc_cs_read_byte(int cs, int idx)
-{
-   void __iomem *reg_addr;
-
-   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
-   return __raw_readb(reg_addr);
-}
-
 void gpmc_cs_write_reg(int cs, int idx, u32 val)
 {
void __iomem *reg_addr;
@@ -563,44 +546,6 @@ void gpmc_cs_free(int cs)
 EXPORT_SYMBOL(gpmc_cs_free);
 
 /**
- * gpmc_read_status - read access request to get the different gpmc status
- * @cmd: command type
- * @return status
- */
-int gpmc_read_status(int cmd)
-{
-   int status = -EINVAL;
-   u32 regval = 0;
-
-   switch (cmd) {
-   case GPMC_GET_IRQ_STATUS:
-   status = gpmc_read_reg(GPMC_IRQSTATUS);
-   break;
-
-   case GPMC_PREFETCH_FIFO_CNT:
-   regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
-   status = GPMC_PREFETCH_STATUS_FIFO_CNT(regval);
-   break;
-
-   case GPMC_PREFETCH_COUNT:
-   regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
-   status = GPMC_PREFETCH_STATUS_COUNT(regval);
-   break;
-
-   case GPMC_STATUS_BUFFER:
-   regval = gpmc_read_reg(GPMC_STATUS);
-   /* 1 : buffer is available to write */
-   status = regval  GPMC_STATUS_BUFF_EMPTY;
-   break;
-
-   default:
-   printk(KERN_ERR gpmc_read_status: Not supported\n);
-   }
-   return status;
-}
-EXPORT_SYMBOL(gpmc_read_status);
-
-/**
  * gpmc_cs_configure - write request to configure gpmc
  * @cs: chip select number
  * @cmd: command type
@@ -668,119 +613,6 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
 }
 EXPORT_SYMBOL(gpmc_cs_configure);
 
-/**
- * gpmc_nand_read - nand specific read access request
- * @cs: chip select number
- * @cmd: command type
- */
-int gpmc_nand_read(int cs, int cmd)
-{
-   int rval = -EINVAL;
-
-   switch (cmd) {
-   case GPMC_NAND_DATA:
-   rval = gpmc_cs_read_byte(cs, GPMC_CS_NAND_DATA);
-   break;
-
-   default:
-   printk(KERN_ERR gpmc_read_nand_ctrl: Not supported\n);
-   }
-   return rval;
-}
-EXPORT_SYMBOL(gpmc_nand_read);
-
-/**
- * gpmc_nand_write - nand specific write request
- * @cs: chip select number
- * @cmd: command type
- * @wval: value to write
- */
-int gpmc_nand_write(int cs, int cmd, int wval)
-{
-   int err = 0;
-
-   switch (cmd) {
-   case GPMC_NAND_COMMAND:
-   gpmc_cs_write_byte(cs, GPMC_CS_NAND_COMMAND, wval);
-   break;
-
-   case GPMC_NAND_ADDRESS:
-   gpmc_cs_write_byte(cs, GPMC_CS_NAND_ADDRESS, wval);
-   break;
-
-   case GPMC_NAND_DATA:
-   gpmc_cs_write_byte(cs, GPMC_CS_NAND_DATA, wval);
-
-   default:
-   printk(KERN_ERR gpmc_write_nand_ctrl: Not supported\n);
-   err = -EINVAL;
-   }
-   return err;
-}
-EXPORT_SYMBOL(gpmc_nand_write);
-
-
-
-/**
- * gpmc_prefetch_enable - configures and starts prefetch transfer
- * @cs: cs (chip select) number
- * @fifo_th: fifo threshold to be used for read/ write
- * @dma_mode: dma mode enable (1) or disable (0)
- * @u32_count: number of bytes to be transferred
- * @is_write: prefetch read(0) or write post(1) mode
- */
-int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
-   unsigned int u32_count, int is_write)
-{
-
-   if (fifo_th  PREFETCH_FIFOTHRESHOLD_MAX) {
-   pr_err(gpmc: fifo threshold is not supported\n);
-   return -1;
-   } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
-   /* Set the amount of bytes to be prefetched */
-   gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
-
-   /* Set dma/mpu mode, the 

[PATCH v2 14/14] ARM: OMAP2+: gpmc: localize gpmc header

2012-10-07 Thread Afzal Mohammed
Requirement of gpmc header outside of mach-omap2 has been
cutoff, move gpmc header file in plat-omap folder to local
mach-omap2 folder

Objective - common zImage participation of omap

Signed-off-by: Afzal Mohammed af...@ti.com
---
 arch/arm/mach-omap2/board-2430sdp.c  |   2 +-
 arch/arm/mach-omap2/board-3430sdp.c  |   2 +-
 arch/arm/mach-omap2/board-apollon.c  |   2 +-
 arch/arm/mach-omap2/board-cm-t35.c   |   2 +-
 arch/arm/mach-omap2/board-cm-t3517.c |   2 +-
 arch/arm/mach-omap2/board-devkit8000.c   |   2 +-
 arch/arm/mach-omap2/board-flash.c|   2 +-
 arch/arm/mach-omap2/board-flash.h|   2 +-
 arch/arm/mach-omap2/board-h4.c   |   2 +-
 arch/arm/mach-omap2/board-igep0020.c |   2 +-
 arch/arm/mach-omap2/board-ldp.c  |   2 +-
 arch/arm/mach-omap2/board-omap3beagle.c  |   2 +-
 arch/arm/mach-omap2/board-omap3logic.c   |   2 +-
 arch/arm/mach-omap2/board-omap3stalker.c |   2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c   |   2 +-
 arch/arm/mach-omap2/board-overo.c|   2 +-
 arch/arm/mach-omap2/board-rm680.c|   2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |   2 +-
 arch/arm/mach-omap2/board-rx51.c |   2 +-
 arch/arm/mach-omap2/board-zoom-debugboard.c  |   2 +-
 arch/arm/mach-omap2/gpmc-nand.c  |   3 +-
 arch/arm/mach-omap2/gpmc-nand.h  |   2 +-
 arch/arm/mach-omap2/gpmc-onenand.c   |   3 +-
 arch/arm/mach-omap2/gpmc-smc91x.c|   2 +-
 arch/arm/mach-omap2/gpmc-smsc911x.c  |   2 +-
 arch/arm/mach-omap2/gpmc.c   |   3 +-
 arch/arm/mach-omap2/gpmc.h   | 154 +++
 arch/arm/mach-omap2/pm34xx.c |   2 +-
 arch/arm/mach-omap2/usb-tusb6010.c   |   2 +-
 arch/arm/plat-omap/include/plat/gpmc.h   | 154 ---
 30 files changed, 182 insertions(+), 185 deletions(-)
 create mode 100644 arch/arm/mach-omap2/gpmc.h
 delete mode 100644 arch/arm/plat-omap/include/plat/gpmc.h

diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
b/arch/arm/mach-omap2/board-2430sdp.c
index 95b384d..49e49d0 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -34,7 +34,7 @@
 #include asm/mach/map.h
 
 #include common.h
-#include plat/gpmc.h
+#include gpmc.h
 #include plat/usb.h
 #include gpmc-smc91x.h
 
diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 96cd369..5ad0901 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -33,7 +33,7 @@
 #include plat/usb.h
 #include common.h
 #include plat/dma.h
-#include plat/gpmc.h
+#include gpmc.h
 #include video/omapdss.h
 #include video/omap-panel-tfp410.h
 
diff --git a/arch/arm/mach-omap2/board-apollon.c 
b/arch/arm/mach-omap2/board-apollon.c
index cea3aba..8cdd186 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -35,7 +35,7 @@
 
 #include plat/led.h
 #include common.h
-#include plat/gpmc.h
+#include gpmc.h
 
 #include video/omapdss.h
 #include video/omap-panel-generic-dpi.h
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index fef68de..73e2ba9 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -40,7 +40,7 @@
 
 #include common.h
 #include linux/platform_data/mtd-nand-omap2.h
-#include plat/gpmc.h
+#include gpmc.h
 #include plat/usb.h
 #include video/omapdss.h
 #include video/omap-panel-generic-dpi.h
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c 
b/arch/arm/mach-omap2/board-cm-t3517.c
index 3a19e80..b5495e4 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -41,7 +41,7 @@
 #include common.h
 #include plat/usb.h
 #include linux/platform_data/mtd-nand-omap2.h
-#include plat/gpmc.h
+#include gpmc.h
 
 #include am35xx.h
 
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 9933966..3eedb8f 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -39,7 +39,7 @@
 #include asm/mach/flash.h
 
 #include common.h
-#include plat/gpmc.h
+#include gpmc.h
 #include linux/platform_data/mtd-nand-omap2.h
 #include plat/usb.h
 #include video/omapdss.h
diff --git a/arch/arm/mach-omap2/board-flash.c 
b/arch/arm/mach-omap2/board-flash.c
index 776e57a..c56986f 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -18,7 +18,7 @@
 #include linux/io.h
 
 #include plat/cpu.h
-#include plat/gpmc.h
+#include gpmc.h
 #include linux/platform_data/mtd-nand-omap2.h
 #include linux/platform_data/mtd-onenand-omap2.h
 #include plat/tc.h
diff --git a/arch/arm/mach-omap2/board-flash.h 
b/arch/arm/mach-omap2/board-flash.h
index a3aa5fc..2fb5d41 100644
--- a/arch/arm/mach-omap2/board-flash.h
+++ 

RE: [PATCH 00/15] OMAP-GPMC related cleanup for common zImage

2012-10-07 Thread Mohammed, Afzal
Hi,

On Fri, Oct 05, 2012 at 21:22:50, Mohammed, Afzal wrote:

 This series cleans up omap-gpmc related code so that omap can
 be a part of common zImage.

Upon selecting BCH CONFIG option, build breaks, updated
series - v2 that fixes it has been posted.

Regards
Afzal