From: Stephen Warren <swarren@wwwdotorg.org>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com,
devicetree-discuss@lists.ozlabs.org, kyungmin.park@samsung.com,
linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org,
linus.walleij@linaro.org, m.szyprowski@samsung.com
Subject: Re: [RFC 6/6] ARM: dts: exynos4210: Add platform-specific descriptions for pin controllers
Date: Tue, 25 Sep 2012 16:52:39 -0600 [thread overview]
Message-ID: <506235B7.7020507@wwwdotorg.org> (raw)
In-Reply-To: <1634883.GDdJlvHhnl@flatron>
On 09/25/2012 12:35 PM, Tomasz Figa wrote:
> On Tuesday 25 of September 2012 12:22:03 Stephen Warren wrote:
...
>> BTW, how does the driver know what register addresses to use; I can see
>> the base for each pin controller bank is in samsung,pctl-offset, but
>> what describes the offset for each of the func, pud, drv, ... registers
>> from there? Are the offsets the same for all current Samsung SoCs?
>
> The offsets are defined as constants in the driver.
>
> They are the same in all cases, but the "4bit2" bank type of S3C64xx, which
> can have up to 16 pins with 4-bit function specifiers, so two registers are
> required for function configuration. In this case all the remaining
> registers are offset by 0x04.
>
> I couldn't think about any good solution for this special case, but still,
> I haven't been thinking a lot about it, as the driver is targetted at
> current Exynos SoCs primarily.
I suppose if you always assume that the registers will appear in a
specific order, and never have gaps between them, then you can simply
always calculate the addresses as e.g.:
reg_func = reg_base
reg_pud = reg_func + round_up(num_pins / (32 / func_width))
reg_drv = reg_pud + round_up(num_pins / (32 / func_width))
...
Then, there wouldn't ever be any special cases - that calculation would
always work.
An alternative would be to put each register's address in DT rather than
just the base of the register block. It'd certainly be more
future-flexible, even if not strictly necessary.
WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 6/6] ARM: dts: exynos4210: Add platform-specific descriptions for pin controllers
Date: Tue, 25 Sep 2012 16:52:39 -0600 [thread overview]
Message-ID: <506235B7.7020507@wwwdotorg.org> (raw)
In-Reply-To: <1634883.GDdJlvHhnl@flatron>
On 09/25/2012 12:35 PM, Tomasz Figa wrote:
> On Tuesday 25 of September 2012 12:22:03 Stephen Warren wrote:
...
>> BTW, how does the driver know what register addresses to use; I can see
>> the base for each pin controller bank is in samsung,pctl-offset, but
>> what describes the offset for each of the func, pud, drv, ... registers
>> from there? Are the offsets the same for all current Samsung SoCs?
>
> The offsets are defined as constants in the driver.
>
> They are the same in all cases, but the "4bit2" bank type of S3C64xx, which
> can have up to 16 pins with 4-bit function specifiers, so two registers are
> required for function configuration. In this case all the remaining
> registers are offset by 0x04.
>
> I couldn't think about any good solution for this special case, but still,
> I haven't been thinking a lot about it, as the driver is targetted at
> current Exynos SoCs primarily.
I suppose if you always assume that the registers will appear in a
specific order, and never have gaps between them, then you can simply
always calculate the addresses as e.g.:
reg_func = reg_base
reg_pud = reg_func + round_up(num_pins / (32 / func_width))
reg_drv = reg_pud + round_up(num_pins / (32 / func_width))
...
Then, there wouldn't ever be any special cases - that calculation would
always work.
An alternative would be to put each register's address in DT rather than
just the base of the register block. It'd certainly be more
future-flexible, even if not strictly necessary.
next prev parent reply other threads:[~2012-09-25 22:52 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 8:53 [RFC 0/6] pinctrl: samsung: Remove static platform-specific data Tomasz Figa
2012-09-20 8:53 ` Tomasz Figa
2012-09-20 8:53 ` [RFC 1/6] pinctrl: exynos: Parse wakeup-eint parameters from DT Tomasz Figa
2012-09-20 8:53 ` Tomasz Figa
2012-09-20 8:53 ` [RFC 2/6] pinctrl: samsung: Parse pin banks " Tomasz Figa
2012-09-20 8:53 ` Tomasz Figa
2012-09-20 8:53 ` [RFC 3/6] pinctrl: exynos: Remove static platform-specific data Tomasz Figa
2012-09-20 8:53 ` Tomasz Figa
2012-09-20 8:53 ` [RFC 4/6] pinctrl: samsung: Parse bank-specific eint offset from DT Tomasz Figa
2012-09-20 8:53 ` Tomasz Figa
2012-09-20 8:53 ` [RFC 5/6] ARM: dts: exynos4210: Remove legacy gpio nodes Tomasz Figa
2012-09-20 8:53 ` Tomasz Figa
2012-09-20 8:53 ` [RFC 6/6] ARM: dts: exynos4210: Add platform-specific descriptions for pin controllers Tomasz Figa
2012-09-20 8:53 ` Tomasz Figa
2012-09-21 18:56 ` Stephen Warren
2012-09-21 18:56 ` Stephen Warren
2012-09-21 19:54 ` Tomasz Figa
2012-09-21 19:54 ` Tomasz Figa
2012-09-24 17:42 ` Stephen Warren
2012-09-24 17:42 ` Stephen Warren
2012-09-24 21:31 ` Tomasz Figa
2012-09-24 21:31 ` Tomasz Figa
2012-09-24 23:14 ` Stephen Warren
2012-09-24 23:14 ` Stephen Warren
2012-09-25 9:37 ` Tomasz Figa
2012-09-25 9:37 ` Tomasz Figa
2012-09-25 16:49 ` Stephen Warren
2012-09-25 16:49 ` Stephen Warren
2012-09-25 17:41 ` Tomasz Figa
2012-09-25 17:41 ` Tomasz Figa
2012-09-25 18:22 ` Stephen Warren
2012-09-25 18:22 ` Stephen Warren
2012-09-25 18:35 ` Tomasz Figa
2012-09-25 18:35 ` Tomasz Figa
2012-09-25 22:52 ` Stephen Warren [this message]
2012-09-25 22:52 ` Stephen Warren
2012-09-20 10:27 ` [RFC 0/6] pinctrl: samsung: Remove static platform-specific data Linus Walleij
2012-09-20 10:27 ` Linus Walleij
2012-09-21 18:40 ` Stephen Warren
2012-09-21 18:40 ` Stephen Warren
2012-09-21 19:31 ` Tomasz Figa
2012-09-21 19:31 ` Tomasz Figa
2012-09-24 17:34 ` Stephen Warren
2012-09-24 17:34 ` Stephen Warren
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=506235B7.7020507@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=t.figa@samsung.com \
--cc=thomas.abraham@linaro.org \
--cc=tomasz.figa@gmail.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.