All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scott.wood@nxp.com>
To: Po Liu <po.liu@nxp.com>, "broonie@kernel.org" <broonie@kernel.org>
Cc: "linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dspi: config dspi master regmap with right mode depend on BE or LE
Date: Sun, 17 Apr 2016 02:41:40 +0000	[thread overview]
Message-ID: <DB5PR0401MB19281A317BFB1D9001F97ABB916A0@DB5PR0401MB1928.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 1460545402-8162-1-git-send-email-po.liu@nxp.com

On 04/13/2016 06:12 AM, Po Liu wrote:
> When kernel config with big endian mode, spi master need
> to config regmap data value to be little endian mode. Or else,
> the kernel boot will hang.
> 
> Signed-off-by: Po Liu <po.liu@nxp.com>
> ---
>  drivers/spi/spi-fsl-dspi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
> index 39412c9..a1d893c 100644
> --- a/drivers/spi/spi-fsl-dspi.c
> +++ b/drivers/spi/spi-fsl-dspi.c
> @@ -637,6 +637,9 @@ static const struct regmap_config dspi_regmap_config = {
>  	.val_bits = 32,
>  	.reg_stride = 4,
>  	.max_register = 0x88,
> +#ifdef CONFIG_CPU_BIG_ENDIAN
> +	.val_format_endian = REGMAP_ENDIAN_LITTLE,
> +#endif

Drop this ifdef.  It's little endian regardless of what mode the CPU is in.

Are you sure this is correct on all platforms?  E.g. ls1021a?

Looking more closely, the binding has a big-endian property.  It says
the default if that property is absent is native endian, which is
insane.  Fix the binding to say that little endian is the default (this
change shouldn't break any existing trees), and make sure that's what
the code implements.  I think you need val_format_endian_default, not
val_format_endian.

-Scott

  parent reply	other threads:[~2016-04-17  3:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 11:03 [PATCH] dspi: config dspi master regmap with right mode depend on BE or LE Po Liu
2016-04-13 11:03 ` Po Liu
2016-04-13 14:06 ` Mark Brown
2016-04-13 14:06   ` Mark Brown
2016-04-17  2:41 ` Scott Wood [this message]
2016-04-18 10:11   ` Mark Brown
2016-04-18 10:11     ` Mark Brown
2016-04-19  2:30     ` Po Liu
2016-04-19  2:30       ` Po Liu

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=DB5PR0401MB19281A317BFB1D9001F97ABB916A0@DB5PR0401MB1928.eurprd04.prod.outlook.com \
    --to=scott.wood@nxp.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=po.liu@nxp.com \
    /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.