From: Alexander Shiyan <shc_work@mail.ru>
To: linux-arm-kernel@lists.infradead.org
Cc: Alexander Shiyan <shc_work@mail.ru>,
Russell King <linux@armlinux.org.uk>,
NXP Linux Team <linux-imx@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <fabio.estevam@nxp.com>,
Shawn Guo <shawnguo@kernel.org>
Subject: [PATCH 2/6] ARM i.MX21: Add devicetree support
Date: Sat, 22 Dec 2018 13:51:56 +0300 [thread overview]
Message-ID: <20181222105200.18502-2-shc_work@mail.ru> (raw)
In-Reply-To: <20181222105200.18502-1-shc_work@mail.ru>
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
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2018-12-22 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-22 10:51 [PATCH 1/6] ARM: dts: imx21: add i.MX21 SoC device tree Alexander Shiyan
2018-12-22 10:51 ` Alexander Shiyan [this message]
2019-01-12 2:53 ` [PATCH 2/6] ARM i.MX21: Add devicetree support Shawn Guo
2019-01-12 5:17 ` Alexander Shiyan
2019-01-12 7:04 ` Shawn Guo
2018-12-22 10:51 ` [PATCH 3/6] ARM: dts: imx21: Add support for the i.MX21 Freescale ADS board Alexander Shiyan
2018-12-22 10:51 ` [PATCH 4/6] ARM: i.MX: Remove i.MX21 Freescale ADS board support Alexander Shiyan
2018-12-22 10:51 ` [PATCH 5/6] ARM: i.MX: Move SOC_IMX21 into 'Device tree only' Alexander Shiyan
2018-12-22 10:52 ` [PATCH 6/6] ARM: i.MX: Remove i.MX21 non-DT device registration helpers Alexander Shiyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181222105200.18502-2-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=fabio.estevam@nxp.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux@armlinux.org.uk \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.