Re: [PATCH 05/20] ARM: dts: aspeed: Add proper clock references
On Mon, Dec 11, 2017 at 6:39 PM, Arnd Bergmannwrote: > On Mon, Dec 11, 2017 at 6:06 AM, Joel Stanley wrote: >> The existing device trees use fixed-clocks in order to boot without a >> clk driver. The newly added clk driver provides proper clock support, >> including gating, so we move the device trees over to properly request >> clocks. >> >> Signed-off-by: Joel Stanley > > Can you clarify here whether this will break running old kernels with > new DT files or vice versa, and why this is ok here? This device tree will break kernels that do not have the clk patches applied (no clocksource, as we don't know the speed of the APB clock. You can boot if you pass a lpj value on the command line, but won't have a uart). Older device trees running with the newer kernel will function as well as pre-4.16 kernels. That is, that some IP blocks (i2c, pwm/tach, adc) will not work as the kernel lacks reset controller and clock enabling. > I assume you have thought about it carefully, but I'd still like to document > every time we intentionally break compatibility like this. It looks like > you too care to merge the driver changes and the DT binding change first, > so we don't get any bisection problems. Thanks for calling it out. I will modify the commit message to say that this device tree change depends on the newer driver, and it will not boot with kernels that lack the driver. > > What I'm not completely clear about is the difference between the > "aspeed,g4-scu" binding and the "aspeed,ast2400-scu" binding. > They are listed as equal in > Documentation/devicetree/bindings/mfd/aspeed-scu.txt, so why do you > change it here? The g4-scu string made it into the tree before we had decided that we would settle on aspeed,astX000- as the format for the strings. We list both in the docs, but I would like to deprecate the old one. If I was doing this again, I would make sure we had the clock driver upstream before completing the other driver. It's caused a lot of pain. Thanks for your help getting us there. Cheers, Joel
Re: [PATCH 05/20] ARM: dts: aspeed: Add proper clock references
On Mon, Dec 11, 2017 at 6:39 PM, Arnd Bergmann wrote: > On Mon, Dec 11, 2017 at 6:06 AM, Joel Stanley wrote: >> The existing device trees use fixed-clocks in order to boot without a >> clk driver. The newly added clk driver provides proper clock support, >> including gating, so we move the device trees over to properly request >> clocks. >> >> Signed-off-by: Joel Stanley > > Can you clarify here whether this will break running old kernels with > new DT files or vice versa, and why this is ok here? This device tree will break kernels that do not have the clk patches applied (no clocksource, as we don't know the speed of the APB clock. You can boot if you pass a lpj value on the command line, but won't have a uart). Older device trees running with the newer kernel will function as well as pre-4.16 kernels. That is, that some IP blocks (i2c, pwm/tach, adc) will not work as the kernel lacks reset controller and clock enabling. > I assume you have thought about it carefully, but I'd still like to document > every time we intentionally break compatibility like this. It looks like > you too care to merge the driver changes and the DT binding change first, > so we don't get any bisection problems. Thanks for calling it out. I will modify the commit message to say that this device tree change depends on the newer driver, and it will not boot with kernels that lack the driver. > > What I'm not completely clear about is the difference between the > "aspeed,g4-scu" binding and the "aspeed,ast2400-scu" binding. > They are listed as equal in > Documentation/devicetree/bindings/mfd/aspeed-scu.txt, so why do you > change it here? The g4-scu string made it into the tree before we had decided that we would settle on aspeed,astX000- as the format for the strings. We list both in the docs, but I would like to deprecate the old one. If I was doing this again, I would make sure we had the clock driver upstream before completing the other driver. It's caused a lot of pain. Thanks for your help getting us there. Cheers, Joel
Re: [PATCH 05/20] ARM: dts: aspeed: Add proper clock references
On Mon, Dec 11, 2017 at 6:06 AM, Joel Stanleywrote: > The existing device trees use fixed-clocks in order to boot without a > clk driver. The newly added clk driver provides proper clock support, > including gating, so we move the device trees over to properly request > clocks. > > Signed-off-by: Joel Stanley Can you clarify here whether this will break running old kernels with new DT files or vice versa, and why this is ok here? I assume you have thought about it carefully, but I'd still like to document every time we intentionally break compatibility like this. It looks like you too care to merge the driver changes and the DT binding change first, so we don't get any bisection problems. What I'm not completely clear about is the difference between the "aspeed,g4-scu" binding and the "aspeed,ast2400-scu" binding. They are listed as equal in Documentation/devicetree/bindings/mfd/aspeed-scu.txt, so why do you change it here? Arnd
Re: [PATCH 05/20] ARM: dts: aspeed: Add proper clock references
On Mon, Dec 11, 2017 at 6:06 AM, Joel Stanley wrote: > The existing device trees use fixed-clocks in order to boot without a > clk driver. The newly added clk driver provides proper clock support, > including gating, so we move the device trees over to properly request > clocks. > > Signed-off-by: Joel Stanley Can you clarify here whether this will break running old kernels with new DT files or vice versa, and why this is ok here? I assume you have thought about it carefully, but I'd still like to document every time we intentionally break compatibility like this. It looks like you too care to merge the driver changes and the DT binding change first, so we don't get any bisection problems. What I'm not completely clear about is the difference between the "aspeed,g4-scu" binding and the "aspeed,ast2400-scu" binding. They are listed as equal in Documentation/devicetree/bindings/mfd/aspeed-scu.txt, so why do you change it here? Arnd
[PATCH 05/20] ARM: dts: aspeed: Add proper clock references
The existing device trees use fixed-clocks in order to boot without a clk driver. The newly added clk driver provides proper clock support, including gating, so we move the device trees over to properly request clocks. Signed-off-by: Joel Stanley--- arch/arm/boot/dts/aspeed-g4.dtsi | 100 +++-- arch/arm/boot/dts/aspeed-g5.dtsi | 104 +++ 2 files changed, 81 insertions(+), 123 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi index b6d01523555a..c87883a7f250 100644 --- a/arch/arm/boot/dts/aspeed-g4.dtsi +++ b/arch/arm/boot/dts/aspeed-g4.dtsi @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "skeleton.dtsi" +#include #include / { @@ -107,47 +108,12 @@ ranges; syscon: syscon@1e6e2000 { - compatible = "aspeed,g4-scu", "syscon", "simple-mfd"; + compatible = "aspeed,ast2400-scu", "syscon", "simple-mfd"; reg = <0x1e6e2000 0x1a8>; #address-cells = <1>; #size-cells = <0>; - -clk_clkin: clk_clkin { -#clock-cells = <0>; -compatible = "fixed-clock"; -clock-frequency = <4800>; -}; - -clk_hpll: clk_hpll@70 { -#clock-cells = <0>; -compatible = "aspeed,g4-hpll-clock", "fixed-clock"; -reg = <0x70>; -clocks = <_clkin>; -clock-frequency = <38400>; -}; - -clk_ahb: clk_ahb@70 { -#clock-cells = <0>; -compatible = "aspeed,g4-ahb-clock", "fixed-clock"; -reg = <0x70>; -clocks = <_hpll>; -clock-frequency = <19200>; -}; - -clk_apb: clk_apb@8 { -#clock-cells = <0>; -compatible = "aspeed,g4-apb-clock", "fixed-clock"; -reg = <0x08>; -clocks = <_hpll>; -clock-frequency = <4800>; -}; - -clk_uart: clk_uart@2c{ -#clock-cells = <0>; -compatible = "aspeed,g4-uart-clock", "fixed-clock"; -reg = <0x2c>; -clock-frequency = <2400>; -}; + #clock-cells = <1>; + #reset-cells = <1>; pinctrl: pinctrl { compatible = "aspeed,g4-pinctrl"; @@ -157,7 +123,7 @@ adc: adc@1e6e9000 { compatible = "aspeed,ast2400-adc"; reg = <0x1e6e9000 0xb0>; - clocks = <_apb>; + clocks = < ASPEED_CLK_APB>; #io-channel-cells = <1>; status = "disabled"; }; @@ -182,7 +148,7 @@ compatible = "aspeed,ast2400-timer"; reg = <0x1e782000 0x90>; interrupts = <16 17 18 35 36 37 38 39>; - clocks = <_apb>; + clocks = < ASPEED_CLK_APB>; clock-names = "PCLK"; }; @@ -191,7 +157,7 @@ reg = <0x1e783000 0x20>; reg-shift = <2>; interrupts = <9>; - clocks = <_uart>; + clocks = < ASPEED_CLK_GATE_UART1CLK>; no-loopback-test; status = "disabled"; }; @@ -201,7 +167,7 @@ reg = <0x1e784000 0x20>; reg-shift = <2>; interrupts = <10>; - clocks = <_uart>; + clocks = <
[PATCH 05/20] ARM: dts: aspeed: Add proper clock references
The existing device trees use fixed-clocks in order to boot without a clk driver. The newly added clk driver provides proper clock support, including gating, so we move the device trees over to properly request clocks. Signed-off-by: Joel Stanley --- arch/arm/boot/dts/aspeed-g4.dtsi | 100 +++-- arch/arm/boot/dts/aspeed-g5.dtsi | 104 +++ 2 files changed, 81 insertions(+), 123 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi index b6d01523555a..c87883a7f250 100644 --- a/arch/arm/boot/dts/aspeed-g4.dtsi +++ b/arch/arm/boot/dts/aspeed-g4.dtsi @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "skeleton.dtsi" +#include #include / { @@ -107,47 +108,12 @@ ranges; syscon: syscon@1e6e2000 { - compatible = "aspeed,g4-scu", "syscon", "simple-mfd"; + compatible = "aspeed,ast2400-scu", "syscon", "simple-mfd"; reg = <0x1e6e2000 0x1a8>; #address-cells = <1>; #size-cells = <0>; - -clk_clkin: clk_clkin { -#clock-cells = <0>; -compatible = "fixed-clock"; -clock-frequency = <4800>; -}; - -clk_hpll: clk_hpll@70 { -#clock-cells = <0>; -compatible = "aspeed,g4-hpll-clock", "fixed-clock"; -reg = <0x70>; -clocks = <_clkin>; -clock-frequency = <38400>; -}; - -clk_ahb: clk_ahb@70 { -#clock-cells = <0>; -compatible = "aspeed,g4-ahb-clock", "fixed-clock"; -reg = <0x70>; -clocks = <_hpll>; -clock-frequency = <19200>; -}; - -clk_apb: clk_apb@8 { -#clock-cells = <0>; -compatible = "aspeed,g4-apb-clock", "fixed-clock"; -reg = <0x08>; -clocks = <_hpll>; -clock-frequency = <4800>; -}; - -clk_uart: clk_uart@2c{ -#clock-cells = <0>; -compatible = "aspeed,g4-uart-clock", "fixed-clock"; -reg = <0x2c>; -clock-frequency = <2400>; -}; + #clock-cells = <1>; + #reset-cells = <1>; pinctrl: pinctrl { compatible = "aspeed,g4-pinctrl"; @@ -157,7 +123,7 @@ adc: adc@1e6e9000 { compatible = "aspeed,ast2400-adc"; reg = <0x1e6e9000 0xb0>; - clocks = <_apb>; + clocks = < ASPEED_CLK_APB>; #io-channel-cells = <1>; status = "disabled"; }; @@ -182,7 +148,7 @@ compatible = "aspeed,ast2400-timer"; reg = <0x1e782000 0x90>; interrupts = <16 17 18 35 36 37 38 39>; - clocks = <_apb>; + clocks = < ASPEED_CLK_APB>; clock-names = "PCLK"; }; @@ -191,7 +157,7 @@ reg = <0x1e783000 0x20>; reg-shift = <2>; interrupts = <9>; - clocks = <_uart>; + clocks = < ASPEED_CLK_GATE_UART1CLK>; no-loopback-test; status = "disabled"; }; @@ -201,7 +167,7 @@ reg = <0x1e784000 0x20>; reg-shift = <2>; interrupts = <10>; - clocks = <_uart>; + clocks = < ASPEED_CLK_GATE_UART5CLK>;