Skip to contentSkip to conversation

rockchip: rk3288: Include files from dts/upstream

PATCH Superseded Jonas Karlman 2 participants 6 messages Nov 9, 2024 – Jan 10, 2025

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover rockchip: rk3288: Include files from dts/upstream

This series remove common rk3288 related device tree files that instead can be included directly from dts/upstream.

No functional change to board DTs is intended with these removals.

Changes in v2:
- Keep code for use of gmac internal clock source
- Collect r-b tags

Jonas Karlman (4):
rockchip: rk3288: Use rk3288-power.h from dts/upstream
rockchip: clk: rk3288: Drop use of SCLK_MAC_PLL
rockchip: rk3288: Use rk3288-cru.h from dts/upstream
rockchip: rk3288: Use rk3288.dtsi from dts/upstream

 arch/arm/dts/rk3288-u-boot.dtsi               |    9 -
 arch/arm/dts/rk3288.dtsi                      | 2035 -----------------
 .../clock/rockchip,rk3288-cru.txt             |   61 -
 drivers/clk/rockchip/clk_rk3288.c             |    8 +-
 include/dt-bindings/clock/rk3288-cru.h        |  381 ---
 include/dt-bindings/power/rk3288-power.h      |   32 -
 6 files changed, 4 insertions(+), 2522 deletions(-)
 delete mode 100644 arch/arm/dts/rk3288.dtsi
 delete mode 100644 doc/device-tree-bindings/clock/rockchip,rk3288-cru.txt
 delete mode 100644 include/dt-bindings/clock/rk3288-cru.h
 delete mode 100644 include/dt-bindings/power/rk3288-power.h
Signature · 1 line
2.46.2
#1 lore raw

PATCH v2 1/4 rockchip: rk3288: Use rk3288-power.h from dts/upstream

power/rk3288-power.h in include/dt-bindings is identical to the version in dts/upstream, remove the copy from include/dt-bindings to only use the version from dts/upstream.

No functional change to board DTs is intended with this removal.

---
v2: Collect r-b tag

---
 include/dt-bindings/power/rk3288-power.h | 32 ------------------------
 1 file changed, 32 deletions(-)
 delete mode 100644 include/dt-bindings/power/rk3288-power.h
include/dt-bindings/power/rk3288-power.h deleted +0 -32
deleted file mode 100644
index f710b56ccd81..000000000000
@@ -1,32 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __DT_BINDINGS_POWER_RK3288_POWER_H__
-#define __DT_BINDINGS_POWER_RK3288_POWER_H__
-
-/**
- * RK3288 Power Domain and Voltage Domain Summary.
- */
-
-/* VD_CORE */
-#define RK3288_PD_A17_0		0
-#define RK3288_PD_A17_1		1
-#define RK3288_PD_A17_2		2
-#define RK3288_PD_A17_3		3
-#define RK3288_PD_SCU		4
-#define RK3288_PD_DEBUG		5
-#define RK3288_PD_MEM		6
-
-/* VD_LOGIC */
-#define RK3288_PD_BUS		7
-#define RK3288_PD_PERI		8
-#define RK3288_PD_VIO		9
-#define RK3288_PD_ALIVE		10
-#define RK3288_PD_HEVC		11
-#define RK3288_PD_VIDEO		12
-
-/* VD_GPU */
-#define RK3288_PD_GPU		13
-
-/* VD_PMU */
-#define RK3288_PD_PMU		14
-
-#endif
Signature · 1 line
2.46.2
#2 lore raw

PATCH v2 2/4 rockchip: clk: rk3288: Drop use of SCLK_MAC_PLL

In reply to Jonas Karlman

The SCLK_MAC_PLL id is not exported or referenced upstream. It is also not referenced in vendor U-Boot or vendor kernel 4.4, 4.19, 5.10 or 6.1.

Relax the check for parent id SCLK_MAC_PLL when using internal clock source for gmac to allow use of clock/rk3288-cru.h from dts/upstream.

All in-tree and upstream rk3288 DTs use an external clock as parent, so no functional change to boards is expected with this change.

