2 Basic serial IO abstaction for GDB
4 Copyright (c) 2008-2009, Apple Inc. All rights reserved.
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/GdbSerialLib.h>
18 #include <Library/PcdLib.h>
19 #include <Library/IoLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/OmapLib.h>
22 #include <Omap3530/Omap3530.h>
26 GdbSerialLibConstructor (
30 return RETURN_SUCCESS
;
42 return RETURN_SUCCESS
;
51 UINT32 LSR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_LSR_REG
;
53 if ((MmioRead8(LSR
) & UART_LSR_RX_FIFO_E_MASK
) == UART_LSR_RX_FIFO_E_NOT_EMPTY
) {
66 UINT32 LSR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_LSR_REG
;
67 UINT32 RBR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_RBR_REG
;
70 while ((MmioRead8(LSR
) & UART_LSR_RX_FIFO_E_MASK
) == UART_LSR_RX_FIFO_E_EMPTY
);
71 Char
= MmioRead8(RBR
);
82 UINT32 LSR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_LSR_REG
;
83 UINT32 THR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_THR_REG
;
85 while ((MmioRead8(LSR
) & UART_LSR_TX_FIFO_E_MASK
) == UART_LSR_TX_FIFO_E_NOT_EMPTY
);
86 MmioWrite8(THR
, Char
);
94 while (*String
!= '\0') {