12 Nov, 2014

1 commit

  • "msi_chip" isn't very descriptive, so rename it to "msi_controller". That
    tells a little more about what it does and is already used in device tree
    bindings.

    No functional change.

    [bhelgaas: changelog, change *only* the struct name so it's reviewable]
    Suggested-by: Bjorn Helgaas
    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas

    Yijing Wang
     

01 Oct, 2014

2 commits

  • Provide a function to parse the PCI DT ranges that can be used to create a
    pci_host_bridge structure together with its associated bus.

    Signed-off-by: Liviu Dudau
    [make io_base parameter optional]
    Signed-off-by: Robert Richter
    Signed-off-by: Bjorn Helgaas
    CC: Arnd Bergmann
    CC: Grant Likely
    CC: Rob Herring
    CC: Catalin Marinas

    Liviu Dudau
     
  • Add pci_get_new_domain_nr() to allocate a new domain number and
    of_get_pci_domain_nr() to retrieve the PCI domain number of a given device
    from DT. Host bridge drivers or architecture-specific code can choose to
    implement their PCI domain number policy using these two functions.

    Using of_get_pci_domain_nr() guarantees a stable PCI domain number on every
    boot provided that all host bridge controllers are assigned a number in the
    device tree using "linux,pci-domain" property. Mixing use of
    pci_get_new_domain_nr() and of_get_pci_domain_nr() is not recommended as it
    can lead to potentially conflicting domain numbers being assigned to root
    buses behind different host bridges.

    Signed-off-by: Liviu Dudau
    Signed-off-by: Bjorn Helgaas
    CC: Arnd Bergmann
    CC: Grant Likely
    CC: Rob Herring
    CC: Catalin Marinas

    Liviu Dudau
     

04 Jun, 2014

1 commit

  • The pci-rcar driver is enabled for compile tests, and this has
    now shown that the driver cannot build without CONFIG_OF,
    following the inclusion of f8f2fe7355fb "PCI: rcar: Use new OF
    interrupt mapping when possible":

    drivers/built-in.o: In function `rcar_pci_map_irq':
    :(.text+0x1cc7c): undefined reference to `of_irq_parse_and_map_pci'
    pci/host/pcie-rcar.c: In function 'pci_dma_range_parser_init':
    pci/host/pcie-rcar.c:875:2: error: implicit declaration of function 'of_n_addr_cells' [-Werror=implicit-function-declaration]

    As pointed out by Ben Dooks and Geert Uytterhoeven, this is actually
    supposed to build fine, which we can achieve if we make the
    declaration of of_irq_parse_and_map_pci conditional on CONFIG_OF
    and provide an empty inline function otherwise, as we do for
    a lot of other of interfaces.

    This lets us build the rcar_pci driver again without CONFIG_OF
    for build testing. All platforms using this driver select OF,
    so this doesn't change anything for the users.

    Signed-off-by: Arnd Bergmann
    Cc: devicetree@vger.kernel.org
    Cc: Rob Herring
    Cc: Grant Likely
    Cc: Lucas Stach
    Cc: Bjorn Helgaas
    Cc: Magnus Damm
    Cc: Geert Uytterhoeven
    Cc: Ben Dooks
    Cc: linux-pci@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    [robh: drop wrappers for of_n_addr_cells and of_n_size_cells which are
    low-level functions that should not be used for !OF]
    Signed-off-by: Rob Herring

    Arnd Bergmann
     

24 Oct, 2013

3 commits

  • Several architectures open code effectively the same code block for
    finding and mapping PCI irqs. This patch consolidates it down to a
    single function.

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • struct of_irq and struct of_phandle_args are exactly the same structure.
    This patch makes the kernel use of_phandle_args everywhere. This in
    itself isn't a big deal, but it makes some follow-on patches simpler.

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • The OF irq handling code has been overloading the term 'map' to refer to
    both parsing the data in the device tree and mapping it to the internal
    linux irq system. This is probably because the device tree does have the
    concept of an 'interrupt-map' function for translating interrupt
    references from one node to another, but 'map' is still confusing when
    the primary purpose of some of the functions are to parse the DT data.

    This patch renames all the of_irq_map_* functions to of_irq_parse_*
    which makes it clear that there is a difference between the parsing
    phase and the mapping phase. Kernel code can make use of just the
    parsing or just the mapping support as needed by the subsystem.

    The patch was generated mechanically with a handful of sed commands.

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     

12 Aug, 2013

1 commit

  • This commit adds a very basic registry of msi_chip structures, so that
    an IRQ controller driver can register an msi_chip, and a PCIe host
    controller can find it, based on a 'struct device_node'.

    Signed-off-by: Thomas Petazzoni
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Rob Herring
    Signed-off-by: Jason Cooper

    Thomas Petazzoni
     

20 May, 2013

2 commits


21 May, 2012

1 commit

  • On MIPS we want to call of_irq_map_pci from inside

    arch/mips/include/asm/pci.h:extern int pcibios_map_irq(
    const struct pci_dev *dev, u8 slot, u8 pin);
    For this to work we need to change several functions to const usage.

    Signed-off-by: John Crispin
    Cc: linux-pci@vger.kernel.org
    Cc: devicetree-discuss@lists.ozlabs.org
    Cc: linux-mips@linux-mips.org
    Acked-by: Bjorn Helgaas
    Acked-by: Grant Likely
    Patchwork: https://patchwork.linux-mips.org/patch/3710/
    Signed-off-by: Ralf Baechle

    John Crispin
     

08 Jun, 2011

1 commit

  • powerpc has two different ways of matching PCI devices to their
    corresponding OF node (if any) for historical reasons. The ppc64 one
    does a scan looking for matching bus/dev/fn, while the ppc32 one does a
    scan looking only for matching dev/fn on each level in order to be
    agnostic to busses being renumbered (which Linux does on some
    platforms).

    This removes both and instead moves the matching code to the PCI core
    itself. It's the most logical place to do it: when a pci_dev is created,
    we know the parent and thus can do a single level scan for the matching
    device_node (if any).

    The benefit is that all archs now get the matching for free. There's one
    hook the arch might want to provide to match a PHB bus to its device
    node. A default weak implementation is provided that looks for the
    parent device device node, but it's not entirely reliable on powerpc for
    various reasons so powerpc provides its own.

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Michal Simek
    Acked-by: Jesse Barnes

    Benjamin Herrenschmidt
     

05 Feb, 2011

1 commit