Re: [edk2-devel] [[edk2-platforms]PATCH v4 1/1] Platform: Intel: Add Stratix 10 platform support

2019-05-29 Thread Loh, Tien Hock
Leif, thanks for reviewing, a question inlined.

> -Original Message-
> From: Leif Lindholm 
> Sent: Wednesday, May 29, 2019 10:43 PM
> To: Loh, Tien Hock 
> Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> ; Kinney, Michael D
> 
> Subject: Re: [[edk2-platforms]PATCH v4 1/1] Platform: Intel: Add Stratix 10
> platform support
> 
> Urgh, sorry, saw this was still stuck in my review queue.
> 
No problem, thanks for reviewing. 

> Mike, one question for you inline below.
> Oh, and one here - what's your take on maintainership for ARM-based
> Intel platforms? Fall back to top-level maintainers and add Tien Hock
> as reviewer?
> 
> On Thu, May 09, 2019 at 04:55:47PM +0800, tien.hock@intel.com wrote:
> > From: "Tien Hock, Loh" 
> >
> > Adds support for Intel Stratix 10 Platform.
> >
> > Signed-off-by: "Tien Hock, Loh" 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> 
> Yeah, so amusingly we've now updated the license, so we don't need
> this tag any longer...
> 
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> >
> > --
> > v4
> > - Removed LibC
> > - Added NOOPT to BUILD_TARGETS
> > - Removed ARM from SUPPORTED_ARCHITECTURE
> > v3
> > - Updated Pcd with updated name
> > v2
> > - Updates ShellBinPkg with ShellPkg
> 
> Revision history goes below --- or in cover letter.
> 
> > ---
> >  Platform/Intel/Stratix10/Stratix10SoCPkg.dec   
> >|  30 ++
> >  Platform/Intel/Stratix10/Stratix10SoCPkg.dsc   
> >| 546
> 
> >  Platform/Intel/Stratix10/Stratix10SoCPkg.fdf   
> >| 270
> ++
> >  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
> |  49 ++
> >  Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf 
> >|
> 49 ++
> >  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> |  43 ++
> >  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c   
> >|
> 155 ++
> >  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c
> | 167 ++
> >
> Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelp
> er.S |  51 ++
> >  Platform/Intel/Stratix10/Readme.md 
> >|  61 +++
> >  Platform/Intel/Stratix10/ShellScript/startup.nsh   
> >|   2 +
> >  11 files changed, 1423 insertions(+)
> >
> > diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
> b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
> > new file mode 100755
> > index ..5677ac7676d5
> > --- /dev/null
> > +++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
> > @@ -0,0 +1,30 @@
> > +#/** @file
> > +#  Intel Stratix 10 SoC FPGA Package
> > +#
> > +# Copyright (c) 2019, Intel All rights reserved.
> > +#
> > +#This program and the accompanying materials are licensed and made
> available under
> > +#the terms and conditions of the BSD License which accompanies this
> distribution.
> > +#The full text of the license may be found at
> > +#http://opensource.org/licenses/bsd-license.php
> > +#
> > +#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> > +#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> 
> ... and as a result of the license change, could you also please
> replace these
> 
> Mike Kinney may actually have some scripts that would help with this?
OK noted. If there are scripts that can automate the license header changes I'd 
love to use it :)

> 
> > +#
> > +#**/
> > +
> > +[Defines]
> > +  DEC_SPECIFICATION  = 0x00010005
> 
> We could probably bump this to the current DSC specification format?
> I think we're on 0x0001001B? (1.27)
OK noted. 
> 
> > +  PACKAGE_NAME   = IntelSoCFpgaPkg
> 
> Should this be Stratix10SoCPkg?
> 
> > +  PACKAGE_GUID   = 45533DD0-C41F-4ab6-A5DF-65B52684AC60
> > +  PACKAGE_VERSION= 0.1
> > +
> > +[Includes.common]
> 
> Add "Include" here, and you won't need to add manual -I flags below.
> 
OK

> > +
> > +[Guids.common]
> > +  gIntelSocFpgaTokenSpaceGuid =  { 0xb89b8744, 0x4a1c, 0x4cd6, { 0xba,
> 0xa, 0x69, 0xb3, 0xfe, 0xe6, 0x91, 0x6b } }
> 
> This sounds like a very generic TokenS

