1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/mach-ks8695/board-dsm320.c
5 * DSM-320 D-Link Wireless Media Player, board support.
7 * Copyright 2008 Simtec Electronics
8 * Daniel Silverstone <dsilvers@simtec.co.uk>
10 #include <linux/gpio.h>
11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/interrupt.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
17 #include <linux/mtd/mtd.h>
18 #include <linux/mtd/map.h>
19 #include <linux/mtd/physmap.h>
20 #include <linux/mtd/partitions.h>
22 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/irq.h>
29 #include <mach/gpio-ks8695.h>
34 static int dsm320_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
39 return KS8695_IRQ_EXTERN0;
42 return KS8695_IRQ_EXTERN2;
45 return KS8695_IRQ_EXTERN0;
50 static struct ks8695_pci_cfg __initdata dsm320_pci = {
51 .mode = KS8695_MODE_MINIPCI,
52 .map_irq = dsm320_pci_map_irq,
55 static void __init dsm320_register_pci(void)
57 /* Initialise the GPIO lines for interrupt mode */
59 ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
61 ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW);
63 ks8695_init_pci(&dsm320_pci);
67 static inline void __init dsm320_register_pci(void) { }
70 static struct physmap_flash_data dsm320_nor_pdata = {
75 static struct resource dsm320_nor_resource[] = {
77 .start = SZ_32M, /* We expect the bootloader to map
80 .end = SZ_32M + SZ_4M - 1,
81 .flags = IORESOURCE_MEM,
85 static struct platform_device dsm320_device_nor = {
86 .name = "physmap-flash",
88 .num_resources = ARRAY_SIZE(dsm320_nor_resource),
89 .resource = dsm320_nor_resource,
91 .platform_data = &dsm320_nor_pdata,
95 void __init dsm320_register_nor(void)
99 ret = platform_device_register(&dsm320_device_nor);
101 printk(KERN_ERR "failed to register physmap-flash device\n");
104 static void __init dsm320_init(void)
106 /* GPIO registration */
107 ks8695_register_gpios();
109 /* PCI registration */
110 dsm320_register_pci();
113 ks8695_add_device_lan(); /* eth0 = LAN */
116 dsm320_register_nor();
119 MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
120 /* Maintainer: Simtec Electronics. */
121 .atag_offset = 0x100,
122 .map_io = ks8695_map_io,
123 .init_irq = ks8695_init_irq,
124 .init_machine = dsm320_init,
125 .init_time = ks8695_timer_init,
126 .restart = ks8695_restart,