source: rtems/c/src/lib/libbsp/powerpc/shared/console/console.inl @ 3605c4e

Last change on this file since 3605c4e was 9966204, checked in by Joel Sherrill <joel.sherrill@…>, on 05/14/02 at 17:28:05

2001-05-14 Till Straumann <strauman@…>

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.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1
2/* inline routines for console i/o
3 *
4 * The purpose of this file is to provide generic inline functions,
5 * i.e. not using hardcoded base addresses. These are provided by
6 * the BSP header.
7 *
8 * $Id$
9 */
10
11#include <bsp.h>
12
13#define INL_IN_DECL(name,base) \
14static inline unsigned char name(int off) \
15{ \
16        return in_8((unsigned char*)(((unsigned long)base) + off)); \
17}
18
19#define INL_OUT_DECL(name,base) \
20static inline void name(int off, unsigned int val) \
21{ \
22        out_8((unsigned char*)(((unsigned long)base) + off), val); \
23}
24
25#ifdef BSP_UART_IOBASE_COM1
26INL_IN_DECL(com1_inb,   BSP_UART_IOBASE_COM1)
27INL_OUT_DECL(com1_outb, BSP_UART_IOBASE_COM1)
28#endif
29#ifdef BSP_UART_IOBASE_COM2
30INL_IN_DECL(com2_inb,   BSP_UART_IOBASE_COM2)
31INL_OUT_DECL(com2_outb, BSP_UART_IOBASE_COM2)
32#endif
33
34#if defined(BSP_CONSOLE_PORT)
35#if   (BSP_CONSOLE_PORT == BSP_UART_COM1) && defined(BSP_UART_IOBASE_COM1)
36#define INL_CONSOLE_INB         com1_inb
37#define INL_CONSOLE_OUTB        com1_outb
38#elif (BSP_CONSOLE_PORT == BSP_UART_COM2) && defined(BSP_UART_IOBASE_COM2)
39#define INL_CONSOLE_INB         com2_inb
40#define INL_CONSOLE_OUTB        com2_outb
41#endif
42#endif
43
44#ifdef BSP_KBD_IOBASE
45INL_IN_DECL(kbd_inb,    BSP_KBD_IOBASE)
46INL_OUT_DECL(kbd_outb,  BSP_KBD_IOBASE)
47#endif
48
49#ifdef BSP_VGA_IOBASE
50INL_OUT_DECL(vga_outb,  BSP_VGA_IOBASE)
51#endif
Note: See TracBrowser for help on using the repository browser.