| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Contains common pci routines for ALL ppc platform |
|---|
| 3 | 4 | * (based on pci_32.c and pci_64.c) |
|---|
| .. | .. |
|---|
| 9 | 10 | * Rework, based on alpha PCI code. |
|---|
| 10 | 11 | * |
|---|
| 11 | 12 | * Common pmac/prep/chrp pci routines. -- Cort |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is free software; you can redistribute it and/or |
|---|
| 14 | | - * modify it under the terms of the GNU General Public License |
|---|
| 15 | | - * as published by the Free Software Foundation; either version |
|---|
| 16 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 17 | 13 | */ |
|---|
| 18 | 14 | |
|---|
| 19 | 15 | #include <linux/kernel.h> |
|---|
| 20 | 16 | #include <linux/pci.h> |
|---|
| 21 | 17 | #include <linux/string.h> |
|---|
| 22 | 18 | #include <linux/init.h> |
|---|
| 23 | | -#include <linux/bootmem.h> |
|---|
| 19 | +#include <linux/memblock.h> |
|---|
| 24 | 20 | #include <linux/mm.h> |
|---|
| 25 | 21 | #include <linux/shmem_fs.h> |
|---|
| 26 | 22 | #include <linux/list.h> |
|---|
| .. | .. |
|---|
| 437 | 433 | pr_debug("Parsing ranges property...\n"); |
|---|
| 438 | 434 | for_each_of_pci_range(&parser, &range) { |
|---|
| 439 | 435 | /* Read next ranges element */ |
|---|
| 440 | | - pr_debug("pci_space: 0x%08x pci_addr:0x%016llx ", |
|---|
| 441 | | - range.pci_space, range.pci_addr); |
|---|
| 442 | | - pr_debug("cpu_addr:0x%016llx size:0x%016llx\n", |
|---|
| 443 | | - range.cpu_addr, range.size); |
|---|
| 444 | 436 | |
|---|
| 445 | 437 | /* If we failed translation or got a zero-sized region |
|---|
| 446 | 438 | * (some FW try to feed us with non sensical zero sized regions |
|---|
| .. | .. |
|---|
| 490 | 482 | pr_info(" MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n", |
|---|
| 491 | 483 | range.cpu_addr, range.cpu_addr + range.size - 1, |
|---|
| 492 | 484 | range.pci_addr, |
|---|
| 493 | | - (range.pci_space & 0x40000000) ? |
|---|
| 485 | + (range.flags & IORESOURCE_PREFETCH) ? |
|---|
| 494 | 486 | "Prefetch" : ""); |
|---|
| 495 | 487 | |
|---|
| 496 | 488 | /* We support only 3 memory ranges */ |
|---|
| .. | .. |
|---|
| 1125 | 1117 | { |
|---|
| 1126 | 1118 | return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap); |
|---|
| 1127 | 1119 | } |
|---|
| 1128 | | - |
|---|