2 * arch/arm/mach-ks8695/board-dsm320.c
4 * DSM-320 D-Link Wireless Media Player, board support.
6 * Copyright 2008 Simtec Electronics
7 * Daniel Silverstone <dsilvers@simtec.co.uk>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 #include <linux/gpio.h>
14 #include <linux/kernel.h>
15 #include <linux/types.h>
16 #include <linux/interrupt.h>
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
20 #include <linux/mtd/mtd.h>
21 #include <linux/mtd/map.h>
22 #include <linux/mtd/physmap.h>
23 #include <linux/mtd/partitions.h>
25 #include <asm/mach-types.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/irq.h>
31 #include <mach/devices.h>
36 static int dsm320_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
41 return KS8695_IRQ_EXTERN0;
44 return KS8695_IRQ_EXTERN2;
47 return KS8695_IRQ_EXTERN0;
52 static struct ks8695_pci_cfg __initdata dsm320_pci = {
53 .mode = KS8695_MODE_MINIPCI,
54 .map_irq = dsm320_pci_map_irq,
57 static void __init dsm320_register_pci(void)
59 /* Initialise the GPIO lines for interrupt mode */
61 ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
63 ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW);
65 ks8695_init_pci(&dsm320_pci);
69 static inline void __init dsm320_register_pci(void) { }
72 static struct physmap_flash_data dsm320_nor_pdata = {
77 static struct resource dsm320_nor_resource[] = {
79 .start = SZ_32M, /* We expect the bootloader to map
82 .end = SZ_32M + SZ_4M - 1,
83 .flags = IORESOURCE_MEM,
87 static struct platform_device dsm320_device_nor = {
88 .name = "physmap-flash",
90 .num_resources = ARRAY_SIZE(dsm320_nor_resource),
91 .resource = dsm320_nor_resource,
93 .platform_data = &dsm320_nor_pdata,
97 void __init dsm320_register_nor(void)
101 ret = platform_device_register(&dsm320_device_nor);
103 printk(KERN_ERR "failed to register physmap-flash device\n");
106 static void __init dsm320_init(void)
108 /* GPIO registration */
109 ks8695_register_gpios();
111 /* PCI registration */
112 dsm320_register_pci();
115 ks8695_add_device_lan(); /* eth0 = LAN */
118 dsm320_register_nor();
121 MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
122 /* Maintainer: Simtec Electronics. */
123 .boot_params = KS8695_SDRAM_PA + 0x100,
124 .map_io = ks8695_map_io,
125 .init_irq = ks8695_init_irq,
126 .init_machine = dsm320_init,
127 .timer = &ks8695_timer,