14 Oct, 2016

1 commit


12 Oct, 2016

2 commits


11 Oct, 2016

1 commit


24 Sep, 2016

1 commit


21 Sep, 2016

2 commits

  • In pci_uclass_pre_probe an attempt is made to detect whether the parent
    of a device is a PCI device and that the device is thus a bridge. This
    was being done by checking whether the parent of the device is of the
    UCLASS_ROOT class. This causes problems if the PCI controller is a child
    of some other non-PCI node, for example a simple-bus node.

    For example, if the device tree contains something like the following
    then pci_uclass_pre_probe would incorrectly believe that the PCI
    controller is a bridge, with a PCI parent:

    / {
    some_child {
    compatible = "simple-bus";
    #address-cells = ;
    #size-cells = ;
    ranges = <>;

    pci_controller: pci@10000000 {
    compatible = "my-pci-controller";
    device_type = "pci";
    reg = ;
    };
    };
    };

    Avoid this incorrect detection of bridges by instead checking whether
    the parent devices class is UCLASS_PCI and treating a device as a bridge
    when this is true, making use of device_is_on_pci_bus to perform this
    test.

    Signed-off-by: Paul Burton
    Reviewed-by: Simon Glass

    Paul Burton
     
  • This patch adds a driver for the Xilinx AXI bridge for PCI express, an
    IP block which can be used on some generations of Xilinx FPGAs. This is
    mostly a case of implementing PCIe ECAM specification, but with some
    quirks about what devices are valid to access.

    Signed-off-by: Paul Burton
    Reviewed-by: Simon Glass

    Paul Burton
     

16 Aug, 2016

1 commit

  • Tegra186 supports the new standard clock, reset, and power domain APIs.
    Older Tegra SoCs still use custom APIs. Enhance the Tegra PCIe driver so
    that it can operate with either set of APIs.

    On Tegra186, the BPMP handles all aspects of PCIe PHY (UPHY) programming.
    Consequently, this logic is disabled too.

    Signed-off-by: Stephen Warren
    Reviewed-by: Simon Glass
    Signed-off-by: Tom Warren

    Stephen Warren
     

28 Jul, 2016

4 commits


12 Jul, 2016

4 commits


06 Jul, 2016

2 commits

  • On recent SoCs, tegra_pcie_phy_enable() isn't called; but instead
    tegra_pcie_enable_controller() calls tegra_xusb_phy_enable(). However,
    part of tegra_pcie_phy_enable() needs to happen in all cases. Move that
    code to tegra_pcie_port_enable() instead.

    For reference, NVIDIA's downstream Linux kernel performs this operation
    in tegra_pcie_enable_rp_features(), which is called immediately after
    tegra_pcie_port_enable(). Since that function doesn't exist in the U-Boot
    driver, we'll just add it to the tail of tegra_pcie_port_enable() instead.

    Signed-off-by: Stephen Warren
    Signed-off-by: Tom Warren

    Stephen Warren
     
  • The value that should be programmed into the PADS_REFCLK register varies
    per SoC. Fix the Tegra PCIe driver to program the correct values. Future
    SoCs will require different values in cfg0/1, so the two values are stored
    separately in the per-SoC data structures.

    For reference, the values are all documented in NV bug 1771116 comment 20.
    The Tegra210 value doesn't match the current TRM, but I've filed a bug to
    get the TRM fixed. Earlier TRMs don't document the value this register
    should contain, but the ASIC team has validated all these values, except
    for the Tegra20 value which is simply left unchanged in this patch.

    Signed-off-by: Stephen Warren
    Signed-off-by: Tom Warren

    Stephen Warren
     

04 Jun, 2016

1 commit

  • When multiple PCI cards are present in an ls2080a board, the second
    card does not get its msi-map set up properly due to a bug in
    computing the bus number.

    The bus number returned by PCI_BDF() is not the actual PCI bus
    number, but instead represents a global u-boot PCI bus number. A
    given bus number is relative to hose->first_busno, so that has to be
    subtracted from the PCI device id.

    Signed-off-by: Bogdan Purcareata
    Acked-by: Stuart Yoder
    Reviewed-by: York Sun

    Bogdan Purcareata
     

17 May, 2016

1 commit


05 May, 2016

