Path: blob/master/arch/arm/mach-ks8695/board-dsm320.c
10817 views
/*1* arch/arm/mach-ks8695/board-dsm320.c2*3* DSM-320 D-Link Wireless Media Player, board support.4*5* Copyright 2008 Simtec Electronics6* Daniel Silverstone <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License version 2 as10* published by the Free Software Foundation.11*/1213#include <linux/kernel.h>14#include <linux/types.h>15#include <linux/interrupt.h>16#include <linux/init.h>17#include <linux/platform_device.h>1819#include <linux/mtd/mtd.h>20#include <linux/mtd/map.h>21#include <linux/mtd/physmap.h>22#include <linux/mtd/partitions.h>2324#include <asm/mach-types.h>2526#include <asm/mach/arch.h>27#include <asm/mach/map.h>28#include <asm/mach/irq.h>2930#include <mach/devices.h>31#include <mach/gpio.h>3233#include "generic.h"3435#ifdef CONFIG_PCI36static int dsm320_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)37{38switch (slot) {39case 0:40/* PCI-AHB bridge? */41return KS8695_IRQ_EXTERN0;42case 18:43/* Mini PCI slot */44return KS8695_IRQ_EXTERN2;45case 20:46/* RealMAGIC chip */47return KS8695_IRQ_EXTERN0;48}49BUG();50}5152static struct ks8695_pci_cfg __initdata dsm320_pci = {53.mode = KS8695_MODE_MINIPCI,54.map_irq = dsm320_pci_map_irq,55};5657static void __init dsm320_register_pci(void)58{59/* Initialise the GPIO lines for interrupt mode */60/* RealMAGIC */61ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);62/* MiniPCI Slot */63ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW);6465ks8695_init_pci(&dsm320_pci);66}6768#else69static inline void __init dsm320_register_pci(void) { }70#endif7172static struct physmap_flash_data dsm320_nor_pdata = {73.width = 4,74.nr_parts = 0,75};7677static struct resource dsm320_nor_resource[] = {78[0] = {79.start = SZ_32M, /* We expect the bootloader to map80* the flash here.81*/82.end = SZ_32M + SZ_4M - 1,83.flags = IORESOURCE_MEM,84}85};8687static struct platform_device dsm320_device_nor = {88.name = "physmap-flash",89.id = -1,90.num_resources = ARRAY_SIZE(dsm320_nor_resource),91.resource = dsm320_nor_resource,92.dev = {93.platform_data = &dsm320_nor_pdata,94},95};9697void __init dsm320_register_nor(void)98{99int ret;100101ret = platform_device_register(&dsm320_device_nor);102if (ret < 0)103printk(KERN_ERR "failed to register physmap-flash device\n");104}105106static void __init dsm320_init(void)107{108/* GPIO registration */109ks8695_register_gpios();110111/* PCI registration */112dsm320_register_pci();113114/* Network device */115ks8695_add_device_lan(); /* eth0 = LAN */116117/* NOR devices */118dsm320_register_nor();119}120121MACHINE_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,128MACHINE_END129130131