-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pci/host-generic' into next
* pci/host-generic: arm64: Add architectural support for PCI PCI: Add pci_remap_iospace() to map bus I/O resources of/pci: Add support for parsing PCI host bridge resources from DT of/pci: Add pci_get_new_domain_nr() and of_get_pci_domain_nr() PCI: Add generic domain handling of/pci: Fix the conversion of IO ranges into IO resources of/pci: Move of_pci_range_to_resource() to of/address.c ARM: Define PCI_IOBASE as the base of virtual PCI IO space of/pci: Add pci_register_io_range() and pci_pio_to_address() asm-generic/io.h: Fix ioport_map() for !CONFIG_GENERIC_IOMAP Conflicts: drivers/pci/host/pci-tegra.c
- Loading branch information
Showing
20 changed files
with
576 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef __ASM_PCI_H | ||
#define __ASM_PCI_H | ||
#ifdef __KERNEL__ | ||
|
||
#include <linux/types.h> | ||
#include <linux/slab.h> | ||
#include <linux/dma-mapping.h> | ||
|
||
#include <asm/io.h> | ||
#include <asm-generic/pci-bridge.h> | ||
#include <asm-generic/pci-dma-compat.h> | ||
|
||
#define PCIBIOS_MIN_IO 0x1000 | ||
#define PCIBIOS_MIN_MEM 0 | ||
|
||
/* | ||
* Set to 1 if the kernel should re-assign all PCI bus numbers | ||
*/ | ||
#define pcibios_assign_all_busses() \ | ||
(pci_has_flag(PCI_REASSIGN_ALL_BUS)) | ||
|
||
/* | ||
* PCI address space differs from physical memory address space | ||
*/ | ||
#define PCI_DMA_BUS_IS_PHYS (0) | ||
|
||
extern int isa_dma_bridge_buggy; | ||
|
||
#ifdef CONFIG_PCI | ||
static inline int pci_proc_domain(struct pci_bus *bus) | ||
{ | ||
return 1; | ||
} | ||
#endif /* CONFIG_PCI */ | ||
|
||
#endif /* __KERNEL__ */ | ||
#endif /* __ASM_PCI_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Code borrowed from powerpc/kernel/pci-common.c | ||
* | ||
* Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM | ||
* Copyright (C) 2014 ARM Ltd. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* version 2 as published by the Free Software Foundation. | ||
* | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <linux/io.h> | ||
#include <linux/kernel.h> | ||
#include <linux/mm.h> | ||
#include <linux/of_pci.h> | ||
#include <linux/of_platform.h> | ||
#include <linux/slab.h> | ||
|
||
#include <asm/pci-bridge.h> | ||
|
||
/* | ||
* Called after each bus is probed, but before its children are examined | ||
*/ | ||
void pcibios_fixup_bus(struct pci_bus *bus) | ||
{ | ||
/* nothing to do, expected to be removed in the future */ | ||
} | ||
|
||
/* | ||
* We don't have to worry about legacy ISA devices, so nothing to do here | ||
*/ | ||
resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
resource_size_t size, resource_size_t align) | ||
{ | ||
return res->start; | ||
} | ||
|
||
/* | ||
* Try to assign the IRQ number from DT when adding a new device | ||
*/ | ||
int pcibios_add_device(struct pci_dev *dev) | ||
{ | ||
dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); | ||
|
||
return 0; | ||
} | ||
|
||
|
||
#ifdef CONFIG_PCI_DOMAINS_GENERIC | ||
static bool dt_domain_found = false; | ||
|
||
void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) | ||
{ | ||
int domain = of_get_pci_domain_nr(parent->of_node); | ||
|
||
if (domain >= 0) { | ||
dt_domain_found = true; | ||
} else if (dt_domain_found == true) { | ||
dev_err(parent, "Node %s is missing \"linux,pci-domain\" property in DT\n", | ||
parent->of_node->full_name); | ||
return; | ||
} else { | ||
domain = pci_get_new_domain_nr(); | ||
} | ||
|
||
bus->domain_nr = domain; | ||
} | ||
#endif |
Oops, something went wrong.