[PATCH v6 06/10] PCI: dw-rockchip: Add helper function for DDL indicator
Shawn Lin
shawn.lin at rock-chips.com
Tue Sep 8 17:58:50 PDT 2026
在 2026/09/08 星期二 22:51, Sebastian Reichel 写道:
> Remove code duplication and improve readability by introducing a new
> function to setup the DLL indicator.
>
Reviewed-by: Shawn Lin <shawn.lin at rock-chips.com>
> Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
> ---
> drivers/pci/controller/dwc/pcie-dw-rockchip.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> index 211776bbcb99..1e48099e36e4 100644
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> @@ -713,6 +713,16 @@ static void rockchip_pcie_set_controller_mode(struct rockchip_pcie *rockchip, u3
> rockchip_pcie_writel_apb(rockchip, PCIE_CLIENT_SET_MODE(mode), PCIE_CLIENT_GENERAL_CON);
> }
>
> +static void rockchip_pcie_unmask_dll_indicator(struct rockchip_pcie *rockchip)
> +{
> + u32 val;
> +
> + /* unmask DLL up/down indicator and hot reset/link-down reset */
> + val = FIELD_PREP_WM16(PCIE_RDLH_LINK_UP_CHGED, 0) |
> + FIELD_PREP_WM16(PCIE_LINK_REQ_RST_NOT_INT, 0);
> + rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_INTR_MASK_MISC);
> +}
> +
> static int rockchip_pcie_configure_rc(struct platform_device *pdev,
> struct rockchip_pcie *rockchip)
> {
> @@ -760,7 +770,6 @@ static int rockchip_pcie_configure_ep(struct platform_device *pdev,
> {
> struct device *dev = &pdev->dev;
> int irq, ret;
> - u32 val;
>
> if (!IS_ENABLED(CONFIG_PCIE_ROCKCHIP_DW_EP))
> return -ENODEV;
> @@ -800,10 +809,7 @@ static int rockchip_pcie_configure_ep(struct platform_device *pdev,
>
> pci_epc_init_notify(rockchip->pci.ep.epc);
>
> - /* unmask DLL up/down indicator and hot reset/link-down reset */
> - val = FIELD_PREP_WM16(PCIE_RDLH_LINK_UP_CHGED, 0) |
> - FIELD_PREP_WM16(PCIE_LINK_REQ_RST_NOT_INT, 0);
> - rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_INTR_MASK_MISC);
> + rockchip_pcie_unmask_dll_indicator(rockchip);
>
> return ret;
> }
>
More information about the linux-arm-kernel
mailing list