Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Mark Brown <broonie@kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
	<linux-kernel@vger.kernel.org>, <linux-spi@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] spi: fsl-spi: Fix parameter ram offset setup for CPM1
Date: Fri, 3 Oct 2014 15:29:58 -0500	[thread overview]
Message-ID: <1412368198.13320.434.camel@snotra.buserror.net> (raw)
In-Reply-To: <20141003164916.DBD631AAFA2@localhost.localdomain>

On Fri, 2014-10-03 at 18:49 +0200, Christophe Leroy wrote:
> On CPM1, the SPI parameter RAM has a default location. In fsl_spi_cpm_get_pram()
> there was a confusion between the SPI_BASE register and the base of the SPI
> parameter RAM. Fortunatly, it was working properly with MPC866 and MPC885
> because they do set SPI_BASE, but on MPC860 and other old MPC8xx that doesn't
> set SPI_BASE, pram_ofs was not properly set. This patch fixes this confusion.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> 
> ---
> Changes from v1 to v2: none
> 
>  drivers/spi/spi-fsl-cpm.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-cpm.c b/drivers/spi/spi-fsl-cpm.c
> index 54b0637..0f3a912 100644
> --- a/drivers/spi/spi-fsl-cpm.c
> +++ b/drivers/spi/spi-fsl-cpm.c
> @@ -262,15 +262,14 @@ static unsigned long fsl_spi_cpm_get_pram(struct mpc8xxx_spi *mspi)
>  		pram_ofs = cpm_muram_alloc(SPI_PRAM_SIZE, 64);
>  		out_be16(spi_base, pram_ofs);
>  	} else {
> -		struct spi_pram __iomem *pram = spi_base;
> -		u16 rpbase = in_be16(&pram->rpbase);
> +		u16 rpbase = in_be16(spi_base);
>  
> -		/* Microcode relocation patch applied? */
> +		/* Microcode relocation patch applied | rpbase set by default */
>  		if (rpbase) {
>  			pram_ofs = rpbase;
>  		} else {
> -			pram_ofs = cpm_muram_alloc(SPI_PRAM_SIZE, 64);
> -			out_be16(spi_base, pram_ofs);
> +			pram_ofs = offsetof(cpm8xx_t, cp_dparam[PROFF_SPI]) -
> +				   offsetof(cpm8xx_t, cp_dpmem[0]);
>  		}
>  	}

Why is PROFF_SPI not coming from the device tree?  Why don't I see any
cpm spi in any device tree nor any binding for it?

-Scott

  reply	other threads:[~2014-10-03 20:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 16:49 [PATCH v2 1/2] spi: fsl-spi: Fix parameter ram offset setup for CPM1 Christophe Leroy
2014-10-03 20:29 ` Scott Wood [this message]
     [not found]   ` <1412368198.13320.434.camel-88ow+0ZRuxG2UiBs7uKeOtHuzzzSOjJt@public.gmane.org>
2014-10-04 12:02     ` christophe leroy
2014-10-07  0:15       ` Scott Wood
     [not found]         ` <1412640953.13320.502.camel-88ow+0ZRuxG2UiBs7uKeOtHuzzzSOjJt@public.gmane.org>
2014-10-08 16:21           ` leroy christophe
2014-10-08 16:30             ` Scott Wood

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=1412368198.13320.434.camel@snotra.buserror.net \
    --to=scottwood@freescale.com \
    --cc=broonie@kernel.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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