[edk2-devel] [PATCH v2 5/7] EmbeddedPkg: Clear CTYPE on initialization

Loh, Tien Hock posted 7 patches 6 years, 8 months ago
[edk2-devel] [PATCH v2 5/7] EmbeddedPkg: Clear CTYPE on initialization
Posted by Loh, Tien Hock 6 years, 8 months ago
From: "Tien Hock, Loh" <tien.hock.loh@intel.com>

Clear CTYPE on initialization. This is important if previous bootloader
changes the CTYPE can cause the controller to not initialize correctly
if CTYPE is not reset to 0

Signed-off-by: "Tien Hock, Loh" <tien.hock.loh@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index e0068655ca..c6c8e04917 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -205,6 +205,7 @@ DwEmmcNotifyState (
     MmioWrite32 (DWEMMC_TMOUT, ~0);
     MmioWrite32 (DWEMMC_IDINTEN, 0);
     MmioWrite32 (DWEMMC_BMOD, DWEMMC_IDMAC_SWRESET);
+    MmioWrite32 (DWEMMC_CTYPE, 0);
 
     MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
     do {
-- 
2.19.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41413): https://edk2.groups.io/g/devel/message/41413
Mute This Topic: https://groups.io/mt/31807964/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 5/7] EmbeddedPkg: Clear CTYPE on initialization
Posted by Leif Lindholm 6 years, 8 months ago
On Mon, May 27, 2019 at 05:30:26PM +0800, tien.hock.loh@intel.com wrote:
> From: "Tien Hock, Loh" <tien.hock.loh@intel.com>
> 
> Clear CTYPE on initialization. This is important if previous bootloader
> changes the CTYPE can cause the controller to not initialize correctly
> if CTYPE is not reset to 0
> 
> Signed-off-by: "Tien Hock, Loh" <tien.hock.loh@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> index e0068655ca..c6c8e04917 100644
> --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> @@ -205,6 +205,7 @@ DwEmmcNotifyState (
>      MmioWrite32 (DWEMMC_TMOUT, ~0);
>      MmioWrite32 (DWEMMC_IDINTEN, 0);
>      MmioWrite32 (DWEMMC_BMOD, DWEMMC_IDMAC_SWRESET);
> +    MmioWrite32 (DWEMMC_CTYPE, 0);
>  
>      MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
>      do {
> -- 
> 2.19.0
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41538): https://edk2.groups.io/g/devel/message/41538
Mute This Topic: https://groups.io/mt/31807964/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-