devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Add imem clock for Exynos 5433
       [not found] <CGME20181204165315eucas1p1693a3d349f39c272297e5d1902c905ca@eucas1p1.samsung.com>
@ 2018-12-04 16:52 ` Kamil Konieczny
       [not found]   ` <CGME20181204165316eucas1p2da523b358ed62eca270fe24c5e2b063c@eucas1p2.samsung.com>
                     ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Kamil Konieczny @ 2018-12-04 16:52 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: linux-clk, Chanwoo Choi, devicetree, Krzysztof Kozlowski,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

Add imem clock for Exynos 5433. This will allow to use SSS and SlimSSS
(Security SubSystem) with crypto functions.

Changes since v2:
- added Reviewed-by to two first patches
- fixed subject for 3rd patch and commit message
- in patch 3 moved documentation of imem to end of clocks after CMU_CAM1
- in patch 4 moved cmu_imem declarations after cmu_cam1
- in patch 5 added newlines after clock registers, moved code after cmu_cam1,
  removed CLK_OF_DECLARE and exynos5433_cmu_imem_init, moved cmu_imem
  compatible to the end of exynos5433_cmu_of_match

Changes since v1:
- splitted typo patch into two, one of them for stable, suggested by Krzystof
  Kozlowski
- added more registers as suggested by Chanwoo Choi

Kamil Konieczny (5):
  clk: samsung: exynos5433: fix typo in imem divider
  clk: samsung: exynos5433: fix name typo in sssx
  dt-bindings: clk: exynos5433: document imem clock
  arm64: dts: exynos: add imem clock
  clk: samsung: exynos5433: add imem clocks

 .../bindings/clock/exynos5433-clock.txt       |  23 ++
 arch/arm64/boot/dts/exynos/exynos5433.dtsi    |  15 ++
 drivers/clk/samsung/clk-exynos5433.c          | 199 +++++++++++++++++-
 include/dt-bindings/clock/exynos5433.h        |  57 ++++-
 4 files changed, 290 insertions(+), 4 deletions(-)

-- 
2.19.1

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

* [PATCH v3 1/5] clk: samsung: exynos5433: fix typo in imem divider
       [not found]   ` <CGME20181204165316eucas1p2da523b358ed62eca270fe24c5e2b063c@eucas1p2.samsung.com>
@ 2018-12-04 16:52     ` Kamil Konieczny
  0 siblings, 0 replies; 17+ messages in thread
From: Kamil Konieczny @ 2018-12-04 16:52 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: linux-clk, Chanwoo Choi, devicetree, Krzysztof Kozlowski,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski, stable

Fix typo in imem clock divider 200 switched with 266.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
---
 drivers/clk/samsung/clk-exynos5433.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c
