From 90311ae923051afa0db6554679e7389d1c95e4f2 Mon Sep 17 00:00:00 2001
From: John Hodge <tpg@mutabah.net>
Date: Sat, 8 Oct 2011 18:49:33 +0800
Subject: [PATCH] Modules/PS2KbMouse - Fixing PL050 bugs

---
 Modules/Input/PS2KbMouse/main.c  | 2 +-
 Modules/Input/PS2KbMouse/pl050.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Modules/Input/PS2KbMouse/main.c b/Modules/Input/PS2KbMouse/main.c
index 08dfb003..c5ad4e8b 100644
--- a/Modules/Input/PS2KbMouse/main.c
+++ b/Modules/Input/PS2KbMouse/main.c
@@ -40,7 +40,7 @@ int PS2_Install(char **Arguments)
 	KBC8042_Init();
 	gpMouse_EnableFcn = KBC8042_EnableMouse;
 	#elif ARCHDIR_is_armv7
-	PL050_Init(KEYBOARD_IRQ, KEYBOARD_IRQ, MOUSE_BASE, MOUSE_IRQ);
+	PL050_Init(KEYBOARD_BASE, KEYBOARD_IRQ, MOUSE_BASE, MOUSE_IRQ);
 	gpMouse_EnableFcn = PL050_EnableMouse;
 	#endif
 
diff --git a/Modules/Input/PS2KbMouse/pl050.c b/Modules/Input/PS2KbMouse/pl050.c
index 8d65e3a3..6f82e510 100644
--- a/Modules/Input/PS2KbMouse/pl050.c
+++ b/Modules/Input/PS2KbMouse/pl050.c
@@ -4,6 +4,8 @@
  *
  * PL050 (or comaptible) Driver
  */
+#define DEBUG	1
+
 #include <acess.h>
 #include "common.h"
 
@@ -28,12 +30,18 @@ Uint32	*gpPL050_MouseBase;
 void PL050_Init(Uint32 KeyboardBase, Uint8 KeyboardIRQ, Uint32 MouseBase, Uint8 MouseIRQ)
 {
 	if( KeyboardBase ) {
+		LOG("KeyboardBase = 0x%x", KeyboardBase);
 		gpPL050_KeyboardBase = (void*)MM_MapHWPages(KeyboardBase, 1);
+		LOG("gpPL050_KeyboardBase = %p", gpPL050_KeyboardBase);
 		IRQ_AddHandler(KeyboardIRQ, PL050_KeyboardHandler, NULL);
+
+		gpPL050_KeyboardBase[0] = 0x10;
 	}
 	if( MouseBase ) {
 		gpPL050_MouseBase = (void*)MM_MapHWPages(MouseBase, 1);
 		IRQ_AddHandler(MouseIRQ, PL050_MouseHandler, NULL);
+
+		gpPL050_MouseBase[0] = 0x10;
 	}
 }
 
@@ -64,6 +72,7 @@ void PL050_EnableMouse(void)
 	//PL050_WriteMouseData(0xF6);	// Set Default Settings
 	PL050_WriteMouseData(0xD4);
 	PL050_WriteMouseData(0xF4);	// Enable Packets
+	LOG("Done");
 }
 
 static inline void PL050_WriteMouseData(Uint8 Data)
-- 
GitLab