linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion
@ 2020-09-16 20:55 Fabio Estevam
  2020-09-16 20:55 ` [PATCH 01/13] ARM: dts: imx27: Fix the register range for CCM Fabio Estevam
                   ` (12 more replies)
  0 siblings, 13 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Now that i.MX has been converted to a devicetree-only platform, do
one more round of cleanups that consists mainly in using devicetree
to get the peripherals base addresses and get rid of unused clock driver
code.

Fabio Estevam (13):
  ARM: dts: imx27: Fix the register range for CCM
  ARM: dts: imx27: Add the SYSCTRL description
  ARM: imx27: Retrieve the SYSCTRL base address from devicetree
  ARM: imx27: Retrieve the CCM base address from devicetree
  ARM: imx31: Retrieve the IIM base address from devicetree
  ARM: imx3: Retrieve the CCM base address from devicetree
  ARM: imx3: Retrieve the AVIC base address from devicetree
  ARM: imx35: Retrieve the IIM base address from devicetree
  ARM: imx: Remove unused IO_ADDRESS() macros
  clk: imx: imx27: Remove mx27_clocks_init()
  clk: imx: imx31: Remove mx31_clocks_init()
  clk: imx: imx35: Remove mx35_clocks_init()
  clk: imx: imx21: Remove clock driver

 arch/arm/boot/dts/imx27.dtsi  |   7 +-
 arch/arm/mach-imx/cpu-imx27.c |   9 +-
 arch/arm/mach-imx/cpu-imx31.c |  10 +-
 arch/arm/mach-imx/cpu-imx35.c |   9 +-
 arch/arm/mach-imx/mm-imx3.c   |  31 +++++-
 arch/arm/mach-imx/mx27.h      |   1 -
 arch/arm/mach-imx/mx31.h      |   1 -
 arch/arm/mach-imx/mx35.h      |   1 -
 arch/arm/mach-imx/pm-imx27.c  |  12 ++-
 drivers/clk/imx/Kconfig       |   4 -
 drivers/clk/imx/Makefile      |   1 -
 drivers/clk/imx/clk-imx21.c   | 171 ----------------------------------
 drivers/clk/imx/clk-imx27.c   |  73 ---------------
 drivers/clk/imx/clk-imx31.c   |  71 --------------
 drivers/clk/imx/clk-imx35.c   |  68 --------------
 15 files changed, 68 insertions(+), 401 deletions(-)
 delete mode 100644 drivers/clk/imx/clk-imx21.c

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 01/13] ARM: dts: imx27: Fix the register range for CCM
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 02/13] ARM: dts: imx27: Add the SYSCTRL description Fabio Estevam
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

According to the i.MX27 Reference Manual, the range for the CCM
registers has a size of 0x800.