---
v2: New patch to keep code for use of gmac internal clock source

---
 drivers/clk/rockchip/clk_rk3288.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/rockchip/clk_rk3288.c +4 -4
index 43c44fadbe7a..a4ff1c41abb8 100644
@@ -903,11 +903,11 @@ static int __maybe_unused rk3288_gmac_set_parent(struct clk *clk, struct clk *pa
 	int ret;
 
 	/*
-	 * If the requested parent is in the same clock-controller and
-	 * the id is SCLK_MAC_PLL ("mac_pll_src"), switch to the internal
-	 * clock.
+	 * If the requested parent is in the same clock-controller the
+	 * likely parent is the unexported SCLK_MAC_PLL ("mac_pll_src"),
+	 * switch to the internal clock.
 	 */
-	if ((parent->dev == clk->dev) && (parent->id == SCLK_MAC_PLL)) {
+	if (parent->dev == clk->dev) {
 		debug("%s: switching GAMC to SCLK_MAC_PLL\n", __func__);
 		rk_clrsetreg(&cru->cru_clksel_con[21], RMII_EXTCLK_MASK, 0);
 		return 0;
Signature · 1 line
2.46.2
Reviewed-by on v2 2/4
#3 lore raw

Re: [PATCH v2 2/4] rockchip: clk: rk3288: Drop use of SCLK_MAC_PLL

Quoted 10 lines · Jonas Karlman

The SCLK_MAC_PLL id is not exported or referenced upstream. It is also not referenced in vendor U-Boot or vendor kernel 4.4, 4.19, 5.10 or 6.1.

Relax the check for parent id SCLK_MAC_PLL when using internal clock source for gmac to allow use of clock/rk3288-cru.h from dts/upstream.

All in-tree and upstream rk3288 DTs use an external clock as parent, so no functional change to boards is expected with this change.

Thanks,
- Kever

Quoted 26 lines

---
v2: New patch to keep code for use of gmac internal clock source

---
  drivers/clk/rockchip/clk_rk3288.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/rockchip/clk_rk3288.c +4 -4
index 43c44fadbe7a..a4ff1c41abb8 100644
@@ -903,11 +903,11 @@ static int __maybe_unused rk3288_gmac_set_parent(struct clk *clk, struct clk *pa
  	int ret;
 
  	/*
-	 * If the requested parent is in the same clock-controller and
-	 * the id is SCLK_MAC_PLL ("mac_pll_src"), switch to the internal
-	 * clock.
+	 * If the requested parent is in the same clock-controller the
+	 * likely parent is the unexported SCLK_MAC_PLL ("mac_pll_src"),
+	 * switch to the internal clock.
  	 */
-	if ((parent->dev == clk->dev) && (parent->id == SCLK_MAC_PLL)) {
+	if (parent->dev == clk->dev) {
  		debug("%s: switching GAMC to SCLK_MAC_PLL\n", __func__);
  		rk_clrsetreg(&cru->cru_clksel_con[21], RMII_EXTCLK_MASK, 0);
  		return 0;
#4 lore raw

PATCH v2 3/4 rockchip: rk3288: Use rk3288-cru.h from dts/upstream

In reply to Jonas Karlman

clock/rk3288-cru.h in include/dt-bindings is almost identical to the version in dts/upstream, remove the copy from include/dt-bindings to only use the version from dts/upstream.

One clk, SCLK_MAC_PLL, is not part of the upstream bindings, this clk is not used by upstream, in-tree or vendor DTs and can safely be dropped.

No functional change to board DTs is intended with this removal.

---
v2: Collect r-b tag

---
 .../clock/rockchip,rk3288-cru.txt             |  61 ---
 include/dt-bindings/clock/rk3288-cru.h        | 381 ------------------
 2 files changed, 442 deletions(-)
 delete mode 100644 doc/device-tree-bindings/clock/rockchip,rk3288-cru.txt
 delete mode 100644 include/dt-bindings/clock/rk3288-cru.h
doc/device-tree-bindings/clock/rockchip,rk3288-cru.txt deleted +0 -61
deleted file mode 100644
index c9fbb76573e1..000000000000
@@ -1,61 +0,0 @@
-* Rockchip RK3288 Clock and Reset Unit
-
-The RK3288 clock controller generates and supplies clock to various
-controllers within the SoC and also implements a reset controller for SoC
-peripherals.
-
-Required Properties:
-
-- compatible: should be "rockchip,rk3288-cru"
-- reg: physical base address of the controller and length of memory mapped
-  region.
-- #clock-cells: should be 1.
-- #reset-cells: should be 1.
-
-Optional Properties:
-
-- rockchip,grf: phandle to the syscon managing the "general register files"
-  If missing pll rates are not changable, due to the missing pll lock status.
-
-Each clock is assigned an identifier and client nodes can use this identifier
-to specify the clock which they consume. All available clocks are defined as
-preprocessor macros in the dt-bindings/clock/rk3288-cru.h headers and can be
-used in device tree sources. Similar macros exist for the reset sources in
-these files.
-
-External clocks:
-
-There are several clocks that are generated outside the SoC. It is expected
-that they are defined using standard clock bindings with following
-clock-output-names:
- - "xin24m" - crystal input - required,
- - "xin32k" - rtc clock - optional,
- - "ext_i2s" - external I2S clock - optional,
- - "ext_hsadc" - external HSADC clock - optional,
- - "ext_edp_24m" - external display port clock - optional,
- - "ext_vip" - external VIP clock - optional,
- - "ext_isp" - external ISP clock - optional,
- - "ext_jtag" - external JTAG clock - optional
-
-Example: Clock controller node:
-
-	cru: cru@20000000 {
-		compatible = "rockchip,rk3188-cru";
-		reg = <0x20000000 0x1000>;
-		rockchip,grf = <&grf>;
-
-		#clock-cells = <1>;
-		#reset-cells = <1>;
-	};
-
-Example: UART controller node that consumes the clock generated by the clock
-  controller:
-
-	uart0: serial@10124000 {
-		compatible = "snps,dw-apb-uart";
-		reg = <0x10124000 0x400>;
-		interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
-		reg-shift = <2>;
-		reg-io-width = <1>;
-		clocks = <&cru SCLK_UART0>;
-	};
include/dt-bindings/clock/rk3288-cru.h deleted +0 -381

381 lines not on this page · raw message

Signature · 1 line
2.46.2
#5 lore raw

PATCH v2 4/4 rockchip: rk3288: Use rk3288.dtsi from dts/upstream

In reply to Jonas Karlman

rk3288.dtsi from arch/arm/dts is almost identical to the rk3288.dtsi from dts/upstream, it differs only with a minor change in hdmi port nodes, something that does not affect U-Boot.

Remove arch/arm/dts/rk3288.dtsi to use rk3288.dtsi from dts/upstream. Also drop gpio aliases from -u-boot.dtsi that has been part of rk3288.dtsi for some time.

No functional change to board DTs is intended with this removal.

---
v2: Collect r-b tag

---
 arch/arm/dts/rk3288-u-boot.dtsi |    9 -
 arch/arm/dts/rk3288.dtsi        | 2035 -------------------------------
 2 files changed, 2044 deletions(-)
 delete mode 100644 arch/arm/dts/rk3288.dtsi
arch/arm/dts/rk3288-u-boot.dtsi +0 -9
index c51bfca65604..2205caabc51e 100644
@@ -7,15 +7,6 @@
 
 / {
 	aliases {
-		gpio0 = &gpio0;
-		gpio1 = &gpio1;
-		gpio2 = &gpio2;
-		gpio3 = &gpio3;
-		gpio4 = &gpio4;
-		gpio5 = &gpio5;
-		gpio6 = &gpio6;
-		gpio7 = &gpio7;
-		gpio8 = &gpio8;
 		mmc0 = &emmc;
 		mmc1 = &sdmmc;
 		mmc2 = &sdio0;
arch/arm/dts/rk3288.dtsi deleted +0 -2035

2,035 lines not on this page · raw message

Signature · 1 line
2.46.2