Modules/PS2KbMouse - Adding pl050 support
[tpg/acess2.git] / Modules / Input / PS2KbMouse / main.c
index e3ea35c..7a2b83d 100644 (file)
@@ -8,6 +8,22 @@
 #include "common.h"
 
 // === IMPORTS ===
+// TODO: Allow runtime/compile-time switching
+//       Maybe PCI will have it?
+// Integrator-CP
+#if 0
+#define KEYBOARD_IRQ   3
+#define KEYBOARD_BASE  0x18000000
+#define MOUSE_IRQ      4
+#define MOUSE_BASE     0x19000000
+#endif
+// Realview
+#if 1
+#define KEYBOARD_IRQ   20
+#define KEYBOARD_BASE  0x10006000
+#define MOUSE_IRQ      21
+#define MOUSE_BASE     0x10007000
+#endif
 
 // === PROTOTYPES ===
  int   PS2_Install(char **Arguments);
@@ -20,6 +36,13 @@ MODULE_DEFINE(0, 0x0100, PS2Mouse, PS2Mouse_Install, NULL, NULL);
 // === CODE ===
 int PS2_Install(char **Arguments)
 {
+       #if ARCH_is_x86 || ARCH_is_x86_64
        KBC8042_Init();
+       gpMouse_EnableFcn = KBC8042_EnableMouse;
+       #elif ARCH_is_armv7
+       PL050_Init(KEYBOARD_IRQ, KEYBOARD_IRQ, MOUSE_BASE, MOUSE_IRQ);
+       gpMouse_EnableFcn = PL050_EnableMouse;
+       #endif
+
        return MODULE_ERR_OK;
 }

UCC git Repository :: git.ucc.asn.au