xref: /haiku/src/system/kernel/arch/arm/soc_omap3.h (revision f638102196d8255c37eb0f6727c13e42cefa8a88)
1 #ifndef ARCH_ARM_SOC_OMAP3_H
2 #define ARCH_ARM_SOC_OMAP3_H
3 
4 class OMAP3InterruptController;
5 
6 #include "soc.h"
7 
8 #include <new>
9 
10 
11 class OMAP3InterruptController : public InterruptController {
12 public:
13 	void EnableInterrupt(int irq);
14 	void DisableInterrupt(int irq);
15 	void HandleInterrupt();
16 
17 #if 0
18 	static status_t Init(fdt_module_info *fdt, fdt_device_node node, void *cookie) {
19 		InterruptController *ic = new(std::nothrow) OMAP3InterruptController(fdt, node);
20 		// XXX implement InitCheck() functionality
21 		return ic != NULL ? B_OK : B_NO_MEMORY;
22 	}
23 #endif
24 protected:
25 	//OMAP3InterruptController(fdt_module_info *fdt, fdt_device_node node);
26 
27 	void SoftReset();
28 
29 	area_id fRegArea;
30 	uint32 *fRegBase;
31 	uint32 fNumPending;
32 };
33 
34 class OMAP3Timer : public HardwareTimer {
35 public:
36 	void SetTimeout(bigtime_t timeout);
37 	bigtime_t Time();
38 	void Clear();
39 
40 #if 0
41 	static status_t Init(fdt_module_info *fdt, fdt_device_node node, void *cookie) {
42 		if (sInstance == NULL) {
43 			OMAP3Timer *timer = new(std::nothrow) OMAP3Timer(fdt, node);
44 			// XXX implement InitCheck() functionality
45 			return timer != NULL ? B_OK : B_NO_MEMORY;
46 		} else {
47 			// XXX We have multiple timers; just create the first one
48 			// and ignore the rest
49 			return B_OK;
50 		}
51 	}
52 #endif
53 
54 private:
55 	//OMAP3Timer(fdt_module_info *fdtModule, fdt_device_node node);
56 
57 	static int32 _InterruptWrapper(void *data);
58 	int32 HandleInterrupt();
59 
60 	bigtime_t fSystemTime;
61 	area_id fRegArea;
62 	uint32 *fRegBase;
63 	int fInterrupt;
64 };
65 
66 #endif /* ARCH_ARM_SOC_OMAP3_H */
67