📄 pnp2110.c
字号:
/* * linux/arch/arm/mach-pxa/pnp2110.c * * (C) 2003 SSV Marco Hasewinkel, Embedded Systems * (C) 2004 Pengutronix, Robert Schwebel * * Support for the SSV PNP/2110-3V Platform. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#include <linux/kernel.h>#include <linux/init.h>#include <linux/device.h>#include <linux/major.h>#include <linux/fs.h>#include <linux/interrupt.h>#include <asm/setup.h>#include <asm/memory.h>#include <asm/mach-types.h>#include <asm/hardware.h>#include <asm/irq.h>#include <asm/mach/arch.h>#include <asm/mach/map.h>#include <asm/mach/irq.h>#include <asm/arch/irq.h>#include <asm/arch/pnp2110.h>#include "generic.h"/* * FIXME: RSC: * * - fix memory tag in bootloader * * - direction for GPIOs: * set_GPIO_IRQ_edge(1 ,GPIO_RISING_EDGE); GPIO1 = EXT IRQ * *//* * Interrupt Initialisation */static void __init pnp2110_init_irq(void){ pxa_init_irq(); set_irq_type(PNP2110_ETH_IRQ, PNP2110_ETH_IRQ_EDGE);}/* * Ressource entries for onboard devices */static struct resource smc91x_resources[] = { [0] = { .start = PNP2110_ETH_PHYS, .end = PNP2110_ETH_PHYS + PNP2110_ETH_SIZE - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = PNP2110_ETH_IRQ, .end = PNP2110_ETH_IRQ, .flags = IORESOURCE_IRQ, },};static struct platform_device smc91x_device = { .name = "smc91x", .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources,};static struct platform_device *devices[] __initdata = { &smc91x_device,};/* * Specific Board Initialisation */static int __init pnp2110_init(void){ /* init pnp2110 irqs */ /* FIXME: add here if we need platform specific non-modular interrupts */ /* add device entries */ return platform_add_devices(devices, ARRAY_SIZE(devices));}subsys_initcall(pnp2110_init);static struct map_desc pnp2110_io_desc[] __initdata = {/* virtual physical length type */ { PNP2110_ETH_VIRT, PNP2110_ETH_PHYS, PNP2110_ETH_SIZE, MT_DEVICE }, /* ETH SMSC 91111 */};static void __init pnp2110_map_io(void){ pxa_map_io(); iotable_init(pnp2110_io_desc, ARRAY_SIZE(pnp2110_io_desc)); /* Enable the BTUART */ CKEN |= CKEN7_BTUART; pxa_gpio_mode(GPIO42_BTRXD_MD); pxa_gpio_mode(GPIO43_BTTXD_MD); pxa_gpio_mode(GPIO44_BTCTS_MD); pxa_gpio_mode(GPIO45_BTRTS_MD);// pxa_gpio_mode(GPIO33_nCS_5_MD); /* SMSC network chip */ /* setup sleep mode values */ PWER = 0x00000002; PFER = 0x00000000; PRER = 0x00000002; PGSR0 = 0x00008000; PGSR1 = 0x003F0202; PGSR2 = 0x0001C000; PCFR |= PCFR_OPDE; /* PCMCIA Socket 0 Timing - SSV has the ethernet chip located there */ MCMEM0 = 0x00000000; MECR = 0x00000003;}static void __initpnp2110_fixup(struct machine_desc *desc, struct tag *tag, char **cmdline, struct meminfo *mi){ /* FIXME: put this into bootloader */ SET_BANK(0, 0xa0000000, (64*1024*1024)); mi->nr_banks = 1;}MACHINE_START(PNP2110, "SSV PNP/2110-3V Platform") MAINTAINER("Robert Schwebel, Pengutronix") BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) BOOT_PARAMS(0xa0000100) FIXUP(pnp2110_fixup) MAPIO(pnp2110_map_io) INITIRQ(pnp2110_init_irq)MACHINE_END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -