Add comment, small style fixes (trivial).

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@514 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Uwe Hermann 2007-11-21 18:25:20 +00:00
parent e28f0155f6
commit 441145f9fe
3 changed files with 16 additions and 8 deletions

View file

@ -20,9 +20,16 @@
#include <types.h> #include <types.h>
#include <io.h> #include <io.h>
/**
* 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) void post_code(u8 value)
{ {
outb(value, 0x80); outb(value, 0x80);
} }

View file

@ -47,13 +47,15 @@
*/ */
void speaker_enable(u16 freq) 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); outb(0xb6, I82C54_CONTROL_WORD_REGISTER);
/* Set the desired tone frequency. */ /* Set the desired tone frequency. */
outb((u8)(freq & 0x00ff), I82C54_COUNTER2); /* LSB. */ outb((u8)(freq & 0x00ff), I82C54_COUNTER2); /* LSB */
outb((u8)(freq >> 8), I82C54_COUNTER2); /* MSB. */ outb((u8)(freq >> 8), I82C54_COUNTER2); /* MSB */
/* Enable the PC speaker (set bits 0 and 1). */ /* Enable the PC speaker (set bits 0 and 1). */
outb(inb(PC_SPEAKER_PORT) | 0x03, PC_SPEAKER_PORT); outb(inb(PC_SPEAKER_PORT) | 0x03, PC_SPEAKER_PORT);
@ -105,4 +107,3 @@ void beep_long(void)
speaker_tone(1760, 2000); /* 1760 == note A6. */ speaker_tone(1760, 2000); /* 1760 == note A6. */
#endif #endif
} }

View file

@ -28,7 +28,7 @@
* - http://en.wikipedia.org/wiki/Intel_8253 * - 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_COUNTER0 0x40
#define I82C54_COUNTER1 0x41 #define I82C54_COUNTER1 0x41
#define I82C54_COUNTER2 0x42 #define I82C54_COUNTER2 0x42