From df9c0e88e1e30cb5d1c81c4c2f295f7d153ed02b Mon Sep 17 00:00:00 2001 From: Bartlomiej Grzesik Date: Tue, 31 Aug 2021 06:22:33 +0200 Subject: [PATCH] qoriq_dw_pci: Fix typo in link status checking code On some DesignWare PCIe controllers accessing config registers of slots whose link is down triggers a SError. Because of that we need to check the link status before any acceses config space. Due to a typo link was always reported up. This fixes a SError that occured during boot on LS1028A-RDB. Obtained from: Semihalf Reviewed by: wma Differential revision: https://reviews.freebsd.org/D31509 --- sys/arm64/qoriq/qoriq_dw_pci.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/arm64/qoriq/qoriq_dw_pci.c b/sys/arm64/qoriq/qoriq_dw_pci.c index 4d0c7928fc4..d052c9910a4 100644 --- a/sys/arm64/qoriq/qoriq_dw_pci.c +++ b/sys/arm64/qoriq/qoriq_dw_pci.c @@ -101,13 +101,7 @@ static struct qoriq_dw_pci_cfg ls2028_cfg = { /* Compatible devices. */ static struct ofw_compat_data compat_data[] = { {"fsl,ls1012a-pcie", (uintptr_t)&ls1012_cfg}, - /* - * XXX: On LS1028ARDB attaching this driver causes external abort. - * Disable it for now. - */ -#ifdef notyet {"fsl,ls1028a-pcie", (uintptr_t)&ls2028_cfg}, -#endif {"fsl,ls1043a-pcie", (uintptr_t)&ls1043_cfg}, {"fsl,ls1046a-pcie", (uintptr_t)&ls1012_cfg}, {"fsl,ls2080a-pcie", (uintptr_t)&ls2080_cfg}, @@ -156,7 +150,7 @@ qorif_dw_pci_get_link(device_t dev, bool *status) reg = pci_dw_dbi_rd4(sc->dev, sc->soc_cfg->pex_pf0_dgb); reg >>= sc->soc_cfg->ltssm_bit; reg &= 0x3F; - *status = (reg = 0x11) ? true: false; + *status = (reg == 0x11) ? true : false; return (0); }