0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-03-14 10:07:20 +00:00
Lakka-LibreELEC/projects/NXP/devices/iMX8/patches/linux/0013-PCI-imx-Use-the-external-clock-as-REF_CLK-when-neede.patch
Rudi Heitbaum 7862c4854a linux (NXP iMX8): adjust downstream mendel coral patches for linux-6.11
Allows pcie0 to come online (not the wireless card though)
2024-10-15 07:42:18 +00:00

42 lines
1.5 KiB
Diff

From dd3d8c2c0b77eb742b288cf83e4849f87c8db5c6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 7 Mar 2023 21:19:36 -0800
Subject: [PATCH 3/4] PCI: imx: Use the external clock as REF_CLK when needed
for i.MX8MQ
Do not use the external clock when the internal PLL is used as PCIe
REF_CLK.
Signed-off-by: Ryosuke Saito <rsaito@redhat.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
drivers/pci/controller/dwc/pci-imx6.c | 15 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 3a8350cad812..841af6f55c7d 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -370,11 +370,13 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
static int imx8mq_pcie_init_phy(struct imx_pcie *imx_pcie)
{
- /* TODO: Currently this code assumes external oscillator is being used */
- regmap_update_bits(imx_pcie->iomuxc_gpr,
- imx_pcie_grp_offset(imx_pcie),
- IMX8MQ_GPR_PCIE_REF_USE_PAD,
- IMX8MQ_GPR_PCIE_REF_USE_PAD);
+ if (imx_pcie->ext_osc) {
+ /* Use the external oscillator as REF clock */
+ regmap_update_bits(imx_pcie->iomuxc_gpr,
+ imx_pcie_grp_offset(imx_pcie),
+ IMX8MQ_GPR_PCIE_REF_USE_PAD,
+ IMX8MQ_GPR_PCIE_REF_USE_PAD);
+ }
/*
* Regarding the datasheet, the PCIE_VPH is suggested to be 1.8V. If the PCIE_VPH is
* supplied by 3.3V, the VREG_BYPASS should be cleared to zero.
--
2.39.2