pcie_layerscape.c 999 B

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