From 441145f9fe89cb07bbb87cd16695eb21de818184 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 21 Nov 2007 18:25:20 +0000 Subject: [PATCH] Add comment, small style fixes (trivial). Signed-off-by: Uwe Hermann Acked-by: Uwe Hermann git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@514 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/post_code.c | 11 +++++++++-- arch/x86/speaker.c | 11 ++++++----- include/arch/x86/legacy.h | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/x86/post_code.c b/arch/x86/post_code.c index c66a0d3ba4..d824ab9dfb 100644 --- a/arch/x86/post_code.c +++ b/arch/x86/post_code.c @@ -20,9 +20,16 @@ #include #include +/** + * Output a POST code (Power-on-self-test code) on port 0x80. + * + * We're hardcoding 0x80 as port where we output the POST code, as pretty + * much all of today's computers use that one. However, in the past (pre-486 + * era or so) other ports were sometimes used, too. + * + * @param value The 8 bit value to output as POST code. + */ void post_code(u8 value) { outb(value, 0x80); } - - diff --git a/arch/x86/speaker.c b/arch/x86/speaker.c index 81b9b42b34..e048ca9006 100644 --- a/arch/x86/speaker.c +++ b/arch/x86/speaker.c @@ -47,13 +47,15 @@ */ void speaker_enable(u16 freq) { - /* Select counter 2. Read/write LSB first, then MSB. Use mode 3 - (square wave generator). Use a 16bit binary counter. */ + /* + * Select counter 2. Read/write LSB first, then MSB. Use mode 3 + * (square wave generator). Use a 16bit binary counter. + */ outb(0xb6, I82C54_CONTROL_WORD_REGISTER); /* Set the desired tone frequency. */ - outb((u8)(freq & 0x00ff), I82C54_COUNTER2); /* LSB. */ - outb((u8)(freq >> 8), I82C54_COUNTER2); /* MSB. */ + outb((u8)(freq & 0x00ff), I82C54_COUNTER2); /* LSB */ + outb((u8)(freq >> 8), I82C54_COUNTER2); /* MSB */ /* Enable the PC speaker (set bits 0 and 1). */ outb(inb(PC_SPEAKER_PORT) | 0x03, PC_SPEAKER_PORT); @@ -105,4 +107,3 @@ void beep_long(void) speaker_tone(1760, 2000); /* 1760 == note A6. */ #endif } - diff --git a/include/arch/x86/legacy.h b/include/arch/x86/legacy.h index 4bcffb619a..784bf3be27 100644 --- a/include/arch/x86/legacy.h +++ b/include/arch/x86/legacy.h @@ -28,7 +28,7 @@ * - http://en.wikipedia.org/wiki/Intel_8253 */ -#define I82C54_CONTROL_WORD_REGISTER 0x43 /* Write-only. */ +#define I82C54_CONTROL_WORD_REGISTER 0x43 /* Write-only! */ #define I82C54_COUNTER0 0x40 #define I82C54_COUNTER1 0x41 #define I82C54_COUNTER2 0x42