From nobody Mon Mar 21 19:11:51 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7D6CC1A206FC; Mon, 21 Mar 2022 19:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KMkkb2xFQz3sys; Mon, 21 Mar 2022 19:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647889911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hy/+YxIIXtvVKchUt+VnMB33QadWVpyzLjCZr8Q0YEU=; b=uIb7fJzbxVfxALoBnZVWazsiUMs46v4WQ1WHo9m50Zy2zwj/Y2qC/OwJfgxunP24H25ULg xYzt6hu4VV8cNt9cmIy2xCLTWf1LA9T2/whUxr3MhRNdtHvSaQJZcEFEWG3ay1Y/sOg67F l0g8ziv4PSv621O6kKEK80yEtkOK669hkiGsJcBB9llHq4deLn9Dhv8i+WKnbmpA6AiFD+ 0Jx42HyQmykc5YnRkIAteXBXpzwCnqDeoN6c8sbhdbaAUbK68vTM4Zl0PEX50yj5oGfuSh a5qlZ1WozHxtx+/15ELhX6EWSBzB5oUR4JWPapjb4fnp3G4hwATFtpfi9CeIUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 454BB20DC2; Mon, 21 Mar 2022 19:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22LJBpp8086270; Mon, 21 Mar 2022 19:11:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22LJBpoF086269; Mon, 21 Mar 2022 19:11:51 GMT (envelope-from git) Date: Mon, 21 Mar 2022 19:11:51 GMT Message-Id: <202203211911.22LJBpoF086269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 27f56d337be3 - main - powerpcspe: fix PCI enumeration on ppce500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27f56d337be39a3f493febb585f3484c4cb6c3b6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647889911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hy/+YxIIXtvVKchUt+VnMB33QadWVpyzLjCZr8Q0YEU=; b=PIA9+troi+a4ZzuPvYsf34tA3WyUkjF95WMzDTj4+LvRQVBlwfFSbOkf68kokMPCkWkBy4 LkIozP/R4LHHJIcbaI6ajBLQyTFsBgF4ZKbJ1jrHmel8GL8ha37uA4BhInjDpZNrKIRkWa XriDzOoESEMym5xc9SzWLo2B8Kmx+RuzHi1vRF0bXyaAoIrhqxwyjC1lcWIceW8puMsx4r BeX4LPBcN+I9Ac09PjDbit3JWagQsDLCc6EUtxD6jIZYJ/fLhlcBG2O2adm8kALbKWnou+ czVMopfgQDqm94QOrN+aZ8Ap8x9trAcYjbPhFMQqoLLNeF+s2+fVUP+Rq1MCKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647889911; a=rsa-sha256; cv=none; b=SNEL/jlQ0kvU/yT5nTTMad0T7UvvOIOzLNrwHroVGR4lJk2tlEid+axGGwYLfPCoCZLPSD I94wLN5rzqJbRMKiff9xBAJ9yAYeHeIcpdqj7a3CjLXmGGd8YDwiT0cqAIOL3oAkVuRWXs VhsU7emLUDmRPUqKFq4fPE/ctXWeUbnAeYRg9CD/PoQjKE82wr7VokiIE99dNVKQMA/L1r mBnpeM+6A23VAWtEGpXIbLLbX6MkKQ4N1MnAWSkWjhSW3RML3xwv4jFTmKT9zqRChRCni8 9Uvv0CRqRG9lXRMvth2Vq8jlz7a/I7tKz/Cb8tiQfHoAOHIHpcZq8XQEsaJroA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=27f56d337be39a3f493febb585f3484c4cb6c3b6 commit 27f56d337be39a3f493febb585f3484c4cb6c3b6 Author: Alfredo Dal'Ava Junior AuthorDate: 2022-03-21 10:57:07 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2022-03-21 19:11:33 +0000 powerpcspe: fix PCI enumeration on ppce500 This fixes PCI devices not being found on QEMU ppce500. This generic board used to have its first PCI slot at 0x11, like the mpc8544dsi and some real HW. After commit [1], it was changed to 0x1 and our driver wasn't prepared for that. [1] https://gitlab.com/qemu-project/qemu/-/commit/3bb7e02a9725a24e5bf915b35f914f82f5b07a1f Reviewed by: jhibbits, bdragon MFC after: 2 days Sponsored by: Institudo de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D34621 --- sys/powerpc/mpc85xx/pci_mpc85xx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/mpc85xx/pci_mpc85xx.c b/sys/powerpc/mpc85xx/pci_mpc85xx.c index ced24d224860..8d0c21342215 100644 --- a/sys/powerpc/mpc85xx/pci_mpc85xx.c +++ b/sys/powerpc/mpc85xx/pci_mpc85xx.c @@ -138,7 +138,8 @@ __FBSDID("$FreeBSD$"); #define DEVFN(b, s, f) ((b << 16) | (s << 8) | f) -#define FSL_NUM_MSIS 256 /* 8 registers of 32 bits (8 hardware IRQs) */ +#define FSL_NUM_MSIS 256 /* 8 registers of 32 bits (8 hardware IRQs) */ +#define PCI_SLOT_FIRST 0x1 /* used to be 0x11 but qemu-ppce500 starts from 0x1 */ struct fsl_pcib_softc { struct ofw_pci_softc pci_sc; @@ -552,7 +553,8 @@ fsl_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, struct fsl_pcib_softc *sc = device_get_softc(dev); u_int devfn; - if (bus == sc->sc_busnr && !sc->sc_pcie && slot < 10) + if (bus == sc->sc_busnr && !sc->sc_pcie && + slot < PCI_SLOT_FIRST) return (~0); devfn = DEVFN(bus, slot, func); @@ -565,7 +567,8 @@ fsl_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, { struct fsl_pcib_softc *sc = device_get_softc(dev); - if (bus == sc->sc_busnr && !sc->sc_pcie && slot < 10) + if (bus == sc->sc_busnr && !sc->sc_pcie && + slot < PCI_SLOT_FIRST) return; fsl_pcib_cfgwrite(sc, bus, slot, func, reg, val, bytes); }