cadence_ttc.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Xilinx Zynq cadence TTC model
  3. *
  4. * Copyright (c) 2011 Xilinx Inc.
  5. * Copyright (c) 2012 Peter A.G. Crosthwaite (peter.crosthwaite@petalogix.com)
  6. * Copyright (c) 2012 PetaLogix Pty Ltd.
  7. * Written By Haibing Ma
  8. * M. Habib
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version
  13. * 2 of the License, or (at your option) any later version.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef HW_TIMER_CADENCE_TTC_H
  19. #define HW_TIMER_CADENCE_TTC_H
  20. #include "hw/sysbus.h"
  21. #include "qemu/timer.h"
  22. typedef struct {
  23. QEMUTimer *timer;
  24. int freq;
  25. uint32_t reg_clock;
  26. uint32_t reg_count;
  27. uint32_t reg_value;
  28. uint16_t reg_interval;
  29. uint16_t reg_match[3];
  30. uint32_t reg_intr;
  31. uint32_t reg_intr_en;
  32. uint32_t reg_event_ctrl;
  33. uint32_t reg_event;
  34. uint64_t cpu_time;
  35. unsigned int cpu_time_valid;
  36. qemu_irq irq;
  37. } CadenceTimerState;
  38. #define TYPE_CADENCE_TTC "cadence_ttc"
  39. OBJECT_DECLARE_SIMPLE_TYPE(CadenceTTCState, CADENCE_TTC)
  40. struct CadenceTTCState {
  41. SysBusDevice parent_obj;
  42. MemoryRegion iomem;
  43. CadenceTimerState timer[3];
  44. };
  45. #endif