common.c revision c05012ce9a70100dd547042865df751498244ec3
1af75655c066621352c419646ec0775e9523dc720Jamie Iles/*
2af75655c066621352c419646ec0775e9523dc720Jamie Iles * Copyright (c) 2011 Picochip Ltd., Jamie Iles
3af75655c066621352c419646ec0775e9523dc720Jamie Iles *
4af75655c066621352c419646ec0775e9523dc720Jamie Iles * This program is free software; you can redistribute it and/or modify
5af75655c066621352c419646ec0775e9523dc720Jamie Iles * it under the terms of the GNU General Public License version 2 as
6af75655c066621352c419646ec0775e9523dc720Jamie Iles * published by the Free Software Foundation.
7af75655c066621352c419646ec0775e9523dc720Jamie Iles *
8af75655c066621352c419646ec0775e9523dc720Jamie Iles * All enquiries to support@picochip.com
9af75655c066621352c419646ec0775e9523dc720Jamie Iles */
10af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <linux/irq.h>
11af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <linux/irqdomain.h>
12af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <linux/of.h>
13af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <linux/of_address.h>
14c05012ce9a70100dd547042865df751498244ec3Jamie Iles#include <linux/of_irq.h>
15af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <linux/of_platform.h>
16af75655c066621352c419646ec0775e9523dc720Jamie Iles
17af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <asm/mach/arch.h>
18af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <asm/hardware/vic.h>
19af75655c066621352c419646ec0775e9523dc720Jamie Iles
20af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <mach/map.h>
21af75655c066621352c419646ec0775e9523dc720Jamie Iles#include <mach/picoxcell_soc.h>
22af75655c066621352c419646ec0775e9523dc720Jamie Iles
23af75655c066621352c419646ec0775e9523dc720Jamie Iles#include "common.h"
24af75655c066621352c419646ec0775e9523dc720Jamie Iles
25af75655c066621352c419646ec0775e9523dc720Jamie Ilesstatic void __init picoxcell_init_machine(void)
26af75655c066621352c419646ec0775e9523dc720Jamie Iles{
27af75655c066621352c419646ec0775e9523dc720Jamie Iles	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
28af75655c066621352c419646ec0775e9523dc720Jamie Iles}
29af75655c066621352c419646ec0775e9523dc720Jamie Iles
30af75655c066621352c419646ec0775e9523dc720Jamie Ilesstatic const char *picoxcell_dt_match[] = {
31af75655c066621352c419646ec0775e9523dc720Jamie Iles	"picochip,pc3x2",
32af75655c066621352c419646ec0775e9523dc720Jamie Iles	"picochip,pc3x3",
33af75655c066621352c419646ec0775e9523dc720Jamie Iles	NULL
34af75655c066621352c419646ec0775e9523dc720Jamie Iles};
35af75655c066621352c419646ec0775e9523dc720Jamie Iles
36af75655c066621352c419646ec0775e9523dc720Jamie Ilesstatic const struct of_device_id vic_of_match[] __initconst = {
37c05012ce9a70100dd547042865df751498244ec3Jamie Iles	{ .compatible = "arm,pl192-vic", .data = vic_of_init, },
38af75655c066621352c419646ec0775e9523dc720Jamie Iles	{ /* Sentinel */ }
39af75655c066621352c419646ec0775e9523dc720Jamie Iles};
40af75655c066621352c419646ec0775e9523dc720Jamie Iles
41af75655c066621352c419646ec0775e9523dc720Jamie Ilesstatic void __init picoxcell_init_irq(void)
42af75655c066621352c419646ec0775e9523dc720Jamie Iles{
43c05012ce9a70100dd547042865df751498244ec3Jamie Iles	of_irq_init(vic_of_match);
44af75655c066621352c419646ec0775e9523dc720Jamie Iles}
45af75655c066621352c419646ec0775e9523dc720Jamie Iles
46af75655c066621352c419646ec0775e9523dc720Jamie IlesDT_MACHINE_START(PICOXCELL, "Picochip picoXcell")
47af75655c066621352c419646ec0775e9523dc720Jamie Iles	.map_io		= picoxcell_map_io,
48af75655c066621352c419646ec0775e9523dc720Jamie Iles	.nr_irqs	= ARCH_NR_IRQS,
49af75655c066621352c419646ec0775e9523dc720Jamie Iles	.init_irq	= picoxcell_init_irq,
50c05012ce9a70100dd547042865df751498244ec3Jamie Iles	.handle_irq	= vic_handle_irq,
51af75655c066621352c419646ec0775e9523dc720Jamie Iles	.timer		= &picoxcell_timer,
52af75655c066621352c419646ec0775e9523dc720Jamie Iles	.init_machine	= picoxcell_init_machine,
53af75655c066621352c419646ec0775e9523dc720Jamie Iles	.dt_compat	= picoxcell_dt_match,
54af75655c066621352c419646ec0775e9523dc720Jamie IlesMACHINE_END
55