Commit Graph

4 Commits

Author SHA1 Message Date
Myron Stowe 4fd3c13ace PCI: rcar: Avoid defines prefixed with CONFIG
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2228915
Upstream Status: 727de4c0876836fdf59ec13c3121880fc939cc3e

commit 727de4c0876836fdf59ec13c3121880fc939cc3e
Author: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Date:   Fri Jan 13 09:45:16 2023 +0100

    PCI: rcar: Avoid defines prefixed with CONFIG

    Defines prefixed with "CONFIG" should be limited to proper Kconfig options,
    that are introduced in a Kconfig file.

    In the R-car driver the bitmask to configure the SEND_ENABLE mode is named
    CONFIG_SEND_ENABLE.

    Rename this local definition to a more suitable name, containing the
    register bitfield name defined in the R-Car Gen3 rev. 2.30 user
    manual.

    No functional change.

    Link: https://lore.kernel.org/r/20230113084516.31888-1-lukas.bulwahn@gmail.com
    Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
    [lpieralisi@kernel.org: Changed define naming and commit log]
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-09-05 09:16:45 -06:00
Myron Stowe 40bc5ae441 PCI: rcar: Add L1 link state fix into data abort hook
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2045254
Upstream Status: a115b1bd3af0c2963e72f6e47143724c59251be6

commit a115b1bd3af0c2963e72f6e47143724c59251be6
Author: Marek Vasut <marek.vasut+renesas@gmail.com>
Date:   Sun Aug 15 20:16:50 2021 +0200

    PCI: rcar: Add L1 link state fix into data abort hook

    When the link is in L1, hardware should return it to L0
    automatically whenever a transaction targets a component on the
    other end of the link (PCIe r5.0, sec 5.2).

    The R-Car PCIe controller doesn't handle this transition correctly.
    If the link is not in L0, an MMIO transaction targeting a downstream
    device fails, and the controller reports an ARM imprecise external
    abort.

    Work around this by hooking the abort handler so the driver can
    detect this situation and help the hardware complete the link state
    transition.

    When the R-Car controller receives a PM_ENTER_L1 DLLP from the
    downstream component, it sets PMEL1RX bit in PMSR register, but then
    the controller enters some sort of in-between state.  A subsequent
    MMIO transaction will fail, resulting in the external abort.  The
    abort handler detects this condition and completes the link state
    transition by setting the L1IATN bit in PMCTLR and waiting for the
    link state transition to complete.

    Link: https://lore.kernel.org/r/20210815181650.132579-1-marek.vasut@gmail.com
    Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Cc: Bjorn Helgaas <bhelgaas@google.com>
    Cc: Geert Uytterhoeven <geert+renesas@glider.be>
    Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Cc: Wolfram Sang <wsa@the-dreams.de>
    Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Cc: linux-renesas-soc@vger.kernel.org

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-03-03 20:43:39 -07:00
Lad Prabhakar 2a6d0d63d9 PCI: rcar: Add endpoint mode support
Add support for R-Car PCIe controller to work in endpoint mode.

Link: https://lore.kernel.org/r/1588854799-13710-8-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
2020-05-22 12:35:32 +01:00
Lad Prabhakar 78a0d7f2f5 PCI: rcar: Move shareable code to a common file
Move shareable code to common file pcie-rcar.c and the #defines to
pcie-rcar.h so that the common code can be reused with endpoint driver.
There are no functional changes with this patch for the host controller
driver.

Link: https://lore.kernel.org/r/1588854799-13710-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
2020-05-11 11:29:47 +01:00