From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
Boris Brezillon
<boris-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Mike Turquette
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Emilio Lopez <emilio-0Z03zUJReD5OxF6Tv1QG9Q@public.gmane.org>,
Linux Media Mailing List
<linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-arm-kernel
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: [PATCH 3/9] clk: sunxi: Add prcm mod0 clock driver
Date: Fri, 28 Nov 2014 14:37:14 +0100 [thread overview]
Message-ID: <54787A8A.6040209@redhat.com> (raw)
In-Reply-To: <20141127190509.GR25249@lukather>
[-- Attachment #1: Type: text/plain, Size: 2587 bytes --]
Hi,
On 11/27/2014 08:05 PM, Maxime Ripard wrote:
> Hi,
>
> On Thu, Nov 27, 2014 at 11:10:51AM +0100, Hans de Goede wrote:
>> Hi,
>>
>> On 11/27/2014 10:28 AM, Chen-Yu Tsai wrote:
>>> Hi,
>>>
>>> On Thu, Nov 27, 2014 at 4:41 PM, Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>
>> <snip>
>>
>>>> I notice that you've not responded to my proposal to simple make the clock
>>>> node a child node of the clocks node in the dt, that should work nicely, and
>>>> avoid the need for any kernel level changes to support it, I'm beginning to
>>>> think that that is probably the best solution.
>>>
>>> Would that not cause an overlap of the io regions, and cause one of them
>>> to fail? AFAIK the OF subsystem doesn't like overlapping resources.
>>
>> No the overlap check is done by the platform dev resource code, and of_clk_declare
>> does not use that. So the overlap would be there, but not an issue (in theory
>> I did not test this).
>
> An overlap is always an issue.
>
>> Thinking more about this, I believe that using the MFD framework for the prcm seems
>> like a mistake to me. It gains us nothing, since we have no irq to de-multiplex or
>> some such. We're not using MFD for the CMU, why use it for CMU2 (which the prcm
>> effectively is) ?
>
> Because the PRCM is much more than that. It also handles the power
> domains for example.
Ok, so thinking more about this, I'm still convinced that the MFD framework is only
getting in the way here. But I can see having things represented in devicetree
properly, with the clocks, etc. as child nodes of the prcm being something which
we want.
So since all we are using the MFD for is to instantiate platform devices under the prcm
nodes, and assign an io resource for the regs to them, why not simply make the prcm node
itself a simple-bus.
This does everything the MFD prcm driver currently does, without actually needing a specific
kernel driver, and as added bonus this will move the definition of the mfd function reg offsets
out of the kernel and into the devicetree where they belong in the first place.
Please see the attached patches, I've tested this on sun6i, if we go this route we should
make the same change on sun8i (I can make the change, but not test it).
Regards,
Hans
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: 0001-ARM-dts-sun6i-Change-prcm-node-into-a-simple-bus.patch --]
[-- Type: text/x-patch, Size: 2231 bytes --]
>From 6756574293a1f291a8dcc29427b27f32f83acb2d Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Fri, 28 Nov 2014 13:48:58 +0100
Subject: [PATCH v2 1/2] ARM: dts: sun6i: Change prcm node into a simple-bus
The prcm node's purpose is to group the various prcm sub-devices together,
it does not need any special handling beyond that, there is no need to
handle shared resources like a shared (multiplexed) interrupt or a shared
i2c bus.
As such there really is no need to have a separate compatible for it, using
simple-bus for it works fine. This also allows us to specify the register
offsets of the various child-devices directly into the dts, rather then having
to specify them in the OS implementation, putting the register offsets where
the belong.
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
arch/arm/boot/dts/sun6i-a31.dtsi | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 29e6438..4b8541f 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -846,11 +846,15 @@
};
prcm@01f01400 {
- compatible = "allwinner,sun6i-a31-prcm";
+ compatible = "simple-bus";
reg = <0x01f01400 0x200>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
ar100: ar100_clk {
compatible = "allwinner,sun6i-a31-ar100-clk";
+ reg = <0x01f01400 0x4>;
#clock-cells = <0>;
clocks = <&osc32k>, <&osc24M>, <&pll6>, <&pll6>;
clock-output-names = "ar100";
@@ -867,6 +871,7 @@
apb0: apb0_clk {
compatible = "allwinner,sun6i-a31-apb0-clk";
+ reg = <0x01f0140c 0x4>;
#clock-cells = <0>;
clocks = <&ahb0>;
clock-output-names = "apb0";
@@ -874,6 +879,7 @@
apb0_gates: apb0_gates_clk {
compatible = "allwinner,sun6i-a31-apb0-gates-clk";
+ reg = <0x01f01428 0x4>;
#clock-cells = <1>;
clocks = <&apb0>;
clock-output-names = "apb0_pio", "apb0_ir",
@@ -884,6 +890,7 @@
apb0_rst: apb0_rst {
compatible = "allwinner,sun6i-a31-clock-reset";
+ reg = <0x01f014b0 0x4>;
#reset-cells = <1>;
};
};
--
2.1.0
[-- Attachment #3: 0002-ARM-dts-sun6i-Add-ir_clk-node.patch --]
[-- Type: text/x-patch, Size: 992 bytes --]
>From a152b0405d446c748fef146915736e4a8fc548b1 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Fri, 28 Nov 2014 13:54:14 +0100
Subject: [PATCH v2 2/2] ARM: dts: sun6i: Add ir_clk node
Add an ir_clk sub-node to the prcm node.
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 4b8541f..92a1c95 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -888,6 +888,14 @@
"apb0_i2c";
};
+ ir_clk: ir_clk {
+ reg = <0x01f01454 0x4>;
+ #clock-cells = <0>;
+ compatible = "allwinner,sun4i-a10-mod0-clk";
+ clocks = <&osc32k>, <&osc24M>;
+ clock-output-names = "ir";
+ };
+
apb0_rst: apb0_rst {
compatible = "allwinner,sun6i-a31-clock-reset";
reg = <0x01f014b0 0x4>;
next prev parent reply other threads:[~2014-11-28 13:37 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 15:55 [PATCH 0/9] sun6i / A31 ir receiver support Hans de Goede
[not found] ` <1416498928-1300-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-20 15:55 ` [PATCH 1/9] clk: sunxi: Give sunxi_factors_register a registers parameter Hans de Goede
2014-11-21 8:35 ` Maxime Ripard
2014-11-21 8:44 ` Hans de Goede
[not found] ` <546EFB83.1020806-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-21 11:15 ` Maxime Ripard
2014-11-20 15:55 ` [PATCH 2/9] clk: sunxi: Make sun4i_a10_mod0_data available outside of clk-mod0.c Hans de Goede
2014-11-20 15:55 ` [PATCH 3/9] clk: sunxi: Add prcm mod0 clock driver Hans de Goede
[not found] ` <1416498928-1300-4-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-20 18:24 ` Chen-Yu Tsai
[not found] ` <CAGb2v66zoAy93mjZn+yf8zvCmkQ8AVWH92jKL-gyu90E5HLuuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-20 19:32 ` Hans de Goede
2014-11-21 8:49 ` Maxime Ripard
2014-11-21 9:13 ` Hans de Goede
[not found] ` <546F0226.2040700-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-24 22:03 ` Maxime Ripard
2014-11-25 8:29 ` Hans de Goede
[not found] ` <54743DE1.7020704-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-25 8:37 ` Hans de Goede
2014-11-26 21:13 ` Maxime Ripard
2014-11-27 8:41 ` Hans de Goede
[not found] ` <5476E3A5.4000708-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-27 9:28 ` Chen-Yu Tsai
[not found] ` <CAGb2v652m0bCdPWFF4LWwjcrCJZvnLibFPw8xXJ3Q-Ge+_-p7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-27 10:10 ` Hans de Goede
[not found] ` <5476F8AB.2000601-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-27 19:05 ` Maxime Ripard
2014-11-28 13:37 ` Hans de Goede [this message]
[not found] ` <54787A8A.6040209-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-12-02 15:45 ` Maxime Ripard
2014-12-03 9:49 ` Hans de Goede
[not found] ` <547EDCA0.4040805-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-12-07 18:08 ` Maxime Ripard
2014-12-08 8:19 ` Hans de Goede
[not found] ` <54855EF6.1000900-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-12-09 8:51 ` Maxime Ripard
2014-11-27 18:51 ` Maxime Ripard
2014-11-27 16:40 ` Boris Brezillon
2014-11-27 19:15 ` Maxime Ripard
2014-11-20 15:55 ` [PATCH 4/9] rc: sunxi-cir: Add support for an optional reset controller Hans de Goede
2014-11-20 16:28 ` Mauro Carvalho Chehab
[not found] ` <20141120142831.003fb63e-+RedX5hVuTR+urZeOPWqwQ@public.gmane.org>
2014-11-21 8:51 ` Maxime Ripard
[not found] ` <1416498928-1300-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-20 23:05 ` Julian Calaby
2014-11-20 15:55 ` [PATCH 5/9] rc: sunxi-cir: Add support for the larger fifo found on sun5i and sun6i Hans de Goede
2014-11-20 16:28 ` Mauro Carvalho Chehab
2014-11-21 8:26 ` Maxime Ripard
2014-11-21 8:42 ` Hans de Goede
[not found] ` <546EFAE1.9050506-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-21 9:59 ` Maxime Ripard
2014-11-21 10:13 ` Hans de Goede
[not found] ` <546F103D.6050004-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-23 15:47 ` Maxime Ripard
2014-11-20 15:55 ` [PATCH 6/9] ARM: dts: sun6i: Add ir_clk node Hans de Goede
2014-11-20 15:55 ` [PATCH 7/9] ARM: dts: sun6i: Add ir node Hans de Goede
2014-11-20 15:55 ` [PATCH 8/9] ARM: dts: sun6i: Add pinmux settings for the ir pins Hans de Goede
2014-11-20 15:55 ` [PATCH 9/9] ARM: dts: sun6i: Enable ir receiver on the Mele M9 Hans de Goede
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=54787A8A.6040209@redhat.com \
--to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=boris-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=emilio-0Z03zUJReD5OxF6Tv1QG9Q@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=wens-jdAy2FN1RRM@public.gmane.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).