pci.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * pci.c: GT64120 PCI support.
  3. *
  4. * Copyright (C) 2006, Wind River System Inc. Rongkai.Zhan <rongkai.zhan@windriver.com>
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/ioport.h>
  12. #include <linux/types.h>
  13. #include <linux/pci.h>
  14. #include <asm/gt64120.h>
  15. extern struct pci_ops gt64xxx_pci0_ops;
  16. static struct resource pci0_io_resource = {
  17. .name = "pci_0 io",
  18. .start = GT_PCI_IO_BASE,
  19. .end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1,
  20. .flags = IORESOURCE_IO,
  21. };
  22. static struct resource pci0_mem_resource = {
  23. .name = "pci_0 memory",
  24. .start = GT_PCI_MEM_BASE,
  25. .end = GT_PCI_MEM_BASE + GT_PCI_MEM_SIZE - 1,
  26. .flags = IORESOURCE_MEM,
  27. };
  28. static struct pci_controller hose_0 = {
  29. .pci_ops = &gt64xxx_pci0_ops,
  30. .io_resource = &pci0_io_resource,
  31. .mem_resource = &pci0_mem_resource,
  32. };
  33. static int __init gt64120_pci_init(void)
  34. {
  35. u32 tmp;
  36. tmp = GT_READ(GT_PCI0_CMD_OFS); /* Huh??? -- Ralf */
  37. tmp = GT_READ(GT_PCI0_BARE_OFS);
  38. /* reset the whole PCI I/O space range */
  39. ioport_resource.start = GT_PCI_IO_BASE;
  40. ioport_resource.end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1;
  41. register_pci_controller(&hose_0);
  42. return 0;
  43. }
  44. arch_initcall(gt64120_pci_init);