Lines Matching +full:cfg +full:- +full:space
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * sata_sis.c - Silicon Integrated Systems SATA
6 * Please ALWAYS copy linux-ide@vger.kernel.org
12 * as Documentation/driver-api/libata.rst
38 SIS180_SATA1_OFS = 0x10, /* offset from sata0->sata1 phy regs */
39 SIS182_SATA1_OFS = 0x20, /* offset from sata0->sata1 phy regs */
44 SIS_FLAG_CFGSCR = (1 << 30), /* host flag: SCRs via PCI cfg */
46 GENCTL_IOMAPPED_SCR = (1 << 26), /* if set, SCRs are in IO space */
94 MODULE_DESCRIPTION("low-level driver for Silicon Integrated Systems SATA controller");
101 struct ata_port *ap = link->ap; in get_scr_cfg_addr()
102 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in get_scr_cfg_addr()
106 if (ap->port_no) { in get_scr_cfg_addr()
107 switch (pdev->device) { in get_scr_cfg_addr()
122 if (link->pmp) in get_scr_cfg_addr()
131 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); in sis_scr_cfg_read()
134 if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */ in sis_scr_cfg_read()
135 return -EINVAL; in sis_scr_cfg_read()
144 struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); in sis_scr_cfg_write()
153 struct ata_port *ap = link->ap; in sis_scr_read()
154 void __iomem *base = ap->ioaddr.scr_addr + link->pmp * 0x10; in sis_scr_read()
157 return -EINVAL; in sis_scr_read()
159 if (ap->flags & SIS_FLAG_CFGSCR) in sis_scr_read()
168 struct ata_port *ap = link->ap; in sis_scr_write()
169 void __iomem *base = ap->ioaddr.scr_addr + link->pmp * 0x10; in sis_scr_write()
172 return -EINVAL; in sis_scr_write()
174 if (ap->flags & SIS_FLAG_CFGSCR) in sis_scr_write()
191 ata_print_version_once(&pdev->dev, DRV_VERSION); in sis_init_one()
197 /* check and see if the SCRs are in IO space or PCI cfg space */ in sis_init_one()
202 /* if hardware thinks SCRs are in IO space, but there are in sis_init_one()
203 * no IO resources assigned, change to PCI cfg space. in sis_init_one()
214 switch (ent->device) { in sis_init_one()
218 /* The PATA-handling is provided by pata_sis */ in sis_init_one()
229 dev_info(&pdev->dev, in sis_init_one()
233 dev_info(&pdev->dev, in sis_init_one()
244 dev_info(&pdev->dev, "Detected SiS 182/965 chipset\n"); in sis_init_one()
247 dev_info(&pdev->dev, "Detected SiS 182/965L chipset\n"); in sis_init_one()
252 dev_info(&pdev->dev, in sis_init_one()
258 dev_info(&pdev->dev, in sis_init_one()
270 struct ata_port *ap = host->ports[i]; in sis_init_one()
272 if (ap->flags & ATA_FLAG_SATA && in sis_init_one()
273 ap->flags & ATA_FLAG_SLAVE_POSS) { in sis_init_one()
286 mmio = host->iomap[SIS_SCR_PCI_BAR]; in sis_init_one()
288 host->ports[0]->ioaddr.scr_addr = mmio; in sis_init_one()
289 host->ports[1]->ioaddr.scr_addr = mmio + port2_start; in sis_init_one()
294 return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, in sis_init_one()