Author: mjones Date: 2007-07-05 18:58:10 +0200 (Thu, 05 Jul 2007) New Revision: 433
Added: LinuxBIOSv3/include/arch/x86/legacy.h Modified: LinuxBIOSv3/arch/x86/geodelx/geodelx.c LinuxBIOSv3/arch/x86/speaker.c Log: Moved some generic 8254 PIT #defines out of the speaker code to legacy.h. Use legacy.h PIT defines in Geode code.
Signed-off-by: Marc Jones marc.jones@amd.com Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: LinuxBIOSv3/arch/x86/geodelx/geodelx.c =================================================================== --- LinuxBIOSv3/arch/x86/geodelx/geodelx.c 2007-07-03 20:33:33 UTC (rev 432) +++ LinuxBIOSv3/arch/x86/geodelx/geodelx.c 2007-07-05 16:58:10 UTC (rev 433) @@ -30,6 +30,7 @@ #include <io.h> #include <amd_geodelx.h> #include <spd.h> +#include <legacy.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); }
/**
Modified: LinuxBIOSv3/arch/x86/speaker.c =================================================================== --- LinuxBIOSv3/arch/x86/speaker.c 2007-07-03 20:33:33 UTC (rev 432) +++ LinuxBIOSv3/arch/x86/speaker.c 2007-07-05 16:58:10 UTC (rev 433) @@ -27,13 +27,8 @@
#include <io.h> #include <lib.h> +#include <legacy.h>
-#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
/**
Added: LinuxBIOSv3/include/arch/x86/legacy.h =================================================================== --- LinuxBIOSv3/include/arch/x86/legacy.h (rev 0) +++ LinuxBIOSv3/include/arch/x86/legacy.h 2007-07-05 16:58:10 UTC (rev 433) @@ -0,0 +1,34 @@ +/* + * This file is part of the LinuxBIOS project. + * + * Copyright (C) 2007 Uwe Hermann uwe@hermann-uwe.de + * + * 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