24 #include <asm/addrspace.h>
35 #define IMR_IP2_VAL K_BCM1480_INT_MAP_I0
36 #define IMR_IP3_VAL K_BCM1480_INT_MAP_I1
37 #define IMR_IP4_VAL K_BCM1480_INT_MAP_I2
43 static void sibyte_set_mode(
enum clock_event_mode
mode,
44 struct clock_event_device *
evt)
53 case CLOCK_EVT_MODE_PERIODIC:
60 case CLOCK_EVT_MODE_ONESHOT:
62 case CLOCK_EVT_MODE_SHUTDOWN:
66 case CLOCK_EVT_MODE_UNUSED:
67 case CLOCK_EVT_MODE_RESUME:
72 static int sibyte_next_event(
unsigned long delta,
struct clock_event_device *
cd)
90 struct clock_event_device *cd =
dev_id;
94 if (cd->mode == CLOCK_EVT_MODE_PERIODIC)
101 ____raw_writeq(tmode, cfg);
103 cd->event_handler(cd);
108 static DEFINE_PER_CPU(
struct clock_event_device, sibyte_hpt_clockevent);
117 struct clock_event_device *cd = &
per_cpu(sibyte_hpt_clockevent, cpu);
118 unsigned char *
name =
per_cpu(sibyte_hpt_name, cpu);
122 sprintf(name,
"bcm1480-counter-%d", cpu);
124 cd->features = CLOCK_EVT_FEAT_PERIODIC |
125 CLOCK_EVT_FEAT_ONESHOT;
132 cd->set_next_event = sibyte_next_event;
133 cd->set_mode = sibyte_set_mode;
147 action->
handler = sibyte_counter_handler;