/*
 * Emma Mobile EV2 processor support
 *
 * Copyright (C) 2012  Magnus Damm
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqchip.h>
#include <linux/platform_device.h>
#include <linux/platform_data/gpio-em.h>
#include <linux/of_platform.h>
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/io.h>
#include <linux/irqchip/arm-gic.h>
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/emev2.h>
#include <mach/irqs.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>

static struct map_desc emev2_io_desc[] __initdata = {
#ifdef CONFIG_SMP
	/* 128K entity map for 0xe0100000 (SMU) */
	{
		.virtual	= 0xe0100000,
		.pfn		= __phys_to_pfn(0xe0100000),
		.length		= SZ_128K,
		.type		= MT_DEVICE
	},
	/* 2M mapping for SCU + L2 controller */
	{
		.virtual	= 0xf0000000,
		.pfn		= __phys_to_pfn(0x1e000000),
		.length		= SZ_2M,
		.type		= MT_DEVICE
	},
#endif
};

void __init emev2_map_io(void)
{
	iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc));
}

/* UART */
static struct resource uart0_resources[] = {
	[0]	= {
		.start	= 0xe1020000,
		.end	= 0xe1020037,
		.flags	= IORESOURCE_MEM,
	},
	[1]	= {
		.start	= 40,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device uart0_device = {
	.name		= "serial8250-em",
	.id		= 0,
	.num_resources	= ARRAY_SIZE(uart0_resources),
	.resource	= uart0_resources,
};

static struct resource uart1_resources[] = {
	[0]	= {
		.start	= 0xe1030000,
		.end	= 0xe1030037,
		.flags	= IORESOURCE_MEM,
	},
	[1]	= {
		.start	= 41,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device uart1_device = {
	.name		= "serial8250-em",
	.id		= 1,
	.num_resources	= ARRAY_SIZE(uart1_resources),
	.resource	= uart1_resources,
};

static struct resource uart2_resources[] = {
	[0]	= {
		.start	= 0xe1040000,
		.end	= 0xe1040037,
		.flags	= IORESOURCE_MEM,
	},
	[1]	= {
		.start	= 42,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device uart2_device = {
	.name		= "serial8250-em",
	.id		= 2,
	.num_resources	= ARRAY_SIZE(uart2_resources),
	.resource	= uart2_resources,
};

static struct resource uart3_resources[] = {
	[0]	= {
		.start	= 0xe1050000,
		.end	= 0xe1050037,
		.flags	= IORESOURCE_MEM,
	},
	[1]	= {
		.start	= 43,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device uart3_device = {
	.name		= "serial8250-em",
	.id		= 3,
	.num_resources	= ARRAY_SIZE(uart3_resources),
	.resource	= uart3_resources,
};

/* STI */
static struct resource sti_resources[] = {
	[0] = {
		.name	= "STI",
		.start	= 0xe0180000,
		.end	= 0xe0180053,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= 157,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device sti_device = {
	.name		= "em_sti",
	.id		= 0,
	.resource	= sti_resources,
	.num_resources	= ARRAY_SIZE(sti_resources),
};


/* GIO */
static struct gpio_em_config gio0_config = {
	.gpio_base = 0,
	.irq_base = EMEV2_GPIO_IRQ(0),
	.number_of_pins = 32,
};

static struct resource gio0_resources[] = {
	[0] = {
		.name	= "GIO_000",
		.start	= 0xe0050000,
		.end	= 0xe005002b,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.name	= "GIO_000",
		.start	= 0xe0050040,
		.end	= 0xe005005f,
		.flags	= IORESOURCE_MEM,
	},
	[2] = {
		.start	= 99,
		.flags	= IORESOURCE_IRQ,
	},
	[3] = {
		.start	= 100,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device gio0_device = {
	.name		= "em_gio",
	.id		= 0,
	.resource	= gio0_resources,
	.num_resources	= ARRAY_SIZE(gio0_resources),
	.dev		= {
		.platform_data	= &gio0_config,
	},
};

static struct gpio_em_config gio1_config = {
	.gpio_base = 32,
	.irq_base = EMEV2_GPIO_IRQ(32),
	.number_of_pins = 32,
};

static struct resource gio1_resources[] = {
	[0] = {
		.name	= "GIO_032",
		.start	= 0xe0050080,
		.end	= 0xe00500ab,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.name	= "GIO_032",
		.start	= 0xe00500c0,
		.end	= 0xe00500df,
		.flags	= IORESOURCE_MEM,
	},
	[2] = {
		.start	= 101,
		.flags	= IORESOURCE_IRQ,
	},
	[3] = {
		.start	= 102,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device gio1_device = {
	.name		= "em_gio",
	.id		= 1,
	.resource	= gio1_resources,
	.num_resources	= ARRAY_SIZE(gio1_resources),
	.dev		= {
		.platform_data	= &gio1_config,
	},
};

static struct gpio_em_config gio2_config = {
	.gpio_base = 64,
	.irq_base = EMEV2_GPIO_IRQ(64),
	.number_of_pins = 32,
};

static struct resource gio2_resources[] = {
	[0] = {
		.name	= "GIO_064",
		.start	= 0xe0050100,
		.end	= 0xe005012b,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.name	= "GIO_064",
		.start	= 0xe0050140,
		.end	= 0xe005015f,
		.flags	= IORESOURCE_MEM,
	},
	[2] = {
		.start	= 103,
		.flags	= IORESOURCE_IRQ,
	},
	[3] = {
		.start	= 104,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device gio2_device = {
	.name		= "em_gio",
	.id		= 2,
	.resource	= gio2_resources,
	.num_resources	= ARRAY_SIZE(gio2_resources),
	.dev		= {
		.platform_data	= &gio2_config,
	},
};

static struct gpio_em_config gio3_config = {
	.gpio_base = 96,
	.irq_base = EMEV2_GPIO_IRQ(96),
	.number_of_pins = 32,
};

static struct resource gio3_resources[] = {
	[0] = {
		.name	= "GIO_096",
		.start	= 0xe0050100,
		.end	= 0xe005012b,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.name	= "GIO_096",
		.start	= 0xe0050140,
		.end	= 0xe005015f,
		.flags	= IORESOURCE_MEM,
	},
	[2] = {
		.start	= 105,
		.flags	= IORESOURCE_IRQ,
	},
	[3] = {
		.start	= 106,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device gio3_device = {
	.name		= "em_gio",
	.id		= 3,
	.resource	= gio3_resources,
	.num_resources	= ARRAY_SIZE(gio3_resources),
	.dev		= {
		.platform_data	= &gio3_config,
	},
};

static struct gpio_em_config gio4_config = {
	.gpio_base = 128,
	.irq_base = EMEV2_GPIO_IRQ(128),
	.number_of_pins = 31,
};

static struct resource gio4_resources[] = {
	[0] = {
		.name	= "GIO_128",
		.start	= 0xe0050200,
		.end	= 0xe005022b,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.name	= "GIO_128",
		.start	= 0xe0050240,
		.end	= 0xe005025f,
		.flags	= IORESOURCE_MEM,
	},
	[2] = {
		.start	= 107,
		.flags	= IORESOURCE_IRQ,
	},
	[3] = {
		.start	= 108,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device gio4_device = {
	.name		= "em_gio",
	.id		= 4,
	.resource	= gio4_resources,
	.num_resources	= ARRAY_SIZE(gio4_resources),
	.dev		= {
		.platform_data	= &gio4_config,
	},
};

static struct resource pmu_resources[] = {
	[0] = {
		.start	= 152,
		.end	= 152,
		.flags	= IORESOURCE_IRQ,
	},
	[1] = {
		.start	= 153,
		.end	= 153,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device pmu_device = {
	.name		= "arm-pmu",
	.id		= -1,
	.num_resources	= ARRAY_SIZE(pmu_resources),
	.resource	= pmu_resources,
};

static struct platform_device *emev2_early_devices[] __initdata = {
	&uart0_device,
	&uart1_device,
	&uart2_device,
	&uart3_device,
};

static struct platform_device *emev2_late_devices[] __initdata = {
	&sti_device,
	&gio0_device,
	&gio1_device,
	&gio2_device,
	&gio3_device,
	&gio4_device,
	&pmu_device,
};

void __init emev2_add_standard_devices(void)
{
	emev2_clock_init();

	platform_add_devices(emev2_early_devices,
			     ARRAY_SIZE(emev2_early_devices));

	platform_add_devices(emev2_late_devices,
			     ARRAY_SIZE(emev2_late_devices));
}

static void __init emev2_init_delay(void)
{
	shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */
}

void __init emev2_add_early_devices(void)
{
	emev2_init_delay();

	early_platform_add_devices(emev2_early_devices,
				   ARRAY_SIZE(emev2_early_devices));

	/* setup early console here as well */
	shmobile_setup_console();
}

void __init emev2_init_irq(void)
{
	void __iomem *gic_dist_base;
	void __iomem *gic_cpu_base;

	/* Static mappings, never released */
	gic_dist_base = ioremap(0xe0028000, PAGE_SIZE);
	gic_cpu_base = ioremap(0xe0020000, PAGE_SIZE);
	BUG_ON(!gic_dist_base || !gic_cpu_base);

	/* Use GIC to handle interrupts */
	gic_init(0, 29, gic_dist_base, gic_cpu_base);
}

#ifdef CONFIG_USE_OF
static const struct of_dev_auxdata emev2_auxdata_lookup[] __initconst = {
	{ }
};

static void __init emev2_add_standard_devices_dt(void)
{
	of_platform_populate(NULL, of_default_bus_match_table,
			     emev2_auxdata_lookup, NULL);
}

static const char *emev2_boards_compat_dt[] __initdata = {
	"renesas,emev2",
	NULL,
};

DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
	.smp		= smp_ops(emev2_smp_ops),
	.init_early	= emev2_init_delay,
	.nr_irqs	= NR_IRQS_LEGACY,
	.init_irq	= irqchip_init,
	.init_machine	= emev2_add_standard_devices_dt,
	.init_time	= shmobile_timer_init,
	.dt_compat	= emev2_boards_compat_dt,
MACHINE_END

#endif /* CONFIG_USE_OF */
