IMX6 PCI with external clocks

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6 PCI with external clocks

IMX6 PCI with external clocks

(

  converted from discussion created by Alfred Latypov

  IMX6 PCI with external cloks 

)

   Hello, I had a problem, to launch a board with an imx6 solo processor with a pci-express, and with external clock. I'll tell you my decision.

On my motherboard there is a pci-switch PI7C9X2G606 from Pericom with 4 endpoints of Intel type 82574 ethernet controller.

I used the Linux kernel version 4.9.16

In the device-tree file, I used the following options to enable external clocks for CLK1 input gate (100MHz). Sorry, I had to change the root imx6 device tree file. See attached (imx6*.dtsi) files. From ..kernel/arch/arm/boot/dts/..

Add anatop external clock source for clocks section, and change clk source for pcie-phy.

...

anaclk1 {
            compatible = "fixed-clock";
            reg = <0>;
            #clock-cells = <0>;
            clock-frequency = <100000000>;  /* 100MHz */
        };

...

Change pcie section

...

        pcie: pcie@0x01000000 {
            compatible = "fsl,imx6q-pcie", "snps,dw-pcie";
            reg = <0x01ffc000 0x04000>,
                  <0x01f00000 0x80000>;
            reg-names = "dbi", "config";
            #address-cells = <3>;
            #size-cells = <2>;
            device_type = "pci";
            ranges = <0x81000000 0 0          0x01e00000 0 0x00100000 /* downstream I/O */
                  0x82000000 0 0x01000000 0x01000000 0 0x00e00000>; /* non-prefetchable memory */
            /* ranges = <0x81000000 0 0          0x01f80000 0 0x00010000
                  0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; */
            num-lanes = <1>;
            interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
            interrupt-names = "msi";
            #interrupt-cells = <1>;
            interrupt-map-mask = <0 0 0 0x7>;
            interrupt-map = <0 0 0 1 &gpc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
                            <0 0 0 2 &gpc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
                            <0 0 0 3 &gpc GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
                            <0 0 0 4 &gpc GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&clks IMX6QDL_CLK_PCIE_AXI>,
                 <&clks IMX6QDL_CLK_LVDS1_IN>,
                 <&clks IMX6QDL_CLK_SATA_REF_100M>;
            clock-names = "pcie", "pcie_bus", "pcie_phy";
            status = "disabled";
        };

...

and add new source clocks dependencies:

....

&clks {
        assigned-clocks = <&clks IMX6QDL_PLL6_BYPASS_SRC>,
                          <&clks IMX6QDL_PLL6_BYPASS>;                          
        assigned-clock-parents = <&clks IMX6QDL_CLK_LVDS1_IN>,
                                 <&clks IMX6QDL_PLL6_BYPASS_SRC>;
        assigned-clock-rates = <100000000>, <100000000>;
};

....

for your board dtsi.

I could not start the pcie-bus with the function Gen2.

Next, I needed to change the bus driver (pci-imx6.c), for fine tuning the bus clock frequency. I add MPLL frequency services functions (Thanks for Charle Powe i.MX6Q: Using an external reference for PCIe ):

...

static void imx_pcie_override_phy_mpll(struct pcie_port *pp, u32 mpll_multiplier, u32 ref_clkdiv2)
{
    u32 ref_usb2_en;
    u32 reg1;
    
    
    pr_info("Overriding PCIe PHY MPLL config: multiplier = %d, clkdiv2 = %d\n",
        mpll_multiplier, ref_clkdiv2);
        
    
    // set MPLL to disabled
    ////pcie_phy_write(pp->dbi_base, PCIE_PHY_MPLL_OVRD_IN_LO, 0x0001);
    
    // set MPLL multiplier    
    pcie_phy_write(pp->dbi_base, PCIE_PHY_MPLL_OVRD_IN_LO,
            (0x0001<<9 | (mpll_multiplier<<2)) & 0x03fc);
    
    /*
     * set the ref_clkdiv2.  when this override is enabled it
     * overrides both ref_clkdiv2 and ref_usb2_en.  make sure
     * the overriden ref_usb2_en reflects the original value.
     */     
    pcie_phy_read(pp->dbi_base, PCIE_PHY_ATEOVRD, &reg1);     
    ref_usb2_en = (reg1 >> 1) & 0x1;   

    /* set the current value of ref_usb2_en as the override */     
    /* set the ref_clkdiv2 override  */     
    /* enable the ref_clkdiv2 override */     
    pcie_phy_write(pp->dbi_base, PCIE_PHY_ATEOVRD,
            (ref_usb2_en << 1) | ref_clkdiv2 | (0x1 << 2));   
    
    /* enable MPLL */    
    ///pcie_phy_write(pp->dbi_base, PCIE_PHY_MPLL_OVRD_IN_LO, 0x0003);
        
}

