12 Jul, 2011

1 commit

  • This renames pci flags functions and enums in preparation for creating
    generic version in asm-generic/pci-bridge.h. The following search and
    replace is done:

    s/ppc_pci_/pci_/
    s/PPC_PCI_/PCI_/

    Direct accesses to ppc_pci_flag variable are replaced with helper
    functions.

    Signed-off-by: Rob Herring
    Acked-by: Benjamin Herrenschmidt
    Cc: Paul Mackerras

    Rob Herring
     

21 May, 2009

1 commit


06 Nov, 2008

1 commit

  • The pseries PCI hotplug code has a number of issues, ranging from
    incorrect resource setup to crashes, depending on what is added,
    when, whether it contains a bridge, etc etc....

    This fixes a whole bunch of these, while actually simplifying the code
    a bit, using more generic code in the process and factoring out common
    code between adding of a PHB, a slot or a device.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

14 May, 2008

1 commit

  • Make a few things static in lparcfg.c
    Make init and exit routines static in rtas_flash.c
    Make things static in rtas_pci.c
    Make some functions static in rtas.c
    Make fops static in rtas-proc.c
    Remove unneeded extern for do_gtod in smp.c
    Make clocksource_init() static in time.c
    Make last_tick_len and ticklen_to_xs static in time.c
    Move the declaration of the pvr per-cpu into smp.h
    Make kexec_smp_down() and kexec_stack static in machine_kexec_64.c
    Don't return void in arch_teardown_msi_irqs() in msi.c
    Move declaration of GregorianDay()into asm/time.h

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

07 Apr, 2008

1 commit


01 Apr, 2008

1 commit


17 Jan, 2008

1 commit


20 Dec, 2007

1 commit

  • This adds to the 32 bits PCI code some flags, replacing the old
    pci_assign_all_busses global, that allow us to control various
    aspects of the PCI probing, such as whether to re-assign all
    resources or not, or to not try to assign anything at all.

    This also adds the flag x86 already has to avoid ISA alignment
    on bridges that don't have ISA forwarding enabled (no legacy
    devices on the top level bus) and sets it for PowerMacs.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

11 Dec, 2007

1 commit


17 Aug, 2007

1 commit


14 Jun, 2007

1 commit

  • This rewrites pretty much from scratch the handling of MMIO and PIO
    space allocations on powerpc64. The main goals are:

    - Get rid of imalloc and use more common code where possible
    - Simplify the current mess so that PIO space is allocated and
    mapped in a single place for PCI bridges
    - Handle allocation constraints of PIO for all bridges including
    hot plugged ones within the 2GB space reserved for IO ports,
    so that devices on hotplugged busses will now work with drivers
    that assume IO ports fit in an int.
    - Cleanup and separate tracking of the ISA space in the reserved
    low 64K of IO space. No ISA -> Nothing mapped there.

    I booted a cell blade with IDE on PIO and MMIO and a dual G5 so
    far, that's it :-)

    With this patch, all allocations are done using the code in
    mm/vmalloc.c, though we use the low level __get_vm_area with
    explicit start/stop constraints in order to manage separate
    areas for vmalloc/vmap, ioremap, and PCI IOs.

    This greatly simplifies a lot of things, as you can see in the
    diffstat of that patch :-)

    A new pair of functions pcibios_map/unmap_io_space() now replace
    all of the previous code that used to manipulate PCI IOs space.
    The allocation is done at mapping time, which is now called from
    scan_phb's, just before the devices are probed (instead of after,
    which is by itself a bug fix). The only other caller is the PCI
    hotplug code for hot adding PCI-PCI bridges (slots).

    imalloc is gone, as is the "sub-allocation" thing, but I do beleive
    that hotplug should still work in the sense that the space allocation
    is always done by the PHB, but if you unmap a child bus of this PHB
    (which seems to be possible), then the code should properly tear
    down all the HPTE mappings for that area of the PHB allocated IO space.

    I now always reserve the first 64K of IO space for the bridge with
    the ISA bus on it. I have moved the code for tracking ISA in a separate
    file which should also make it smarter if we ever are capable of
    hot unplugging or re-plugging an ISA bridge.

    This should have a side effect on platforms like powermac where VGA IOs
    will no longer work. This is done on purpose though as they would have
    worked semi-randomly before. The idea at this point is to isolate drivers
    that might need to access those and fix them by providing a proper
    function to obtain an offset to the legacy IOs of a given bus.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

13 Apr, 2007

1 commit


09 Mar, 2007

1 commit


04 Dec, 2006

