PL050 PS/2 Controller

From OSDev Wiki
Jump to: navigation, search

This article is a stub! This page or section is a stub. You can help the wiki by accurately contributing to it.

Another example is the ARM Integrator/CP board which implements the PS/2 interface encapsulated in the PL050 (where the PL050 is analogous to the I8042) except you communicate with the PL050 differently than the I8042. But, after the PL050 is configured you then proceed with the PS/2 mouse protocol. For example:

             KMI/PL050 bases under Integrator/CP compatible board.
        #define KMI_KB_BASE	            0x18000000	// keyboard
        #define KMI_MS_BASE	            0x19000000	// mouse
	typedef struct _KMI_MMIO
		uint32		cr;		// control register (rw)
		uint32		stat;		// status register (r)
		uint32		data;		// data register (rw)
		uint32		ir;		// interupt control register (r)

	KMI_MMIO	volatile *mmio;
	uint32       tmp;
	mmio->cr = 0x4;
	/* talk to the PS2 controller and enable it */
	mmio->data = 0xF4;
	/* keyboard sends back ACK */
	tmp = mmio->data;

The above uses memory mapped input/output (MMIO), but other architectures may use I/O ports instead or a combination of I/O ports and MMIO for example the X84/64. So understanding your platform is very important to understand how to proceed in talking to the devices.

Above, the PL050 is also called the KMI (Keyboard And Mouse Interface). So first we have to configure the PL050 by enabling it. Now, it provides a interface to the PS2 interface which then interfaces with the mouse. So, the next thing I have to do is write the value 0xF4 which you can find in the table above to enable the mouse.

See Also

External Links

Personal tools