From owner-svn-src-all@freebsd.org Sat Mar 3 13:20:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFE9F3B7D6; Sat, 3 Mar 2018 13:20:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C406F80E10; Sat, 3 Mar 2018 13:20:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF1AF26C2F; Sat, 3 Mar 2018 13:20:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23DKif7011443; Sat, 3 Mar 2018 13:20:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23DKiSG011442; Sat, 3 Mar 2018 13:20:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803031320.w23DKiSG011442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Mar 2018 13:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330337 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 13:20:45 -0000 Author: andrew Date: Sat Mar 3 13:20:44 2018 New Revision: 330337 URL: https://svnweb.freebsd.org/changeset/base/330337 Log: Move setting the IRQ base and length into the common GICv3 ITS attach function. This is common across both ACPI and FDT. Sponsored by: ABT Systems Ltd Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Sat Mar 3 13:19:08 2018 (r330336) +++ head/sys/arm64/arm64/gicv3_its.c Sat Mar 3 13:20:44 2018 (r330337) @@ -694,6 +694,10 @@ gicv3_its_attach(device_t dev) sc = device_get_softc(dev); + sc->sc_irq_length = gicv3_get_nirqs(dev); + sc->sc_irq_base = GIC_FIRST_LPI; + sc->sc_irq_base += device_get_unit(dev) * sc->sc_irq_length; + rid = 0; sc->sc_its_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1666,11 +1670,6 @@ gicv3_its_fdt_attach(device_t dev) int err; sc = device_get_softc(dev); - - sc->sc_irq_length = gicv3_get_nirqs(dev); - sc->sc_irq_base = GIC_FIRST_LPI; - sc->sc_irq_base += device_get_unit(dev) * sc->sc_irq_length; - err = gicv3_its_attach(dev); if (err != 0) return (err); @@ -1730,11 +1729,10 @@ gicv3_its_acpi_attach(device_t dev) struct gicv3_its_softc *sc; int err; + sc = device_get_softc(dev); err = gicv3_its_attach(dev); if (err != 0) return (err); - - sc = device_get_softc(dev); sc->sc_pic = intr_pic_register(dev, 1); intr_pic_add_handler(device_get_parent(dev), sc->sc_pic,