summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/console/inch.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-05-14 17:10:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-05-14 17:10:17 +0000
commit69ed59f083a083fd96d08b5f6d54f2c80f267f03 (patch)
tree3d8fcd08bcface88cea636117b47dd1520b2874c /c/src/lib/libbsp/powerpc/shared/console/inch.c
parent2001-05-14 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-69ed59f083a083fd96d08b5f6d54f2c80f267f03.tar.bz2
2001-05-14 Till Straumann <strauman@slac.stanford.edu>
* bootloader/misc.c, console/Makefile.am, console/console.c, console/consoleIo.h, console/inch.c, console/polled_io.c, console/uart.c, console/uart.h, include/bsp.h, irq/Makefile.am, irq/irq.c, irq/irq.h, irq/irq_init.c, openpic/openpic.c, openpic/openpic.h, pci/Makefile.am, pci/pci.c, pci/pci.h, residual/Makefile.am, start/start.S, startup/bspstart.c, vectors/vectors.S, vectors/vectors.h, vectors/vectors_init.c: Per PR216, "libbsp/powerpc/shared" BSP has been modified considerably with the goal to make it more flexible and reusable by other BSPs. The main strategies were: - eliminate hardcoded base addresses; devices use offsets and a BSP defined base address. - separate functionality into different files (e.g. reboot from inch.c to reboot.c) which can be overridden by a 'derived' BSP. - separate initialization code into separate files (e.g. PCI bridge detection/initialization was separated from the more generic PCI access routines), also to make it easier for 'derived' BSPs to substitute their own initialization code. There are also a couple of enhancements and fixes: - IRQ handling code now has a hook for attaching a VME bridge. - OpenPIC is now explicitely initialized (polarities, senses). Eliminated the implicit assumption on the presence of an ISA PIC. - UART and console driver now supports more than 1 port. The current maximum of 2 can easily be extended by enlarging a table (it would even be easier if the ISR API was not broken by design). - fixed polled_io.c so it correctly supports console on COM2 - fixed TLB invalidation code (start.S). - exception handler prints a stack backtrace. - added BSP_pciFindDevice() to scan the pci bus for a particular vendor/device/instance.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/console/inch.c')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/console/inch.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/console/inch.c b/c/src/lib/libbsp/powerpc/shared/console/inch.c
index 5cd7148e97..eaa6224529 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/inch.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/inch.c
@@ -22,12 +22,14 @@
#include <bsp.h>
#include <bsp/irq.h>
+#include "console.inl"
+
/*-------------------------------------------------------------------------+
| Constants
+--------------------------------------------------------------------------*/
-#define KBD_CTL 0x61 /* -------------------------------- */
-#define KBD_DATA 0x60 /* Ports for PC keyboard controller */
-#define KBD_STATUS 0x64 /* -------------------------------- */
+#define KBD_CTL 0x1 /* -------------------------------- */
+#define KBD_DATA 0x0 /* Port offsets for PC keyboard controller */
+#define KBD_STATUS 0x4 /* -------------------------------- */
#define KBD_BUF_SIZE 256
@@ -62,19 +64,6 @@ static rtems_unsigned16 kbd_last = 0;
static rtems_unsigned16 kbd_end = KBD_BUF_SIZE - 1;
/*-------------------------------------------------------------------------+
-| Function: rtemsReboot
-| Description: Reboot the PC.
-| Global Variables: None.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-void rtemsReboot(void)
-{
- /* shutdown and reboot */
- outport_byte(0x64, 0xFE); /* use keyboard controler to do the job... */
-} /* rtemsReboot */
-
-/*-------------------------------------------------------------------------+
| Function: _IBMPC_scankey
| Description: This function can be called during a poll for input, or by
| an ISR. Basically any time you want to process a keypress.
@@ -97,18 +86,18 @@ _IBMPC_scankey(char *outChar)
*outChar = NULL; /* default value if we return FALSE */
/* Read keyboard controller, toggle enable */
- inport_byte(KBD_CTL, inChar);
- outport_byte(KBD_CTL, inChar & ~0x80);
- outport_byte(KBD_CTL, inChar | 0x80);
- outport_byte(KBD_CTL, inChar & ~0x80);
+ inChar=kbd_inb(KBD_CTL);
+ kbd_outb(KBD_CTL, inChar & ~0x80);
+ kbd_outb(KBD_CTL, inChar | 0x80);
+ kbd_outb(KBD_CTL, inChar & ~0x80);
/* See if it has data */
- inport_byte(KBD_STATUS, inChar);
+ inChar=kbd_inb(KBD_STATUS);
if ((inChar & 0x01) == 0)
return FALSE;
/* Read the data. Handle nonsense with shift, control, etc. */
- inport_byte(KBD_DATA, inChar);
+ inChar=kbd_inb(KBD_DATA);
if (extended)
extended--;