aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-da830-evm.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-06-03 21:41:53 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-08-26 03:56:59 -0400
commit8593790d604c29a717d5914159ce78c7bb9899fb (patch)
tree68176675ac1f1931548cdb282c3cfbff7b69930f /arch/arm/mach-davinci/board-da830-evm.c
parent55c79a40e34566e9d198f6205b0cf06e3d89ac0a (diff)
davinci: da8xx: Add support for DA830/OMAP-L137 EVM board
Add support for the DA830/OMAP-L137 Evaluation Module (EVM) from TI. The EVM has User Interface (UI) and Audio cards that can be connected which contain various devices. Support for those devices and ones on the EVM will be added in subsequent patches. Additional generalizations for future SoCs in da8xx family done by Sudhakar Rajashekhara and Sekhar Nori. Signed-off-by: Steve Chen <schen@mvista.com> Signed-off-by: Mark A. Greer <mgreer@mvista.com> Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Cc: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-da830-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c127
1 files changed, 127 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
new file mode 100644
index 000000000000..0409eb67cfe1
--- /dev/null
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -0,0 +1,127 @@
1/*
2 * TI DA830/OMAP L137 EVM board
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 * Derived from: arch/arm/mach-davinci/board-dm644x-evm.c
6 *
7 * 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/console.h>
16#include <linux/i2c.h>
17#include <linux/i2c/at24.h>
18
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21
22#include <mach/common.h>
23#include <mach/irqs.h>
24#include <mach/cp_intc.h>
25#include <mach/da8xx.h>
26
27#define DA830_EVM_PHY_MASK 0x0
28#define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
29
30static struct at24_platform_data da830_evm_i2c_eeprom_info = {
31 .byte_len = SZ_256K / 8,
32 .page_size = 64,
33 .flags = AT24_FLAG_ADDR16,
34 .setup = davinci_get_mac_addr,
35 .context = (void *)0x7f00,
36};
37
38static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
39 {
40 I2C_BOARD_INFO("24c256", 0x50),
41 .platform_data = &da830_evm_i2c_eeprom_info,
42 },
43};
44
45static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = {
46 .bus_freq = 100, /* kHz */
47 .bus_delay = 0, /* usec */
48};
49
50static struct davinci_uart_config da830_evm_uart_config __initdata = {
51 .enabled_uarts = 0x7,
52};
53
54static __init void da830_evm_init(void)
55{
56 struct davinci_soc_info *soc_info = &davinci_soc_info;
57 int ret;
58
59 ret = da8xx_register_edma();
60 if (ret)
61 pr_warning("da830_evm_init: edma registration failed: %d\n",
62 ret);
63
64 ret = da830_pinmux_setup(da830_i2c0_pins);
65 if (ret)
66 pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n",
67 ret);
68
69 ret = da8xx_register_i2c(0, &da830_evm_i2c_0_pdata);
70 if (ret)
71 pr_warning("da830_evm_init: i2c0 registration failed: %d\n",
72 ret);
73
74 soc_info->emac_pdata->phy_mask = DA830_EVM_PHY_MASK;
75 soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY;
76 soc_info->emac_pdata->rmii_en = 1;
77
78 ret = da830_pinmux_setup(da830_cpgmac_pins);
79 if (ret)
80 pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n",
81 ret);
82
83 ret = da8xx_register_emac();
84 if (ret)
85 pr_warning("da830_evm_init: emac registration failed: %d\n",
86 ret);
87
88 ret = da8xx_register_watchdog();
89 if (ret)
90 pr_warning("da830_evm_init: watchdog registration failed: %d\n",
91 ret);
92
93 davinci_serial_init(&da830_evm_uart_config);
94 i2c_register_board_info(1, da830_evm_i2c_devices,
95 ARRAY_SIZE(da830_evm_i2c_devices));
96}
97
98#ifdef CONFIG_SERIAL_8250_CONSOLE
99static int __init da830_evm_console_init(void)
100{
101 return add_preferred_console("ttyS", 2, "115200");
102}
103console_initcall(da830_evm_console_init);
104#endif
105
106static __init void da830_evm_irq_init(void)
107{
108 struct davinci_soc_info *soc_info = &davinci_soc_info;
109
110 cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA830_N_CP_INTC_IRQ,
111 soc_info->intc_irq_prios);
112}
113
114static void __init da830_evm_map_io(void)
115{
116 da830_init();
117}
118
119MACHINE_START(DAVINCI_DA8XX_EVM, "DaVinci DA830/OMAP L137 EVM")
120 .phys_io = IO_PHYS,
121 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
122 .boot_params = (DA8XX_DDR_BASE + 0x100),
123 .map_io = da830_evm_map_io,
124 .init_irq = da830_evm_irq_init,
125 .timer = &davinci_timer,
126 .init_machine = da830_evm_init,
127MACHINE_END