Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: hp6xx pata_platform support.

Drop the hd64461 I/O ops and wire up pata_platform for MMIO.

Signed-off-by: Kristoffer Ericson <Kristoffer_e1@hotmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Kristoffer Ericson and committed by
Paul Mundt
34a780a0 dd126662

+37 -30
+37 -30
arch/sh/boards/hp6xx/setup.c
··· 2 2 * linux/arch/sh/boards/hp6xx/setup.c 3 3 * 4 4 * Copyright (C) 2002 Andriy Skulysh 5 + * Copyright (C) 2007 Kristoffer Ericson <Kristoffer_e1@hotmail.com> 5 6 * 6 7 * May be copied or modified under the terms of the GNU General Public 7 8 * License. See linux/COPYING for more information. ··· 11 10 */ 12 11 #include <linux/types.h> 13 12 #include <linux/init.h> 13 + #include <linux/platform_device.h> 14 14 #include <asm/hd64461.h> 15 15 #include <asm/io.h> 16 16 #include <asm/irq.h> ··· 20 18 21 19 #define SCPCR 0xa4000116 22 20 #define SCPDR 0xa4000136 21 + 22 + /* CF Slot */ 23 + static struct resource cf_ide_resources[] = { 24 + [0] = { 25 + .start = 0x15000000 + 0x1f0, 26 + .end = 0x15000000 + 0x1f0 + 0x08 - 0x01, 27 + .flags = IORESOURCE_MEM, 28 + }, 29 + [1] = { 30 + .start = 0x15000000 + 0x1fe, 31 + .end = 0x15000000 + 0x1fe + 0x01, 32 + .flags = IORESOURCE_MEM, 33 + }, 34 + [2] = { 35 + .start = 93, 36 + .flags = IORESOURCE_IRQ, 37 + }, 38 + }; 39 + 40 + static struct platform_device cf_ide_device = { 41 + .name = "pata_platform", 42 + .id = -1, 43 + .num_resources = ARRAY_SIZE(cf_ide_resources), 44 + .resource = cf_ide_resources, 45 + }; 46 + 47 + static struct platform_device *hp6xx_devices[] __initdata = { 48 + &cf_ide_device, 49 + }; 50 + 51 + static int __init hp6xx_devices_setup(void) 52 + { 53 + return platform_add_devices(hp6xx_devices, ARRAY_SIZE(hp6xx_devices)); 54 + } 23 55 24 56 static void __init hp6xx_setup(char **cmdline_p) 25 57 { ··· 96 60 v |= SCPCR_TS_ENABLE; 97 61 ctrl_outw(v, SCPCR); 98 62 } 63 + device_initcall(hp6xx_devices_setup); 99 64 100 - /* 101 - * XXX: This is stupid, we should have a generic machine vector for the cchips 102 - * and just wrap the platform setup code in to this, as it's the only thing 103 - * that ends up being different. 104 - */ 105 65 struct sh_machine_vector mv_hp6xx __initmv = { 106 66 .mv_name = "hp6xx", 107 67 .mv_setup = hp6xx_setup, 108 68 .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM, 109 - 110 - .mv_inb = hd64461_inb, 111 - .mv_inw = hd64461_inw, 112 - .mv_inl = hd64461_inl, 113 - .mv_outb = hd64461_outb, 114 - .mv_outw = hd64461_outw, 115 - .mv_outl = hd64461_outl, 116 - 117 - .mv_inb_p = hd64461_inb_p, 118 - .mv_inw_p = hd64461_inw, 119 - .mv_inl_p = hd64461_inl, 120 - .mv_outb_p = hd64461_outb_p, 121 - .mv_outw_p = hd64461_outw, 122 - .mv_outl_p = hd64461_outl, 123 - 124 - .mv_insb = hd64461_insb, 125 - .mv_insw = hd64461_insw, 126 - .mv_insl = hd64461_insl, 127 - .mv_outsb = hd64461_outsb, 128 - .mv_outsw = hd64461_outsw, 129 - .mv_outsl = hd64461_outsl, 130 - 131 - .mv_readw = hd64461_readw, 132 - .mv_writew = hd64461_writew, 133 - 134 69 .mv_irq_demux = hd64461_irq_demux, 135 70 }; 136 71 ALIAS_MV(hp6xx)