The ProcessOptionRomLight() assumes that OpRom has already been
processed in the previous full enumeration and updates
AllOpRomProcessed flag to TRUE by default. However, this may not
be applicable with other pre-stage boot firmwares.
This will update AllOpRomProcessed flag properly by checking
PciRomGetImageMapping().
Signed-off-by: Aiden Park <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
https://bugzilla.tianocore.org/show_bug.cgi?id=3114
Add logic to flush all UART transmit buffers if there is a
config change from Reset(), SetAttributes() or SetControl().
Use a timeout in the flush operation, so the system can
continue to boot if the transmit buffers can not be
flushed for any reason.
This change prevents lost characters on serial debug logs
and serial consoles when a config change is made. It also
prevents a UART from getting into a bad state or reporting
error status due to characters being transmitted at the same
time registers are updated with new communications settings.
Cc: Hao A Wu <[email protected]>
Cc: Ray Ni <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
This simplify ATA driver debugging all ATA packets will be printed to
debug port on DEBUG_VERBOSE level along with the packet execution
status. Additionally failed packets and the failed packet execution
status will be printed on DEBUG_ERROR level.
Signed-off-by: Mateusz Albecki <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Hao A Wu <[email protected]>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3026
This commit adds code to restart the ATA packets that failed due to the
CRC error or other link condition. For sync transfers the code will try
to get the command working for up to 5 times. For async transfers, the
command will be retried until the timeout value timeout specified by the
requester is reached. For sync case the count of 5 retries has been
chosen arbitrarily and if needed can be increased or decreased.
Signed-off-by: Mateusz Albecki <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Hao A Wu <[email protected]>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3024
AHCI driver used to poll D2H register type to determine whether the FIS
has been received. This caused a problem of long timeouts when the link
got a CRC error and the FIS never arrives. To fix this this change
switches AHCI driver to poll the IS register which will signal both the
reception of FIS and the occurrence of error.
Signed-off-by: Mateusz Albecki <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Hao A Wu <[email protected]>
With some super-speed USB mass storage devices it has been observed
that a USB transaction error may occur when attempting the set the
device address during enumeration.
According the the xHCI specification (section 4.6.5) ...
"A USB Transaction ErrorCompletion Code for an Address Device Command
may be due to a Stall response from a device. Software should issue a
Disable Slot Commandfor the Device Slot then an Enable Slot Command
to recover from this error."
To fix this, retry the device slot initialization if it fails due to a
device error.
Change was verified using a superspeed mass storage device that was
occasionally failing to enumerate in UEFI. With this change this failure
to enumerate was resolved. This failure was also only seen in UEFI and not
in the OS.
Signed-off-by: Jon Hunter <[email protected]>
Signed-off-by: Jeff Brasen <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3007
Currently UsbDevContext is not cleaned up if USB slot initialization is
failed, the wrong context data will affect next USB devices and
the USB devices can not be enumerated.
Need to disable slot if USB slot initialization is failed.
Below test cases are passed on UpXtreme:
a. USB 3.0 thumb drives can be recognized in UEFI shell
b. SUT can boot to Puppylinux from USB3.0 mass storage,
the storage can be recognized in linux
c. Plug in a USB keyboard (hot plug) and enumeration is OK
in UEFI shell and linux
d. Plug in a USB mouse(hot plug) and enumeration is OK in linux.
Cc: Ray Ni <[email protected]>
Cc: Hao A Wu <[email protected]>
Signed-off-by: Heng Luo <[email protected]>
Tested-by: Jon Hunter <[email protected]>
Reviewed-by: Jon Hunter <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2948
Timeouts in the XhciDxe driver are taking longer than
expected due to the timeout loops not accounting for
code execution time. As en example, 5 second timeouts
have been observed to take around 36 seconds to complete.
Use SetTimer and Create/CheckEvent from Boot Services to
determine when timeout occurred.
Cc: Jian J Wang <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Ray Ni <[email protected]>
Signed-off-by: Patrick Henz <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Add check for NULL HostAddress in AllocateBuffer as required by UEFI
specification.
Signed-off-by: Jeff Brasen <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
NonDiscoverablePciDeviceDxe currently #defines the module-internal
PCI_MAX_BARS macro, with value 6 (and type "int").
Remove this private macro definition, and adopt PCI_MAX_BAR from
"MdePkg/Include/IndustryStandard/Pci22.h". Both the value and the type
remain unchanged (the standard PCI_MAX_BAR macro expands to 0x0006).
"NonDiscoverablePciDeviceIo.h" gets the definition of PCI_MAX_BAR via its
existent #include <IndustryStandard/Pci.h> directive.
Build-tested only.
Cc: Ard Biesheuvel <[email protected]>
Cc: Hao A Wu <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: Ray Ni <[email protected]>
Signed-off-by: Laszlo Ersek <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
ASSERT in PollMem_Conf, CopyMem_Conf, SetBarAttributes_Conf
Conformance Test.
SCT Test expect return as Invalid Parameter or Unsupported.
Added Checks for Function Parameters.
return Invalid or Unsupported if Check fails.
Added Checks in PciIoPollIo(), PciIoIoRead()
PciIoIoWrite()
Signed-off-by: Gaurav Jain <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Driver code used to map memory for DMA transfer even if host doesn't
support DMA. This is causing memory corruption when driver transfers
data using PIO. This change refactors the code to skip call to
PciIo->Map for non DMA transfers.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Tested-by: Hao A Wu <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
SdMmcPciHcDxe driver used to read response only after
command and data transfer completed. According to SDHCI
specification response data is ready after the command
complete status is set by the host controller. Getting
the response data early will help debugging the cases
when command completed but data transfer timed out.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Tested-by: Hao A Wu <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
To allow for easier debug of failing commands we
have added a capability to print TRB and command
packet when we start execution of the TRB(on
DEBUG_VERBOSE level) and when the TRB failed to
execute correctly(on DEBUG_ERROR level). Additionally
we will also print error interrupt status and interrupt
status register on failed SD command.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Tested-by: Hao A Wu <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1989
The commit will avoid unmapping the same resource in error handling logic
for function BuildAdmaDescTable() and SdMmcCreateTrb().
For the error handling in BuildAdmaDescTable():
The error is directly related with the corresponding Map() operation
(mapped address beyond 4G, which is not supported in ADMA), so the Unmap()
operation is done in the error handling logic, and then setting
'Trb->AdmaMap' to NULL to avoid double Unmap.
For the error handling in SdMmcCreateTrb():
The error is not directly related with the corresponding Map() operation,
so the commit will update the code to left SdMmcFreeTrb() for the Unmap
operation to avoid double Unmap.
Cc: Jian J Wang <[email protected]>
Cc: Ray Ni <[email protected]>
Signed-off-by: Hao A Wu <[email protected]>
Reviewed-by: Jian J Wang <[email protected]>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1140
To increase the resiliency driver will now attempt to
retry the commands that failed due to the CRC error up
to 5 times. This should address the problems with the commands
that fail due to random condition on links. This should also
help the boards on which CMD13 is particularly unstable after
switching the link frequency.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1140
Error detection function will now check if the command
failure has been caused by one of the errors that can
appear randomly on link(CRC error + end bit error). If
such an error has been a cause of failure, function will
return EFI_CRC_ERROR instead of EFI_DEVICE_ERROR to indicate
to the higher level that command has a chance of succeeding if
resent.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Driver used to reset the DAT lane on a current error which
is not required according to SD specification(it's not going
to help). This patch will reset the DAT lane only on DAT
lane specific errors.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
Changed @rtval to @retval in SdMmcHcStartSdClock
function description.
Signed-off-by: Mateusz Albecki <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
The endpoint selected by the driver needs to not
only be an interrupt type, but have direction IN
as required to set up an asynchronous interrupt transfer.
Currently, the driver assumes that the first INT endpoint
will be of type IN, but that is not true of all devices,
and will silently fail on devices which have the OUT endpoint
before the IN. Adjust the endpoint selection loop to explictly
check for direction IN.
Signed-off-by: Matt DeVillier <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
The endpoint selected by the driver needs to not
only be an interrupt type, but have direction IN
as required to set up an asynchronous interrupt transfer.
Currently, the driver assumes that the first INT endpoint
will be of type IN, but that is not true of all devices,
and will silently fail on devices which have the OUT endpoint
before the IN. Adjust the endpoint selection loop to explictly
check for direction IN.
Signed-off-by: Matt DeVillier <[email protected]>
Reviewed-by: GuoMinJ <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
The endpoint selected by the driver needs to not
only be an interrupt type, but have direction IN
as required to set up an asynchronous interrupt transfer.
Currently, the driver assumes that the first INT endpoint
will be of type IN, but that is not true of all devices,
and will silently fail on devices which have the OUT endpoint
before the IN. Adjust the endpoint selection loop to explictly
check for direction IN.
Test: detachable keyboard on Google Pixel Slate now works.
Signed-off-by: Matt DeVillier <[email protected]>
Reviewed-by: GuoMinJ <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
In SD card voltage switch flow we used to redo the
entire internal clock setup after voltage switch.
Since internal clock has already been setup this
is wasting time on polling the internal clock stable.
This commit changes it to only start the SD clock.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Tested-by: Marcin Wojtas <[email protected]>
Tested-by: Hao A Wu <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
For eMMC modules we used to notify the platform about frequency
change only after sending CMD13 which meant that platform
might not get a chance to apply required post frequency
change fixes to get the clock stable. To fix this
notification has been moved to SdMmcHcClockSupply function
just after we start the SD clock. During first time setup
the notification won't be sent to avoid changing old behavior.
Cc: Hao A Wu <[email protected]>
Cc: Marcin Wojtas <[email protected]>
Cc: Zhichao Gao <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Mateusz Albecki <[email protected]>
Tested-by: Marcin Wojtas <[email protected]>
Tested-by: Hao A Wu <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2118
When a packet is queued/completed for the asynchronous IO queue, the logic
to roll over to the front of the queue doesn't account for actual size of
the IO Submission/Completion queue.
This causes a device to hang due to doorbell being outside of visible
queue. An example would be if an NVMe drive only supported a queue size of
128 while the driver supports 256.
Cc: Jian J Wang <[email protected]>
Signed-off-by: Sean Brogan <[email protected]>
Signed-off-by: Hao A Wu <[email protected]>
Acked-by: Ray Ni <[email protected]>