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


Groups > linux.kernel > #1255217

Re: [PATCH] mtd: spi-nor: fsl-quadspi: add big-endian support

From Fabio Estevam <festevam@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mtd: spi-nor: fsl-quadspi: add big-endian support
Date 2015-10-24 17:50 +0200
Message-ID <qn9eW-4A2-13@gated-at.bofh.it> (permalink)
References <qmO0P-7In-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Oct 23, 2015 at 5:53 AM, Yuan Yao <yao.yuan@freescale.com> wrote:

>  /*
> + * R/W functions for big- or little-endian registers:
> + * The qSPI controller's endian is independent of the CPU core's endian.
> + * So far, although the CPU core is little-endian but the qSPI have two
> + * versions for big-endian and little-endian.
> + */
> +static void qspi_writel(struct fsl_qspi *q, u32 val, void __iomem *addr)
> +{
> +       if (q->big_endian)
> +               iowrite32be(val, addr);
> +       else
> +               iowrite32(val, addr);
> +}

I suggest you to implement regmap support for this driver instead.

Take a look at drivers/watchdog/imx2_wdt.c for a reference.

Then you only need to pass 'big-endian' as a property for the qspi in
the .dtsi file and regmap core will take care of endianness.
--
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 | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mtd: spi-nor: fsl-quadspi: add big-endian support Fabio Estevam <festevam@gmail.com> - 2015-10-24 17:50 +0200
  RE: [PATCH] mtd: spi-nor: fsl-quadspi: add big-endian support Yao Yuan <yao.yuan@freescale.com> - 2015-10-30 10:50 +0100

csiph-web