Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…/git/khilman/linux-amlogic into arm/dt

ARM: dts: Amlogic updates for v5.6
- add DDR clock controller
- GPU OPP updates

* tag 'amlogic-dt' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
  ARM: dts: meson8b: use the actual frequency for the GPU's 364MHz OPP
  ARM: dts: meson8: use the actual frequency for the GPU's 182.1MHz OPP
  ARM: dts: meson8b: fix the clock controller compatible string
  ARM: dts: meson8b: add the DDR clock controller
  ARM: dts: meson8: add the DDR clock controller
  ARM: dts: meson: provide the XTAL clock using a fixed-clock
  dt-bindings: clock: meson8b: add the clock inputs
  dt-bindings: clock: add the Amlogic Meson8 DDR clock controller binding

Link: https://lore.kernel.org/r/7hwo9udi7m.fsf@baylibre.com
Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Jan 16, 2020
2 parents 5a74e85 + c3dd331 commit a0be473
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/amlogic,meson8-ddr-clkc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic DDR Clock Controller Device Tree Bindings

maintainers:
- Martin Blumenstingl <martin.blumenstingl@googlemail.com>

properties:
compatible:
enum:
- amlogic,meson8-ddr-clkc
- amlogic,meson8b-ddr-clkc

reg:
maxItems: 1

clocks:
maxItems: 1

clock-names:
items:
- const: xtal

"#clock-cells":
const: 1

required:
- compatible
- reg
- clocks
- clock-names
- "#clock-cells"

additionalProperties: false

examples:
- |
ddr_clkc: clock-controller@400 {
compatible = "amlogic,meson8-ddr-clkc";
reg = <0x400 0x20>;
clocks = <&xtal>;
clock-names = "xtal";
#clock-cells = <1>;
};
...
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Required Properties:
- "amlogic,meson8m2-clkc" for Meson8m2 (S812) SoCs
- #clock-cells: should be 1.
- #reset-cells: should be 1.
- clocks: list of clock phandles, one for each entry in clock-names
- clock-names: should contain the following:
* "xtal": the 24MHz system oscillator
* "ddr_pll": the DDR PLL clock
* "clk_32k": (if present) the 32kHz clock signal from GPIOAO_6 (CLK_32K_IN)

Parent node should have the following properties :
- compatible: "amlogic,meson-hhi-sysctrl", "simple-mfd", "syscon"
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/meson.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,11 @@
};
};
};

xtal: xtal-clk {
compatible = "fixed-clock";
clock-frequency = <24000000>;
clock-output-names = "xtal";
#clock-cells = <0>;
};
}; /* end of / */
7 changes: 0 additions & 7 deletions arch/arm/boot/dts/meson6.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@
ranges = <0x0 0xd0000000 0x40000>;
};

xtal: xtal-clk {
compatible = "fixed-clock";
clock-frequency = <24000000>;
clock-output-names = "xtal";
#clock-cells = <0>;
};

