aboutsummaryrefslogtreecommitdiff
path: root/sys/mips/rmi/iodi.c
diff options
context:
space:
mode:
authorJayachandran C. <jchandra@FreeBSD.org>2010-08-28 07:58:10 +0000
committerJayachandran C. <jchandra@FreeBSD.org>2010-08-28 07:58:10 +0000
commit97f047a80b855cb78606cc05a2d7f89e186fa27f (patch)
treef2787d84238563d8a75dc0545393d54e478b5c96 /sys/mips/rmi/iodi.c
parent90400bed63a5dd61ffece484521630caff5a87f3 (diff)
downloadsrc-97f047a80b855cb78606cc05a2d7f89e186fa27f.tar.gz
src-97f047a80b855cb78606cc05a2d7f89e186fa27f.zip
Initial code for XLR CompactFlash driver.
Submitted by: Sreekanth M. S. <kanthms at netlogicmicro com>
Notes
Notes: svn path=/head/; revision=211923
Diffstat (limited to 'sys/mips/rmi/iodi.c')
-rw-r--r--sys/mips/rmi/iodi.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/mips/rmi/iodi.c b/sys/mips/rmi/iodi.c
index 5ee961f88b9d..fc18732488b5 100644
--- a/sys/mips/rmi/iodi.c
+++ b/sys/mips/rmi/iodi.c
@@ -89,6 +89,20 @@ iodi_setup_intr(device_t, device_t, struct resource *, int,
struct iodi_softc *iodi_softc; /* There can be only one. */
+/*
+ * We will manage the Flash/PCMCIA devices in IODI for now.
+ * The NOR flash, Compact flash etc. which can be connected on
+ * various chip selects on the peripheral IO, should have a
+ * separate bus later.
+ */
+static void
+bridge_pcmcia_ack(int irq)
+{
+ xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_FLASH_OFFSET);
+
+ xlr_write_reg(mmio, 0x60, 0xffffffff);
+}
+
static int
iodi_setup_intr(device_t dev, device_t child,
struct resource *ires, int flags, driver_filter_t * filt,
@@ -112,6 +126,10 @@ iodi_setup_intr(device_t dev, device_t child,
cpu_establish_hardintr("ehci", filt, intr, arg, PIC_USB_IRQ, flags,
cookiep);
pic_setup_intr(PIC_USB_IRQ - PIC_IRQ_BASE, PIC_USB_IRQ, 0x1, 0);
+ } else if (strcmp(device_get_name(child), "ata") == 0) {
+ xlr_establish_intr("ata", filt, intr, arg, PIC_PCMCIA_IRQ, flags,
+ cookiep, bridge_pcmcia_ack);
+ pic_setup_intr(PIC_PCMCIA_IRQ - PIC_IRQ_BASE, PIC_PCMCIA_IRQ, 0x1, 0);
}
return (0);
@@ -158,6 +176,9 @@ iodi_alloc_resource(device_t bus, device_t child, int type, int *rid,
} else if (strcmp(device_get_name(child), "cfi") == 0) {
res->r_bushandle = MIPS_PHYS_TO_KSEG1(0x1c000000);
res->r_bustag = 0;
+ } else if (strcmp(device_get_name(child), "ata") == 0) {
+ res->r_bushandle = MIPS_PHYS_TO_KSEG1(0x1d000000);
+ res->r_bustag = rmi_pci_bus_space; /* byte swapping (not really PCI) */
}
/* res->r_start = *rid; */
return (res);
@@ -206,6 +227,9 @@ iodi_attach(device_t dev)
if (xlr_board_info.cfi)
device_add_child(dev, "cfi", 0);
+ if (xlr_board_info.ata)
+ device_add_child(dev, "ata", 0);
+
if (xlr_board_info.gmac_block[0].enabled) {
tmpd = device_add_child(dev, "rge", 0);
device_set_ivars(tmpd, &xlr_board_info.gmac_block[0]);