linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Overlapping regions in DT
@ 2015-02-08  3:17 Stefan Wahren
  2015-02-09  8:22 ` Tsahee Zidenberg
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Wahren @ 2015-02-08  3:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

currently i work on two DT capable drivers for a ARM9 processor. The former
driver mxs_power.c should trigger the population of the underlying power
management functions and the ladder take care of the on-chip regulators. In the
future more drivers
should be added as child nodes of the power driver. 

My problem is that some of the processor registers are not separated per
function. So
the drivers need access (mostly read) on the same registers.

Here are my questions:

How should define i the register space in the device?
Define the regions in the parent node and use offsets in the childs?
Which functions are recommend for such access?

I want to make use of of_platform_populate / of_platform_depopulate.
Is there anything i should take care of?

The relevant parts of the devicetree is at the end of the mail.

Best regards
Stefan

       power: power at 80044000 {
                compatible = "fsl,imx28-power"; /* handled by mxs_power.c */
                #address-cells = <1>;
                #size-cells = <1>;
                reg = <0x80044000 0x2000>;
                interrupts = <6>;
                ranges;

                reg_vddd: regulator at 80044040 {
                        reg = <0x80044040 0x10>,
                              <0x80044010 0x10>,
                              <0x800440c0 0x10>;
                        reg-names = "base-address",
                                    "v5ctrl-address",
                                    "status-address";
                        compatible = "fsl,imx28-vddd"; /* handled by
mxs-regulator.c */
                        regulator-name = "vddd";
                        regulator-min-microvolt = <1350000>;
                        regulator-max-microvolt = <1550000>;
                        vddd-supply = <&reg_vdda>;
                };

                reg_vdda: regulator at 80044050 {
                        reg = <0x80044050 0x10>,
                              <0x80044010 0x10>,
                              <0x800440c0 0x10>;
                        reg-names = "base-address",
                                    "v5ctrl-address",
                                    "status-address";
                        compatible = "fsl,imx28-vdda"; /* handled by
mxs-regulator.c */
                        regulator-name = "vdda";
                        regulator-min-microvolt = <1725000>;
                        regulator-max-microvolt = <1950000>;
                        vdda-supply = <&reg_vddio>;
                };

                reg_vddio: regulator at 80044060 {
                        reg = <0x80044060 0x10>,
                              <0x80044010 0x10>,
                              <0x800440c0 0x10>;
                        reg-names = "base-address",
                                    "v5ctrl-address",
                                    "status-address";
                        compatible = "fsl,imx28-vddio"; /* handled by
mxs-regulator.c */
                        regulator-name = "vddio";
                        regulator-min-microvolt = <3000000>;
                        regulator-max-microvolt = <3575000>;
                        regulator-microvolt-offset = <80000>;
                };
        };

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Overlapping regions in DT
  2015-02-08  3:17 Overlapping regions in DT Stefan Wahren
@ 2015-02-09  8:22 ` Tsahee Zidenberg
  2015-02-11 15:49   ` Stefan Wahren
  0 siblings, 1 reply; 3+ messages in thread
From: Tsahee Zidenberg @ 2015-02-09  8:22 UTC (permalink / raw)
  To: linux-arm-kernel

syscon regmap is one possible way to access a register file from two
different drivers without mapping it twice. But in that case you loose
the name-per-register in devicetree. The devtree maps the general
regfile, and the drivers know the offsets by themselves.
Have a look here:
Have a look: http://thread.gmane.org/gmane.linux.kernel/1352299

On 8 February 2015 at 05:17, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi,
>
> currently i work on two DT capable drivers for a ARM9 processor. The former
> driver mxs_power.c should trigger the population of the underlying power
> management functions and the ladder take care of the on-chip regulators. In the
> future more drivers
> should be added as child nodes of the power driver.
>
> My problem is that some of the processor registers are not separated per
> function. So
> the drivers need access (mostly read) on the same registers.
>
> Here are my questions:
>
> How should define i the register space in the device?
> Define the regions in the parent node and use offsets in the childs?
> Which functions are recommend for such access?
>
> I want to make use of of_platform_populate / of_platform_depopulate.
> Is there anything i should take care of?
>
> The relevant parts of the devicetree is at the end of the mail.
>
> Best regards
> Stefan
>
>        power: power at 80044000 {
>                 compatible = "fsl,imx28-power"; /* handled by mxs_power.c */
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>                 reg = <0x80044000 0x2000>;
>                 interrupts = <6>;
>                 ranges;
>
>                 reg_vddd: regulator at 80044040 {
>                         reg = <0x80044040 0x10>,
>                               <0x80044010 0x10>,
>                               <0x800440c0 0x10>;
>                         reg-names = "base-address",
>                                     "v5ctrl-address",
>                                     "status-address";
>                         compatible = "fsl,imx28-vddd"; /* handled by
> mxs-regulator.c */
>                         regulator-name = "vddd";
>                         regulator-min-microvolt = <1350000>;
>                         regulator-max-microvolt = <1550000>;
>                         vddd-supply = <&reg_vdda>;
>                 };
>
>                 reg_vdda: regulator at 80044050 {
>                         reg = <0x80044050 0x10>,
>                               <0x80044010 0x10>,
>                               <0x800440c0 0x10>;
>                         reg-names = "base-address",
>                                     "v5ctrl-address",
>                                     "status-address";
>                         compatible = "fsl,imx28-vdda"; /* handled by
> mxs-regulator.c */
>                         regulator-name = "vdda";
>                         regulator-min-microvolt = <1725000>;
>                         regulator-max-microvolt = <1950000>;
>                         vdda-supply = <&reg_vddio>;
>                 };
>
>                 reg_vddio: regulator at 80044060 {
>                         reg = <0x80044060 0x10>,
>                               <0x80044010 0x10>,
>                               <0x800440c0 0x10>;
>                         reg-names = "base-address",
>                                     "v5ctrl-address",
>                                     "status-address";
>                         compatible = "fsl,imx28-vddio"; /* handled by
> mxs-regulator.c */
>                         regulator-name = "vddio";
>                         regulator-min-microvolt = <3000000>;
>                         regulator-max-microvolt = <3575000>;
>                         regulator-microvolt-offset = <80000>;
>                 };
>         };
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Overlapping regions in DT
  2015-02-09  8:22 ` Tsahee Zidenberg
@ 2015-02-11 15:49   ` Stefan Wahren
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Wahren @ 2015-02-11 15:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tsahee,

Am 09.02.2015 um 09:22 schrieb Tsahee Zidenberg:
> syscon regmap is one possible way to access a register file from two
> different drivers without mapping it twice. But in that case you loose
> the name-per-register in devicetree. The devtree maps the general
> regfile, and the drivers know the offsets by themselves.
> Have a look here:
> Have a look: http://thread.gmane.org/gmane.linux.kernel/1352299

thanks for your suggestion. I'll give it a try.

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-11 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-08  3:17 Overlapping regions in DT Stefan Wahren
2015-02-09  8:22 ` Tsahee Zidenberg
2015-02-11 15:49   ` Stefan Wahren

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).