3 commits

  • powerpc: Merge 32 and 64 bits asm-powerpc/io.h

    The rework on io.h done for the new hookable accessors made it easier,
    so I just finished the work and merged 32 and 64 bits io.h for arch/powerpc.

    arch/ppc still uses the old version in asm-ppc, there is just too much gunk
    in there that I really can't be bothered trying to cleanup.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • When enabled in Kconfig, it will pick up any of_platform_device
    matching it's match list (currently type "pci", "pcix", "pcie",
    or "ht" and setup a PHB for it.

    Platform must provide a ppc_md.pci_setup_phb() for it to work
    (for doing the necessary initialisations specific to a given PHB
    like setting up the config space ops).

    It's currently only available on 64 bits as the 32 bits PCI code
    can't quite cope with it in it's current form. I will fix that
    later.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • The BUID is the first entry of a PCI host bridge "reg" property.

    Now that PCI busses can be anywhere in the device-tree, we need to
    fully translate the value there to a CPU physical address before
    we can use it with RTAS.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

25 Aug, 2006

1 commit

  • Several RTAS calls take a "config_addr" parameter, which is a particular
    way of specifying a PCI busno, devfn and register number into a 32-bit word.
    Currently these are open-coded, and I'll be adding another soon, replace
    them with a helper that encapsulates the logic. Be more strict about masking
    the busno too, just in case.

    Booted on P5 LPAR.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

31 Jul, 2006

1 commit


03 Jul, 2006

1 commit

  • This adds the new irq remapper core and removes the old one. Because
    there are some fundamental conflicts with the old code, like the value
    of NO_IRQ which I'm now setting to 0 (as per discussions with Linus),
    etc..., this commit also changes the relevant platform and driver code
    over to use the new remapper (so as not to cause difficulties later
    in bisecting).

    This patch removes the old pre-parsing of the open firmware interrupt
    tree along with all the bogus assumptions it made to try to renumber
    interrupts according to the platform. This is all to be handled by the
    new code now.

    For the pSeries XICS interrupt controller, a single remapper host is
    created for the whole machine regardless of how many interrupt
    presentation and source controllers are found, and it's set to match
    any device node that isn't a 8259. That works fine on pSeries and
    avoids having to deal with some of the complexities of split source
    controllers vs. presentation controllers in the pSeries device trees.

    The powerpc i8259 PIC driver now always requests the legacy interrupt
    range. It also has the feature of being able to match any device node
    (including NULL) if passed no device node as an input. That will help
    porting over platforms with broken device-trees like Pegasos who don't
    have a proper interrupt tree.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

15 Jun, 2006

1 commit


17 Mar, 2006

1 commit


16 Mar, 2006

1 commit

  • The dynamic add path for PCI Host Bridges can fail to configure children
    adapters under P5IOC controllers. It fails to properly fixup bus/device
    resources, and it fails to properly enable EEH. Both of these steps
    need to occur before any children devices are enabled in
    pci_bus_add_devices().

    Signed-off-by: John Rose
    Signed-off-by: Paul Mackerras

    John Rose
     

10 Feb, 2006

1 commit


10 Jan, 2006

1 commit


09 Jan, 2006

1 commit

  • The pre-parsed addrs/n_addrs fields in struct device_node are finally
    gone. Remove the dodgy heuristics that did that parsing at boot and
    remove the fields themselves since we now have a good replacement with
    the new OF parsing code. This patch also fixes a bunch of drivers to use
    the new code instead, so that at least pmac32, pseries, iseries and g5
    defconfigs build.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

16 Nov, 2005

1 commit

  • I discovered that in some cases (PowerMac for example) we wouldn't
    properly map the PCI IO space on recent kernels. In addition, the code
    for initializing PCI host bridges was scattered all over the place with
    some duplication between platforms.

    This patch fixes the problem and does a small cleanup by creating a
    pcibios_alloc_controller() in pci_64.c that is similar to the one in
    pci_32.c (just takes an additional device node argument) that takes care
    of all the grunt allocation and initialisation work. It should work for
    both boot time and dynamically allocated PHBs.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

10 Nov, 2005

1 commit

  • This patch moves a bunch more files from arch/ppc64 and
    include/asm-ppc64 which have no equivalents in ppc32 code into
    arch/powerpc and include/asm-powerpc. The file affected are:
    hvcall.h
    proc_ppc64.c
    sysfs.c
    lparcfg.c
    rtas_pci.c

    The only changes apart from the move and corresponding Makefile
    changes are:
    - #ifndef/#define in includes updated to _ASM_POWERPC_ form
    - trailing whitespace removed
    - comments giving full paths removed

    Built and booted on POWER5 LPAR (ARCH=powerpc and ARCH=ppc64), built
    for 32-bit powermac (ARCH=powerpc).

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson