⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 board-evm.c

📁 TI达芬奇 arm+dsp双核平台Davinci 6446 EVM板的linux下的 处理器平台底层代码
💻 C
字号:
/* * 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 <linux/config.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/init.h>#include <linux/fs.h>#include <linux/major.h>#include <linux/root_dev.h>#include <linux/dma-mapping.h>#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)#include <linux/usb_musb.h>#endif#include <asm/setup.h>#include <asm/io.h>#include <asm/mach-types.h>#include <asm/mach/arch.h>#include <asm/mach/map.h>#include <asm/mach/flash.h>#include <asm/arch/hardware.h>#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);}#elsestatic 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_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 }, { DAVINCI_IRAM_VIRT,   DAVINCI_IRAM_BASE,   SZ_16K,               MT_DEVICE },};static void __initdavinci_map_io(void){	iotable_init(davinci_io_desc, ARRAY_SIZE(davinci_io_desc));	/* Initialize the DaVinci EVM board settigs */	board_init ();}static __init void evm_init(void){        setup_usb();}extern void davinci_irq_init(void);extern struct sys_timer davinci_timer;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_ENDEXPORT_SYMBOL(cpu_type);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -