diff mbox

mtd/gpmi : do not include the mxs.h

Message ID 1333247817-18472-1-git-send-email-shijie8@gmail.com
State Accepted
Commit 4aa6ae3ecca04d7956817170418c74861ce071de
Headers show

Commit Message

Huang Shijie April 1, 2012, 2:36 a.m. UTC
The mxs.h does not exit in the mx6q.
So rewrite the __mxs_clrl()/__mxs_setl() and remove the mxs.h.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Comments

Wolfram Sang April 3, 2012, 7:39 p.m. UTC | #1
On Sat, Mar 31, 2012 at 10:36:57PM -0400, Huang Shijie wrote:
> The mxs.h does not exit in the mx6q.
> So rewrite the __mxs_clrl()/__mxs_setl() and remove the mxs.h.
> 
> Signed-off-by: Huang Shijie <shijie8@gmail.com>

I am quite sure we will have STMP devices in 3.5 which should make this patch
obsolete. If this patch is considered a bugfix for 3.4, then OK for now.

Regards,

   Wolfram
Huang Shijie April 4, 2012, 7:26 a.m. UTC | #2
Hi Wolfram:

On Tue, Apr 3, 2012 at 3:39 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> On Sat, Mar 31, 2012 at 10:36:57PM -0400, Huang Shijie wrote:
>> The mxs.h does not exit in the mx6q.
>> So rewrite the __mxs_clrl()/__mxs_setl() and remove the mxs.h.
>>
>> Signed-off-by: Huang Shijie <shijie8@gmail.com>
>
> I am quite sure we will have STMP devices in 3.5 which should make this patch
Do you mean your patch "lib: add support for stmp-style devices" ?
or some other patch?


Your patch "lib: add support for stmp-style devices" does not give me
the API to remove this
code as i ever wished to.


BR
Huang Shijie



> obsolete. If this patch is considered a bugfix for 3.4, then OK for now.
>
> Regards,
>
>   Wolfram
>
> --
> Pengutronix e.K.                           | Wolfram Sang                |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Wolfram Sang April 4, 2012, 7:57 a.m. UTC | #3
Hi,

> Do you mean your patch "lib: add support for stmp-style devices" ?
> or some other patch?

Yes, it adds the SET and CLR macros. writel() then need to be modified again.
Nothing major, though.

> Your patch "lib: add support for stmp-style devices" does not give me the API
> to remove this code as i ever wished to.

Then please speak up. The only comment I can find from you is the requested
move to a fsl-directory, but this is nothing about API?

Regards,

   Wolfram
Huang Shijie April 4, 2012, 11:19 a.m. UTC | #4
On Wed, Apr 4, 2012 at 3:57 AM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> Hi,
>
>> Do you mean your patch "lib: add support for stmp-style devices" ?
>> or some other patch?
>
> Yes, it adds the SET and CLR macros. writel() then need to be modified again.
> Nothing major, though.

The two macros are not needed if you give me a two arguments API such
as gpmi_reset_block().
I wish I can remove the gpmi_reset_block(), and use your code. :)

>
>> Your patch "lib: add support for stmp-style devices" does not give me the API
>> to remove this code as i ever wished to.
>
> Then please speak up. The only comment I can find from you is the requested
> move to a fsl-directory, but this is nothing about API?
yes.
I will send new comments about your patch.


 thanks.

Huang Shijie

>
> Regards,
>
>   Wolfram
>
> --
> Pengutronix e.K.                           | Wolfram Sang                |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Artem Bityutskiy April 13, 2012, 4:09 p.m. UTC | #5
On Sat, 2012-03-31 at 22:36 -0400, Huang Shijie wrote:
> The mxs.h does not exit in the mx6q.
> So rewrite the __mxs_clrl()/__mxs_setl() and remove the mxs.h.
> 
> Signed-off-by: Huang Shijie <shijie8@gmail.com>

Pushed  to l2-mtd.git, thanks!
diff mbox

Patch

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index 85e6071..649d459 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -21,7 +21,6 @@ 
 #include <linux/mtd/gpmi-nand.h>
 #include <linux/delay.h>
 #include <linux/clk.h>
-#include <mach/mxs.h>
 
 #include "gpmi-nand.h"
 #include "gpmi-regs.h"
@@ -37,6 +36,8 @@  struct timing_threshod timing_default_threshold = {
 	.max_dll_delay_in_ns         = 16,
 };
 
+#define MXS_SET_ADDR		0x4
+#define MXS_CLR_ADDR		0x8
 /*
  * Clear the bit and poll it cleared.  This is usually called with
  * a reset address and mask being either SFTRST(bit 31) or CLKGATE
@@ -47,7 +48,7 @@  static int clear_poll_bit(void __iomem *addr, u32 mask)
 	int timeout = 0x400;
 
 	/* clear the bit */
-	__mxs_clrl(mask, addr);
+	writel(mask, addr + MXS_CLR_ADDR);
 
 	/*
 	 * SFTRST needs 3 GPMI clocks to settle, the reference manual
@@ -92,11 +93,11 @@  static int gpmi_reset_block(void __iomem *reset_addr, bool just_enable)
 		goto error;
 
 	/* clear CLKGATE */
-	__mxs_clrl(MODULE_CLKGATE, reset_addr);
+	writel(MODULE_CLKGATE, reset_addr + MXS_CLR_ADDR);
 
 	if (!just_enable) {
 		/* set SFTRST to reset the block */
-		__mxs_setl(MODULE_SFTRST, reset_addr);
+		writel(MODULE_SFTRST, reset_addr + MXS_SET_ADDR);
 		udelay(1);
 
 		/* poll CLKGATE becoming set */