24 #include <asm/addrspace.h>
33 #define IMR_IP2_VAL K_INT_MAP_I0
34 #define IMR_IP3_VAL K_INT_MAP_I1
35 #define IMR_IP4_VAL K_INT_MAP_I2
41 static void sibyte_set_mode(
enum clock_event_mode
mode,
42 struct clock_event_device *
evt)
51 case CLOCK_EVT_MODE_PERIODIC:
58 case CLOCK_EVT_MODE_ONESHOT:
60 case CLOCK_EVT_MODE_SHUTDOWN:
64 case CLOCK_EVT_MODE_UNUSED:
65 case CLOCK_EVT_MODE_RESUME:
70 static int sibyte_next_event(
unsigned long delta,
struct clock_event_device *
cd)
88 struct clock_event_device *cd =
dev_id;
92 if (cd->mode == CLOCK_EVT_MODE_PERIODIC)
99 ____raw_writeq(tmode, cfg);
101 cd->event_handler(cd);
106 static DEFINE_PER_CPU(
struct clock_event_device, sibyte_hpt_clockevent);
115 struct clock_event_device *cd = &
per_cpu(sibyte_hpt_clockevent, cpu);
116 unsigned char *
name =
per_cpu(sibyte_hpt_name, cpu);
121 sprintf(name,
"sb1250-counter-%d", cpu);
123 cd->features = CLOCK_EVT_FEAT_PERIODIC |
124 CLOCK_EVT_FEAT_ONESHOT;
131 cd->set_next_event = sibyte_next_event;
132 cd->set_mode = sibyte_set_mode;
146 action->
handler = sibyte_counter_handler;