2
0

digic-timer.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Canon DIGIC timer block declarations.
  3. *
  4. * Copyright (C) 2013 Antony Pavlov <antonynpavlov@gmail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. */
  17. #ifndef HW_TIMER_DIGIC_TIMER_H
  18. #define HW_TIMER_DIGIC_TIMER_H
  19. #include "hw/sysbus.h"
  20. #include "hw/ptimer.h"
  21. #include "qom/object.h"
  22. #define TYPE_DIGIC_TIMER "digic-timer"
  23. OBJECT_DECLARE_SIMPLE_TYPE(DigicTimerState, DIGIC_TIMER)
  24. #define DIGIC_TIMER_CONTROL 0x00
  25. #define DIGIC_TIMER_CONTROL_RST 0x80000000
  26. #define DIGIC_TIMER_CONTROL_EN 0x00000001
  27. #define DIGIC_TIMER_RELVALUE 0x08
  28. #define DIGIC_TIMER_VALUE 0x0c
  29. struct DigicTimerState {
  30. /*< private >*/
  31. SysBusDevice parent_obj;
  32. /*< public >*/
  33. MemoryRegion iomem;
  34. ptimer_state *ptimer;
  35. uint32_t control;
  36. uint32_t relvalue;
  37. };
  38. #endif /* HW_TIMER_DIGIC_TIMER_H */