All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: dedekind1@gmail.com, koen.beel.barco@gmail.com,
	w.sang@pengutronix.de, Huang Shijie <b32955@freescale.com>,
	linux-mtd@lists.infradead.org, shijie8@gmail.com,
	s.hauer@pengutronix.de
Subject: Re: [PATCH v10 2/3] MTD : add helper functions library and header files for GPMI NAND driver
Date: Fri, 26 Aug 2011 17:15:17 +0200	[thread overview]
Message-ID: <201108261715.17398.marek.vasut@gmail.com> (raw)
In-Reply-To: <1314171204-25458-3-git-send-email-b32955@freescale.com>

On Wednesday, August 24, 2011 09:33:23 AM Huang Shijie wrote:
> bch-regs.h : registers file for BCH module
> gpmi-regs.h: registers file for GPMI module
> gpmi-lib.c: helper functions library.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>

[...]

> +/* Returns the Ready/Busy status of the given chip. */
> +int gpmi_is_ready(struct gpmi_nand_data *this, unsigned chip)
> +{
> +	struct resources *r = &this->resources;
> +	uint32_t mask;
> +	uint32_t reg;
> +
> +	if (GPMI_IS_MX23(this)) {
> +		mask = MX23_BM_GPMI_DEBUG_READY0 << chip;
> +		reg = readl(r->gpmi_regs + HW_GPMI_DEBUG);
> +	} else if (GPMI_IS_MX28(this)) {
> +		mask = MX28_BF_GPMI_STAT_READY_BUSY(1 << chip);
> +		reg = readl(r->gpmi_regs + HW_GPMI_STAT);
> +	} else
> +		BUG();
> +	return !!(reg & mask);

Maybe you don't need that double negation here ?

> +}

[...]

> +#define HW_GPMI_TIMING1					0x00000080
> +#define HW_GPMI_TIMING2					0x00000090
> +#define HW_GPMI_DATA					0x000000a0
> +/*============================ MX28 uses this to detect READY
> ==============*/ +#define HW_GPMI_STAT					0x000000b0
> +#define MX28_BP_GPMI_STAT_READY_BUSY			24
> +#define MX28_BM_GPMI_STAT_READY_BUSY	(0xff <<
> MX28_BP_GPMI_STAT_READY_BUSY) +#define MX28_BF_GPMI_STAT_READY_BUSY(v)		
\
> +	(((v) << MX28_BP_GPMI_STAT_READY_BUSY) & MX28_BM_GPMI_STAT_READY_BUSY)
> +/*============================ MX23 uses this to detect READY
> ==============*/ +#define HW_GPMI_DEBUG					0x000000c0
> +#define MX23_BP_GPMI_DEBUG_READY0			28
> +#define MX23_BM_GPMI_DEBUG_READY0	(1 << MX23_BP_GPMI_DEBUG_READY0)
> +#endif

Maybe remove those "==========" above.

Minor things,

Acked-by: Marek Vasut <marek.vasut@gmail.com>

WARNING: multiple messages have this Message-ID (diff)
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v10 2/3] MTD : add helper functions library and header files for GPMI NAND driver
Date: Fri, 26 Aug 2011 17:15:17 +0200	[thread overview]
Message-ID: <201108261715.17398.marek.vasut@gmail.com> (raw)
In-Reply-To: <1314171204-25458-3-git-send-email-b32955@freescale.com>

On Wednesday, August 24, 2011 09:33:23 AM Huang Shijie wrote:
> bch-regs.h : registers file for BCH module
> gpmi-regs.h: registers file for GPMI module
> gpmi-lib.c: helper functions library.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>

[...]

> +/* Returns the Ready/Busy status of the given chip. */
> +int gpmi_is_ready(struct gpmi_nand_data *this, unsigned chip)
> +{
> +	struct resources *r = &this->resources;
> +	uint32_t mask;
> +	uint32_t reg;
> +
> +	if (GPMI_IS_MX23(this)) {
> +		mask = MX23_BM_GPMI_DEBUG_READY0 << chip;
> +		reg = readl(r->gpmi_regs + HW_GPMI_DEBUG);
> +	} else if (GPMI_IS_MX28(this)) {
> +		mask = MX28_BF_GPMI_STAT_READY_BUSY(1 << chip);
> +		reg = readl(r->gpmi_regs + HW_GPMI_STAT);
> +	} else
> +		BUG();
> +	return !!(reg & mask);

Maybe you don't need that double negation here ?

> +}

[...]

> +#define HW_GPMI_TIMING1					0x00000080
> +#define HW_GPMI_TIMING2					0x00000090
> +#define HW_GPMI_DATA					0x000000a0
> +/*============================ MX28 uses this to detect READY
> ==============*/ +#define HW_GPMI_STAT					0x000000b0
> +#define MX28_BP_GPMI_STAT_READY_BUSY			24
> +#define MX28_BM_GPMI_STAT_READY_BUSY	(0xff <<
> MX28_BP_GPMI_STAT_READY_BUSY) +#define MX28_BF_GPMI_STAT_READY_BUSY(v)		
\
> +	(((v) << MX28_BP_GPMI_STAT_READY_BUSY) & MX28_BM_GPMI_STAT_READY_BUSY)
> +/*============================ MX23 uses this to detect READY
> ==============*/ +#define HW_GPMI_DEBUG					0x000000c0
> +#define MX23_BP_GPMI_DEBUG_READY0			28
> +#define MX23_BM_GPMI_DEBUG_READY0	(1 << MX23_BP_GPMI_DEBUG_READY0)
> +#endif

Maybe remove those "==========" above.

Minor things,

Acked-by: Marek Vasut <marek.vasut@gmail.com>

  reply	other threads:[~2011-08-26 15:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24  7:33 [PATCH v10 0/3] add the GPMI controller driver for IMX23/IMX28 Huang Shijie
2011-08-24  7:33 ` Huang Shijie
2011-08-24  7:33 ` [PATCH v10 1/3] MTD : add the common code for GPMI-NAND controller driver Huang Shijie
2011-08-24  7:33   ` Huang Shijie
2011-08-26 15:12   ` Marek Vasut
2011-08-26 15:12     ` Marek Vasut
2011-08-24  7:33 ` [PATCH v10 2/3] MTD : add helper functions library and header files for GPMI NAND driver Huang Shijie
2011-08-24  7:33   ` Huang Shijie
2011-08-26 15:15   ` Marek Vasut [this message]
2011-08-26 15:15     ` Marek Vasut
2011-08-24  7:33 ` [PATCH v10 3/3] MTD : add GPMI-NAND driver in the config and Makefile Huang Shijie
2011-08-24  7:33   ` Huang Shijie
2011-08-26 15:15   ` Marek Vasut
2011-08-26 15:15     ` Marek Vasut
2011-08-25 11:34 ` [PATCH v10 0/3] add the GPMI controller driver for IMX23/IMX28 Artem Bityutskiy
2011-08-25 11:34   ` Artem Bityutskiy
2011-08-26  3:22   ` Huang Shijie
2011-08-26  3:22     ` Huang Shijie
2011-08-26 13:34     ` Koen Beel
2011-08-26 13:34       ` Koen Beel
2011-08-26 15:15   ` Marek Vasut
2011-08-26 15:15     ` Marek Vasut
2011-08-27  1:03     ` Huang Shijie
2011-08-27  1:03       ` Huang Shijie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201108261715.17398.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=b32955@freescale.com \
    --cc=dedekind1@gmail.com \
    --cc=koen.beel.barco@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shijie8@gmail.com \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.