Skip to content

Commit 2999dea

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: versatile: Remove usage of PHYS_OFFSET
PHYS_OFFSET is not universally defined on all arches and using it prevents enabling COMPILE_TEST. PAGE_OFFSET and __pa() are always available, so use them to get the physical start of memory address. This should have probably used 'dma-ranges' to get the address, but we don't want to force a DT update to do that. At least in QEMU, the SMAP registers have no effect (or perhaps the only value that is handled is 0). Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Linus Walleij <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Andrew Murray <[email protected]> Cc: Bjorn Helgaas <[email protected]>
1 parent f9f4fda commit 2999dea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/pci/controller/pci-versatile.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int versatile_pci_probe(struct platform_device *pdev)
9999
resource_list_for_each_entry(entry, &bridge->windows) {
100100
if (resource_type(entry->res) == IORESOURCE_MEM) {
101101
writel(entry->res->start >> 28, PCI_IMAP(mem));
102-
writel(PHYS_OFFSET >> 28, PCI_SMAP(mem));
102+
writel(__pa(PAGE_OFFSET) >> 28, PCI_SMAP(mem));
103103
mem++;
104104
}
105105
}
@@ -136,9 +136,9 @@ static int versatile_pci_probe(struct platform_device *pdev)
136136
/*
137137
* Configure the PCI inbound memory windows to be 1:1 mapped to SDRAM
138138
*/
139-
writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_0);
140-
writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_1);
141-
writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_2);
139+
writel(__pa(PAGE_OFFSET), local_pci_cfg_base + PCI_BASE_ADDRESS_0);
140+
writel(__pa(PAGE_OFFSET), local_pci_cfg_base + PCI_BASE_ADDRESS_1);
141+
writel(__pa(PAGE_OFFSET), local_pci_cfg_base + PCI_BASE_ADDRESS_2);
142142

143143
/*
144144
* For many years the kernel and QEMU were symbiotically buggy

0 commit comments

Comments
 (0)