aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/renesas/r7780rp/setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-14 21:29:06 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-14 21:29:06 -0800
commit11d64be6a631236b3b3d21711c7d1a83d9f85904 (patch)
treeddd4d2444ff79cc9866d30c35c16f75e0c6ce16d /arch/sh/boards/renesas/r7780rp/setup.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt (diff)
parentsh: Fix multiple UTLB hit on UP SH-4. (diff)
downloadlinux-dev-11d64be6a631236b3b3d21711c7d1a83d9f85904.tar.xz
linux-dev-11d64be6a631236b3b3d21711c7d1a83d9f85904.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (46 commits) sh: Fix multiple UTLB hit on UP SH-4. sh: fix pci io access for r2d boards sh: fix ioreadN_rep and iowriteN_rep sh: use ctrl_in/out for on chip pci access sh: Kill off more dead symbols. sh: __uncached_start only on sh32. sh: asm/irq.h needs asm/cpu/irq.h. serial: sh-sci: Fix up SH-5 build. sh: Get SH-5 caches working again post-unification. maple: Fix up maple build failure. sh: Kill off bogus SH_SDK7780_STANDALONE symbol. sh: asm/tlb.h needs linux/pagemap.h for CONFIG_SWAP=n. sh: Tidy include/asm-sh/hp6xx.h maple: improve detection of attached peripherals sh: Shut up some trivial build warnings. sh: Update SH-5 flush_cache_sigtramp() for API changes. sh: Fix up set_fixmap_nocache() for SH-5. sh: Fix up pte_mkhuge() build breakage for SH-5. sh: Disable big endian for SH-5. sh: Handle SH7366 CPU in check_bugs(). ...
Diffstat (limited to 'arch/sh/boards/renesas/r7780rp/setup.c')
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
index f7a8d5c9d510..2f68bea7890c 100644
--- a/arch/sh/boards/renesas/r7780rp/setup.c
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -23,6 +23,7 @@
#include <asm/clock.h>
#include <asm/heartbeat.h>
#include <asm/io.h>
+#include <asm/io_trapped.h>
static struct resource r8a66597_usb_host_resources[] = {
[0] = {
@@ -181,13 +182,27 @@ static struct platform_device *r7780rp_devices[] __initdata = {
&m66592_usb_peripheral_device,
&heartbeat_device,
#ifndef CONFIG_SH_R7780RP
- &cf_ide_device,
&ax88796_device,
#endif
};
+/*
+ * The CF is connected using a 16-bit bus where 8-bit operations are
+ * unsupported. The linux ata driver is however using 8-bit operations, so
+ * insert a trapped io filter to convert 8-bit operations into 16-bit.
+ */
+static struct trapped_io cf_trapped_io = {
+ .resource = cf_ide_resources,
+ .num_resources = 2,
+ .minimum_bus_width = 16,
+};
+
static int __init r7780rp_devices_setup(void)
{
+#ifndef CONFIG_SH_R7780RP
+ if (register_trapped_io(&cf_trapped_io) == 0)
+ platform_device_register(&cf_ide_device);
+#endif
return platform_add_devices(r7780rp_devices,
ARRAY_SIZE(r7780rp_devices));
}
@@ -226,34 +241,6 @@ static void r7780rp_power_off(void)
ctrl_outw(0x0001, PA_POFF);
}
-static inline unsigned char is_ide_ioaddr(unsigned long addr)
-{
- return ((cf_ide_resources[0].start <= addr &&
- addr <= cf_ide_resources[0].end) ||
- (cf_ide_resources[1].start <= addr &&
- addr <= cf_ide_resources[1].end));
-}
-
-void highlander_writeb(u8 b, void __iomem *addr)
-{
- unsigned long tmp = (unsigned long __force)addr;
-
- if (is_ide_ioaddr(tmp))
- ctrl_outw((u16)b, tmp);
- else
- ctrl_outb(b, tmp);
-}
-
-u8 highlander_readb(void __iomem *addr)
-{
- unsigned long tmp = (unsigned long __force)addr;
-
- if (is_ide_ioaddr(tmp))
- return ctrl_inw(tmp) & 0xff;
- else
- return ctrl_inb(tmp);
-}
-
/*
* Initialize the board
*/
@@ -338,6 +325,4 @@ static struct sh_machine_vector mv_highlander __initmv = {
.mv_setup = highlander_setup,
.mv_init_irq = highlander_init_irq,
.mv_irq_demux = highlander_irq_demux,
- .mv_readb = highlander_readb,
- .mv_writeb = highlander_writeb,
};