Path: blob/master/arch/sh/boards/mach-sh03/setup.c
15125 views
/*1* linux/arch/sh/boards/sh03/setup.c2*3* Copyright (C) 2004 Interface Co.,Ltd. Saito.K4*5*/67#include <linux/init.h>8#include <linux/irq.h>9#include <linux/pci.h>10#include <linux/platform_device.h>11#include <linux/ata_platform.h>12#include <asm/io.h>13#include <asm/rtc.h>14#include <mach-sh03/mach/io.h>15#include <mach-sh03/mach/sh03.h>16#include <asm/addrspace.h>1718static void __init init_sh03_IRQ(void)19{20plat_irq_setup_pins(IRQ_MODE_IRQ);21}2223/* arch/sh/boards/sh03/rtc.c */24void sh03_time_init(void);2526static void __init sh03_setup(char **cmdline_p)27{28board_time_init = sh03_time_init;29}3031static struct resource cf_ide_resources[] = {32[0] = {33.start = 0x1f0,34.end = 0x1f0 + 8,35.flags = IORESOURCE_IO,36},37[1] = {38.start = 0x1f0 + 0x206,39.end = 0x1f0 +8 + 0x206 + 8,40.flags = IORESOURCE_IO,41},42[2] = {43.start = IRL2_IRQ,44.flags = IORESOURCE_IRQ,45},46};4748static struct platform_device cf_ide_device = {49.name = "pata_platform",50.id = -1,51.num_resources = ARRAY_SIZE(cf_ide_resources),52.resource = cf_ide_resources,53};5455static struct resource heartbeat_resources[] = {56[0] = {57.start = 0xa0800000,58.end = 0xa0800000,59.flags = IORESOURCE_MEM,60},61};6263static struct platform_device heartbeat_device = {64.name = "heartbeat",65.id = -1,66.num_resources = ARRAY_SIZE(heartbeat_resources),67.resource = heartbeat_resources,68};6970static struct platform_device *sh03_devices[] __initdata = {71&heartbeat_device,72&cf_ide_device,73};7475static int __init sh03_devices_setup(void)76{77pgprot_t prot;78unsigned long paddrbase;79void *cf_ide_base;8081/* open I/O area window */82paddrbase = virt_to_phys((void *)PA_AREA5_IO);83prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);84cf_ide_base = ioremap_prot(paddrbase, PAGE_SIZE, pgprot_val(prot));85if (!cf_ide_base) {86printk("allocate_cf_area : can't open CF I/O window!\n");87return -ENOMEM;88}8990/* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */91cf_ide_resources[0].start += (unsigned long)cf_ide_base;92cf_ide_resources[0].end += (unsigned long)cf_ide_base;93cf_ide_resources[1].start += (unsigned long)cf_ide_base;94cf_ide_resources[1].end += (unsigned long)cf_ide_base;9596return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));97}98device_initcall(sh03_devices_setup);99100static struct sh_machine_vector mv_sh03 __initmv = {101.mv_name = "Interface (CTP/PCI-SH03)",102.mv_setup = sh03_setup,103.mv_nr_irqs = 48,104.mv_init_irq = init_sh03_IRQ,105};106107108