ae51f81c8f736976b5d7270facb0131897737854
[tpg/acess2.git] / KernelLand / Modules / Input / PS2KbMouse / main.c
1 /*
2  * Acess2
3  *
4  * PS/2 Keboard / Mouse Driver
5  */
6 #include <acess.h>
7 #include <modules.h>
8 #include "common.h"
9
10 // === IMPORTS ===
11 // TODO: Allow runtime/compile-time switching
12 //       Maybe PCI will have it?
13 // Integrator-CP
14 #if 0
15 #define KEYBOARD_IRQ    3
16 #define KEYBOARD_BASE   0x18000000
17 #define MOUSE_IRQ       4
18 #define MOUSE_BASE      0x19000000
19 #endif
20 // Realview
21 #if 1
22 #define KEYBOARD_IRQ    20
23 #define KEYBOARD_BASE   0x10006000
24 #define MOUSE_IRQ       21
25 #define MOUSE_BASE      0x10007000
26 #endif
27
28 // === PROTOTYPES ===
29  int    PS2_Install(char **Arguments);
30
31 // === GLOBALS ===
32 MODULE_DEFINE(0, 0x0100, Input_PS2KbMouse, PS2_Install, NULL, NULL);    // Shuts the makefile up
33 MODULE_DEFINE(0, 0x0100, PS2Keyboard, KB_Install, NULL, "Input_PS2KbMouse", "Keyboard", NULL);
34 MODULE_DEFINE(0, 0x0100, PS2Mouse, PS2Mouse_Install, NULL, "Input_PS2KbMouse", NULL);
35
36 // === CODE ===
37 int PS2_Install(char **Arguments)
38 {
39         #if ARCHDIR_is_x86 || ARCHDIR_is_x86_64
40         KBC8042_Init();
41         gpMouse_EnableFcn = KBC8042_EnableMouse;
42         #elif ARCHDIR_is_armv7
43         PL050_Init(KEYBOARD_BASE, KEYBOARD_IRQ, MOUSE_BASE, MOUSE_IRQ);
44         gpMouse_EnableFcn = PL050_EnableMouse;
45         #endif
46
47         return MODULE_ERR_OK;
48 }

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