From: Tomasz Figa <tomasz.figa@gmail.com>
To: linux-samsung-soc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
devicetree-discuss@lists.ozlabs.org, kgene.kim@samsung.com,
broonie@opensource.wolfsonmicro.com, kwangwoo.lee@gmail.com,
jacmet@sunsite.dk, augulis.darius@gmail.com,
mcuelenaere@gmail.com, linux@arm.linux.org.uk,
Rob Herring <robherring2@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
Tomasz Figa <tomasz.figa@gmail.com>
Subject: [PATCH v5 4/6] ARM: s3c64xx: Add board file for boot using Device Tree
Date: Mon, 15 Apr 2013 23:14:41 +0200 [thread overview]
Message-ID: <1366060483-20342-5-git-send-email-tomasz.figa@gmail.com> (raw)
In-Reply-To: <1366060483-20342-1-git-send-email-tomasz.figa@gmail.com>
This patch adds board file that will be used to boot S3C64xx-based boards
using Device Tree.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
arch/arm/mach-s3c64xx/Kconfig | 16 +++++++
arch/arm/mach-s3c64xx/Makefile | 1 +
arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 83 +++++++++++++++++++++++++++++++++
3 files changed, 100 insertions(+)
create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 283cb77..184d53c 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -311,3 +311,19 @@ config MACH_WLF_CRAGG_6410
select SAMSUNG_GPIO_EXTRA128
help
Machine support for the Wolfson Cragganmore S3C6410 variant.
+
+config MACH_S3C64XX_DT
+ bool "Samsung S3C6400/S3C6410 machine using Device Tree"
+ select CLKSRC_OF
+ select CPU_S3C6400
+ select CPU_S3C6410
+ select PINCTRL
+ select PINCTRL_S3C64XX
+ select USE_OF
+ help
+ Machine support for Samsung S3C6400/S3C6410 machines with Device Tree
+ enabled.
+ Select this if a fdt blob is available for your S3C64XX SoC based
+ board.
+ Note: This is under development and not all peripherals can be
+ supported with this machine file.
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 31d0c91..5e5eb4b 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -57,3 +57,4 @@ obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o
obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o
+obj-$(CONFIG_MACH_S3C64XX_DT) += mach-s3c64xx-dt.o
diff --git a/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
new file mode 100644
index 0000000..10b76cc
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
@@ -0,0 +1,83 @@
+/*
+ * Samsung's S3C64XX flattened device tree enabled machine
+ *
+ * Copyright (c) 2013 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/clocksource.h>
+#include <linux/irqchip.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/arch.h>
+#include <mach/map.h>
+
+#include <plat/cpu.h>
+#include <plat/regs-serial.h>
+
+#include "common.h"
+
+/*
+ * The following lookup table is used to override device names when devices
+ * are registered from device tree. This is temporarily added to enable
+ * device tree support addition for the S3C64xx architecture.
+ *
+ * For drivers that require platform data to be provided from the machine
+ * file, a platform data pointer can also be supplied along with the
+ * devices names. Usually, the platform data elements that cannot be parsed
+ * from the device tree by the drivers (example: function pointers) are
+ * supplied. But it should be noted that this is a temporary mechanism and
+ * at some point, the drivers should be capable of parsing all the platform
+ * data from the device tree.
+ */
+static const struct of_dev_auxdata s3c64xx_auxdata_lookup[] __initconst = {
+ OF_DEV_AUXDATA("samsung,s3c6400-uart", 0x7f005000,
+ "s3c6400-uart.0", NULL),
+ OF_DEV_AUXDATA("samsung,s3c6400-uart", 0x7f005400,
+ "s3c6400-uart.1", NULL),
+ OF_DEV_AUXDATA("samsung,s3c6400-uart", 0x7f005800,
+ "s3c6400-uart.2", NULL),
+ OF_DEV_AUXDATA("samsung,s3c6400-uart", 0x7f005c00,
+ "s3c6400-uart.3", NULL),
+ OF_DEV_AUXDATA("samsung,s3c6410-sdhci", 0x7c200000,
+ "s3c-sdhci.0", NULL),
+ OF_DEV_AUXDATA("samsung,s3c6410-sdhci", 0x7c300000,
+ "s3c-sdhci.1", NULL),
+ OF_DEV_AUXDATA("samsung,s3c6410-sdhci", 0x7c400000,
+ "s3c-sdhci.2", NULL),
+ {},
+};
+
+static void __init s3c64xx_dt_map_io(void)
+{
+ s3c64xx_init_io(NULL, 0);
+ s3c24xx_init_clocks(12000000);
+}
+
+static void __init s3c64xx_dt_machine_init(void)
+{
+ of_platform_populate(NULL, of_default_bus_match_table,
+ s3c64xx_auxdata_lookup, NULL);
+}
+
+static char const *s3c64xx_dt_compat[] __initdata = {
+ "samsung,s3c6400",
+ "samsung,s3c6410",
+ NULL
+};
+
+DT_MACHINE_START(S3C6400_DT, "Samsung S3C64xx (Flattened Device Tree)")
+ /* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
+ .init_irq = irqchip_init,
+ .map_io = s3c64xx_dt_map_io,
+ .init_machine = s3c64xx_dt_machine_init,
+ .init_late = s3c64xx_init_late,
+ .init_time = clocksource_of_init,
+ .dt_compat = s3c64xx_dt_compat,
+ .restart = s3c64xx_restart,
+MACHINE_END
--
1.8.1.5
next prev parent reply other threads:[~2013-04-15 21:14 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 21:14 [PATCH v5 0/6] Initial Device Tree support for S3C64xx Tomasz Figa
2013-04-15 21:14 ` [PATCH v5 1/6] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
2013-04-15 21:14 ` [PATCH v5 2/6] ARM: s3c64xx: Skip legacy EINT setup if pinctrl-s3c64xx driver is present Tomasz Figa
2013-04-16 16:26 ` Mark Brown
2013-04-16 22:31 ` Tomasz Figa
2013-04-16 22:43 ` [PATCH v6 " Tomasz Figa
2013-04-15 21:14 ` [PATCH v5 3/6] gpio: samsung: Skip legacy GPIO registration if pinctrl-s3c64xx " Tomasz Figa
2013-04-16 16:27 ` Mark Brown
2013-04-16 22:35 ` Tomasz Figa
2013-04-17 13:06 ` Mark Brown
2013-04-23 14:33 ` Kukjin Kim
2013-04-15 21:14 ` Tomasz Figa [this message]
2013-04-15 21:14 ` [PATCH v5 5/6] ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs Tomasz Figa
2013-04-16 13:09 ` Rob Herring
2013-04-16 13:19 ` Tomasz Figa
2013-04-17 17:46 ` Rob Herring
2013-04-23 14:29 ` Kukjin Kim
2013-04-23 14:44 ` Tomasz Figa
2013-04-23 14:48 ` Kukjin Kim
2013-04-15 21:14 ` [PATCH v5 6/6] ARM: dts: Add dts file for S3C6410-based Mini6410 board Tomasz Figa
2013-04-16 16:33 ` [PATCH v5 0/6] Initial Device Tree support for S3C64xx Mark Brown
2013-04-16 22:23 ` [PATCH 1/2] pinctrl: s3c64xx: Fix build error caused by undefined chained_irq_enter Tomasz Figa
2013-04-16 22:24 ` [PATCH 2/2] pinctrl: samsung: Fix link error with CONFIG_PINCTRL_EXYNOS disabled Tomasz Figa
2013-04-23 12:03 ` Linus Walleij
2013-04-23 12:09 ` Tomasz Figa
2013-04-24 14:27 ` Linus Walleij
2013-04-24 14:47 ` Tomasz Figa
2013-04-25 13:26 ` Linus Walleij
2013-04-16 22:29 ` [PATCH RESEND " Tomasz Figa
2013-04-23 12:00 ` [PATCH 1/2] pinctrl: s3c64xx: Fix build error caused by undefined chained_irq_enter Linus Walleij
2013-04-17 13:08 ` [PATCH v5 0/6] Initial Device Tree support for S3C64xx Mark Brown
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=1366060483-20342-5-git-send-email-tomasz.figa@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=augulis.darius@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=jacmet@sunsite.dk \
--cc=kgene.kim@samsung.com \
--cc=kwangwoo.lee@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mcuelenaere@gmail.com \
--cc=robherring2@gmail.com \
/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 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).