2 Basic serial IO abstaction for GDB
4 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
6 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 (
27 IN EFI_HANDLE ImageHandle
,
28 IN EFI_SYSTEM_TABLE
*SystemTable
31 return RETURN_SUCCESS
;
43 return RETURN_SUCCESS
;
52 UINT32 LSR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_LSR_REG
;
54 if ((MmioRead8(LSR
) & UART_LSR_RX_FIFO_E_MASK
) == UART_LSR_RX_FIFO_E_NOT_EMPTY
) {
67 UINT32 LSR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_LSR_REG
;
68 UINT32 RBR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_RBR_REG
;
71 while ((MmioRead8(LSR
) & UART_LSR_RX_FIFO_E_MASK
) == UART_LSR_RX_FIFO_E_EMPTY
);
72 Char
= MmioRead8(RBR
);
83 UINT32 LSR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_LSR_REG
;
84 UINT32 THR
= UartBase(PcdGet32(PcdOmap35xxConsoleUart
)) + UART_THR_REG
;
86 while ((MmioRead8(LSR
) & UART_LSR_TX_FIFO_E_MASK
) == UART_LSR_TX_FIFO_E_NOT_EMPTY
);
87 MmioWrite8(THR
, Char
);
95 while (*String
!= '\0') {