From owner-p4-projects@FreeBSD.ORG Wed Apr 17 22:22:37 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3534FF45; Wed, 17 Apr 2013 22:22:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E820BF43 for ; Wed, 17 Apr 2013 22:22:36 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF446A58 for ; Wed, 17 Apr 2013 22:22:36 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HMMZBO077264 for ; Wed, 17 Apr 2013 22:22:35 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.6/8.14.6/Submit) id r3HMMZ9V077261 for perforce@freebsd.org; Wed, 17 Apr 2013 22:22:35 GMT (envelope-from brooks@freebsd.org) Date: Wed, 17 Apr 2013 22:22:35 GMT Message-Id: <201304172222.r3HMMZ9V077261@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 227822 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 22:22:37 -0000 http://p4web.freebsd.org/@@227822?ac=10 Change 227822 by brooks@brooks_zenith on 2013/04/17 22:22:04 When we find configured interupt sources during attach, clear the config. It will be reestablished later if a driver is configured. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_pic.c#4 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_pic.c#4 (text+ko) ==== @@ -56,7 +56,6 @@ static void bp_write_cfg(struct beripic_softc *, int, uint64_t); static void bp_detach_resources(device_t); static char *bp_strconfig(uint64_t, char *, size_t); -static void bp_print_config(device_t); static void bp_config_source(device_t, int, int, u_long, u_long); #ifdef __mips__ static void bp_set_counter_name(device_t, device_t, int); @@ -217,29 +216,6 @@ } static void -bp_print_config(device_t dev) -{ - char configstr[64]; - struct beripic_softc *sc; - int src; - uint64_t config; - - sc = device_get_softc(dev); - - for (src = 0; src < sc->bp_nsrcs; src++) { - config = bp_read_cfg(sc, src); - if (config == 0) - continue; - - device_printf(dev, "src %d: %s\n", src, - bp_strconfig(config, configstr, sizeof(configstr))); - if (config & BP_CFG_RESERVED) - device_printf(dev, "reserved bits not 0: 0x%016jx\n", - (uintmax_t) config); - } -} - -static void bp_config_source(device_t ic, int src, int enable, u_long tid, u_long irq) { char configstr[64]; @@ -292,11 +268,13 @@ static int beripic_fdt_attach(device_t dev) { + char configstr[64]; struct beripic_softc *sc; struct fdt_ic *fic; pcell_t nhard, nsoft; phandle_t ph; - int error, i; + int error, i, src; + uint64_t config; sc = device_get_softc(dev); sc->bp_dev = dev; @@ -442,10 +420,22 @@ sc->bp_clear_bst = rman_get_bustag(sc->bp_clear_res); sc->bp_clear_bsh = rman_get_bushandle(sc->bp_clear_res); - if (bootverbose) - bp_print_config(dev); + for (src = 0; src < sc->bp_nsrcs; src++) { + config = bp_read_cfg(sc, src); + if (config == 0) + continue; + + if (bootverbose) { + device_printf(dev, "initial config: src %d: %s\n", src, + bp_strconfig(config, configstr, sizeof(configstr))); + if (config & BP_CFG_RESERVED) + device_printf(dev, + "reserved bits not 0: 0x%016jx\n", + (uintmax_t) config); + } - /* XXX: ensure values match reset config */ + bp_config_source(dev, src, 0, 0, 0); + } fic = malloc(sizeof(*fic), M_BERIPIC, M_WAITOK|M_ZERO); fic->iph = ph;