1 commit

  • Tegra20's PCIe controller has a couple of quirks. There are workarounds in
    the driver for these, but they don't work after the DM conversion:

    1) The PCI_CLASS value is wrong in HW.

    This is worked around in pci_tegra_read_config() by patching up the value
    read from that register. Pre-DM, the PCIe core always read this via a
    16-bit access to the 16-bit offset 0xa. With DM, 32-bit accesses are used,
    so we need to check for offset 0x8 instead. Mask the offset value back to
    32-bit alignment to make this work in all cases.

    2) Accessing devices other than dev 1 causes a data abort.

    Pre-DM, this was worked around in pci_skip_dev(), which the PCIe core code
    called during enumeration while iterating over a bus. The DM PCIe core
    doesn't use this function. Instead, enhance tegra_pcie_conf_address() to
    validate the bdf being accessed, and refuse to access invalid devices.
    Since pci_skip_dev() isn't used, delete it.

    I've also validated that both these WARs are only needed for Tegra20, by
    testing on Tegra30/Cardhu and Tegra124/Jetson TKx. So, compile them in
    conditionally.

    Fixes: e81ca88451cf ("dm: tegra: pci: Convert tegra boards to driver model for PCI")
    Signed-off-by: Stephen Warren
    Reviewed-by: Thierry Reding
    Reviewed-by: Simon Glass
    Signed-off-by: Tom Warren

    Stephen Warren
     

26 Apr, 2016

1 commit


22 Mar, 2016

2 commits

  • msi-map properties are used to tell an OS how PCI requester IDs are
    mapped to ARM SMMU stream IDs.

    for all PCI devices discovered in a system:
    -allocate a LUT (look-up-table) entry in that PCI controller
    -allocate a stream ID for the device
    -program and enable a LUT entry (maps PCI requester id to stream ID)
    -set the msi-map property on the controller reflecting the
    LUT mapping

    basic bus scanning loop/logic was taken from drivers/pci/pci.c
    pci_hose_scan_bus().

    Signed-off-by: Stuart Yoder
    Reviewed-by: York Sun

    Stuart Yoder
     
  • Remove stream ID partitioning support that has been made
    obsolete by upstream device tree bindings that specify how
    representing how PCI requester IDs are mapped to MSI specifiers
    and SMMU stream IDs.

    Signed-off-by: Stuart Yoder
    Reviewed-by: York Sun

    Stuart Yoder
     

17 Mar, 2016

2 commits


15 Mar, 2016

2 commits


26 Feb, 2016

1 commit


25 Feb, 2016

1 commit


30 Jan, 2016

1 commit


29 Jan, 2016

3 commits

  • With CONFIG_DM_PCI enabled, PCI buses are not enumerated at boot, as they
    are without that config option enabled. No command exists to enumerate the
    PCI buses. Hence, unless some board-specific code causes PCI enumeration,
    PCI-based Ethernet devices are not detected, and network access is not
    available.

    This patch implements "pci enum" in the CONFIG_DM_PCI case, thus giving a
    mechanism whereby PCI can be enumerated.

    do_pci()'s handling of case 'e' is moved into a single location before the
    dev variable is assigned, in order to skip calculation of dev. The enum
    sub-command doesn't need the dev value, and skipping its calculation
    avoids an irrelevant error being printed.

    Using a command to initialize PCI like this has a disadvantage relative to
    enumerating PCI at boot. In particular, Ethernet devices are not probed
    during PCI enumeration, but only when used. This defers setting variables
    such as ethact, ethaddr, etc. until the first network-related command is
    executed. Hopefully this will not cause further issues. Perhaps in the
    long term, we need a "net start/enum" command too?

    Signed-off-by: Stephen Warren
    Reviewed-by: Simon Glass
    Reviewed-by: Bin Meng

    Stephen Warren
     
  • Tom Rini
     
  • This function can fail, so be sure to report any errors that occur.

    Signed-off-by: Simon Glass
    Reviewed-by: Joe Hershberger

    Simon Glass
     

24 Jan, 2016

4 commits


19 Jan, 2016

1 commit

  • With gcc-5.x we get:
    drivers/pci/pci_rom.c: In function 'dm_pci_run_vga_bios':
    drivers/pci/pci_rom.c:352:3: warning: 'ram' may be used uninitialized in
    this function [-Wmaybe-uninitialized]

    While unconvinced that this can happen in practice (if we malloc we set
    alloced to true, it will be false otherwise), silence the compiler.

    Signed-off-by: Tom Rini
    Reviewed-by: Bin Meng
    Reviewed-by: Simon Glass

    Tom Rini
     

15 Jan, 2016

1 commit