kernel/arch/arm/int: enable OMAP3 and PXA intc drivers
Change-Id: I83ab8cd4c474bd374f66a39d9a60c778dd7033e8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4757 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
36d65a7890
commit
b3780b5658
@@ -120,20 +120,6 @@ arch_int_init(kernel_args *args)
|
|||||||
extern "C" void arm_vector_init(void);
|
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
|
status_t
|
||||||
arch_int_init_post_vm(kernel_args *args)
|
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);
|
args->arch_args.interrupt_controller.regs2.start);
|
||||||
if (ic == NULL)
|
if (ic == NULL)
|
||||||
return B_NO_MEMORY;
|
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 {
|
} else {
|
||||||
panic("No interrupt controllers found!\n");
|
panic("No interrupt controllers found!\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include <vm/vm.h>
|
||||||
|
|
||||||
#include "soc_omap3.h"
|
#include "soc_omap3.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -92,12 +94,12 @@ OMAP3InterruptController::SoftReset()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
OMAP3InterruptController::OMAP3InterruptController(uint32_t reg_base)
|
||||||
OMAP3InterruptController::OMAP3InterruptController(fdt_module_info *fdt, fdt_device_node node)
|
: fNumPending(3)
|
||||||
: InterruptController(fdt, node),
|
|
||||||
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)
|
if (fRegArea < 0)
|
||||||
panic("OMAP3InterruptController: cannot map registers!");
|
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)
|
// Enable protection (MPU registers only available in privileged mode)
|
||||||
fRegBase[INTCPS_PROTECTION] |= 1;
|
fRegBase[INTCPS_PROTECTION] |= 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
@@ -10,20 +10,12 @@ class OMAP3InterruptController;
|
|||||||
|
|
||||||
class OMAP3InterruptController : public InterruptController {
|
class OMAP3InterruptController : public InterruptController {
|
||||||
public:
|
public:
|
||||||
|
OMAP3InterruptController(uint32_t reg_base);
|
||||||
void EnableInterrupt(int irq);
|
void EnableInterrupt(int irq);
|
||||||
void DisableInterrupt(int irq);
|
void DisableInterrupt(int irq);
|
||||||
void HandleInterrupt();
|
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:
|
protected:
|
||||||
//OMAP3InterruptController(fdt_module_info *fdt, fdt_device_node node);
|
|
||||||
|
|
||||||
void SoftReset();
|
void SoftReset();
|
||||||
|
|
||||||
area_id fRegArea;
|
area_id fRegArea;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include <vm/vm.h>
|
||||||
|
|
||||||
#include "soc_pxa.h"
|
#include "soc_pxa.h"
|
||||||
|
|
||||||
/* PXA Interrupt Controller Registers */
|
/* PXA Interrupt Controller Registers */
|
||||||
@@ -40,17 +42,18 @@ PXAInterruptController::HandleInterrupt()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
PXAInterruptController::PXAInterruptController(uint32_t reg_base)
|
||||||
PXAInterruptController::PXAInterruptController(fdt_module_info *fdt, fdt_device_node node)
|
{
|
||||||
: InterruptController(fdt, node) {
|
fRegArea = vm_map_physical_memory(B_SYSTEM_TEAM, "intc-pxa", (void**)&fRegBase,
|
||||||
fRegArea = fFDT->map_reg_range(node, 0, (void**)&fRegBase);
|
B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
||||||
|
reg_base, false);
|
||||||
if (fRegArea < 0)
|
if (fRegArea < 0)
|
||||||
panic("PXAInterruptController: cannot map registers!");
|
panic("PXAInterruptController: cannot map registers!");
|
||||||
|
|
||||||
fRegBase[PXA_ICMR] = 0;
|
fRegBase[PXA_ICMR] = 0;
|
||||||
fRegBase[PXA_ICMR2] = 0;
|
fRegBase[PXA_ICMR2] = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PXA_TIMERS_INTERRUPT 7 /* OST_4_11 */
|
#define PXA_TIMERS_INTERRUPT 7 /* OST_4_11 */
|
||||||
|
|
||||||
|
|||||||
@@ -10,21 +10,12 @@ class PXAInterruptController;
|
|||||||
|
|
||||||
class PXAInterruptController : public InterruptController {
|
class PXAInterruptController : public InterruptController {
|
||||||
public:
|
public:
|
||||||
|
PXAInterruptController(uint32_t reg_base);
|
||||||
void EnableInterrupt(int irq);
|
void EnableInterrupt(int irq);
|
||||||
void DisableInterrupt(int irq);
|
void DisableInterrupt(int irq);
|
||||||
void HandleInterrupt();
|
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:
|
protected:
|
||||||
//PXAInterruptController(fdt_module_info *fdt, fdt_device_node node);
|
|
||||||
|
|
||||||
area_id fRegArea;
|
area_id fRegArea;
|
||||||
uint32 *fRegBase;
|
uint32 *fRegBase;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user