xref: /linux/arch/arm/mach-davinci/da8xx-dt.c (revision db4c8fa7c0214c83cbbc990ba630b3b613fcf7c5)
1689e331fSSekhar Nori /*
2689e331fSSekhar Nori  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3689e331fSSekhar Nori  *
4689e331fSSekhar Nori  * Modified from mach-omap/omap2/board-generic.c
5689e331fSSekhar Nori  *
6689e331fSSekhar Nori  * This program is free software; you can redistribute it and/or modify
7689e331fSSekhar Nori  * it under the terms of the GNU General Public License version 2 as
8689e331fSSekhar Nori  * published by the Free Software Foundation.
9689e331fSSekhar Nori  */
10689e331fSSekhar Nori #include <linux/io.h>
11689e331fSSekhar Nori #include <linux/of_irq.h>
12689e331fSSekhar Nori #include <linux/of_platform.h>
13689e331fSSekhar Nori #include <linux/irqdomain.h>
14689e331fSSekhar Nori 
15689e331fSSekhar Nori #include <asm/mach/arch.h>
16689e331fSSekhar Nori 
17689e331fSSekhar Nori #include <mach/common.h>
18689e331fSSekhar Nori #include <mach/cp_intc.h>
19689e331fSSekhar Nori #include <mach/da8xx.h>
20689e331fSSekhar Nori 
21689e331fSSekhar Nori #define DA8XX_NUM_UARTS	3
22689e331fSSekhar Nori 
23689e331fSSekhar Nori void __init da8xx_uart_clk_enable(void)
24689e331fSSekhar Nori {
25689e331fSSekhar Nori 	int i;
26689e331fSSekhar Nori 	for (i = 0; i < DA8XX_NUM_UARTS; i++)
27689e331fSSekhar Nori 		davinci_serial_setup_clk(i, NULL);
28689e331fSSekhar Nori }
29689e331fSSekhar Nori 
30689e331fSSekhar Nori static struct of_device_id da8xx_irq_match[] __initdata = {
31689e331fSSekhar Nori 	{ .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
32689e331fSSekhar Nori 	{ }
33689e331fSSekhar Nori };
34689e331fSSekhar Nori 
35689e331fSSekhar Nori static void __init da8xx_init_irq(void)
36689e331fSSekhar Nori {
37689e331fSSekhar Nori 	of_irq_init(da8xx_irq_match);
38689e331fSSekhar Nori }
39689e331fSSekhar Nori 
4001729ccfSVishwanathrao Badarkhe, Manish struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
4101729ccfSVishwanathrao Badarkhe, Manish 	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
42518f97dbSKumar, Anil 	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
43*db4c8fa7SManjunathappa, Prakash 	OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL),
4401729ccfSVishwanathrao Badarkhe, Manish 	{}
4501729ccfSVishwanathrao Badarkhe, Manish };
4601729ccfSVishwanathrao Badarkhe, Manish 
47689e331fSSekhar Nori #ifdef CONFIG_ARCH_DAVINCI_DA850
48689e331fSSekhar Nori 
49689e331fSSekhar Nori static void __init da850_init_machine(void)
50689e331fSSekhar Nori {
5101729ccfSVishwanathrao Badarkhe, Manish 	of_platform_populate(NULL, of_default_bus_match_table,
5201729ccfSVishwanathrao Badarkhe, Manish 			     da850_auxdata_lookup, NULL);
53689e331fSSekhar Nori 
54689e331fSSekhar Nori 	da8xx_uart_clk_enable();
55689e331fSSekhar Nori }
56689e331fSSekhar Nori 
57689e331fSSekhar Nori static const char *da850_boards_compat[] __initdata = {
583015fb33SHeiko Schocher 	"enbw,cmc",
5927e6e0d3SSekhar Nori 	"ti,da850-evm",
60689e331fSSekhar Nori 	"ti,da850",
61689e331fSSekhar Nori 	NULL,
62689e331fSSekhar Nori };
63689e331fSSekhar Nori 
64689e331fSSekhar Nori DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
65689e331fSSekhar Nori 	.map_io		= da850_init,
66689e331fSSekhar Nori 	.init_irq	= da8xx_init_irq,
676bb27d73SStephen Warren 	.init_time	= davinci_timer_init,
68689e331fSSekhar Nori 	.init_machine	= da850_init_machine,
69689e331fSSekhar Nori 	.dt_compat	= da850_boards_compat,
70689e331fSSekhar Nori 	.init_late	= davinci_init_late,
71689e331fSSekhar Nori 	.restart	= da8xx_restart,
72689e331fSSekhar Nori MACHINE_END
73689e331fSSekhar Nori 
74689e331fSSekhar Nori #endif
75