a46a712610
In the file `COPYING` in the coreboot repository and upstream [1] just one space is used. The following command was used to convert all files. $ git grep -l 'MA 02' | xargs sed -i 's/MA 02/MA 02/' [1] http://www.gnu.org/licenses/gpl-2.0.txt Change-Id: Ic956dab2820a9e2ccb7841cab66966ba168f305f Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/2490 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
55 lines
1.6 KiB
C
55 lines
1.6 KiB
C
/*
|
|
* This file is part of the coreboot project.
|
|
*
|
|
* Copyright (C) 2009 coresystems GmbH
|
|
*
|
|
* 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; version 2 of the License.
|
|
*
|
|
* 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
|
|
*/
|
|
|
|
#include <arch/io.h>
|
|
#include <pc80/i8254.h>
|
|
#include <console/console.h>
|
|
|
|
/* Initialize i8254 timers */
|
|
|
|
void setup_i8254(void)
|
|
{
|
|
/* Timer 0 (taken from biosemu) */
|
|
outb(TIMER0_SEL|WORD_ACCESS|MODE3|BINARY_COUNT, TIMER_MODE_PORT);
|
|
outb(0x00, TIMER0_PORT);
|
|
outb(0x00, TIMER0_PORT);
|
|
|
|
/* Timer 1 */
|
|
outb(TIMER1_SEL|LOBYTE_ACCESS|MODE3|BINARY_COUNT, TIMER_MODE_PORT);
|
|
outb(0x12, TIMER1_PORT);
|
|
}
|
|
|
|
#if CONFIG_UDELAY_TIMER2
|
|
static void load_timer2(unsigned int ticks)
|
|
{
|
|
/* Set up the timer gate, turn off the speaker */
|
|
outb((inb(PPC_PORTB) & ~PPCB_SPKR) | PPCB_T2GATE, PPC_PORTB);
|
|
outb(TIMER2_SEL|WORD_ACCESS|MODE0|BINARY_COUNT, TIMER_MODE_PORT);
|
|
outb(ticks & 0xFF, TIMER2_PORT);
|
|
outb(ticks >> 8, TIMER2_PORT);
|
|
}
|
|
|
|
|
|
void udelay(int usecs)
|
|
{
|
|
load_timer2((usecs*TICKS_PER_MS)/1000);
|
|
while ((inb(PPC_PORTB) & PPCB_T2OUT) == 0)
|
|
;
|
|
}
|
|
#endif
|