source: rtems/c/src/lib/libbsp/arm/realview-pbx-a9/console/console-config.c @ 3b645c1

4.115
Last change on this file since 3b645c1 was 3b645c1, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 28, 2013 at 7:26:59 PM

bsps/arm: Add PL050 support

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <info@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.com/license/LICENSE.
13 */
14
15#include <rtems/serial_mouse.h>
16
17#include <libchip/serial.h>
18
19#include <bsp.h>
20#include <bsp/irq.h>
21#include <bsp/arm-pl011.h>
22#include <bsp/arm-pl050.h>
23
24static const char psaux[] = "/dev/psaux";
25
26console_tbl Console_Configuration_Ports[] = {
27  {
28    .sDeviceName = "/dev/ttyS0",
29    .deviceType = SERIAL_CUSTOM,
30    .pDeviceFns = &arm_pl011_fns,
31    .deviceProbe = NULL,
32    .pDeviceFlow = NULL,
33    .ulMargin = 10,
34    .ulHysteresis = 0,
35    .pDeviceParams = (void *) 115200,
36    .ulCtrlPort1 = 0x10009000,
37    .ulCtrlPort2 = 0,
38    .ulDataPort = 0,
39    .getRegister = NULL,
40    .setRegister = NULL,
41    .getData = NULL,
42    .setData = NULL,
43    .ulClock = 0,
44    .ulIntVector = RVPBXA9_IRQ_UART_0
45  }, {
46    .sDeviceName = &psaux[0],
47    .deviceType = SERIAL_CUSTOM,
48    .pDeviceFns = &arm_pl050_fns,
49    .deviceProbe = NULL,
50    .pDeviceFlow = NULL,
51    .ulMargin = 10,
52    .ulHysteresis = 0,
53    .pDeviceParams = (void *) 115200,
54    .ulCtrlPort1 = 0x10007000,
55    .ulCtrlPort2 = 0,
56    .ulDataPort = 0,
57    .getRegister = NULL,
58    .setRegister = NULL,
59    .getData = NULL,
60    .setData = NULL,
61    .ulClock = 0,
62    .ulIntVector = RVPBXA9_IRQ_KMI1
63  }
64};
65
66unsigned long Console_Configuration_Count =
67  RTEMS_ARRAY_SIZE(Console_Configuration_Ports);
68
69static void output_char(char c)
70{
71  int minor = (int) Console_Port_Minor;
72  const console_tbl *ct = Console_Port_Tbl != NULL ?
73    Console_Port_Tbl[minor] : &Console_Configuration_Ports[minor];
74  const console_fns *cf = ct->pDeviceFns;
75
76  if (c == '\n') {
77    (*cf->deviceWritePolled)(minor, '\r');
78  }
79
80  (*cf->deviceWritePolled)(minor, c);
81}
82
83static void output_char_init(char c)
84{
85  if (Console_Port_Tbl == NULL) {
86    int minor = (int) Console_Port_Minor;
87    const console_fns *cf = Console_Configuration_Ports[minor].pDeviceFns;
88
89    (*cf->deviceInitialize)(minor);
90  }
91
92  BSP_output_char = output_char;
93  output_char(c);
94}
95
96BSP_output_char_function_type BSP_output_char = output_char_init;
97
98BSP_polling_getchar_function_type BSP_poll_char = NULL;
99
100bool bsp_get_serial_mouse_device(
101  const char **name,
102  const char **type
103)
104{
105  *name = &psaux[0];
106  *type = "ps2";
107
108  return true;
109}
Note: See TracBrowser for help on using the repository browser.