Moved some generic 8254 PIT #defines out of the speaker code to a seperate .h. Signed-off-by: Marc Jones Index: LinuxBIOSv3/arch/x86/geodelx/geodelx.c =================================================================== --- LinuxBIOSv3.orig/arch/x86/geodelx/geodelx.c 2007-07-02 10:23:52.000000000 -0600 +++ LinuxBIOSv3/arch/x86/geodelx/geodelx.c 2007-07-03 09:37:11.000000000 -0600 @@ -30,6 +30,7 @@ #include #include #include +#include <8254_pit.h> /* all these functions used to be in a lot of fiddly little files. To * make it easier to find functions, we are merging them here. This @@ -41,8 +42,6 @@ /** * Starts Timer 1 for port 61 use. - * 0x43 is PIT command/control. - * 0x41 is PIT counter 1. * * The command 0x56 means write counter 1 lower 8 bits in next IO, * set the counter mode to square wave generator (count down to 0 @@ -58,8 +57,8 @@ */ void start_timer1(void) { - outb(0x56, 0x43); - outb(0x12, 0x41); + outb(0x56, I82C54_CONTROL_WORD_REGISTER); + outb(0x12, I82C54_COUNTER1); } /** Index: LinuxBIOSv3/arch/x86/speaker.c =================================================================== --- LinuxBIOSv3.orig/arch/x86/speaker.c 2007-07-02 10:23:37.000000000 -0600 +++ LinuxBIOSv3/arch/x86/speaker.c 2007-07-03 09:34:08.000000000 -0600 @@ -2,6 +2,7 @@ * This file is part of the LinuxBIOS project. * * Copyright (C) 2007 Uwe Hermann + * Copyright (C) 2007 Advanced Micro Devices, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,23 +19,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* - * Datasheet: - * - Name: 82C54 CHMOS Programmable Interval Timer - * - PDF: http://www.intel.com/design/archives/periphrl/docs/23124406.pdf - * - Order number: 231244-006 - */ - #include #include - -#define I82C54_CONTROL_WORD_REGISTER 0x43 /* Write-only. */ - -#define I82C54_COUNTER0 0x40 -#define I82C54_COUNTER1 0x41 -#define I82C54_COUNTER2 0x42 - -#define PC_SPEAKER_PORT 0x61 +#include <8254_pit.h> /** * Use the PC speaker to create a tone/sound of the specified frequency. Index: LinuxBIOSv3/include/arch/x86/8254_pit.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ LinuxBIOSv3/include/arch/x86/8254_pit.h 2007-07-03 09:34:04.000000000 -0600 @@ -0,0 +1,36 @@ +/* + * This file is part of the LinuxBIOS project. + * + * Copyright (C) 2007 Uwe Hermann + * Copyright (C) 2007 Advanced Micro Devices, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * Datasheet: + * - Name: 82C54 CHMOS Programmable Interval Timer + * - PDF: http://www.intel.com/design/archives/periphrl/docs/23124406.pdf + * - Order number: 231244-006 + * + * See also: + * - http://en.wikipedia.org/wiki/Intel_8253 + */ + +#define I82C54_CONTROL_WORD_REGISTER 0x43 /* Write-only. */ +#define I82C54_COUNTER0 0x40 +#define I82C54_COUNTER1 0x41 +#define I82C54_COUNTER2 0x42 +#define PC_SPEAKER_PORT 0x61