Date: Fri, 6 Jan 2006 23:09:11 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 89305 for review Message-ID: <200601062309.k06N9BO0055430@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=89305 Change 89305 by imp@imp_Speedy on 2006/01/06 23:08:41 This stuff appears to be generic for all AT91 processors that FreeBSD is likely to support, so rename it from at91rm92 (which is a pain to type) to plain at91. File renaming will happen in a bit. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91rm92.c#12 edit .. //depot/projects/arm/src/sys/arm/at91/at91rm92timer.c#6 edit .. //depot/projects/arm/src/sys/arm/at91/at91rm92var.h#4 edit .. //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#6 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91rm92.c#12 (text+ko) ==== @@ -45,10 +45,10 @@ #include <arm/at91/at91rm92reg.h> #include <arm/at91/at91rm92var.h> -static struct at91rm92_softc *at91rm92_softc; +static struct at91_softc *at91_softc; static int -at91rm92_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, +at91_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { vm_paddr_t pa, endpa; @@ -64,7 +64,7 @@ } static void -at91rm92_bs_unmap(void *t, bus_size_t size) +at91_bs_unmap(void *t, bus_size_t size) { vm_offset_t va, endva; @@ -76,7 +76,7 @@ } static int -at91rm92_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, +at91_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp) { @@ -87,14 +87,14 @@ bs_protos(generic); bs_protos(generic_armv4); -struct bus_space at91rm92_bs_tag = { +struct bus_space at91_bs_tag = { /* cookie */ (void *) 0, /* mapping/unmapping */ - at91rm92_bs_map, - at91rm92_bs_unmap, - at91rm92_bs_subregion, + at91_bs_map, + at91_bs_unmap, + at91_bs_subregion, /* allocation/deallocation */ NULL, @@ -159,14 +159,14 @@ }; static int -at91rm92_probe(device_t dev) +at91_probe(device_t dev) { device_set_desc(dev, "AT91RM9200 device bus"); return (0); } static void -at91rm92_identify(driver_t *drv, device_t parent) +at91_identify(driver_t *drv, device_t parent) { BUS_ADD_CHILD(parent, 0, "atmelarm", 0); @@ -188,11 +188,11 @@ extern void irq_entry(void); static void -at91rm92_add_child(device_t dev, int prio, const char *name, int unit, +at91_add_child(device_t dev, int prio, const char *name, int unit, bus_addr_t addr, bus_size_t size, int irq) { device_t kid; - struct at91rm92_ivar *ivar; + struct at91_ivar *ivar; kid = device_add_child_ordered(dev, prio, name, unit); if (kid == NULL) @@ -212,13 +212,13 @@ static int -at91rm92_attach(device_t dev) +at91_attach(device_t dev) { - struct at91rm92_softc *sc = device_get_softc(dev); + struct at91_softc *sc = device_get_softc(dev); int i; - at91rm92_softc = sc; - sc->sc_st = &at91rm92_bs_tag; + at91_softc = sc; + sc->sc_st = &at91_bs_tag; sc->sc_sh = AT91RM92_BASE; sc->dev = dev; if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_SYS_BASE, @@ -230,11 +230,11 @@ sc->sc_mem_rman.rm_descr = "AT91RM92 Memory"; if (rman_init(&sc->sc_irq_rman) != 0 || rman_manage_region(&sc->sc_irq_rman, 1, 31) != 0) - panic("at91rm92_attach: failed to set up IRQ rman"); + panic("at91_attach: failed to set up IRQ rman"); if (rman_init(&sc->sc_mem_rman) != 0 || rman_manage_region(&sc->sc_mem_rman, 0xfff00000ul, 0xfffffffful) != 0) - panic("at91rm92_attach: failed to set up memory rman"); + panic("at91_attach: failed to set up memory rman"); for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_SVR + @@ -255,35 +255,35 @@ bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_ICCR, 0xffffffff); - at91rm92_add_child(dev, 0, "at91rm92_timer", 0, 0, 0, 1); - at91rm92_add_child(dev, 10, "atudp", 0, AT91RM92_BASE + // UDP + at91_add_child(dev, 0, "at91rm92_timer", 0, 0, 0, 1); + at91_add_child(dev, 10, "atudp", 0, AT91RM92_BASE + // UDP AT91RM92_UDP_BASE, AT91RM92_UDP_SIZE, AT91RM92_IRQ_UDP); - at91rm92_add_child(dev, 10, "mci", 0, AT91RM92_BASE + // MCI + at91_add_child(dev, 10, "mci", 0, AT91RM92_BASE + // MCI AT91RM92_MCI_BASE, AT91RM92_MCI_SIZE, AT91RM92_IRQ_MCI); - at91rm92_add_child(dev, 10, "twi", 0, AT91RM92_BASE + // TWI + at91_add_child(dev, 10, "twi", 0, AT91RM92_BASE + // TWI AT91RM92_TWI_BASE, AT91RM92_TWI_SIZE, AT91RM92_IRQ_TWI); - at91rm92_add_child(dev, 10, "ate", 0, AT91RM92_BASE + // EMAC + at91_add_child(dev, 10, "ate", 0, AT91RM92_BASE + // EMAC AT91RM92_EMAC_BASE, AT91RM92_EMAC_SIZE, AT91RM92_IRQ_EMAC); - at91rm92_add_child(dev, 10, "uart", 0, AT91RM92_BASE + // DBGU + at91_add_child(dev, 10, "uart", 0, AT91RM92_BASE + // DBGU AT91RM92_SYS_BASE + DBGU, DBGU_SIZE, AT91RM92_IRQ_SYSTEM); - at91rm92_add_child(dev, 10, "uart", 1, AT91RM92_BASE + // USART0 + at91_add_child(dev, 10, "uart", 1, AT91RM92_BASE + // USART0 AT91RM92_USART0_BASE, AT91RM92_USART_SIZE, AT91RM92_IRQ_USART0); - at91rm92_add_child(dev, 10, "uart", 2, AT91RM92_BASE + // USART1 + at91_add_child(dev, 10, "uart", 2, AT91RM92_BASE + // USART1 AT91RM92_USART1_BASE, AT91RM92_USART_SIZE, AT91RM92_IRQ_USART1); - at91rm92_add_child(dev, 10, "uart", 3, AT91RM92_BASE + // USART2 + at91_add_child(dev, 10, "uart", 3, AT91RM92_BASE + // USART2 AT91RM92_USART2_BASE, AT91RM92_USART_SIZE, AT91RM92_IRQ_USART2); - at91rm92_add_child(dev, 10, "uart", 4, AT91RM92_BASE + // USART3 + at91_add_child(dev, 10, "uart", 4, AT91RM92_BASE + // USART3 AT91RM92_USART3_BASE, AT91RM92_USART_SIZE, AT91RM92_IRQ_USART3); - at91rm92_add_child(dev, 10, "ssc", 0, AT91RM92_BASE + // SSC0 + at91_add_child(dev, 10, "ssc", 0, AT91RM92_BASE + // SSC0 AT91RM92_SSC0_BASE, AT91RM92_SSC_SIZE, AT91RM92_IRQ_SSC0); - at91rm92_add_child(dev, 10, "ssc", 1, AT91RM92_BASE + // SSC1 + at91_add_child(dev, 10, "ssc", 1, AT91RM92_BASE + // SSC1 AT91RM92_SSC1_BASE, AT91RM92_SSC_SIZE, AT91RM92_IRQ_SSC1); - at91rm92_add_child(dev, 10, "ssc", 2, AT91RM92_BASE + // SSC2 + at91_add_child(dev, 10, "ssc", 2, AT91RM92_BASE + // SSC2 AT91RM92_SSC2_BASE, AT91RM92_SSC_SIZE, AT91RM92_IRQ_SSC2); - at91rm92_add_child(dev, 10, "spi", 0, AT91RM92_BASE + // SPI + at91_add_child(dev, 10, "spi", 0, AT91RM92_BASE + // SPI AT91RM92_SPI_BASE, AT91RM92_SPI_SIZE, AT91RM92_IRQ_SPI); // Not sure that the following belongs on this bus. - at91rm92_add_child(dev, 10, "ohci", 0, AT91RM92_BASE + // UHP + at91_add_child(dev, 10, "ohci", 0, AT91RM92_BASE + // UHP AT91RM92_OHCI_BASE, AT91RM92_OHCI_SIZE, AT91RM92_IRQ_UHP); bus_generic_probe(dev); bus_generic_attach(dev); @@ -292,12 +292,12 @@ } static struct resource * -at91rm92_alloc_resource(device_t dev, device_t child, int type, int *rid, +at91_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - struct at91rm92_softc *sc = device_get_softc(dev); + struct at91_softc *sc = device_get_softc(dev); struct resource_list_entry *rle; - struct at91rm92_ivar *ivar = device_get_ivars(child); + struct at91_ivar *ivar = device_get_ivars(child); struct resource_list *rl = &ivar->resources; if (device_get_parent(child) != dev) @@ -323,7 +323,7 @@ case SYS_RES_MEMORY: rle->res = rman_reserve_resource(&sc->sc_mem_rman, start, end, count, flags, child); - rman_set_bustag(rle->res, &at91rm92_bs_tag); + rman_set_bustag(rle->res, &at91_bs_tag); rman_set_bushandle(rle->res, start); break; } @@ -336,22 +336,22 @@ } static struct resource_list * -at91rm92_get_resource_list(device_t dev, device_t child) +at91_get_resource_list(device_t dev, device_t child) { - struct at91rm92_ivar *ivar; + struct at91_ivar *ivar; ivar = device_get_ivars(child); return (&(ivar->resources)); } static int -at91rm92_release_resource(device_t dev, device_t child, int type, +at91_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { struct resource_list *rl; struct resource_list_entry *rle; - rl = at91rm92_get_resource_list(dev, child); + rl = at91_get_resource_list(dev, child); if (rl == NULL) return (EINVAL); rle = resource_list_find(rl, type, rid); @@ -363,11 +363,11 @@ } static int -at91rm92_setup_intr(device_t dev, device_t child, +at91_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, driver_intr_t *intr, void *arg, void **cookiep) { - struct at91rm92_softc *sc = device_get_softc(dev); + struct at91_softc *sc = device_get_softc(dev); BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg, cookiep); @@ -377,10 +377,10 @@ } static int -at91rm92_teardown_intr(device_t dev, device_t child, struct resource *res, +at91_teardown_intr(device_t dev, device_t child, struct resource *res, void *cookie) { - struct at91rm92_softc *sc = device_get_softc(dev); + struct at91_softc *sc = device_get_softc(dev); bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_IDCR, 1 << rman_get_start(res)); @@ -388,7 +388,7 @@ } static int -at91rm92_activate_resource(device_t bus, device_t child, int type, int rid, +at91_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { #if 0 @@ -407,9 +407,9 @@ } static int -at91rm92_print_child(device_t dev, device_t child) +at91_print_child(device_t dev, device_t child) { - struct at91rm92_ivar *ivars; + struct at91_ivar *ivars; struct resource_list *rl; int retval = 0; @@ -433,8 +433,8 @@ arm_mask_irq(uintptr_t nb) { - bus_space_write_4(at91rm92_softc->sc_st, - at91rm92_softc->sc_sys_sh, IC_IDCR, 1 << nb); + bus_space_write_4(at91_softc->sc_st, + at91_softc->sc_sys_sh, IC_IDCR, 1 << nb); } @@ -445,13 +445,13 @@ int status; int irq; - irq = bus_space_read_4(at91rm92_softc->sc_st, - at91rm92_softc->sc_sys_sh, IC_IVR); - status = bus_space_read_4(at91rm92_softc->sc_st, - at91rm92_softc->sc_sys_sh, IC_ISR); + irq = bus_space_read_4(at91_softc->sc_st, + at91_softc->sc_sys_sh, IC_IVR); + status = bus_space_read_4(at91_softc->sc_st, + at91_softc->sc_sys_sh, IC_ISR); if (status == 0) { - bus_space_write_4(at91rm92_softc->sc_st, - at91rm92_softc->sc_sys_sh, IC_EOICR, 1); + bus_space_write_4(at91_softc->sc_st, + at91_softc->sc_sys_sh, IC_EOICR, 1); return (-1); } return (irq); @@ -461,35 +461,35 @@ arm_unmask_irq(uintptr_t nb) { - bus_space_write_4(at91rm92_softc->sc_st, - at91rm92_softc->sc_sys_sh, IC_IECR, 1 << nb); + bus_space_write_4(at91_softc->sc_st, + at91_softc->sc_sys_sh, IC_IECR, 1 << nb); } -static device_method_t at91rm92_methods[] = { - DEVMETHOD(device_probe, at91rm92_probe), - DEVMETHOD(device_attach, at91rm92_attach), - DEVMETHOD(device_identify, at91rm92_identify), +static device_method_t at91_methods[] = { + DEVMETHOD(device_probe, at91_probe), + DEVMETHOD(device_attach, at91_attach), + DEVMETHOD(device_identify, at91_identify), - DEVMETHOD(bus_alloc_resource, at91rm92_alloc_resource), - DEVMETHOD(bus_setup_intr, at91rm92_setup_intr), - DEVMETHOD(bus_teardown_intr, at91rm92_teardown_intr), - DEVMETHOD(bus_activate_resource, at91rm92_activate_resource), + DEVMETHOD(bus_alloc_resource, at91_alloc_resource), + DEVMETHOD(bus_setup_intr, at91_setup_intr), + DEVMETHOD(bus_teardown_intr, at91_teardown_intr), + DEVMETHOD(bus_activate_resource, at91_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_get_resource_list,at91rm92_get_resource_list), + DEVMETHOD(bus_get_resource_list,at91_get_resource_list), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_release_resource, at91rm92_release_resource), - DEVMETHOD(bus_print_child, at91rm92_print_child), + DEVMETHOD(bus_release_resource, at91_release_resource), + DEVMETHOD(bus_print_child, at91_print_child), {0, 0}, }; -static driver_t at91rm92_driver = { +static driver_t at91_driver = { "atmelarm", - at91rm92_methods, - sizeof(struct at91rm92_softc), + at91_methods, + sizeof(struct at91_softc), }; -static devclass_t at91rm92_devclass; +static devclass_t at91_devclass; -DRIVER_MODULE(atmelarm, nexus, at91rm92_driver, at91rm92_devclass, 0, 0); +DRIVER_MODULE(atmelarm, nexus, at91_driver, at91_devclass, 0, 0); ==== //depot/projects/arm/src/sys/arm/at91/at91rm92timer.c#6 (text+ko) ==== @@ -86,7 +86,7 @@ static int at91rm92timer_attach(device_t dev) { - struct at91rm92_softc *sc = device_get_softc(device_get_parent(dev)); + struct at91_softc *sc = device_get_softc(device_get_parent(dev)); timer_softc = device_get_softc(dev); timer_softc->sc_st = sc->sc_st; ==== //depot/projects/arm/src/sys/arm/at91/at91rm92var.h#4 (text+ko) ==== @@ -24,12 +24,12 @@ /* $FreeBSD$ */ -#ifndef _AT91RM92VAR_H_ -#define _AT91RM92VAR_H_ +#ifndef _AT91VAR_H_ +#define _AT91VAR_H_ #include <sys/rman.h> -struct at91rm92_softc { +struct at91_softc { device_t dev; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; @@ -38,9 +38,9 @@ struct rman sc_mem_rman; }; -struct at91rm92_ivar { +struct at91_ivar { struct resource_list resources; }; -#endif /* _AT91RM92VAR_H_ */ +#endif /* _AT91VAR_H_ */ ==== //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#6 (text+ko) ==== @@ -44,7 +44,7 @@ bus_space_tag_t uart_bus_space_mem; extern struct uart_ops at91_usart_ops; -extern struct bus_space at91rm92_bs_tag; +extern struct bus_space at91_bs_tag; int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) @@ -57,7 +57,7 @@ { di->ops = at91_usart_ops; di->bas.chan = 0; - di->bas.bst = &at91rm92_bs_tag; + di->bas.bst = &at91_bs_tag; /* * XXX: Not pretty, but will work because we map VA == PA early * for the last 1MB of memory. @@ -80,7 +80,7 @@ if (uart_getenv(devtype, di) == 0) return (0); - uart_bus_space_io = &at91rm92_bs_tag; + uart_bus_space_io = &at91_bs_tag; uart_bus_space_mem = NULL; return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601062309.k06N9BO0055430>