...

call this function in pcie_hos_init

...

static void imx6_pcie_host_init(struct pcie_port *pp)
{
    imx6_pcie_assert_core_reset(pp);       
    imx6_pcie_init_phy(pp);       
    imx6_pcie_deassert_core_reset(pp);   
    imx_pcie_override_phy_mpll(pp, 50, 1); /* tune this */     
    dw_pcie_setup_rc(pp);

    imx6_pcie_establish_link(pp); 

    if (IS_ENABLED(CONFIG_PCI_MSI))
        dw_pcie_msi_init(pp);
}

...

See documentation for p.p. IMX6DLRM 50.5.1.2.

Tune <pci_hotplug_mem_size> global variable for optimal pci window sizes enumeration.

See for my imx6_add_pcie_port call.

If you use a FEC module, it will stop working. You must use an external clock as specified in the documentation (http://cache.freescale.com/files/32bit/doc/user_guide/IMX6DQ6SDLHDG.pdf ). Changes are shown in the attached dtsi file.

For clocks segment

...

rmii_clk: clock@0 {
            compatible = "fixed-clock";
            reg = <0>;
            #clock-cells = <0>;
            clock-frequency = <50000000>;  /* 50MHz */
        };

...

and for fec:

...

fec: ethernet@02188000 {
                compatible = "fsl,imx6q-fec";
                reg = <0x02188000 0x4000>;
                interrupts-extended =
                    <&intc 0 118 IRQ_TYPE_LEVEL_HIGH>,
                    <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&clks IMX6QDL_CLK_ENET>,
                     <&clks IMX6QDL_CLK_ENET>,
                     <&rmii_clk>;
                clock-names = "ipg", "ahb", "ptp";
                status = "disabled";
            };

...

If they are not required, disable this editing this file.

Thanks for all. Sorry for my bad English.

Alfred <[email protected]>

This document was generated from the following discussion: IMX6 PCI with external cloks

Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1119714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EIMX6%20PCI%20with%20external%20clocks%20%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1119714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E(%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%26nbsp%3B%20converted%20from%20discussion%20created%20by%20Alfred%20Latypov%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fthread%2F448174%22%20target%3D%22_blank%22%3EIMX6%20PCI%20with%20external%20cloks%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E)%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%26nbsp%3B%20%26nbsp%3BHello%2C%20I%20had%20a%20problem%2C%20to%20launch%20a%20board%20with%20an%20imx6%20solo%20processor%20with%20a%20pci-express%2C%20and%20with%20external%20clock.%20I'll%20tell%20you%20my%20decision.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EOn%20my%20motherboard%20there%20is%20a%20pci-switch%20PI7C9X2G606%20from%20Pericom%20with%204%20endpoints%20of%20Intel%20type%2082574%20ethernet%20controller.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EI%20used%20the%20Linux%20kernel%20version%204.9.16%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EIn%20the%20device-tree%20file%2C%20I%20used%20the%20following%20options%20to%20enable%20external%20clocks%20for%20CLK1%20input%20gate%20(100MHz).%20Sorry%2C%20I%20had%20to%20change%20the%20root%20imx6%20device%20tree%20file.%20See%20attached%20(imx6*.dtsi)%20files.%20From%20..kernel%2Farch%2Farm%2Fboot%2Fdts%2F..%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EAdd%20anatop%20external%20clock%20source%20for%20clocks%20section%2C%20and%20change%20clk%20source%20for%20pcie-phy.%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3Eanaclk1%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bcompatible%20%3D%20%22fixed-clock%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breg%20%3D%20%26lt%3B0%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%23clock-cells%20%3D%20%26lt%3B0%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bclock-frequency%20%3D%20%26lt%3B100000000%26gt%3B%3B%26nbsp%3B%20%2F*%20100MHz%20*%2F%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3B%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3EChange%20pcie%20section%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20pcie%3A%20pcie%400x01000000%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bcompatible%20%3D%20%22fsl%2Cimx6q-pcie%22%2C%20%22snps%2Cdw-pcie%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breg%20%3D%20%26lt%3B0x01ffc000%200x04000%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26lt%3B0x01f00000%200x80000%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breg-names%20%3D%20%22dbi%22%2C%20%22config%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%23address-cells%20%3D%20%26lt%3B3%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%23size-cells%20%3D%20%26lt%3B2%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bdevice_type%20%3D%20%22pci%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Branges%20%3D%20%26lt%3B0x81000000%200%200%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%200x01e00000%200%200x00100000%20%2F*%20downstream%20I%2FO%20*%2F%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%200x82000000%200%200x01000000%200x01000000%200%200x00e00000%26gt%3B%3B%20%2F*%20non-prefetchable%20memory%20*%2F%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F*%20ranges%20%3D%20%26lt%3B0x81000000%200%200%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%200x01f80000%200%200x00010000%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%200x82000000%200%200x01000000%200x01000000%200%200x00f00000%26gt%3B%3B%20*%2F%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bnum-lanes%20%3D%20%26lt%3B1%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Binterrupts%20%3D%20%3CGIC_SPI%20120%3D%22%22%20irq_type_level_high%3D%22%22%3E%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Binterrupt-names%20%3D%20%22msi%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%23interrupt-cells%20%3D%20%26lt%3B1%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Binterrupt-map-mask%20%3D%20%26lt%3B0%200%200%200x7%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Binterrupt-map%20%3D%20%26lt%3B0%200%200%201%20%26amp%3Bgpc%20GIC_SPI%20123%20IRQ_TYPE_LEVEL_HIGH%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26lt%3B0%200%200%202%20%26amp%3Bgpc%20GIC_SPI%20122%20IRQ_TYPE_LEVEL_HIGH%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26lt%3B0%200%200%203%20%26amp%3Bgpc%20GIC_SPI%20121%20IRQ_TYPE_LEVEL_HIGH%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26lt%3B0%200%200%204%20%26amp%3Bgpc%20GIC_SPI%20120%20IRQ_TYPE_LEVEL_HIGH%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bclocks%20%3D%20%26lt%3B%26amp%3Bclks%20IMX6QDL_CLK_PCIE_AXI%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%20%26lt%3B%26amp%3Bclks%20IMX6QDL_CLK_LVDS1_IN%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%20%26lt%3B%26amp%3Bclks%20IMX6QDL_CLK_SATA_REF_100M%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bclock-names%20%3D%20%22pcie%22%2C%20%22pcie_bus%22%2C%20%22pcie_phy%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bstatus%20%3D%20%22disabled%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3B%3C%2FGIC_SPI%3E%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3Eand%20add%20new%20source%20clocks%20dependencies%3A%3C%2FP%3E%3CP%3E....%3C%2FP%3E%3CP%3E%26amp%3Bclks%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20assigned-clocks%20%3D%20%26lt%3B%26amp%3Bclks%20IMX6QDL_PLL6_BYPASS_SRC%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26lt%3B%26amp%3Bclks%20IMX6QDL_PLL6_BYPASS%26gt%3B%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bassigned-clock-parents%20%3D%20%26lt%3B%26amp%3Bclks%20IMX6QDL_CLK_LVDS1_IN%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26lt%3B%26amp%3Bclks%20IMX6QDL_PLL6_BYPASS_SRC%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20assigned-clock-rates%20%3D%20%26lt%3B100000000%26gt%3B%2C%20%26lt%3B100000000%26gt%3B%3B%3CBR%20%2F%3E%7D%3B%3C%2FP%3E%3CP%3E....%3C%2FP%3E%3CP%3Efor%20your%20board%20dtsi.%3C%2FP%3E%3CP%3EI%20could%20not%20start%20the%20pcie-bus%20with%20the%20function%20Gen2.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3ENext%2C%20I%20needed%20to%20change%20the%20bus%20driver%20(pci-imx6.c)%2C%20for%20fine%20tuning%20the%20bus%20clock%20frequency.%20I%20add%20MPLL%20frequency%20services%20functions%20(Thanks%20for%20Charle%20Powe%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fthread%2F304283%22%20target%3D%22_blank%22%3Ei.MX6Q%3A%20Using%20an%20external%20reference%20for%20PCIe%3C%2FA%3E%26nbsp%3B%3CLI-EMOJI%20id%3D%22lia_disappointed-face%22%20title%3D%22%3Adisappointed_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3Estatic%20void%20imx_pcie_override_phy_mpll(struct%20pcie_port%20*pp%2C%20u32%20mpll_multiplier%2C%20u32%20ref_clkdiv2)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20u32%20ref_usb2_en%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20u32%20reg1%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bpr_info(%22Overriding%20PCIe%20PHY%20MPLL%20config%3A%20multiplier%20%3D%20%25d%2C%20clkdiv2%20%3D%20%25d%5Cn%22%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20mpll_multiplier%2C%20ref_clkdiv2)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20set%20MPLL%20to%20disabled%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%2F%2Fpcie_phy_write(pp-%26gt%3Bdbi_base%2C%20PCIE_PHY_MPLL_OVRD_IN_LO%2C%200x0001)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20set%20MPLL%20multiplier%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20pcie_phy_write(pp-%26gt%3Bdbi_base%2C%20PCIE_PHY_MPLL_OVRD_IN_LO%2C%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B(0x0001%26lt%3B%26lt%3B9%20%7C%20(mpll_multiplier%26lt%3B%26lt%3B2))%20%26amp%3B%200x03fc)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20*%20set%20the%20ref_clkdiv2.%26nbsp%3B%20when%20this%20override%20is%20enabled%20it%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20*%20overrides%20both%20ref_clkdiv2%20and%20ref_usb2_en.%26nbsp%3B%20make%20sure%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20*%20the%20overriden%20ref_usb2_en%20reflects%20the%20original%20value.%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20*%2F%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20pcie_phy_read(pp-%26gt%3Bdbi_base%2C%20PCIE_PHY_ATEOVRD%2C%20%26amp%3Breg1)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ref_usb2_en%20%3D%20(reg1%20%26gt%3B%26gt%3B%201)%20%26amp%3B%200x1%3B%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20set%20the%20current%20value%20of%20ref_usb2_en%20as%20the%20override%20*%2F%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20set%20the%20ref_clkdiv2%20override%26nbsp%3B%20*%2F%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20enable%20the%20ref_clkdiv2%20override%20*%2F%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20pcie_phy_write(pp-%26gt%3Bdbi_base%2C%20PCIE_PHY_ATEOVRD%2C%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B(ref_usb2_en%20%26lt%3B%26lt%3B%201)%20%7C%20ref_clkdiv2%20%7C%20(0x1%20%26lt%3B%26lt%3B%202))%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20enable%20MPLL%20*%2F%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%2Fpcie_phy_write(pp-%26gt%3Bdbi_base%2C%20PCIE_PHY_MPLL_OVRD_IN_LO%2C%200x0003)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3Ecall%20this%20function%20in%20pcie_hos_init%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3Estatic%20void%20imx6_pcie_host_init(struct%20pcie_port%20*pp)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bimx6_pcie_assert_core_reset(pp)%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bimx6_pcie_init_phy(pp)%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bimx6_pcie_deassert_core_reset(pp)%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bimx_pcie_override_phy_mpll(pp%2C%2050%2C%201)%3B%20%2F*%20tune%20this%20*%2F%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bdw_pcie_setup_rc(pp)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bimx6_pcie_establish_link(pp)%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bif%20(IS_ENABLED(CONFIG_PCI_MSI))%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bdw_pcie_msi_init(pp)%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E...%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3ESee%20documentation%20for%20p.p.%20IMX6DLRM%2050.5.1.2.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3ETune%20%3CPCI_HOTPLUG_MEM_SIZE%3E%20global%20variable%20for%20optimal%20pci%20window%20sizes%20enumeration.%3C%2FPCI_HOTPLUG_MEM_SIZE%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3ESee%20for%20my%20imx6_add_pcie_port%20call.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EIf%20you%20use%20a%20FEC%20module%2C%20it%20will%20stop%20working.%20You%20must%20use%20an%20external%20clock%20as%20specified%20in%20the%20documentation%20(%3CA%20class%3D%22link-titled%22%20href%3D%22http%3A%2F%2Fcache.freescale.com%2Ffiles%2F32bit%2Fdoc%2Fuser_guide%2FIMX6DQ6SDLHDG.pdf%22%20title%3D%22http%3A%2F%2Fcache.freescale.com%2Ffiles%2F32bit%2Fdoc%2Fuser_guide%2FIMX6DQ6SDLHDG.pdf%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttp%3A%2F%2Fcache.freescale.com%2Ffiles%2F32bit%2Fdoc%2Fuser_guide%2FIMX6DQ6SDLHDG.pdf%3C%2FA%3E%26nbsp%3B).%20Changes%20are%20shown%20in%20the%20attached%20dtsi%20file.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EFor%20clocks%20segment%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E...%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3Ermii_clk%3A%20clock%400%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bcompatible%20%3D%20%22fixed-clock%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breg%20%3D%20%26lt%3B0%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%23clock-cells%20%3D%20%26lt%3B0%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bclock-frequency%20%3D%20%26lt%3B50000000%26gt%3B%3B%26nbsp%3B%20%2F*%2050MHz%20*%2F%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3B%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E...%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3Eand%20for%20fec%3A%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E...%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3Efec%3A%20ethernet%4002188000%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bcompatible%20%3D%20%22fsl%2Cimx6q-fec%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Breg%20%3D%20%26lt%3B0x02188000%200x4000%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Binterrupts-extended%20%3D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26lt%3B%26amp%3Bintc%200%20118%20IRQ_TYPE_LEVEL_HIGH%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26lt%3B%26amp%3Bintc%200%20119%20IRQ_TYPE_LEVEL_HIGH%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bclocks%20%3D%20%26lt%3B%26amp%3Bclks%20IMX6QDL_CLK_ENET%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%20%26lt%3B%26amp%3Bclks%20IMX6QDL_CLK_ENET%26gt%3B%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%20%26lt%3B%26amp%3Brmii_clk%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bclock-names%20%3D%20%22ipg%22%2C%20%22ahb%22%2C%20%22ptp%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bstatus%20%3D%20%22disabled%22%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%7D%3B%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E...%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EIf%20they%20are%20not%20required%2C%20disable%20this%20editing%20this%20file.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3EThanks%20for%20all.%20Sorry%20for%20my%20bad%20English.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%200in%3B%20line-height%3A%20100%25%3B%22%3E%3CSPAN%3EAlfred%20%26lt%3B%3C%2FSPAN%3E%3CA%20class%3D%22jive-link-email-small%22%20href%3D%22mailto%3Amuksunoved%40mail.ru%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Emuksunoved%40mail.ru%3C%2FA%3E%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThis%20document%20was%20generated%20from%20the%20following%20discussion%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fthread%2F448174%22%20target%3D%22_blank%22%3EIMX6%20PCI%20with%20external%20cloks%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎06-15-2017 06:55 PM
Updated by: