diff --git a/src/system/kernel/arch/arm/arch_int.cpp b/src/system/kernel/arch/arm/arch_int.cpp index 146a0b9332..7dfc4583b7 100644 --- a/src/system/kernel/arch/arm/arch_int.cpp +++ b/src/system/kernel/arch/arm/arch_int.cpp @@ -120,20 +120,6 @@ arch_int_init(kernel_args *args) extern "C" void arm_vector_init(void); -#if 0 -static struct fdt_device_info intc_table[] = { - { - .compatible = "marvell,pxa-intc", - .init = PXAInterruptController::Init, - }, { - .compatible = "ti,omap3-intc", - .init = OMAP3InterruptController::Init, - } -}; -static int intc_count = sizeof(intc_table) / sizeof(struct fdt_device_info); -#endif - - status_t arch_int_init_post_vm(kernel_args *args) { @@ -178,6 +164,18 @@ arch_int_init_post_vm(kernel_args *args) args->arch_args.interrupt_controller.regs2.start); if (ic == NULL) return B_NO_MEMORY; + } else if (strncmp(args->arch_args.interrupt_controller.kind, INTC_KIND_OMAP3, + sizeof(args->arch_args.interrupt_controller.kind)) == 0) { + InterruptController *ic = new(std::nothrow) OMAP3InterruptController( + args->arch_args.interrupt_controller.regs1.start); + if (ic == NULL) + return B_NO_MEMORY; + } else if (strncmp(args->arch_args.interrupt_controller.kind, INTC_KIND_PXA, + sizeof(args->arch_args.interrupt_controller.kind)) == 0) { + InterruptController *ic = new(std::nothrow) PXAInterruptController( + args->arch_args.interrupt_controller.regs1.start); + if (ic == NULL) + return B_NO_MEMORY; } else { panic("No interrupt controllers found!\n"); } diff --git a/src/system/kernel/arch/arm/soc_omap3.cpp b/src/system/kernel/arch/arm/soc_omap3.cpp index 2bc8fbcf4b..24ad86c2a6 100644 --- a/src/system/kernel/arch/arm/soc_omap3.cpp +++ b/src/system/kernel/arch/arm/soc_omap3.cpp @@ -1,3 +1,5 @@ +#include + #include "soc_omap3.h" enum { @@ -92,12 +94,12 @@ OMAP3InterruptController::SoftReset() } -#if 0 -OMAP3InterruptController::OMAP3InterruptController(fdt_module_info *fdt, fdt_device_node node) - : InterruptController(fdt, node), - fNumPending(3) +OMAP3InterruptController::OMAP3InterruptController(uint32_t reg_base) + : fNumPending(3) { - fRegArea = fFDT->map_reg_range(node, 0, (void**)&fRegBase); + fRegArea = vm_map_physical_memory(B_SYSTEM_TEAM, "intc-omap3", (void**)&fRegBase, + B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, + reg_base, false); if (fRegArea < 0) panic("OMAP3InterruptController: cannot map registers!"); @@ -106,7 +108,6 @@ OMAP3InterruptController::OMAP3InterruptController(fdt_module_info *fdt, fdt_dev // Enable protection (MPU registers only available in privileged mode) fRegBase[INTCPS_PROTECTION] |= 1; } -#endif enum { diff --git a/src/system/kernel/arch/arm/soc_omap3.h b/src/system/kernel/arch/arm/soc_omap3.h index d698d5e5e4..14e43dafd7 100644 --- a/src/system/kernel/arch/arm/soc_omap3.h +++ b/src/system/kernel/arch/arm/soc_omap3.h @@ -10,20 +10,12 @@ class OMAP3InterruptController; class OMAP3InterruptController : public InterruptController { public: + OMAP3InterruptController(uint32_t reg_base); void EnableInterrupt(int irq); void DisableInterrupt(int irq); void HandleInterrupt(); -#if 0 - static status_t Init(fdt_module_info *fdt, fdt_device_node node, void *cookie) { - InterruptController *ic = new(std::nothrow) OMAP3InterruptController(fdt, node); - // XXX implement InitCheck() functionality - return ic != NULL ? B_OK : B_NO_MEMORY; - } -#endif protected: - //OMAP3InterruptController(fdt_module_info *fdt, fdt_device_node node); - void SoftReset(); area_id fRegArea; diff --git a/src/system/kernel/arch/arm/soc_pxa.cpp b/src/system/kernel/arch/arm/soc_pxa.cpp index 5933346def..299196fec6 100644 --- a/src/system/kernel/arch/arm/soc_pxa.cpp +++ b/src/system/kernel/arch/arm/soc_pxa.cpp @@ -1,3 +1,5 @@ +#include + #include "soc_pxa.h" /* PXA Interrupt Controller Registers */ @@ -40,17 +42,18 @@ PXAInterruptController::HandleInterrupt() } -#if 0 -PXAInterruptController::PXAInterruptController(fdt_module_info *fdt, fdt_device_node node) - : InterruptController(fdt, node) { - fRegArea = fFDT->map_reg_range(node, 0, (void**)&fRegBase); +PXAInterruptController::PXAInterruptController(uint32_t reg_base) +{ + fRegArea = vm_map_physical_memory(B_SYSTEM_TEAM, "intc-pxa", (void**)&fRegBase, + B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, + reg_base, false); if (fRegArea < 0) panic("PXAInterruptController: cannot map registers!"); fRegBase[PXA_ICMR] = 0; fRegBase[PXA_ICMR2] = 0; } -#endif + #define PXA_TIMERS_INTERRUPT 7 /* OST_4_11 */ diff --git a/src/system/kernel/arch/arm/soc_pxa.h b/src/system/kernel/arch/arm/soc_pxa.h index a676b01f6a..6226aa469f 100644 --- a/src/system/kernel/arch/arm/soc_pxa.h +++ b/src/system/kernel/arch/arm/soc_pxa.h @@ -10,21 +10,12 @@ class PXAInterruptController; class PXAInterruptController : public InterruptController { public: + PXAInterruptController(uint32_t reg_base); void EnableInterrupt(int irq); void DisableInterrupt(int irq); void HandleInterrupt(); -#if 0 - static status_t Init(fdt_module_info *fdt, fdt_device_node node, void *cookie) { - InterruptController *ic = new(std::nothrow) PXAInterruptController(fdt, node); - // XXX implement InitCheck() functionality - return ic != NULL ? B_OK : B_NO_MEMORY; - } -#endif - protected: - //PXAInterruptController(fdt_module_info *fdt, fdt_device_node node); - area_id fRegArea; uint32 *fRegBase; };