12 #include <linux/kernel.h>
18 #include <linux/i2c.h>
37 #define DA830_EVM_PHY_ID ""
41 #define ON_BD_USB_DRV GPIO_TO_PIN(1, 15)
42 #define ON_BD_USB_OVC GPIO_TO_PIN(2, 4)
44 static const short da830_evm_usb11_pins[] = {
51 static int da830_evm_usb_set_power(
unsigned port,
int on)
57 static int da830_evm_usb_get_power(
unsigned port)
62 static int da830_evm_usb_get_oci(
unsigned port)
67 static irqreturn_t da830_evm_usb_ocic_irq(
int,
void *);
74 if (handler !=
NULL) {
75 da830_evm_usb_ocic_handler = handler;
79 "OHCI over-current indicator",
NULL);
82 "over-current indicator changes\n", __func__);
90 .set_power = da830_evm_usb_set_power,
91 .get_power = da830_evm_usb_get_power,
92 .get_oci = da830_evm_usb_get_oci,
93 .ocic_notify = da830_evm_usb_ocic_notify,
96 .potpgt = (3 + 1) / 2,
101 da830_evm_usb_ocic_handler(&da830_evm_usb11_pdata, 1);
105 static __init void da830_evm_usb_init(
void)
135 #ifdef CONFIG_USB_MUSB_HOST
146 pr_warning(
"%s: USB 2.0 PinMux setup failed: %d\n",
155 pr_warning(
"%s: USB 2.0 registration failed: %d\n",
161 pr_warning(
"%s: USB 1.1 PinMux setup failed: %d\n",
169 "power control: %d\n", __func__, ret);
177 "over-current indicator: %d\n", __func__, ret);
184 pr_warning(
"%s: USB 1.1 registration failed: %d\n",
189 .enabled_uarts = 0x7,
192 static const short da830_evm_mcasp1_pins[] = {
200 static u8 da830_iis_serializer_direction[] = {
207 .tx_dma_offset = 0x2000,
208 .rx_dma_offset = 0x2000,
210 .num_serializer =
ARRAY_SIZE(da830_iis_serializer_direction),
212 .serial_dir = da830_iis_serializer_direction,
222 static const short da830_evm_mmc_sd_pins[] = {
230 #define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1)
231 #define DA830_MMCSD_CD_PIN GPIO_TO_PIN(2, 2)
233 static int da830_evm_mmc_get_ro(
int index)
238 static int da830_evm_mmc_get_cd(
int index)
244 .get_ro = da830_evm_mmc_get_ro,
245 .get_cd = da830_evm_mmc_get_cd,
247 .max_freq = 50000000,
252 static inline void da830_evm_init_mmc(
void)
258 pr_warning(
"da830_evm_init: mmc/sd mux setup failed: %d\n",
265 pr_warning(
"da830_evm_init: can not open GPIO %d\n",
273 pr_warning(
"da830_evm_init: can not open GPIO %d\n",
281 pr_warning(
"da830_evm_init: mmc/sd registration failed: %d\n",
290 static const short da830_evm_emif25_pins[] = {
301 #if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE)
307 #ifdef CONFIG_DA830_UI_NAND
311 .
name =
"bootloader",
332 .name =
"filesystem",
340 static uint8_t da830_evm_nand_bbt_pattern[] = {
'B',
'b',
't',
'0' };
341 static uint8_t da830_evm_nand_mirror_pattern[] = {
'1',
't',
'b',
'B' };
351 .pattern = da830_evm_nand_bbt_pattern
362 .pattern = da830_evm_nand_mirror_pattern
376 .
parts = da830_evm_nand_partitions,
377 .nr_parts =
ARRAY_SIZE(da830_evm_nand_partitions),
381 .bbt_td = &da830_evm_nand_bbt_main_descr,
382 .bbt_md = &da830_evm_nand_bbt_mirror_descr,
383 .timing = &da830_evm_nandflash_timing,
386 static struct resource da830_evm_nand_resources[] = {
400 .
name =
"davinci_nand",
403 .platform_data = &da830_evm_nand_pdata,
405 .num_resources =
ARRAY_SIZE(da830_evm_nand_resources),
406 .resource = da830_evm_nand_resources,
409 static inline void da830_evm_init_nand(
int mux_mode)
414 pr_warning(
"WARNING: both MMC/SD and NAND are "
415 "enabled, but they share AEMIF pins.\n"
416 "\tDisable MMC/SD for NAND support.\n");
422 pr_warning(
"da830_evm_init: emif25 mux setup failed: %d\n",
427 pr_warning(
"da830_evm_init: NAND device not registered.\n");
432 static inline void da830_evm_init_nand(
int mux_mode) { }
435 #ifdef CONFIG_DA830_UI_LCD
436 static inline void da830_evm_init_lcdc(
int mux_mode)
442 pr_warning(
"da830_evm_init: lcdcntl mux setup failed: %d\n",
447 pr_warning(
"da830_evm_init: lcd setup failed: %d\n", ret);
452 static inline void da830_evm_init_lcdc(
int mux_mode) { }
460 .context = (
void *)0x7f00,
471 da830_evm_init_lcdc(gpio + 6);
473 da830_evm_init_nand(gpio + 6);
487 .setup = da830_evm_ui_expander_setup,
488 .teardown = da830_evm_ui_expander_teardown,
491 static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
494 .platform_data = &da830_evm_i2c_eeprom_info,
501 .platform_data = &da830_evm_ui_expander_info,
515 static const s16 da830_dma_rsv_chans[][2] = {
524 static const s16 da830_dma_rsv_slots[][2] = {
535 .rsv_chans = da830_dma_rsv_chans,
536 .rsv_slots = da830_dma_rsv_slots,
560 .name =
"U-Boot-Environment",
575 .parts = da830evm_spiflash_part,
576 .nr_parts =
ARRAY_SIZE(da830evm_spiflash_part),
588 .modalias =
"m25p80",
589 .platform_data = &da830evm_spiflash_data,
590 .controller_data = &da830evm_spiflash_cfg,
592 .max_speed_hz = 30000000,
598 static __init void da830_evm_init(
void)
605 pr_warning(
"da830_evm_init: edma registration failed: %d\n",
610 pr_warning(
"da830_evm_init: i2c0 mux setup failed: %d\n",
615 pr_warning(
"da830_evm_init: i2c0 registration failed: %d\n",
618 da830_evm_usb_init();
625 pr_warning(
"da830_evm_init: cpgmac mux setup failed: %d\n",
630 pr_warning(
"da830_evm_init: emac registration failed: %d\n",
635 pr_warning(
"da830_evm_init: watchdog registration failed: %d\n",
644 pr_warning(
"da830_evm_init: mcasp1 mux setup failed: %d\n",
649 da830_evm_init_mmc();
653 pr_warning(
"da830_evm_init: rtc setup failed: %d\n", ret);
658 pr_warning(
"da830_evm_init: spi 0 registration failed: %d\n",
662 #ifdef CONFIG_SERIAL_8250_CONSOLE
663 static int __init da830_evm_console_init(
void)
665 if (!machine_is_davinci_da830_evm())
673 static void __init da830_evm_map_io(
void)
678 MACHINE_START(DAVINCI_DA830_EVM,
"DaVinci DA830/OMAP-L137/AM17x EVM")
679 .atag_offset = 0x100,
680 .map_io = da830_evm_map_io,
683 .init_machine = da830_evm_init,