Lines Matching +full:rs780e +full:- +full:pci
1 // SPDX-License-Identifier: GPL-2.0
3 * Loongson PCI Host Controller Driver
10 #include <linux/pci.h>
13 #include "../pci.h"
38 dev->class = PCI_CLASS_BRIDGE_PCI << 8; in bridge_class_quirk()
53 pdev->mmio_always_on = 1; in system_bus_quirk()
54 pdev->non_compliant_bars = 1; in system_bus_quirk()
65 struct pci_bus *bus = dev->bus; in loongson_mrrs_quirk()
76 bridge = bus->self; in loongson_mrrs_quirk()
77 bus = bus->parent; in loongson_mrrs_quirk()
104 return priv->cfg1_base + addroff; in cfg1_map()
115 return priv->cfg0_base + addroff; in cfg0_map()
121 unsigned char busnum = bus->number; in pci_loongson_map_bus()
129 if (priv->flags & FLAG_DEV_FIX && busnum != 0 && in pci_loongson_map_bus()
134 if (where < PCI_CFG_SPACE_SIZE && priv->cfg0_base) in pci_loongson_map_bus()
138 if (where < PCI_CFG_SPACE_EXP_SIZE && priv->cfg1_base) in pci_loongson_map_bus()
162 /* H/w only accept 32-bit PCI operations */
170 { .compatible = "loongson,ls2k-pci",
172 { .compatible = "loongson,ls7a-pci",
174 { .compatible = "loongson,rs780e-pci",
182 struct device *dev = &pdev->dev; in loongson_pci_probe()
183 struct device_node *node = dev->of_node; in loongson_pci_probe()
188 return -ENODEV; in loongson_pci_probe()
192 return -ENODEV; in loongson_pci_probe()
195 priv->pdev = pdev; in loongson_pci_probe()
196 priv->flags = (unsigned long)of_device_get_match_data(dev); in loongson_pci_probe()
201 return -EINVAL; in loongson_pci_probe()
204 priv->cfg0_base = devm_pci_remap_cfg_resource(dev, regs); in loongson_pci_probe()
205 if (IS_ERR(priv->cfg0_base)) in loongson_pci_probe()
206 return PTR_ERR(priv->cfg0_base); in loongson_pci_probe()
209 if (priv->flags & FLAG_CFG1) { in loongson_pci_probe()
214 priv->cfg1_base = devm_pci_remap_cfg_resource(dev, regs); in loongson_pci_probe()
215 if (IS_ERR(priv->cfg1_base)) in loongson_pci_probe()
216 priv->cfg1_base = NULL; in loongson_pci_probe()
220 bridge->sysdata = priv; in loongson_pci_probe()
221 bridge->ops = &loongson_pci_ops; in loongson_pci_probe()
222 bridge->map_irq = loongson_map_irq; in loongson_pci_probe()
229 .name = "loongson-pci",