commandProcessing.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * linux/arch/arm/kernel/arch_timer.c
  3. *
  4. * Copyright (C) 2011 ARM Ltd.
  5. * All Rights Reserved
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/kernel.h>
  13. #include <linux/delay.h>
  14. #include <linux/device.h>
  15. #include <linux/smp.h>
  16. #include <linux/cpu.h>
  17. #include <linux/jiffies.h>
  18. #include <linux/clockchips.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/of_irq.h>
  21. #include <linux/io.h>
  22. #include <asm/cputype.h>
  23. #include <asm/delay.h>
  24. #include <asm/localtimer.h>
  25. #include <asm/arch_timer.h>
  26. #include <asm/system_info.h>
  27. #include <asm/sched_clock.h>
  28. static unsigned long arch_timer_rate;
  29. enum ppi_nr {
  30. PHYS_SECURE_PPI,
  31. PHYS_NONSECURE_PPI,
  32. VIRT_PPI,
  33. HYP_PPI,
  34. MAX_TIMER_PPI
  35. };
  36. static int arch_timer_ppi[MAX_TIMER_PPI];
  37. static struct clock_event_device __percpu **arch_timer_evt;
  38. static struct delay_timer arch_delay_timer;
  39. static bool arch_timer_use_virtual = true;
  40. /*
  41. * Architected system timer support.
  42. */
  43. #define ARCH_TIMER_CTRL_ENABLE (1 << 0)
  44. #define ARCH_TIMER_CTRL_IT_MASK (1 << 1)
  45. #define ARCH_TIMER_CTRL_IT_STAT (1 << 2)
  46. #define ARCH_TIMER_REG_CTRL 0
  47. #define ARCH_TIMER_REG_FREQ 1