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 static status_t Init(fdt_module_info *fdt, fdt_device_node node, void *cookie) { 18 InterruptController *ic = new(std::nothrow) OMAP3InterruptController(fdt, node); 19 // XXX implement InitCheck() functionality 20 return ic != NULL ? B_OK : B_NO_MEMORY; 21 } 22 protected: 23 OMAP3InterruptController(fdt_module_info *fdt, fdt_device_node node); 24 25 void SoftReset(); 26 27 area_id fRegArea; 28 uint32 *fRegBase; 29 uint32 fNumPending; 30 }; 31 32 class OMAP3Timer : public HardwareTimer { 33 public: 34 void SetTimeout(bigtime_t timeout); 35 bigtime_t Time(); 36 void Clear(); 37 38 static status_t Init(fdt_module_info *fdt, fdt_device_node node, void *cookie) { 39 if (sInstance == NULL) { 40 OMAP3Timer *timer = new(std::nothrow) OMAP3Timer(fdt, node); 41 // XXX implement InitCheck() functionality 42 return timer != NULL ? B_OK : B_NO_MEMORY; 43 } else { 44 // XXX We have multiple timers; just create the first one 45 // and ignore the rest 46 return B_OK; 47 } 48 } 49 50 private: 51 OMAP3Timer(fdt_module_info *fdtModule, fdt_device_node node); 52 53 static int32 _InterruptWrapper(void *data); 54 int32 HandleInterrupt(); 55 56 bigtime_t fSystemTime; 57 area_id fRegArea; 58 uint32 *fRegBase; 59 int fInterrupt; 60 }; 61 62 #endif /* ARCH_ARM_SOC_OMAP3_H */ 63