Re: [edk2-devel] [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand polling

2019-05-30 Thread Loh, Tien Hock
> -Original Message-
> From: Haojian Zhuang 
> Sent: Thursday, May 30, 2019 3:06 PM
> To: Leif Lindholm 
> Cc: Loh, Tien Hock ; devel@edk2.groups.io;
> thlo...@gmail.com; Ard Biesheuvel 
> Subject: Re: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> polling
> 
> On Tue, May 28, 2019 at 07:04:09PM +0100, Leif Lindholm wrote:
> > +Haojian,
> >
> > Haojian - since you are the original author, can you comment on the
> > delays? Are these silicon bug workarounds (so we need to add a Pcd),
> > or does these changes work on your platforms too?
> 
> I'm not in the loop, so I missed the patch series.
> 
> The patch series can't work on my platform for the eMMC. Although a
> variable is created to identify whether it's a SD or eMMC device, it doesn't
> identify the eMMC device by the right way. So the eMMC device isn't
> initialized successfully on my platform.
> 
> 1. Since MMC framework could identify whether it's eMMC device or SD
> device, we need to make device driver gets this kind of information from the
> MMC framework. And we need to support multiple eMMC/SD instances in
> MMC framework.

Yeah my bad I didn't read through the SD/MMC specs on that. Now I check the 
specs and you're right, the information should be read from MMC framework.

> 
> 2. I sent a patch series to support both eMMC device and SD device before.
> https://edk2.groups.io/g/devel/message/28572
> &&
> https://edk2.groups.io/g/devel/message/28615
> Maybe it's missed. Could you help to review that patch series?

> 
> Best Regards
> Haojian
> 
> >
> > Regards,
> >
> > Leif
> >
> > On Mon, May 27, 2019 at 05:30:27PM +0800, tien.hock@intel.com
> wrote:
> > > From: "Tien Hock, Loh" 
> > >
> > > Change SendCommand polling mode to remove unnecessary delay, and
> > > check for transfer done only when block data is to be read/write.
> > > This would also increase performance slightly.
> > >
> > > Signed-off-by: "Tien Hock, Loh" 
> > > Cc: Leif Lindholm 
> > > Cc: Ard Biesheuvel 
> > > ---
> > >  EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 43
> +++-
> > >  1 file changed, 33 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > index c6c8e04917..b57833458f 100644
> > > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > @@ -286,16 +286,13 @@ SendCommand (
> > >  DWEMMC_INT_RCRC | DWEMMC_INT_RE;
> > >ErrMask |= DWEMMC_INT_DCRC | DWEMMC_INT_DRT |
> DWEMMC_INT_SBE;
> > >do {
> > > -MicroSecondDelay(500);
> > >  Data = MmioRead32 (DWEMMC_RINTSTS);
> > > -
> > > -if (Data & ErrMask) {
> > > -  return EFI_DEVICE_ERROR;
> > > -}
> > > -if (Data & DWEMMC_INT_DTO) { // Transfer Done
> > > -  break;
> > > -}
> > >} while (!(Data & DWEMMC_INT_CMD_DONE));
> > > +
> > > +  if (Data & ErrMask) {
> > > +return EFI_DEVICE_ERROR;
> > > +  }
> > > +
> > >return EFI_SUCCESS;
> > >  }
> > >
> > > @@ -550,8 +547,9 @@ DwEmmcReadBlockData (
> > >)
> > >  {
> > >EFI_STATUS  Status;
> > > -  UINT32  DescPages, CountPerPage, Count;
> > > +  UINT32  DescPages, CountPerPage, Count, ErrMask;
> > >EFI_TPL Tpl;
> > > +  UINTN Rintsts = 0;
> > >
> > >Tpl = gBS->RaiseTPL (TPL_NOTIFY);
> > >
> > > @@ -574,6 +572,18 @@ DwEmmcReadBlockData (
> > >  DEBUG ((DEBUG_ERROR, "Failed to read data,
> mDwEmmcCommand:%x, mDwEmmcArgument:%x, Status:%r\n",
> mDwEmmcCommand, mDwEmmcArgument, Status));
> > >  goto out;
> > >}
> > > +
> > > +  while(!((MmioRead32(DWEMMC_RINTSTS) & (DWEMMC_INT_DTO
> {
> > > +Rintsts = MmioRead32 (DWEMMC_RINTSTS);  }  ErrMask =
> > > + DWEMMC_INT_EBE | DWEMMC_INT_HLE | DWEMMC_INT_RTO |
> > > +DWEMMC_INT_RCRC | DWEMMC_INT_RE |
> DWEMMC_INT_DCRC |
> > > +DWEMMC_INT_DRT | DWEMMC_INT_SBE;
> > > +
> > > +  if (Rintsts & ErrMask) {
> > > +Status = EFI_DEVICE_ERROR;
> > > +goto out;
> > > +  }
> > >  out:
> > >// Restore Tpl
> > >gBS->RestoreTPL (Tpl);
> > &g

Re: [edk2-devel] [[edk2-platforms]PATCH v4 1/1] Platform: Intel: Add Stratix 10 platform support

2019-05-29 Thread Loh, Tien Hock
> -Original Message-
> From: Wu, Hao A
> Sent: Thursday, May 30, 2019 9:03 AM
> To: devel@edk2.groups.io; Loh, Tien Hock ;
> thlo...@gmail.com
> Cc: Ard Biesheuvel ; Leif Lindholm
> ; Kinney, Michael D
> 
> Subject: RE: [edk2-devel] [[edk2-platforms]PATCH v4 1/1] Platform: Intel: Add
> Stratix 10 platform support
> 
> > -Original Message-
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Loh, Tien Hock
> > Sent: Thursday, May 09, 2019 4:56 PM
> > To: devel@edk2.groups.io; thlo...@gmail.com
> > Cc: Loh, Tien Hock; Ard Biesheuvel; Leif Lindholm; Kinney, Michael D
> > Subject: [edk2-devel] [[edk2-platforms]PATCH v4 1/1] Platform: Intel: Add
> > Stratix 10 platform support
> >
> > From: "Tien Hock, Loh" 
> >
> > Adds support for Intel Stratix 10 Platform.
> >
> > Signed-off-by: "Tien Hock, Loh" 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> >
> > --
> > v4
> > - Removed LibC
> > - Added NOOPT to BUILD_TARGETS
> > - Removed ARM from SUPPORTED_ARCHITECTURE
> 
> Hello Tien Hock,
> 
> Could you help to remove the IntelFrameworkModulePkg dependency on the
> platform? The package will be removed in the near future.
> 
> More specifically, for:
> 
> *
> GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBd
> sLib.inf
> I do not see the library is being consumed by any module and I think it
> can be dropped. Could you help to double-confirm on this?
> 
> *
> ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusC
> odeLibFramework/DxeReportStatusCodeLib.inf
> The platform seems do not have a status code router, so could you help to
> use
> MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull
> .inf
> for ReportStatusCodeLib instances?

OK noted. I'll fix this and resubmit a new version. Thanks!

> 
> Thanks in advance.
> 
> Best Regards,
> Hao Wu
> 
> > v3
> > - Updated Pcd with updated name
> > v2
> > - Updates ShellBinPkg with ShellPkg
> > ---
> >  Platform/Intel/Stratix10/Stratix10SoCPkg.dec   
> >|  30 ++
> >  Platform/Intel/Stratix10/Stratix10SoCPkg.dsc   
> >| 546
> > 
> >  Platform/Intel/Stratix10/Stratix10SoCPkg.fdf   
> >| 270
> > ++
> >  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
> > |  49 ++
> >  Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf 
> >|
> > 49 ++
> >  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> |
> > 43 ++
> >  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c   
> >|
> > 155 ++
> >  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c
> |
> > 167 ++
> >
> >
> Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelp
> > er.S |  51 ++
> >  Platform/Intel/Stratix10/Readme.md 
> >|  61 +++
> >  Platform/Intel/Stratix10/ShellScript/startup.nsh   
> >|   2 +
> >  11 files changed, 1423 insertions(+)
> >
> > diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
> > b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
> > new file mode 100755
> > index ..5677ac7676d5
> > --- /dev/null
> > +++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
> > @@ -0,0 +1,30 @@
> > +#/** @file
> > +#  Intel Stratix 10 SoC FPGA Package
> > +#
> > +# Copyright (c) 2019, Intel All rights reserved.
> > +#
> > +#This program and the accompanying materials are licensed and made
> > available under
> > +#the terms and conditions of the BSD License which accompanies this
> > distribution.
> > +#The full text of the license may be found at
> > +#http://opensource.org/licenses/bsd-license.php
> > +#
> > +#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > BASIS,
> > +#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > EXPRESS OR IMPLIED.
> > +#
> > +#**/
> > +
> > +[Defines]
> > +  DEC_SPECIFICATION  = 0x00010005
> > +  PACKAGE_NAME   = IntelSoCFpgaPkg
> > +  PACKAGE_GUID   = 45533DD0-C41F-4ab6-A5DF-65B52684AC60
> &g

[edk2-devel] [PATCH v2 7/7] EmbeddedPkg: Fix DwEmmc read/write size in preparing DMA size

2019-05-27 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Add support for reading data that is less than DWEMMC_BLOCK_SIZE,
otherwise it would read bigger data than requested and cause errors

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 

--
v2:
- Fix white space issue
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index b57833458f..ec2fa7923b 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -493,7 +493,10 @@ PrepareDmaData (
 
   Cnt = (Length + DWEMMC_DMA_BUF_SIZE - 1) / DWEMMC_DMA_BUF_SIZE;
   Blks = (Length + DWEMMC_BLOCK_SIZE - 1) / DWEMMC_BLOCK_SIZE;
-  Length = DWEMMC_BLOCK_SIZE * Blks;
+
+  if(Length >= DWEMMC_BLOCK_SIZE) {
+Length = DWEMMC_BLOCK_SIZE * Blks;
+  }
 
   for (Idx = 0; Idx < Cnt; Idx++) {
 (IdmacDesc + Idx)->Des0 = DWEMMC_IDMAC_DES0_OWN | DWEMMC_IDMAC_DES0_CH |
@@ -534,8 +537,14 @@ StartDma (
   Data |= DWEMMC_IDMAC_ENABLE | DWEMMC_IDMAC_FB;
   MmioWrite32 (DWEMMC_BMOD, Data);
 
-  MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
-  MmioWrite32 (DWEMMC_BYTCNT, Length);
+  if(Length < DWEMMC_BLOCK_SIZE) {
+MmioWrite32 (DWEMMC_BLKSIZ, Length);
+MmioWrite32 (DWEMMC_BYTCNT, Length);
+  }
+  else {
+MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
+MmioWrite32 (DWEMMC_BYTCNT, Length);
+  }
 }
 
 EFI_STATUS
-- 
2.19.0


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

View/Reply Online (#41415): https://edk2.groups.io/g/devel/message/41415
Mute This Topic: https://groups.io/mt/31807966/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



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

2019-05-27 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

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" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 1/7] EmbeddedPkg: Add SD command support for DwEmmc

2019-05-27 Thread Loh, Tien Hock
From: "TIen Hock, Loh" 

Added ACMD6 for SD support. For SD, after CMD55 is sent, the next
command should be an application command, which should not expect
data

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 

--
v2:
- Move IsACmd as a local static variable in function
- Fix some coding standard issue with spacing
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 68c523a99f..420487757d 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -307,6 +307,7 @@ DwEmmcSendCommand (
 {
   UINT32   Cmd = 0;
   EFI_STATUS   Status = EFI_SUCCESS;
+  STATIC BOOLEAN IsACmd = FALSE;
 
   switch (MMC_GET_INDX(MmcCmd)) {
   case MMC_INDX(0):
@@ -323,6 +324,15 @@ DwEmmcSendCommand (
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
BIT_CMD_SEND_INIT;
 break;
+  case MMC_INDX (6):
+if(IsACmd) {
+  Cmd = BIT_CMD_RESPONSE_EXPECT;
+}
+else {
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED |
+BIT_CMD_READ;
+}
+break;
   case MMC_INDX(7):
 if (Argument)
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
@@ -367,12 +377,22 @@ DwEmmcSendCommand (
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
BIT_CMD_DATA_EXPECTED;
 break;
+  case MMC_INDX (51):
+Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED |
+   BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
+break;
   default:
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
 break;
   }
 
   Cmd |= MMC_GET_INDX(MmcCmd) | BIT_CMD_USE_HOLD_REG | BIT_CMD_START;
+
+  if(MMC_INDX (55) == MMC_GET_INDX (MmcCmd))
+IsACmd = TRUE;
+  else
+IsACmd = FALSE;
+
   if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
 mDwEmmcCommand = Cmd;
 mDwEmmcArgument = Argument;
-- 
2.19.0


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

View/Reply Online (#41409): https://edk2.groups.io/g/devel/message/41409
Mute This Topic: https://groups.io/mt/31807960/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 3/7] EmbeddedPkg: Send command when MMC ask for response

2019-05-27 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Send command when MMC ask for response in DwEmmcReceiveResponse, and
command is a pending command (eg. DMA needs to be set up first)

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index fd3a5bf685..c44e310c04 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -400,6 +400,8 @@ DwEmmcSendCommand (
 mDwEmmcCommand = Cmd;
 mDwEmmcArgument = Argument;
   } else {
+mDwEmmcCommand = Cmd;
+mDwEmmcArgument = Argument;
 Status = SendCommand (Cmd, Argument);
   }
   return Status;
@@ -412,10 +414,15 @@ DwEmmcReceiveResponse (
   IN UINT32*Buffer
   )
 {
+  EFI_STATUS Status = EFI_SUCCESS;
+
   if (Buffer == NULL) {
 return EFI_INVALID_PARAMETER;
   }
 
+  if(IsPendingReadCommand (mDwEmmcCommand) || 
IsPendingWriteCommand(mDwEmmcCommand))
+Status = SendCommand (mDwEmmcCommand, mDwEmmcArgument);
+
   if (   (Type == MMC_RESPONSE_TYPE_R1)
   || (Type == MMC_RESPONSE_TYPE_R1b)
   || (Type == MMC_RESPONSE_TYPE_R3)
@@ -429,7 +436,7 @@ DwEmmcReceiveResponse (
 Buffer[2] = MmioRead32 (DWEMMC_RESP2);
 Buffer[3] = MmioRead32 (DWEMMC_RESP3);
   }
-  return EFI_SUCCESS;
+  return Status;
 }
 
 VOID
-- 
2.19.0


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

View/Reply Online (#41411): https://edk2.groups.io/g/devel/message/41411
Mute This Topic: https://groups.io/mt/31807962/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand polling

2019-05-27 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Change SendCommand polling mode to remove unnecessary delay, and check
for transfer done only when block data is to be read/write. This would
also increase performance slightly.

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 43 +++-
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index c6c8e04917..b57833458f 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -286,16 +286,13 @@ SendCommand (
 DWEMMC_INT_RCRC | DWEMMC_INT_RE;
   ErrMask |= DWEMMC_INT_DCRC | DWEMMC_INT_DRT | DWEMMC_INT_SBE;
   do {
-MicroSecondDelay(500);
 Data = MmioRead32 (DWEMMC_RINTSTS);
-
-if (Data & ErrMask) {
-  return EFI_DEVICE_ERROR;
-}
-if (Data & DWEMMC_INT_DTO) { // Transfer Done
-  break;
-}
   } while (!(Data & DWEMMC_INT_CMD_DONE));
+
+  if (Data & ErrMask) {
+return EFI_DEVICE_ERROR;
+  }
+
   return EFI_SUCCESS;
 }
 
@@ -550,8 +547,9 @@ DwEmmcReadBlockData (
   )
 {
   EFI_STATUS  Status;
-  UINT32  DescPages, CountPerPage, Count;
+  UINT32  DescPages, CountPerPage, Count, ErrMask;
   EFI_TPL Tpl;
+  UINTN Rintsts = 0;
 
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);
 
@@ -574,6 +572,18 @@ DwEmmcReadBlockData (
 DEBUG ((DEBUG_ERROR, "Failed to read data, mDwEmmcCommand:%x, 
mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));
 goto out;
   }
+
+  while(!((MmioRead32(DWEMMC_RINTSTS) & (DWEMMC_INT_DTO {
+Rintsts = MmioRead32 (DWEMMC_RINTSTS);
+  }
+  ErrMask = DWEMMC_INT_EBE | DWEMMC_INT_HLE | DWEMMC_INT_RTO |
+DWEMMC_INT_RCRC | DWEMMC_INT_RE | DWEMMC_INT_DCRC |
+DWEMMC_INT_DRT | DWEMMC_INT_SBE;
+
+  if (Rintsts & ErrMask) {
+Status = EFI_DEVICE_ERROR;
+goto out;
+  }
 out:
   // Restore Tpl
   gBS->RestoreTPL (Tpl);
@@ -589,8 +599,9 @@ DwEmmcWriteBlockData (
   )
 {
   EFI_STATUS  Status;
-  UINT32  DescPages, CountPerPage, Count;
+  UINT32  DescPages, CountPerPage, Count, ErrMask;
   EFI_TPL Tpl;
+  UINTN Rintsts = 0;
 
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);
 
@@ -613,6 +624,18 @@ DwEmmcWriteBlockData (
 DEBUG ((DEBUG_ERROR, "Failed to write data, mDwEmmcCommand:%x, 
mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));
 goto out;
   }
+
+  while(!((MmioRead32(DWEMMC_RINTSTS) & (DWEMMC_INT_DTO {
+Rintsts = MmioRead32 (DWEMMC_RINTSTS);
+  }
+  ErrMask = DWEMMC_INT_EBE | DWEMMC_INT_HLE | DWEMMC_INT_RTO |
+DWEMMC_INT_RCRC | DWEMMC_INT_RE | DWEMMC_INT_DCRC |
+DWEMMC_INT_DRT | DWEMMC_INT_SBE;
+
+  if (Rintsts & ErrMask) {
+Status = EFI_DEVICE_ERROR;
+goto out;
+  }
 out:
   // Restore Tpl
   gBS->RestoreTPL (Tpl);
-- 
2.19.0


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

View/Reply Online (#41414): https://edk2.groups.io/g/devel/message/41414
Mute This Topic: https://groups.io/mt/31807965/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 4/7] EmbeddedPkg: Fix response check flag

2019-05-27 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Do not send CRC response check if the MMC command does not support CRC
response

Signed-off-by: Tien Hock, Loh 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index c44e310c04..e0068655ca 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -385,7 +385,7 @@ DwEmmcSendCommand (
BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
 break;
   default:
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
+Cmd = BIT_CMD_RESPONSE_EXPECT;
 break;
   }
 
@@ -396,6 +396,10 @@ DwEmmcSendCommand (
   else
 IsACmd = FALSE;
 
+  if (!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) {
+Cmd |= BIT_CMD_CHECK_RESPONSE_CRC;
+  }
+
   if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
 mDwEmmcCommand = Cmd;
 mDwEmmcArgument = Argument;
-- 
2.19.0


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

View/Reply Online (#41412): https://edk2.groups.io/g/devel/message/41412
Mute This Topic: https://groups.io/mt/31807963/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 2/7] EmbeddedPkg: Fix DwEmmc CMD8 support for SD

2019-05-27 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

On CMD8, for SD, the controller should not expect data as this is a
SEND_IF_COND command to verify SD operating condition, and does not have
data.

Signed-off-by: Tien Hock, Loh 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 

--
v2
- Change IsEmmc to EFI_MMC_HOST_CARD_TYPE
---
 EmbeddedPkg/Include/Protocol/MmcHost.h   | 6 ++
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c| 9 ++---
 EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 2 ++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/EmbeddedPkg/Include/Protocol/MmcHost.h 
b/EmbeddedPkg/Include/Protocol/MmcHost.h
index 9e07082680..7807744721 100644
--- a/EmbeddedPkg/Include/Protocol/MmcHost.h
+++ b/EmbeddedPkg/Include/Protocol/MmcHost.h
@@ -151,6 +151,11 @@ typedef BOOLEAN (EFIAPI *MMC_ISMULTIBLOCK) (
   IN  EFI_MMC_HOST_PROTOCOL *This
   );
 
+typedef enum {
+  EMMC,
+  SD
+} EFI_MMC_HOST_CARD_TYPE;
+
 struct _EFI_MMC_HOST_PROTOCOL {
 
   UINT32  Revision;
@@ -169,6 +174,7 @@ struct _EFI_MMC_HOST_PROTOCOL {
   MMC_SETIOS  SetIos;
   MMC_ISMULTIBLOCKIsMultiBlock;
 
+  EFI_MMC_HOST_CARD_TYPE  HostCardType;
 };
 
 #define MMC_HOST_PROTOCOL_REVISION0x00010002// 1.2
diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 420487757d..fd3a5bf685 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -340,9 +340,12 @@ DwEmmcSendCommand (
 Cmd = 0;
 break;
   case MMC_INDX(8):
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
-   BIT_CMD_DATA_EXPECTED | BIT_CMD_READ |
-   BIT_CMD_WAIT_PRVDATA_COMPLETE;
+if (This->HostCardType == SD)
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
+ BIT_CMD_WAIT_PRVDATA_COMPLETE;
+else
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
+ BIT_CMD_WAIT_PRVDATA_COMPLETE | BIT_CMD_READ | 
BIT_CMD_DATA_EXPECTED;
 break;
   case MMC_INDX(9):
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c 
b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
index 4dc0be125c..c816ae09ee 100755
--- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
@@ -770,8 +770,10 @@ InitializeMmcDevice (
   }
 
   if (MmcHostInstance->CardInfo.CardType != EMMC_CARD) {
+MmcHostInstance->MmcHost->HostCardType = SD;
 Status = InitializeSdMmcDevice (MmcHostInstance);
   } else {
+MmcHostInstance->MmcHost->HostCardType = EMMC;
 Status = InitializeEmmcDevice (MmcHostInstance);
   }
   if (EFI_ERROR (Status)) {
-- 
2.19.0


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

View/Reply Online (#41410): https://edk2.groups.io/g/devel/message/41410
Mute This Topic: https://groups.io/mt/31807961/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 0/7] Fix some bugs with DwEmmc

2019-05-27 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

There are some issues with DwEmmc when being used with SD protocol.
These series of patches fixes the issues.

TIen Hock, Loh (1):
  EmbeddedPkg: Add SD command support for DwEmmc

Tien Hock, Loh (6):
  EmbeddedPkg: Fix DwEmmc CMD8 support for SD
  EmbeddedPkg: Send command when MMC ask for response
  EmbeddedPkg: Fix response check flag
  EmbeddedPkg: Clear CTYPE on initialization
  EmbeddedPkg: Fix DwEmmc SendCommand polling
  EmbeddedPkg: Fix DwEmmc read/write size in preparing DMA size

 EmbeddedPkg/Include/Protocol/MmcHost.h|   6 +
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 103 +++---
 .../Universal/MmcDxe/MmcIdentification.c  |   2 +
 3 files changed, 93 insertions(+), 18 deletions(-)

-- 
2.19.0


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

View/Reply Online (#41408): https://edk2.groups.io/g/devel/message/41408
Mute This Topic: https://groups.io/mt/31807959/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand polling

2019-06-10 Thread Loh, Tien Hock
Leif,

Since Haojian have a newer driver model that uses the NonDiscoverableDeviceDxe, 
I believe we should be moving to use the new driver.
I'll try to test out the patches submitted by Haojian in the mean time. 
Can you help review the patch? Thanks!

> -Original Message-
> From: Loh, Tien Hock
> Sent: Thursday, May 30, 2019 3:56 PM
> To: Haojian Zhuang ; Leif Lindholm
> 
> Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> 
> Subject: RE: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> polling
> 
> > -Original Message-
> > From: Haojian Zhuang 
> > Sent: Thursday, May 30, 2019 3:06 PM
> > To: Leif Lindholm 
> > Cc: Loh, Tien Hock ; devel@edk2.groups.io;
> > thlo...@gmail.com; Ard Biesheuvel 
> > Subject: Re: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> > polling
> >
> > On Tue, May 28, 2019 at 07:04:09PM +0100, Leif Lindholm wrote:
> > > +Haojian,
> > >
> > > Haojian - since you are the original author, can you comment on the
> > > delays? Are these silicon bug workarounds (so we need to add a Pcd),
> > > or does these changes work on your platforms too?
> >
> > I'm not in the loop, so I missed the patch series.
> >
> > The patch series can't work on my platform for the eMMC. Although a
> > variable is created to identify whether it's a SD or eMMC device, it
> > doesn't identify the eMMC device by the right way. So the eMMC device
> > isn't initialized successfully on my platform.
> >
> > 1. Since MMC framework could identify whether it's eMMC device or SD
> > device, we need to make device driver gets this kind of information
> > from the MMC framework. And we need to support multiple eMMC/SD
> > instances in MMC framework.
> 
> Yeah my bad I didn't read through the SD/MMC specs on that. Now I check
> the specs and you're right, the information should be read from MMC
> framework.
> 
> >
> > 2. I sent a patch series to support both eMMC device and SD device before.
> > https://edk2.groups.io/g/devel/message/28572
> > &&
> > https://edk2.groups.io/g/devel/message/28615
> > Maybe it's missed. Could you help to review that patch series?

Leif, can you help review the patch series? Since Haojian have moved the driver 
to NonDiscoverableDeviceDxe, I think that would be a more appropriate driver to 
be used going forward. Thanks!

> 
> >
> > Best Regards
> > Haojian
> >
> > >
> > > Regards,
> > >
> > > Leif
> > >
> > > On Mon, May 27, 2019 at 05:30:27PM +0800, tien.hock@intel.com
> > wrote:
> > > > From: "Tien Hock, Loh" 
> > > >
> > > > Change SendCommand polling mode to remove unnecessary delay, and
> > > > check for transfer done only when block data is to be read/write.
> > > > This would also increase performance slightly.
> > > >
> > > > Signed-off-by: "Tien Hock, Loh" 
> > > > Cc: Leif Lindholm 
> > > > Cc: Ard Biesheuvel 
> > > > ---
> > > >  EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 43
> > +++-
> > > >  1 file changed, 33 insertions(+), 10 deletions(-)
> > > >
> > > > diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > > b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > > index c6c8e04917..b57833458f 100644
> > > > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > > > @@ -286,16 +286,13 @@ SendCommand (
> > > >  DWEMMC_INT_RCRC | DWEMMC_INT_RE;
> > > >ErrMask |= DWEMMC_INT_DCRC | DWEMMC_INT_DRT |
> > DWEMMC_INT_SBE;
> > > >do {
> > > > -MicroSecondDelay(500);
> > > >  Data = MmioRead32 (DWEMMC_RINTSTS);
> > > > -
> > > > -if (Data & ErrMask) {
> > > > -  return EFI_DEVICE_ERROR;
> > > > -}
> > > > -if (Data & DWEMMC_INT_DTO) { // Transfer Done
> > > > -  break;
> > > > -}
> > > >} while (!(Data & DWEMMC_INT_CMD_DONE));
> > > > +
> > > > +  if (Data & ErrMask) {
> > > > +return EFI_DEVICE_ERROR;
> > > > +  }
> > > > +
> > > >return EFI_SUCCESS;
> > > >  }
> > > >
> > > > @@ -550,8 +547,9 @@ DwEmmcReadBlockData (
> > > >)
> > > >  {
> > > >EFI_STATUS  Status;
> > 

Re: [edk2-devel] [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand polling

2019-06-11 Thread Loh, Tien Hock
> -Original Message-
> From: Leif Lindholm 
> Sent: Tuesday, June 11, 2019 5:09 PM
> To: Loh, Tien Hock 
> Cc: 'Haojian Zhuang' ; 'devel@edk2.groups.io'
> ; 'thlo...@gmail.com' ; 'Ard
> Biesheuvel' 
> Subject: Re: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> polling
> 
> On Tue, Jun 11, 2019 at 02:40:51AM +, Loh, Tien Hock wrote:
> > Leif,
> >
> > Since Haojian have a newer driver model that uses the
> > NonDiscoverableDeviceDxe, I believe we should be moving to use the new
> > driver.
> >
> > I'll try to test out the patches submitted by Haojian in the mean time.
> > Can you help review the patch? Thanks!
> 
> I can have another look at the patch, but I would really appreciate if you
> could also review it please?
> 
> My problem is that I really don't have much understanding of SD/MMC
> protocols.

Sure. I'll test it out on the SoCFPGA platform first. It is quite a long patch, 
so I might take a bit of time to review.
Thanks Leif!

> 
> /
> Leif
> 
> > > -Original Message-
> > > From: Loh, Tien Hock
> > > Sent: Thursday, May 30, 2019 3:56 PM
> > > To: Haojian Zhuang ; Leif Lindholm
> > > 
> > > Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> > > 
> > > Subject: RE: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> > > polling
> > >
> > > > -Original Message-
> > > > From: Haojian Zhuang 
> > > > Sent: Thursday, May 30, 2019 3:06 PM
> > > > To: Leif Lindholm 
> > > > Cc: Loh, Tien Hock ;
> > > > devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> > > > 
> > > > Subject: Re: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> > > > polling
> > > >
> > > > On Tue, May 28, 2019 at 07:04:09PM +0100, Leif Lindholm wrote:
> > > > > +Haojian,
> > > > >
> > > > > Haojian - since you are the original author, can you comment on
> > > > > the delays? Are these silicon bug workarounds (so we need to add
> > > > > a Pcd), or does these changes work on your platforms too?
> > > >
> > > > I'm not in the loop, so I missed the patch series.
> > > >
> > > > The patch series can't work on my platform for the eMMC. Although
> > > > a variable is created to identify whether it's a SD or eMMC
> > > > device, it doesn't identify the eMMC device by the right way. So
> > > > the eMMC device isn't initialized successfully on my platform.
> > > >
> > > > 1. Since MMC framework could identify whether it's eMMC device or
> > > > SD device, we need to make device driver gets this kind of
> > > > information from the MMC framework. And we need to support
> > > > multiple eMMC/SD instances in MMC framework.
> > >
> > > Yeah my bad I didn't read through the SD/MMC specs on that. Now I
> > > check the specs and you're right, the information should be read
> > > from MMC framework.
> > >
> > > >
> > > > 2. I sent a patch series to support both eMMC device and SD device
> before.
> > > > https://edk2.groups.io/g/devel/message/28572
> > > > &&
> > > > https://edk2.groups.io/g/devel/message/28615
> > > > Maybe it's missed. Could you help to review that patch series?
> >
> > Leif, can you help review the patch series? Since Haojian have moved the
> driver to NonDiscoverableDeviceDxe, I think that would be a more
> appropriate driver to be used going forward. Thanks!
> >
> > >
> > > >
> > > > Best Regards
> > > > Haojian
> > > >
> > > > >
> > > > > Regards,
> > > > >
> > > > > Leif
> > > > >
> > > > > On Mon, May 27, 2019 at 05:30:27PM +0800,
> > > > > tien.hock@intel.com
> > > > wrote:
> > > > > > From: "Tien Hock, Loh" 
> > > > > >
> > > > > > Change SendCommand polling mode to remove unnecessary delay,
> > > > > > and check for transfer done only when block data is to be
> read/write.
> > > > > > This would also increase performance slightly.
> > > > > >
> > > > > > Signed-off-by: "Tien Hock, Loh" 
> > > > > > Cc: Leif Lindholm 
> > > > > > Cc: Ard Biesheuvel 
> > > > > > ---
> > > > > >  Embed

[edk2-devel] [PATCH 2/4] EmbeddedPkg: Fix response check flag

2019-05-09 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Do not send CRC response check if the MMC command does not support CRC
response

Signed-off-by: Tien Hock, Loh 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index c44e310c04..e0068655ca 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -385,7 +385,7 @@ DwEmmcSendCommand (
BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
 break;
   default:
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
+Cmd = BIT_CMD_RESPONSE_EXPECT;
 break;
   }
 
@@ -396,6 +396,10 @@ DwEmmcSendCommand (
   else
 IsACmd = FALSE;
 
+  if (!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) {
+Cmd |= BIT_CMD_CHECK_RESPONSE_CRC;
+  }
+
   if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
 mDwEmmcCommand = Cmd;
 mDwEmmcArgument = Argument;
-- 
2.19.0


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

View/Reply Online (#40290): https://edk2.groups.io/g/devel/message/40290
Mute This Topic: https://groups.io/mt/31552954/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2] EmbeddedPkg: Fix DwEmmc SendCommand polling

2019-05-09 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Change SendCommand polling mode to remove unnecessary delay, and check
for transfer done only when block data is to be read/write. This would
also increase performance slightly.

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 43 +--
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index c6c8e04917..b57833458f 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -286,16 +286,13 @@ SendCommand (
 DWEMMC_INT_RCRC | DWEMMC_INT_RE;
   ErrMask |= DWEMMC_INT_DCRC | DWEMMC_INT_DRT | DWEMMC_INT_SBE;
   do {
-MicroSecondDelay(500);
 Data = MmioRead32 (DWEMMC_RINTSTS);
-
-if (Data & ErrMask) {
-  return EFI_DEVICE_ERROR;
-}
-if (Data & DWEMMC_INT_DTO) { // Transfer Done
-  break;
-}
   } while (!(Data & DWEMMC_INT_CMD_DONE));
+
+  if (Data & ErrMask) {
+return EFI_DEVICE_ERROR;
+  }
+
   return EFI_SUCCESS;
 }
 
@@ -550,8 +547,9 @@ DwEmmcReadBlockData (
   )
 {
   EFI_STATUS  Status;
-  UINT32  DescPages, CountPerPage, Count;
+  UINT32  DescPages, CountPerPage, Count, ErrMask;
   EFI_TPL Tpl;
+  UINTN Rintsts = 0;
 
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);
 
@@ -574,6 +572,18 @@ DwEmmcReadBlockData (
 DEBUG ((DEBUG_ERROR, "Failed to read data, mDwEmmcCommand:%x, 
mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));
 goto out;
   }
+
+  while(!((MmioRead32(DWEMMC_RINTSTS) & (DWEMMC_INT_DTO {
+Rintsts = MmioRead32 (DWEMMC_RINTSTS);
+  }
+  ErrMask = DWEMMC_INT_EBE | DWEMMC_INT_HLE | DWEMMC_INT_RTO |
+DWEMMC_INT_RCRC | DWEMMC_INT_RE | DWEMMC_INT_DCRC |
+DWEMMC_INT_DRT | DWEMMC_INT_SBE;
+
+  if (Rintsts & ErrMask) {
+Status = EFI_DEVICE_ERROR;
+goto out;
+  }
 out:
   // Restore Tpl
   gBS->RestoreTPL (Tpl);
@@ -589,8 +599,9 @@ DwEmmcWriteBlockData (
   )
 {
   EFI_STATUS  Status;
-  UINT32  DescPages, CountPerPage, Count;
+  UINT32  DescPages, CountPerPage, Count, ErrMask;
   EFI_TPL Tpl;
+  UINTN Rintsts = 0;
 
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);
 
@@ -613,6 +624,18 @@ DwEmmcWriteBlockData (
 DEBUG ((DEBUG_ERROR, "Failed to write data, mDwEmmcCommand:%x, 
mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));
 goto out;
   }
+
+  while(!((MmioRead32(DWEMMC_RINTSTS) & (DWEMMC_INT_DTO {
+Rintsts = MmioRead32 (DWEMMC_RINTSTS);
+  }
+  ErrMask = DWEMMC_INT_EBE | DWEMMC_INT_HLE | DWEMMC_INT_RTO |
+DWEMMC_INT_RCRC | DWEMMC_INT_RE | DWEMMC_INT_DCRC |
+DWEMMC_INT_DRT | DWEMMC_INT_SBE;
+
+  if (Rintsts & ErrMask) {
+Status = EFI_DEVICE_ERROR;
+goto out;
+  }
 out:
   // Restore Tpl
   gBS->RestoreTPL (Tpl);
-- 
2.19.0


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

View/Reply Online (#40305): https://edk2.groups.io/g/devel/message/40305
Mute This Topic: https://groups.io/mt/31552978/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



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

2019-05-09 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

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" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 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 (#40304): https://edk2.groups.io/g/devel/message/40304
Mute This Topic: https://groups.io/mt/31552976/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: BaseSerialPortLib16550: Update Mmio32 to UNI

2019-05-09 Thread Loh, Tien Hock
> -Original Message-
> From: Wu, Hao A
> Sent: Thursday, May 9, 2019 2:37 PM
> To: devel@edk2.groups.io; Loh, Tien Hock ;
> thlo...@gmail.com
> Cc: tien.hock.loh ; Wang, Jian J
> ; Zhu, Yonghong 
> Subject: RE: [edk2-devel] [PATCH 1/1] MdeModulePkg:
> BaseSerialPortLib16550: Update Mmio32 to UNI
> 
> > -Original Message-
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Loh, Tien Hock
> > Sent: Tuesday, May 07, 2019 7:08 PM
> > To: devel@edk2.groups.io; thlo...@gmail.com
> > Cc: tien.hock.loh; Loh, Tien Hock; Wang, Jian J; Wu, Hao A; Zhu,
> > Yonghong
> > Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg:
> BaseSerialPortLib16550:
> > Update Mmio32 to UNI
> >
> 
> Hello Tien Hock,
> 
> > From: "tien.hock.loh" 
> 
> Is the above information automatically generated when formatting the
> patch?
> It seems a bit weird to me.
Yeah, must be a broken config. I'll fix this.

> 
> Also, could you help to add the Bugzilla link reference information in the
> commit message? Like:
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1771
OK noted. Will generate a patch v2. 
> 
> >
> > Some busses doesn't allow 8 bit MMIO read/write, this adds support for
> > 32 bits read/write. This patch adds the UNI information on the new Pcd
> > introduced - PcdSerialRegisterAccessWidth
> >
> > Signed-off-by: "Tien Hock, Loh" 
> > Cc: Jian J Wang 
> > Cc: Hao Wu 
> > Cc: "Zhu, YongHong" 
> >
> > Signed-off-by: tien.hock.loh 
> 
> There are 2 'Signed-off' tags here, could you help to cleanup to drop the
> unneeded one?
Yeah, I must've broken my config. I'll fix and send a new patch. 

> 
> > ---
> >  MdeModulePkg/MdeModulePkg.uni | 6 ++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/MdeModulePkg/MdeModulePkg.uni
> > b/MdeModulePkg/MdeModulePkg.uni index cf2aefa7ad..654dfeadb0
> 100644
> > --- a/MdeModulePkg/MdeModulePkg.uni
> > +++ b/MdeModulePkg/MdeModulePkg.uni
> > @@ -160,6 +160,12 @@
> >
> > "TRUE  - 16550 serial port registers are in MMIO space.\n"
> >
> > "FALSE - 16550 serial port registers are in I/O space."
> >
> > +#string
> >
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterAccessWidth_PR
> O
> > MPT  #language en-US "Serial port registers access width"
> > +
> > +#string
> >
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterAccessWidth_HE
> LP
> > #language en-US "Sets the 16550 serial port registers access width in
> > MMIO space. Default is 8 bits access.\n"
> 
> IMO, you can directly use the text:
> 'Indicates the access width for 16550 serial port registers.'
> in MdeModulePkg.dec here for
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterAccessWidth_HE
> LP.
> 
> > +
> > + "8  - 16550 serial port
> > MMIO register access are in 8 bits mode.\n"
> > +
> > + "32 - 16550 serial port
> > MMIO registers acess are in 32 bits mode.."
> 
> acess -> access
> Please also help to remove the extra '.' for the above line.
> 
> Best Regards,
> Hao Wu
> 
> > +
> >  #string
> >
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialUseHardwareFlowContr
> ol_P
> > ROMPT  #language en-US "Enable serial port hardware flow control"
> >
> >  #string
> >
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialUseHardwareFlowContr
> ol_
> > HELP  #language en-US "Indicates if the 16550 serial port hardware
> > flow control will be enabled. Default is FALSE.\n"
> > --
> > 2.13.0
> >
> >
> > 


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

View/Reply Online (#40308): https://edk2.groups.io/g/devel/message/40308
Mute This Topic: https://groups.io/mt/31530534/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 1/1] MdeModulePkg: BaseSerialPortLib16550: Add missing Pcd to UNI

2019-05-09 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1771

Some busses doesn't allow 8 bit MMIO read/write, this adds support for
32 bits read/write. This patch adds the UNI information on the new Pcd
introduced - PcdSerialRegisterAccessWidth

Signed-off-by: "Tien Hock, Loh" 
Cc: Jian J Wang 
Cc: Hao Wu 
Cc: "Zhu, YongHong" 
--
v2
- Added Bugzilla to commit
- Fixed typo
---
 MdeModulePkg/MdeModulePkg.uni | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index cf2aefa7ad..654dfeadb0 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -160,6 +160,12 @@

   "TRUE  - 16550 serial port registers are in MMIO space.\n"

   "FALSE - 16550 serial port registers are in I/O space."
 
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterAccessWidth_PROMPT 
 #language en-US "Serial port registers access width"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterAccessWidth_HELP  
#language en-US "Sets the 16550 serial port registers access width in MMIO 
space. Default is 8 bits access.\n"
+   
   "8  - 16550 serial port MMIO register access are in 8 bits mode.\n"
+   
   "32 - 16550 serial port MMIO registers acess are in 32 bits mode.."
+
 #string 
STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialUseHardwareFlowControl_PROMPT  
#language en-US "Enable serial port hardware flow control"
 
 #string 
STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialUseHardwareFlowControl_HELP  
#language en-US "Indicates if the 16550 serial port hardware flow control will 
be enabled. Default is FALSE.\n"
-- 
2.19.0


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

View/Reply Online (#40311): https://edk2.groups.io/g/devel/message/40311
Mute This Topic: https://groups.io/mt/31553371/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [[edk2-platforms]PATCH v4 1/1] Platform: Intel: Add Stratix 10 platform support

2019-05-09 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Adds support for Intel Stratix 10 Platform.

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 

--
v4
- Removed LibC
- Added NOOPT to BUILD_TARGETS
- Removed ARM from SUPPORTED_ARCHITECTURE
v3
- Updated Pcd with updated name
v2
- Updates ShellBinPkg with ShellPkg
---
 Platform/Intel/Stratix10/Stratix10SoCPkg.dec  
|  30 ++
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc  
| 546 
 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf  
| 270 ++
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
|  49 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
|  49 ++
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c  
|  43 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c  
| 155 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c  
| 167 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S 
|  51 ++
 Platform/Intel/Stratix10/Readme.md
|  61 +++
 Platform/Intel/Stratix10/ShellScript/startup.nsh  
|   2 +
 11 files changed, 1423 insertions(+)

diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dec 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
new file mode 100755
index ..5677ac7676d5
--- /dev/null
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
@@ -0,0 +1,30 @@
+#/** @file
+#  Intel Stratix 10 SoC FPGA Package
+#
+# Copyright (c) 2019, Intel All rights reserved.
+#
+#This program and the accompanying materials are licensed and made 
available under
+#the terms and conditions of the BSD License which accompanies this 
distribution.
+#The full text of the license may be found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#**/
+
+[Defines]
+  DEC_SPECIFICATION  = 0x00010005
+  PACKAGE_NAME   = IntelSoCFpgaPkg
+  PACKAGE_GUID   = 45533DD0-C41F-4ab6-A5DF-65B52684AC60
+  PACKAGE_VERSION= 0.1
+
+[Includes.common]
+
+[Guids.common]
+  gIntelSocFpgaTokenSpaceGuid =  { 0xb89b8744, 0x4a1c, 0x4cd6, { 0xba, 0xa, 
0x69, 0xb3, 0xfe, 0xe6, 0x91, 0x6b } }
+[PcdsFeatureFlag.common]
+
+[PcdsFixedAtBuild.common]
+
+
diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
new file mode 100755
index ..5665ac6c8982
--- /dev/null
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
@@ -0,0 +1,546 @@
+#/** @file
+#  Intel Stratix 10 SoC FPGA Package
+#
+# Copyright (c) 2019, Intel All rights reserved.
+#
+#This program and the accompanying materials are licensed and made 
available under
+#the terms and conditions of the BSD License which accompanies this 
distribution.
+#The full text of the license may be found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#**/
+
+
+
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+
+[Defines]
+  PLATFORM_NAME  = Intel Stratix 10 SoC Development Board
+  PLATFORM_GUID  = A2D10D02-7C36-4de8-831B-EFBFC2092D1B
+  PLATFORM_VERSION   = 0.1
+  FIRMWARE_VERSION   = 1.0
+  DSC_SPECIFICATION  = 0x00010005
+  SUPPORTED_ARCHITECTURES= AARCH64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+  FLASH_DEFINITION   = Platform/Intel/Stratix10/Stratix10SoCPkg.fdf
+  OUTPUT_DIRECTORY   = Build/Stratix10SoCPkg
+  USE_ARM_BDS= FALSE
+  SECURE_BOOT_ENABLE = FALSE
+
+
+#
+# Pcd Section - list of all EDK II PCD Entries defined by this Platform
+#
+
+
+[PcdsFixedAtBuild.common]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE
+  gArmPlatformTokenSpaceGuid.PcdCoreCount|1
+
+  # Stacks for MPCores in PEI Phase
+  gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x6d000
+  gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x3
+
+  # ARM L2x0 PCDs
+  

Re: [edk2-devel] [PATCH v2] EmbeddedPkg: Clear CTYPE on initialization

2019-05-22 Thread Loh, Tien Hock
Hi Ard, Leif,

Can you help review this?

Thanks!

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

View/Reply Online (#41205): https://edk2.groups.io/g/devel/message/41205
Mute This Topic: https://groups.io/mt/31552976/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 2/4] EmbeddedPkg: Fix response check flag

2019-05-22 Thread Loh, Tien Hock
Hi Ard, Leif,

Can you help review this?

Thanks!

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

View/Reply Online (#41204): https://edk2.groups.io/g/devel/message/41204
Mute This Topic: https://groups.io/mt/31552954/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 1/1] EmbeddedPkg: Fix DwEmmc read/write size in preparing DMA size

2019-05-09 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Add support for reading data that is less than DWEMMC_BLOCK_SIZE,
otherwise it would read bigger data than requested and cause errors

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 

--
v2:
- Fix white space issue
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index b57833458f..ec2fa7923b 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -493,7 +493,10 @@ PrepareDmaData (
 
   Cnt = (Length + DWEMMC_DMA_BUF_SIZE - 1) / DWEMMC_DMA_BUF_SIZE;
   Blks = (Length + DWEMMC_BLOCK_SIZE - 1) / DWEMMC_BLOCK_SIZE;
-  Length = DWEMMC_BLOCK_SIZE * Blks;
+
+  if(Length >= DWEMMC_BLOCK_SIZE) {
+Length = DWEMMC_BLOCK_SIZE * Blks;
+  }
 
   for (Idx = 0; Idx < Cnt; Idx++) {
 (IdmacDesc + Idx)->Des0 = DWEMMC_IDMAC_DES0_OWN | DWEMMC_IDMAC_DES0_CH |
@@ -534,8 +537,14 @@ StartDma (
   Data |= DWEMMC_IDMAC_ENABLE | DWEMMC_IDMAC_FB;
   MmioWrite32 (DWEMMC_BMOD, Data);
 
-  MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
-  MmioWrite32 (DWEMMC_BYTCNT, Length);
+  if(Length < DWEMMC_BLOCK_SIZE) {
+MmioWrite32 (DWEMMC_BLKSIZ, Length);
+MmioWrite32 (DWEMMC_BYTCNT, Length);
+  }
+  else {
+MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
+MmioWrite32 (DWEMMC_BYTCNT, Length);
+  }
 }
 
 EFI_STATUS
-- 
2.19.0


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

View/Reply Online (#40390): https://edk2.groups.io/g/devel/message/40390
Mute This Topic: https://groups.io/mt/31573046/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: BaseSerialPortLib16550: Add Mmio32 support

2019-04-24 Thread Loh, Tien Hock
Hi Mike, Hao,

Replies inlined.

On Wed, 2019-04-24 at 03:45 +, Michael D Kinney wrote:
> One issue I see is using a FeatureFlag PCD.
> These PCDs can only be TRUE or FALSE, so they can not be
> extended later.  A FixedAtBuild PCD of type BOOL has the 
> same issue.
> 
> It would be better to use a UINTx FixedAtBuild PCD, and 
> define a bit or a value for 32-bit access.  That way, if
> there is a device that requires 16-bit access, it can be
> added in the same PCD.
> 
OK noted. I'll update with UINT8, and set 0x0 to default 8bits and 0x1
to 32 bits access

> Also, should the new PCD be limited to MMIO?  It could be
> an access width PCD that could be applied to I/O or MMIO
> Access.
> 
I'm not sure if this should affect the I/O. I would separate the I/O
access with MMIO access with different PCD, I'll skip this for now as I
don't have platform that uses I/O space, thus I'm unable to test the
changes. 

> Mike
> 
> > -Original Message-
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
> > On Behalf Of Wu, Hao A
> > Sent: Tuesday, April 23, 2019 8:20 PM
> > To: Loh, Tien Hock ;
> > devel@edk2.groups.io; thlo...@gmail.com
> > Cc: Wang, Jian J 
> > Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg:
> > BaseSerialPortLib16550: Add Mmio32 support
> > 
> > > -Original Message-
> > > From: Loh, Tien Hock
> > > Sent: Wednesday, April 24, 2019 11:05 AM
> > > To: devel@edk2.groups.io; thlo...@gmail.com
> > > Cc: Loh, Tien Hock; Wang, Jian J; Wu, Hao A
> > > Subject: [PATCH 1/1] MdeModulePkg:
> > 
> > BaseSerialPortLib16550: Add Mmio32
> > > support
> > > 
> > > From: "Tien Hock, Loh" 
> > > 
> > > Some busses doesn't allow 8 bit MMIO read/write, this
> > 
> > adds support for
> > > 32 bits read/write
> > 
> > Hello Tien Hock,
> > 
> > Your V2 patch seems to be based on your V1 patch.
> > 
> > Could you help to update the V2 patch to base on the tip
> > of the edk2
> > master branch? Thanks.
> > 
> > One easy way to do this is to squash the 2 commits into
> > one.
> > 
Yes sorry I wasn't aware I'm making patch on top of a patch. 
> > 
> > Some minor comments:
> > A. Please help to update the copyright year for the
> > files:
> >BaseSerialPortLib16550.c
> >BaseSerialPortLib16550.inf
> > 
OK noted. I'll update the copyright year.

> > B. For BaseSerialPortLib16550.inf, maybe:
> > 
> > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialMmio32BitAccess
> > ## SOMETIMES_CONSUMES
> > 
OK noted.

> > is more appropriate here.
> > 
> > Best Regards,
> > Hao Wu
> > 
> > > 
> > > Signed-off-by: "Tien Hock, Loh"
> > 
> > 
> > > Cc: Jian J Wang 
> > > Cc: Hao Wu 
> > > 
> > > --
> > > v2:
> > > - Updates the Pcd name to PcdSerialMmio32BitAccess and
> > 
> > access 32 bits
> > > register if PcdSerialUseMmio and
> > 
> > PcdSerialMmio32BitAccess is set
> > > ---
> > >  .../BaseSerialPortLib16550/BaseSerialPortLib16550.c
> > > 16 
> > >  .../BaseSerialPortLib16550/BaseSerialPortLib16550.inf
> > >  2 +-
> > >  MdeModulePkg/MdeModulePkg.dec
> > > 12 +++-
> > >  3 files changed, 16 insertions(+), 14 deletions(-)
> > > 
> > > diff --git
> > > 
> > 
> > a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
> > ortLib16550.c
> > > 
> > 
> > b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
> > ortLib16550.c
> > > index b242b23..f90fb55 100644
> > > ---
> > 
> > a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
> > ortLib16550.c
> > > +++
> > > 
> > 
> > b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
> > ortLib16550.c
> > > @@ -76,10 +76,10 @@ SerialPortReadRegister (
> > >UINTN  Offset
> > >)
> > >  {
> > > -  if (PcdGetBool (PcdSerialUseMmio32)) {
> > > -return (UINT8) MmioRead32 (Base + Offset *
> > 
> > PcdGet32
> > > (PcdSerialRegisterStride));
> > > -  }
> > > -  else if (PcdGetBool (PcdSerialUseMmio)) {
> > > +  if (PcdGetBool (PcdSerialUseMmio)) {
> > > +if (PcdGetBool (PcdSerialMmio32BitAccess)) {
> > > +  return (UINT8) MmioRead32 (Base + Offset *
> > 
> > PcdGet32
> > > (PcdSerialRegisterStride));
> > > +}
> > >

Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: BaseSerialPortLib16550: Add Mmio32 support

2019-04-26 Thread Loh, Tien Hock


> -Original Message-
> From: Wu, Hao A
> Sent: Friday, April 26, 2019 1:36 PM
> To: thlo...@gmail.com; devel@edk2.groups.io; Loh, Tien Hock
> ; Kinney, Michael D
> 
> Cc: Wang, Jian J 
> Subject: RE: [PATCH 1/1] MdeModulePkg: BaseSerialPortLib16550: Add
> Mmio32 support
> 
> > -----Original Message-
> > From: Loh, Tien Hock
> > Sent: Thursday, April 25, 2019 2:13 PM
> > To: thlo...@gmail.com devel@edk2.groups.io; Kinney, Michael D
> > Cc: Loh, Tien Hock; Wang, Jian J; Wu, Hao A
> > Subject: [PATCH 1/1] MdeModulePkg: BaseSerialPortLib16550: Add Mmio32
> > support
> >
> > From: "Tien Hock, Loh" 
> >
> > Some busses doesn't allow 8 bit MMIO read/write, this adds support for
> > 32 bits read/write
> >
> > Signed-off-by: "Tien Hock, Loh" 
> > Cc: Jian J Wang 
> > Cc: Hao Wu 
> >
> > ---
> > v4
> > - Updates Pcd name to a better name: PcdSerialRegisterAccessWidth
> > v3
> > - Updates the Pcd to be UINT8 to allow more options such as 16 bits
> > access in the future
> > - Updated copyright date
> > v2
> > - Updates the Pcd name to PcdSerialMmio32BitAccess and access 32 bits
> > register if PcdSerialUseMmio and PcdSerialMmio32BitAccess is set
> > ---
> >  .../Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c  | 12
> > +++-
> >  .../BaseSerialPortLib16550/BaseSerialPortLib16550.inf|  3 ++-
> >  MdeModulePkg/MdeModulePkg.dec|  7 +++
> >  3 files changed, 20 insertions(+), 2 deletions(-)
> >
> > diff --git
> >
> a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
> >
> b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
> > index 34df34d..5910606 100644
> > ---
> >
> a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
> > +++
> >
> b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
> > @@ -2,7 +2,7 @@
> >16550 UART Serial Port library functions
> >
> >(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> > -  Copyright (c) 2006 - 2018, Intel Corporation. All rights
> > reserved.
> > +  Copyright (c) 2006 - 2019, Intel Corporation. All rights
> > + reserved.
> >Copyright (c) 2018, AMD Incorporated. All rights reserved.
> >
> >SPDX-License-Identifier: BSD-2-Clause-Patent @@ -77,6 +77,11 @@
> > SerialPortReadRegister (
> >)
> >  {
> >if (PcdGetBool (PcdSerialUseMmio)) {
> > +if (PcdGet8 (PcdSerialRegisterAccessWidth) == 8) {
> > +  return MmioRead8 (Base + Offset * PcdGet32
> (PcdSerialRegisterStride));
> > +} else if (PcdGet8 (PcdSerialRegisterAccessWidth) == 32) {
> > +  return (UINT8) MmioRead32 (Base + Offset * PcdGet32
> > (PcdSerialRegisterStride));
> > +}
> >  return MmioRead8 (Base + Offset * PcdGet32
> > (PcdSerialRegisterStride));
> 
> Hello Tien Hock,
> 
> Sorry for the delayed response.
No problem, thanks for reviewing the patch.

> 
> The above codes deal with 3 cases (also true for SerialPortWriteRegister):
> 
> 1. PcdSerialRegisterAccessWidth is set to 8 2. PcdSerialRegisterAccessWidth is
> set to 32 3. PcdSerialRegisterAccessWidth is set to values other than 8 or 32
> (For 3, the behavior falls back to default, which is okay to me)
> 
> For case 1 and 3, they end up calling MmioRead8(). So IMO, maybe we can
> simplifies the logic to:
> 
>   if (PcdGet8 (PcdSerialRegisterAccessWidth) == 32) {
> MmioRead32 (...);
>   } else {
> MmioRead8 (...);
>   }
> 
> What do you think?
> 
I'm OK either way, I'll make the changes.
> 
> Also, could you help to update the function description comments for
> 
> * SerialPortReadRegister()
> * SerialPortWriteRegister()
> 
> to reflect their behavior with regard to the new PCD?
OK noted.

> 
> Lastly, when sending a new version of the patch, could you help to append
> option '--subject-prefix="PATCH vN"' to the 'git-format-patch' command. So
> for this v4 patch, it will be '--subject-prefix="PATCH v4"'.
OK noted.
> 
> 
> Best Regards,
> Hao Wu
> 
> >} else {
> >  return IoRead8 (Base + Offset * PcdGet32
> > (PcdSerialRegisterStride)); @@ -104,6 +109,11 @@ SerialPortWriteRegister
> (
> >)
> >  {
> >if (PcdGetBool (PcdSerialUseMmio)) {
> > +if (PcdGet8 (PcdSerialRegisterAccessWidth) == 8) {
> > +  return MmioWrite8 (Base + Offset * PcdGet32
> > + (PcdSerialRegisterStride),
> > Value);
>

[edk2-devel] [PATCH v5 1/1] MdeModulePkg: BaseSerialPortLib16550: Add Mmio32 support

2019-04-26 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Some busses doesn't allow 8 bit MMIO read/write, this adds support for
32 bits read/write

Signed-off-by: "Tien Hock, Loh" 
Cc: Jian J Wang 
Cc: Hao Wu 

---
v5
- Updates function header comments
- Change the implementation to eliminate unnecessary else clause
v4
- Updates Pcd name to a better name: PcdSerialRegisterAccessWidth
v3
- Updates the Pcd to be UINT8 to allow more options such as 16 bits access
in the future
- Updated copyright date
v2
- Updates the Pcd name to PcdSerialMmio32BitAccess and access 32 bits
register if PcdSerialUseMmio and PcdSerialMmio32BitAccess is set
---
 .../BaseSerialPortLib16550/BaseSerialPortLib16550.c| 14 +++---
 .../BaseSerialPortLib16550/BaseSerialPortLib16550.inf  |  3 ++-
 MdeModulePkg/MdeModulePkg.dec  |  7 +++
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git 
a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c 
b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
index 34df34d..bbae379 100644
--- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
+++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
@@ -2,7 +2,7 @@
   16550 UART Serial Port library functions
 
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
   Copyright (c) 2018, AMD Incorporated. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -62,7 +62,8 @@ typedef struct {
   Read an 8-bit 16550 register.  If PcdSerialUseMmio is TRUE, then the value 
is read from
   MMIO space.  If PcdSerialUseMmio is FALSE, then the value is read from I/O 
space.  The
   parameter Offset is added to the base address of the 16550 registers that is 
specified
-  by PcdSerialRegisterBase.
+  by PcdSerialRegisterBase. PcdSerialRegisterAccessWidth specifies the MMIO 
space access
+  width and defaults to 8 bit access, and supports 8 or 32 bit access.
 
   @param  BaseThe base address register of UART device.
   @param  Offset  The offset of the 16550 register to read.
@@ -77,6 +78,9 @@ SerialPortReadRegister (
   )
 {
   if (PcdGetBool (PcdSerialUseMmio)) {
+if (PcdGet8 (PcdSerialRegisterAccessWidth) == 32) {
+  return (UINT8) MmioRead32 (Base + Offset * PcdGet32 
(PcdSerialRegisterStride));
+}
 return MmioRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride));
   } else {
 return IoRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride));
@@ -87,7 +91,8 @@ SerialPortReadRegister (
   Write an 8-bit 16550 register.  If PcdSerialUseMmio is TRUE, then the value 
is written to
   MMIO space.  If PcdSerialUseMmio is FALSE, then the value is written to I/O 
space.  The
   parameter Offset is added to the base address of the 16550 registers that is 
specified
-  by PcdSerialRegisterBase.
+  by PcdSerialRegisterBase. PcdSerialRegisterAccessWidth specifies the MMIO 
space access
+  width and defaults to 8 bit access, and supports 8 or 32 bit access.
 
   @param  BaseThe base address register of UART device.
   @param  Offset  The offset of the 16550 register to write.
@@ -104,6 +109,9 @@ SerialPortWriteRegister (
   )
 {
   if (PcdGetBool (PcdSerialUseMmio)) {
+if (PcdGet8 (PcdSerialRegisterAccessWidth) == 32) {
+  return (UINT8) MmioWrite32 (Base + Offset * PcdGet32 
(PcdSerialRegisterStride), (UINT8)Value);
+}
 return MmioWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride), 
Value);
   } else {
 return IoWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride), 
Value);
diff --git 
a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf 
b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
index b60779c..8b4ae3f 100644
--- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
+++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
@@ -1,7 +1,7 @@
 ## @file
 #  SerialPortLib instance for 16550 UART.
 #
-#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -29,6 +29,7 @@
   BaseSerialPortLib16550.c
 
 [Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth ## 
SOMETIMES_CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl  ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable ## 
SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index be84916..2ef48f2 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1170,6 +1170,13 @@
   # @Prompt Serial port registers use MMIO.
   

[edk2-devel] [[edk2-platforms] PATCH v3 1/1] Platform/Intel/Stratix10: Add Stratix 10 platform support

2019-05-01 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Adds support for Intel Stratix 10 Platform.

Signed-off-by: "Tien Hock, Loh" 
#Cc: Ard Biesheuvel 
#Cc: Leif Lindholm 
#Cc: Michael D Kinney 

--
v3
- Updated Pcd with updated name
v2
- Updates ShellBinPkg with ShellPkg
---
 .../Drivers/IntelPlatformDxe/IntelPlatformDxe.c|  43 ++
 .../Drivers/IntelPlatformDxe/IntelPlatformDxe.inf  |  49 ++
 .../IntelPlatformLib/AArch64/ArmPlatformHelper.S   |  51 ++
 .../IntelPlatformLib/Arm/ArmPlatformHelper.S   |  63 +++
 .../IntelPlatformLib/Arm/ArmPlatformHelper.asm |  72 +++
 .../Library/IntelPlatformLib/IntelPlatformLib.inf  |  53 ++
 .../Library/IntelPlatformLib/Stratix10Mmu.c| 155 ++
 .../IntelPlatformLib/Stratix10PlatformLib.c| 167 +++
 Platform/Intel/Stratix10/Readme.md |  61 +++
 Platform/Intel/Stratix10/ShellScript/startup.nsh   |   2 +
 Platform/Intel/Stratix10/Stratix10SoCPkg.dec   |  30 ++
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc   | 547 +
 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf   | 270 ++
 13 files changed, 1563 insertions(+)
 create mode 100644 
Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
 create mode 100644 
Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
 create mode 100644 
Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S
 create mode 100644 
Platform/Intel/Stratix10/Library/IntelPlatformLib/Arm/ArmPlatformHelper.S
 create mode 100644 
Platform/Intel/Stratix10/Library/IntelPlatformLib/Arm/ArmPlatformHelper.asm
 create mode 100644 
Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
 create mode 100644 
Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c
 create mode 100644 
Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c
 create mode 100644 Platform/Intel/Stratix10/Readme.md
 create mode 100644 Platform/Intel/Stratix10/ShellScript/startup.nsh
 create mode 100755 Platform/Intel/Stratix10/Stratix10SoCPkg.dec
 create mode 100755 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
 create mode 100755 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf

diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
new file mode 100644
index ..144b4c54ef55
--- /dev/null
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
@@ -0,0 +1,43 @@
+/** @file
+*
+*  Copyright (c) 2019, Intel All rights reserved.
+*
+*  This program and the accompanying materials
+*  are licensed and made available under the terms and conditions of the BSD 
License
+*  which accompanies this distribution.  The full text of the license may be 
found at
+*  http://opensource.org/licenses/bsd-license.php
+*
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+*
+**/
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+EFI_STATUS
+EFIAPI
+IntelPlatformDxeEntryPoint (
+  IN EFI_HANDLE ImageHandle,
+  IN EFI_SYSTEM_TABLE   *SystemTable
+  )
+{
+  EFI_STATUSStatus = 0;
+
+  return Status;
+}
+
diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
new file mode 100644
index ..c3c0d7242082
--- /dev/null
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
@@ -0,0 +1,49 @@
+#/** @file
+#
+#  Copyright (c) 2019, Intel All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+#**/
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = IntelPlatformDxe
+  FILE_GUID  = AB87E291-1689-4c7b-B613-FB54A0E38CEA
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= IntelPlatformDxeEntryPoint
+
+[Sources.common]
+  IntelPlatformDxe.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  MdePkg/MdePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+
+[LibraryClasses]
+  ArmLib
+  BaseMemoryLib
+  DebugLib
+  DxeServicesTableLib
+  PcdLib
+  PrintLib
+  SerialPortLib
+  UefiBootServicesTableLib
+  UefiRuntimeServicesTableLib
+  UefiLib
+  UefiDriverEntryPoint
+
+
+[Depex]
+  # We depend on these protocols to create the default 

Re: [edk2-devel] [[edk2-platforms] PATCH v3 1/1] Platform/Intel/Stratix10: Add Stratix 10 platform support

2019-05-01 Thread Loh, Tien Hock
Please ignore this patch, something went wrong with the my mail server config.
See https://edk2.groups.io/g/devel/message/39897 for the actual patch

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

View/Reply Online (#39898): https://edk2.groups.io/g/devel/message/39898
Mute This Topic: https://groups.io/mt/31451557/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/1] EmbeddedPkg: Fix DwEmmc driver bugs

2019-05-01 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

This fixes some issues with DwEmmc when using with SDMMC card:
- clear CTYPE when controller initializes
- change SendCommand polling mode to remove unnecessary delay
- Add CMD6 support for SD support
- For pending read/write command, send when DwEmmcReceiveResponse is called
  so that we can properly error check the response
- Fix bug on reading block size less than DWEMMC_BLOCK_SIZE
- Wait for DwEmmcReadBlockData and DwEmmacWriteBlockData to complete
  before returning the function

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c| 108 +++
 EmbeddedPkg/Include/Protocol/MmcHost.h   |   1 +
 EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c |   2 +
 3 files changed, 92 insertions(+), 19 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 68c523a..92b5176 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -39,6 +39,7 @@ DWEMMC_IDMAC_DESCRIPTOR   *gpIdmacDesc;
 EFI_GUID mDwEmmcDevicePathGuid = EFI_CALLER_ID_GUID;
 STATIC UINT32 mDwEmmcCommand;
 STATIC UINT32 mDwEmmcArgument;
+STATIC BOOLEAN mIsACmd = FALSE;
 
 EFI_STATUS
 DwEmmcReadBlockData (
@@ -205,6 +206,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 {
@@ -284,17 +286,15 @@ SendCommand (
   ErrMask = DWEMMC_INT_EBE | DWEMMC_INT_HLE | DWEMMC_INT_RTO |
 DWEMMC_INT_RCRC | DWEMMC_INT_RE;
   ErrMask |= DWEMMC_INT_DCRC | DWEMMC_INT_DRT | DWEMMC_INT_SBE;
+
   do {
-MicroSecondDelay(500);
 Data = MmioRead32 (DWEMMC_RINTSTS);
-
-if (Data & ErrMask) {
-  return EFI_DEVICE_ERROR;
-}
-if (Data & DWEMMC_INT_DTO) { // Transfer Done
-  break;
-}
   } while (!(Data & DWEMMC_INT_CMD_DONE));
+
+  if (Data & ErrMask) {
+return EFI_DEVICE_ERROR;
+  }
+
   return EFI_SUCCESS;
 }
 
@@ -323,6 +323,15 @@ DwEmmcSendCommand (
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
BIT_CMD_SEND_INIT;
 break;
+  case MMC_INDX(6):
+if(mIsACmd) {
+  Cmd = BIT_CMD_RESPONSE_EXPECT ;
+}
+else {
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED |
+BIT_CMD_READ;
+}
+break;
   case MMC_INDX(7):
 if (Argument)
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
@@ -330,9 +339,12 @@ DwEmmcSendCommand (
 Cmd = 0;
 break;
   case MMC_INDX(8):
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
-   BIT_CMD_DATA_EXPECTED | BIT_CMD_READ |
-   BIT_CMD_WAIT_PRVDATA_COMPLETE;
+if (!This->IsEmmc)
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
+ BIT_CMD_WAIT_PRVDATA_COMPLETE ;
+else
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
+ BIT_CMD_WAIT_PRVDATA_COMPLETE | BIT_CMD_READ | 
BIT_CMD_DATA_EXPECTED;
 break;
   case MMC_INDX(9):
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
@@ -364,21 +376,38 @@ DwEmmcSendCommand (
BIT_CMD_WAIT_PRVDATA_COMPLETE;
 break;
   case MMC_INDX(30):
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
+Cmd = BIT_CMD_RESPONSE_EXPECT  |
BIT_CMD_DATA_EXPECTED;
 break;
+  case MMC_INDX(51):
+Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED |
+   BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
+break;
   default:
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
+Cmd = BIT_CMD_RESPONSE_EXPECT;
 break;
   }
 
   Cmd |= MMC_GET_INDX(MmcCmd) | BIT_CMD_USE_HOLD_REG | BIT_CMD_START;
+
+  if(MMC_INDX(55) == MMC_GET_INDX(MmcCmd))
+mIsACmd = TRUE;
+  else
+mIsACmd = FALSE;
+
+  if (!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) {
+Cmd |= BIT_CMD_CHECK_RESPONSE_CRC;
+  }
+
   if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
 mDwEmmcCommand = Cmd;
 mDwEmmcArgument = Argument;
   } else {
+mDwEmmcCommand = Cmd;
+mDwEmmcArgument = Argument;
 Status = SendCommand (Cmd, Argument);
   }
+
   return Status;
 }
 
@@ -389,6 +418,11 @@ DwEmmcReceiveResponse (
   IN UINT32*Buffer
   )
 {
+  EFI_STATUS Status = EFI_SUCCESS;
+
+  if(IsPendingReadCommand (mDwEmmcCommand) || 
IsPendingWriteCommand(mDwEmmcCommand))
+Status = SendCommand (mDwEmmcCommand, mDwEmmcArgument);
+
   if (Buffer == NULL) {
 return EFI_INVALID_PARAMETER;
   }
@@ -406,7 +440,7 @@ DwEmmcReceiveResponse (
 Buffer[2] = MmioRead32 (DWEMMC_RESP2);
 Buffer[3] = MmioRead32 (DWEMMC_RESP3);
   }
-  return EFI_SUCCESS;
+  return Status;
 }
 
 VOID
@@ -461,7 +495,10 @@ PrepareDmaData (
 
   Cnt = (Length + DWEMMC_DMA_BUF_SIZE - 1) / 

[edk2-devel] [[PATCH v2] 0/7] Fix DwEmmc driver bugs

2019-05-02 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

This fixes a few issues with DwEmmc driver:
- - Change SendCommand polling mode and check for DTO when read/write
  - Add CMD6 for SD support
  - Clear CTYPE on initialization
  - Add CMD8 support for SD
  - Add ACMD51 for SD
  - Call send command when receive response is called
  - Add check CRC response only when MMC command supports it
  - Add support for reading data less than DWEMMC_BLOCK_SIZE

Tien Hock, Loh (7):
  EmbeddedPkg: Fix DwEmmc driver bugs
  EmbeddedPkg: Fix DwEmmc driver bugs
  EmbeddedPkg: Fix DwEmmc driver bugs
  EmbeddedPkg: Fix DwEmmc driver bugs
  EmbeddedPkg: Fix DwEmmc driver bugs
  EmbeddedPkg: Fix DwEmmc driver bugs
  EmbeddedPkg: Fix DwEmmc driver bugs

 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c| 62 +---
 EmbeddedPkg/Include/Protocol/MmcHost.h   |  1 +
 EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c |  2 +
 3 files changed, 57 insertions(+), 8 deletions(-)

-- 
2.2.2


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

View/Reply Online (#39934): https://edk2.groups.io/g/devel/message/39934
Mute This Topic: https://groups.io/mt/31480076/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [[PATCH v2] 2/7] EmbeddedPkg: Fix DwEmmc driver bugs

2019-05-02 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

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" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 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 fa24802..058665b 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -206,6 +206,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.2.2


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

View/Reply Online (#39936): https://edk2.groups.io/g/devel/message/39936
Mute This Topic: https://groups.io/mt/31480078/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [[PATCH v2] 4/7] EmbeddedPkg: Fix DwEmmc driver bugs

2019-05-02 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Add ACMD51 support for SD, this is needed to do SEND_SCR command correctly

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 04fdcbf..32572a9 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -379,6 +379,10 @@ DwEmmcSendCommand (
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
BIT_CMD_DATA_EXPECTED;
 break;
+  case MMC_INDX(51):
+Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED |
+   BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
+break;
   default:
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
 break;
-- 
2.2.2


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

View/Reply Online (#39938): https://edk2.groups.io/g/devel/message/39938
Mute This Topic: https://groups.io/mt/31480080/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [[PATCH v2] 6/7] EmbeddedPkg: Fix DwEmmc driver bugs

2019-05-02 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Do not send CRC response check if the MMC command does not support CRC
response

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index a69d9ab..c38b5a4 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -384,7 +384,7 @@ DwEmmcSendCommand (
BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
 break;
   default:
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
+Cmd = BIT_CMD_RESPONSE_EXPECT;
 break;
   }
 
@@ -394,6 +394,11 @@ DwEmmcSendCommand (
 mIsACmd = TRUE;
   else
 mIsACmd = FALSE;
+
+  if (!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) {
+Cmd |= BIT_CMD_CHECK_RESPONSE_CRC;
+  }
+
   if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
 mDwEmmcCommand = Cmd;
 mDwEmmcArgument = Argument;
-- 
2.2.2


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

View/Reply Online (#39940): https://edk2.groups.io/g/devel/message/39940
Mute This Topic: https://groups.io/mt/31480082/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [[PATCH v2] 7/7] EmbeddedPkg: Fix DwEmmc driver bugs

2019-05-02 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Add support for reading data that is less than DWEMMC_BLOCK_SIZE, otherwise
it would read bigger data than requested and cause errors

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index c38b5a4..4183ad4 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -495,7 +495,10 @@ PrepareDmaData (
 
   Cnt = (Length + DWEMMC_DMA_BUF_SIZE - 1) / DWEMMC_DMA_BUF_SIZE;
   Blks = (Length + DWEMMC_BLOCK_SIZE - 1) / DWEMMC_BLOCK_SIZE;
-  Length = DWEMMC_BLOCK_SIZE * Blks;
+
+  if(Length >= DWEMMC_BLOCK_SIZE) {
+Length = DWEMMC_BLOCK_SIZE * Blks;
+  }
 
   for (Idx = 0; Idx < Cnt; Idx++) {
 (IdmacDesc + Idx)->Des0 = DWEMMC_IDMAC_DES0_OWN | DWEMMC_IDMAC_DES0_CH |
@@ -533,11 +536,18 @@ StartDma (
   Data |= DWEMMC_CTRL_INT_EN | DWEMMC_CTRL_DMA_EN | DWEMMC_CTRL_IDMAC_EN;
   MmioWrite32 (DWEMMC_CTRL, Data);
   Data = MmioRead32 (DWEMMC_BMOD);
+
   Data |= DWEMMC_IDMAC_ENABLE | DWEMMC_IDMAC_FB;
   MmioWrite32 (DWEMMC_BMOD, Data);
 
-  MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
-  MmioWrite32 (DWEMMC_BYTCNT, Length);
+  if(Length < DWEMMC_BLOCK_SIZE) {
+MmioWrite32 (DWEMMC_BLKSIZ, Length);
+MmioWrite32 (DWEMMC_BYTCNT, Length);
+  }
+  else {
+MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
+MmioWrite32 (DWEMMC_BYTCNT, Length);
+  }
 }
 
 EFI_STATUS
-- 
2.2.2


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

View/Reply Online (#39941): https://edk2.groups.io/g/devel/message/39941
Mute This Topic: https://groups.io/mt/31480083/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [[PATCH v2] 3/7] EmbeddedPkg: Fix DwEmmc driver bugs

2019-05-02 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

On CMD8, for SD, the controller should not expect data as this is a
SEND_IF_COND command to verify SD operating condition, and does not have
data

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c| 9 ++---
 EmbeddedPkg/Include/Protocol/MmcHost.h   | 1 +
 EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 2 ++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 058665b..04fdcbf 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -339,9 +339,12 @@ DwEmmcSendCommand (
 Cmd = 0;
 break;
   case MMC_INDX(8):
-Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
-   BIT_CMD_DATA_EXPECTED | BIT_CMD_READ |
-   BIT_CMD_WAIT_PRVDATA_COMPLETE;
+if (!This->IsEmmc)
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
+ BIT_CMD_WAIT_PRVDATA_COMPLETE ;
+else
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
+ BIT_CMD_WAIT_PRVDATA_COMPLETE | BIT_CMD_READ | 
BIT_CMD_DATA_EXPECTED;
 break;
   case MMC_INDX(9):
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
diff --git a/EmbeddedPkg/Include/Protocol/MmcHost.h 
b/EmbeddedPkg/Include/Protocol/MmcHost.h
index 9e07082..ae8ea5d 100644
--- a/EmbeddedPkg/Include/Protocol/MmcHost.h
+++ b/EmbeddedPkg/Include/Protocol/MmcHost.h
@@ -169,6 +169,7 @@ struct _EFI_MMC_HOST_PROTOCOL {
   MMC_SETIOS  SetIos;
   MMC_ISMULTIBLOCKIsMultiBlock;
 
+  BOOLEAN IsEmmc;
 };
 
 #define MMC_HOST_PROTOCOL_REVISION0x00010002// 1.2
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c 
b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
index 4dc0be1..fa1eda2 100755
--- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
@@ -770,8 +770,10 @@ InitializeMmcDevice (
   }
 
   if (MmcHostInstance->CardInfo.CardType != EMMC_CARD) {
+MmcHostInstance->MmcHost->IsEmmc = FALSE;
 Status = InitializeSdMmcDevice (MmcHostInstance);
   } else {
+MmcHostInstance->MmcHost->IsEmmc = TRUE;
 Status = InitializeEmmcDevice (MmcHostInstance);
   }
   if (EFI_ERROR (Status)) {
-- 
2.2.2


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

View/Reply Online (#39937): https://edk2.groups.io/g/devel/message/39937
Mute This Topic: https://groups.io/mt/31480079/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/1] MdeModulePkg: BaseSerialPortLib16550: Update Mmio32 to UNI

2019-05-07 Thread Loh, Tien Hock
From: "tien.hock.loh" 

Some busses doesn't allow 8 bit MMIO read/write, this adds support for
32 bits read/write. This patch adds the UNI information on the new
Pcd introduced - PcdSerialRegisterAccessWidth

Signed-off-by: "Tien Hock, Loh" 
Cc: Jian J Wang 
Cc: Hao Wu 
Cc: "Zhu, YongHong" 

Signed-off-by: tien.hock.loh 
---
 MdeModulePkg/MdeModulePkg.uni | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index cf2aefa7ad..654dfeadb0 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -160,6 +160,12 @@

   "TRUE  - 16550 serial port registers are in MMIO space.\n"

   "FALSE - 16550 serial port registers are in I/O space."
 
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterAccessWidth_PROMPT 
 #language en-US "Serial port registers access width"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterAccessWidth_HELP  
#language en-US "Sets the 16550 serial port registers access width in MMIO 
space. Default is 8 bits access.\n"
+   
   "8  - 16550 serial port MMIO register access are in 8 bits mode.\n"
+   
   "32 - 16550 serial port MMIO registers acess are in 32 bits mode.."
+
 #string 
STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialUseHardwareFlowControl_PROMPT  
#language en-US "Enable serial port hardware flow control"
 
 #string 
STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialUseHardwareFlowControl_HELP  
#language en-US "Indicates if the 16550 serial port hardware flow control will 
be enabled. Default is FALSE.\n"
-- 
2.13.0


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

View/Reply Online (#40104): https://edk2.groups.io/g/devel/message/40104
Mute This Topic: https://groups.io/mt/31530534/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/1] EmbeddedPkg: Add SD command support for DwEmmc

2019-05-08 Thread Loh, Tien Hock
From: "TIen Hock, Loh" 

Added ACMD6 for SD support. For SD, after CMD55 is sent, the next
command should be an application command, which should not expect
data

Signed-off-by: "Tien Hock, Loh" 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 

--
v2:
- Move IsACmd as a local static variable in function
- Fix some coding standard issue with spacing
---
 EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c 
b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index 68c523a99f..420487757d 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -307,6 +307,7 @@ DwEmmcSendCommand (
 {
   UINT32   Cmd = 0;
   EFI_STATUS   Status = EFI_SUCCESS;
+  STATIC BOOLEAN IsACmd = FALSE;
 
   switch (MMC_GET_INDX(MmcCmd)) {
   case MMC_INDX(0):
@@ -323,6 +324,15 @@ DwEmmcSendCommand (
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
BIT_CMD_SEND_INIT;
 break;
+  case MMC_INDX (6):
+if(IsACmd) {
+  Cmd = BIT_CMD_RESPONSE_EXPECT;
+}
+else {
+  Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED |
+BIT_CMD_READ;
+}
+break;
   case MMC_INDX(7):
 if (Argument)
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
@@ -367,12 +377,22 @@ DwEmmcSendCommand (
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC |
BIT_CMD_DATA_EXPECTED;
 break;
+  case MMC_INDX (51):
+Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED |
+   BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE;
+break;
   default:
 Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC;
 break;
   }
 
   Cmd |= MMC_GET_INDX(MmcCmd) | BIT_CMD_USE_HOLD_REG | BIT_CMD_START;
+
+  if(MMC_INDX (55) == MMC_GET_INDX (MmcCmd))
+IsACmd = TRUE;
+  else
+IsACmd = FALSE;
+
   if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) {
 mDwEmmcCommand = Cmd;
 mDwEmmcArgument = Argument;
-- 
2.19.0


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

View/Reply Online (#40198): https://edk2.groups.io/g/devel/message/40198
Mute This Topic: https://groups.io/mt/31542143/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [[PATCH v2] 7/7] EmbeddedPkg: Fix DwEmmc driver bugs

2019-05-09 Thread Loh, Tien Hock
> -Original Message-
> From: Leif Lindholm 
> Sent: Friday, May 3, 2019 8:19 PM
> To: Loh, Tien Hock 
> Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> 
> Subject: Re: [[PATCH v2] 7/7] EmbeddedPkg: Fix DwEmmc driver bugs
> 
> On Fri, May 03, 2019 at 11:27:03AM +0800, tien.hock@intel.com wrote:
> > From: "Tien Hock, Loh" 
> >
> > Add support for reading data that is less than DWEMMC_BLOCK_SIZE,
> > otherwise it would read bigger data than requested and cause errors
> >
> > Signed-off-by: "Tien Hock, Loh" 
> > Cc: Leif Lindholm 
> > Cc: Ard Biesheuvel 
> > ---
> >  EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 16
> +---
> >  1 file changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > index c38b5a4..4183ad4 100644
> > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
> > @@ -495,7 +495,10 @@ PrepareDmaData (
> >
> >Cnt = (Length + DWEMMC_DMA_BUF_SIZE - 1) /
> DWEMMC_DMA_BUF_SIZE;
> >Blks = (Length + DWEMMC_BLOCK_SIZE - 1) / DWEMMC_BLOCK_SIZE;
> 
> Could we add a BlockSize variable instead?...

Can you clarify further on this? I didn't change anything on DWEMMC_BLOCK_SIZE. 
Do you want me to assign DWEMMC_BLOCK_SIZE to a BlockSize variable and use it? 

> 
> > -  Length = DWEMMC_BLOCK_SIZE * Blks;
> > +
> > +  if(Length >= DWEMMC_BLOCK_SIZE) {
> > +Length = DWEMMC_BLOCK_SIZE * Blks;  }
> >
> >for (Idx = 0; Idx < Cnt; Idx++) {
> >  (IdmacDesc + Idx)->Des0 = DWEMMC_IDMAC_DES0_OWN |
> > DWEMMC_IDMAC_DES0_CH | @@ -533,11 +536,18 @@ StartDma (
> >Data |= DWEMMC_CTRL_INT_EN | DWEMMC_CTRL_DMA_EN |
> DWEMMC_CTRL_IDMAC_EN;
> >MmioWrite32 (DWEMMC_CTRL, Data);
> >Data = MmioRead32 (DWEMMC_BMOD);
> > +
> 
> Drop unrelated whitespace addition.
OK noted.

> 
> >Data |= DWEMMC_IDMAC_ENABLE | DWEMMC_IDMAC_FB;
> >MmioWrite32 (DWEMMC_BMOD, Data);
> >
> 
> And do
>   if (Length < DWEMMC_BLOCK_SIZE) {
> BlockSize = Length;
>   } else {
> BlockSize = DWEMMC_BLOCK_SIZE;
>   }
> 
>   MmioWrite32 (DWEMMC_BLKSIZ, BlockSize);
>   MmioWrite32 (DWEMMC_BYTCNT, Length);
> instead?
> 
> (I have no comments on the patches I have not responded to at this point,
> but I want to see their proper subject lines before giving a R-b:)
OK, noted with thanks!
> 
> /
> Leif
> 
> > -  MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
> > -  MmioWrite32 (DWEMMC_BYTCNT, Length);
> > +  if(Length < DWEMMC_BLOCK_SIZE) {
> > +MmioWrite32 (DWEMMC_BLKSIZ, Length);
> > +MmioWrite32 (DWEMMC_BYTCNT, Length);  }  else {
> > +MmioWrite32 (DWEMMC_BLKSIZ, DWEMMC_BLOCK_SIZE);
> > +MmioWrite32 (DWEMMC_BYTCNT, Length);  }
> >  }
> >
> >  EFI_STATUS
> > --
> > 2.2.2
> >

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

View/Reply Online (#40284): https://edk2.groups.io/g/devel/message/40284
Mute This Topic: https://groups.io/mt/31480083/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand polling

2019-07-11 Thread Loh, Tien Hock
Leif,
Some comments inlined.

> -Original Message-
> From: Loh, Tien Hock
> Sent: Tuesday, June 11, 2019 5:12 PM
> To: Leif Lindholm 
> Cc: 'Haojian Zhuang' ; 'devel@edk2.groups.io'
> ; 'thlo...@gmail.com' ; 'Ard
> Biesheuvel' 
> Subject: RE: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> polling
> 
> > -Original Message-
> > From: Leif Lindholm 
> > Sent: Tuesday, June 11, 2019 5:09 PM
> > To: Loh, Tien Hock 
> > Cc: 'Haojian Zhuang' ; 'devel@edk2.groups.io'
> > ; 'thlo...@gmail.com' ;
> 'Ard
> > Biesheuvel' 
> > Subject: Re: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> > polling
> >
> > On Tue, Jun 11, 2019 at 02:40:51AM +, Loh, Tien Hock wrote:
> > > Leif,
> > >
> > > Since Haojian have a newer driver model that uses the
> > > NonDiscoverableDeviceDxe, I believe we should be moving to use the
> > > new driver.
> > >
> > > I'll try to test out the patches submitted by Haojian in the mean time.
> > > Can you help review the patch? Thanks!
> >
> > I can have another look at the patch, but I would really appreciate if
> > you could also review it please?
> >
> > My problem is that I really don't have much understanding of SD/MMC
> > protocols.
> 
> Sure. I'll test it out on the SoCFPGA platform first. It is quite a long 
> patch, so I
> might take a bit of time to review.
> Thanks Leif!

I've reviewed and tested the driver. For SD portion the patch works correctly 
on the SoCFPGA platform. How should I ACK the patch?

> 
> >
> > /
> > Leif
> >
> > > > -Original Message-
> > > > From: Loh, Tien Hock
> > > > Sent: Thursday, May 30, 2019 3:56 PM
> > > > To: Haojian Zhuang ; Leif Lindholm
> > > > 
> > > > Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> > > > 
> > > > Subject: RE: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc SendCommand
> > > > polling
> > > >
> > > > > -Original Message-
> > > > > From: Haojian Zhuang 
> > > > > Sent: Thursday, May 30, 2019 3:06 PM
> > > > > To: Leif Lindholm 
> > > > > Cc: Loh, Tien Hock ;
> > > > > devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> > > > > 
> > > > > Subject: Re: [PATCH v2 6/7] EmbeddedPkg: Fix DwEmmc
> SendCommand
> > > > > polling
> > > > >
> > > > > On Tue, May 28, 2019 at 07:04:09PM +0100, Leif Lindholm wrote:
> > > > > > +Haojian,
> > > > > >
> > > > > > Haojian - since you are the original author, can you comment
> > > > > > on the delays? Are these silicon bug workarounds (so we need
> > > > > > to add a Pcd), or does these changes work on your platforms too?
> > > > >
> > > > > I'm not in the loop, so I missed the patch series.
> > > > >
> > > > > The patch series can't work on my platform for the eMMC.
> > > > > Although a variable is created to identify whether it's a SD or
> > > > > eMMC device, it doesn't identify the eMMC device by the right
> > > > > way. So the eMMC device isn't initialized successfully on my platform.
> > > > >
> > > > > 1. Since MMC framework could identify whether it's eMMC device
> > > > > or SD device, we need to make device driver gets this kind of
> > > > > information from the MMC framework. And we need to support
> > > > > multiple eMMC/SD instances in MMC framework.
> > > >
> > > > Yeah my bad I didn't read through the SD/MMC specs on that. Now I
> > > > check the specs and you're right, the information should be read
> > > > from MMC framework.
> > > >
> > > > >
> > > > > 2. I sent a patch series to support both eMMC device and SD
> > > > > device
> > before.
> > > > > https://edk2.groups.io/g/devel/message/28572
> > > > > &&
> > > > > https://edk2.groups.io/g/devel/message/28615
> > > > > Maybe it's missed. Could you help to review that patch series?
> > >
> > > Leif, can you help review the patch series? Since Haojian have moved
> > > the
> > driver to NonDiscoverableDeviceDxe, I think that would be a more
> > appropriate driver to be used going forward. Thanks!
> > >
> > > >
> > > > >
> 

[edk2-devel] [[edk2-platforms]PATCH v5 1/1] Platform: Intel: Add Stratix 10 platform support

2019-07-16 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Adds support for Intel Stratix 10 Platform.

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c  
|  43 ++
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
|  48 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S 
|  51 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
|  49 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c  
| 155 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c  
| 153 ++
 Platform/Intel/Stratix10/Readme.md
|  61 +++
 Platform/Intel/Stratix10/Stratix10SoCPkg.dec  
|  22 +
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc  
| 500 
 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf  
| 253 ++
 Readme.md 
|   3 +
 11 files changed, 1338 insertions(+)

diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
new file mode 100644
index ..144b4c54ef55
--- /dev/null
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
@@ -0,0 +1,43 @@
+/** @file
+*
+*  Copyright (c) 2019, Intel All rights reserved.
+*
+*  This program and the accompanying materials
+*  are licensed and made available under the terms and conditions of the BSD 
License
+*  which accompanies this distribution.  The full text of the license may be 
found at
+*  http://opensource.org/licenses/bsd-license.php
+*
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+*
+**/
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+EFI_STATUS
+EFIAPI
+IntelPlatformDxeEntryPoint (
+  IN EFI_HANDLE ImageHandle,
+  IN EFI_SYSTEM_TABLE   *SystemTable
+  )
+{
+  EFI_STATUSStatus = 0;
+
+  return Status;
+}
+
diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
new file mode 100644
index ..64b398969f1e
--- /dev/null
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
@@ -0,0 +1,48 @@
+#/** @file
+#
+#  Copyright (c) 2019, Intel All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+#**/
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = IntelPlatformDxe
+  FILE_GUID  = AB87E291-1689-4c7b-B613-FB54A0E38CEA
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= IntelPlatformDxeEntryPoint
+
+[Sources.common]
+  IntelPlatformDxe.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  ArmLib
+  BaseMemoryLib
+  DebugLib
+  DxeServicesTableLib
+  PcdLib
+  PrintLib
+  SerialPortLib
+  UefiBootServicesTableLib
+  UefiRuntimeServicesTableLib
+  UefiLib
+  UefiDriverEntryPoint
+
+[Depex]
+  # We depend on these protocols to create the default boot entries
+  gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid
diff --git 
a/Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S 
b/Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S
new file mode 100644
index ..2f4cf95cbf13
--- /dev/null
+++ 
b/Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S
@@ -0,0 +1,51 @@
+//
+//  Copyright (c) 2012-2013, ARM Limited. All rights reserved.
+//
+//  This program and the accompanying materials
+//  are licensed and made available under the terms and conditions of the BSD 
License
+//  which accompanies this distribution.  The full text of the license may be 
found at
+//  http://opensource.org/licenses/bsd-license.php
+//
+//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, 

Re: [edk2-devel] [PATCH v2 0/3] add DwMmcHcDxe driver

2019-08-15 Thread Loh, Tien Hock
Hi Leif, Ard, Christopher,

Haojian and I have tested the driver on 2 platforms, any further comments on 
this?

Thanks
Tien Hock

> -Original Message-
> From: Haojian Zhuang 
> Sent: Tuesday, July 30, 2019 3:33 PM
> To: Loh, Tien Hock ; leif.lindh...@linaro.org;
> ard.biesheu...@linaro.org; christopher...@microsoft.com
> Cc: devel@edk2.groups.io; thlo...@gmail.com
> Subject: Re: [PATCH v2 0/3] add DwMmcHcDxe driver
> 
> On Wed, Jul 24, 2019 at 05:26:03PM +0800, tien.hock@intel.com wrote:
> > From: "Tien Hock, Loh" 
> >
> > Changelog:
> > v3:
> >   * Fix an issue in NonDiscoverableDeviceDxe driver where it did not
> invalidate
> > cache before copying the memory.
> > v2:
> >   *Split DwMmcHcDxe driver into two patches. One is for PlatformDwMmc
> protocol,
> >and the other is for DwMmcHcDxe driver.
> > v1:
> >   *Add NonDiscoverableDeviceDxe for embedded platform. Make
> DwMmcHcDxe driver
> >to support both eMMC and SD controller.
> >
> > Haojian Zhuang (3):
> >   EmbeddedPkg: add NonDiscoverableDeviceDxe driver
> >   EmbeddedPkg: add PlatformDwMmc protocol
> >   EmbeddedPkg/Drivers: add DwMmcHcDxe driver
> >
> >  .../Drivers/DwMmcHcDxe/ComponentName.c|  214 ++
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c   | 1295
> +
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec |   40 +
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h   |  815 ++
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf |   69 +
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c | 2366
> +
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h |  983 +++
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c   | 1042 
> >  EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c | 1104 
> >  EmbeddedPkg/EmbeddedPkg.dec   |1 +
> >  EmbeddedPkg/Include/Protocol/PlatformDwMmc.h  |   79 +
> >  .../NonDiscoverableDeviceDxe/ComponentName.c  |  124 +
> >  .../NonDiscoverableDeviceDxe.c|  243 ++
> >  .../NonDiscoverableDeviceDxe.inf  |   52 +
> >  .../NonDiscoverableDeviceIo.c |  976 +++
> >  .../NonDiscoverableDeviceIo.h |   92 +
> >  16 files changed, 9495 insertions(+)
> >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c
> >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c
> >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec
> >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h
> >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf
> >  create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c
> >  create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h
> >  create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c
> >  create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c
> >  create mode 100644 EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
> >  create mode 100644
> > EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/ComponentName.c
> >  create mode 100644
> >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> eDx
> > e.c  create mode 100644
> >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> eDx
> > e.inf  create mode 100644
> >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> eIo
> > .c  create mode 100644
> >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> eIo
> > .h
> >
> > --
> > 2.19.0
> >
> 
> Hi Leif, Ard & Chris,
> 
> Could you help to share your comments on this patch set?
> 
> Best Regards
> Haojian

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

View/Reply Online (#45708): https://edk2.groups.io/g/devel/message/45708
Mute This Topic: https://groups.io/mt/32582252/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support

2019-08-12 Thread Loh, Tien Hock
Hi Leif,

I'll update it and send another patch on top of the previously reviewed patch.

Thanks! 

> -Original Message-
> From: Leif Lindholm 
> Sent: Friday, August 9, 2019 6:16 PM
> To: Loh, Tien Hock 
> Cc: Kinney, Michael D ; devel@edk2.groups.io;
> thlo...@gmail.com; Ard Biesheuvel 
> Subject: Re: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support
> 
> Hi Tien Hock,
> 
> Given Mike's review, could you roll a v7 with all of the incorporated feedback
> from Mike based on this (instead of submitting the v6 updates as a separate
> patch, which I previously requested)?
> 
> Could you also roll in the following in that patch?:
> diff --git a/Maintainers.txt b/Maintainers.txt index
> 876ae5612ad8..47d58ffa0b2c 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -98,6 +98,11 @@ M: Shifei A Lu 
>  M: Xiaohu Zhou 
>  M: Isaac W Oram 
> 
> +Platform/Intel/Stratix10SocPkg
> +M: Leif Lindholm 
> +M: Michael D Kinney 
> +R: Tien Hock Loh 
> +
>  Platform/Intel/Tools
>  M: Bob Feng 
>  M: Liming Gao 
> 
> Best Regards,
> 
> Leif
> 
> On Fri, Aug 09, 2019 at 02:17:42AM +, Loh, Tien Hock wrote:
> > > -Original Message-
> > > From: Kinney, Michael D
> > > Sent: Friday, August 9, 2019 3:50 AM
> > > To: Leif Lindholm ; Loh, Tien Hock
> > > ; Kinney, Michael D
> > > 
> > > Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> > > 
> > > Subject: RE: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform
> > > support
> > >
> > > Tien Hock,
> > >
> > > I have a few comments:
> > >
> > > 1) Recommend change name of directory
> > >
> > > Platform/Intel/Startix10 -> Platform/Intel/Startix10SocPkg.
> > OK will do that.
> >
> > >
> > > 2) S10ClockManager.c is missing file header with license and
> > > copyright
> > > 3) S10ClockManager.h is missing file header with license and
> > > copyright
> > Yeah, I'll submit a fix to that
> >
> > > 4) PlatformHookLib.inf uses '..' to access sources in a different 
> > > directory.
> > >'..' should never be used in an INF.  This INF also lists many
> > >PCDs that are not used by PlatformHookLib.c
> > OK I'll remove the dependencies.
> >
> > > 5) PlatformHookLib.c also uses '..' in an include that should not
> > >be used.
> > > 6) Can the following files be updated to a BSD+Patent license and
> > >use an SPDX identifier?
> > >
> > >  IntelPlatformDxe.inf
> > >  IntelPlatformDxe.c
> > >
> > >  IntelPlatformLib.inf
> > >  Stratix10PlatformLib.c
> > >  Startix10Mmu.c
> > >  ArmPlatformHelper.S
> > >
> > OK. Noted, I missed changing these license headers.
> >
> > > If S10ClockManager is only used by the PlatformHookLib, then I
> > > recommend you move the S10ClockManager sources into the
> > > PlatformHookLib directory or a subdirectory below PlatformHookLib.
> > >
> > The S10ClockManager is also being used by
> Drivers/IntelPlatformDxe/IntelPlatformDxe.c, so I'm wondering what's the
> best approach to this?
> >
> > > Thanks,
> > >
> > > Mike

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

View/Reply Online (#45470): https://edk2.groups.io/g/devel/message/45470
Mute This Topic: https://groups.io/mt/32677389/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/1] Platform: Intel: Update licenses to SPDX and update clock settings

2019-09-03 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Update all license to SPDX. Also update UART clock to be calculated instead
of hardcoded, removed some unused packages, and updated maintainers.

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Platform/Intel/Stratix10/Stratix10SoCPkg.dec  
|   3 +-
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc  
|  15 ++-
 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf  
|   1 -
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
|  22 ++--
 Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
|  94 +++---
 Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf  
|  41 ++
 Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.inf  
|  34 +
 Platform/Intel/Stratix10/Include/Library/S10ClockManager/S10ClockManager.h
|  48 +++
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c  
|  22 ++--
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c  
|  20 ++-
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c  
|  19 +--
 Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.c
|  43 +++
 Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.c
| 133 
 Maintainers.txt   
|   5 +
 Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S 
|   8 +-
 15 files changed, 391 insertions(+), 117 deletions(-)

diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dec 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
index 7c44670d591d..346f7f9a042b 100755
--- a/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
@@ -10,7 +10,8 @@ [Defines]
   PACKAGE_GUID   = 45533DD0-C41F-4ab6-A5DF-65B52684AC60
   PACKAGE_VERSION= 0.1
 
-[Includes.common]
+[Includes]
+  Include
 
 [Guids.common]
   gStratix10SocFpgaTokenSpaceGuid = { 0x0fe272eb, 0xb2cf, 0x4390, { 0xa5, 
0xc4, 0x60, 0x13, 0x2c, 0x6b, 0xd0, 0x34 } }
diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
index 17d0c5baadc6..d3ad0eba7e75 100755
--- a/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
@@ -27,6 +27,8 @@ [Defines]
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
 #
 

+[PcdsPatchableInModule.common]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|184320
 
 [PcdsFixedAtBuild.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE
@@ -103,7 +105,6 @@ [PcdsFixedAtBuild.common]
   #  DEBUG_GCD   0x0010  // Global Coherency Database changes
   #  DEBUG_CACHE 0x0020  // Memory range cachability changes
   #  DEBUG_ERROR 0x8000  // Error
-#  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803010CF
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x800F
 
   gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x00
@@ -227,7 +228,8 @@ [LibraryClasses.common]
   SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf
 
   
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
-  
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
+  
PlatformHookLib|Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf
+  
S10ClockManager|Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.inf
 
   
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
@@ -251,7 +253,6 @@ [LibraryClasses.common]
   PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
 
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
-#  
GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
 
   #
@@ -414,7 +415,6 @@ [Components.common]
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
-  #PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   
NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
   }
 
@@ -475,7 +475,6 @@ [Components.common]
   
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
   
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
   
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
-#  

Re: [edk2-devel] [PATCH v2 0/3] add DwMmcHcDxe driver

2019-09-11 Thread Loh, Tien Hock
Hi Ard, Leif, Christopher,

Any comments on the patches?

Thanks!
Tien Hock 
> -Original Message-
> From: Haojian Zhuang 
> Sent: Monday, September 2, 2019 5:31 PM
> To: Loh, Tien Hock 
> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org;
> christopher...@microsoft.com; devel@edk2.groups.io; thlo...@gmail.com
> Subject: Re: [PATCH v2 0/3] add DwMmcHcDxe driver
> 
> Hi Leif, Ard, Christopher,
> 
> Could you help to share the comments on this patch set? Thanks a lot.
> 
> Best Regards
> Haojian
> 
> On Thu, Aug 15, 2019 at 09:09:19AM +, Loh, Tien Hock wrote:
> > Hi Leif, Ard, Christopher,
> >
> > Haojian and I have tested the driver on 2 platforms, any further comments
> on this?
> >
> > Thanks
> > Tien Hock
> >
> > > -Original Message-
> > > From: Haojian Zhuang 
> > > Sent: Tuesday, July 30, 2019 3:33 PM
> > > To: Loh, Tien Hock ;
> > > leif.lindh...@linaro.org; ard.biesheu...@linaro.org;
> > > christopher...@microsoft.com
> > > Cc: devel@edk2.groups.io; thlo...@gmail.com
> > > Subject: Re: [PATCH v2 0/3] add DwMmcHcDxe driver
> > >
> > > On Wed, Jul 24, 2019 at 05:26:03PM +0800, tien.hock@intel.com
> wrote:
> > > > From: "Tien Hock, Loh" 
> > > >
> > > > Changelog:
> > > > v3:
> > > >   * Fix an issue in NonDiscoverableDeviceDxe driver where it did
> > > > not
> > > invalidate
> > > > cache before copying the memory.
> > > > v2:
> > > >   *Split DwMmcHcDxe driver into two patches. One is for
> > > > PlatformDwMmc
> > > protocol,
> > > >and the other is for DwMmcHcDxe driver.
> > > > v1:
> > > >   *Add NonDiscoverableDeviceDxe for embedded platform. Make
> > > DwMmcHcDxe driver
> > > >to support both eMMC and SD controller.
> > > >
> > > > Haojian Zhuang (3):
> > > >   EmbeddedPkg: add NonDiscoverableDeviceDxe driver
> > > >   EmbeddedPkg: add PlatformDwMmc protocol
> > > >   EmbeddedPkg/Drivers: add DwMmcHcDxe driver
> > > >
> > > >  .../Drivers/DwMmcHcDxe/ComponentName.c|  214 ++
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c   | 1295
> > > +
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec |   40 +
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h   |  815
> ++
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf |   69 +
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c | 2366
> > > +
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h |  983 +++
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c   | 1042
> 
> > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c | 1104 
> > > >  EmbeddedPkg/EmbeddedPkg.dec   |1 +
> > > >  EmbeddedPkg/Include/Protocol/PlatformDwMmc.h  |   79 +
> > > >  .../NonDiscoverableDeviceDxe/ComponentName.c  |  124 +
> > > >  .../NonDiscoverableDeviceDxe.c|  243 ++
> > > >  .../NonDiscoverableDeviceDxe.inf  |   52 +
> > > >  .../NonDiscoverableDeviceIo.c |  976 +++
> > > >  .../NonDiscoverableDeviceIo.h |   92 +
> > > >  16 files changed, 9495 insertions(+)  create mode 100644
> > > EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c
> > > >  create mode 100644
> > > EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c
> > > >  create mode 100644
> > > EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec
> > > >  create mode 100644
> > > EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h
> > > >  create mode 100644
> > > EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf
> > > >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c
> > > >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h
> > > >  create mode 100644
> EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c
> > > >  create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c
> > > >  create mode 100644
> EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
> > > >  create mode 100644
> > > >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/ComponentName.c
> > > >  create mode 100644
> > > >
> > >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> > > eDx
> > > > e.c  create mode 100644
> > > >
> > >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> > > eDx
> > > > e.inf  create mode 100644
> > > >
> > >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> > > eIo
> > > > .c  create mode 100644
> > > >
> > >
> EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDevic
> > > eIo
> > > > .h
> > > >
> > > > --
> > > > 2.19.0
> > > >
> > >
> > > Hi Leif, Ard & Chris,
> > >
> > > Could you help to share your comments on this patch set?
> > >
> > > Best Regards
> > > Haojian

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

View/Reply Online (#47167): https://edk2.groups.io/g/devel/message/47167
Mute This Topic: https://groups.io/mt/32582252/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 3/4] Platform: Intel: Remove unused packages and clean up

2019-09-05 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Remove some unused packages in Stratix 10 packages, clean up some commented
out codes

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc | 4 
 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf | 1 -
 2 files changed, 5 deletions(-)

diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
index 17d0c5baadc6..643ce625c563 100755
--- a/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
@@ -103,7 +103,6 @@ [PcdsFixedAtBuild.common]
   #  DEBUG_GCD   0x0010  // Global Coherency Database changes
   #  DEBUG_CACHE 0x0020  // Memory range cachability changes
   #  DEBUG_ERROR 0x8000  // Error
-#  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803010CF
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x800F
 
   gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x00
@@ -251,7 +250,6 @@ [LibraryClasses.common]
   PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
 
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
-#  
GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
 
   #
@@ -414,7 +412,6 @@ [Components.common]
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
-  #PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   
NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
   }
 
@@ -475,7 +472,6 @@ [Components.common]
   
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
   
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
   
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
-#  
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
   
HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   
BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.fdf 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.fdf
index 2c4e5ee887ca..1ac2da28addf 100755
--- a/Platform/Intel/Stratix10/Stratix10SoCPkg.fdf
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.fdf
@@ -140,7 +140,6 @@ [FV.FV_DXE]
   INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
   INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   INF MdeModulePkg/Application/UiApp/UiApp.inf
-  INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
   INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
 
   # FV Filesystem
-- 
2.19.0


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

View/Reply Online (#46880): https://edk2.groups.io/g/devel/message/46880
Mute This Topic: https://groups.io/mt/33151032/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 0/4] Update Stratix 10 platform support

2019-09-05 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Update maintainer list, SPDX license, remove unused packages
and remove hardcoded UART clock

Tien Hock, Loh (4):
  Platform: Intel: Update maintainers list for Stratix 10 device
  Platform: Intel: Update license to SPDX
  Platform: Intel: Remove unused packages and clean up
  Platform: Intel: Remove hardcoded Stratix 10 UART clock

 Platform/Intel/Stratix10/Stratix10SoCPkg.dec  |   3 +-
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc  |  15 +-
 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf  |   1 -
 .../IntelPlatformDxe/IntelPlatformDxe.inf |  22 ++-
 .../IntelPlatformLib/IntelPlatformLib.inf |  22 +--
 .../PlatformHookLib/PlatformHookLib.inf   |  41 ++
 .../S10ClockManager/S10ClockManager.inf   |  34 +
 .../Library/S10ClockManager/S10ClockManager.h |  48 +++
 .../IntelPlatformDxe/IntelPlatformDxe.c   |  22 ++-
 .../Library/IntelPlatformLib/Stratix10Mmu.c   |  20 +--
 .../IntelPlatformLib/Stratix10PlatformLib.c   |  19 +--
 .../Library/PlatformHookLib/PlatformHookLib.c |  43 ++
 .../Library/S10ClockManager/S10ClockManager.c | 133 ++
 Maintainers.txt   |   5 +
 .../AArch64/ArmPlatformHelper.S   |   8 +-
 15 files changed, 353 insertions(+), 83 deletions(-)
 create mode 100644 
Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf
 create mode 100644 
Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.inf
 create mode 100644 
Platform/Intel/Stratix10/Include/Library/S10ClockManager/S10ClockManager.h
 create mode 100644 
Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.c
 create mode 100644 
Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.c

-- 
2.19.0


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

View/Reply Online (#46877): https://edk2.groups.io/g/devel/message/46877
Mute This Topic: https://groups.io/mt/33151029/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/4] Platform: Intel: Update maintainers list for Stratix 10 device

2019-09-05 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Update maintainers list for Stratix 10 devices

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Maintainers.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 876ae5612ad8..47d58ffa0b2c 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -98,6 +98,11 @@ M: Shifei A Lu 
 M: Xiaohu Zhou 
 M: Isaac W Oram 
 
+Platform/Intel/Stratix10SocPkg
+M: Leif Lindholm 
+M: Michael D Kinney 
+R: Tien Hock Loh 
+
 Platform/Intel/Tools
 M: Bob Feng 
 M: Liming Gao 
-- 
2.19.0


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

View/Reply Online (#46878): https://edk2.groups.io/g/devel/message/46878
Mute This Topic: https://groups.io/mt/33151030/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 4/4] Platform: Intel: Remove hardcoded Stratix 10 UART clock

2019-09-05 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Added clock manager so that Stratix 10 UART clock doesn't need to be
hardcoded

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Platform/Intel/Stratix10/Stratix10SoCPkg.dec   |   
3 +-
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc   |  
11 +-
 Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf   |  
41 ++
 Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.inf   |  
34 +
 Platform/Intel/Stratix10/Include/Library/S10ClockManager/S10ClockManager.h |  
48 +++
 Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.c |  
43 +++
 Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.c | 
133 
 7 files changed, 310 insertions(+), 3 deletions(-)

diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dec 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
index 7c44670d591d..346f7f9a042b 100755
--- a/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dec
@@ -10,7 +10,8 @@ [Defines]
   PACKAGE_GUID   = 45533DD0-C41F-4ab6-A5DF-65B52684AC60
   PACKAGE_VERSION= 0.1
 
-[Includes.common]
+[Includes]
+  Include
 
 [Guids.common]
   gStratix10SocFpgaTokenSpaceGuid = { 0x0fe272eb, 0xb2cf, 0x4390, { 0xa5, 
0xc4, 0x60, 0x13, 0x2c, 0x6b, 0xd0, 0x34 } }
diff --git a/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc 
b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
index 643ce625c563..d3ad0eba7e75 100755
--- a/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
+++ b/Platform/Intel/Stratix10/Stratix10SoCPkg.dsc
@@ -27,6 +27,8 @@ [Defines]
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
 #
 

+[PcdsPatchableInModule.common]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|184320
 
 [PcdsFixedAtBuild.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE
@@ -226,7 +228,8 @@ [LibraryClasses.common]
   SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf
 
   
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
-  
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
+  
PlatformHookLib|Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf
+  
S10ClockManager|Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.inf
 
   
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
@@ -483,9 +486,13 @@ [Components.common]
   }
 
   #
-  # Platform Specific Init for DXE phase
+  # Platform Specific Init
   #
   Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
+  Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf {
+
+
S10ClockManager|Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.inf
+  }
 
 [BuildOptions]
   #---
diff --git 
a/Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf 
b/Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf
new file mode 100644
index ..dc18db7c5444
--- /dev/null
+++ b/Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf
@@ -0,0 +1,41 @@
+## @file
+#  Platform Hook Library instance for UART device.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = PlatformHookLib
+  FILE_GUID  = 90A73C58-A6E3-4EED-A1A3-6F9C7C3D998F
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = PlatformHookLib
+  CONSTRUCTOR= PlatformHookSerialPortInitialize
+
+[Sources]
+  PlatformHookLib.c
+
+[LibraryClasses]
+  PcdLib
+  PciLib
+  S10ClockManager
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  Platform/Intel/Stratix10/Stratix10SoCPkg.dec
+  UefiPayloadPkg/UefiPayloadPkg.dec
+
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## PRODUCES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase## PRODUCES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate## PRODUCES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride  ## PRODUCES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate   ## PRODUCES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## PRODUCES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters   ## PRODUCES
+
diff --git 
a/Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.inf 

[edk2-devel] [PATCH 2/4] Platform: Intel: Update license to SPDX

2019-09-05 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Update licenses to SPDX

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
| 22 +++-
 Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
| 22 +++-
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c  
| 22 
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c  
| 20 +++---
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c  
| 19 ++---
 Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S 
|  8 +--
 6 files changed, 38 insertions(+), 75 deletions(-)

diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
index 64b398969f1e..b16d93f22058 100644
--- a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
@@ -1,18 +1,12 @@
-#/** @file
-#
-#  Copyright (c) 2019, Intel All rights reserved.
-#
-#  This program and the accompanying materials
-#  are licensed and made available under the terms and conditions of the BSD 
License
-#  which accompanies this distribution.  The full text of the license may be 
found at
-#  http://opensource.org/licenses/bsd-license.php
-#
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
-#
-#
-#**/
 
+### @file
+#
+#  Intel Stratix 10 Platform
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+###
+
 [Defines]
   INF_VERSION= 0x0001001B
   BASE_NAME  = IntelPlatformDxe
diff --git 
a/Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf 
b/Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
index ef5c06aede7f..b6b6c743b800 100644
--- a/Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
+++ b/Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
@@ -1,18 +1,10 @@
-/** @file
-*
-*  Stratix 10 Platform Library
-*
-*  Copyright (c) 2019, Intel Corporations All rights reserved.
-*
-*  This program and the accompanying materials
-*  are licensed and made available under the terms and conditions of the BSD 
License
-*  which accompanies this distribution.  The full text of the license may be 
found at
-*  http://opensource.org/licenses/bsd-license.php
-*
-*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
-*
-**/
+### @file
+#
+#  Stratix 10 Platform Library
+#  Copyright (c) 2019, Intel Corporation All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+###
 
 [Defines]
   INF_VERSION= 0x0001001B
diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
index 144b4c54ef55..b762fdc69ca4 100644
--- a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
@@ -1,16 +1,12 @@
-/** @file
-*
-*  Copyright (c) 2019, Intel All rights reserved.
-*
-*  This program and the accompanying materials
-*  are licensed and made available under the terms and conditions of the BSD 
License
-*  which accompanies this distribution.  The full text of the license may be 
found at
-*  http://opensource.org/licenses/bsd-license.php
-*
-*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
-*
-**/
+/** @file
+
+  Stratix 10 Platform Entry code
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
 
 
 #include 
diff --git a/Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c 
b/Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c
index 892387bf5d07..73ea1b423567 100644
--- a/Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c
+++ b/Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c
@@ -1,17 +1,11 @@
 /** @file
-*
-*  Stratix 10 Mmu configuration
-*
-*  Copyright (c) 2019, Intel Corporations All rights reserved.
-*
-*  This program and the accompanying materials
-*  are licensed and made available under the terms and conditions of the BSD 
License
-*  which accompanies this distribution.  The full text of the license may be 
found at
-*  http://opensource.org/licenses/bsd-license.php
-*
-*  

Re: [edk2-devel] [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support

2019-08-04 Thread Loh, Tien Hock
Hi Leif, Ard, Micheal,

Any comments on this?

Thanks!

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

View/Reply Online (#44890): https://edk2.groups.io/g/devel/message/44890
Mute This Topic: https://groups.io/mt/32677389/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support

2019-08-04 Thread Loh, Tien Hock
Hi Leif, Ard, Micheal,

Any comments on this patch?

Thanks
Tien Hock

> -Original Message-
> From: Loh, Tien Hock
> Sent: Thursday, August 1, 2019 6:32 PM
> To: devel@edk2.groups.io; thlo...@gmail.com
> Cc: Loh, Tien Hock ; Ard Biesheuvel
> ; Leif Lindholm ;
> Kinney, Michael D 
> Subject: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support
> 
> From: "Tien Hock, Loh" 
> 
> Adds support for Intel Stratix 10 Platform.
> 
> Signed-off-by: "Tien Hock, Loh" 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> 
> ---
> v5:
> Remove hardcoded UART clock
> ---
>  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c 
>  |
> 44 ++
>  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf   
>  |
> 48 ++
> 
> Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelp
> er.S |  51 ++
>  Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf   
>  |
> 54 +++
>  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c 
>  |
> 155 ++
>  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c 
>  |
> 153 ++
>  Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.c   
>  |
> 43 ++
>  Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf
> |  40 ++
>  Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.c
> | 121 +
>  Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.h
> |  40 ++
>  Platform/Intel/Stratix10/Readme.md   
>  |  61 +++
>  Platform/Intel/Stratix10/Stratix10SoCPkg.dec 
>  |  22 +
>  Platform/Intel/Stratix10/Stratix10SoCPkg.dsc 
>  | 501
> 
>  Platform/Intel/Stratix10/Stratix10SoCPkg.fdf 
>  | 253
> ++
>  Readme.md
>  |   3 +
>  15 files changed, 1589 insertions(+)
> 
> diff --git
> a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> new file mode 100644
> index ..a801f12bb59e
> --- /dev/null
> +++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> @@ -0,0 +1,44 @@
> +/** @file
> +*
> +*  Copyright (c) 2019, Intel All rights reserved.
> +*
> +*  This program and the accompanying materials
> +*  are licensed and made available under the terms and conditions of the
> BSD License
> +*  which accompanies this distribution.  The full text of the license may be
> found at
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +*
> +**/
> +
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "../../Library/S10ClockManager/S10ClockManager.h"
> +EFI_STATUS
> +EFIAPI
> +IntelPlatformDxeEntryPoint (
> +  IN EFI_HANDLE ImageHandle,
> +  IN EFI_SYSTEM_TABLE   *SystemTable
> +  )
> +{
> +  EFI_STATUSStatus = 0;
> +
> +  return Status;
> +}
> +
> diff --git
> a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
> b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
> new file mode 100644
> index ..64b398969f1e
> --- /dev/null
> +++
> b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
> @@ -0,0 +1,48 @@
> +#/** @file
> +#
> +#  Copyright (c) 2019, Intel All rights reserved.
> +#
> +#  This program and the accompanying materials
> +#  are licensed and made available under the terms and conditions of the
> BSD License
> +#  which accompanies this distribution.  The full text of the license may be
> found at
> +#  http://opensource.org/licenses/bsd-license.php
> +#
> +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> +#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +#
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = IntelPlatformDxe
> +  FILE_GUID

Re: [edk2-devel] [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support

2019-08-05 Thread Loh, Tien Hock
Hi Leif,

OK noted, I'll submit a new patch on top of the commit.
I'll also try to ping Micheal.

Thanks
Tien Hock

> -Original Message-
> From: Leif Lindholm 
> Sent: Monday, August 5, 2019 5:26 PM
> To: Loh, Tien Hock ; Kinney, Michael D
> 
> Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> 
> Subject: Re: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support
> 
> Hi Tien Hock,
> 
> I have already given my reviewed-by to v5 of this patch.
> So can you please resubmit the changes since then as a separate patch?
> 
> But I am still waiting for a response from Mike to
> https://edk2.groups.io/g/devel/message/44042
> before I am able to push the platform support.
> 
> Best Regards,
> 
> Leif
> 
> On Mon, Aug 05, 2019 at 03:34:14AM +, Loh, Tien Hock wrote:
> > Hi Leif, Ard, Micheal,
> >
> > Any comments on this patch?
> >
> > Thanks
> > Tien Hock
> >
> > > -Original Message-
> > > From: Loh, Tien Hock
> > > Sent: Thursday, August 1, 2019 6:32 PM
> > > To: devel@edk2.groups.io; thlo...@gmail.com
> > > Cc: Loh, Tien Hock ; Ard Biesheuvel
> > > ; Leif Lindholm ;
> > > Kinney, Michael D 
> > > Subject: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support
> > >
> > > From: "Tien Hock, Loh" 
> > >
> > > Adds support for Intel Stratix 10 Platform.
> > >
> > > Signed-off-by: "Tien Hock, Loh" 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Cc: Michael D Kinney 
> > >
> > > ---
> > > v5:
> > > Remove hardcoded UART clock
> > > ---
> > >  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> |
> > > 44 ++
> > >  Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
> |
> > > 48 ++
> > >
> > >
> Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelp
> > > er.S |  51 ++
> > >  Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
> |
> > > 54 +++
> > >  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c
> |
> > > 155 ++
> > >  Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c
> |
> > > 153 ++
> > >  Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.c
> |
> > > 43 ++
> > >  Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf
> > > |  40 ++
> > >  Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.c
> > > | 121 +
> > >  Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.h
> > > |  40 ++
> > >  Platform/Intel/Stratix10/Readme.md   
> > >  |  61 +++
> > >  Platform/Intel/Stratix10/Stratix10SoCPkg.dec 
> > >  |  22 +
> > >  Platform/Intel/Stratix10/Stratix10SoCPkg.dsc 
> > >  | 501
> > > 
> > >  Platform/Intel/Stratix10/Stratix10SoCPkg.fdf 
> > >  | 253
> > > ++
> > >  Readme.md
> > >  |   3 +
> > >  15 files changed, 1589 insertions(+)
> > >
> > > diff --git
> > > a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> > > b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> > > new file mode 100644
> > > index ..a801f12bb59e
> > > --- /dev/null
> > > +++
> b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
> > > @@ -0,0 +1,44 @@
> > > +/** @file
> > > +*
> > > +*  Copyright (c) 2019, Intel All rights reserved.
> > > +*
> > > +*  This program and the accompanying materials
> > > +*  are licensed and made available under the terms and conditions of
> the
> > > BSD License
> > > +*  which accompanies this distribution.  The full text of the license may
> be
> > > found at
> > > +*  http://opensource.org/licenses/bsd-license.php
> > > +*
> > > +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS
> IS"
> > > BASIS,
> > > +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > > EXPRESS OR IMPLIED.
> > > +*
> 

[edk2-devel] [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support

2019-08-01 Thread Loh, Tien Hock
From: "Tien Hock, Loh" 

Adds support for Intel Stratix 10 Platform.

Signed-off-by: "Tien Hock, Loh" 
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 

---
v5:
Remove hardcoded UART clock
---
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c  
|  44 ++
 Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
|  48 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S 
|  51 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/IntelPlatformLib.inf
|  54 +++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10Mmu.c  
| 155 ++
 Platform/Intel/Stratix10/Library/IntelPlatformLib/Stratix10PlatformLib.c  
| 153 ++
 Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.c
|  43 ++
 Platform/Intel/Stratix10/Library/PlatformHookLib/PlatformHookLib.inf  
|  40 ++
 Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.c
| 121 +
 Platform/Intel/Stratix10/Library/S10ClockManager/S10ClockManager.h
|  40 ++
 Platform/Intel/Stratix10/Readme.md
|  61 +++
 Platform/Intel/Stratix10/Stratix10SoCPkg.dec  
|  22 +
 Platform/Intel/Stratix10/Stratix10SoCPkg.dsc  
| 501 
 Platform/Intel/Stratix10/Stratix10SoCPkg.fdf  
| 253 ++
 Readme.md 
|   3 +
 15 files changed, 1589 insertions(+)

diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
new file mode 100644
index ..a801f12bb59e
--- /dev/null
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.c
@@ -0,0 +1,44 @@
+/** @file
+*
+*  Copyright (c) 2019, Intel All rights reserved.
+*
+*  This program and the accompanying materials
+*  are licensed and made available under the terms and conditions of the BSD 
License
+*  which accompanies this distribution.  The full text of the license may be 
found at
+*  http://opensource.org/licenses/bsd-license.php
+*
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+*
+**/
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "../../Library/S10ClockManager/S10ClockManager.h"
+EFI_STATUS
+EFIAPI
+IntelPlatformDxeEntryPoint (
+  IN EFI_HANDLE ImageHandle,
+  IN EFI_SYSTEM_TABLE   *SystemTable
+  )
+{
+  EFI_STATUSStatus = 0;
+
+  return Status;
+}
+
diff --git 
a/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf 
b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
new file mode 100644
index ..64b398969f1e
--- /dev/null
+++ b/Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/IntelPlatformDxe.inf
@@ -0,0 +1,48 @@
+#/** @file
+#
+#  Copyright (c) 2019, Intel All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+#**/
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = IntelPlatformDxe
+  FILE_GUID  = AB87E291-1689-4c7b-B613-FB54A0E38CEA
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= IntelPlatformDxeEntryPoint
+
+[Sources.common]
+  IntelPlatformDxe.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  ArmLib
+  BaseMemoryLib
+  DebugLib
+  DxeServicesTableLib
+  PcdLib
+  PrintLib
+  SerialPortLib
+  UefiBootServicesTableLib
+  UefiRuntimeServicesTableLib
+  UefiLib
+  UefiDriverEntryPoint
+
+[Depex]
+  # We depend on these protocols to create the default boot entries
+  gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid
diff --git 
a/Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S 
b/Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S
new file mode 100644
index ..2f4cf95cbf13
--- /dev/null
+++ 
b/Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch64/ArmPlatformHelper.S
@@ -0,0 +1,51 @@
+//
+//  Copyright (c) 

Re: [edk2-devel] [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support

2019-08-08 Thread Loh, Tien Hock
> -Original Message-
> From: Kinney, Michael D
> Sent: Friday, August 9, 2019 3:50 AM
> To: Leif Lindholm ; Loh, Tien Hock
> ; Kinney, Michael D
> 
> Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> 
> Subject: RE: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support
> 
> Tien Hock,
> 
> I have a few comments:
> 
> 1) Recommend change name of directory
> 
> Platform/Intel/Startix10 -> Platform/Intel/Startix10SocPkg.
OK will do that.

> 
> 2) S10ClockManager.c is missing file header with license and copyright
> 3) S10ClockManager.h is missing file header with license and copyright
Yeah, I'll submit a fix to that

> 4) PlatformHookLib.inf uses '..' to access sources in a different directory.
>'..' should never be used in an INF.  This INF also lists many
>PCDs that are not used by PlatformHookLib.c
OK I'll remove the dependencies. 

> 5) PlatformHookLib.c also uses '..' in an include that should not
>be used.
> 6) Can the following files be updated to a BSD+Patent license and
>use an SPDX identifier?
> 
>  IntelPlatformDxe.inf
>  IntelPlatformDxe.c
> 
>  IntelPlatformLib.inf
>  Stratix10PlatformLib.c
>  Startix10Mmu.c
>  ArmPlatformHelper.S
> 
OK. Noted, I missed changing these license headers. 

> If S10ClockManager is only used by the PlatformHookLib, then I
> recommend you move the S10ClockManager sources into the
> PlatformHookLib
> directory or a subdirectory below PlatformHookLib.
> 
The S10ClockManager is also being used by 
Drivers/IntelPlatformDxe/IntelPlatformDxe.c, so I'm wondering what's the best 
approach to this?

> Thanks,
> 
> Mike
> 
> 
> > -Original Message-
> > From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > Sent: Monday, August 5, 2019 2:26 AM
> > To: Loh, Tien Hock ; Kinney,
> > Michael D 
> > Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard
> > Biesheuvel 
> > Subject: Re: [PATCH v6 1/1] Platform: Intel: Add
> > Stratix 10 platform support
> >
> > Hi Tien Hock,
> >
> > I have already given my reviewed-by to v5 of this
> > patch.
> > So can you please resubmit the changes since then as a
> > separate patch?
> >
> > But I am still waiting for a response from Mike to
> > https://edk2.groups.io/g/devel/message/44042
> > before I am able to push the platform support.
> >
> > Best Regards,
> >
> > Leif
> >
> > On Mon, Aug 05, 2019 at 03:34:14AM +, Loh, Tien
> > Hock wrote:
> > > Hi Leif, Ard, Micheal,
> > >
> > > Any comments on this patch?
> > >
> > > Thanks
> > > Tien Hock
> > >
> > > > -Original Message-
> > > > From: Loh, Tien Hock
> > > > Sent: Thursday, August 1, 2019 6:32 PM
> > > > To: devel@edk2.groups.io; thlo...@gmail.com
> > > > Cc: Loh, Tien Hock ; Ard
> > Biesheuvel
> > > > ; Leif Lindholm
> > ;
> > > > Kinney, Michael D 
> > > > Subject: [PATCH v6 1/1] Platform: Intel: Add
> > Stratix 10 platform support
> > > >
> > > > From: "Tien Hock, Loh" 
> > > >
> > > > Adds support for Intel Stratix 10 Platform.
> > > >
> > > > Signed-off-by: "Tien Hock, Loh"
> > 
> > > > Contributed-under: TianoCore Contribution Agreement
> > 1.1
> > > > Cc: Ard Biesheuvel 
> > > > Cc: Leif Lindholm 
> > > > Cc: Michael D Kinney 
> > > >
> > > > ---
> > > > v5:
> > > > Remove hardcoded UART clock
> > > > ---
> > > >
> > Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/Intel
> > PlatformDxe.c  |
> > > > 44 ++
> > > >
> > Platform/Intel/Stratix10/Drivers/IntelPlatformDxe/Intel
> > PlatformDxe.inf|
> > > > 48 ++
> > > >
> > > >
> > Platform/Intel/Stratix10/Library/IntelPlatformLib/AArch
> > 64/ArmPlatformHelp
> > > > er.S |  51 ++
> > > >
> > Platform/Intel/Stratix10/Library/IntelPlatformLib/Intel
> > PlatformLib.inf|
> > > > 54 +++
> > > >
> > Platform/Intel/Stratix10/Library/IntelPlatformLib/Strat
> > ix10Mmu.c  |
> > > > 155 ++
> > > >
> > Platform/Intel/Stratix10/Library/IntelPlatformLib/Strat
> > ix10PlatformLib.c  |
> > > > 153 ++
> > > >
> > Platform/Intel/Stratix10/Library/PlatformHookLib/Platfo
> > rmHookLib.c

[edk2-devel] [PATCH v2 2/3] EmbeddedPkg: add PlatformDwMmc protocol

2019-07-24 Thread Loh, Tien Hock
From: Haojian Zhuang 

Add PlatformDwMmc protocol. It's used to set properties of DwMmc
device in platform driver.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Chris Co 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang 
---
 EmbeddedPkg/Include/Protocol/PlatformDwMmc.h | 79 
 1 file changed, 79 insertions(+)

diff --git a/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h 
b/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
new file mode 100644
index ..54a44928a7e1
--- /dev/null
+++ b/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
@@ -0,0 +1,79 @@
+/** @file
+
+  Copyright (c) 2018, Linaro. All rights reserved.
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PLATFORM_DW_MMC_H__
+#define __PLATFORM_DW_MMC_H__
+
+typedef enum {
+  RemovableSlot,
+  EmbeddedSlot,
+  SharedBusSlot,
+  UnknownSlot
+} EFI_SD_MMC_SLOT_TYPE;
+
+typedef enum {
+  UnknownCardType,
+  SdCardType,
+  SdioCardType,
+  MmcCardType,
+  EmmcCardType
+} SD_MMC_CARD_TYPE;
+
+typedef struct {
+  UINT32DefaultSpeed:1;// bit 0
+  UINT32HighSpeed:1;   // bit 1
+  UINT32Sdr12:1;   // bit 2
+  UINT32Sdr25:1;   // bit 3
+  UINT32Sdr50:1;   // bit 4
+  UINT32Sdr104:1;  // bit 5
+  UINT32Ddr50:1;   // bit 6
+  UINT32SysBus64:1;// bit 7
+  UINT32BusWidth:4;// bit 11:8
+  UINT32SlotType:2;// bit 13:12
+  UINT32CardType:3;// bit 16:14
+  UINT32Voltage18:1;   // bit 17
+  UINT32Voltage30:1;   // bit 18
+  UINT32Voltage33:1;   // bit 19
+  UINT32BaseClkFreq;
+  EFI_HANDLEController;
+} DW_MMC_HC_SLOT_CAP;
+
+//
+// Protocol interface structure
+//
+typedef struct _PLATFORM_DW_MMC_PROTOCOL   PLATFORM_DW_MMC_PROTOCOL;
+
+typedef
+EFI_STATUS
+(EFIAPI *PLATFORM_DW_MMC_GET_CAPABILITY) (
+  IN EFI_HANDLE Controller,
+  IN UINT8  Slot,
+ OUT DW_MMC_HC_SLOT_CAP *Capability
+  );
+
+typedef
+BOOLEAN
+(EFIAPI *PLATFORM_DW_MMC_CARD_DETECT) (
+  IN EFI_HANDLE Controller,
+  IN UINT8  Slot
+  );
+
+struct _PLATFORM_DW_MMC_PROTOCOL {
+  PLATFORM_DW_MMC_GET_CAPABILITY   GetCapability;
+  PLATFORM_DW_MMC_CARD_DETECT  CardDetect;
+};
+
+extern EFI_GUID gPlatformDwMmcProtocolGuid;
+
+#endif /* __PLATFORM_DW_MMC_H__ */
-- 
2.19.0


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

View/Reply Online (#44301): https://edk2.groups.io/g/devel/message/44301
Mute This Topic: https://groups.io/mt/32582278/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 1/3] EmbeddedPkg: add NonDiscoverableDeviceDxe driver

2019-07-24 Thread Loh, Tien Hock
From: Haojian Zhuang 

It's used to create NonDiscoverableDevice in embedded platform. Since
there's no PCI bus.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Chris Co 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang 
Signed-off-by: Tien Hock, Loh 
---
 EmbeddedPkg/EmbeddedPkg.dec |  
 1 +
 EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/ComponentName.c  | 
124 +++
 EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDeviceDxe.c   | 
243 +
 EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDeviceDxe.inf |  
52 ++
 EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDeviceIo.c| 
976 
 EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/NonDiscoverableDeviceIo.h|  
92 ++
 6 files changed, 1488 insertions(+)

diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
index bbaadc5a17ab..8f051c76c51f 100644
--- a/EmbeddedPkg/EmbeddedPkg.dec
+++ b/EmbeddedPkg/EmbeddedPkg.dec
@@ -79,6 +79,7 @@
   gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 
0x08, 0x12, 0x54, 0x7a, 0xc2 }}
   gPlatformVirtualKeyboardProtocolGuid = { 0x0e3606d2, 0x1dc3, 0x4e6f, { 0xbe, 
0x65, 0x39, 0x49, 0x82, 0xa2, 0x65, 0x47 }}
   gAndroidBootImgProtocolGuid = { 0x9859bb19, 0x407c, 0x4f8b, {0xbc, 0xe1, 
0xf8, 0xda, 0x65, 0x65, 0xf4, 0xa5 }}
+  gEmbeddedNonDiscoverableIoProtocolGuid = { 0x6937742f, 0xf611, 0x4a40, { 
0xb1, 0xc6, 0xe7, 0xb4, 0x6e, 0x3c, 0x6e, 0x32 }}
 
 [Ppis]
   gEdkiiEmbeddedGpioPpiGuid = { 0x21c3b115, 0x4e0b, 0x470c, { 0x85, 0xc7, 
0xe1, 0x05, 0xa5, 0x75, 0xc9, 0x7b }}
diff --git a/EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/ComponentName.c 
b/EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/ComponentName.c
new file mode 100644
index ..613938697ee4
--- /dev/null
+++ b/EmbeddedPkg/Universal/NonDiscoverableDeviceDxe/ComponentName.c
@@ -0,0 +1,124 @@
+/** @file
+
+  Copyright (C) 2016-2018, Linaro Ltd. All rights reserved.
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution. The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+
+#include "NonDiscoverableDeviceIo.h"
+
+//
+// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
+// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
+// in English, for display on standard console devices. This is recommended for
+// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
+// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
+//
+
+STATIC
+EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
+  { "eng;en", L"I/O protocol emulation driver for non-discoverable devices" },
+  { NULL, NULL   }
+};
+
+EFI_COMPONENT_NAME_PROTOCOL gComponentName;
+
+/**
+  Retrieves a Unicode string that is the user readable name of the UEFI Driver.
+
+  @param This   A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+  @param Language   A pointer to a three character ISO 639-2 language 
identifier.
+This is the language of the driver name that that the 
caller
+is requesting, and it must match one of the languages 
specified
+in SupportedLanguages.  The number of languages 
supported by a
+driver is up to the driver writer.
+  @param DriverName A pointer to the Unicode string to return.  This 
Unicode string
+is the name of the driver specified by This in the 
language
+specified by Language.
+
+  @retval EFI_SUCCESS   The Unicode string for the Driver specified by 
This
+and the language specified by Language was 
returned
+in DriverName.
+  @retval EFI_INVALID_PARAMETER Language is NULL.
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.
+  @retval EFI_UNSUPPORTED   The driver specified by This does not support 
the
+language specified by Language.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+NonDiscoverableGetDriverName (
+  IN  EFI_COMPONENT_NAME_PROTOCOL *This,
+  IN  CHAR8   *Language,
+  OUT CHAR16  **DriverName
+  )
+{
+  return LookupUnicodeString2 (
+   Language,
+   This->SupportedLanguages,
+   mDriverNameTable,
+   DriverName,
+   (BOOLEAN)(This == ) // Iso639Language
+   );
+}
+
+/**
+  Retrieves a Unicode string that is the user readable name of the controller
+  that is being managed by an UEFI Driver.
+
+  

[edk2-devel] Problem with decompression on EDK2

2019-09-26 Thread Loh, Tien Hock
Hi

I have an issue while porting a new platform to EDK2. After porting the Stratix 
10 platform (ARM) to EDK2 it works correctly. However, when I tried to add more 
INF to the FDF file, it failed to decompress the image during boot time, log as 
below

INFO: DDR: DRAM calibration success.

INFO: Scrubbing ECC

INFO: Init HPS NOC's DDR Scheduler.

NOTICE: BL2: v2.1(debug):v2.1-15-g5880144-dirty

NOTICE: BL2: Built : 14:02:01, Aug 22 2019

INFO: BL2: Doing platform setup

INFO: BL2: Loading image id 3

INFO: Loading image id=3 at address 0xffe1c000

INFO: Image id=3 loaded: 0xffe1c000 - 0xffe22019

INFO: BL2: Loading image id 5

INFO: Loading image id=5 at address 0x5

INFO: Image id=5 loaded: 0x5 - 0x15

NOTICE: BL2: Booting BL31

INFO: Entry point address = 0xffe1c000

INFO: SPSR = 0x3cd

NOTICE: BL31: v2.1(release):v2.1-604-g3441952

NOTICE: BL31: Built : 15:32:55, Sep 25 2019 UEFI firmware (version 1.0 built at 
15:15:26 on Sep 26 2019) Decompress Failed - Invalid Parameter

ASSERT_EFI_ERROR (Status = Not Found)

ASSERT [ArmPlatformPrePiUniCore] 
/nfs/png/disks/swuser_work_thloh/push/build/edk2/ArmPlatformPkg/PrePi/PrePi.c(151):
 !EFI_ERROR (Status)

This happens if I add more items to the image, and if I reduce the size of the 
image, it works correctly again. This could be a clue to what could've gone 
wrong. Does anyone have any ideas what might've gone wrong?

I traced the decompression to LzmaDecode, and got lost in the code there.

Thanks!

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

View/Reply Online (#48084): https://edk2.groups.io/g/devel/message/48084
Mute This Topic: https://groups.io/mt/34296776/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] Problem with decompression on EDK2

2019-09-26 Thread Loh, Tien Hock
Hi

I have an issue while porting a new platform to EDK2. After porting the Stratix 
10 platform (ARM) to EDK2 it works correctly. However, when I tried to add more 
INF to the FDF file, it failed to decompress the image during boot time, log as 
below
INFO:DDR: DRAM calibration success.
INFO:Scrubbing ECC
INFO:Init HPS NOC's DDR Scheduler.
NOTICE:  BL2: v2.1(debug):v2.1-15-g5880144-dirty
NOTICE:  BL2: Built : 14:02:01, Aug 22 2019
INFO:BL2: Doing platform setup
INFO:BL2: Loading image id 3
INFO:Loading image id=3 at address 0xffe1c000
INFO:Image id=3 loaded: 0xffe1c000 - 0xffe22019
INFO:BL2: Loading image id 5
INFO:Loading image id=5 at address 0x5
INFO:Image id=5 loaded: 0x5 - 0x15
NOTICE:  BL2: Booting BL31
INFO:Entry point address = 0xffe1c000
INFO:SPSR = 0x3cd
NOTICE:  BL31: v2.1(release):v2.1-604-g3441952
NOTICE:  BL31: Built : 15:32:55, Sep 25 2019
UEFI firmware (version 1.0 built at 15:15:26 on Sep 26 2019)
Decompress Failed - Invalid Parameter

ASSERT_EFI_ERROR (Status = Not Found)
ASSERT [ArmPlatformPrePiUniCore] 
/nfs/png/disks/swuser_work_thloh/push/build/edk2/ArmPlatformPkg/PrePi/PrePi.c(151):
 !EFI_ERROR (Status)

This happens if I add more items to the image, and if I reduce the size of the 
image, it works correctly again. This could be a clue to what could've gone 
wrong. Does anyone have any ideas what might've gone wrong?
I traced the decompression to LzmaDecode, and got lost in the code there.

Thanks!


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

View/Reply Online (#48085): https://edk2.groups.io/g/devel/message/48085
Mute This Topic: https://groups.io/mt/34296776/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] Problem with decompression on EDK2

2019-09-30 Thread Loh, Tien Hock
Hi Liming,

Thanks for the quick response.
Can you help show me where I can find more information on the decompression 
(ie. how to test the image, etc.)?

Thanks
Tien Hock

> -Original Message-
> From: Gao, Liming 
> Sent: Sunday, September 29, 2019 3:06 PM
> To: Loh, Tien Hock ; devel@edk2.groups.io;
> ler...@redhat.com
> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> 
> Tien Hock:
>   The image is correct. It can be decompressed by lzma.
>   When FD is loaded into 0x5, I suspect that the image data can't fully
> read. Then, the decompress will failure.
> 
>   FD image last valid byte offset is 0xC1B8F. Its value is 0x83. When FD base
> address is 0x5, this position is 0x111B8F.
>   You can read this place and check its value.
> 
> Thanks
> Liming
> >-Original Message-
> >From: Loh, Tien Hock
> >Sent: Friday, September 27, 2019 3:05 PM
> >To: Gao, Liming ; devel@edk2.groups.io;
> >ler...@redhat.com
> >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> >Subject: RE: [edk2-devel] Problem with decompression on EDK2
> >
> >Hi Liming,
> >
> >I've tested another workaround - Move the FD file to a higher RAM
> >location (originally, it is loaded into 0x5, now it is at
> >0x1000) With the FD file moved to 0x1000, the decompression
> >works every time, even with bigger FD. I've attached the my FD file in the
> mail.
> >
> >Thanks
> >Tien Hock
> >
> >> -Original Message-
> >> From: Gao, Liming 
> >> Sent: Friday, September 27, 2019 8:13 AM
> >> To: devel@edk2.groups.io; ler...@redhat.com; Loh, Tien Hock
> >> 
> >> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> >> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> >>
> >> Can you share the generated FD image? I can help check whether it is
> >> generated correctly with compression.
> >>
> >> Thanks
> >> Liming
> >>
> >> >-Original Message-
> >> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> >> >Of Laszlo Ersek
> >> >Sent: Friday, September 27, 2019 3:22 AM
> >> >To: devel@edk2.groups.io; Loh, Tien Hock 
> >> >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> >> >Subject: Re: [edk2-devel] Problem with decompression on EDK2
> >> >
> >> >On 09/26/19 11:27, Loh, Tien Hock wrote:
> >> >> Hi
> >> >>
> >> >> I have an issue while porting a new platform to EDK2. After
> >> >> porting the
> >> >Stratix 10 platform (ARM) to EDK2 it works correctly. However, when
> >> >I tried to add more INF to the FDF file, it failed to decompress the
> >> >image during boot time, log as below
> >> >> INFO:DDR: DRAM calibration success.
> >> >> INFO:Scrubbing ECC
> >> >> INFO:Init HPS NOC's DDR Scheduler.
> >> >> NOTICE:  BL2: v2.1(debug):v2.1-15-g5880144-dirty
> >> >> NOTICE:  BL2: Built : 14:02:01, Aug 22 2019
> >> >> INFO:BL2: Doing platform setup
> >> >> INFO:BL2: Loading image id 3
> >> >> INFO:Loading image id=3 at address 0xffe1c000
> >> >> INFO:Image id=3 loaded: 0xffe1c000 - 0xffe22019
> >> >> INFO:BL2: Loading image id 5
> >> >> INFO:Loading image id=5 at address 0x5
> >> >> INFO:Image id=5 loaded: 0x5 - 0x15
> >> >> NOTICE:  BL2: Booting BL31
> >> >> INFO:Entry point address = 0xffe1c000
> >> >> INFO:SPSR = 0x3cd
> >> >> NOTICE:  BL31: v2.1(release):v2.1-604-g3441952
> >> >> NOTICE:  BL31: Built : 15:32:55, Sep 25 2019 UEFI firmware
> >> >> (version
> >> >> 1.0 built at 15:15:26 on Sep 26 2019) Decompress Failed - Invalid
> >> >> Parameter
> >> >>
> >> >> ASSERT_EFI_ERROR (Status = Not Found) ASSERT
> >> >> [ArmPlatformPrePiUniCore]
> >>
> >/nfs/png/disks/swuser_work_thloh/push/build/edk2/ArmPlatformPkg/Pr
> >eP
> >> i
> >> >/PrePi.c(151): !EFI_ERROR (Status)
> >> >>
> >> >> This happens if I add more items to the image, and if I reduce the
> >> >> size of the
> >> >image, it works correctly again. This could be a clue to what
> >> >could've gone wrong. Does anyone have 

Re: [edk2-devel] Problem with decompression on EDK2

2019-10-08 Thread Loh, Tien Hock
Ok, noted with thanks Liming. I'll try the tools out. 

Thanks
Tien Hock

> -Original Message-
> From: Gao, Liming 
> Sent: Tuesday, October 8, 2019 10:04 PM
> To: Loh, Tien Hock ; devel@edk2.groups.io;
> ler...@redhat.com
> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> 
> BaseTools VolInfo tool. Its input is the binary FvImage file. In the same
> directory, GuidedSectionTools.txt (built in the FV directory) should be here.
> 
> Thanks
> Liming
> > -----Original Message-
> > From: Loh, Tien Hock 
> > Sent: Tuesday, October 1, 2019 10:34 AM
> > To: Gao, Liming ; devel@edk2.groups.io;
> > ler...@redhat.com
> > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > Subject: RE: [edk2-devel] Problem with decompression on EDK2
> >
> > Hi Liming,
> >
> > Thanks for the quick response.
> > Can you help show me where I can find more information on the
> decompression (ie. how to test the image, etc.)?
> >
> > Thanks
> > Tien Hock
> >
> > > -Original Message-
> > > From: Gao, Liming 
> > > Sent: Sunday, September 29, 2019 3:06 PM
> > > To: Loh, Tien Hock ; devel@edk2.groups.io;
> > > ler...@redhat.com
> > > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > >
> > > Tien Hock:
> > >   The image is correct. It can be decompressed by lzma.
> > >   When FD is loaded into 0x5, I suspect that the image data
> > > can't fully read. Then, the decompress will failure.
> > >
> > >   FD image last valid byte offset is 0xC1B8F. Its value is 0x83.
> > > When FD base address is 0x5, this position is 0x111B8F.
> > >   You can read this place and check its value.
> > >
> > > Thanks
> > > Liming
> > > >-Original Message-
> > > >From: Loh, Tien Hock
> > > >Sent: Friday, September 27, 2019 3:05 PM
> > > >To: Gao, Liming ; devel@edk2.groups.io;
> > > >ler...@redhat.com
> > > >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > >Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > > >
> > > >Hi Liming,
> > > >
> > > >I've tested another workaround - Move the FD file to a higher RAM
> > > >location (originally, it is loaded into 0x5, now it is at
> > > >0x1000) With the FD file moved to 0x1000, the decompression
> > > >works every time, even with bigger FD. I've attached the my FD file
> > > >in the
> > > mail.
> > > >
> > > >Thanks
> > > >Tien Hock
> > > >
> > > >> -Original Message-
> > > >> From: Gao, Liming 
> > > >> Sent: Friday, September 27, 2019 8:13 AM
> > > >> To: devel@edk2.groups.io; ler...@redhat.com; Loh, Tien Hock
> > > >> 
> > > >> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > >> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > > >>
> > > >> Can you share the generated FD image? I can help check whether it
> > > >> is generated correctly with compression.
> > > >>
> > > >> Thanks
> > > >> Liming
> > > >>
> > > >> >-Original Message-
> > > >> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > >> >Behalf Of Laszlo Ersek
> > > >> >Sent: Friday, September 27, 2019 3:22 AM
> > > >> >To: devel@edk2.groups.io; Loh, Tien Hock
> > > >> >
> > > >> >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > >> >Subject: Re: [edk2-devel] Problem with decompression on EDK2
> > > >> >
> > > >> >On 09/26/19 11:27, Loh, Tien Hock wrote:
> > > >> >> Hi
> > > >> >>
> > > >> >> I have an issue while porting a new platform to EDK2. After
> > > >> >> porting the
> > > >> >Stratix 10 platform (ARM) to EDK2 it works correctly. However,
> > > >> >when I tried to add more INF to the FDF file, it failed to
> > > >> >decompress the image during boot time, log as below
> > > >> >> INFO:DDR: DRAM calibration success.
> > > >> >> INFO:Scrubbing ECC
&g

Re: [edk2-devel] [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.

2020-04-07 Thread Loh, Tien Hock
Hi Leif, Gaurav,

The changes look good to me, but I haven't tested it on Intel's SoCFPGA 
platform.
I will need some time to test it as I'm working on some other tasks, maybe in a 
week or so.

Thanks 

> -Original Message-
> From: Gaurav Jain 
> Sent: Tuesday, April 7, 2020 3:02 PM
> To: Ard Biesheuvel ; Leif Lindholm
> 
> Cc: devel@edk2.groups.io; Pankaj Bansal ; Haojian
> Zhuang ; Loh, Tien Hock
> 
> Subject: RE: [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock
> Transfer Limit 65535 in R/W.
> 
> 
> 
> > -Original Message-
> > From: Ard Biesheuvel 
> > Sent: Monday, April 6, 2020 7:42 PM
> > To: Leif Lindholm ; Gaurav Jain
> > 
> > Cc: devel@edk2.groups.io; Pankaj Bansal ;
> > Haojian Zhuang ; Loh, Tien Hock
> > 
> > Subject: [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock
> > Transfer Limit 65535 in R/W.
> >
> > Caution: EXT Email
> >
> > On 4/6/20 4:08 PM, Leif Lindholm wrote:
> > > Hi Gaurav,
> > >
> > > Haojian, Tien Hock - can you help review/test this change?
> > >
> > > Best Regards,
> > >
> > > Leif
> > >
> > > On Fri, Apr 03, 2020 at 14:54:07 +0530, Gaurav Jain wrote:
> > >> Moved BlockCount calculation below BufferSize Validation checks.
> > >> First Ensure Buffersize is Not Zero and multiple of Media BlockSize.
> > >> then calculate BlockCount and perform Block checks.
> > >>
> > >> Corrected BlockCount calculation, as BufferSize is multiple of
> > >> BlockSize, So adding (BlockSize-1) bytes to BufferSize and then
> > >> divide by BlockSize will have no impact on BlockCount.
> > >>
> > >> Reading Large Images from MMC causes errors.
> > >> As per SD Host Controller Spec version 4.20, Restriction of 16-bit
> > >> Block Count transfer is 65535.
> > >> Max block transfer limit in single cmd is 65535 blocks.
> > >> Added Max Block check that can be processed is 0x.
> > >> then Update BlockCount on the basis of MaxBlock.
> > >>
> > >> Signed-off-by: Gaurav Jain 
> >
> >
> > Hello Gaurav,
> >
> > Could you please elaborate on the underlying need for this change? If
> > you are considering using this driver for future NXP platforms, I
> > should point out that this legacy driver is only kept around for
> > existing users, and new users should use the driver stack in
> > MdeModulePkg, which is based on the UEFI spec.
> >
> > --
> > Ard.
> 
> Hello Ard
> 
> This change is for existing Platforms as well, that are using EmbeddedPkg
> driver.
> I can see Max Block Transfer Limit in MdeModulePkg also.
> This Limit is not defined in EmbeddedPkg, which is causing errors on NXP
> existing platform While reading Large images from MMC.
> Block transfer limit is defined in SD spec.
> 
> Regards
> Gaurav Jain
> >
> >
> >
> > >> ---
> > >>   EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c | 38
> > ---
> > >>   1 file changed, 25 insertions(+), 13 deletions(-)
> > >>
> > >> diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > >> b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > >> index 17c20c0159ba..b508c466d9c5 100644
> > >> --- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > >> +++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > >> @@ -242,6 +242,8 @@ MmcIoBlocks (
> > >> UINTN   BytesRemainingToBeTransfered;
> > >> UINTN   BlockCount;
> > >> UINTN   ConsumeSize;
> > >> +  UINT32  MaxBlock;
> > >> +  UINTN   RemainingBlock;
> > >>
> > >> BlockCount = 1;
> > >> MmcHostInstance = MMC_HOST_INSTANCE_FROM_BLOCK_IO_THIS
> > (This); @@
> > >> -262,19 +264,6 @@ MmcIoBlocks (
> > >>   return EFI_NO_MEDIA;
> > >> }
> > >>
> > >> -  if (MMC_HOST_HAS_ISMULTIBLOCK(MmcHost) && MmcHost-
> > >IsMultiBlock(MmcHost)) {
> > >> -BlockCount = (BufferSize + This->Media->BlockSize - 1) / 
> > >> This->Media-
> > >BlockSize;
> > >> -  }
> > >> -
> > >> -  // All blocks must be within the device
> > >> -  if ((Lba + (BufferSize / This->Media->BlockSize)) >
> > >> (This->Media-
> > >LastBlock + 1)) {
> > >> -  

Re: [edk2-devel] [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.

2020-04-28 Thread Loh, Tien Hock
Hi Ard,

I have checked the patch and it looks good.

However, I can no longer test the patch as the new DwMmc driver no longer uses 
the protocol.
Sorry for the delay, I initially thought I can test it until I investigated 
further today. 

Thanks 


> -Original Message-
> From: Pankaj Bansal 
> Sent: Monday, April 27, 2020 2:19 PM
> To: Ard Biesheuvel ; Leif Lindholm
> ; Gaurav Jain ; Meenakshi
> Aggarwal 
> Cc: devel@edk2.groups.io; Haojian Zhuang ; Loh,
> Tien Hock ; Varun Sethi 
> Subject: RE: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock Transfer
> Limit 65535 in R/W.
> 
> + Meenakshi
> 
> > -Original Message-
> > From: Ard Biesheuvel 
> > Sent: Monday, April 6, 2020 7:42 PM
> > To: Leif Lindholm ; Gaurav Jain
> > 
> > Cc: devel@edk2.groups.io; Pankaj Bansal ;
> > Haojian Zhuang ; Loh, Tien Hock
> > 
> > Subject: Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock Transfer
> > Limit 65535 in R/W.
> >
> > On 4/6/20 4:08 PM, Leif Lindholm wrote:
> > > Hi Gaurav,
> > >
> > > Haojian, Tien Hock - can you help review/test this change?
> > >
> > > Best Regards,
> > >
> > > Leif
> > >
> > > On Fri, Apr 03, 2020 at 14:54:07 +0530, Gaurav Jain wrote:
> > >> Moved BlockCount calculation below BufferSize Validation checks.
> > >> First Ensure Buffersize is Not Zero and multiple of Media BlockSize.
> > >> then calculate BlockCount and perform Block checks.
> > >>
> > >> Corrected BlockCount calculation, as BufferSize is multiple of
> > >> BlockSize, So adding (BlockSize-1) bytes to BufferSize and then
> > >> divide by BlockSize will have no impact on BlockCount.
> > >>
> > >> Reading Large Images from MMC causes errors.
> > >> As per SD Host Controller Spec version 4.20, Restriction of 16-bit
> > >> Block Count transfer is 65535.
> > >> Max block transfer limit in single cmd is 65535 blocks.
> > >> Added Max Block check that can be processed is 0x.
> > >> then Update BlockCount on the basis of MaxBlock.
> > >>
> > >> Signed-off-by: Gaurav Jain 
> >
> >
> > Hello Gaurav,
> >
> > Could you please elaborate on the underlying need for this change? If
> > you are considering using this driver for future NXP platforms, I
> > should point out that this legacy driver is only kept around for
> > existing users, and new users should use the driver stack in
> > MdeModulePkg, which is based on the UEFI spec.
> >
> > --
> > Ard.
> >
> >
> >


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

View/Reply Online (#58295): https://edk2.groups.io/g/devel/message/58295
Mute This Topic: https://groups.io/mt/72744881/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.

2020-04-26 Thread Loh, Tien Hock
Hi Gaurav,

Sorry for the late reply. I wanted to test the patch last week but were fixing 
a bug in our platform initialization bug that caused MMC to fail, thus I were 
unable to test.
I'll test it in a few days. 

Thanks! 

> -Original Message-
> From: Gaurav Jain 
> Sent: Tuesday, April 21, 2020 2:40 PM
> To: Loh, Tien Hock ; Ard Biesheuvel
> ; Leif Lindholm 
> Cc: devel@edk2.groups.io; Pankaj Bansal ; Haojian
> Zhuang 
> Subject: RE: [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock
> Transfer Limit 65535 in R/W.
> 
> Hi Tien Hock
> 
> Can you help to review the patch?
> 
> Regards
> Gaurav Jain
> 
> > -Original Message-
> > From: Loh, Tien Hock 
> > Sent: Tuesday, April 7, 2020 1:23 PM
> > To: Gaurav Jain ; Ard Biesheuvel
> > ; Leif Lindholm 
> > Cc: devel@edk2.groups.io; Pankaj Bansal ;
> > Haojian Zhuang 
> > Subject: RE: [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock
> > Transfer Limit 65535 in R/W.
> >
> > Caution: EXT Email
> >
> > Hi Leif, Gaurav,
> >
> > The changes look good to me, but I haven't tested it on Intel's
> > SoCFPGA platform.
> > I will need some time to test it as I'm working on some other tasks,
> > maybe in a week or so.
> >
> > Thanks
> >
> > > -Original Message-
> > > From: Gaurav Jain 
> > > Sent: Tuesday, April 7, 2020 3:02 PM
> > > To: Ard Biesheuvel ; Leif Lindholm
> > > 
> > > Cc: devel@edk2.groups.io; Pankaj Bansal ;
> > > Haojian Zhuang ; Loh, Tien Hock
> > > 
> > > Subject: RE: [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added
> > MaxBlock
> > > Transfer Limit 65535 in R/W.
> > >
> > >
> > >
> > > > -Original Message-
> > > > From: Ard Biesheuvel 
> > > > Sent: Monday, April 6, 2020 7:42 PM
> > > > To: Leif Lindholm ; Gaurav Jain
> > > > 
> > > > Cc: devel@edk2.groups.io; Pankaj Bansal ;
> > > > Haojian Zhuang ; Loh, Tien Hock
> > > > 
> > > > Subject: [EXT] Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock
> > > > Transfer Limit 65535 in R/W.
> > > >
> > > > Caution: EXT Email
> > > >
> > > > On 4/6/20 4:08 PM, Leif Lindholm wrote:
> > > > > Hi Gaurav,
> > > > >
> > > > > Haojian, Tien Hock - can you help review/test this change?
> > > > >
> > > > > Best Regards,
> > > > >
> > > > > Leif
> > > > >
> > > > > On Fri, Apr 03, 2020 at 14:54:07 +0530, Gaurav Jain wrote:
> > > > >> Moved BlockCount calculation below BufferSize Validation checks.
> > > > >> First Ensure Buffersize is Not Zero and multiple of Media BlockSize.
> > > > >> then calculate BlockCount and perform Block checks.
> > > > >>
> > > > >> Corrected BlockCount calculation, as BufferSize is multiple of
> > > > >> BlockSize, So adding (BlockSize-1) bytes to BufferSize and then
> > > > >> divide by BlockSize will have no impact on BlockCount.
> > > > >>
> > > > >> Reading Large Images from MMC causes errors.
> > > > >> As per SD Host Controller Spec version 4.20, Restriction of
> > > > >> 16-bit Block Count transfer is 65535.
> > > > >> Max block transfer limit in single cmd is 65535 blocks.
> > > > >> Added Max Block check that can be processed is 0x.
> > > > >> then Update BlockCount on the basis of MaxBlock.
> > > > >>
> > > > >> Signed-off-by: Gaurav Jain 
> > > >
> > > >
> > > > Hello Gaurav,
> > > >
> > > > Could you please elaborate on the underlying need for this change?
> > > > If you are considering using this driver for future NXP platforms,
> > > > I should point out that this legacy driver is only kept around for
> > > > existing users, and new users should use the driver stack in
> > > > MdeModulePkg, which is based on the UEFI spec.
> > > >
> > > > --
> > > > Ard.
> > >
> > > Hello Ard
> > >
> > > This change is for existing Platforms as well, that are using
> > > EmbeddedPkg driver.
> > > I can see Max Block Transfer Limit in MdeModulePkg also.
> > > This Limit is not defined in EmbeddedPkg, which is causing errors on
> > > NXP existing platfor

Re: [edk2-devel] [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.

2020-04-29 Thread Loh, Tien Hock
Hi Leif,

Yes, that's a Reviewed-by. 

Thanks. 

> -Original Message-
> From: Leif Lindholm 
> Sent: Wednesday, April 29, 2020 7:16 PM
> To: Loh, Tien Hock 
> Cc: Pankaj Bansal ; Ard Biesheuvel
> ; Gaurav Jain ; Meenakshi
> Aggarwal ; devel@edk2.groups.io; Haojian
> Zhuang ; Varun Sethi 
> Subject: Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock Transfer
> Limit 65535 in R/W.
> 
> Hi Tien Hock,
> 
> Can I take that as a Reviewed-by:?
> 
> Regards,
> 
> Leif
> 
> On Wed, Apr 29, 2020 at 05:17:18 +, Loh, Tien Hock wrote:
> > Hi Ard,
> >
> > I have checked the patch and it looks good.
> >
> > However, I can no longer test the patch as the new DwMmc driver no longer
> uses the protocol.
> > Sorry for the delay, I initially thought I can test it until I investigated 
> > further
> today.
> >
> > Thanks
> >
> >
> > > -Original Message-
> > > From: Pankaj Bansal 
> > > Sent: Monday, April 27, 2020 2:19 PM
> > > To: Ard Biesheuvel ; Leif Lindholm
> > > ; Gaurav Jain ; Meenakshi
> > > Aggarwal 
> > > Cc: devel@edk2.groups.io; Haojian Zhuang
> > > ; Loh, Tien Hock
> > > ; Varun Sethi 
> > > Subject: RE: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock
> Transfer
> > > Limit 65535 in R/W.
> > >
> > > + Meenakshi
> > >
> > > > -Original Message-
> > > > From: Ard Biesheuvel 
> > > > Sent: Monday, April 6, 2020 7:42 PM
> > > > To: Leif Lindholm ; Gaurav Jain
> > > > 
> > > > Cc: devel@edk2.groups.io; Pankaj Bansal ;
> > > > Haojian Zhuang ; Loh, Tien Hock
> > > > 
> > > > Subject: Re: [PATCH 1/1] EmbeddedPkg/MmcDxe: Added MaxBlock
> > > > Transfer Limit 65535 in R/W.
> > > >
> > > > On 4/6/20 4:08 PM, Leif Lindholm wrote:
> > > > > Hi Gaurav,
> > > > >
> > > > > Haojian, Tien Hock - can you help review/test this change?
> > > > >
> > > > > Best Regards,
> > > > >
> > > > > Leif
> > > > >
> > > > > On Fri, Apr 03, 2020 at 14:54:07 +0530, Gaurav Jain wrote:
> > > > >> Moved BlockCount calculation below BufferSize Validation checks.
> > > > >> First Ensure Buffersize is Not Zero and multiple of Media BlockSize.
> > > > >> then calculate BlockCount and perform Block checks.
> > > > >>
> > > > >> Corrected BlockCount calculation, as BufferSize is multiple of
> > > > >> BlockSize, So adding (BlockSize-1) bytes to BufferSize and then
> > > > >> divide by BlockSize will have no impact on BlockCount.
> > > > >>
> > > > >> Reading Large Images from MMC causes errors.
> > > > >> As per SD Host Controller Spec version 4.20, Restriction of
> > > > >> 16-bit Block Count transfer is 65535.
> > > > >> Max block transfer limit in single cmd is 65535 blocks.
> > > > >> Added Max Block check that can be processed is 0x.
> > > > >> then Update BlockCount on the basis of MaxBlock.
> > > > >>
> > > > >> Signed-off-by: Gaurav Jain 
> > > >
> > > >
> > > > Hello Gaurav,
> > > >
> > > > Could you please elaborate on the underlying need for this change?
> > > > If you are considering using this driver for future NXP platforms,
> > > > I should point out that this legacy driver is only kept around for
> > > > existing users, and new users should use the driver stack in
> > > > MdeModulePkg, which is based on the UEFI spec.
> > > >
> > > > --
> > > > Ard.
> > > >
> > > >
> > > >
> >

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

View/Reply Online (#58349): https://edk2.groups.io/g/devel/message/58349
Mute This Topic: https://groups.io/mt/72744881/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 0/3] add DwMmcHcDxe driver

2020-06-16 Thread Loh, Tien Hock
Hi Leif, Ard,

I talked to Haojian and got to know that you wanted the patch to go into the 
MdeModulePkg. 
I don't have a lot of context on it, do you have specific requirement?
The driver at its current state already uses the MdeModulePkg's SdDxe's API, so 
some more specific changes would help me understand and fix the concern you 
have.

Thanks

> -Original Message-
> From: Loh, Tien Hock
> Sent: Thursday, September 12, 2019 12:59 PM
> To: Haojian Zhuang ; leif.lindh...@linaro.org;
> ard.biesheu...@linaro.org; christopher...@microsoft.com
> Cc: devel@edk2.groups.io; thlo...@gmail.com
> Subject: RE: [PATCH v2 0/3] add DwMmcHcDxe driver
> 
> Hi Ard, Leif, Christopher,
> 
> Any comments on the patches?
> 
> Thanks!
> Tien Hock
> > -Original Message-
> > From: Haojian Zhuang 
> > Sent: Monday, September 2, 2019 5:31 PM
> > To: Loh, Tien Hock 
> > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org;
> > christopher...@microsoft.com; devel@edk2.groups.io; thlo...@gmail.com
> > Subject: Re: [PATCH v2 0/3] add DwMmcHcDxe driver
> >
> > Hi Leif, Ard, Christopher,
> >
> > Could you help to share the comments on this patch set? Thanks a lot.
> >
> > Best Regards
> > Haojian
> >
> > On Thu, Aug 15, 2019 at 09:09:19AM +, Loh, Tien Hock wrote:
> > > Hi Leif, Ard, Christopher,
> > >
> > > Haojian and I have tested the driver on 2 platforms, any further
> > > comments
> > on this?
> > >
> > > Thanks
> > > Tien Hock
> > >
> > > > -Original Message-
> > > > From: Haojian Zhuang 
> > > > Sent: Tuesday, July 30, 2019 3:33 PM
> > > > To: Loh, Tien Hock ;
> > > > leif.lindh...@linaro.org; ard.biesheu...@linaro.org;
> > > > christopher...@microsoft.com
> > > > Cc: devel@edk2.groups.io; thlo...@gmail.com
> > > > Subject: Re: [PATCH v2 0/3] add DwMmcHcDxe driver
> > > >
> > > > On Wed, Jul 24, 2019 at 05:26:03PM +0800, tien.hock@intel.com
> > wrote:
> > > > > From: "Tien Hock, Loh" 
> > > > >
> > > > > Changelog:
> > > > > v3:
> > > > >   * Fix an issue in NonDiscoverableDeviceDxe driver where it did
> > > > > not
> > > > invalidate
> > > > > cache before copying the memory.
> > > > > v2:
> > > > >   *Split DwMmcHcDxe driver into two patches. One is for
> > > > > PlatformDwMmc
> > > > protocol,
> > > > >and the other is for DwMmcHcDxe driver.
> > > > > v1:
> > > > >   *Add NonDiscoverableDeviceDxe for embedded platform. Make
> > > > DwMmcHcDxe driver
> > > > >to support both eMMC and SD controller.
> > > > >
> > > > > Haojian Zhuang (3):
> > > > >   EmbeddedPkg: add NonDiscoverableDeviceDxe driver
> > > > >   EmbeddedPkg: add PlatformDwMmc protocol
> > > > >   EmbeddedPkg/Drivers: add DwMmcHcDxe driver
> > > > >
> > > > >  .../Drivers/DwMmcHcDxe/ComponentName.c|  214 ++
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c   | 1295
> > > > +
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec |   40 +
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h   |  815
> > ++
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf |   69 +
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c | 2366
> > > > +
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h |  983 +++
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c   | 1042
> > 
> > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c | 1104 
> > > > >  EmbeddedPkg/EmbeddedPkg.dec   |1 +
> > > > >  EmbeddedPkg/Include/Protocol/PlatformDwMmc.h  |   79 +
> > > > >  .../NonDiscoverableDeviceDxe/ComponentName.c  |  124 +
> > > > >  .../NonDiscoverableDeviceDxe.c|  243 ++
> > > > >  .../NonDiscoverableDeviceDxe.inf  |   52 +
> > > > >  .../NonDiscoverableDeviceIo.c |  976 +++
> > > > >  .../NonDiscoverableDeviceIo.h |   92 +
> > > > >  16 files changed, 9495 insertions(+)  create mode 100644
> > > > EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c
> > > > >  create mode 

Re: [edk2-devel] [PATCH v2 0/3] add DwMmcHcDxe driver

2020-06-19 Thread Loh, Tien Hock
Hi Leif, Ard,

Can you help on the questions I have below?

Thanks! 

> -Original Message-
> From: Loh, Tien Hock
> Sent: Tuesday, June 16, 2020 4:39 PM
> To: 'Haojian Zhuang' ; 'leif.lindh...@linaro.org'
> ; 'ard.biesheu...@linaro.org'
> ; 'christopher...@microsoft.com'
> 
> Cc: 'devel@edk2.groups.io' ; 'thlo...@gmail.com'
> 
> Subject: RE: [PATCH v2 0/3] add DwMmcHcDxe driver
> 
> Hi Leif, Ard,
> 
> I talked to Haojian and got to know that you wanted the patch to go into the
> MdeModulePkg.
> I don't have a lot of context on it, do you have specific requirement?
> The driver at its current state already uses the MdeModulePkg's SdDxe's API, 
> so
> some more specific changes would help me understand and fix the concern you
> have.
> 
> Thanks
> 
> > -Original Message-
> > From: Loh, Tien Hock
> > Sent: Thursday, September 12, 2019 12:59 PM
> > To: Haojian Zhuang ;
> > leif.lindh...@linaro.org; ard.biesheu...@linaro.org;
> > christopher...@microsoft.com
> > Cc: devel@edk2.groups.io; thlo...@gmail.com
> > Subject: RE: [PATCH v2 0/3] add DwMmcHcDxe driver
> >
> > Hi Ard, Leif, Christopher,
> >
> > Any comments on the patches?
> >
> > Thanks!
> > Tien Hock
> > > -Original Message-
> > > From: Haojian Zhuang 
> > > Sent: Monday, September 2, 2019 5:31 PM
> > > To: Loh, Tien Hock 
> > > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org;
> > > christopher...@microsoft.com; devel@edk2.groups.io;
> > > thlo...@gmail.com
> > > Subject: Re: [PATCH v2 0/3] add DwMmcHcDxe driver
> > >
> > > Hi Leif, Ard, Christopher,
> > >
> > > Could you help to share the comments on this patch set? Thanks a lot.
> > >
> > > Best Regards
> > > Haojian
> > >
> > > On Thu, Aug 15, 2019 at 09:09:19AM +, Loh, Tien Hock wrote:
> > > > Hi Leif, Ard, Christopher,
> > > >
> > > > Haojian and I have tested the driver on 2 platforms, any further
> > > > comments
> > > on this?
> > > >
> > > > Thanks
> > > > Tien Hock
> > > >
> > > > > -Original Message-
> > > > > From: Haojian Zhuang 
> > > > > Sent: Tuesday, July 30, 2019 3:33 PM
> > > > > To: Loh, Tien Hock ;
> > > > > leif.lindh...@linaro.org; ard.biesheu...@linaro.org;
> > > > > christopher...@microsoft.com
> > > > > Cc: devel@edk2.groups.io; thlo...@gmail.com
> > > > > Subject: Re: [PATCH v2 0/3] add DwMmcHcDxe driver
> > > > >
> > > > > On Wed, Jul 24, 2019 at 05:26:03PM +0800,
> > > > > tien.hock@intel.com
> > > wrote:
> > > > > > From: "Tien Hock, Loh" 
> > > > > >
> > > > > > Changelog:
> > > > > > v3:
> > > > > >   * Fix an issue in NonDiscoverableDeviceDxe driver where it
> > > > > > did not
> > > > > invalidate
> > > > > > cache before copying the memory.
> > > > > > v2:
> > > > > >   *Split DwMmcHcDxe driver into two patches. One is for
> > > > > > PlatformDwMmc
> > > > > protocol,
> > > > > >and the other is for DwMmcHcDxe driver.
> > > > > > v1:
> > > > > >   *Add NonDiscoverableDeviceDxe for embedded platform. Make
> > > > > DwMmcHcDxe driver
> > > > > >to support both eMMC and SD controller.
> > > > > >
> > > > > > Haojian Zhuang (3):
> > > > > >   EmbeddedPkg: add NonDiscoverableDeviceDxe driver
> > > > > >   EmbeddedPkg: add PlatformDwMmc protocol
> > > > > >   EmbeddedPkg/Drivers: add DwMmcHcDxe driver
> > > > > >
> > > > > >  .../Drivers/DwMmcHcDxe/ComponentName.c|  214 ++
> > > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c   | 1295
> > > > > +
> > > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec |   40 +
> > > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h   |  815
> > > ++
> > > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf |   69 +
> > > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c | 2366
> > > > > +
> > > > > >  EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h |  983
> +++
> > > >

Re: [edk2-devel] [PATCH V5 1/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver

2021-04-28 Thread Loh, Tien Hock
Andrew, Ard,

In that case then I will update the patch to address Mike’s concerns and send a 
new version up.

Thanks!

From: Andrew Fish 
Sent: Wednesday, April 28, 2021 10:58 PM
To: Ard Biesheuvel 
Cc: Kinney, Michael D ; edk2-devel-groups-io 
; Loh, Tien Hock ; 
thlo...@gmail.com; Leif Lindholm ; Ard Biesheuvel 

Subject: Re: [edk2-devel] [PATCH V5 1/1] EmbeddedPkg: DwMmcHcDxe: Add support 
for Designware SDMMC driver




On Apr 28, 2021, at 6:03 AM, Ard Biesheuvel 
mailto:a...@kernel.org>> wrote:

On Tue, 27 Apr 2021 at 21:31, Kinney, Michael D
mailto:michael.d.kin...@intel.com>> wrote:


This is an example of another approach.  This module uses PCI I/O or IoLib 
based on the type of device.



https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/Pci/PciSioSerialDxe



No additional protocols or lib classes/instances.  Instead, the register access 
APIs are included in the module and based on the type of device detected, it 
uses PCI I/O or IoLib:



https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f548ad23b6ab22d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1327

https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f548ad23b6ab22d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1358



This technique could for PCI I/O vs MMIO register access.  You would need to 
add more APIs for the use of PCI I/O or DmaLib for DMA access.

Is it really worth the effort to rewrite this code?

This patch has been circulating for a while now, and I fail to see the
point of refactoring and splitting up this code, given how unlikely it
is that DesignWare will ever put a real PCI frontend on this IP. The
SD/MMC override protocol was intended for implementations that are
almost SDHCI compliant, but have some quirks that need to be worked
around.

Ard,

If we don’t see any potential value for making it more portable I’m OK with 
going with the current patch style.

Thanks,

Andrew Fish


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74585): https://edk2.groups.io/g/devel/message/74585
Mute This Topic: https://groups.io/mt/81516685/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH V4 1/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver

2021-03-19 Thread Loh, Tien Hock
From: Loh Tien Hock 

This adds support for Designware SDMMC driver. The SDMMC driver depends on
MdeModulePkg/Bus/Sd/, and produces EFI_SD_MMC_PASS_THRU_PROTOCOL. The
driver uses MMIO to read/write, and uses
gEdkiiNonDiscoverableDeviceProtocolGuid. Platform needs to register device
with gEdkiiNonDiscoverableDeviceProtocolGuid.

https://github.com/thloh85-intel/edk2/tree/dwmmc_driver_v4

--
v4:
  * Rewrite the MMIO section so that it reuses
gEdkiiNonDiscoverableDeviceProtocolGuid, thus no extra NonDiscoverable
driver is needed


Tien Hock, Loh (1):
  EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver

 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec  |   40 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf  |   70 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h|  817 ++
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h  |  985 
 EmbeddedPkg/Include/Protocol/PlatformDwMmc.h   |   79 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c |  214 +++
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c| 1296 
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c  | 1602 
 EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c| 1042 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c  | 1105 ++
 10 files changed, 7250 insertions(+)
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h
 create mode 100644 EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c

-- 
2.12.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73040): https://edk2.groups.io/g/devel/message/73040
Mute This Topic: https://groups.io/mt/81450752/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver

2021-03-08 Thread Loh, Tien Hock
Please skip this patch, I missed one file in the patch.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72570): https://edk2.groups.io/g/devel/message/72570
Mute This Topic: https://groups.io/mt/81194433/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 0/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver

2021-03-08 Thread Loh, Tien Hock
From: Loh Tien Hock 

This adds support for Designware SDMMC driver. The SDMMC driver depends on
MdeModulePkg/Bus/Sd/, and produces EFI_SD_MMC_PASS_THRU_PROTOCOL. The
driver uses MMIO to read/write, and uses
gEdkiiNonDiscoverableDeviceProtocolGuid. Platform needs to register device
with gEdkiiNonDiscoverableDeviceProtocolGuid.

Tien Hock, Loh (1):
  EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver

 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec  |   40 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf  |   70 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h|  817 ++
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h  |  985 
 EmbeddedPkg/Include/Protocol/PlatformDwMmc.h   |   79 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c |  214 +++
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c| 1296 
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c  | 1603 
 EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c| 1042 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c  | 1105 ++
 10 files changed, 7251 insertions(+)
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h
 create mode 100644 EmbeddedPkg/Include/Protocol/PlatformDwMmc.h
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c

-- 
2.12.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72575): https://edk2.groups.io/g/devel/message/72575
Mute This Topic: https://groups.io/mt/81196313/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 0/1] Add support for Designware SDMMC driver

2021-03-08 Thread Loh, Tien Hock
From: Loh Tien Hock 

This adds support for Designware SDMMC driver. The SDMMC driver depends on
MdeModulePkg/Bus/Sd/, and produces EFI_SD_MMC_PASS_THRU_PROTOCOL. The
driver uses MMIO to read/write, and uses
gEdkiiNonDiscoverableDeviceProtocolGuid. Platform needs to register device
with gEdkiiNonDiscoverableDeviceProtocolGuid.

Tien Hock, Loh (1):
  EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver

 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec  |   40 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf  |   70 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h|  817 ++
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h  |  985 
 EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c |  214 +++
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c| 1305 
 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c  | 1603 
 EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c| 1042 +
 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c  | 1105 ++
 9 files changed, 7181 insertions(+)
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.dec
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.inf
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.h
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.h
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/ComponentName.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHcDxe.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/DwMmcHci.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/EmmcDevice.c
 create mode 100644 EmbeddedPkg/Drivers/DwMmcHcDxe/SdDevice.c

-- 
2.12.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72562): https://edk2.groups.io/g/devel/message/72562
Mute This Topic: https://groups.io/mt/81194432/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 3/3] EmbeddedPkg/Drivers: add DwMmcHcDxe driver

2021-02-19 Thread Loh, Tien Hock
Hi Leif, Ard,

Sorry I've been working non EDK2 work for the past year and am now back to 
working on this

Can you comment on the changes that is needed to get this driver upstreamed?

Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71839): https://edk2.groups.io/g/devel/message/71839
Mute This Topic: https://groups.io/mt/30914317/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-