Path: blob/master/arch/sh/boards/mach-lboxre2/setup.c
15126 views
/*1* linux/arch/sh/boards/lbox/setup.c2*3* Copyright (C) 2007 Nobuhiro Iwamatsu4*5* NTT COMWARE L-BOX RE2 Support6*7* This file is subject to the terms and conditions of the GNU General Public8* License. See the file "COPYING" in the main directory of this archive9* for more details.10*11*/1213#include <linux/init.h>14#include <linux/platform_device.h>15#include <linux/ata_platform.h>16#include <asm/machvec.h>17#include <asm/addrspace.h>18#include <mach/lboxre2.h>19#include <asm/io.h>2021static struct resource cf_ide_resources[] = {22[0] = {23.start = 0x1f0,24.end = 0x1f0 + 8 ,25.flags = IORESOURCE_IO,26},27[1] = {28.start = 0x1f0 + 0x206,29.end = 0x1f0 +8 + 0x206 + 8,30.flags = IORESOURCE_IO,31},32[2] = {33.start = IRQ_CF0,34.flags = IORESOURCE_IRQ,35},36};3738static struct platform_device cf_ide_device = {39.name = "pata_platform",40.id = -1,41.num_resources = ARRAY_SIZE(cf_ide_resources),42.resource = cf_ide_resources,43};4445static struct platform_device *lboxre2_devices[] __initdata = {46&cf_ide_device,47};4849static int __init lboxre2_devices_setup(void)50{51u32 cf0_io_base; /* Boot CF base address */52pgprot_t prot;53unsigned long paddrbase, psize;5455/* open I/O area window */56paddrbase = virt_to_phys((void*)PA_AREA5_IO);57psize = PAGE_SIZE;58prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);59cf0_io_base = (u32)ioremap_prot(paddrbase, psize, pgprot_val(prot));60if (!cf0_io_base) {61printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );62return -ENOMEM;63}6465cf_ide_resources[0].start += cf0_io_base ;66cf_ide_resources[0].end += cf0_io_base ;67cf_ide_resources[1].start += cf0_io_base ;68cf_ide_resources[1].end += cf0_io_base ;6970return platform_add_devices(lboxre2_devices,71ARRAY_SIZE(lboxre2_devices));7273}74device_initcall(lboxre2_devices_setup);7576/*77* The Machine Vector78*/79static struct sh_machine_vector mv_lboxre2 __initmv = {80.mv_name = "L-BOX RE2",81.mv_nr_irqs = 72,82.mv_init_irq = init_lboxre2_IRQ,83};848586