Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1157644

Re: [PATCH v4 1/6] mtd: nand: vf610_nfc: Freescale NFC for VF610, MPC5125 and others

From Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/6] mtd: nand: vf610_nfc: Freescale NFC for VF610, MPC5125 and others
Date 2015-06-03 15:10 +0200
Message-ID <pxgAI-1Uo-69@gated-at.bofh.it> (permalink)
References <p7WlP-2gi-5@gated-at.bofh.it> <p7WlQ-2gi-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v4 1/6] mtd: nand: vf610_nfc: Freescale NFC for VF610,  MPC5125 and others Sebastian Andrzej Siewior <sebastian@breakpoint.cc> - 2015-06-03 15:10 +0200

csiph-web