Using 0x1000 will overlap with the SYSCTRL region, so fix it
accordingly.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/boot/dts/imx27.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 7bc132737a37..9fbc6cb7fbef 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -536,7 +536,7 @@
 
 			clks: ccm@10027000{
 				compatible = "fsl,imx27-ccm";
-				reg = <0x10027000 0x1000>;
+				reg = <0x10027000 0x800>;
 				#clock-cells = <1>;
 			};
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 02/13] ARM: dts: imx27: Add the SYSCTRL description
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
  2020-09-16 20:55 ` [PATCH 01/13] ARM: dts: imx27: Fix the register range for CCM Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree Fabio Estevam
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Add the SYSCTRL register range description.

This is useful for accessing the chip ID register.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/boot/dts/imx27.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 9fbc6cb7fbef..d54736524786 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -540,6 +540,11 @@
 				#clock-cells = <1>;
 			};
 
+			sysctrl: system-control@10027800 {
+				compatible = "fsl,imx27-sysctrl";
+				reg = <0x10027800 0x800>;
+			};
+
 			iim: efuse@10028000 {
 				compatible = "fsl,imx27-iim";
 				reg = <0x10028000 0x1000>;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
  2020-09-16 20:55 ` [PATCH 01/13] ARM: dts: imx27: Fix the register range for CCM Fabio Estevam
  2020-09-16 20:55 ` [PATCH 02/13] ARM: dts: imx27: Add the SYSCTRL description Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 21:30   ` Arnd Bergmann
  2020-09-16 20:55 ` [PATCH 04/13] ARM: imx27: Retrieve the CCM " Fabio Estevam
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Now that imx27 has been converted to a devicetree-only platform,
retrieve the SYSCTRL base address from devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/cpu-imx27.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cpu-imx27.c b/arch/arm/mach-imx/cpu-imx27.c
index a969aa71b60f..2c8430f34556 100644
--- a/arch/arm/mach-imx/cpu-imx27.c
+++ b/arch/arm/mach-imx/cpu-imx27.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/io.h>
+#include <linux/of_address.h>
 #include <linux/module.h>
 
 #include "hardware.h"
@@ -20,13 +21,19 @@ static int mx27_cpu_partnumber;
 
 static int mx27_read_cpu_rev(void)
 {
+	void __iomem *sysctrl_base;
+	struct device_node *np;
 	u32 val;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx27-sysctrl");
+	sysctrl_base = of_iomap(np, 0);
+	BUG_ON(!sysctrl_base);
 	/*
 	 * now we have access to the IO registers. As we need
 	 * the silicon revision very early we read it here to
 	 * avoid any further hooks
 	*/
-	val = imx_readl(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR + SYS_CHIP_ID));
+	val = imx_readl(sysctrl_base + SYS_CHIP_ID);
 
 	mx27_cpu_partnumber = (int)((val >> 12) & 0xFFFF);
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 04/13] ARM: imx27: Retrieve the CCM base address from devicetree
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (2 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 05/13] ARM: imx31: Retrieve the IIM " Fabio Estevam
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Now that imx27 has been converted to a devicetree-only platform,
retrieve the CCM base address from devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/pm-imx27.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c
index d943535566c8..020e6deb67c8 100644
--- a/arch/arm/mach-imx/pm-imx27.c
+++ b/arch/arm/mach-imx/pm-imx27.c
@@ -7,6 +7,7 @@
  * modify it under the terms of the GNU General Public License.
  */
 
+#include <linux/of_address.h>
 #include <linux/kernel.h>
 #include <linux/suspend.h>
 #include <linux/io.h>
@@ -15,13 +16,20 @@
 
 static int mx27_suspend_enter(suspend_state_t state)
 {
+	void __iomem *ccm_base;
+	struct device_node *np;
 	u32 cscr;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
+	ccm_base = of_iomap(np, 0);
+	BUG_ON(!ccm_base);
+
 	switch (state) {
 	case PM_SUSPEND_MEM:
 		/* Clear MPEN and SPEN to disable MPLL/SPLL */
-		cscr = imx_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
+		cscr = imx_readl(ccm_base);
 		cscr &= 0xFFFFFFFC;
-		imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
+		imx_writel(cscr, ccm_base);
 		/* Executes WFI */
 		cpu_do_idle();
 		break;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 05/13] ARM: imx31: Retrieve the IIM base address from devicetree
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (3 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 04/13] ARM: imx27: Retrieve the CCM " Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 06/13] ARM: imx3: Retrieve the CCM " Fabio Estevam
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Now that imx31 has been converted to a devicetree-only platform,
retrieve the IIM base address from devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/cpu-imx31.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index 3ee684b71006..47677da05cff 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/of_address.h>
 #include <linux/io.h>
 
 #include "common.h"
@@ -32,10 +33,17 @@ static struct {
 
 static int mx31_read_cpu_rev(void)
 {
+	void __iomem *iim_base;
+	struct device_node *np;
 	u32 i, srev;
 
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim");
+	iim_base = of_iomap(np, 0);
+	BUG_ON(!iim_base);
+
+
 	/* read SREV register from IIM module */
-	srev = imx_readl(MX31_IO_ADDRESS(MX31_IIM_BASE_ADDR + MXC_IIMSREV));
+	srev = imx_readl(iim_base + MXC_IIMSREV);
 	srev &= 0xff;
 
 	for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 06/13] ARM: imx3: Retrieve the CCM base address from devicetree
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (4 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 05/13] ARM: imx31: Retrieve the IIM " Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 07/13] ARM: imx3: Retrieve the AVIC " Fabio Estevam
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Now that imx31 and imx35 has been converted to a devicetree-only platform,
retrieve the CCM base address from devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/mm-imx3.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 4df7edc7ae7c..b7c5e15bb972 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
 #include <linux/pinctrl/machine.h>
 
 #include <asm/system_misc.h>
@@ -99,10 +100,14 @@ static void imx31_idle(void)
 
 void __init imx31_init_early(void)
 {
+	struct device_node *np;
+
 	mxc_set_cpu_type(MXC_CPU_MX31);
 	arch_ioremap_caller = imx3_ioremap_caller;
 	arm_pm_idle = imx31_idle;
-	mx3_ccm_base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR);
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
+	mx3_ccm_base = of_iomap(np, 0);
+	BUG_ON(!mx3_ccm_base);
 }
 
 void __init mx31_init_irq(void)
@@ -137,10 +142,14 @@ static void imx35_idle(void)
 
 void __init imx35_init_early(void)
 {
+	struct device_node *np;
+
 	mxc_set_cpu_type(MXC_CPU_MX35);
 	arm_pm_idle = imx35_idle;
 	arch_ioremap_caller = imx3_ioremap_caller;
-	mx3_ccm_base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR);
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx35-ccm");
+	mx3_ccm_base = of_iomap(np, 0);
+	BUG_ON(!mx3_ccm_base);
 }
 
 void __init mx35_init_irq(void)
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 07/13] ARM: imx3: Retrieve the AVIC base address from devicetree
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (5 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 06/13] ARM: imx3: Retrieve the CCM " Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 08/13] ARM: imx35: Retrieve the IIM " Fabio Estevam
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Now that imx31 and imx35 has been converted to a devicetree-only platform,
retrieve the AVIC base address from devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/mm-imx3.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index b7c5e15bb972..5056438e5b42 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -112,7 +112,14 @@ void __init imx31_init_early(void)
 
 void __init mx31_init_irq(void)
 {
-	mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR));
+	void __iomem *avic_base;
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx31-avic");
+	avic_base = of_iomap(np, 0);
+	BUG_ON(!avic_base);
+
+	mxc_init_irq(avic_base);
 }
 #endif /* ifdef CONFIG_SOC_IMX31 */
 
@@ -154,6 +161,13 @@ void __init imx35_init_early(void)
 
 void __init mx35_init_irq(void)
 {
-	mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
+	void __iomem *avic_base;
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx35-avic");
+	avic_base = of_iomap(np, 0);
+	BUG_ON(!avic_base);
+
+	mxc_init_irq(avic_base);
 }
 #endif /* ifdef CONFIG_SOC_IMX35 */
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 08/13] ARM: imx35: Retrieve the IIM base address from devicetree
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (6 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 07/13] ARM: imx3: Retrieve the AVIC " Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros Fabio Estevam
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

Now that imx35 has been converted to a devicetree-only platform,
retrieve the IIM base address from devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/cpu-imx35.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c
index ebb3cdabd506..80e7d8ab9f1b 100644
--- a/arch/arm/mach-imx/cpu-imx35.c
+++ b/arch/arm/mach-imx/cpu-imx35.c
@@ -5,6 +5,7 @@
  * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
  */
 #include <linux/module.h>
+#include <linux/of_address.h>
 #include <linux/io.h>
 
 #include "hardware.h"
@@ -14,9 +15,15 @@ static int mx35_cpu_rev = -1;
 
 static int mx35_read_cpu_rev(void)
 {
+	void __iomem *iim_base;
+	struct device_node *np;
 	u32 rev;
 
-	rev = imx_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
+	iim_base = of_iomap(np, 0);
+	BUG_ON(!iim_base);
+
+	rev = imx_readl(iim_base + MXC_IIMSREV);
 	switch (rev) {
 	case 0x00:
 		return IMX_CHIP_REVISION_1_0;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (7 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 08/13] ARM: imx35: Retrieve the IIM " Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 21:34   ` Arnd Bergmann
  2020-09-16 20:55 ` [PATCH 10/13] clk: imx: imx27: Remove mx27_clocks_init() Fabio Estevam
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

The IO_ADDRESS() macros were used to retrieve the peripherals
base address for board related code.

Now that i.MX is a devicetree-only platforms, all base addresses are
retrieved from devicetree and these macros are unused.

Remove the unused IO_ADDRESS() macros.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/mx27.h | 1 -
 arch/arm/mach-imx/mx31.h | 1 -
 arch/arm/mach-imx/mx35.h | 1 -
 3 files changed, 3 deletions(-)

diff --git a/arch/arm/mach-imx/mx27.h b/arch/arm/mach-imx/mx27.h
index c6f7aae02b67..d6dae9fa8610 100644
--- a/arch/arm/mach-imx/mx27.h
+++ b/arch/arm/mach-imx/mx27.h
@@ -112,7 +112,6 @@
 #define MX27_IRAM_BASE_ADDR		0xffff4c00	/* internal ram */
 
 #define MX27_IO_P2V(x)			IMX_IO_P2V(x)
-#define MX27_IO_ADDRESS(x)		IOMEM(MX27_IO_P2V(x))
 
 /* fixed interrupt numbers */
 #include <asm/irq.h>
diff --git a/arch/arm/mach-imx/mx31.h b/arch/arm/mach-imx/mx31.h
index d9574671ca5c..192499dcc792 100644
--- a/arch/arm/mach-imx/mx31.h
+++ b/arch/arm/mach-imx/mx31.h
@@ -117,7 +117,6 @@
 #define MX31_PCMCIA_MEM_BASE_ADDR	0xbc000000
 
 #define MX31_IO_P2V(x)			IMX_IO_P2V(x)
-#define MX31_IO_ADDRESS(x)		IOMEM(MX31_IO_P2V(x))
 
 /*
  * Interrupt numbers
diff --git a/arch/arm/mach-imx/mx35.h b/arch/arm/mach-imx/mx35.h
index 760de6a0af7e..4f0b939c6e03 100644
--- a/arch/arm/mach-imx/mx35.h
+++ b/arch/arm/mach-imx/mx35.h
@@ -116,7 +116,6 @@
 #define MX35_PCMCIA_MEM_BASE_ADDR	0xbc000000
 
 #define MX35_IO_P2V(x)			IMX_IO_P2V(x)
-#define MX35_IO_ADDRESS(x)		IOMEM(MX35_IO_P2V(x))
 
 /*
  * Interrupt numbers
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 10/13] clk: imx: imx27: Remove mx27_clocks_init()
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (8 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 11/13] clk: imx: imx31: Remove mx31_clocks_init() Fabio Estevam
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

mx27_clocks_init() has been used to register clocks on i.MX27
non-devicetree platforms.

Now that i.MX is a devicetree-only platform, it is safe to
remove mx27_clocks_init() as there are no more users.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/clk/imx/clk-imx27.c | 73 -------------------------------------
 1 file changed, 73 deletions(-)

diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c
index a3753067fc12..5585ded8b8c6 100644
--- a/drivers/clk/imx/clk-imx27.c
+++ b/drivers/clk/imx/clk-imx27.c
@@ -181,79 +181,6 @@ static void __init _mx27_clocks_init(unsigned long fref)
 	imx_print_silicon_rev("i.MX27", mx27_revision());
 }
 
-int __init mx27_clocks_init(unsigned long fref)
-{
-	ccm = ioremap(MX27_CCM_BASE_ADDR, SZ_4K);
-
-	_mx27_clocks_init(fref);
-
-	clk_register_clkdev(clk[IMX27_CLK_UART1_IPG_GATE], "ipg", "imx21-uart.0");
-	clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.0");
-	clk_register_clkdev(clk[IMX27_CLK_UART2_IPG_GATE], "ipg", "imx21-uart.1");
-	clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.1");
-	clk_register_clkdev(clk[IMX27_CLK_UART3_IPG_GATE], "ipg", "imx21-uart.2");
-	clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.2");
-	clk_register_clkdev(clk[IMX27_CLK_UART4_IPG_GATE], "ipg", "imx21-uart.3");
-	clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.3");
-	clk_register_clkdev(clk[IMX27_CLK_UART5_IPG_GATE], "ipg", "imx21-uart.4");
-	clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.4");
-	clk_register_clkdev(clk[IMX27_CLK_UART6_IPG_GATE], "ipg", "imx21-uart.5");
-	clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.5");
-	clk_register_clkdev(clk[IMX27_CLK_GPT1_IPG_GATE], "ipg", "imx-gpt.0");
-	clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx-gpt.0");
-	clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.0");
-	clk_register_clkdev(clk[IMX27_CLK_SDHC1_IPG_GATE], "ipg", "imx21-mmc.0");
-	clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.1");
-	clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.1");
-	clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.2");
-	clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.2");
-	clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.0");
-	clk_register_clkdev(clk[IMX27_CLK_CSPI1_IPG_GATE], "ipg", "imx27-cspi.0");
-	clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.1");
-	clk_register_clkdev(clk[IMX27_CLK_CSPI2_IPG_GATE], "ipg", "imx27-cspi.1");
-	clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.2");
-	clk_register_clkdev(clk[IMX27_CLK_CSPI3_IPG_GATE], "ipg", "imx27-cspi.2");
-	clk_register_clkdev(clk[IMX27_CLK_PER3_GATE], "per", "imx21-fb.0");
-	clk_register_clkdev(clk[IMX27_CLK_LCDC_IPG_GATE], "ipg", "imx21-fb.0");
-	clk_register_clkdev(clk[IMX27_CLK_LCDC_AHB_GATE], "ahb", "imx21-fb.0");
-	clk_register_clkdev(clk[IMX27_CLK_CSI_AHB_GATE], "ahb", "imx27-camera.0");
-	clk_register_clkdev(clk[IMX27_CLK_PER4_GATE], "per", "imx27-camera.0");
-	clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "imx-udc-mx27");
-	clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "imx-udc-mx27");
-	clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "imx-udc-mx27");
-	clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.0");
-	clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.0");
-	clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.0");
-	clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.1");
-	clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.1");
-	clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.1");
-	clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.2");
-	clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.2");
-	clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.2");
-	clk_register_clkdev(clk[IMX27_CLK_SSI1_IPG_GATE], NULL, "imx-ssi.0");
-	clk_register_clkdev(clk[IMX27_CLK_SSI2_IPG_GATE], NULL, "imx-ssi.1");
-	clk_register_clkdev(clk[IMX27_CLK_NFC_BAUD_GATE], NULL, "imx27-nand.0");
-	clk_register_clkdev(clk[IMX27_CLK_VPU_BAUD_GATE], "per", "coda-imx27.0");
-	clk_register_clkdev(clk[IMX27_CLK_VPU_AHB_GATE], "ahb", "coda-imx27.0");
-	clk_register_clkdev(clk[IMX27_CLK_DMA_AHB_GATE], "ahb", "imx27-dma");
-	clk_register_clkdev(clk[IMX27_CLK_DMA_IPG_GATE], "ipg", "imx27-dma");
-	clk_register_clkdev(clk[IMX27_CLK_FEC_IPG_GATE], "ipg", "imx27-fec.0");
-	clk_register_clkdev(clk[IMX27_CLK_FEC_AHB_GATE], "ahb", "imx27-fec.0");
-	clk_register_clkdev(clk[IMX27_CLK_WDOG_IPG_GATE], NULL, "imx2-wdt.0");
-	clk_register_clkdev(clk[IMX27_CLK_I2C1_IPG_GATE], NULL, "imx21-i2c.0");
-	clk_register_clkdev(clk[IMX27_CLK_I2C2_IPG_GATE], NULL, "imx21-i2c.1");
-	clk_register_clkdev(clk[IMX27_CLK_OWIRE_IPG_GATE], NULL, "mxc_w1.0");
-	clk_register_clkdev(clk[IMX27_CLK_KPP_IPG_GATE], NULL, "imx-keypad");
-	clk_register_clkdev(clk[IMX27_CLK_EMMA_AHB_GATE], "emma-ahb", "imx27-camera.0");
-	clk_register_clkdev(clk[IMX27_CLK_EMMA_IPG_GATE], "emma-ipg", "imx27-camera.0");
-	clk_register_clkdev(clk[IMX27_CLK_EMMA_AHB_GATE], "ahb", "m2m-emmaprp.0");
-	clk_register_clkdev(clk[IMX27_CLK_EMMA_IPG_GATE], "ipg", "m2m-emmaprp.0");
-
-	mxc_timer_init(MX27_GPT1_BASE_ADDR, MX27_INT_GPT1, GPT_TYPE_IMX21);
-
-	return 0;
-}
-
 static void __init mx27_clocks_init_dt(struct device_node *np)
 {
 	struct device_node *refnp;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 11/13] clk: imx: imx31: Remove mx31_clocks_init()
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (9 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 10/13] clk: imx: imx27: Remove mx27_clocks_init() Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 12/13] clk: imx: imx35: Remove mx35_clocks_init() Fabio Estevam
  2020-09-16 20:55 ` [PATCH 13/13] clk: imx: imx21: Remove clock driver Fabio Estevam
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

