pci.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * arch/ppc/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. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU General Public License as published by the
  14. * Free Software Foundation; either version 2 of the License, or (at your
  15. * option) any later version.
  16. */
  17. #include <common.h>
  18. #ifdef CONFIG_PCI
  19. #include <asm/processor.h>
  20. #include <asm/io.h>
  21. #include <pci.h>
  22. #include <mpc824x.h>
  23. void pci_mpc824x_init (struct pci_controller *hose)
  24. {
  25. hose->first_busno = 0;
  26. hose->last_busno = 0xff;
  27. /* System memory space */
  28. pci_set_region(hose->regions + 0,
  29. CHRP_PCI_MEMORY_BUS,
  30. CHRP_PCI_MEMORY_PHYS,
  31. CHRP_PCI_MEMORY_SIZE,
  32. PCI_REGION_MEM | PCI_REGION_MEMORY);
  33. /* PCI memory space */
  34. pci_set_region(hose->regions + 1,
  35. CHRP_PCI_MEM_BUS,
  36. CHRP_PCI_MEM_PHYS,
  37. CHRP_PCI_MEM_SIZE,
  38. PCI_REGION_MEM);
  39. /* ISA/PCI memory space */
  40. pci_set_region(hose->regions + 2,
  41. CHRP_ISA_MEM_BUS,
  42. CHRP_ISA_MEM_PHYS,
  43. CHRP_ISA_MEM_SIZE,
  44. PCI_REGION_MEM);
  45. /* PCI I/O space */
  46. pci_set_region(hose->regions + 3,
  47. CHRP_PCI_IO_BUS,
  48. CHRP_PCI_IO_PHYS,
  49. CHRP_PCI_IO_SIZE,
  50. PCI_REGION_IO);
  51. /* ISA/PCI I/O space */
  52. pci_set_region(hose->regions + 4,
  53. CHRP_ISA_IO_BUS,
  54. CHRP_ISA_IO_PHYS,
  55. CHRP_ISA_IO_SIZE,
  56. PCI_REGION_IO);
  57. hose->region_count = 5;
  58. pci_setup_indirect(hose,
  59. CHRP_REG_ADDR,
  60. CHRP_REG_DATA);
  61. pci_register_hose(hose);
  62. hose->last_busno = pci_hose_scan(hose);
  63. }
  64. #endif