mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
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:
parent
e28f0155f6
commit
441145f9fe
3 changed files with 16 additions and 8 deletions
|
@ -20,9 +20,16 @@
|
|||
#include <types.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)
|
||||
{
|
||||
outb(value, 0x80);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue