* [PATCH v4 0/3] SdMmc fixes
@ 2018-09-18 8:59 Marcin Wojtas
2018-09-18 8:59 ` [PATCH v4 1/2] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits Marcin Wojtas
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marcin Wojtas @ 2018-09-18 8:59 UTC (permalink / raw)
To: edk2-devel
Cc: feng.tian, michael.d.kinney, liming.gao, leif.lindholm, hao.a.wu,
ard.biesheuvel, nadavh, mw, jsd, tm
Hi,
The third version has shrunk once again - it turned
out the bus width / bus mode sequence modification
in eMMC high speed setting may not be needed.
Other than that, for remaining two patches add
bugzilla references and apply required modifications.
More details can be found in the changelog below.
Patches are available in the github:
https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/sdmmc-fixes-r20180918
I'm looking forward to the comments and remarks.
Best regards,
Marcin
Changelog:
v3 -> v4
* rebase on top of the newest master
* add Hao Wu RB in 2/2
* add references to according bugzilla entries
* remove changes in EmmcSwitchToHighSpeed ()
* Use BIT0 directly and update error message in 1/2
v2 -> v3
* rebase on top of the newest master
* remove changes in EmmcSwitchToHS200 ()
* 2/3 - use BIT0 in macro
v1 -> v2
* rebase on top of the newest master
* resolve conflicts after taking fixes out from new features
* 3/4 - use macro instead of raw value in SdMmcHcReset
Marcin Wojtas (1):
MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot
Tomasz Michalec (1):
MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 18 ++++++++++++------
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 8 ++++----
2 files changed, 16 insertions(+), 10 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v4 1/2] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits
2018-09-18 8:59 [PATCH v4 0/3] SdMmc fixes Marcin Wojtas
@ 2018-09-18 8:59 ` Marcin Wojtas
2018-09-18 8:59 ` [PATCH v4 2/2] MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot Marcin Wojtas
2018-09-21 2:50 ` [PATCH v4 0/3] SdMmc fixes Wu, Hao A
2 siblings, 0 replies; 4+ messages in thread
From: Marcin Wojtas @ 2018-09-18 8:59 UTC (permalink / raw)
To: edk2-devel
Cc: feng.tian, michael.d.kinney, liming.gao, leif.lindholm, hao.a.wu,
ard.biesheuvel, nadavh, mw, jsd, tm
From: Tomasz Michalec <tm@semihalf.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1185
SdMmcHcReset used to set all bits of Software Reset Register to 1
including reserved ones, which on some controllers may result in
timeout.
Now only first bit is set, which means "Software Reset for All".
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index 9672b5b..25771dc 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -454,11 +454,11 @@ SdMmcHcReset (
}
PciIo = Private->PciIo;
- SwReset = 0xFF;
- Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_SW_RST, FALSE, sizeof (SwReset), &SwReset);
+ SwReset = BIT0;
+ Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_SW_RST, sizeof (SwReset), &SwReset);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "SdMmcHcReset: write full 1 fails: %r\n", Status));
+ DEBUG ((DEBUG_ERROR, "SdMmcHcReset: write SW Reset for All fails: %r\n", Status));
return Status;
}
@@ -467,7 +467,7 @@ SdMmcHcReset (
Slot,
SD_MMC_HC_SW_RST,
sizeof (SwReset),
- 0xFF,
+ BIT0,
0x00,
SD_MMC_HC_GENERIC_TIMEOUT
);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v4 2/2] MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot
2018-09-18 8:59 [PATCH v4 0/3] SdMmc fixes Marcin Wojtas
2018-09-18 8:59 ` [PATCH v4 1/2] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits Marcin Wojtas
@ 2018-09-18 8:59 ` Marcin Wojtas
2018-09-21 2:50 ` [PATCH v4 0/3] SdMmc fixes Wu, Hao A
2 siblings, 0 replies; 4+ messages in thread
From: Marcin Wojtas @ 2018-09-18 8:59 UTC (permalink / raw)
To: edk2-devel
Cc: feng.tian, michael.d.kinney, liming.gao, leif.lindholm, hao.a.wu,
ard.biesheuvel, nadavh, mw, jsd, tm
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1182
Some devices can be non removable (such as eMMC) and checking
Present State Register on host controller may falsely return
an information that device is not present. Execute this
check conditionally on the SloType field value.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
---
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
index f923930..bf9869d 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
@@ -661,12 +661,18 @@ SdMmcPciHcDriverBindingStart (
//
// Check whether there is a SD/MMC card attached
//
- Status = SdMmcHcCardDetect (PciIo, Slot, &MediaPresent);
- if (EFI_ERROR (Status) && (Status != EFI_MEDIA_CHANGED)) {
- continue;
- } else if (!MediaPresent) {
- DEBUG ((DEBUG_INFO, "SdMmcHcCardDetect: No device attached in Slot[%d]!!!\n", Slot));
- continue;
+ if (Private->Slot[Slot].SlotType == RemovableSlot) {
+ Status = SdMmcHcCardDetect (PciIo, Slot, &MediaPresent);
+ if (EFI_ERROR (Status) && (Status != EFI_MEDIA_CHANGED)) {
+ continue;
+ } else if (!MediaPresent) {
+ DEBUG ((
+ DEBUG_INFO,
+ "SdMmcHcCardDetect: No device attached in Slot[%d]!!!\n",
+ Slot
+ ));
+ continue;
+ }
}
Status = SdMmcHcInitHost (Private, Slot);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4 0/3] SdMmc fixes
2018-09-18 8:59 [PATCH v4 0/3] SdMmc fixes Marcin Wojtas
2018-09-18 8:59 ` [PATCH v4 1/2] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits Marcin Wojtas
2018-09-18 8:59 ` [PATCH v4 2/2] MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot Marcin Wojtas
@ 2018-09-21 2:50 ` Wu, Hao A
2 siblings, 0 replies; 4+ messages in thread
From: Wu, Hao A @ 2018-09-21 2:50 UTC (permalink / raw)
To: Marcin Wojtas, edk2-devel@lists.01.org
Cc: tm@semihalf.com, nadavh@marvell.com, Gao, Liming,
Kinney, Michael D
The series is good to me.
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
I will push the changes and update the relating Bugzilla trackers.
Best Regards,
Hao Wu
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Marcin Wojtas
> Sent: Tuesday, September 18, 2018 4:59 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng; tm@semihalf.com; Wu, Hao A; nadavh@marvell.com; Gao,
> Liming; Kinney, Michael D
> Subject: [edk2] [PATCH v4 0/3] SdMmc fixes
>
> Hi,
>
> The third version has shrunk once again - it turned
> out the bus width / bus mode sequence modification
> in eMMC high speed setting may not be needed.
> Other than that, for remaining two patches add
> bugzilla references and apply required modifications.
> More details can be found in the changelog below.
>
> Patches are available in the github:
> https://github.com/MarvellEmbeddedProcessors/edk2-open-
> platform/commits/sdmmc-fixes-r20180918
>
> I'm looking forward to the comments and remarks.
>
> Best regards,
> Marcin
>
> Changelog:
> v3 -> v4
> * rebase on top of the newest master
> * add Hao Wu RB in 2/2
> * add references to according bugzilla entries
> * remove changes in EmmcSwitchToHighSpeed ()
> * Use BIT0 directly and update error message in 1/2
>
> v2 -> v3
> * rebase on top of the newest master
> * remove changes in EmmcSwitchToHS200 ()
> * 2/3 - use BIT0 in macro
>
> v1 -> v2
> * rebase on top of the newest master
> * resolve conflicts after taking fixes out from new features
> * 3/4 - use macro instead of raw value in SdMmcHcReset
>
>
> Marcin Wojtas (1):
> MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot
>
> Tomasz Michalec (1):
> MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits
>
> MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 18
> ++++++++++++------
> MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 8 ++++----
> 2 files changed, 16 insertions(+), 10 deletions(-)
>
> --
> 2.7.4
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-21 2:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-18 8:59 [PATCH v4 0/3] SdMmc fixes Marcin Wojtas
2018-09-18 8:59 ` [PATCH v4 1/2] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits Marcin Wojtas
2018-09-18 8:59 ` [PATCH v4 2/2] MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot Marcin Wojtas
2018-09-21 2:50 ` [PATCH v4 0/3] SdMmc fixes Wu, Hao A
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox