1
0

Add devices directory, and PL011 and PL110 basic (very!) device drivers

This commit is contained in:
2012-09-07 23:51:04 -04:00
parent 4be5ceeec6
commit 84dd295956
6 changed files with 82 additions and 0 deletions

13
devices/pl011.c Normal file
View File

@ -0,0 +1,13 @@
#define PL011_SERIAL_BASE 0x16000000
#define PL011_SERIAL_FLAG_REGISTER 0x18
#define PL011_SERIAL_BUFFER_FULL (1 << 5)
void pl011_putc(char c)
{
/* Wait until the serial buffer is empty */
while (*(volatile unsigned long*)(PL011_SERIAL_BASE + PL011_SERIAL_FLAG_REGISTER)
& (PL011_SERIAL_BUFFER_FULL));
/* When it's empty, put our character at the base */
*(volatile unsigned long*)PL011_SERIAL_BASE = c;
}