/** @file\r
Debug Port Library implementation based on usb debug port.\r
\r
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
//\r
// If the owner and in_use bit is not set, it means system is doing cold/warm boot or EHCI host controller is reset by system software.\r
//\r
- UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)(UINTN)(Handle->UsbDebugPortMemoryBase + Handle->DebugPortOffset);\r
+ UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)((UINTN)Handle->UsbDebugPortMemoryBase + Handle->DebugPortOffset);\r
if ((MmioRead32((UINTN)&UsbDebugPortRegister->ControlStatus) & (USB_DEBUG_PORT_OWNER | USB_DEBUG_PORT_ENABLE | USB_DEBUG_PORT_IN_USE))\r
!= (USB_DEBUG_PORT_OWNER | USB_DEBUG_PORT_ENABLE | USB_DEBUG_PORT_IN_USE)) {\r
Status = TRUE;\r
UINT8 DebugPortNumber;\r
UINT8 Length;\r
\r
- UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)(UINTN)(Handle->UsbDebugPortMemoryBase + Handle->DebugPortOffset);\r
- UsbHCSParam = (UINT32 *)(UINTN)(Handle->EhciMemoryBase + 0x04);\r
- UsbCmd = (UINT32 *)(UINTN)(Handle->EhciMemoryBase + 0x20);\r
- UsbStatus = (UINT32 *)(UINTN)(Handle->EhciMemoryBase + 0x24);\r
+ UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)((UINTN)Handle->UsbDebugPortMemoryBase + Handle->DebugPortOffset);\r
+ UsbHCSParam = (UINT32 *)((UINTN)Handle->EhciMemoryBase + 0x04);\r
+ UsbCmd = (UINT32 *)((UINTN)Handle->EhciMemoryBase + 0x20);\r
+ UsbStatus = (UINT32 *)((UINTN)Handle->EhciMemoryBase + 0x24);\r
\r
//\r
// Check if the debug port is enabled and owned by myself.\r
//\r
// Should find a device is connected at debug port\r
//\r
- PortStatus = (UINT32 *)(UINTN)(Handle->EhciMemoryBase + 0x64 + (DebugPortNumber - 1) * 4);\r
+ PortStatus = (UINT32 *)((UINTN)Handle->EhciMemoryBase + 0x64 + (DebugPortNumber - 1) * 4);\r
if (!(MmioRead32((UINTN)PortStatus) & BIT0)) {\r
Handle->Initialized = USBDBG_NO_DEV;\r
return RETURN_NOT_FOUND;\r
}\r
}\r
\r
- UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)(UINTN)(UsbDebugPortHandle->UsbDebugPortMemoryBase + UsbDebugPortHandle->DebugPortOffset);\r
+ UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)((UINTN)UsbDebugPortHandle->UsbDebugPortMemoryBase + UsbDebugPortHandle->DebugPortOffset);\r
\r
while ((Total < NumberOfBytes)) {\r
if (NumberOfBytes - Total > USB_DEBUG_PORT_MAX_PACKET_SIZE) {\r
return TRUE;\r
}\r
\r
- UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)(UINTN)(UsbDebugPortHandle->UsbDebugPortMemoryBase + UsbDebugPortHandle->DebugPortOffset);\r
+ UsbDebugPortRegister = (USB_DEBUG_PORT_REGISTER *)((UINTN)UsbDebugPortHandle->UsbDebugPortMemoryBase + UsbDebugPortHandle->DebugPortOffset);\r
\r
UsbDebugPortRegister->TokenPid = INPUT_PID;\r
if (UsbDebugPortHandle->BulkInToggle == 0) {\r