2 * TI DA830/OMAP L137 EVM board
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 * Derived from: arch/arm/mach-davinci/board-dm644x-evm.c
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
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>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
22 #include <mach/common.h>
23 #include <mach/irqs.h>
24 #include <mach/cp_intc.h>
25 #include <mach/da8xx.h>
28 #define DA830_EVM_PHY_MASK 0x0
29 #define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
31 static struct at24_platform_data da830_evm_i2c_eeprom_info
= {
32 .byte_len
= SZ_256K
/ 8,
34 .flags
= AT24_FLAG_ADDR16
,
35 .setup
= davinci_get_mac_addr
,
36 .context
= (void *)0x7f00,
39 static struct i2c_board_info __initdata da830_evm_i2c_devices
[] = {
41 I2C_BOARD_INFO("24c256", 0x50),
42 .platform_data
= &da830_evm_i2c_eeprom_info
,
45 I2C_BOARD_INFO("tlv320aic3x", 0x18),
49 static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata
= {
50 .bus_freq
= 100, /* kHz */
51 .bus_delay
= 0, /* usec */
54 static struct davinci_uart_config da830_evm_uart_config __initdata
= {
58 static u8 da830_iis_serializer_direction
[] = {
59 RX_MODE
, INACTIVE_MODE
, INACTIVE_MODE
, INACTIVE_MODE
,
60 INACTIVE_MODE
, TX_MODE
, INACTIVE_MODE
, INACTIVE_MODE
,
61 INACTIVE_MODE
, INACTIVE_MODE
, INACTIVE_MODE
, INACTIVE_MODE
,
64 static struct snd_platform_data da830_evm_snd_data
= {
65 .tx_dma_offset
= 0x2000,
66 .rx_dma_offset
= 0x2000,
67 .op_mode
= DAVINCI_MCASP_IIS_MODE
,
68 .num_serializer
= ARRAY_SIZE(da830_iis_serializer_direction
),
70 .serial_dir
= da830_iis_serializer_direction
,
71 .eventq_no
= EVENTQ_0
,
72 .version
= MCASP_VERSION_2
,
77 static __init
void da830_evm_init(void)
79 struct davinci_soc_info
*soc_info
= &davinci_soc_info
;
82 ret
= da8xx_register_edma();
84 pr_warning("da830_evm_init: edma registration failed: %d\n",
87 ret
= da8xx_pinmux_setup(da830_i2c0_pins
);
89 pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n",
92 ret
= da8xx_register_i2c(0, &da830_evm_i2c_0_pdata
);
94 pr_warning("da830_evm_init: i2c0 registration failed: %d\n",
97 soc_info
->emac_pdata
->phy_mask
= DA830_EVM_PHY_MASK
;
98 soc_info
->emac_pdata
->mdio_max_freq
= DA830_EVM_MDIO_FREQUENCY
;
99 soc_info
->emac_pdata
->rmii_en
= 1;
101 ret
= da8xx_pinmux_setup(da830_cpgmac_pins
);
103 pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n",
106 ret
= da8xx_register_emac();
108 pr_warning("da830_evm_init: emac registration failed: %d\n",
111 ret
= da8xx_register_watchdog();
113 pr_warning("da830_evm_init: watchdog registration failed: %d\n",
116 davinci_serial_init(&da830_evm_uart_config
);
117 i2c_register_board_info(1, da830_evm_i2c_devices
,
118 ARRAY_SIZE(da830_evm_i2c_devices
));
120 ret
= da8xx_pinmux_setup(da830_mcasp1_pins
);
122 pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n",
125 da8xx_init_mcasp(1, &da830_evm_snd_data
);
128 #ifdef CONFIG_SERIAL_8250_CONSOLE
129 static int __init
da830_evm_console_init(void)
131 return add_preferred_console("ttyS", 2, "115200");
133 console_initcall(da830_evm_console_init
);
136 static __init
void da830_evm_irq_init(void)
138 struct davinci_soc_info
*soc_info
= &davinci_soc_info
;
140 cp_intc_init((void __iomem
*)DA8XX_CP_INTC_VIRT
, DA830_N_CP_INTC_IRQ
,
141 soc_info
->intc_irq_prios
);
144 static void __init
da830_evm_map_io(void)
149 MACHINE_START(DAVINCI_DA830_EVM
, "DaVinci DA830/OMAP L137 EVM")
151 .io_pg_offst
= (__IO_ADDRESS(IO_PHYS
) >> 18) & 0xfffc,
152 .boot_params
= (DA8XX_DDR_BASE
+ 0x100),
153 .map_io
= da830_evm_map_io
,
154 .init_irq
= da830_evm_irq_init
,
155 .timer
= &davinci_timer
,
156 .init_machine
= da830_evm_init
,