diff mbox series

[2/6] ARM i.MX21: Add devicetree support

Message ID 20181222105200.18502-2-shc_work@mail.ru
State New
Headers show
Series None | expand

Commit Message

Alexander Shiyan Dec. 22, 2018, 10:51 a.m. UTC
This patch adds basic devicetree support for i.MX21 based SoCs.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/mach-imx/Kconfig      |  7 +++++++
 arch/arm/mach-imx/Makefile     |  1 +
 arch/arm/mach-imx/mach-imx21.c | 31 +++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 arch/arm/mach-imx/mach-imx21.c

Comments

Shawn Guo Jan. 12, 2019, 2:53 a.m. UTC | #1
On Sat, Dec 22, 2018 at 01:51:56PM +0300, Alexander Shiyan wrote:
> This patch adds basic devicetree support for i.MX21 based SoCs.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

What i.MX21 board are you running devicetree support on?

Shawn

> ---
>  arch/arm/mach-imx/Kconfig      |  7 +++++++
>  arch/arm/mach-imx/Makefile     |  1 +
>  arch/arm/mach-imx/mach-imx21.c | 31 +++++++++++++++++++++++++++++++
>  3 files changed, 39 insertions(+)
>  create mode 100644 arch/arm/mach-imx/mach-imx21.c
> 
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index abc3371..abf3c0d 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -91,6 +91,13 @@ config MACH_MX21ADS
>  	  Include support for MX21ADS platform. This includes specific
>  	  configurations for the board and its peripherals.
>  
> +config MACH_IMX21_DT
> +	bool "Support i.MX21 platforms from device tree"
> +	select SOC_IMX21
> +	help
> +	  Include support for Freescale i.MX21 based platforms
> +	  using the device tree for discovery
> +
>  comment "MX27 platforms:"
>  
>  config MACH_MX27ADS
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index bae179a..52a9138 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -38,6 +38,7 @@ endif
>  
>  # i.MX21 based machines
>  obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
> +obj-$(CONFIG_MACH_IMX21_DT) += mach-imx21.o
>  
>  # i.MX27 based machines
>  obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o
> diff --git a/arch/arm/mach-imx/mach-imx21.c b/arch/arm/mach-imx/mach-imx21.c
> new file mode 100644
> index 0000000..7eb7de0
> --- /dev/null
> +++ b/arch/arm/mach-imx/mach-imx21.c
> @@ -0,0 +1,31 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/* Author: Alexander Shiyan <shc_work@mail.ru> */
> +
> +#include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
> +#include <linux/of_platform.h>
> +
> +#include "common.h"
> +#include "hardware.h"
> +
> +#define MX21_AVIC_ADDR	0x10040000
> +
> +static void __init imx21_init_irq(void)
> +{
> +	void __iomem *avic = ioremap(MX21_AVIC_ADDR, SZ_4K);
> +
> +	WARN_ON(!avic);
> +
> +	mxc_init_irq(avic);
> +}
> +
> +static const char * const imx21_dt_board_compat[] __initconst = {
> +	"fsl,imx21",
> +	NULL
> +};
> +
> +DT_MACHINE_START(IMX21_DT, "Freescale i.MX21 (Device Tree Support)")
> +	.init_early	= imx21_init_early,
> +	.init_irq	= imx21_init_irq,
> +	.dt_compat	= imx21_dt_board_compat,
> +MACHINE_END
> -- 
> 2.10.2
>
Alexander Shiyan Jan. 12, 2019, 5:17 a.m. UTC | #2
Hello.

>Суббота, 12 января 2019, 5:53 +03:00 от Shawn Guo <shawnguo@kernel.org>:
>
>On Sat, Dec 22, 2018 at 01:51:56PM +0300, Alexander Shiyan wrote:
>> This patch adds basic devicetree support for i.MX21 based SoCs.
>> 
>> Signed-off-by: Alexander Shiyan < shc_work@mail.ru >
>What i.MX21 board are you running devicetree support on?

I don't have any hardware for o.MX21 SoC.
Have any comments or something wrong?

---
Shawn Guo Jan. 12, 2019, 7:04 a.m. UTC | #3
On Sat, Jan 12, 2019 at 08:17:04AM +0300, Alexander Shiyan wrote:
> Hello.
> 
> >Суббота, 12 января 2019, 5:53 +03:00 от Shawn Guo <shawnguo@kernel.org>:
> >
> >On Sat, Dec 22, 2018 at 01:51:56PM +0300, Alexander Shiyan wrote:
> >> This patch adds basic devicetree support for i.MX21 based SoCs.
> >> 
> >> Signed-off-by: Alexander Shiyan < shc_work@mail.ru >
> >What i.MX21 board are you running devicetree support on?
> 
> I don't have any hardware for o.MX21 SoC.
> Have any comments or something wrong?

If there is no real users for the hardware, I would leave it as it is
and rather not add new code for it.

Shawn
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index abc3371..abf3c0d 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -91,6 +91,13 @@  config MACH_MX21ADS
 	  Include support for MX21ADS platform. This includes specific
 	  configurations for the board and its peripherals.
 
+config MACH_IMX21_DT
+	bool "Support i.MX21 platforms from device tree"
+	select SOC_IMX21
+	help
+	  Include support for Freescale i.MX21 based platforms
+	  using the device tree for discovery
+
 comment "MX27 platforms:"
 
 config MACH_MX27ADS
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index bae179a..52a9138 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -38,6 +38,7 @@  endif
 
 # i.MX21 based machines
 obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
+obj-$(CONFIG_MACH_IMX21_DT) += mach-imx21.o
 
 # i.MX27 based machines
 obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o
diff --git a/arch/arm/mach-imx/mach-imx21.c b/arch/arm/mach-imx/mach-imx21.c
new file mode 100644
index 0000000..7eb7de0
--- /dev/null
+++ b/arch/arm/mach-imx/mach-imx21.c
@@ -0,0 +1,31 @@ 
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Author: Alexander Shiyan <shc_work@mail.ru> */
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <linux/of_platform.h>
+
+#include "common.h"
+#include "hardware.h"
+
+#define MX21_AVIC_ADDR	0x10040000
+
+static void __init imx21_init_irq(void)
+{
+	void __iomem *avic = ioremap(MX21_AVIC_ADDR, SZ_4K);
+
+	WARN_ON(!avic);
+
+	mxc_init_irq(avic);
+}
+
+static const char * const imx21_dt_board_compat[] __initconst = {
+	"fsl,imx21",
+	NULL
+};
+
+DT_MACHINE_START(IMX21_DT, "Freescale i.MX21 (Device Tree Support)")
+	.init_early	= imx21_init_early,
+	.init_irq	= imx21_init_irq,
+	.dt_compat	= imx21_dt_board_compat,
+MACHINE_END