Mark A. Greer | 8593790 | 2009-06-03 18:41:53 -0700 | [diff] [blame] | 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 | |
| 30 | static 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 | |
| 38 | static 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 | |
| 45 | static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = { |
| 46 | .bus_freq = 100, /* kHz */ |
| 47 | .bus_delay = 0, /* usec */ |
| 48 | }; |
| 49 | |
| 50 | static struct davinci_uart_config da830_evm_uart_config __initdata = { |
| 51 | .enabled_uarts = 0x7, |
| 52 | }; |
| 53 | |
| 54 | static __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 | |
Sudhakar Rajashekhara | c96b56c | 2009-07-16 05:45:32 -0400 | [diff] [blame^] | 64 | ret = da8xx_pinmux_setup(da830_i2c0_pins); |
Mark A. Greer | 8593790 | 2009-06-03 18:41:53 -0700 | [diff] [blame] | 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 | |
Sudhakar Rajashekhara | c96b56c | 2009-07-16 05:45:32 -0400 | [diff] [blame^] | 78 | ret = da8xx_pinmux_setup(da830_cpgmac_pins); |
Mark A. Greer | 8593790 | 2009-06-03 18:41:53 -0700 | [diff] [blame] | 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 |
| 99 | static int __init da830_evm_console_init(void) |
| 100 | { |
| 101 | return add_preferred_console("ttyS", 2, "115200"); |
| 102 | } |
| 103 | console_initcall(da830_evm_console_init); |
| 104 | #endif |
| 105 | |
| 106 | static __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 | |
| 114 | static void __init da830_evm_map_io(void) |
| 115 | { |
| 116 | da830_init(); |
| 117 | } |
| 118 | |
Kevin Hilman | baf09a4 | 2009-07-08 08:32:27 -0700 | [diff] [blame] | 119 | MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP L137 EVM") |
Mark A. Greer | 8593790 | 2009-06-03 18:41:53 -0700 | [diff] [blame] | 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, |
| 127 | MACHINE_END |