Merge branch 'master' of git://88.191.163.10/u-boot-arm
[oweals/u-boot.git] / arch / powerpc / cpu / mpc83xx / pcie.c
index 52d446175aa5992e1e1c3a36c550d61d22bd818e..28c25e5febba59176db4ebba14a5360b6156032d 100644 (file)
@@ -5,20 +5,7 @@
  * Authors: Tony Li <tony.li@freescale.com>
  *          Anton Vorontsov <avorontsov@ru.mvista.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -286,8 +273,8 @@ static void mpc83xx_pcie_init_bus(int bus, struct pci_region *reg)
        get_clocks();
        /* Configure the PCIE controller core clock ratio */
        out_le32(hose_cfg_base + PEX_GCLK_RATIO,
-               (((bus ? gd->pciexp2_clk : gd->pciexp1_clk) / 1000000) * 16)
-               / 333);
+               (((bus ? gd->arch.pciexp2_clk : gd->arch.pciexp1_clk)
+                       / 1000000) * 16) / 333);
        udelay(1000000);
 
        /* Do Type 1 bridge configuration */
@@ -312,6 +299,8 @@ static void mpc83xx_pcie_init_bus(int bus, struct pci_region *reg)
 
        printf("PCIE%d: ", bus);
 
+#define PCI_LTSSM      0x404 /* PCIe Link Training, Status State Machine */
+#define PCI_LTSSM_L0   0x16 /* L0 state */
        reg16 = in_le16(hose_cfg_base + PCI_LTSSM);
        if (reg16 >= PCI_LTSSM_L0)
                printf("link\n");