mx31_clocks_init() has been used to register clocks on i.MX31
non-devicetree platforms.

Now that i.MX is a devicetree-only platform, it is safe to
remove mx31_clocks_init() as there are no more users.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/clk/imx/clk-imx31.c | 71 -------------------------------------
 1 file changed, 71 deletions(-)

diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
index 4bb05e440cdd..7b13fb57d842 100644
--- a/drivers/clk/imx/clk-imx31.c
+++ b/drivers/clk/imx/clk-imx31.c
@@ -132,77 +132,6 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
 	clk_disable_unprepare(clk[iim_gate]);
 }
 
-int __init mx31_clocks_init(unsigned long fref)
-{
-	void __iomem *base;
-
-	base = ioremap(MX31_CCM_BASE_ADDR, SZ_4K);
-	if (!base)
-		panic("%s: failed to map registers\n", __func__);
-
-	_mx31_clocks_init(base, fref);
-
-	clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
-	clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
-	clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0");
-	clk_register_clkdev(clk[cspi2_gate], NULL, "imx31-cspi.1");
-	clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
-	clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
-	clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
-	clk_register_clkdev(clk[ckil], "ref", "imx21-rtc");
-	clk_register_clkdev(clk[rtc_gate], "ipg", "imx21-rtc");
-	clk_register_clkdev(clk[epit1_gate], "epit", NULL);
-	clk_register_clkdev(clk[epit2_gate], "epit", NULL);
-	clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
-	clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
-	clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
-	clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
-	clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.0");
-	clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.0");
-	clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
-	clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.1");
-	clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.1");
-	clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.1");
-	clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.2");
-	clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.2");
-	clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2");
-	clk_register_clkdev(clk[usb_div_post], "per", "imx-udc-mx27");
-	clk_register_clkdev(clk[usb_gate], "ahb", "imx-udc-mx27");
-	clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27");
-	clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
-	/* i.mx31 has the i.mx21 type uart */
-	clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
-	clk_register_clkdev(clk[uart2_gate], "per", "imx21-uart.1");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
-	clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
-	clk_register_clkdev(clk[uart4_gate], "per", "imx21-uart.3");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.3");
-	clk_register_clkdev(clk[uart5_gate], "per", "imx21-uart.4");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.4");
-	clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
-	clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
-	clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
-	clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
-	clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0");
-	clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1");
-	clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
-	clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
-	clk_register_clkdev(clk[firi_gate], "firi", NULL);
-	clk_register_clkdev(clk[ata_gate], NULL, "pata_imx");
-	clk_register_clkdev(clk[rtic_gate], "rtic", NULL);
-	clk_register_clkdev(clk[rng_gate], NULL, "mxc_rnga");
-	clk_register_clkdev(clk[sdma_gate], NULL, "imx31-sdma");
-	clk_register_clkdev(clk[iim_gate], "iim", NULL);
-
-
-	imx_register_uart_clocks(uart_clks);
-	mxc_timer_init(MX31_GPT1_BASE_ADDR, MX31_INT_GPT, GPT_TYPE_IMX31);
-
-	return 0;
-}
-
 static void __init mx31_clocks_init_dt(struct device_node *np)
 {
 	struct device_node *osc_np;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 12/13] clk: imx: imx35: Remove mx35_clocks_init()
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (10 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 11/13] clk: imx: imx31: Remove mx31_clocks_init() Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  2020-09-16 20:55 ` [PATCH 13/13] clk: imx: imx21: Remove clock driver Fabio Estevam
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

mx35_clocks_init() has been used to register clocks on i.MX35
non-devicetree platforms.

Now that i.MX is a devicetree-only platform, it is safe to
remove mx35_clocks_init() as there are no more users.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/clk/imx/clk-imx35.c | 68 -------------------------------------
 1 file changed, 68 deletions(-)

diff --git a/drivers/clk/imx/clk-imx35.c b/drivers/clk/imx/clk-imx35.c
index e595f559907f..c1df03665c09 100644
--- a/drivers/clk/imx/clk-imx35.c
+++ b/drivers/clk/imx/clk-imx35.c
@@ -248,74 +248,6 @@ static void __init _mx35_clocks_init(void)
 	imx_print_silicon_rev("i.MX35", mx35_revision());
 }
 
-int __init mx35_clocks_init(void)
-{
-	_mx35_clocks_init();
-
-	clk_register_clkdev(clk[pata_gate], NULL, "pata_imx");
-	clk_register_clkdev(clk[can1_gate], NULL, "flexcan.0");
-	clk_register_clkdev(clk[can2_gate], NULL, "flexcan.1");
-	clk_register_clkdev(clk[cspi1_gate], "per", "imx35-cspi.0");
-	clk_register_clkdev(clk[cspi1_gate], "ipg", "imx35-cspi.0");
-	clk_register_clkdev(clk[cspi2_gate], "per", "imx35-cspi.1");
-	clk_register_clkdev(clk[cspi2_gate], "ipg", "imx35-cspi.1");
-	clk_register_clkdev(clk[epit1_gate], NULL, "imx-epit.0");
-	clk_register_clkdev(clk[epit2_gate], NULL, "imx-epit.1");
-	clk_register_clkdev(clk[esdhc1_gate], "per", "sdhci-esdhc-imx35.0");
-	clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.0");
-	clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.0");
-	clk_register_clkdev(clk[esdhc2_gate], "per", "sdhci-esdhc-imx35.1");
-	clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.1");
-	clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.1");
-	clk_register_clkdev(clk[esdhc3_gate], "per", "sdhci-esdhc-imx35.2");
-	clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.2");
-	clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.2");
-	/* i.mx35 has the i.mx27 type fec */
-	clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
-	clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
-	clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
-	clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
-	clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
-	clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
-	clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
-	clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
-	clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
-	clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1");
-	clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma");
-	clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
-	clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
-	/* i.mx35 has the i.mx21 type uart */
-	clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
-	clk_register_clkdev(clk[uart2_gate], "per", "imx21-uart.1");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
-	clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
-	clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
-	/* i.mx35 has the i.mx21 type rtc */
-	clk_register_clkdev(clk[ckil], "ref", "imx21-rtc");
-	clk_register_clkdev(clk[rtc_gate], "ipg", "imx21-rtc");
-	clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0");
-	clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
-	clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.0");
-	clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.1");
-	clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.1");
-	clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.1");
-	clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.2");
-	clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2");
-	clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.2");
-	clk_register_clkdev(clk[usb_div], "per", "imx-udc-mx27");
-	clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27");
-	clk_register_clkdev(clk[usbotg_gate], "ahb", "imx-udc-mx27");
-	clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
-	clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0");
-	clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
-	clk_register_clkdev(clk[admux_gate], "audmux", NULL);
-
-	mxc_timer_init(MX35_GPT1_BASE_ADDR, MX35_INT_GPT, GPT_TYPE_IMX31);
-
-	return 0;
-}
-
 static void __init mx35_clocks_init_dt(struct device_node *ccm_node)
 {
 	_mx35_clocks_init();
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 13/13] clk: imx: imx21: Remove clock driver
  2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
                   ` (11 preceding siblings ...)
  2020-09-16 20:55 ` [PATCH 12/13] clk: imx: imx35: Remove mx35_clocks_init() Fabio Estevam
@ 2020-09-16 20:55 ` Fabio Estevam
  12 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 20:55 UTC (permalink / raw)
  To: shawnguo; +Cc: linux-arm-kernel, Fabio Estevam, arnd, linux-imx, kernel

