2
0

arm_mptimer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Private peripheral timer/watchdog blocks for ARM 11MPCore and A9MP
  3. *
  4. * Copyright (c) 2006-2007 CodeSourcery.
  5. * Copyright (c) 2011 Linaro Limited
  6. * Written by Paul Brook, Peter Maydell
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef HW_TIMER_ARM_MPTIMER_H
  22. #define HW_TIMER_ARM_MPTIMER_H
  23. #include "hw/sysbus.h"
  24. #include "qom/object.h"
  25. #define ARM_MPTIMER_MAX_CPUS 4
  26. /* State of a single timer or watchdog block */
  27. typedef struct {
  28. uint32_t control;
  29. uint32_t status;
  30. struct ptimer_state *timer;
  31. qemu_irq irq;
  32. MemoryRegion iomem;
  33. } TimerBlock;
  34. #define TYPE_ARM_MPTIMER "arm_mptimer"
  35. OBJECT_DECLARE_SIMPLE_TYPE(ARMMPTimerState, ARM_MPTIMER)
  36. struct ARMMPTimerState {
  37. /*< private >*/
  38. SysBusDevice parent_obj;
  39. /*< public >*/
  40. uint32_t num_cpu;
  41. TimerBlock timerblock[ARM_MPTIMER_MAX_CPUS];
  42. MemoryRegion iomem;
  43. };
  44. #endif