uninorth.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * QEMU Uninorth PCI host (for all Mac99 and newer machines)
  3. *
  4. * Copyright (c) 2006 Fabrice Bellard
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. */
  24. #ifndef UNINORTH_H
  25. #define UNINORTH_H
  26. #include "hw/hw.h"
  27. #include "hw/ppc/openpic.h"
  28. /* UniNorth version */
  29. #define UNINORTH_VERSION_10A 0x7
  30. #define TYPE_UNI_NORTH_PCI_HOST_BRIDGE "uni-north-pci-pcihost"
  31. #define TYPE_UNI_NORTH_AGP_HOST_BRIDGE "uni-north-agp-pcihost"
  32. #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pcihost"
  33. #define TYPE_U3_AGP_HOST_BRIDGE "u3-agp-pcihost"
  34. #define UNI_NORTH_PCI_HOST_BRIDGE(obj) \
  35. OBJECT_CHECK(UNINHostState, (obj), TYPE_UNI_NORTH_PCI_HOST_BRIDGE)
  36. #define UNI_NORTH_AGP_HOST_BRIDGE(obj) \
  37. OBJECT_CHECK(UNINHostState, (obj), TYPE_UNI_NORTH_AGP_HOST_BRIDGE)
  38. #define UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE(obj) \
  39. OBJECT_CHECK(UNINHostState, (obj), TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE)
  40. #define U3_AGP_HOST_BRIDGE(obj) \
  41. OBJECT_CHECK(UNINHostState, (obj), TYPE_U3_AGP_HOST_BRIDGE)
  42. typedef struct UNINHostState {
  43. PCIHostState parent_obj;
  44. uint32_t ofw_addr;
  45. OpenPICState *pic;
  46. qemu_irq irqs[4];
  47. MemoryRegion pci_mmio;
  48. MemoryRegion pci_hole;
  49. MemoryRegion pci_io;
  50. } UNINHostState;
  51. typedef struct UNINState {
  52. SysBusDevice parent_obj;
  53. MemoryRegion mem;
  54. } UNINState;
  55. #define TYPE_UNI_NORTH "uni-north"
  56. #define UNI_NORTH(obj) \
  57. OBJECT_CHECK(UNINState, (obj), TYPE_UNI_NORTH)
  58. #endif /* UNINORTH_H */