Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame^] | 1 | /* |
| 2 | * TI DA850/OMAP-L138 EVM board |
| 3 | * |
| 4 | * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ |
| 5 | * |
| 6 | * Derived from: arch/arm/mach-davinci/board-da830-evm.c |
| 7 | * Original Copyrights follow: |
| 8 | * |
| 9 | * 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under |
| 10 | * the terms of the GNU General Public License version 2. This program |
| 11 | * is licensed "as is" without any warranty of any kind, whether express |
| 12 | * or implied. |
| 13 | */ |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/module.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/console.h> |
| 18 | #include <linux/i2c.h> |
| 19 | #include <linux/i2c/at24.h> |
| 20 | |
| 21 | #include <asm/mach-types.h> |
| 22 | #include <asm/mach/arch.h> |
| 23 | |
| 24 | #include <mach/common.h> |
| 25 | #include <mach/irqs.h> |
| 26 | #include <mach/cp_intc.h> |
| 27 | #include <mach/da8xx.h> |
| 28 | |
| 29 | static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { |
| 30 | .bus_freq = 100, /* kHz */ |
| 31 | .bus_delay = 0, /* usec */ |
| 32 | }; |
| 33 | |
| 34 | static struct davinci_uart_config da850_evm_uart_config __initdata = { |
| 35 | .enabled_uarts = 0x7, |
| 36 | }; |
| 37 | |
| 38 | static __init void da850_evm_init(void) |
| 39 | { |
| 40 | int ret; |
| 41 | |
| 42 | ret = da8xx_register_edma(); |
| 43 | if (ret) |
| 44 | pr_warning("da850_evm_init: edma registration failed: %d\n", |
| 45 | ret); |
| 46 | |
| 47 | ret = da8xx_pinmux_setup(da850_i2c0_pins); |
| 48 | if (ret) |
| 49 | pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n", |
| 50 | ret); |
| 51 | |
| 52 | ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata); |
| 53 | if (ret) |
| 54 | pr_warning("da850_evm_init: i2c0 registration failed: %d\n", |
| 55 | ret); |
| 56 | |
| 57 | ret = da8xx_register_watchdog(); |
| 58 | if (ret) |
| 59 | pr_warning("da830_evm_init: watchdog registration failed: %d\n", |
| 60 | ret); |
| 61 | |
| 62 | davinci_serial_init(&da850_evm_uart_config); |
| 63 | |
| 64 | /* |
| 65 | * shut down uart 0 and 1; they are not used on the board and |
| 66 | * accessing them causes endless "too much work in irq53" messages |
| 67 | * with arago fs |
| 68 | */ |
| 69 | __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); |
| 70 | __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); |
| 71 | } |
| 72 | |
| 73 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
| 74 | static int __init da850_evm_console_init(void) |
| 75 | { |
| 76 | return add_preferred_console("ttyS", 2, "115200"); |
| 77 | } |
| 78 | console_initcall(da850_evm_console_init); |
| 79 | #endif |
| 80 | |
| 81 | static __init void da850_evm_irq_init(void) |
| 82 | { |
| 83 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
| 84 | |
| 85 | cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA850_N_CP_INTC_IRQ, |
| 86 | soc_info->intc_irq_prios); |
| 87 | } |
| 88 | |
| 89 | static void __init da850_evm_map_io(void) |
| 90 | { |
| 91 | da850_init(); |
| 92 | } |
| 93 | |
| 94 | MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM") |
| 95 | .phys_io = IO_PHYS, |
| 96 | .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, |
| 97 | .boot_params = (DA8XX_DDR_BASE + 0x100), |
| 98 | .map_io = da850_evm_map_io, |
| 99 | .init_irq = da850_evm_irq_init, |
| 100 | .timer = &davinci_timer, |
| 101 | .init_machine = da850_evm_init, |
| 102 | MACHINE_END |