Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdc3df6f authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge branch 'dt-part2' of...

Merge branch 'dt-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt

* 'dt-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  arm/dts: mt_ventoux: very basic support for TeeJet Mt.Ventoux board
  ARM: OMAP2+: Remove extra ifdefs for board-generic
  ARM: OMAP2+: Fix build error when only ARCH_OMAP2/3 or 4 is selected
  ARM: OMAP2+: board-generic: Use of_irq_init API
  arm/dts: OMAP3: Add interrupt-controller bindings for INTC
  ARM: OMAP2/3: intc: Add DT support for TI interrupt controller
parents a58f67e7 328ae2cb
Loading
Loading
Loading
Loading
+27 −0
Original line number Original line Diff line number Diff line
* OMAP Interrupt Controller

OMAP2/3 are using a TI interrupt controller that can support several
configurable number of interrupts.

Main node required properties:

- compatible : should be:
	"ti,omap2-intc"
- interrupt-controller : Identifies the node as an interrupt controller
- #interrupt-cells : Specifies the number of cells needed to encode an
  interrupt source. The type shall be a <u32> and the value shall be 1.

  The cell contains the interrupt number in the range [0-128].
- ti,intc-size: Number of interrupts handled by the interrupt controller.
- reg: physical base address and size of the intc registers map.

Example:

	intc: interrupt-controller@1 {
		compatible = "ti,omap2-intc";
		interrupt-controller;
		#interrupt-cells = <1>;
		ti,intc-size = <96>;
		reg = <0x48200000 0x1000>;
	};
+27 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2011 Ilya Yanok, EmCraft Systems
 *
 * 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.
 */
/dts-v1/;

/include/ "omap3.dtsi"

