045-twd_base.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --- a/arch/arm/mach-cns3xxx/core.c
  2. +++ b/arch/arm/mach-cns3xxx/core.c
  3. @@ -17,6 +17,7 @@
  4. #include <linux/platform_device.h>
  5. #include <linux/usb/ehci_pdriver.h>
  6. #include <linux/usb/ohci_pdriver.h>
  7. +#include <asm/smp_twd.h>
  8. #include <asm/mach/arch.h>
  9. #include <asm/mach/map.h>
  10. #include <asm/mach/time.h>
  11. @@ -26,6 +27,8 @@
  12. #include "core.h"
  13. #include "pm.h"
  14. +#define IRQ_LOCALTIMER 29
  15. +
  16. static struct map_desc cns3xxx_io_desc[] __initdata = {
  17. {
  18. .virtual = CNS3XXX_TC11MP_SCU_BASE_VIRT,
  19. @@ -198,6 +201,15 @@ static struct irqaction cns3xxx_timer_ir
  20. .handler = cns3xxx_timer_interrupt,
  21. };
  22. +static void __init cns3xxx_init_twd(void)
  23. +{
  24. + static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
  25. + CNS3XXX_TC11MP_TWD_BASE,
  26. + IRQ_LOCALTIMER);
  27. +
  28. + twd_local_timer_register(&cns3xx_twd_local_timer);
  29. +}
  30. +
  31. /*
  32. * Set up the clock source and clock events devices
  33. */
  34. @@ -251,6 +263,7 @@ static void __init __cns3xxx_timer_init(
  35. setup_irq(timer_irq, &cns3xxx_timer_irq);
  36. cns3xxx_clockevents_init(timer_irq);
  37. + cns3xxx_init_twd();
  38. }
  39. void __init cns3xxx_timer_init(void)