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 | |
Sudhakar Rajashekhara | 5a4b131 | 2009-07-17 04:47:10 -0400 | [diff] [blame^] | 29 | #define DA850_EVM_PHY_MASK 0x1 |
| 30 | #define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ |
| 31 | |
Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame] | 32 | static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { |
| 33 | .bus_freq = 100, /* kHz */ |
| 34 | .bus_delay = 0, /* usec */ |
| 35 | }; |
| 36 | |
| 37 | static struct davinci_uart_config da850_evm_uart_config __initdata = { |
| 38 | .enabled_uarts = 0x7, |
| 39 | }; |
| 40 | |
| 41 | static __init void da850_evm_init(void) |
| 42 | { |
Sudhakar Rajashekhara | 5a4b131 | 2009-07-17 04:47:10 -0400 | [diff] [blame^] | 43 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame] | 44 | int ret; |
| 45 | |
| 46 | ret = da8xx_register_edma(); |
| 47 | if (ret) |
| 48 | pr_warning("da850_evm_init: edma registration failed: %d\n", |
| 49 | ret); |
| 50 | |
| 51 | ret = da8xx_pinmux_setup(da850_i2c0_pins); |
| 52 | if (ret) |
| 53 | pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n", |
| 54 | ret); |
| 55 | |
| 56 | ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata); |
| 57 | if (ret) |
| 58 | pr_warning("da850_evm_init: i2c0 registration failed: %d\n", |
| 59 | ret); |
| 60 | |
Sudhakar Rajashekhara | 5a4b131 | 2009-07-17 04:47:10 -0400 | [diff] [blame^] | 61 | soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK; |
| 62 | soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY; |
| 63 | soc_info->emac_pdata->rmii_en = 0; |
| 64 | |
| 65 | ret = da8xx_pinmux_setup(da850_cpgmac_pins); |
| 66 | if (ret) |
| 67 | pr_warning("da850_evm_init: cpgmac mux setup failed: %d\n", |
| 68 | ret); |
| 69 | |
| 70 | ret = da8xx_register_emac(); |
| 71 | if (ret) |
| 72 | pr_warning("da850_evm_init: emac registration failed: %d\n", |
| 73 | ret); |
| 74 | |
Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame] | 75 | ret = da8xx_register_watchdog(); |
| 76 | if (ret) |
| 77 | pr_warning("da830_evm_init: watchdog registration failed: %d\n", |
| 78 | ret); |
| 79 | |
| 80 | davinci_serial_init(&da850_evm_uart_config); |
| 81 | |
| 82 | /* |
| 83 | * shut down uart 0 and 1; they are not used on the board and |
| 84 | * accessing them causes endless "too much work in irq53" messages |
| 85 | * with arago fs |
| 86 | */ |
| 87 | __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); |
| 88 | __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); |
| 89 | } |
| 90 | |
| 91 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
| 92 | static int __init da850_evm_console_init(void) |
| 93 | { |
| 94 | return add_preferred_console("ttyS", 2, "115200"); |
| 95 | } |
| 96 | console_initcall(da850_evm_console_init); |
| 97 | #endif |
| 98 | |
| 99 | static __init void da850_evm_irq_init(void) |
| 100 | { |
| 101 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
| 102 | |
| 103 | cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA850_N_CP_INTC_IRQ, |
| 104 | soc_info->intc_irq_prios); |
| 105 | } |
| 106 | |
| 107 | static void __init da850_evm_map_io(void) |
| 108 | { |
| 109 | da850_init(); |
| 110 | } |
| 111 | |
| 112 | MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM") |
| 113 | .phys_io = IO_PHYS, |
| 114 | .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, |
| 115 | .boot_params = (DA8XX_DDR_BASE + 0x100), |
| 116 | .map_io = da850_evm_map_io, |
| 117 | .init_irq = da850_evm_irq_init, |
| 118 | .timer = &davinci_timer, |
| 119 | .init_machine = da850_evm_init, |
| 120 | MACHINE_END |