From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 1/3] serial: sh-sci: Add OF support
Date: Tue, 05 Mar 2013 19:26:25 +0000 [thread overview]
Message-ID: <201303051926.25655.arnd@arndb.de> (raw)
In-Reply-To: <CABYn4sxYRbmEe27WKE-FbTZ3_SM+APaYqHJ1=Zrk8_a5czxZaQ@mail.gmail.com>
On Tuesday 05 March 2013, Bastian Hecht wrote:
> 2013/3/4 Arnd Bergmann <arnd@arndb.de>:
> > On Monday 04 March 2013 17:20:52 Bastian Hecht wrote:
> >> +- reg : Address and length of the register set for the device
> >> +- interrupts : Should contain the following IRQs: ERI, RXI, TXI and BRI.
> >
> > You probably want to require the "interrupt-names" property as well
> > then.
>
> I added the interrupt-names property but still enforce the ordering in
> the binding specs.
Yes, that is the correct approach.
> Don't know if we want the extra overhead to scan for strings or just
> take a certain order for granted.
> If we want to change it to parsing, it would be better to switch
> completely to platform_get_irq_byname() and change all the current
> platform code, else we will produce code overhead.
Right, there is no need to change the code for that, but I think it
makes sense to do the binding the way you describe, in case someone
later wants to move to platform_get_irq_byname. A lot of people prefer
that for some reason, although I think the traditional numbering is
just as good.
> >> +- renesas,scbrr-algo-id : Algorithm ID for the Bit Rate Register
> >> + 1 = SCBRR_ALGO_1 ((clk + 16 * bps) / (16 * bps) - 1)
> >> + 2 = SCBRR_ALGO_2 ((clk + 16 * bps) / (32 * bps) - 1)
> >> + 3 = SCBRR_ALGO_3 (((clk * 2) + 16 * bps) / (16 * bps) - 1)
> >> + 4 = SCBRR_ALGO_4 (((clk * 2) + 16 * bps) / (32 * bps) - 1)
> >> + 5 = SCBRR_ALGO_5 (((clk * 1000 / 32) / bps) - 1)
> >
> > Maybe replace this with a "clock-frequency" property? This may
> > be what the registers contain, but it is not very readable.
>
> Hmm... do you want a frequency in absolute terms? And then calculate
> the best SCBRR value for it?
> I'm unsure about this, either you must exactly hit it or accept
> tolerances? As something in between I renamed the property to
> "renesas,clock-algorithm", but I don't know if this is what you want.
I meant the absolute frequency in HZ, since that is what we do
for the 8250 uart and other devices, but only if that is sufficient
for your device.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Bastian Hecht <hechtb@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org,
Paul Mundt <lethal@linux-sh.org>,
Magnus Damm <magnus.damm@gmail.com>,
linux-serial@vger.kernel.org
Subject: Re: [PATCH v4 1/3] serial: sh-sci: Add OF support
Date: Tue, 5 Mar 2013 19:26:25 +0000 [thread overview]
Message-ID: <201303051926.25655.arnd@arndb.de> (raw)
In-Reply-To: <CABYn4sxYRbmEe27WKE-FbTZ3_SM+APaYqHJ1=Zrk8_a5czxZaQ@mail.gmail.com>
On Tuesday 05 March 2013, Bastian Hecht wrote:
> 2013/3/4 Arnd Bergmann <arnd@arndb.de>:
> > On Monday 04 March 2013 17:20:52 Bastian Hecht wrote:
> >> +- reg : Address and length of the register set for the device
> >> +- interrupts : Should contain the following IRQs: ERI, RXI, TXI and BRI.
> >
> > You probably want to require the "interrupt-names" property as well
> > then.
>
> I added the interrupt-names property but still enforce the ordering in
> the binding specs.
Yes, that is the correct approach.
> Don't know if we want the extra overhead to scan for strings or just
> take a certain order for granted.
> If we want to change it to parsing, it would be better to switch
> completely to platform_get_irq_byname() and change all the current
> platform code, else we will produce code overhead.
Right, there is no need to change the code for that, but I think it
makes sense to do the binding the way you describe, in case someone
later wants to move to platform_get_irq_byname. A lot of people prefer
that for some reason, although I think the traditional numbering is
just as good.
> >> +- renesas,scbrr-algo-id : Algorithm ID for the Bit Rate Register
> >> + 1 = SCBRR_ALGO_1 ((clk + 16 * bps) / (16 * bps) - 1)
> >> + 2 = SCBRR_ALGO_2 ((clk + 16 * bps) / (32 * bps) - 1)
> >> + 3 = SCBRR_ALGO_3 (((clk * 2) + 16 * bps) / (16 * bps) - 1)
> >> + 4 = SCBRR_ALGO_4 (((clk * 2) + 16 * bps) / (32 * bps) - 1)
> >> + 5 = SCBRR_ALGO_5 (((clk * 1000 / 32) / bps) - 1)
> >
> > Maybe replace this with a "clock-frequency" property? This may
> > be what the registers contain, but it is not very readable.
>
> Hmm... do you want a frequency in absolute terms? And then calculate
> the best SCBRR value for it?
> I'm unsure about this, either you must exactly hit it or accept
> tolerances? As something in between I renamed the property to
> "renesas,clock-algorithm", but I don't know if this is what you want.
I meant the absolute frequency in HZ, since that is what we do
for the 8250 uart and other devices, but only if that is sufficient
for your device.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/3] serial: sh-sci: Add OF support
Date: Tue, 5 Mar 2013 19:26:25 +0000 [thread overview]
Message-ID: <201303051926.25655.arnd@arndb.de> (raw)
In-Reply-To: <CABYn4sxYRbmEe27WKE-FbTZ3_SM+APaYqHJ1=Zrk8_a5czxZaQ@mail.gmail.com>
On Tuesday 05 March 2013, Bastian Hecht wrote:
> 2013/3/4 Arnd Bergmann <arnd@arndb.de>:
> > On Monday 04 March 2013 17:20:52 Bastian Hecht wrote:
> >> +- reg : Address and length of the register set for the device
> >> +- interrupts : Should contain the following IRQs: ERI, RXI, TXI and BRI.
> >
> > You probably want to require the "interrupt-names" property as well
> > then.
>
> I added the interrupt-names property but still enforce the ordering in
> the binding specs.
Yes, that is the correct approach.
> Don't know if we want the extra overhead to scan for strings or just
> take a certain order for granted.
> If we want to change it to parsing, it would be better to switch
> completely to platform_get_irq_byname() and change all the current
> platform code, else we will produce code overhead.
Right, there is no need to change the code for that, but I think it
makes sense to do the binding the way you describe, in case someone
later wants to move to platform_get_irq_byname. A lot of people prefer
that for some reason, although I think the traditional numbering is
just as good.
> >> +- renesas,scbrr-algo-id : Algorithm ID for the Bit Rate Register
> >> + 1 = SCBRR_ALGO_1 ((clk + 16 * bps) / (16 * bps) - 1)
> >> + 2 = SCBRR_ALGO_2 ((clk + 16 * bps) / (32 * bps) - 1)
> >> + 3 = SCBRR_ALGO_3 (((clk * 2) + 16 * bps) / (16 * bps) - 1)
> >> + 4 = SCBRR_ALGO_4 (((clk * 2) + 16 * bps) / (32 * bps) - 1)
> >> + 5 = SCBRR_ALGO_5 (((clk * 1000 / 32) / bps) - 1)
> >
> > Maybe replace this with a "clock-frequency" property? This may
> > be what the registers contain, but it is not very readable.
>
> Hmm... do you want a frequency in absolute terms? And then calculate
> the best SCBRR value for it?
> I'm unsure about this, either you must exactly hit it or accept
> tolerances? As something in between I renamed the property to
> "renesas,clock-algorithm", but I don't know if this is what you want.
I meant the absolute frequency in HZ, since that is what we do
for the 8250 uart and other devices, but only if that is sufficient
for your device.
Arnd
next prev parent reply other threads:[~2013-03-05 19:26 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 15:23 [PATCH v4 1/3] serial: sh-sci: Add OF support Bastian Hecht
2013-03-04 16:20 ` Bastian Hecht
2013-03-04 16:20 ` Bastian Hecht
2013-03-04 15:23 ` [PATCH v4 2/3] ARM: mach-shmobile: r8a7740: Add DT names to clock list Bastian Hecht
2013-03-04 16:20 ` Bastian Hecht
2013-03-04 16:20 ` Bastian Hecht
2013-03-04 15:29 ` [PATCH v4 3/3] ARM: mach-shmobile: r8a7740: Setup the serial devices using DT Bastian Hecht
2013-03-04 16:20 ` Bastian Hecht
2013-03-04 16:20 ` Bastian Hecht
2013-03-04 16:22 ` Arnd Bergmann
2013-03-04 16:22 ` Arnd Bergmann
2013-03-04 16:22 ` Arnd Bergmann
2013-03-05 13:00 ` Bastian Hecht
2013-03-05 13:00 ` Bastian Hecht
2013-03-05 13:00 ` Bastian Hecht
2013-03-05 13:42 ` Sergei Shtylyov
2013-03-05 13:42 ` Sergei Shtylyov
2013-03-05 13:42 ` Sergei Shtylyov
2013-03-05 13:47 ` Bastian Hecht
2013-03-05 13:47 ` Bastian Hecht
2013-03-05 13:47 ` Bastian Hecht
2013-03-05 19:22 ` Arnd Bergmann
2013-03-05 19:22 ` Arnd Bergmann
2013-03-05 19:22 ` Arnd Bergmann
2013-03-04 16:20 ` [PATCH v4 1/3] serial: sh-sci: Add OF support Arnd Bergmann
2013-03-04 16:20 ` Arnd Bergmann
2013-03-04 16:20 ` Arnd Bergmann
2013-03-05 12:58 ` Bastian Hecht
2013-03-05 12:58 ` Bastian Hecht
2013-03-05 12:58 ` Bastian Hecht
2013-03-05 19:26 ` Arnd Bergmann [this message]
2013-03-05 19:26 ` Arnd Bergmann
2013-03-05 19:26 ` Arnd Bergmann
2013-03-06 0:50 ` Paul Mundt
2013-03-06 0:50 ` Paul Mundt
2013-03-06 0:50 ` Paul Mundt
2013-03-06 10:19 ` Bastian Hecht
2013-03-06 10:19 ` Bastian Hecht
2013-03-06 10:19 ` Bastian Hecht
2013-03-06 10:28 ` Arnd Bergmann
2013-03-06 10:28 ` Arnd Bergmann
2013-03-06 10:28 ` Arnd Bergmann
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=201303051926.25655.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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 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.