clk81: clk@0 {
#clock-cells = <0>;
compatible = "fixed-clock";
Expand Down
28 changes: 19 additions & 9 deletions arch/arm/boot/dts/meson8.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright 2014 Carlo Caione <carlo@caione.org>
*/

#include <dt-bindings/clock/meson8-ddr-clkc.h>
#include <dt-bindings/clock/meson8b-clkc.h>
#include <dt-bindings/gpio/meson8-gpio.h>
#include <dt-bindings/reset/amlogic,meson8b-clkc-reset.h>
Expand Down Expand Up @@ -129,8 +130,8 @@
gpu_opp_table: gpu-opp-table {
compatible = "operating-points-v2";

opp-182150000 {
opp-hz = /bits/ 64 <182150000>;
opp-182142857 {
opp-hz = /bits/ 64 <182142857>;
opp-microvolt = <1150000>;
};
opp-318750000 {
Expand Down Expand Up @@ -195,6 +196,14 @@
#size-cells = <1>;
ranges = <0x0 0xc8000000 0x8000>;

ddr_clkc: clock-controller@400 {
compatible = "amlogic,meson8-ddr-clkc";
reg = <0x400 0x20>;
clocks = <&xtal>;
clock-names = "xtal";
#clock-cells = <1>;
};

dmcbus: bus@6000 {
compatible = "simple-bus";
reg = <0x6000 0x400>;
Expand Down Expand Up @@ -455,6 +464,8 @@
&hhi {
clkc: clock-controller {
compatible = "amlogic,meson8-clkc";
clocks = <&xtal>, <&ddr_clkc DDR_CLKID_DDR_PLL>;
clock-names = "xtal", "ddr_pll";
#clock-cells = <1>;
#reset-cells = <1>;
};
Expand Down Expand Up @@ -529,8 +540,7 @@

&saradc {
compatible = "amlogic,meson8-saradc", "amlogic,meson-saradc";
clocks = <&clkc CLKID_XTAL>,
<&clkc CLKID_SAR_ADC>;
clocks = <&xtal>, <&clkc CLKID_SAR_ADC>;
clock-names = "clkin", "core";
amlogic,hhi-sysctrl = <&hhi>;
nvmem-cells = <&temperature_calib>;
Expand All @@ -548,31 +558,31 @@
};

&timer_abcde {
clocks = <&clkc CLKID_XTAL>, <&clkc CLKID_CLK81>;
clocks = <&xtal>, <&clkc CLKID_CLK81>;
clock-names = "xtal", "pclk";
};

&uart_AO {
compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_CLK81>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_CLK81>;
clock-names = "baud", "xtal", "pclk";
};

&uart_A {
compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART0>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART0>;
clock-names = "baud", "xtal", "pclk";
};

&uart_B {
compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART1>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART1>;
clock-names = "baud", "xtal", "pclk";
};

&uart_C {
compatible = "amlogic,meson8-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART2>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART2>;
clock-names = "baud", "xtal", "pclk";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/meson8b-ec100.dts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
status = "okay";
pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>;
pinctrl-names = "default";
clocks = <&clkc CLKID_XTAL>, <&clkc CLKID_XTAL>;
clocks = <&xtal>, <&xtal>;
clock-names = "clkin0", "clkin1";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/meson8b-mxq.dts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
status = "okay";
pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>;
pinctrl-names = "default";
clocks = <&clkc CLKID_XTAL>, <&clkc CLKID_XTAL>;
clocks = <&xtal>, <&xtal>;
clock-names = "clkin0", "clkin1";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/meson8b-odroidc1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
status = "okay";
pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>;
pinctrl-names = "default";
clocks = <&clkc CLKID_XTAL>, <&clkc CLKID_XTAL>;
clocks = <&xtal>, <&xtal>;
clock-names = "clkin0", "clkin1";
};

Expand Down
30 changes: 20 additions & 10 deletions arch/arm/boot/dts/meson8b.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Author: Carlo Caione <carlo@endlessm.com>
*/

#include <dt-bindings/clock/meson8-ddr-clkc.h>
#include <dt-bindings/clock/meson8b-clkc.h>
#include <dt-bindings/gpio/meson8b-gpio.h>
#include <dt-bindings/reset/amlogic,meson8b-reset.h>
Expand Down Expand Up @@ -125,8 +126,8 @@
opp-hz = /bits/ 64 <255000000>;
opp-microvolt = <1100000>;
};
opp-364300000 {
opp-hz = /bits/ 64 <364300000>;
opp-364285714 {
opp-hz = /bits/ 64 <364285714>;
opp-microvolt = <1100000>;
};
opp-425000000 {
Expand Down Expand Up @@ -172,6 +173,14 @@
#size-cells = <1>;
ranges = <0x0 0xc8000000 0x8000>;

ddr_clkc: clock-controller@400 {
compatible = "amlogic,meson8b-ddr-clkc";
reg = <0x400 0x20>;
clocks = <&xtal>;
clock-names = "xtal";
#clock-cells = <1>;
};

dmcbus: bus@6000 {
compatible = "simple-bus";
reg = <0x6000 0x400>;
Expand Down Expand Up @@ -433,7 +442,9 @@

&hhi {
clkc: clock-controller {
compatible = "amlogic,meson8-clkc";
compatible = "amlogic,meson8b-clkc";
clocks = <&xtal>, <&ddr_clkc DDR_CLKID_DDR_PLL>;
clock-names = "xtal", "ddr_pll";
#clock-cells = <1>;
#reset-cells = <1>;
};
Expand Down Expand Up @@ -508,8 +519,7 @@

&saradc {
compatible = "amlogic,meson8b-saradc", "amlogic,meson-saradc";
clocks = <&clkc CLKID_XTAL>,
<&clkc CLKID_SAR_ADC>;
clocks = <&xtal>, <&clkc CLKID_SAR_ADC>;
clock-names = "clkin", "core";
amlogic,hhi-sysctrl = <&hhi>;
nvmem-cells = <&temperature_calib>;
Expand All @@ -523,31 +533,31 @@
};

&timer_abcde {
clocks = <&clkc CLKID_XTAL>, <&clkc CLKID_CLK81>;
clocks = <&xtal>, <&clkc CLKID_CLK81>;
clock-names = "xtal", "pclk";
};

&uart_AO {
compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_CLK81>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_CLK81>;
clock-names = "baud", "xtal", "pclk";
};

&uart_A {
compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART0>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART0>;
clock-names = "baud", "xtal", "pclk";
};

&uart_B {
compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART1>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART1>;
clock-names = "baud", "xtal", "pclk";
};

&uart_C {
compatible = "amlogic,meson8b-uart", "amlogic,meson-uart";
clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_XTAL>, <&clkc CLKID_UART2>;
clocks = <&clkc CLKID_CLK81>, <&xtal>, <&clkc CLKID_UART2>;
clock-names = "baud", "xtal", "pclk";
};

Expand Down
4 changes: 4 additions & 0 deletions include/dt-bindings/clock/meson8-ddr-clkc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 */

#define DDR_CLKID_DDR_PLL_DCO 0
#define DDR_CLKID_DDR_PLL 1

0 comments on commit a0be473

Please sign in to comment.