Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1212925 > unrolled thread
| Started by | Grygorii Strashko <grygorii.strashko@ti.com> |
|---|---|
| First post | 2015-08-25 12:10 +0200 |
| Last post | 2015-09-02 13:20 +0200 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Grygorii Strashko <grygorii.strashko@ti.com> - 2015-08-25 12:10 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Mark Brown <broonie@kernel.org> - 2015-08-25 16:00 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-31 12:50 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Mark Brown <broonie@kernel.org> - 2015-08-31 17:00 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Kishon Vijay Abraham I <kishon@ti.com> - 2015-09-01 11:50 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Kishon Vijay Abraham I <kishon@ti.com> - 2015-09-01 13:40 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Tony Lindgren <tony@atomide.com> - 2015-09-01 16:20 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Mark Brown <broonie@kernel.org> - 2015-09-01 20:40 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Tony Lindgren <tony@atomide.com> - 2015-09-01 21:00 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Mark Brown <broonie@kernel.org> - 2015-09-02 13:20 +0200
| From | Grygorii Strashko <grygorii.strashko@ti.com> |
|---|---|
| Date | 2015-08-25 12:10 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <q1jl0-3k4-9@gated-at.bofh.it> |
Hi Mark,
On 08/19/2015 09:11 PM, Mark Brown wrote:
> On Tue, Aug 18, 2015 at 11:23:54AM +0530, Kishon Vijay Abraham I wrote:
>> On Friday 14 August 2015 11:30 PM, Mark Brown wrote:
>>> On Mon, Jul 27, 2015 at 04:54:09PM +0530, Kishon Vijay Abraham I wrote:
>
>>>> is moved as a child node of syscon, vsel_reg and enable_reg has the
>>>> absolute address because of the address translation that happens while
>>>> creating device from device tree node.
>>>> So avoid using platform_get_resource and use of_get_address in order to
>>>> get only the offset (untranslated address) and populate these in
>>>> vsel_reg and enable_reg.
>
>>> This sounds like we're going in the wrong direction, we're moving from a
>>> more generic API to a firmware specific one. Why is this a good fix?
>
>> platform_get_resource can be used if we need the absolute address but here we
>> need only the offset.
>
> So substract this address from the start of the resource to get the
> offset? Or provide a wrapper function in the resource code which does
> that.
I'd be very appreciated if you have and can share any thought on
How can we get this absolute base address to substract?
Below is what we have in DT:
l4_cfg: l4@4a000000 {
compatible = "ti,dra7-l4-cfg", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x4a000000 0x22c000>;
[GS] <=== 0x4a000000 is our top level l4 base address
scm: scm@2000 {
compatible = "ti,dra7-scm-core", "simple-bus";
reg = <0x2000 0x2000>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x2000 0x2000>;
[GS] <=== 0x4a002000 is our scm-core base address
IORESOURCE_MEM: 0x4a002000 : 4A003FFF
scm_conf: scm_conf@0 {
compatible = "syscon", "simple-bus";
reg = <0x0 0x1400>;
#address-cells = <1>;
#size-cells = <1>;
[GS] <=== 0x4a002000 is our syscon base address
IORESOURCE_MEM: 0x4a002000 : 4A0033FF
pbias_regulator: pbias_regulator {
compatible = "ti,pbias-omap";
reg = <0xe00 0x4>;
[GS] <=== 0x4a002E00 is our pbias base address
IORESOURCE_MEM: 0x4a002E00 : 4A002E03
Here we should use reg_offset=0xE00 as input parameter for regmap APIs.
syscon = <&scm_conf>;
pbias_mmc_reg: pbias_mmc_omap5 {
regulator-name = "pbias_mmc_omap5";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
};
};
scm_conf_clocks: clocks {
#address-cells = <1>;
#size-cells = <0>;
};
};
As I understood, all of_address APIs/code is designed to parse/translate
addresses in top-bottom direction, and it looks nontrivial to get any kind
of base addresses from driver's side (except of its own address), because
it will require reverse DT parsing in bottom-top direction.
Maybe I missed smth?
--
regards,
-grygorii
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-08-25 16:00 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <q1mVB-8gb-25@gated-at.bofh.it> |
| In reply to | #1212925 |
[Multipart message — attachments visible in raw view] — view raw
On Tue, Aug 25, 2015 at 01:03:04PM +0300, Grygorii Strashko wrote: > On 08/19/2015 09:11 PM, Mark Brown wrote: > > So substract this address from the start of the resource to get the > > offset? Or provide a wrapper function in the resource code which does > > that. > I'd be very appreciated if you have and can share any thought on > How can we get this absolute base address to substract? Ask the syscon device for its resource? Or have it provide an absolute address based interface for that matter?
[toc] | [prev] | [next] | [standalone]
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2015-08-31 12:50 +0200 |
| Message-ID | <q3uOZ-5hK-5@gated-at.bofh.it> |
| In reply to | #1213050 |
Hi Mark, On Tuesday 25 August 2015 07:20 PM, Mark Brown wrote: > On Tue, Aug 25, 2015 at 01:03:04PM +0300, Grygorii Strashko wrote: >> On 08/19/2015 09:11 PM, Mark Brown wrote: > >>> So substract this address from the start of the resource to get the >>> offset? Or provide a wrapper function in the resource code which does >>> that. > >> I'd be very appreciated if you have and can share any thought on >> How can we get this absolute base address to substract? > > Ask the syscon device for its resource? Or have it provide an absolute Even if we get the absolute address of syscon, we have to do the subtraction only for the newer dtbs (previous dtbs already have only the offset). Do you recommend adding a new property to differentiate between older dtbs and newer dtbs? Any other suggestions here? > address based interface for that matter? Syscon doesn't directly expose any API's to write to it's register. Rather it uses regmap APIs to read/write to it's register. I'm not sure if it's possible to add regmap APIs to write to a register with absolute address. Any hints? Thanks Kishon -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-08-31 17:00 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <q3yIX-2rV-39@gated-at.bofh.it> |
| In reply to | #1216137 |
[Multipart message — attachments visible in raw view] — view raw
On Mon, Aug 31, 2015 at 04:14:07PM +0530, Kishon Vijay Abraham I wrote: > On Tuesday 25 August 2015 07:20 PM, Mark Brown wrote: > > On Tue, Aug 25, 2015 at 01:03:04PM +0300, Grygorii Strashko wrote: > >> On 08/19/2015 09:11 PM, Mark Brown wrote: > >>> So substract this address from the start of the resource to get the > >>> offset? Or provide a wrapper function in the resource code which does > >>> that. > > > >> I'd be very appreciated if you have and can share any thought on > >> How can we get this absolute base address to substract? > > > > Ask the syscon device for its resource? Or have it provide an absolute > > Even if we get the absolute address of syscon, we have to do the > subtraction only for the newer dtbs (previous dtbs already have only the > offset). Do you recommend adding a new property to differentiate between > older dtbs and newer dtbs? Any other suggestions here? Hang on. This is the first I've heard of any DTs not just having absolute addresses. How does any of this work - has it ever worked, and is the situation completely understood? My original concern with this was that I coudn't understand the commit log and your original response seemed to indicate that we always have the absolute address :( Perhaps this is something to do with the brief mention of having moved the DT node for some reason? We at least need some sort of coherent explanation of the problem and a comprehensible fix to go with it. Right now it seems like things are just being moved about to hide problems without either of these things which seems like it makes the code less clear and more fragile. > > address based interface for that matter? > Syscon doesn't directly expose any API's to write to it's register. > Rather it uses regmap APIs to read/write to it's register. I'm not sure > if it's possible to add regmap APIs to write to a register with absolute > address. Any hints? Yes, I'm aware that it is regmap based! What I am suggesting is that if people are making DTs like yours with devices that are children of the syscon then presumably it might be useful for it to allow client drivers to pass absolute addresses in so that it can translate for them.
[toc] | [prev] | [next] | [standalone]
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2015-09-01 11:50 +0200 |
| Message-ID | <q3Qmu-2NS-19@gated-at.bofh.it> |
| In reply to | #1216242 |
Hi Mark,
On Monday 31 August 2015 08:22 PM, Mark Brown wrote:
> On Mon, Aug 31, 2015 at 04:14:07PM +0530, Kishon Vijay Abraham I wrote:
>> On Tuesday 25 August 2015 07:20 PM, Mark Brown wrote:
>>> On Tue, Aug 25, 2015 at 01:03:04PM +0300, Grygorii Strashko wrote:
>>>> On 08/19/2015 09:11 PM, Mark Brown wrote:
>
>>>>> So substract this address from the start of the resource to get the
>>>>> offset? Or provide a wrapper function in the resource code which does
>>>>> that.
>>>
>>>> I'd be very appreciated if you have and can share any thought on
>>>> How can we get this absolute base address to substract?
>>>
>>> Ask the syscon device for its resource? Or have it provide an absolute
>>
>> Even if we get the absolute address of syscon, we have to do the
>> subtraction only for the newer dtbs (previous dtbs already have only the
>> offset). Do you recommend adding a new property to differentiate between
>> older dtbs and newer dtbs? Any other suggestions here?
>
> Hang on. This is the first I've heard of any DTs not just having
> absolute addresses. How does any of this work - has it ever worked, and
> is the situation completely understood? My original concern with this
Before commit d919501feffa8715147582c3ffce96fad0c7016f ARM: dts: dra7:
add minimal l4 bus layout with control module support, the dt was like
ocp {
dra7_ctrl_general: tisyscon@4a002e00 {
compatible = "syscon";
reg = <0x4a002e00 0x7c>;
};
pbias_regulator: pbias_regulator {
compatible = "ti,pbias-omap";
reg = <0 0x4>;
syscon = <&dra7_ctrl_general>;
};
};
Here platform_get_resource in pbias driver returns '0' which is
populated in vsel_reg and enable_reg. And regulator_enable_regmap uses
the base address from tisyscon@4a002e00 which is '0x4a002e00' and offset
from enable_reg which is '0' inorder to write to the pbias register.
But after commit d919501fef, the dt became like this (after a couple of
fixes)
ocp {
l4_cfg: l4@4a000000 {
compatible = "ti,dra7-l4-cfg", "simple-bus";
ranges = <0 0x4a000000 0x22c000>;
scm: scm@2000 {
compatible = "ti,dra7-scm-core", "simple-bus";
reg = <0x2000 0x2000>;
ranges = <0 0x2000 0x2000>;
scm_conf: scm_conf@0 {
compatible = "syscon", "simple-bus";
reg = <0x0 0x1400>;
ranges = <0 0x0 0x1400>;
pbias_regulator: pbias_regulator {
compatible = "ti,pbias-omap";
reg = <0xe00 0x4>;
syscon = <&scm_conf>;
};
};
};
};
};
Here platform_get_resource in pbias driver returns '4a002e00' which is
populated in vsel_reg and enable_reg. And regulator_enable_regmap uses
the base address from scm_conf@0 which is '0x4a002000' and offset from
enable_reg which is '4a002e00' inorder to write to the pbias register
and it results in a abort.
> was that I coudn't understand the commit log and your original response
> seemed to indicate that we always have the absolute address :( Perhaps
We started having the absolute address only after the dt change (commit
d919501fef and a couple of more dt fixes).
> this is something to do with the brief mention of having moved the DT
> node for some reason?
>
> We at least need some sort of coherent explanation of the problem and a
> comprehensible fix to go with it. Right now it seems like things are
> just being moved about to hide problems without either of these things
> which seems like it makes the code less clear and more fragile.
hmm.. IMO the actual problem was modelling the 'offset' as a resource
(by populating the offset in 'reg' property) which was added when the
initial pbias dt node was created. And now since the pbias dt node is
being moved around, it's causing inadvertent address translation
breaking the pbias driver. IMHO the value in 'reg' property of pbias dt
node should be treated as 'offset' instead of address 'resource' and
that's what my patch tried to do.
>
>>> address based interface for that matter?
>
>> Syscon doesn't directly expose any API's to write to it's register.
>> Rather it uses regmap APIs to read/write to it's register. I'm not sure
>> if it's possible to add regmap APIs to write to a register with absolute
>> address. Any hints?
>
> Yes, I'm aware that it is regmap based! What I am suggesting is that if
> people are making DTs like yours with devices that are children of the
> syscon then presumably it might be useful for it to allow client drivers
> to pass absolute addresses in so that it can translate for them.
Arnd, Lee?
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2015-09-01 13:40 +0200 |
| Message-ID | <q3S4W-5ix-29@gated-at.bofh.it> |
| In reply to | #1216722 |
Now fixed Lee Jones mail address!
On Tuesday 01 September 2015 03:10 PM, Kishon Vijay Abraham I wrote:
> Hi Mark,
>
> On Monday 31 August 2015 08:22 PM, Mark Brown wrote:
>> On Mon, Aug 31, 2015 at 04:14:07PM +0530, Kishon Vijay Abraham I wrote:
>>> On Tuesday 25 August 2015 07:20 PM, Mark Brown wrote:
>>>> On Tue, Aug 25, 2015 at 01:03:04PM +0300, Grygorii Strashko wrote:
>>>>> On 08/19/2015 09:11 PM, Mark Brown wrote:
>>
>>>>>> So substract this address from the start of the resource to get the
>>>>>> offset? Or provide a wrapper function in the resource code which does
>>>>>> that.
>>>>
>>>>> I'd be very appreciated if you have and can share any thought on
>>>>> How can we get this absolute base address to substract?
>>>>
>>>> Ask the syscon device for its resource? Or have it provide an absolute
>>>
>>> Even if we get the absolute address of syscon, we have to do the
>>> subtraction only for the newer dtbs (previous dtbs already have only the
>>> offset). Do you recommend adding a new property to differentiate between
>>> older dtbs and newer dtbs? Any other suggestions here?
>>
>> Hang on. This is the first I've heard of any DTs not just having
>> absolute addresses. How does any of this work - has it ever worked, and
>> is the situation completely understood? My original concern with this
>
> Before commit d919501feffa8715147582c3ffce96fad0c7016f ARM: dts: dra7:
> add minimal l4 bus layout with control module support, the dt was like
>
> ocp {
> dra7_ctrl_general: tisyscon@4a002e00 {
> compatible = "syscon";
> reg = <0x4a002e00 0x7c>;
> };
>
> pbias_regulator: pbias_regulator {
> compatible = "ti,pbias-omap";
> reg = <0 0x4>;
> syscon = <&dra7_ctrl_general>;
> };
> };
>
> Here platform_get_resource in pbias driver returns '0' which is
> populated in vsel_reg and enable_reg. And regulator_enable_regmap uses
> the base address from tisyscon@4a002e00 which is '0x4a002e00' and offset
> from enable_reg which is '0' inorder to write to the pbias register.
>
> But after commit d919501fef, the dt became like this (after a couple of
> fixes)
>
> ocp {
> l4_cfg: l4@4a000000 {
> compatible = "ti,dra7-l4-cfg", "simple-bus";
> ranges = <0 0x4a000000 0x22c000>;
>
> scm: scm@2000 {
> compatible = "ti,dra7-scm-core", "simple-bus";
> reg = <0x2000 0x2000>;
> ranges = <0 0x2000 0x2000>;
>
> scm_conf: scm_conf@0 {
> compatible = "syscon", "simple-bus";
> reg = <0x0 0x1400>;
> ranges = <0 0x0 0x1400>;
>
> pbias_regulator: pbias_regulator {
> compatible = "ti,pbias-omap";
> reg = <0xe00 0x4>;
> syscon = <&scm_conf>;
> };
> };
> };
> };
> };
>
> Here platform_get_resource in pbias driver returns '4a002e00' which is
> populated in vsel_reg and enable_reg. And regulator_enable_regmap uses
> the base address from scm_conf@0 which is '0x4a002000' and offset from
> enable_reg which is '4a002e00' inorder to write to the pbias register
> and it results in a abort.
>
>> was that I coudn't understand the commit log and your original response
>> seemed to indicate that we always have the absolute address :( Perhaps
>
> We started having the absolute address only after the dt change (commit
> d919501fef and a couple of more dt fixes).
>
>> this is something to do with the brief mention of having moved the DT
>> node for some reason?
>>
>> We at least need some sort of coherent explanation of the problem and a
>> comprehensible fix to go with it. Right now it seems like things are
>> just being moved about to hide problems without either of these things
>> which seems like it makes the code less clear and more fragile.
>
> hmm.. IMO the actual problem was modelling the 'offset' as a resource
> (by populating the offset in 'reg' property) which was added when the
> initial pbias dt node was created. And now since the pbias dt node is
> being moved around, it's causing inadvertent address translation
> breaking the pbias driver. IMHO the value in 'reg' property of pbias dt
> node should be treated as 'offset' instead of address 'resource' and
> that's what my patch tried to do.
>>
>>>> address based interface for that matter?
>>
>>> Syscon doesn't directly expose any API's to write to it's register.
>>> Rather it uses regmap APIs to read/write to it's register. I'm not sure
>>> if it's possible to add regmap APIs to write to a register with absolute
>>> address. Any hints?
>>
>> Yes, I'm aware that it is regmap based! What I am suggesting is that if
>> people are making DTs like yours with devices that are children of the
>> syscon then presumably it might be useful for it to allow client drivers
>> to pass absolute addresses in so that it can translate for them.
>
> Arnd, Lee?
>
> Thanks
> Kishon
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Tony Lindgren <tony@atomide.com> |
|---|---|
| Date | 2015-09-01 16:20 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <q3UzM-w6-9@gated-at.bofh.it> |
| In reply to | #1216722 |
Hi,
I think the fix is rather easy here.. See below.
* Kishon Vijay Abraham I <kishon@ti.com> [150901 02:43]:
>
> Before commit d919501feffa8715147582c3ffce96fad0c7016f ARM: dts: dra7:
> add minimal l4 bus layout with control module support, the dt was like
>
> ocp {
> dra7_ctrl_general: tisyscon@4a002e00 {
> compatible = "syscon";
> reg = <0x4a002e00 0x7c>;
> };
>
> pbias_regulator: pbias_regulator {
> compatible = "ti,pbias-omap";
> reg = <0 0x4>;
> syscon = <&dra7_ctrl_general>;
> };
> };
Yes the reg = <0 0x4> above is wrong, it's not an offset from the
ocp but from the syscon base.
> But after commit d919501fef, the dt became like this (after a couple of
> fixes)
>
> ocp {
> l4_cfg: l4@4a000000 {
> compatible = "ti,dra7-l4-cfg", "simple-bus";
> ranges = <0 0x4a000000 0x22c000>;
>
> scm: scm@2000 {
> compatible = "ti,dra7-scm-core", "simple-bus";
> reg = <0x2000 0x2000>;
> ranges = <0 0x2000 0x2000>;
>
> scm_conf: scm_conf@0 {
> compatible = "syscon", "simple-bus";
> reg = <0x0 0x1400>;
> ranges = <0 0x0 0x1400>;
>
> pbias_regulator: pbias_regulator {
> compatible = "ti,pbias-omap";
> reg = <0xe00 0x4>;
> syscon = <&scm_conf>;
> };
> };
> };
> };
> };
And here we properly describe the hardware interconnect layout and
of_ioremap and friends do the right thing. And reg = <0xxe00 0x4>
is correct offset from the scm_conf base.
Why don't you just make reg unused for pbias_regulator since
we already use regmap for this driver?
Then in the pbias driver just define the register offset from
the syscon base? You may need to set it based on the compatible
value, but it's not like it's going to change for SoC.
If we eventually add some API to calculate reg base offset
from the syscon base it's easy to update the driver to use
that.
Cheers,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-09-01 20:40 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <q3YDo-6fB-23@gated-at.bofh.it> |
| In reply to | #1216871 |
[Multipart message — attachments visible in raw view] — view raw
On Tue, Sep 01, 2015 at 07:17:21AM -0700, Tony Lindgren wrote: > Why don't you just make reg unused for pbias_regulator since > we already use regmap for this driver? > Then in the pbias driver just define the register offset from > the syscon base? You may need to set it based on the compatible > value, but it's not like it's going to change for SoC. > If we eventually add some API to calculate reg base offset > from the syscon base it's easy to update the driver to use > that. That'd work. The other thing I was thinking we could do is to get syscon to treat any excessively large address that gets passed in that looks like an absolute address appropriately.
[toc] | [prev] | [next] | [standalone]
| From | Tony Lindgren <tony@atomide.com> |
|---|---|
| Date | 2015-09-01 21:00 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <q3YWK-6Cc-5@gated-at.bofh.it> |
| In reply to | #1217020 |
* Mark Brown <broonie@kernel.org> [150901 11:40]: > On Tue, Sep 01, 2015 at 07:17:21AM -0700, Tony Lindgren wrote: > > > Why don't you just make reg unused for pbias_regulator since > > we already use regmap for this driver? > > > Then in the pbias driver just define the register offset from > > the syscon base? You may need to set it based on the compatible > > value, but it's not like it's going to change for SoC. > > > If we eventually add some API to calculate reg base offset > > from the syscon base it's easy to update the driver to use > > that. > > That'd work. The other thing I was thinking we could do is to get > syscon to treat any excessively large address that gets passed in that > looks like an absolute address appropriately. Hmm wouldn't that get messy for 64-bit :) How about something like: unsigned long syscon_regmap_get_offset(struct regmap *syscon, void __iomem *base) Not sure if that's something that some drivers would start to misuse with read/writel though.. Presumably not if the driver already is using syscon. Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-09-02 13:20 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <q4ef7-3r7-1@gated-at.bofh.it> |
| In reply to | #1217026 |
[Multipart message — attachments visible in raw view] — view raw
On Tue, Sep 01, 2015 at 11:56:06AM -0700, Tony Lindgren wrote: > * Mark Brown <broonie@kernel.org> [150901 11:40]: > > That'd work. The other thing I was thinking we could do is to get > > syscon to treat any excessively large address that gets passed in that > > looks like an absolute address appropriately. > Hmm wouldn't that get messy for 64-bit :) How about something > like: Meh, it'd probably be fine - I was thinking falling back to trying to substract the base address if the passed address was out of bounds. It's not super elegant though, something that directly does the right thing would be better. > unsigned long syscon_regmap_get_offset(struct regmap *syscon, > void __iomem *base) > Not sure if that's something that some drivers would start to > misuse with read/writel though.. Presumably not if the driver > already is using syscon. It should be really easy to spot abuse I'd hope.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web