/ {
	model = "TeeJet Mt.Ventoux";
	compatible = "teejet,mt_ventoux", "ti,omap3";

	memory {
		device_type = "memory";
		reg = <0x80000000 0x10000000>; /* 256 MB */
	};

	/* AM35xx doesn't have IVA */
	soc {
		iva {
			status = "disabled";
		};
	};
};
+4 −2
Original line number Original line Diff line number Diff line
@@ -61,10 +61,12 @@
		ranges;
		ranges;
		ti,hwmods = "l3_main";
		ti,hwmods = "l3_main";


		intc: interrupt-controller@1 {
		intc: interrupt-controller@48200000 {
			compatible = "ti,omap3-intc";
			compatible = "ti,omap2-intc";
			interrupt-controller;
			interrupt-controller;
			#interrupt-cells = <1>;
			#interrupt-cells = <1>;
			ti,intc-size = <96>;
			reg = <0x48200000 0x1000>;
		};
		};


		uart1: serial@4806a000 {
		uart1: serial@4806a000 {
+48 −51
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
 */
 */
#include <linux/io.h>
#include <linux/io.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/of_platform.h>
#include <linux/irqdomain.h>
#include <linux/irqdomain.h>
#include <linux/i2c/twl.h>
#include <linux/i2c/twl.h>
@@ -24,33 +25,23 @@
#include "common.h"
#include "common.h"
#include "common-board-devices.h"
#include "common-board-devices.h"


/*
#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
 * XXX: Still needed to boot until the i2c & twl driver is adapted to
#define omap_intc_of_init	NULL
 * device-tree
#endif
 */
#ifndef CONFIG_ARCH_OMAP4
#ifdef CONFIG_ARCH_OMAP4
#define gic_of_init		NULL
static struct twl4030_platform_data sdp4430_twldata = {
	.irq_base	= TWL6030_IRQ_BASE,
	.irq_end	= TWL6030_IRQ_END,
};

static void __init omap4_i2c_init(void)
{
	omap4_pmic_init("twl6030", &sdp4430_twldata);
}
#endif
#endif


#ifdef CONFIG_ARCH_OMAP3
static struct of_device_id irq_match[] __initdata = {
static struct twl4030_platform_data beagle_twldata = {
	{ .compatible = "ti,omap2-intc", .data = omap_intc_of_init, },
	.irq_base	= TWL4030_IRQ_BASE,
	{ .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
	.irq_end	= TWL4030_IRQ_END,
	{ }
};
};


static void __init omap3_i2c_init(void)
static void __init omap_init_irq(void)
{
{
	omap3_pmic_init("twl4030", &beagle_twldata);
	of_irq_init(irq_match);
}
}
#endif


static struct of_device_id omap_dt_match_table[] __initdata = {
static struct of_device_id omap_dt_match_table[] __initdata = {
	{ .compatible = "simple-bus", },
	{ .compatible = "simple-bus", },
@@ -58,39 +49,13 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
	{ }
	{ }
};
};


static struct of_device_id intc_match[] __initdata = {
	{ .compatible = "ti,omap3-intc", },
	{ .compatible = "arm,cortex-a9-gic", },
	{ }
};

static void __init omap_generic_init(void)
static void __init omap_generic_init(void)
{
{
	struct device_node *node = of_find_matching_node(NULL, intc_match);
	if (node)
		irq_domain_add_legacy(node, 32, 0, 0, &irq_domain_simple_ops, NULL);

	omap_sdrc_init(NULL, NULL);
	omap_sdrc_init(NULL, NULL);


	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
}
}


#ifdef CONFIG_ARCH_OMAP4
static void __init omap4_init(void)
{
	omap4_i2c_init();
	omap_generic_init();
}
#endif

#ifdef CONFIG_ARCH_OMAP3
static void __init omap3_init(void)
{
	omap3_i2c_init();
	omap_generic_init();
}
#endif

#ifdef CONFIG_SOC_OMAP2420
#ifdef CONFIG_SOC_OMAP2420
static const char *omap242x_boards_compat[] __initdata = {
static const char *omap242x_boards_compat[] __initdata = {
	"ti,omap2420",
	"ti,omap2420",
@@ -101,7 +66,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.reserve	= omap_reserve,
	.map_io		= omap242x_map_io,
	.map_io		= omap242x_map_io,
	.init_early	= omap2420_init_early,
	.init_early	= omap2420_init_early,
	.init_irq	= omap2_init_irq,
	.init_irq	= omap_init_irq,
	.handle_irq	= omap2_intc_handle_irq,
	.handle_irq	= omap2_intc_handle_irq,
	.init_machine	= omap_generic_init,
	.init_machine	= omap_generic_init,
	.timer		= &omap2_timer,
	.timer		= &omap2_timer,
@@ -120,7 +85,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.reserve	= omap_reserve,
	.map_io		= omap243x_map_io,
	.map_io		= omap243x_map_io,
	.init_early	= omap2430_init_early,
	.init_early	= omap2430_init_early,
	.init_irq	= omap2_init_irq,
	.init_irq	= omap_init_irq,
	.handle_irq	= omap2_intc_handle_irq,
	.handle_irq	= omap2_intc_handle_irq,
	.init_machine	= omap_generic_init,
	.init_machine	= omap_generic_init,
	.timer		= &omap2_timer,
	.timer		= &omap2_timer,
@@ -130,6 +95,22 @@ MACHINE_END
#endif
#endif


#ifdef CONFIG_ARCH_OMAP3
#ifdef CONFIG_ARCH_OMAP3
static struct twl4030_platform_data beagle_twldata = {
	.irq_base	= TWL4030_IRQ_BASE,
	.irq_end	= TWL4030_IRQ_END,
};

static void __init omap3_i2c_init(void)
{
	omap3_pmic_init("twl4030", &beagle_twldata);
}

static void __init omap3_init(void)
{
	omap3_i2c_init();
	omap_generic_init();
}

static const char *omap3_boards_compat[] __initdata = {
static const char *omap3_boards_compat[] __initdata = {
	"ti,omap3",
	"ti,omap3",
	NULL,
	NULL,
@@ -139,7 +120,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.map_io		= omap3_map_io,
	.init_early	= omap3430_init_early,
	.init_early	= omap3430_init_early,
	.init_irq	= omap3_init_irq,
	.init_irq	= omap_init_irq,
	.handle_irq	= omap3_intc_handle_irq,
	.handle_irq	= omap3_intc_handle_irq,
	.init_machine	= omap3_init,
	.init_machine	= omap3_init,
	.timer		= &omap3_timer,
	.timer		= &omap3_timer,
@@ -149,6 +130,22 @@ MACHINE_END
#endif
#endif


#ifdef CONFIG_ARCH_OMAP4
#ifdef CONFIG_ARCH_OMAP4
static struct twl4030_platform_data sdp4430_twldata = {
	.irq_base	= TWL6030_IRQ_BASE,
	.irq_end	= TWL6030_IRQ_END,
};

static void __init omap4_i2c_init(void)
{
	omap4_pmic_init("twl6030", &sdp4430_twldata);
}

static void __init omap4_init(void)
{
	omap4_i2c_init();
	omap_generic_init();
}

static const char *omap4_boards_compat[] __initdata = {
static const char *omap4_boards_compat[] __initdata = {
	"ti,omap4",
	"ti,omap4",
	NULL,
	NULL,
@@ -158,7 +155,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.reserve	= omap_reserve,
	.map_io		= omap4_map_io,
	.map_io		= omap4_map_io,
	.init_early	= omap4430_init_early,
	.init_early	= omap4430_init_early,
	.init_irq	= gic_init_irq,
	.init_irq	= omap_init_irq,
	.handle_irq	= gic_handle_irq,
	.handle_irq	= gic_handle_irq,
	.init_machine	= omap4_init,
	.init_machine	= omap4_init,
	.timer		= &omap4_timer,
	.timer		= &omap4_timer,
+12 −0
Original line number Original line Diff line number Diff line
@@ -175,6 +175,18 @@ void omap3_intc_handle_irq(struct pt_regs *regs);
extern void __iomem *omap4_get_l2cache_base(void);
extern void __iomem *omap4_get_l2cache_base(void);
#endif
#endif


struct device_node;
#ifdef CONFIG_OF
int __init omap_intc_of_init(struct device_node *node,
			     struct device_node *parent);
#else
int __init omap_intc_of_init(struct device_node *node,
			     struct device_node *parent)
{
	return 0;
}
#endif

#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
extern void __iomem *omap4_get_scu_base(void);
extern void __iomem *omap4_get_scu_base(void);
#else
#else
Loading