index 751e2c4fb65b..ea47f49abc7f 100644
--- a/drivers/clk/samsung/clk-exynos5433.c
+++ b/drivers/clk/samsung/clk-exynos5433.c
@@ -568,10 +568,10 @@ static const struct samsung_gate_clock top_gate_clks[] __initconst = {
 	GATE(CLK_ACLK_BUS1_400, "aclk_bus1_400", "div_aclk_bus1_400",
 			ENABLE_ACLK_TOP, 25,
 			CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
-	GATE(CLK_ACLK_IMEM_200, "aclk_imem_200", "div_aclk_imem_266",
+	GATE(CLK_ACLK_IMEM_200, "aclk_imem_200", "div_aclk_imem_200",
 			ENABLE_ACLK_TOP, 24,
 			CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
-	GATE(CLK_ACLK_IMEM_266, "aclk_imem_266", "div_aclk_imem_200",
+	GATE(CLK_ACLK_IMEM_266, "aclk_imem_266", "div_aclk_imem_266",
 			ENABLE_ACLK_TOP, 23,
 			CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_ACLK_PERIC_66, "aclk_peric_66", "div_aclk_peric_66_b",
-- 
2.19.1

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

* [PATCH v3 2/5] clk: samsung: exynos5433: fix name typo in sssx
       [not found]   ` <CGME20181204165316eucas1p2ba063b96e83d2d2be93ca067d32d7926@eucas1p2.samsung.com>
@ 2018-12-04 16:52     ` Kamil Konieczny
  2018-12-10 22:29       ` Rob Herring
  0 siblings, 1 reply; 17+ messages in thread
From: Kamil Konieczny @ 2018-12-04 16:52 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: linux-clk, Chanwoo Choi, devicetree, Krzysztof Kozlowski,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

Fix typo in sssx name, there should be three letters 's'.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
---
 drivers/clk/samsung/clk-exynos5433.c   | 2 +-
 include/dt-bindings/clock/exynos5433.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c
index ea47f49abc7f..24c3360db65b 100644
--- a/drivers/clk/samsung/clk-exynos5433.c
+++ b/drivers/clk/samsung/clk-exynos5433.c
@@ -559,7 +559,7 @@ static const struct samsung_gate_clock top_gate_clks[] __initconst = {
 	/* ENABLE_ACLK_TOP */
 	GATE(CLK_ACLK_G3D_400, "aclk_g3d_400", "div_aclk_g3d_400",
 			ENABLE_ACLK_TOP, 30, CLK_IS_CRITICAL, 0),
-	GATE(CLK_ACLK_IMEM_SSX_266, "aclk_imem_ssx_266",
+	GATE(CLK_ACLK_IMEM_SSSX_266, "aclk_imem_sssx_266",
 			"div_aclk_imem_sssx_266", ENABLE_ACLK_TOP,
 			29, CLK_IGNORE_UNUSED, 0),
 	GATE(CLK_ACLK_BUS0_400, "aclk_bus0_400", "div_aclk_bus0_400",
diff --git a/include/dt-bindings/clock/exynos5433.h b/include/dt-bindings/clock/exynos5433.h
index 98bd85ce1e45..87bb2b017143 100644
--- a/include/dt-bindings/clock/exynos5433.h
+++ b/include/dt-bindings/clock/exynos5433.h
@@ -156,7 +156,7 @@
 #define CLK_ACLK_G2D_266		220
 #define CLK_ACLK_G2D_400		221
 #define CLK_ACLK_G3D_400		222
-#define CLK_ACLK_IMEM_SSX_266		223
+#define CLK_ACLK_IMEM_SSSX_266		223
 #define CLK_ACLK_BUS0_400		224
 #define CLK_ACLK_BUS1_400		225
 #define CLK_ACLK_IMEM_200		226
-- 
2.19.1

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

* [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock
       [not found]   ` <CGME20181204165317eucas1p10bef0207ee57a9420911410ed2a22453@eucas1p1.samsung.com>
@ 2018-12-04 16:52     ` Kamil Konieczny
  2018-12-04 18:41       ` Stephen Boyd
                         ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Kamil Konieczny @ 2018-12-04 16:52 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: linux-clk, Chanwoo Choi, devicetree, Krzysztof Kozlowski,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

Document DT bindings for imem clock of the Samsung Exynos5433 SSS (Security
SubSystem) and SlimSSS IPs.

Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
---
 .../bindings/clock/exynos5433-clock.txt       | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/exynos5433-clock.txt b/Documentation/devicetree/bindings/clock/exynos5433-clock.txt
index 50d5897c9849..183c327a7d6b 100644
--- a/Documentation/devicetree/bindings/clock/exynos5433-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5433-clock.txt
@@ -50,6 +50,8 @@ Required Properties:
     IPs.
   - "samsung,exynos5433-cmu-cam1" - clock controller compatible for CMU_CAM1
     which generates clocks for Cortex-A5/MIPI_CSIS2/FIMC-LITE_C/FIMC-FD IPs.
+  - "samsung,exynos5433-cmu-imem"   - clock controller compatible for CMU_IMEM
+    which generates clocks for SSS (Security SubSystem) and SlimSSS IPs.
 
 - reg: physical base address of the controller and length of memory mapped
   region.
@@ -168,6 +170,12 @@ Required Properties:
 		- aclk_cam1_400
 		- aclk_cam1_552
 
+	Input clocks for imem clock controller:
+		- oscclk
+		- aclk_imem_sssx_266
+		- aclk_imem_266
+		- aclk_imem_200
+
 Optional properties:
   - power-domains: a phandle to respective power domain node as described by
 	generic PM domain bindings (see power/power_domain.txt for more
@@ -469,6 +477,21 @@ Example 2: Examples of clock controller nodes are listed below.
 		power-domains = <&pd_cam1>;
 	};
 
+	cmu_imem: clock-controller@11060000 {
+		compatible = "samsung,exynos5433-cmu-imem";
+		reg = <0x11060000 0x1000>;
+		#clock-cells = <1>;
+
+		clock-names = "oscclk",
+			"aclk_imem_sssx_266",
+			"aclk_imem_266",
+			"aclk_imem_200";
+		clocks = <&xxti>,
+			<&cmu_top CLK_DIV_ACLK_IMEM_SSSX_266>,
+			<&cmu_top CLK_DIV_ACLK_IMEM_266>,
+			<&cmu_top CLK_DIV_ACLK_IMEM_200>;
+	};
+
 Example 3: UART controller node that consumes the clock generated by the clock
 	   controller.
 
-- 
2.19.1

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

* [PATCH v3 4/5] arm64: dts: exynos: add imem clock
       [not found]   ` <CGME20181204165317eucas1p18cd6168fdefb2aa57259b9ec73438275@eucas1p1.samsung.com>
@ 2018-12-04 16:52     ` Kamil Konieczny
  2018-12-13 21:10       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 17+ messages in thread
From: Kamil Konieczny @ 2018-12-04 16:52 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: linux-clk, Chanwoo Choi, devicetree, Krzysztof Kozlowski,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

Add description for imem clock in the Samsung Exynos5433. The users can use
compatibility "samsung,exynos5433-cmu-imem".

Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
---
 arch/arm64/boot/dts/exynos/exynos5433.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 2131f12364cb..378cd3d87ff0 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -544,6 +544,21 @@
 			power-domains = <&pd_cam1>;
 		};
 
+		cmu_imem: clock-controller@11060000 {
+			compatible = "samsung,exynos5433-cmu-imem";
+			reg = <0x11060000 0x1000>;
+			#clock-cells = <1>;
+
+			clock-names = "oscclk",
+				"aclk_imem_sssx_266",
+				"aclk_imem_266",
+				"aclk_imem_200";
+			clocks = <&xxti>,
+				<&cmu_top CLK_DIV_ACLK_IMEM_SSSX_266>,
+				<&cmu_top CLK_DIV_ACLK_IMEM_266>,
+				<&cmu_top CLK_DIV_ACLK_IMEM_200>;
+		};
+
 		pd_gscl: power-domain@105c4000 {
 			compatible = "samsung,exynos5433-pd";
 			reg = <0x105c4000 0x20>;
-- 
2.19.1

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

* [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks
       [not found]   ` <CGME20181204165318eucas1p2dccd5382ee8b9f4da8c3076fb56607ee@eucas1p2.samsung.com>
@ 2018-12-04 16:52     ` Kamil Konieczny
  2018-12-04 18:40       ` Stephen Boyd
  2018-12-10 22:33       ` Rob Herring
  0 siblings, 2 replies; 17+ messages in thread
From: Kamil Konieczny @ 2018-12-04 16:52 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: Chanwoo Choi, Rob Herring, Mark Rutland, Kukjin Kim,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-kernel

Add imem clocks for exynos5433. This will enable to use crypto Security
SubSystem (in short SSS) and SlimSSS IP blocks.

Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
---
 drivers/clk/samsung/clk-exynos5433.c   | 193 +++++++++++++++++++++++++
 include/dt-bindings/clock/exynos5433.h |  55 +++++++
 2 files changed, 248 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c
index 24c3360db65b..7f557d6f41f0 100644
--- a/drivers/clk/samsung/clk-exynos5433.c
+++ b/drivers/clk/samsung/clk-exynos5433.c
@@ -5467,6 +5467,196 @@ static const struct samsung_cmu_info cam1_cmu_info __initconst = {
 	.clk_name		= "aclk_cam1_400",
 };
 
+/*
+ * Register offset definitions for CMU_IMEM
+ */
+#define ENABLE_ACLK_IMEM			0x0800
+#define ENABLE_ACLK_IMEM_INT_MEM		0x0804
+#define ENABLE_ACLK_IMEM_SSS			0x0808
+#define ENABLE_ACLK_IMEM_SLIMSSS		0x080c
+#define ENABLE_ACLK_IMEM_RTIC			0x0810
+#define ENABLE_ACLK_IMEM_SMMU_SSS		0x0814
+#define ENABLE_ACLK_IMEM_SMMU_SLIMSSS		0x0818
+#define ENABLE_ACLK_IMEM_SMMU_RTIC		0x081c
+#define ENABLE_ACLK_IMEM_ARBG_TX		0x0820
+#define ENABLE_ACLK_IMEM_SMMU_ARBG_TX		0x0824
+#define ENABLE_PCLK_IMEM			0x0900
+#define ENABLE_PCLK_IMEM_SSS			0x0904
+#define ENABLE_PCLK_IMEM_SLIMSSS		0x0908
+#define ENABLE_PCLK_IMEM_RTIC			0x090c
+#define ENABLE_PCLK_IMEM_SMMU_SSS		0x0910
+#define ENABLE_PCLK_IMEM_SMMU_SLIMSSS		0x0914
+#define ENABLE_PCLK_IMEM_SMMU_RTIC		0x0918
+#define ENABLE_PCLK_IMEM_SMMU_ARGB_TX		0x091c
+
+static const unsigned long imem_clk_regs[] __initconst = {
+	ENABLE_ACLK_IMEM,
+	ENABLE_ACLK_IMEM_INT_MEM,
+	ENABLE_ACLK_IMEM_SSS,
+	ENABLE_ACLK_IMEM_SLIMSSS,
+	ENABLE_ACLK_IMEM_RTIC,
+	ENABLE_ACLK_IMEM_SMMU_SSS,
+	ENABLE_ACLK_IMEM_SMMU_SLIMSSS,
+	ENABLE_ACLK_IMEM_SMMU_RTIC,
+	ENABLE_ACLK_IMEM_ARBG_TX,
+	ENABLE_ACLK_IMEM_SMMU_ARBG_TX,
+	ENABLE_PCLK_IMEM,
+	ENABLE_PCLK_IMEM_SSS,
+	ENABLE_PCLK_IMEM_SLIMSSS,
+	ENABLE_PCLK_IMEM_RTIC,
+	ENABLE_PCLK_IMEM_SMMU_SSS,
+	ENABLE_PCLK_IMEM_SMMU_SLIMSSS,
+	ENABLE_PCLK_IMEM_SMMU_RTIC,
+	ENABLE_PCLK_IMEM_SMMU_ARGB_TX,
+};
+
+static const struct samsung_gate_clock imem_gate_clks[] __initconst = {
+	/* ENABLE_ACLK_IMEM */
+	GATE(CLK_ACLK_AXI2AHB_IMEMH, "aclk_axi2ahb_imemh", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 24, 0, 0),
+	GATE(CLK_ACLK_AXIDS_SROMC, "aclk_axids_sromc", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 23, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_SROMC, "aclk_sromc", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 22, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_BTS_ARBG_TX, "aclk_bts_arbg_tx", "aclk_imem_266",
+			ENABLE_ACLK_IMEM, 21, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_ASYNCAXI_IMEMX, "aclk_asyncaxi_imemx", "aclk_imem_266",
+			ENABLE_ACLK_IMEM, 20, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_AXIUS_IMEMX, "aclk_axius_imemx", "aclk_imem_266",
+			ENABLE_ACLK_IMEM, 19, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_XIU_IMEMX, "aclk_xiu_imemx", "aclk_imem_266",
+			ENABLE_ACLK_IMEM, 18, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_ASYNCAXI_SSSX, "aclk_asyncaxi_sssx", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM, 17, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_BTS_SLIMSSS, "aclk_bts_slimsss", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM, 15, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_BTS_SSS_DRAM, "aclk_bts_sss_dram", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM, 14, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_BTS_SSS_CCI, "aclk_bts_sss_cci", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM, 13, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_ALB_IMEM, "aclk_alb_imem", "aclk_imem_266",
+			ENABLE_ACLK_IMEM, 12, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_AXIDS_PIMEMX_IMEM1P, "aclk_axids_pimemx_imem1p", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 11, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_AXIDS_PIMEMX_IMEM0P, "aclk_axids_pimemx_imem0p", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 10, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_AXIDS_PIMEMX_GIC, "aclk_axids_pimemx_gic", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 9, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_ASYNCAHBM_SSS_ATLAS, "aclk_asyncahbm_sss_atlas", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM, 7, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_ASYNCAXIS_MIF_PIMEMX, "aclk_asyncaxis_mif_pimemx", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 6, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_AXI2APB_IMEM1P, "aclk_axi2apb_imem1p", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 5, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_AXI2APB_IMEM0P, "aclk_axi2apb_imem0p", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 4, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_XIU_SSSX, "aclk_xiu_sssx", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM, 3, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_XIU_PIMEMX, "aclk_xiu_pimemx", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 2, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_IMEMND_266, "aclk_imemnd_266", "aclk_imem_266",
+			ENABLE_ACLK_IMEM, 1, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_GIC, "aclk_gic", "aclk_imem_200",
+			ENABLE_ACLK_IMEM, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_ACLK_IMEM_INT_MEM */
+	GATE(CLK_ACLK_INT_MEM, "aclk_int_mem", "aclk_imem_200",
+			ENABLE_ACLK_IMEM_INT_MEM, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_ACLK_IMEM_SSS */
+	GATE(CLK_ACLK_SSS, "aclk_sss", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM_SSS, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_ACLK_IMEM_SLIMSSS */
+	GATE(CLK_ACLK_SLIMSSS, "aclk_slimsss", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM_SLIMSSS, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_ACLK_IMEM_RTIC */
+	GATE(CLK_ACLK_RTIC, "aclk_rtic", "aclk_imem_sssx_266",
+			ENABLE_ACLK_IMEM_RTIC, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_ACLK_SMMU_SSS */
+	GATE(CLK_ACLK_SMMU_SSS_DRAM, "aclk_smmu_sss_dram", "aclk_imem_sssx_266",
+		ENABLE_ACLK_IMEM_SMMU_SSS, 1, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_ACLK_SMMU_SSS_CCI, "aclk_smmu_sss_cci", "aclk_imem_sssx_266",
+		ENABLE_ACLK_IMEM_SMMU_SSS, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_ACLK_SMMU_SLIMSSS */
+	GATE(CLK_ACLK_SMMU_SLIMSSS, "aclk_smmu_slimsss", "aclk_imem_sssx_266",
+		ENABLE_ACLK_IMEM_SMMU_SLIMSSS, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_ACLK_SMMU_RTIC */
+	GATE(CLK_ACLK_SMMU_RTIC, "aclk_smmu_rtic", "aclk_imem_sssx_266",
+		ENABLE_ACLK_IMEM_SMMU_RTIC, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_ACLK_IMEM_ARBG_TX */
+	GATE(CLK_ACLK_ARBG_TX, "aclk_arbg_tx", "aclk_imem_266",
+		ENABLE_ACLK_IMEM_ARBG_TX, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_ACLK_IMEM_SMMU_ARBG_TX */
+	GATE(CLK_ACLK_SMMU_ARBG_TX, "aclk_smmu_arbg_tx", "aclk_imem_266",
+		ENABLE_ACLK_IMEM_SMMU_ARBG_TX, 0, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_PCLK_IMEM */
+	GATE(CLK_PCLK_GPIO_IMEM, "pclk_gpio_imem", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 17, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_ASYNCAXI_IMEMX, "pclk_asyncaxi_imemx", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 16, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_BTS_ARBG_TX, "pclk_bts_arbg_tx", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 15, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_ASYNCAPB_ARBG_TX, "pclk_asyncapb_arbg_tx", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 14, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_BTS_SLIMSSS, "pclk_bts_slimsss", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 8, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_BTS_SSS_DRAM, "pclk_bts_sss_dram", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 7, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_BTS_SSS_CCI, "pclk_bts_sss_cci", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 6, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_ALB_IMEM, "pclk_alb_imem", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 5, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_PMU_IMEM, "pclk_pmu_imem", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 4, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_SYSREG_IMEM, "pclk_sysreg_imem", "aclk_imem_200",
+			ENABLE_PCLK_IMEM, 3, CLK_IGNORE_UNUSED, 0),
+
+	/* ENABLE_PCLK_IMEM_SSS */
+	GATE(CLK_PCLK_SSS, "pclk_sss", "aclk_imem_200",
+			ENABLE_PCLK_IMEM_SSS, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_PCLK_IMEM_SLIMSSS */
+	GATE(CLK_PCLK_SLIMSSS, "pclk_slimsss", "aclk_imem_200",
+			ENABLE_PCLK_IMEM_SLIMSSS, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_PCLK_IMEM_RTIC */
+	GATE(CLK_PCLK_RTIC, "pclk_rtic", "aclk_imem_200",
+		ENABLE_PCLK_IMEM_RTIC, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_PCLK_IMEM_SMMU_SSS */
+	GATE(CLK_PCLK_SMMU_SSS_DRAM, "pclk_smmu_sss_dram", "aclk_imem_200",
+		ENABLE_PCLK_IMEM_SMMU_SSS, 1, CLK_IGNORE_UNUSED, 0),
+	GATE(CLK_PCLK_SMMU_SSS_CCI, "pclk_smmu_sss_cci", "aclk_imem_200",
+		ENABLE_PCLK_IMEM_SMMU_SSS, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_PCLK_IMEM_SMMU_SLIMSSS */
+	GATE(CLK_PCLK_SMMU_SLIMSSS, "pclk_smmu_slimsss", "aclk_imem_200",
+		ENABLE_PCLK_IMEM_SMMU_SLIMSSS, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_PCLK_IMEM_SMMU_RTIC */
+	GATE(CLK_PCLK_SMMU_RTIC, "pclk_sss", "aclk_imem_200",
+		ENABLE_PCLK_IMEM_SMMU_RTIC, 0, CLK_IGNORE_UNUSED, 0),
+	
+	/* ENABLE_PCLK_IMEM_SMMU_ARGB_TX */
+	GATE(CLK_PCLK_SMMU_ARBG_TX, "pclk_smmu_arbg_tx", "aclk_imem_200",
+		ENABLE_PCLK_IMEM_SMMU_ARGB_TX, 0, CLK_IGNORE_UNUSED, 0),
+};
+
+static const struct samsung_cmu_info imem_cmu_info __initconst = {
+	.gate_clks		= imem_gate_clks,
+	.nr_gate_clks		= ARRAY_SIZE(imem_gate_clks),
+	.nr_clk_ids		= IMEM_NR_CLK,
+	.clk_regs		= imem_clk_regs,
+	.nr_clk_regs		= ARRAY_SIZE(imem_clk_regs),
+};
 
 struct exynos5433_cmu_data {
 	struct samsung_clk_reg_dump *clk_save;
@@ -5654,6 +5844,9 @@ static const struct of_device_id exynos5433_cmu_of_match[] = {
 	}, {
 		.compatible = "samsung,exynos5433-cmu-mscl",
 		.data = &mscl_cmu_info,
+	}, {
+		.compatible = "samsung,exynos5433-cmu-imem",
+		.data = &imem_cmu_info,
 	}, {
 	},
 };
diff --git a/include/dt-bindings/clock/exynos5433.h b/include/dt-bindings/clock/exynos5433.h
index 87bb2b017143..cc6153a0b5f7 100644
--- a/include/dt-bindings/clock/exynos5433.h
+++ b/include/dt-bindings/clock/exynos5433.h
@@ -1406,4 +1406,59 @@
 
 #define CAM1_NR_CLK					113
 
+/* CMU_IMEM */
+#define CLK_ACLK_SSS			1
+#define CLK_ACLK_SLIMSSS		2
+#define CLK_ACLK_RTIC			3
+#define CLK_ACLK_XIU_SSSX		4
+#define CLK_ACLK_ASYNCAHBM_SSS_ATLAS	5
+#define CLK_ACLK_ASYNCAXI_SSSX		6
+#define CLK_ACLK_BTS_SSS_CCI		7
+#define CLK_ACLK_BTS_SSS_DRAM		8
+#define CLK_ACLK_BTS_SLIMSSS		9
+#define CLK_ACLK_SMMU_SSS_CCI		10
+#define CLK_ACLK_SMMU_SSS_DRAM		11
+#define CLK_ACLK_SMMU_SLIMSSS		12
+#define CLK_ACLK_SMMU_RTIC		13
+#define CLK_ACLK_IMEMND_266		14
+#define CLK_ACLK_ALB_IMEM		15
+#define CLK_ACLK_XIU_IMEMX		16
+#define CLK_ACLK_AXIUS_IMEMX		17
+#define CLK_ACLK_ASYNCAXI_IMEMX		18
+#define CLK_ACLK_ARBG_TX		19
+#define CLK_ACLK_BTS_ARBG_TX		20
+#define CLK_ACLK_SMMU_ARBG_TX		21
+#define CLK_ACLK_GIC			22
+#define CLK_ACLK_INT_MEM		23
+#define CLK_ACLK_XIU_PIMEMX		24
+#define CLK_ACLK_AXI2APB_IMEM0P		25
+#define CLK_ACLK_AXI2APB_IMEM1P		26
+#define CLK_ACLK_ASYNCAXIS_MIF_PIMEMX	27
+#define CLK_ACLK_AXIDS_PIMEMX_GIC	28
+#define CLK_ACLK_AXIDS_PIMEMX_IMEM0P	29
+#define CLK_ACLK_AXIDS_PIMEMX_IMEM1P	30
+#define CLK_ACLK_SROMC			31
+#define CLK_ACLK_AXIDS_SROMC		32
+#define CLK_ACLK_AXI2AHB_IMEMH		33
+#define CLK_PCLK_SSS			34
+#define CLK_PCLK_SLIMSSS		35
+#define CLK_PCLK_RTIC			36
+#define CLK_PCLK_SYSREG_IMEM		37
+#define CLK_PCLK_PMU_IMEM		38
+#define CLK_PCLK_ALB_IMEM		39
+#define CLK_PCLK_BTS_SSS_CCI		40
+#define CLK_PCLK_BTS_SSS_DRAM		41
+#define CLK_PCLK_BTS_SLIMSSS		42
+#define CLK_PCLK_SMMU_SSS_CCI		43
+#define CLK_PCLK_SMMU_SSS_DRAM		44
+#define CLK_PCLK_SMMU_SLIMSSS		45
+#define CLK_PCLK_SMMU_RTIC		46
+#define CLK_PCLK_ASYNCAPB_ARBG_TX	47
+#define CLK_PCLK_BTS_ARBG_TX		48
+#define CLK_PCLK_SMMU_ARBG_TX		49
+#define CLK_PCLK_ASYNCAXI_IMEMX		50
+#define CLK_PCLK_GPIO_IMEM		51
+
+#define IMEM_NR_CLK			52
+
 #endif /* _DT_BINDINGS_CLOCK_EXYNOS5433_H */
-- 
2.19.1

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

* Re: [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks
  2018-12-04 16:52     ` [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks Kamil Konieczny
@ 2018-12-04 18:40       ` Stephen Boyd
  2018-12-05 10:57         ` Sylwester Nawrocki
  2018-12-10 22:33       ` Rob Herring
  1 sibling, 1 reply; 17+ messages in thread
From: Stephen Boyd @ 2018-12-04 18:40 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: Chanwoo Choi, Rob Herring, Mark Rutland, Kukjin Kim,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-kernel

Quoting Kamil Konieczny (2018-12-04 08:52:48)
> +
> +static const unsigned long imem_clk_regs[] __initconst = {
> +       ENABLE_ACLK_IMEM,
> +       ENABLE_ACLK_IMEM_INT_MEM,
> +       ENABLE_ACLK_IMEM_SSS,
> +       ENABLE_ACLK_IMEM_SLIMSSS,
> +       ENABLE_ACLK_IMEM_RTIC,
> +       ENABLE_ACLK_IMEM_SMMU_SSS,
> +       ENABLE_ACLK_IMEM_SMMU_SLIMSSS,
> +       ENABLE_ACLK_IMEM_SMMU_RTIC,
> +       ENABLE_ACLK_IMEM_ARBG_TX,
> +       ENABLE_ACLK_IMEM_SMMU_ARBG_TX,
> +       ENABLE_PCLK_IMEM,
> +       ENABLE_PCLK_IMEM_SSS,
> +       ENABLE_PCLK_IMEM_SLIMSSS,
> +       ENABLE_PCLK_IMEM_RTIC,
> +       ENABLE_PCLK_IMEM_SMMU_SSS,
> +       ENABLE_PCLK_IMEM_SMMU_SLIMSSS,
> +       ENABLE_PCLK_IMEM_SMMU_RTIC,
> +       ENABLE_PCLK_IMEM_SMMU_ARGB_TX,
> +};
> +
> +static const struct samsung_gate_clock imem_gate_clks[] __initconst = {
> +       /* ENABLE_ACLK_IMEM */
> +       GATE(CLK_ACLK_AXI2AHB_IMEMH, "aclk_axi2ahb_imemh", "aclk_imem_200",
> +                       ENABLE_ACLK_IMEM, 24, 0, 0),
> +       GATE(CLK_ACLK_AXIDS_SROMC, "aclk_axids_sromc", "aclk_imem_200",
> +                       ENABLE_ACLK_IMEM, 23, CLK_IGNORE_UNUSED, 0),

Why is there so much use of CLK_IGNORE_UNUSED in this file?

> +       GATE(CLK_ACLK_SROMC, "aclk_sromc", "aclk_imem_200",

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

* Re: [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock
  2018-12-04 16:52     ` [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock Kamil Konieczny
@ 2018-12-04 18:41       ` Stephen Boyd
  2018-12-10 22:32       ` Rob Herring
  2018-12-11  5:06       ` Chanwoo Choi
  2 siblings, 0 replies; 17+ messages in thread
From: Stephen Boyd @ 2018-12-04 18:41 UTC (permalink / raw)
  To: k.konieczny, linux-samsung-soc
  Cc: linux-clk, Chanwoo Choi, devicetree, Krzysztof Kozlowski,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

Quoting Kamil Konieczny (2018-12-04 08:52:46)
> Document DT bindings for imem clock of the Samsung Exynos5433 SSS (Security
> SubSystem) and SlimSSS IPs.
> 
> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

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

* Re: [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks
  2018-12-04 18:40       ` Stephen Boyd
@ 2018-12-05 10:57         ` Sylwester Nawrocki
  2018-12-05 16:08           ` Stephen Boyd
  0 siblings, 1 reply; 17+ messages in thread
From: Sylwester Nawrocki @ 2018-12-05 10:57 UTC (permalink / raw)
  Cc: Stephen Boyd, k.konieczny, linux-samsung-soc, Chanwoo Choi,
	Rob Herring, Mark Rutland, Kukjin Kim, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-kernel

On 12/4/18 19:40, Stephen Boyd wrote:
> Quoting Kamil Konieczny (2018-12-04 08:52:48)
>> +
>> +static const unsigned long imem_clk_regs[] __initconst = {
>> +       ENABLE_ACLK_IMEM,
>> +       ENABLE_ACLK_IMEM_INT_MEM,
>> +       ENABLE_ACLK_IMEM_SSS,
>> +       ENABLE_ACLK_IMEM_SLIMSSS,
>> +       ENABLE_ACLK_IMEM_RTIC,
>> +       ENABLE_ACLK_IMEM_SMMU_SSS,
>> +       ENABLE_ACLK_IMEM_SMMU_SLIMSSS,
>> +       ENABLE_ACLK_IMEM_SMMU_RTIC,
>> +       ENABLE_ACLK_IMEM_ARBG_TX,
>> +       ENABLE_ACLK_IMEM_SMMU_ARBG_TX,
>> +       ENABLE_PCLK_IMEM,
>> +       ENABLE_PCLK_IMEM_SSS,
>> +       ENABLE_PCLK_IMEM_SLIMSSS,
>> +       ENABLE_PCLK_IMEM_RTIC,
>> +       ENABLE_PCLK_IMEM_SMMU_SSS,
>> +       ENABLE_PCLK_IMEM_SMMU_SLIMSSS,
>> +       ENABLE_PCLK_IMEM_SMMU_RTIC,
>> +       ENABLE_PCLK_IMEM_SMMU_ARGB_TX,
>> +};
>> +
>> +static const struct samsung_gate_clock imem_gate_clks[] __initconst = {
>> +       /* ENABLE_ACLK_IMEM */
>> +       GATE(CLK_ACLK_AXI2AHB_IMEMH, "aclk_axi2ahb_imemh", "aclk_imem_200",
>> +                       ENABLE_ACLK_IMEM, 24, 0, 0),

I don't think that clock will ever need to be disabled/enabled, so I would
drop this definition. The clock will remain in its default state after reset
(enabled).

>> +       GATE(CLK_ACLK_AXIDS_SROMC, "aclk_axids_sromc", "aclk_imem_200",
>> +                       ENABLE_ACLK_IMEM, 23, CLK_IGNORE_UNUSED, 0),
> 
> Why is there so much use of CLK_IGNORE_UNUSED in this file?

I suppose CLK_IGNORE_UNUSED is needed because there is no drivers that
would enable required clocks. For some clocks the flag could probably
indeed just be omitted, e.g. SLIMSSS clocks. 

I'm inclined to just define clocks that we are confident about and which
are needed now. i.e. the SSS IP block clocks. So in include/dt-bindings/
clock/exynos5433.h we would have something like:
 
+/* CMU_IMEM */
+#define CLK_ACLK_SSS			1
+#define CLK_PCLK_SSS			40

+#define IMEM_NR_CLK			41

The other clocks could be added later as needed by someone who has 
detailed knowledge about respective peripheral blocks.

-- 
Regards,
Sylwester

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

* Re: [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks
  2018-12-05 10:57         ` Sylwester Nawrocki
@ 2018-12-05 16:08           ` Stephen Boyd
  2018-12-05 17:25             ` Sylwester Nawrocki
  0 siblings, 1 reply; 17+ messages in thread
From: Stephen Boyd @ 2018-12-05 16:08 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: k.konieczny, linux-samsung-soc, Chanwoo Choi, Rob Herring,
	Mark Rutland, Kukjin Kim, Krzysztof Kozlowski, devicetree,
	linux-arm-kernel, linux-kernel

Quoting Sylwester Nawrocki (2018-12-05 02:57:32)
> On 12/4/18 19:40, Stephen Boyd wrote:
> > Quoting Kamil Konieczny (2018-12-04 08:52:48)
> >> +
> >> +static const unsigned long imem_clk_regs[] __initconst = {
> >> +       ENABLE_ACLK_IMEM,
> >> +       ENABLE_ACLK_IMEM_INT_MEM,
> >> +       ENABLE_ACLK_IMEM_SSS,
> >> +       ENABLE_ACLK_IMEM_SLIMSSS,
> >> +       ENABLE_ACLK_IMEM_RTIC,
> >> +       ENABLE_ACLK_IMEM_SMMU_SSS,
> >> +       ENABLE_ACLK_IMEM_SMMU_SLIMSSS,
> >> +       ENABLE_ACLK_IMEM_SMMU_RTIC,
> >> +       ENABLE_ACLK_IMEM_ARBG_TX,
> >> +       ENABLE_ACLK_IMEM_SMMU_ARBG_TX,
> >> +       ENABLE_PCLK_IMEM,
> >> +       ENABLE_PCLK_IMEM_SSS,
> >> +       ENABLE_PCLK_IMEM_SLIMSSS,
> >> +       ENABLE_PCLK_IMEM_RTIC,
> >> +       ENABLE_PCLK_IMEM_SMMU_SSS,
> >> +       ENABLE_PCLK_IMEM_SMMU_SLIMSSS,
> >> +       ENABLE_PCLK_IMEM_SMMU_RTIC,
> >> +       ENABLE_PCLK_IMEM_SMMU_ARGB_TX,
> >> +};
> >> +
> >> +static const struct samsung_gate_clock imem_gate_clks[] __initconst = {
> >> +       /* ENABLE_ACLK_IMEM */
> >> +       GATE(CLK_ACLK_AXI2AHB_IMEMH, "aclk_axi2ahb_imemh", "aclk_imem_200",
> >> +                       ENABLE_ACLK_IMEM, 24, 0, 0),
> 
> I don't think that clock will ever need to be disabled/enabled, so I would
> drop this definition. The clock will remain in its default state after reset
> (enabled).
> 
> >> +       GATE(CLK_ACLK_AXIDS_SROMC, "aclk_axids_sromc", "aclk_imem_200",
> >> +                       ENABLE_ACLK_IMEM, 23, CLK_IGNORE_UNUSED, 0),
> > 
> > Why is there so much use of CLK_IGNORE_UNUSED in this file?
> 
> I suppose CLK_IGNORE_UNUSED is needed because there is no drivers that
> would enable required clocks. For some clocks the flag could probably
> indeed just be omitted, e.g. SLIMSSS clocks. 
> 
> I'm inclined to just define clocks that we are confident about and which
> are needed now. i.e. the SSS IP block clocks. So in include/dt-bindings/
> clock/exynos5433.h we would have something like:

Agreed, it doesn't make much sense to add clk support for clks that
you'll never need to modify one way or the other.

>  
> +/* CMU_IMEM */
> +#define CLK_ACLK_SSS                   1
> +#define CLK_PCLK_SSS                   40
> 
> +#define IMEM_NR_CLK                    41
> 
> The other clocks could be added later as needed by someone who has 
> detailed knowledge about respective peripheral blocks.
> 

The slow addition of new clks to the binding header file makes for an
integration problem, so can we try to expose any clks that we know about
now as defines and make them not work if the driver isn't implementing
support for those clks? That way the binding is not changing but the
implementation can decide to support or not support certain clks.

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

* Re: [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks
  2018-12-05 16:08           ` Stephen Boyd
@ 2018-12-05 17:25             ` Sylwester Nawrocki
  0 siblings, 0 replies; 17+ messages in thread
From: Sylwester Nawrocki @ 2018-12-05 17:25 UTC (permalink / raw)
  To: Stephen Boyd, k.konieczny
  Cc: linux-samsung-soc, Chanwoo Choi, Rob Herring, Mark Rutland,
	Kukjin Kim, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-kernel

On 12/5/18 17:08, Stephen Boyd wrote:
> Quoting Sylwester Nawrocki (2018-12-05 02:57:32)
>> On 12/4/18 19:40, Stephen Boyd wrote:
>>> Quoting Kamil Konieczny (2018-12-04 08:52:48)
>>>> +
>>>> +static const unsigned long imem_clk_regs[] __initconst = {
[...]
>>>> +};
>>>> +
>>>> +static const struct samsung_gate_clock imem_gate_clks[] __initconst = {
>>>> +       /* ENABLE_ACLK_IMEM */
>>>> +       GATE(CLK_ACLK_AXI2AHB_IMEMH, "aclk_axi2ahb_imemh", "aclk_imem_200",
>>>> +                       ENABLE_ACLK_IMEM, 24, 0, 0),
>>
>> I don't think that clock will ever need to be disabled/enabled, so I would
>> drop this definition. The clock will remain in its default state after reset
>> (enabled).
>>
>>>> +       GATE(CLK_ACLK_AXIDS_SROMC, "aclk_axids_sromc", "aclk_imem_200",
>>>> +                       ENABLE_ACLK_IMEM, 23, CLK_IGNORE_UNUSED, 0),
>>>
>>> Why is there so much use of CLK_IGNORE_UNUSED in this file?
>>
>> I suppose CLK_IGNORE_UNUSED is needed because there is no drivers that
>> would enable required clocks. For some clocks the flag could probably
>> indeed just be omitted, e.g. SLIMSSS clocks. 
>>
>> I'm inclined to just define clocks that we are confident about and which
>> are needed now. i.e. the SSS IP block clocks. So in include/dt-bindings/
>> clock/exynos5433.h we would have something like:
> 
> Agreed, it doesn't make much sense to add clk support for clks that
> you'll never need to modify one way or the other.
> 
>>  
>> +/* CMU_IMEM */
>> +#define CLK_ACLK_SSS                   1
>> +#define CLK_PCLK_SSS                   40
>>
>> +#define IMEM_NR_CLK                    41
>>
>> The other clocks could be added later as needed by someone who has 
>> detailed knowledge about respective peripheral blocks.
>>
> 
> The slow addition of new clks to the binding header file makes for an
> integration problem, so can we try to expose any clks that we know about
> now as defines and make them not work if the driver isn't implementing
> support for those clks? That way the binding is not changing but the
> implementation can decide to support or not support certain clks.

That makes a lot of sense to me. Then all we have to do now is to drop
some of the entries in the imem_gate_clks array above.

-- 
Regards,
Sylwester

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

* Re: [PATCH v3 2/5] clk: samsung: exynos5433: fix name typo in sssx
  2018-12-04 16:52     ` [PATCH v3 2/5] clk: samsung: exynos5433: fix name typo in sssx Kamil Konieczny
@ 2018-12-10 22:29       ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2018-12-10 22:29 UTC (permalink / raw)
  To: Kamil Konieczny
  Cc: linux-samsung-soc, linux-clk, Chanwoo Choi, devicetree,
	Krzysztof Kozlowski, Kukjin Kim, Mark Rutland, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

On Tue, Dec 04, 2018 at 05:52:45PM +0100, Kamil Konieczny wrote:
> Fix typo in sssx name, there should be three letters 's'.
> 
> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
> ---
>  drivers/clk/samsung/clk-exynos5433.c   | 2 +-
>  include/dt-bindings/clock/exynos5433.h | 2 +-

Acked-by: Rob Herring <robh@kernel.org>

>  2 files changed, 2 insertions(+), 2 deletions(-)

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

* Re: [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock
  2018-12-04 16:52     ` [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock Kamil Konieczny
  2018-12-04 18:41       ` Stephen Boyd
@ 2018-12-10 22:32       ` Rob Herring
  2018-12-11  5:06       ` Chanwoo Choi
  2 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2018-12-10 22:32 UTC (permalink / raw)
  To: Kamil Konieczny
  Cc: linux-samsung-soc, linux-clk, Chanwoo Choi, devicetree,
	Krzysztof Kozlowski, Kukjin Kim, Mark Rutland, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

On Tue,  4 Dec 2018 17:52:46 +0100, Kamil Konieczny wrote:
> Document DT bindings for imem clock of the Samsung Exynos5433 SSS (Security
> SubSystem) and SlimSSS IPs.
> 
> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
> ---
>  .../bindings/clock/exynos5433-clock.txt       | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks
  2018-12-04 16:52     ` [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks Kamil Konieczny
  2018-12-04 18:40       ` Stephen Boyd
@ 2018-12-10 22:33       ` Rob Herring
  1 sibling, 0 replies; 17+ messages in thread
From: Rob Herring @ 2018-12-10 22:33 UTC (permalink / raw)
  To: Kamil Konieczny
  Cc: linux-samsung-soc, Chanwoo Choi, Mark Rutland, Kukjin Kim,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-kernel

On Tue, Dec 04, 2018 at 05:52:48PM +0100, Kamil Konieczny wrote:
> Add imem clocks for exynos5433. This will enable to use crypto Security
> SubSystem (in short SSS) and SlimSSS IP blocks.
> 
> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
> ---
>  drivers/clk/samsung/clk-exynos5433.c   | 193 +++++++++++++++++++++++++
>  include/dt-bindings/clock/exynos5433.h |  55 +++++++
>  2 files changed, 248 insertions(+)

Lots of trailing whitespace checkpatch errors...

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

* Re: [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock
  2018-12-04 16:52     ` [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock Kamil Konieczny
  2018-12-04 18:41       ` Stephen Boyd
  2018-12-10 22:32       ` Rob Herring
@ 2018-12-11  5:06       ` Chanwoo Choi
  2 siblings, 0 replies; 17+ messages in thread
From: Chanwoo Choi @ 2018-12-11  5:06 UTC (permalink / raw)
  To: Kamil Konieczny, linux-samsung-soc
  Cc: linux-clk, devicetree, Krzysztof Kozlowski, Kukjin Kim,
	Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

Hi Kamil,

On 2018년 12월 05일 01:52, Kamil Konieczny wrote:
> Document DT bindings for imem clock of the Samsung Exynos5433 SSS (Security
> SubSystem) and SlimSSS IPs.
> 
> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
> ---
>  .../bindings/clock/exynos5433-clock.txt       | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)

Acked-by: Chanwoo Choi <cw00.choi@samsung.com>

> 
> diff --git a/Documentation/devicetree/bindings/clock/exynos5433-clock.txt b/Documentation/devicetree/bindings/clock/exynos5433-clock.txt
> index 50d5897c9849..183c327a7d6b 100644
> --- a/Documentation/devicetree/bindings/clock/exynos5433-clock.txt
> +++ b/Documentation/devicetree/bindings/clock/exynos5433-clock.txt
> @@ -50,6 +50,8 @@ Required Properties:
>      IPs.
>    - "samsung,exynos5433-cmu-cam1" - clock controller compatible for CMU_CAM1
>      which generates clocks for Cortex-A5/MIPI_CSIS2/FIMC-LITE_C/FIMC-FD IPs.
> +  - "samsung,exynos5433-cmu-imem"   - clock controller compatible for CMU_IMEM
> +    which generates clocks for SSS (Security SubSystem) and SlimSSS IPs.
>  
>  - reg: physical base address of the controller and length of memory mapped
>    region.
> @@ -168,6 +170,12 @@ Required Properties:
>  		- aclk_cam1_400
>  		- aclk_cam1_552
>  
> +	Input clocks for imem clock controller:
> +		- oscclk
> +		- aclk_imem_sssx_266
> +		- aclk_imem_266
> +		- aclk_imem_200
> +
>  Optional properties:
>    - power-domains: a phandle to respective power domain node as described by
>  	generic PM domain bindings (see power/power_domain.txt for more
> @@ -469,6 +477,21 @@ Example 2: Examples of clock controller nodes are listed below.
>  		power-domains = <&pd_cam1>;
>  	};
>  
> +	cmu_imem: clock-controller@11060000 {
> +		compatible = "samsung,exynos5433-cmu-imem";
> +		reg = <0x11060000 0x1000>;
> +		#clock-cells = <1>;
> +
> +		clock-names = "oscclk",
> +			"aclk_imem_sssx_266",
> +			"aclk_imem_266",
> +			"aclk_imem_200";
> +		clocks = <&xxti>,
> +			<&cmu_top CLK_DIV_ACLK_IMEM_SSSX_266>,
> +			<&cmu_top CLK_DIV_ACLK_IMEM_266>,
> +			<&cmu_top CLK_DIV_ACLK_IMEM_200>;
> +	};
> +
>  Example 3: UART controller node that consumes the clock generated by the clock
>  	   controller.
>  
> 

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

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

* Re: [PATCH v3 4/5] arm64: dts: exynos: add imem clock
  2018-12-04 16:52     ` [PATCH v3 4/5] arm64: dts: exynos: add " Kamil Konieczny
@ 2018-12-13 21:10       ` Krzysztof Kozlowski
  2019-01-21  8:08         ` Kamil Konieczny
  0 siblings, 1 reply; 17+ messages in thread
From: Krzysztof Kozlowski @ 2018-12-13 21:10 UTC (permalink / raw)
  To: Kamil Konieczny
  Cc: linux-samsung-soc, linux-clk, Chanwoo Choi, devicetree,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

On Tue, Dec 04, 2018 at 05:52:47PM +0100, Kamil Konieczny wrote:
> Add description for imem clock in the Samsung Exynos5433. The users can use
> compatibility "samsung,exynos5433-cmu-imem".

Thanks, applied but the commit message above is not matching contents at all.
You did not add the description. Mentioning some users and compatibility
also seems unrelated. Instead:
1. You added DT node for IMEM clock controller on Exynos5433.
2. Because it is necessary for SSS to work (beside obvious reasons: for
   DTS completeness and allowing to gate them when not used).
Also, please use SoC name in commit title (for example at the end) to
differentiate from Exynos7 or any other future SoCs.

Best regards,
Krzysztof

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

* Re: [PATCH v3 4/5] arm64: dts: exynos: add imem clock
  2018-12-13 21:10       ` Krzysztof Kozlowski
@ 2019-01-21  8:08         ` Kamil Konieczny
  0 siblings, 0 replies; 17+ messages in thread
From: Kamil Konieczny @ 2019-01-21  8:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-samsung-soc, linux-clk, Chanwoo Choi, devicetree,
	Kukjin Kim, Mark Rutland, Rob Herring, Sylwester Nawrocki,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski

On 13.12.2018 22:10, Krzysztof Kozlowski wrote:
> On Tue, Dec 04, 2018 at 05:52:47PM +0100, Kamil Konieczny wrote:
>> Add description for imem clock in the Samsung Exynos5433. The users can use
>> compatibility "samsung,exynos5433-cmu-imem".
> 
> Thanks, applied but the commit message above is not matching contents at all.
> You did not add the description. Mentioning some users and compatibility
> also seems unrelated. Instead:
> 1. You added DT node for IMEM clock controller on Exynos5433.
> 2. Because it is necessary for SSS to work (beside obvious reasons: for
>    DTS completeness and allowing to gate them when not used).
> Also, please use SoC name in commit title (for example at the end) to
> differentiate from Exynos7 or any other future SoCs.

Thank you for your work and insightfull comments, I hope to improve my
commit messages.

-- 
Best regards,
Kamil Konieczny
Samsung R&D Institute Poland

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

end of thread, other threads:[~2019-01-21  8:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20181204165315eucas1p1693a3d349f39c272297e5d1902c905ca@eucas1p1.samsung.com>
2018-12-04 16:52 ` [PATCH v3 0/5] Add imem clock for Exynos 5433 Kamil Konieczny
     [not found]   ` <CGME20181204165316eucas1p2da523b358ed62eca270fe24c5e2b063c@eucas1p2.samsung.com>
2018-12-04 16:52     ` [PATCH v3 1/5] clk: samsung: exynos5433: fix typo in imem divider Kamil Konieczny
     [not found]   ` <CGME20181204165316eucas1p2ba063b96e83d2d2be93ca067d32d7926@eucas1p2.samsung.com>
2018-12-04 16:52     ` [PATCH v3 2/5] clk: samsung: exynos5433: fix name typo in sssx Kamil Konieczny
2018-12-10 22:29       ` Rob Herring
     [not found]   ` <CGME20181204165317eucas1p10bef0207ee57a9420911410ed2a22453@eucas1p1.samsung.com>
2018-12-04 16:52     ` [PATCH v3 3/5] dt-bindings: clk: exynos5433: document imem clock Kamil Konieczny
2018-12-04 18:41       ` Stephen Boyd
2018-12-10 22:32       ` Rob Herring
2018-12-11  5:06       ` Chanwoo Choi
     [not found]   ` <CGME20181204165317eucas1p18cd6168fdefb2aa57259b9ec73438275@eucas1p1.samsung.com>
2018-12-04 16:52     ` [PATCH v3 4/5] arm64: dts: exynos: add " Kamil Konieczny
2018-12-13 21:10       ` Krzysztof Kozlowski
2019-01-21  8:08         ` Kamil Konieczny
     [not found]   ` <CGME20181204165318eucas1p2dccd5382ee8b9f4da8c3076fb56607ee@eucas1p2.samsung.com>
2018-12-04 16:52     ` [PATCH v3 5/5] clk: samsung: exynos5433: add imem clocks Kamil Konieczny
2018-12-04 18:40       ` Stephen Boyd
2018-12-05 10:57         ` Sylwester Nawrocki
2018-12-05 16:08           ` Stephen Boyd
2018-12-05 17:25             ` Sylwester Nawrocki
2018-12-10 22:33       ` Rob Herring

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