Minghuan Lian | a4d6b61 | 2014-10-31 13:43:44 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2014 Freescale Semiconductor, Inc. |
| 3 | * Layerscape PCIe driver |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <asm/arch/fsl_serdes.h> |
| 10 | #include <pci.h> |
| 11 | #include <asm/io.h> |
| 12 | #include <asm/pcie_layerscape.h> |
| 13 | |
| 14 | #ifdef CONFIG_OF_BOARD_SETUP |
| 15 | #include <libfdt.h> |
| 16 | #include <fdt_support.h> |
| 17 | |
| 18 | static void ft_pcie_ls_setup(void *blob, const char *pci_compat, |
| 19 | unsigned long ctrl_addr, enum srds_prtcl dev) |
| 20 | { |
| 21 | int off; |
| 22 | |
| 23 | off = fdt_node_offset_by_compat_reg(blob, pci_compat, |
| 24 | (phys_addr_t)ctrl_addr); |
| 25 | if (off < 0) |
| 26 | return; |
| 27 | |
| 28 | if (!is_serdes_configured(dev)) |
| 29 | fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0); |
| 30 | } |
| 31 | |
| 32 | void ft_pcie_setup(void *blob, bd_t *bd) |
| 33 | { |
| 34 | #ifdef CONFIG_PCIE1 |
| 35 | ft_pcie_ls_setup(blob, FSL_PCIE_COMPAT, CONFIG_SYS_PCIE1_ADDR, PCIE1); |
| 36 | #endif |
| 37 | |
| 38 | #ifdef CONFIG_PCIE2 |
| 39 | ft_pcie_ls_setup(blob, FSL_PCIE_COMPAT, CONFIG_SYS_PCIE2_ADDR, PCIE2); |
| 40 | #endif |
| 41 | } |
| 42 | |
| 43 | #else |
| 44 | void ft_pcie_setup(void *blob, bd_t *bd) |
| 45 | { |
| 46 | } |
| 47 | #endif |
| 48 | |
| 49 | void pci_init_board(void) |
| 50 | { |
| 51 | } |