devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <sebastian-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
To: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>
Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	aaron-yuhzfaV+M/Wz3Dx2OeFgIA@public.gmane.org,
	marb-Z4QKGCRq86k@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	bpringlemeir-ygJ1pmMJ17cAvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v4 1/6] mtd: nand: vf610_nfc: Freescale NFC for VF610, MPC5125 and others
Date: Wed, 3 Jun 2015 15:08:25 +0200	[thread overview]
Message-ID: <20150603130825.GA23991@breakpoint.cc> (raw)
In-Reply-To: <1427300909-20825-2-git-send-email-stefan-XLVq0VzYD2Y@public.gmane.org>

On 2015-03-25 17:28:24 [+0100], Stefan Agner wrote:
> diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
> new file mode 100644
> index 0000000..23c1510
> --- /dev/null
> +++ b/drivers/mtd/nand/vf610_nfc.c
> @@ -0,0 +1,686 @@
> +static inline u32 vf610_nfc_read(struct vf610_nfc *nfc, uint reg)
> +{
> +	return readl(nfc->regs + reg);
> +}
> +
> +static inline void vf610_nfc_write(struct vf610_nfc *nfc, uint reg, u32 val)
> +{
> +	writel(val, nfc->regs + reg);
> +}
> +static void vf610_nfc_send_command(struct vf610_nfc *nfc, u32 cmd_byte1,
> +				   u32 cmd_code)
> +{
> +	void __iomem *reg = nfc->regs + NFC_FLASH_CMD2;
> +	u32 tmp;
> +
> +	vf610_nfc_clear_status(nfc);
> +
> +	tmp = __raw_readl(reg);
> +	tmp &= ~(CMD_BYTE1_MASK | CMD_CODE_MASK | BUFNO_MASK);
> +	tmp |= cmd_byte1 << CMD_BYTE1_SHIFT;
> +	tmp |= cmd_code << CMD_CODE_SHIFT;
> +	__raw_writel(tmp, reg);
> +}

Why readl() vs __raw_readl() dito for write?
vf610_nfc_{read|write} is good since for PPC we would need out_be32()
here instead.
It would be nice if you could abstract the __raw_ once as well. And I am
not sure if you need those at all since the former functions should work
here just fine.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-06-03 13:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 16:28 [PATCH v4 0/6] mtd: nand: vf610_nfc: Freescale NFC for VF610 Stefan Agner
2015-03-25 16:28 ` [PATCH v4 1/6] mtd: nand: vf610_nfc: Freescale NFC for VF610, MPC5125 and others Stefan Agner
     [not found]   ` <1427300909-20825-2-git-send-email-stefan-XLVq0VzYD2Y@public.gmane.org>
2015-06-02  1:32     ` Brian Norris
2015-06-02  9:01       ` Stefan Agner
2015-06-03 13:08     ` Sebastian Andrzej Siewior [this message]
     [not found]       ` <20150603130825.GA23991-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
2015-06-03 15:05         ` Stefan Agner
     [not found]           ` <b3b09b4b8c97cbfc88fa0d5fdc5e40cd-XLVq0VzYD2Y@public.gmane.org>
2015-06-09 20:07             ` Sebastian Andrzej Siewior
     [not found]               ` <20150609200751.GC5720-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
2015-06-09 20:31                 ` Stefan Agner
2015-06-12 19:44                   ` Sebastian Andrzej Siewior
2015-06-17 13:02               ` Stefan Agner
     [not found]                 ` <32a7fe8d8df87dfe35ea50c582077c78-XLVq0VzYD2Y@public.gmane.org>
2015-06-18 18:27                   ` Sebastian Andrzej Siewior
2015-06-03  8:10   ` Sebastian Andrzej Siewior
2015-06-03  9:45     ` Stefan Agner
     [not found]       ` <821b4731043fef279b6a82b920707982-XLVq0VzYD2Y@public.gmane.org>
2015-06-03 12:03         ` Sebastian Andrzej Siewior
     [not found]           ` <20150603120355.GA1668-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
2015-06-03 15:09             ` Stefan Agner
     [not found]               ` <b457fab56ff3ebc72f264a400a0ab33f-XLVq0VzYD2Y@public.gmane.org>
2015-06-09 20:05                 ` Sebastian Andrzej Siewior
2015-03-25 16:28 ` [PATCH v4 2/6] mtd: nand: vf610_nfc: add hardware BCH-ECC support Stefan Agner
     [not found] ` <1427300909-20825-1-git-send-email-stefan-XLVq0VzYD2Y@public.gmane.org>
2015-03-25 16:28   ` [PATCH v4 3/6] mtd: nand: vf610_nfc: add device tree bindings Stefan Agner
2015-03-25 16:28   ` [PATCH v4 4/6] ARM: vf610: enable NAND Flash Controller Stefan Agner
2015-03-25 16:28 ` [PATCH v4 5/6] ARM: dts: vf610: add NAND flash controller peripherial Stefan Agner
2015-03-25 16:28 ` [PATCH v4 6/6] ARM: dts: vf-colibri: enable NAND flash controller Stefan Agner

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=20150603130825.GA23991@breakpoint.cc \
    --to=sebastian-e0pnvn5oa6ohrxcnutq+tq@public.gmane.org \
    --cc=aaron-yuhzfaV+M/Wz3Dx2OeFgIA@public.gmane.org \
    --cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=bpringlemeir-ygJ1pmMJ17cAvxtiuMwx3w@public.gmane.org \
    --cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=marb-Z4QKGCRq86k@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=stefan-XLVq0VzYD2Y@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).