/* * linux/arch/arm/mach-davinci/board-evm.c * * TI DaVinci EVM board * * Copyright (C) 2006 Texas Instruments. * * ---------------------------------------------------------------------------- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * ---------------------------------------------------------------------------- * */ /************************************************************************** * Included Files **************************************************************************/ #include #include #include #include #include #include #include #include #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) #include #endif #include #include #include #include #include #include #include #include "clock.h" /************************************************************************** * Definitions **************************************************************************/ /************************************************************************** * Public Functions **************************************************************************/ int cpu_type(void) { return MACH_TYPE_DAVINCI_EVM; } extern void davinci_serial_init(void); extern void davinci_clk_init(void); /* * USB */ #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) static struct musb_hdrc_platform_data usb_data = { #if defined(CONFIG_USB_MUSB_OTG) /* OTG requires a Mini-AB connector */ .mode = MUSB_OTG, #elif defined(CONFIG_USB_MUSB_PERIPHERAL) .mode = MUSB_PERIPHERAL, #elif defined(CONFIG_USB_MUSB_HOST) .mode = MUSB_HOST, #endif /* irlml6401 switches 5V */ .power = 255, /* sustains 3.0+ Amps (!) */ .potpgt = 4, /* ~8 msec */ /* REVISIT multipoint is a _chip_ capability; not board specific */ .multipoint = 1, }; static struct resource usb_resources [] = { { /* physical address */ .start = DAVINCI_USB_OTG_BASE, .end = DAVINCI_USB_OTG_BASE + 0x5ff, .flags = IORESOURCE_MEM, }, { .start = IRQ_USBINT, .flags = IORESOURCE_IRQ, }, }; static u64 usb_dmamask = DMA_32BIT_MASK; static struct platform_device usb_dev = { .name = "musb_hdrc", .id = -1, .dev = { .platform_data = &usb_data, .dma_mask = &usb_dmamask, .coherent_dma_mask = DMA_32BIT_MASK, }, .resource = usb_resources, .num_resources = ARRAY_SIZE(usb_resources), }; static inline void setup_usb(void) { /* REVISIT: everything except platform_data setup should be * shared between all DaVinci boards using the same core. */ int status; status = platform_device_register(&usb_dev); if (status != 0) pr_debug("setup_usb --> %d\n", status); else board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_USB, 1); } #else static inline void setup_usb(void) { /* NOP */ } #endif /* CONFIG_USB_MUSB_HDRC */ static void board_init(void) { board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_VPSSMSTR, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_VPSSSLV, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPCC, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPTC0, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TPTC1, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_GPIO, 1); /* Turn on WatchDog timer LPSC. Needed for RESET to work */ board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TIMER0, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TIMER1, 1); board_setup_psc(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TIMER2, 1); davinci_serial_init(); /* Initialize the clock configurations */ davinci_clk_init(); } /* * DaVinci IO Mapping */ static struct map_desc davinci_io_desc[] __initdata = { { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, { IO_VIRT_EMIF, IO_PHYS_EMIF, EMIF_SIZE, MT_DEVICE }, { IRAM_VIRT, IRAM_PHYS, IRAM_SIZE, MT_DEVICE }, }; static void __init davinci_map_io(void) { extern int debug_init(unsigned int io_virt, unsigned int io_phys); #if 0 for(i = 0 ; i < ARRAY_SIZE(davinci_io_desc) ; i++) printk("[davinci_map_io] %u virt: 0x%x phys: 0x%x len: 0x%x\n", i, davinci_io_desc[i].virtual, davinci_io_desc[i].physical, davinci_io_desc[i].length); #endif iotable_init(davinci_io_desc, ARRAY_SIZE(davinci_io_desc)); debug_init((unsigned int)IO_VIRT, (unsigned int)IO_PHYS); /* Initialize the DaVinci EVM board settigs */ board_init (); } #if 0 static __init void evm_init(void) { setup_usb(); } #endif extern void davinci_irq_init(void); extern struct sys_timer davinci_timer; #if 0 /*--- 2.6.10 davinci Kernel ---*/ MACHINE_START(DAVINCI_EVM, "DaVinci EVM") MAINTAINER("Texas Instruments, PSP Team") BOOT_MEM(DAVINCI_DDR_BASE, IO_PHYS, IO_VIRT) BOOT_PARAMS(0x80000100) MAPIO(davinci_map_io) INITIRQ(davinci_irq_init) .timer = &davinci_timer, INIT_MACHINE(evm_init) MACHINE_END EXPORT_SYMBOL(cpu_type); #endif MACHINE_START(DAVINCI_EVM, "DaVinci EVM") // MAINTAINER("TI, PSP Team") // BOOT_MEM(DAVINCI_DDR_BASE, IO_PHYS, IO_VIRT) .phys_ram = DAVINCI_DDR_BASE, .phys_io = IO_PHYS, .io_pg_offst = ((IO_VIRT)>>18)&0xfffc, .boot_params = 0x80000100, .map_io = davinci_map_io, .init_irq = davinci_irq_init, .timer = &davinci_timer, /*--- .init_machine = &evm_init, ---*/ MACHINE_END