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 | |
Chaithrika U S | 491214e | 2009-08-11 17:03:25 -0400 | [diff] [blame^] | 41 | /* davinci da850 evm audio machine driver */ |
| 42 | static u8 da850_iis_serializer_direction[] = { |
| 43 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, |
| 44 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, |
| 45 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, TX_MODE, |
| 46 | RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, |
| 47 | }; |
| 48 | |
| 49 | static struct snd_platform_data da850_evm_snd_data = { |
| 50 | .tx_dma_offset = 0x2000, |
| 51 | .rx_dma_offset = 0x2000, |
| 52 | .op_mode = DAVINCI_MCASP_IIS_MODE, |
| 53 | .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), |
| 54 | .tdm_slots = 2, |
| 55 | .serial_dir = da850_iis_serializer_direction, |
| 56 | .eventq_no = EVENTQ_1, |
| 57 | .version = MCASP_VERSION_2, |
| 58 | .txnumevt = 1, |
| 59 | .rxnumevt = 1, |
| 60 | }; |
| 61 | |
| 62 | |
Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame] | 63 | static __init void da850_evm_init(void) |
| 64 | { |
Sudhakar Rajashekhara | 5a4b131 | 2009-07-17 04:47:10 -0400 | [diff] [blame] | 65 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame] | 66 | int ret; |
| 67 | |
| 68 | ret = da8xx_register_edma(); |
| 69 | if (ret) |
| 70 | pr_warning("da850_evm_init: edma registration failed: %d\n", |
| 71 | ret); |
| 72 | |
| 73 | ret = da8xx_pinmux_setup(da850_i2c0_pins); |
| 74 | if (ret) |
| 75 | pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n", |
| 76 | ret); |
| 77 | |
| 78 | ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata); |
| 79 | if (ret) |
| 80 | pr_warning("da850_evm_init: i2c0 registration failed: %d\n", |
| 81 | ret); |
| 82 | |
Sudhakar Rajashekhara | 5a4b131 | 2009-07-17 04:47:10 -0400 | [diff] [blame] | 83 | soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK; |
| 84 | soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY; |
| 85 | soc_info->emac_pdata->rmii_en = 0; |
| 86 | |
| 87 | ret = da8xx_pinmux_setup(da850_cpgmac_pins); |
| 88 | if (ret) |
| 89 | pr_warning("da850_evm_init: cpgmac mux setup failed: %d\n", |
| 90 | ret); |
| 91 | |
| 92 | ret = da8xx_register_emac(); |
| 93 | if (ret) |
| 94 | pr_warning("da850_evm_init: emac registration failed: %d\n", |
| 95 | ret); |
| 96 | |
Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame] | 97 | ret = da8xx_register_watchdog(); |
| 98 | if (ret) |
| 99 | pr_warning("da830_evm_init: watchdog registration failed: %d\n", |
| 100 | ret); |
| 101 | |
| 102 | davinci_serial_init(&da850_evm_uart_config); |
| 103 | |
| 104 | /* |
| 105 | * shut down uart 0 and 1; they are not used on the board and |
| 106 | * accessing them causes endless "too much work in irq53" messages |
| 107 | * with arago fs |
| 108 | */ |
| 109 | __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); |
| 110 | __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); |
Chaithrika U S | 491214e | 2009-08-11 17:03:25 -0400 | [diff] [blame^] | 111 | |
| 112 | ret = da8xx_pinmux_setup(da850_mcasp_pins); |
| 113 | if (ret) |
| 114 | pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", |
| 115 | ret); |
| 116 | |
| 117 | da8xx_init_mcasp(0, &da850_evm_snd_data); |
Sudhakar Rajashekhara | 0fbc559 | 2009-07-16 06:42:18 -0400 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
| 121 | static int __init da850_evm_console_init(void) |
| 122 | { |
| 123 | return add_preferred_console("ttyS", 2, "115200"); |
| 124 | } |
| 125 | console_initcall(da850_evm_console_init); |
| 126 | #endif |
| 127 | |
| 128 | static __init void da850_evm_irq_init(void) |
| 129 | { |
| 130 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
| 131 | |
| 132 | cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA850_N_CP_INTC_IRQ, |
| 133 | soc_info->intc_irq_prios); |
| 134 | } |
| 135 | |
| 136 | static void __init da850_evm_map_io(void) |
| 137 | { |
| 138 | da850_init(); |
| 139 | } |
| 140 | |
| 141 | MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM") |
| 142 | .phys_io = IO_PHYS, |
| 143 | .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, |
| 144 | .boot_params = (DA8XX_DDR_BASE + 0x100), |
| 145 | .map_io = da850_evm_map_io, |
| 146 | .init_irq = da850_evm_irq_init, |
| 147 | .timer = &davinci_timer, |
| 148 | .init_machine = da850_evm_init, |
| 149 | MACHINE_END |