linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: [PATCH 08/19] sh: sh3: sh770x: Fix platform data for the IRDA serial port
Date: Fri, 06 Jan 2017 10:25:22 +0000	[thread overview]
Message-ID: <2288755.l0GGsSiyi2@avalon> (raw)
In-Reply-To: <CAMuHMdVzm4D=Pdd6PoGzXUoO8Va4g1Y5KncaRS19PnSeGUn9Gw@mail.gmail.com>

Hi Geert,

On Friday 06 Jan 2017 11:18:32 Geert Uytterhoeven wrote:
> On Wed, Jan 4, 2017 at 12:06 AM, Laurent Pinchart wrote:
> > Even though most of its registers are 8-bit wide, the IRDA has two
> > 16-bit registers that make it a 16-bit peripheral and not a 8-bit
> > peripheral with addresses shifted by one. Fix the memory resource size
> > and the platform data regshift value.
> > 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> > 
> >  arch/sh/kernel/cpu/sh3/setup-sh770x.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
> > b/arch/sh/kernel/cpu/sh3/setup-sh770x.c index e1e54258b822..084a91e6027e
> > 100644
> > --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
> > +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
> > @@ -157,11 +157,10 @@ static struct platform_device scif1_device = {
> >  static struct plat_sci_port scif2_platform_data = {
> >         .type           = PORT_IRDA,
> >         .ops            = &sh770x_sci_port_ops,
> > -       .regshift       = 1,
> 
> According to my sh7707 and sh7709 datasheets. regshift = 1 is correct.
> 
> SCIx_IRDA_REGTYPE uses:
> 
>                 [SCSMR]         = { 0x00,  8 },
>                 [SCBRR]         = { 0x01,  8 },
>                 [SCSCR]         = { 0x02,  8 },
>                 [SCxTDR]        = { 0x03,  8 },
>                 [SCxSR]         = { 0x04,  8 },
>                 [SCxRDR]        = { 0x05,  8 },
>                 [SCFCR]         = { 0x06,  8 },
>                 [SCFDR]         = { 0x07, 16 },
> 
> While the datasheet says:
> 
>         SCSMR1  H'A4000140      8 bits
>         SCBRR1  H'A4000142      8 bits
>         SCSCR1  H'A4000144      8 bits
>         SCFTDR1 H'A4000146      8 bits
>         SCSSR1  H'A4000148      16 bits
>         SCFRDR1 H'A400014A      8 bits
>         SCFCR1  H'A400014C      8 bits
>         SCFDR1  H'A400014E      16 bits
> 
> So you do need regshift = 1 to handle the gaps.
> 
> Note that SCSSR1 is a 16-bit registers, while SCIx_IRDA_REGTYPE
> declares it as 8-bit, so it may not work at all...
> 
> Ah, you're fixing all this in "[PATCH 19/19] serial: sh-sci: Compute the
> regshift value for SCI ports".
> I think that part should be moved to this patch, to not break bisection.

Yes, I realized that after sending the series. If you think we need to care 
about bisection here (given that it seems that sh-sci hasn't been tested on SH 
since at least v3.1...) we can fix that.

> >  static struct resource scif2_resources[] = {
> > -       DEFINE_RES_MEM(0xa4000140, 0x10),
> > +       DEFINE_RES_MEM(0xa4000140, 0x20),
> >         DEFINE_RES_IRQ(evt2irq(0x880)),
> >  };
> 
> According to the register list above, resource size 0x10 is correct.

I'll fix this.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2017-01-06 10:25 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 23:06 [PATCH 00/19] sh-sci: Platform data simplification Laurent Pinchart
2017-01-03 23:06 ` [PATCH 01/19] serial: sh-sci: Set the SCSCR TE and RE bits in the driver Laurent Pinchart
2017-01-06 10:11   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 02/19] serial: sh-sci: Don't rely on platform data flags when not needed Laurent Pinchart
2017-01-06 10:11   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 03/19] sh: Don't set sh-sci pdata scscr TE and RE bits Laurent Pinchart
2017-01-06 10:11   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 04/19] sh: Don't set sh-sci pdata scscr TIE and RIE bits Laurent Pinchart
2017-01-06 10:11   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 05/19] sh: sh726[49]: Don't set sh-sci pdata scscr TOIE bit Laurent Pinchart
2017-01-06 10:13   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 06/19] sh: Don't set the sh-sci pdata UPF_BOOT_AUTOCONF flags Laurent Pinchart
2017-01-06 10:13   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 07/19] sh: Don't set sh-sci port_reg Laurent Pinchart
2017-01-06 10:17   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 08/19] sh: sh3: sh770x: Fix platform data for the IRDA serial port Laurent Pinchart
2017-01-06 10:18   ` Geert Uytterhoeven
2017-01-06 10:25     ` Laurent Pinchart [this message]
2017-01-06 11:52     ` [PATCH v1.1 08/19] serial: sh-sci: Fix register offsets " Laurent Pinchart
2017-01-11 12:31       ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 09/19] sh: Don't set the sh-sci platform data regshift field Laurent Pinchart
2017-01-06 10:18   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 10/19] sh: Don't set the sh-sci platform data scscr CKE0 bit Laurent Pinchart
2017-01-06 10:23   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 11/19] sh: Don't set the sh-sci platform data REIE bit when not implemented Laurent Pinchart
2017-01-06 10:27   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 12/19] serial: sh-sci: Remove initialization of zero fields in sci_port_params Laurent Pinchart
2017-01-06 10:29   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 13/19] serial: sh-sci: Replace regmap array with port parameters Laurent Pinchart
2017-01-06 10:36   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 14/19] serial: sh-sci: Constify platform data Laurent Pinchart
2017-01-06 10:36   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 15/19] serial: sh-sci: Extend sci_port_params with more port parameters Laurent Pinchart
2017-01-06 10:51   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 16/19] serial: sh-sci: Remove the platform data dma slave rx/tx channel IDs Laurent Pinchart
2017-01-06 10:53   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 17/19] serial: sh-sci: Remove manual break debouncing Laurent Pinchart
2017-01-06 10:57   ` Geert Uytterhoeven
2017-01-03 23:06 ` [PATCH 18/19] serial: sh-sci: Remove unused platform data capabilities field Laurent Pinchart
2017-01-06 10:59   ` Geert Uytterhoeven
2017-01-06 11:05     ` Laurent Pinchart
2017-01-03 23:06 ` [PATCH 19/19] serial: sh-sci: Compute the regshift value for SCI ports Laurent Pinchart
2017-01-06 11:00   ` Geert Uytterhoeven
2017-01-06 12:21     ` [PATCH v1.1 " Laurent Pinchart
2017-01-11 12:37       ` Geert Uytterhoeven
2017-01-06 11:01 ` [PATCH 00/19] sh-sci: Platform data simplification Geert Uytterhoeven
2017-01-11  8:04 ` Greg KH
2017-01-11 10:38   ` Geert Uytterhoeven
2017-01-11 10:43     ` Greg KH
2017-01-11 11:06       ` Laurent Pinchart
2017-01-11 20:31         ` Greg KH
2017-01-11 11:03   ` Laurent Pinchart

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=2288755.l0GGsSiyi2@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-sh@vger.kernel.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).