Date: Thu, 26 Jun 2008 08:55:34 GMT From: Andrew Turner <andrew@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 144131 for review Message-ID: <200806260855.m5Q8tY6n067616@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=144131 Change 144131 by andrew@andrew_bender on 2008/06/26 08:55:28 Add enough support for IRQ's to be able to call the uart interrupt handler Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/neo1973_machdep.c#4 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c2410.c#12 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c2xx0var.h#5 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/neo1973_machdep.c#4 (text+ko) ==== @@ -164,6 +164,8 @@ #undef _A #undef _S +#define ioreg_write32(a,v) (*(volatile uint32_t *)(a)=(v)) + #ifdef DDB extern vm_offset_t ksym_start, ksym_end; #endif @@ -328,6 +330,7 @@ cpu_idcache_wbinv_all(); /* Disable all peripheral interrupts */ + ioreg_write32(S3C2410_INTCTL_BASE + INTCTL_INTMSK, ~0); s3c2410_uart_vaddr = S3C2410_UART0_BASE; cninit(); ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c2410.c#12 (text+ko) ==== @@ -119,21 +119,15 @@ struct resource *ires, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { - int saved_cpsr; int error; - if (flags & INTR_TYPE_CLK) { - if (rman_get_start(ires) == 0) - rman_set_start(ires, 26); - else - rman_set_start(ires, 27); - } - saved_cpsr = SetCPSR(I32_bit, I32_bit); - SetCPSR(I32_bit, saved_cpsr & I32_bit); - error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg, cookiep); - return (error); + if (error != 0) + return (error); + + arm_unmask_irq(rman_get_start(ires)); + return (0); } static struct resource * @@ -262,12 +256,15 @@ s3c2xx0_softc->s3c2xx0_irq_rman.rm_type = RMAN_ARRAY; s3c2xx0_softc->s3c2xx0_irq_rman.rm_descr = "S3C2410 IRQs"; if (rman_init(&s3c2xx0_softc->s3c2xx0_irq_rman) != 0 || - rman_manage_region(&s3c2xx0_softc->s3c2xx0_irq_rman, 0, 32) != 0) + rman_manage_region(&s3c2xx0_softc->s3c2xx0_irq_rman, 0, + S3C2410_SUBIRQ_MAX - 1) != 0) panic("s3c2410_attach: failed to set up IRQ rman"); - device_add_child(dev, "timer", 0); - device_add_child(dev, "nand", 0); + s3c2410_add_child(dev, 0, "nand", 0); + s3c2410_add_child(dev, 0, "timer", 0); + /* Add the uart and set it's irq */ child = s3c2410_add_child(dev, 0, "uart", 0); + bus_set_resource(child, SYS_RES_IRQ, 0, S3C2410_INT_TXD0, 1); bus_generic_probe(dev); bus_generic_attach(dev); @@ -357,7 +354,7 @@ if (irq == 0) return (-1); - irq = ffs(irq) - 1; + irq = ffs(irq); /* Clear the sub irq pending bit */ bus_space_write_4(&s3c2xx0_bs_tag, ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c2xx0var.h#5 (text+ko) ==== @@ -59,6 +59,10 @@ struct rman s3c2xx0_irq_rman; }; +struct s3c2xx0_ivar { + struct resource_list resources; +}; + typedef void *s3c2xx0_chipset_tag_t; extern struct bus_space s3c2xx0_bs_tag;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806260855.m5Q8tY6n067616>