As i.MX21 support has been removed, get rid of its clock driver too.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/clk/imx/Kconfig     |   4 -
 drivers/clk/imx/Makefile    |   1 -
 drivers/clk/imx/clk-imx21.c | 171 ------------------------------------
 3 files changed, 176 deletions(-)
 delete mode 100644 drivers/clk/imx/clk-imx21.c

diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig
index e7defbac0936..3b393cb07295 100644
--- a/drivers/clk/imx/Kconfig
+++ b/drivers/clk/imx/Kconfig
@@ -13,10 +13,6 @@ config CLK_IMX1
 	def_bool SOC_IMX1
 	select MXC_CLK
 
-config CLK_IMX21
-	def_bool SOC_IMX21
-	select MXC_CLK
-
 config CLK_IMX25
 	def_bool SOC_IMX25
 	select MXC_CLK
diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile
index 79e53f2257c1..dd6a737d060b 100644
--- a/drivers/clk/imx/Makefile
+++ b/drivers/clk/imx/Makefile
@@ -31,7 +31,6 @@ clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o
 clk-imx-lpcg-scu-$(CONFIG_CLK_IMX8QXP) += clk-lpcg-scu.o clk-imx8qxp-lpcg.o
 
 obj-$(CONFIG_CLK_IMX1)   += clk-imx1.o
-obj-$(CONFIG_CLK_IMX21)  += clk-imx21.o
 obj-$(CONFIG_CLK_IMX25)  += clk-imx25.o
 obj-$(CONFIG_CLK_IMX27)  += clk-imx27.o
 obj-$(CONFIG_CLK_IMX31)  += clk-imx31.o
