pci.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * arch/powerpc/kernel/mpc10x_common.c
  3. *
  4. * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge,
  5. * Mem ctlr, EPIC, etc.
  6. *
  7. * Author: Mark A. Greer
  8. * mgreer@mvista.com
  9. *
  10. * Copyright 2001 MontaVista Software Inc.
  11. *
  12. * SPDX-License-Identifier: GPL-2.0+
  13. */
  14. #include <common.h>
  15. #ifdef CONFIG_PCI
  16. #include <asm/processor.h>
  17. #include <asm/io.h>
  18. #include <pci.h>
  19. #include <mpc824x.h>
  20. void pci_mpc824x_init (struct pci_controller *hose)
  21. {
  22. hose->first_busno = 0;
  23. hose->last_busno = 0xff;
  24. /* System memory space */
  25. pci_set_region(hose->regions + 0,
  26. CHRP_PCI_MEMORY_BUS,
  27. CHRP_PCI_MEMORY_PHYS,
  28. CHRP_PCI_MEMORY_SIZE,
  29. PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
  30. /* PCI memory space */
  31. pci_set_region(hose->regions + 1,
  32. CHRP_PCI_MEM_BUS,
  33. CHRP_PCI_MEM_PHYS,
  34. CHRP_PCI_MEM_SIZE,
  35. PCI_REGION_MEM);
  36. /* ISA/PCI memory space */
  37. pci_set_region(hose->regions + 2,
  38. CHRP_ISA_MEM_BUS,
  39. CHRP_ISA_MEM_PHYS,
  40. CHRP_ISA_MEM_SIZE,
  41. PCI_REGION_MEM);
  42. /* PCI I/O space */
  43. pci_set_region(hose->regions + 3,
  44. CHRP_PCI_IO_BUS,
  45. CHRP_PCI_IO_PHYS,
  46. CHRP_PCI_IO_SIZE,
  47. PCI_REGION_IO);
  48. /* ISA/PCI I/O space */
  49. pci_set_region(hose->regions + 4,
  50. CHRP_ISA_IO_BUS,
  51. CHRP_ISA_IO_PHYS,
  52. CHRP_ISA_IO_SIZE,
  53. PCI_REGION_IO);
  54. hose->region_count = 5;
  55. pci_setup_indirect(hose,
  56. CHRP_REG_ADDR,
  57. CHRP_REG_DATA);
  58. pci_register_hose(hose);
  59. hose->last_busno = pci_hose_scan(hose);
  60. }
  61. #endif