diff --git a/drivers/clk/imx/clk-imx21.c b/drivers/clk/imx/clk-imx21.c
deleted file mode 100644
index 077b4a7123ce..000000000000
--- a/drivers/clk/imx/clk-imx21.c
+++ /dev/null
@@ -1,171 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
- * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
- * Copyright 2008 Martin Fuzzey, mfuzzey@gmail.com
- */
-
-#include <linux/clk-provider.h>
-#include <linux/clkdev.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <dt-bindings/clock/imx21-clock.h>
-#include <soc/imx/timer.h>
-#include <asm/irq.h>
-
-#include "clk.h"
-
-#define MX21_CCM_BASE_ADDR	0x10027000
-#define MX21_GPT1_BASE_ADDR	0x10003000
-#define MX21_INT_GPT1		(NR_IRQS_LEGACY + 26)
-
-static void __iomem *ccm __initdata;
-
-/* Register offsets */
-#define CCM_CSCR	(ccm + 0x00)
-#define CCM_MPCTL0	(ccm + 0x04)
-#define CCM_SPCTL0	(ccm + 0x0c)
-#define CCM_PCDR0	(ccm + 0x18)
-#define CCM_PCDR1	(ccm + 0x1c)
-#define CCM_PCCR0	(ccm + 0x20)
-#define CCM_PCCR1	(ccm + 0x24)
-
-static const char *mpll_osc_sel_clks[] = { "ckih_gate", "ckih_div1p5", };
-static const char *mpll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
-static const char *spll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
-static const char *ssi_sel_clks[] = { "spll_gate", "mpll_gate", };
-
-static struct clk *clk[IMX21_CLK_MAX];
-static struct clk_onecell_data clk_data;
-
-static void __init _mx21_clocks_init(unsigned long lref, unsigned long href)
-{
-	BUG_ON(!ccm);
-
-	clk[IMX21_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-	clk[IMX21_CLK_CKIL] = imx_obtain_fixed_clock("ckil", lref);
-	clk[IMX21_CLK_CKIH] = imx_obtain_fixed_clock("ckih", href);
-	clk[IMX21_CLK_FPM] = imx_clk_fixed_factor("fpm", "ckil", 512, 1);
-	clk[IMX21_CLK_CKIH_DIV1P5] = imx_clk_fixed_factor("ckih_div1p5", "ckih_gate", 2, 3);
-
-	clk[IMX21_CLK_MPLL_GATE] = imx_clk_gate("mpll_gate", "mpll", CCM_CSCR, 0);
-	clk[IMX21_CLK_SPLL_GATE] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
-	clk[IMX21_CLK_FPM_GATE] = imx_clk_gate("fpm_gate", "fpm", CCM_CSCR, 2);
-	clk[IMX21_CLK_CKIH_GATE] = imx_clk_gate_dis("ckih_gate", "ckih", CCM_CSCR, 3);
-	clk[IMX21_CLK_MPLL_OSC_SEL] = imx_clk_mux("mpll_osc_sel", CCM_CSCR, 4, 1, mpll_osc_sel_clks, ARRAY_SIZE(mpll_osc_sel_clks));
-	clk[IMX21_CLK_IPG] = imx_clk_divider("ipg", "hclk", CCM_CSCR, 9, 1);
-	clk[IMX21_CLK_HCLK] = imx_clk_divider("hclk", "fclk", CCM_CSCR, 10, 4);
-	clk[IMX21_CLK_MPLL_SEL] = imx_clk_mux("mpll_sel", CCM_CSCR, 16, 1, mpll_sel_clks, ARRAY_SIZE(mpll_sel_clks));
-	clk[IMX21_CLK_SPLL_SEL] = imx_clk_mux("spll_sel", CCM_CSCR, 17, 1, spll_sel_clks, ARRAY_SIZE(spll_sel_clks));
-	clk[IMX21_CLK_SSI1_SEL] = imx_clk_mux("ssi1_sel", CCM_CSCR, 19, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
-	clk[IMX21_CLK_SSI2_SEL] = imx_clk_mux("ssi2_sel", CCM_CSCR, 20, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
-	clk[IMX21_CLK_USB_DIV] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 26, 3);
-	clk[IMX21_CLK_FCLK] = imx_clk_divider("fclk", "mpll_gate", CCM_CSCR, 29, 3);
-
-	clk[IMX21_CLK_MPLL] = imx_clk_pllv1(IMX_PLLV1_IMX21, "mpll", "mpll_sel", CCM_MPCTL0);
-
-	clk[IMX21_CLK_SPLL] = imx_clk_pllv1(IMX_PLLV1_IMX21, "spll", "spll_sel", CCM_SPCTL0);
-
-	clk[IMX21_CLK_NFC_DIV] = imx_clk_divider("nfc_div", "fclk", CCM_PCDR0, 12, 4);
-	clk[IMX21_CLK_SSI1_DIV] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6);
-	clk[IMX21_CLK_SSI2_DIV] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 6);
-
-	clk[IMX21_CLK_PER1] = imx_clk_divider("per1", "mpll_gate", CCM_PCDR1, 0, 6);
-	clk[IMX21_CLK_PER2] = imx_clk_divider("per2", "mpll_gate", CCM_PCDR1, 8, 6);
-	clk[IMX21_CLK_PER3] = imx_clk_divider("per3", "mpll_gate", CCM_PCDR1, 16, 6);
-	clk[IMX21_CLK_PER4] = imx_clk_divider("per4", "mpll_gate", CCM_PCDR1, 24, 6);
-
-	clk[IMX21_CLK_UART1_IPG_GATE] = imx_clk_gate("uart1_ipg_gate", "ipg", CCM_PCCR0, 0);
-	clk[IMX21_CLK_UART2_IPG_GATE] = imx_clk_gate("uart2_ipg_gate", "ipg", CCM_PCCR0, 1);
-	clk[IMX21_CLK_UART3_IPG_GATE] = imx_clk_gate("uart3_ipg_gate", "ipg", CCM_PCCR0, 2);
-	clk[IMX21_CLK_UART4_IPG_GATE] = imx_clk_gate("uart4_ipg_gate", "ipg", CCM_PCCR0, 3);
-	clk[IMX21_CLK_CSPI1_IPG_GATE] = imx_clk_gate("cspi1_ipg_gate", "ipg", CCM_PCCR0, 4);
-	clk[IMX21_CLK_CSPI2_IPG_GATE] = imx_clk_gate("cspi2_ipg_gate", "ipg", CCM_PCCR0, 5);
-	clk[IMX21_CLK_SSI1_GATE] = imx_clk_gate("ssi1_gate", "ipg", CCM_PCCR0, 6);
-	clk[IMX21_CLK_SSI2_GATE] = imx_clk_gate("ssi2_gate", "ipg", CCM_PCCR0, 7);
-	clk[IMX21_CLK_SDHC1_IPG_GATE] = imx_clk_gate("sdhc1_ipg_gate", "ipg", CCM_PCCR0, 9);
-	clk[IMX21_CLK_SDHC2_IPG_GATE] = imx_clk_gate("sdhc2_ipg_gate", "ipg", CCM_PCCR0, 10);
-	clk[IMX21_CLK_GPIO_GATE] = imx_clk_gate("gpio_gate", "ipg", CCM_PCCR0, 11);
-	clk[IMX21_CLK_I2C_GATE] = imx_clk_gate("i2c_gate", "ipg", CCM_PCCR0, 12);
-	clk[IMX21_CLK_DMA_GATE] = imx_clk_gate("dma_gate", "ipg", CCM_PCCR0, 13);
-	clk[IMX21_CLK_USB_GATE] = imx_clk_gate("usb_gate", "usb_div", CCM_PCCR0, 14);
-	clk[IMX21_CLK_EMMA_GATE] = imx_clk_gate("emma_gate", "ipg", CCM_PCCR0, 15);
-	clk[IMX21_CLK_SSI2_BAUD_GATE] = imx_clk_gate("ssi2_baud_gate", "ipg", CCM_PCCR0, 16);
-	clk[IMX21_CLK_SSI1_BAUD_GATE] = imx_clk_gate("ssi1_baud_gate", "ipg", CCM_PCCR0, 17);
-	clk[IMX21_CLK_LCDC_IPG_GATE] = imx_clk_gate("lcdc_ipg_gate", "ipg", CCM_PCCR0, 18);
-	clk[IMX21_CLK_NFC_GATE] = imx_clk_gate("nfc_gate", "nfc_div", CCM_PCCR0, 19);
-	clk[IMX21_CLK_SLCDC_HCLK_GATE] = imx_clk_gate("slcdc_hclk_gate", "hclk", CCM_PCCR0, 21);
-	clk[IMX21_CLK_PER4_GATE] = imx_clk_gate("per4_gate", "per4", CCM_PCCR0, 22);
-	clk[IMX21_CLK_BMI_GATE] = imx_clk_gate("bmi_gate", "hclk", CCM_PCCR0, 23);
-	clk[IMX21_CLK_USB_HCLK_GATE] = imx_clk_gate("usb_hclk_gate", "hclk", CCM_PCCR0, 24);
-	clk[IMX21_CLK_SLCDC_GATE] = imx_clk_gate("slcdc_gate", "hclk", CCM_PCCR0, 25);
-	clk[IMX21_CLK_LCDC_HCLK_GATE] = imx_clk_gate("lcdc_hclk_gate", "hclk", CCM_PCCR0, 26);
-	clk[IMX21_CLK_EMMA_HCLK_GATE] = imx_clk_gate("emma_hclk_gate", "hclk", CCM_PCCR0, 27);
-	clk[IMX21_CLK_BROM_GATE] = imx_clk_gate("brom_gate", "hclk", CCM_PCCR0, 28);
-	clk[IMX21_CLK_DMA_HCLK_GATE] = imx_clk_gate("dma_hclk_gate", "hclk", CCM_PCCR0, 30);
-	clk[IMX21_CLK_CSI_HCLK_GATE] = imx_clk_gate("csi_hclk_gate", "hclk", CCM_PCCR0, 31);
-
-	clk[IMX21_CLK_CSPI3_IPG_GATE] = imx_clk_gate("cspi3_ipg_gate", "ipg", CCM_PCCR1, 23);
-	clk[IMX21_CLK_WDOG_GATE] = imx_clk_gate("wdog_gate", "ipg", CCM_PCCR1, 24);
-	clk[IMX21_CLK_GPT1_IPG_GATE] = imx_clk_gate("gpt1_ipg_gate", "ipg", CCM_PCCR1, 25);
-	clk[IMX21_CLK_GPT2_IPG_GATE] = imx_clk_gate("gpt2_ipg_gate", "ipg", CCM_PCCR1, 26);
-	clk[IMX21_CLK_GPT3_IPG_GATE] = imx_clk_gate("gpt3_ipg_gate", "ipg", CCM_PCCR1, 27);
-	clk[IMX21_CLK_PWM_IPG_GATE] = imx_clk_gate("pwm_ipg_gate", "ipg", CCM_PCCR1, 28);
-	clk[IMX21_CLK_RTC_GATE] = imx_clk_gate("rtc_gate", "ipg", CCM_PCCR1, 29);
-	clk[IMX21_CLK_KPP_GATE] = imx_clk_gate("kpp_gate", "ipg", CCM_PCCR1, 30);
-	clk[IMX21_CLK_OWIRE_GATE] = imx_clk_gate("owire_gate", "ipg", CCM_PCCR1, 31);
-
-	imx_check_clocks(clk, ARRAY_SIZE(clk));
-}
-
-int __init mx21_clocks_init(unsigned long lref, unsigned long href)
-{
-	ccm = ioremap(MX21_CCM_BASE_ADDR, SZ_2K);
-
-	_mx21_clocks_init(lref, href);
-
-	clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.0");
-	clk_register_clkdev(clk[IMX21_CLK_UART1_IPG_GATE], "ipg", "imx21-uart.0");
-	clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.1");
-	clk_register_clkdev(clk[IMX21_CLK_UART2_IPG_GATE], "ipg", "imx21-uart.1");
-	clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.2");
-	clk_register_clkdev(clk[IMX21_CLK_UART3_IPG_GATE], "ipg", "imx21-uart.2");
-	clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.3");
-	clk_register_clkdev(clk[IMX21_CLK_UART4_IPG_GATE], "ipg", "imx21-uart.3");
-	clk_register_clkdev(clk[IMX21_CLK_GPT1_IPG_GATE], "ipg", "imx-gpt.0");
-	clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx-gpt.0");
-	clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.0");
-	clk_register_clkdev(clk[IMX21_CLK_CSPI1_IPG_GATE], "ipg", "imx21-cspi.0");
-	clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.1");
-	clk_register_clkdev(clk[IMX21_CLK_CSPI2_IPG_GATE], "ipg", "imx21-cspi.1");
-	clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.2");
-	clk_register_clkdev(clk[IMX21_CLK_CSPI3_IPG_GATE], "ipg", "imx21-cspi.2");
-	clk_register_clkdev(clk[IMX21_CLK_PER3], "per", "imx21-fb.0");
-	clk_register_clkdev(clk[IMX21_CLK_LCDC_IPG_GATE], "ipg", "imx21-fb.0");
-	clk_register_clkdev(clk[IMX21_CLK_LCDC_HCLK_GATE], "ahb", "imx21-fb.0");
-	clk_register_clkdev(clk[IMX21_CLK_USB_GATE], "per", "imx21-hcd.0");
-	clk_register_clkdev(clk[IMX21_CLK_USB_HCLK_GATE], "ahb", "imx21-hcd.0");
-	clk_register_clkdev(clk[IMX21_CLK_NFC_GATE], NULL, "imx21-nand.0");
-	clk_register_clkdev(clk[IMX21_CLK_DMA_HCLK_GATE], "ahb", "imx21-dma");
-	clk_register_clkdev(clk[IMX21_CLK_DMA_GATE], "ipg", "imx21-dma");
-	clk_register_clkdev(clk[IMX21_CLK_WDOG_GATE], NULL, "imx2-wdt.0");
-	clk_register_clkdev(clk[IMX21_CLK_I2C_GATE], NULL, "imx21-i2c.0");
-	clk_register_clkdev(clk[IMX21_CLK_OWIRE_GATE], NULL, "mxc_w1.0");
-
-	mxc_timer_init(MX21_GPT1_BASE_ADDR, MX21_INT_GPT1, GPT_TYPE_IMX21);
-
-	return 0;
-}
-
-static void __init mx21_clocks_init_dt(struct device_node *np)
-{
-	ccm = of_iomap(np, 0);
-
-	_mx21_clocks_init(32768, 26000000);
-
-	clk_data.clks = clk;
-	clk_data.clk_num = ARRAY_SIZE(clk);
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-}
-CLK_OF_DECLARE(imx27_ccm, "fsl,imx21-ccm", mx21_clocks_init_dt);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree
  2020-09-16 20:55 ` [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree Fabio Estevam
@ 2020-09-16 21:30   ` Arnd Bergmann
  2020-09-16 21:36     ` Fabio Estevam
  0 siblings, 1 reply; 23+ messages in thread
From: Arnd Bergmann @ 2020-09-16 21:30 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Linux ARM, Shawn Guo, NXP Linux Team, Sascha Hauer

On Wed, Sep 16, 2020 at 10:55 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Now that imx27 has been converted to a devicetree-only platform,
> retrieve the SYSCTRL base address from devicetree.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

While this is nicer in theory, I don't like the way it breaks compatibility
with old dtb files that are lacking the device node.

What is the status of dtb stability otherwise on imx? My impression
was that it is actually quite good about not breaking this way.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-16 20:55 ` [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros Fabio Estevam
@ 2020-09-16 21:34   ` Arnd Bergmann
  2020-09-16 21:56     ` Fabio Estevam
  0 siblings, 1 reply; 23+ messages in thread
From: Arnd Bergmann @ 2020-09-16 21:34 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Linux ARM, Shawn Guo, NXP Linux Team, Sascha Hauer

On Wed, Sep 16, 2020 at 10:56 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> The IO_ADDRESS() macros were used to retrieve the peripherals
> base address for board related code.
>
> Now that i.MX is a devicetree-only platforms, all base addresses are
> retrieved from devicetree and these macros are unused.
>
> Remove the unused IO_ADDRESS() macros.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  arch/arm/mach-imx/mx27.h | 1 -
>  arch/arm/mach-imx/mx31.h | 1 -
>  arch/arm/mach-imx/mx35.h | 1 -
>  3 files changed, 3 deletions(-)
>
> diff --git a/arch/arm/mach-imx/mx27.h b/arch/arm/mach-imx/mx27.h
> index c6f7aae02b67..d6dae9fa8610 100644
> --- a/arch/arm/mach-imx/mx27.h
> +++ b/arch/arm/mach-imx/mx27.h
> @@ -112,7 +112,6 @@
>  #define MX27_IRAM_BASE_ADDR            0xffff4c00      /* internal ram */
>
>  #define MX27_IO_P2V(x)                 IMX_IO_P2V(x)
> -#define MX27_IO_ADDRESS(x)             IOMEM(MX27_IO_P2V(x))

As far as I can tell, the MX27_IO_P2V() macro should be removed here as
well if MX27_IO_ADDRESS() gets removed.

What about the other constants in these files? Are there any remaining
references to the MX*_BASE_ADDRESS, MX*_INT_*, and MX*_DMA_REQ_*
constants after the series?

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree
  2020-09-16 21:30   ` Arnd Bergmann
@ 2020-09-16 21:36     ` Fabio Estevam
  0 siblings, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 21:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Linux ARM, Shawn Guo, NXP Linux Team, Sascha Hauer

Hi Arnd,

On Wed, Sep 16, 2020 at 6:30 PM Arnd Bergmann <arnd@arndb.de> wrote:

> While this is nicer in theory, I don't like the way it breaks compatibility
> with old dtb files that are lacking the device node.

Good point. Let me access this SYSCTRL region via the CCM register space then.

In the current devicetree CCM region already overlaps with the SYSCTRL region.

This way we don't break dt compatibility.

> What is the status of dtb stability otherwise on imx? My impression
> was that it is actually quite good about not breaking this way.

Yes, we try to keep dt compatibility as much as possible.

Thanks

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-16 21:34   ` Arnd Bergmann
@ 2020-09-16 21:56     ` Fabio Estevam
  2020-09-17  7:16       ` Arnd Bergmann
  0 siblings, 1 reply; 23+ messages in thread
From: Fabio Estevam @ 2020-09-16 21:56 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Linux ARM, Shawn Guo, NXP Linux Team, Sascha Hauer

Hi Arnd,

On Wed, Sep 16, 2020 at 6:35 PM Arnd Bergmann <arnd@arndb.de> wrote:

> As far as I can tell, the MX27_IO_P2V() macro should be removed here as
> well if MX27_IO_ADDRESS() gets removed.

The MX27_IO_P2V() macro is still used. Here is the error when I try to
remove it:

In file included from arch/arm/mach-imx/mach-imx27.c:17:0:
arch/arm/mach-imx/mach-imx27.c:30:16: error: implicit declaration of
function ‘MX27_IO_P2V’; did you mean ‘MX35_IO_P2V’?
[-Werror=implicit-function-declaration]
  imx_map_entry(MX27, AIPI, MT_DEVICE),
                ^
arch/arm/mach-imx/hardware.h:103:13: note: in definition of macro
‘imx_map_entry’
  .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \
             ^~~
arch/arm/mach-imx/mach-imx27.c:30:16: error: initializer element is not constant
  imx_map_entry(MX27, AIPI, MT_DEVICE),

> What about the other constants in these files? Are there any remaining
> references to the MX*_BASE_ADDRESS, MX*_INT_*, and MX*_DMA_REQ_*
> constants after the series?

Some of these can go away. I will remove what is possible in v2.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-16 21:56     ` Fabio Estevam
@ 2020-09-17  7:16       ` Arnd Bergmann
  2020-09-17 10:17         ` Fabio Estevam
  2020-09-29 13:11         ` Linus Walleij
  0 siblings, 2 replies; 23+ messages in thread
From: Arnd Bergmann @ 2020-09-17  7:16 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Linux ARM, Linus Walleij, Shawn Guo, NXP Linux Team, Sascha Hauer

On Wed, Sep 16, 2020 at 11:56 PM Fabio Estevam <festevam@gmail.com> wrote:
> On Wed, Sep 16, 2020 at 6:35 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> > As far as I can tell, the MX27_IO_P2V() macro should be removed here as
> > well if MX27_IO_ADDRESS() gets removed.
>
> The MX27_IO_P2V() macro is still used. Here is the error when I try to
> remove it:
>
> In file included from arch/arm/mach-imx/mach-imx27.c:17:0:
> arch/arm/mach-imx/mach-imx27.c:30:16: error: implicit declaration of
> function ‘MX27_IO_P2V’; did you mean ‘MX35_IO_P2V’?
> [-Werror=implicit-function-declaration]
>   imx_map_entry(MX27, AIPI, MT_DEVICE),
>                 ^
> arch/arm/mach-imx/hardware.h:103:13: note: in definition of macro
> ‘imx_map_entry’
>   .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \

Ah, right. My grep did not catch the static mappings:

arch/arm/mach-imx/mm-imx21.c-/* MX21 memory map definition */
arch/arm/mach-imx/mm-imx21.c-static struct map_desc imx21_io_desc[]
__initdata = {
arch/arm/mach-imx/mm-imx21.c:   imx_map_entry(MX21, AIPI, MT_DEVICE),
arch/arm/mach-imx/mm-imx21.c:   imx_map_entry(MX21, SAHB1, MT_DEVICE),
arch/arm/mach-imx/mm-imx21.c:   imx_map_entry(MX21, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx21.c-};
--
arch/arm/mach-imx/mm-imx27.c-/* MX27 memory map definition */
arch/arm/mach-imx/mm-imx27.c-static struct map_desc imx27_io_desc[]
__initdata = {
arch/arm/mach-imx/mm-imx27.c:   imx_map_entry(MX27, AIPI, MT_DEVICE),
arch/arm/mach-imx/mm-imx27.c:   imx_map_entry(MX27, SAHB1, MT_DEVICE),
arch/arm/mach-imx/mm-imx27.c:   imx_map_entry(MX27, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx27.c-};
--
arch/arm/mach-imx/mm-imx3.c-static struct map_desc mx31_io_desc[] __initdata = {
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, AIPS1, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, AIPS2, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX31, SPBA0, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c-};
--
arch/arm/mach-imx/mm-imx3.c-#ifdef CONFIG_SOC_IMX35
arch/arm/mach-imx/mm-imx3.c-static struct map_desc mx35_io_desc[] __initdata = {
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, X_MEMC, MT_DEVICE),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c:    imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED),
arch/arm/mach-imx/mm-imx3.c-};

If all of the devices in here are now also mapped using of_iomap() or
ioremap(), then the iotables are not strictly needed any more, but most
of them are 1MB section sized, which helps slightly reduce TLB usage
compared to non-section ioremap() mappings, so we might want to
keep them anyway, possibly with the constants moved from the header
into the mm-imx??.c files.

Adding Linus to Cc for further thoughts, as he was looking at the early
io mappings recently.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-17  7:16       ` Arnd Bergmann
@ 2020-09-17 10:17         ` Fabio Estevam
  2020-09-29 13:11         ` Linus Walleij
  1 sibling, 0 replies; 23+ messages in thread
From: Fabio Estevam @ 2020-09-17 10:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linux ARM, Linus Walleij, Shawn Guo, NXP Linux Team, Sascha Hauer

Hi Arnd,

On Thu, Sep 17, 2020 at 4:16 AM Arnd Bergmann <arnd@arndb.de> wrote:

> If all of the devices in here are now also mapped using of_iomap() or
> ioremap(), then the iotables are not strictly needed any more, but most
> of them are 1MB section sized, which helps slightly reduce TLB usage
> compared to non-section ioremap() mappings, so we might want to
> keep them anyway, possibly with the constants moved from the header
> into the mm-imx??.c files.

Yes, I can move the definitions to the mm-imx files as a follow-up
patch after this series gets applied.

Thanks,

Fabio Estevam

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-17  7:16       ` Arnd Bergmann
  2020-09-17 10:17         ` Fabio Estevam
@ 2020-09-29 13:11         ` Linus Walleij
  2020-09-29 13:21           ` Arnd Bergmann
  1 sibling, 1 reply; 23+ messages in thread
From: Linus Walleij @ 2020-09-29 13:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linux ARM, Shawn Guo, Fabio Estevam, NXP Linux Team, Sascha Hauer

On Thu, Sep 17, 2020 at 9:16 AM Arnd Bergmann <arnd@arndb.de> wrote:

> If all of the devices in here are now also mapped using of_iomap() or
> ioremap(), then the iotables are not strictly needed any more, but most
> of them are 1MB section sized, which helps slightly reduce TLB usage
> compared to non-section ioremap() mappings, so we might want to
> keep them anyway, possibly with the constants moved from the header
> into the mm-imx??.c files.
>
> Adding Linus to Cc for further thoughts, as he was looking at the early
> io mappings recently.

There is early fixmap which I think should replace the iotables
completely if we can, since it is generic kernel code. I was meaning
to look into this "at some point".

The early fixmap seems to be page (0x1000) based so the iotables
might be more efficient if using 1MB sections but I doubt that it is
worth it.

The fixmaps are converted to proper ioremaps (at the exact same
virtual address) later during boot.

At least that is how it looks to me :D

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-29 13:11         ` Linus Walleij
@ 2020-09-29 13:21           ` Arnd Bergmann
  2020-09-30  9:34             ` Linus Walleij
  0 siblings, 1 reply; 23+ messages in thread
From: Arnd Bergmann @ 2020-09-29 13:21 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Linux ARM, Shawn Guo, Fabio Estevam, NXP Linux Team, Sascha Hauer

On Tue, Sep 29, 2020 at 3:11 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Thu, Sep 17, 2020 at 9:16 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> > If all of the devices in here are now also mapped using of_iomap() or
> > ioremap(), then the iotables are not strictly needed any more, but most
> > of them are 1MB section sized, which helps slightly reduce TLB usage
> > compared to non-section ioremap() mappings, so we might want to
> > keep them anyway, possibly with the constants moved from the header
> > into the mm-imx??.c files.
> >
> > Adding Linus to Cc for further thoughts, as he was looking at the early
> > io mappings recently.
>
> There is early fixmap which I think should replace the iotables
> completely if we can, since it is generic kernel code. I was meaning
> to look into this "at some point".
>
> The early fixmap seems to be page (0x1000) based so the iotables
> might be more efficient if using 1MB sections but I doubt that it is
> worth it.

As far as I can tell, the 1MB section maps are the only reason
this exists, as all of them are actually ioremap()ed later on before
use.

I don't know if it makes a difference to real-world performance.
Note that there are only 64 TLB entries on ARM926, or 128 on
ARM1136, so avoiding the lookup/eviction at least theoretically
should be measurably faster.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros
  2020-09-29 13:21           ` Arnd Bergmann
@ 2020-09-30  9:34             ` Linus Walleij
  0 siblings, 0 replies; 23+ messages in thread
From: Linus Walleij @ 2020-09-30  9:34 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linux ARM, Shawn Guo, Fabio Estevam, NXP Linux Team, Sascha Hauer

On Tue, Sep 29, 2020 at 3:22 PM Arnd Bergmann <arnd@arndb.de> wrote:
> On Tue, Sep 29, 2020 at 3:11 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Thu, Sep 17, 2020 at 9:16 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > > If all of the devices in here are now also mapped using of_iomap() or
> > > ioremap(), then the iotables are not strictly needed any more, but most
> > > of them are 1MB section sized, which helps slightly reduce TLB usage
> > > compared to non-section ioremap() mappings, so we might want to
> > > keep them anyway, possibly with the constants moved from the header
> > > into the mm-imx??.c files.
> > >
> > > Adding Linus to Cc for further thoughts, as he was looking at the early
> > > io mappings recently.
> >
> > There is early fixmap which I think should replace the iotables
> > completely if we can, since it is generic kernel code. I was meaning
> > to look into this "at some point".
> >
> > The early fixmap seems to be page (0x1000) based so the iotables
> > might be more efficient if using 1MB sections but I doubt that it is
> > worth it.
>
> As far as I can tell, the 1MB section maps are the only reason
> this exists, as all of them are actually ioremap()ed later on before
> use.
>
> I don't know if it makes a difference to real-world performance.
> Note that there are only 64 TLB entries on ARM926, or 128 on
> ARM1136, so avoiding the lookup/eviction at least theoretically
> should be measurably faster.

Hm someone should benchmark this. If this is the case we are
kind of "punishing" all the all-out device tree platforms. It would
make sense to then support an optional 1MB section mapping
and make some of the crucial remaps (of_iomap_hot_io or
something), such as for the timer and
interrupt controllers, use this by default since they are on the
very-hot path.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-09-30  9:35 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
2020-09-16 20:55 ` [PATCH 01/13] ARM: dts: imx27: Fix the register range for CCM Fabio Estevam
2020-09-16 20:55 ` [PATCH 02/13] ARM: dts: imx27: Add the SYSCTRL description Fabio Estevam
2020-09-16 20:55 ` [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree Fabio Estevam
2020-09-16 21:30   ` Arnd Bergmann
2020-09-16 21:36     ` Fabio Estevam
2020-09-16 20:55 ` [PATCH 04/13] ARM: imx27: Retrieve the CCM " Fabio Estevam
2020-09-16 20:55 ` [PATCH 05/13] ARM: imx31: Retrieve the IIM " Fabio Estevam
2020-09-16 20:55 ` [PATCH 06/13] ARM: imx3: Retrieve the CCM " Fabio Estevam
2020-09-16 20:55 ` [PATCH 07/13] ARM: imx3: Retrieve the AVIC " Fabio Estevam
2020-09-16 20:55 ` [PATCH 08/13] ARM: imx35: Retrieve the IIM " Fabio Estevam
2020-09-16 20:55 ` [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros Fabio Estevam
2020-09-16 21:34   ` Arnd Bergmann
2020-09-16 21:56     ` Fabio Estevam
2020-09-17  7:16       ` Arnd Bergmann
2020-09-17 10:17         ` Fabio Estevam
2020-09-29 13:11         ` Linus Walleij
2020-09-29 13:21           ` Arnd Bergmann
2020-09-30  9:34             ` Linus Walleij
2020-09-16 20:55 ` [PATCH 10/13] clk: imx: imx27: Remove mx27_clocks_init() Fabio Estevam
2020-09-16 20:55 ` [PATCH 11/13] clk: imx: imx31: Remove mx31_clocks_init() Fabio Estevam
2020-09-16 20:55 ` [PATCH 12/13] clk: imx: imx35: Remove mx35_clocks_init() Fabio Estevam
2020-09-16 20:55 ` [PATCH 13/13] clk: imx: imx21: Remove clock driver Fabio Estevam

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