Re: [edk2] [edk2-platforms][PATCH] Platform/Hisilicon/HiKey960: add skeleton of HiKey960

2018-02-08 Thread Haojian Zhuang
On 7 February 2018 at 01:29, Leif Lindholm wrote: > On Mon, Feb 05, 2018 at 04:25:52PM +0800, Haojian Zhuang wrote: >> Add skeleton of HiKey960 platform. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Haojian Zhuang >> --- >>

[edk2] [PATCH v2 0/4] support HiKey960

2018-02-09 Thread Haojian Zhuang
v2: * Use Hisilicon common file. * Move SerialPorLib & DebugLib of DXE_RUNTIME out of Hisilicon.dsc.inc. * Remove unused PCD values from HiKey960 dsc file. * Fix to enter boot manager on HiKey. v1: * Support the skeleton of HiKey960. Haojian Zhuang (4): Platform/Hisilicon/H

[edk2] [PATCH v2 1/4] Platform/Hisilicon/HiKey: include DxePcdLib for HiiDatabase

2018-02-09 Thread Haojian Zhuang
Include DxePcdLib for HiiDatabase. Otherwise, PlatformBootManager can't be launched successfully. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/HiKey/HiKey.dsc | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff

[edk2] [PATCH v2 4/4] Platform/Hisilicon/HiKey960: add skeleton of HiKey960

2018-02-09 Thread Haojian Zhuang
Add skeleton of HiKey960 platform. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/HiKey960/HiKey960.dsc | 260 + Platform/Hisilicon/HiKey960/HiKey960.fdf | 214 + .../HiKey960

[edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime lib from common file

2018-02-09 Thread Haojian Zhuang
With the SerialPortLib and DebugLib, Dxe runtime driver can't be executed well on HiKey. Serial logs are missing. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/D02/Pv660D02.dsc | 2 ++ Platform/Hisilicon/D03/D03.dsc

[edk2] [PATCH v2 2/4] Platform/Hisilicon/HiKey: use Hisilicon common file

2018-02-09 Thread Haojian Zhuang
Use common file Hisilicon.dsc.inc/Hisilicon.fdf.inc to reduce redundant contents in both HiKey.dsc and HiKey.fdf. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/HiKey/HiKey.dsc | 204 +++-- Platform

Re: [edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime lib from common file

2018-02-12 Thread Haojian Zhuang
>From: Leif Lindholm >Sent: Monday, February 12, 2018 11:45 AM >To: Haojian Zhuang >Cc: edk2-devel@lists.01.org; linaro-u...@lists.linaro.org; >ard.sheu...@linaro.org; heyi@linaro.org >Subject: Re: [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime lib from >commo

Re: [edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime lib from common file

2018-02-12 Thread Haojian Zhuang
>From: Ard Biesheuvel >Sent: Monday, February 12, 2018 12:05 PM >To: Haojian Zhuang >Cc: Leif Lindholm; edk2-devel@lists.01.org; heyi@linaro.org; >ard.sheu...@linaro.org; linaro-u...@lists.linaro.org >Subject: Re: [edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe

Re: [edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime lib from common file

2018-02-12 Thread Haojian Zhuang
>From: Ard Biesheuvel >Sent: Monday, February 12, 2018 12:22 PM >To: Haojian Zhuang >Cc: Leif Lindholm; edk2-devel@lists.01.org; heyi@linaro.org; >linaro-u...@lists.linaro.org >Subject: Re: [edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime >lib from

Re: [edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime lib from common file

2018-02-12 Thread Haojian Zhuang
On 02/13/2018 08:23 AM, Guo Heyi wrote: > Hi Haojian, > > Dw8250SerialPortRuntimeLib actually depends on DW8250 hardware IP; if there > isn't such device on Hikey, then you can't use this library instance indeed. > > But I think PeiDxeDebugLibReportStatusCode should be some common code, however >

[edk2] [PATCH 1/2] Platform/Hisilicon/HiKey960: add boot options

2018-02-15 Thread Haojian Zhuang
Add four boot options in emu variable region. They are "Boot on SD", "Grub", "Android Boot" and "Android Fastboot". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/HiKey960/HiKey960.dsc | 3

[edk2] [PATCH 2/2] Platform/Hisilicon/HiKey: add boot options

2018-02-15 Thread Haojian Zhuang
Add four boot options into emu variable region. They're "Boot on SD", "Grub", "Android Boot" and "Android Fastboot". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/HiKey/HiKey.dsc |

[edk2] [PATCH 0/2] add boot options in HiKey

2018-02-15 Thread Haojian Zhuang
ChangeLog: v1: *Create boot options in emu variable region. Haojian Zhuang (2): Platform/Hisilicon/HiKey960: add boot options Platform/Hisilicon/HiKey: add boot options Platform/Hisilicon/HiKey/HiKey.dsc | 3 + Platform/Hisilicon/HiKey/HiKey.fdf | 239

[edk2] [PATCH] ArmPkg/PlatformBootManagerLib: add hotkey to fastboot

2018-02-15 Thread Haojian Zhuang
It checkes whether AndroidFastbootApp exists in boot menu. If it exists, add hotkey 'F' to AndroidFastbootApp. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 40 ++ 1 fi

Re: [edk2] [PATCH v2 3/4] Platform/Hisilicon: move out dxe runtime lib from common file

2018-02-15 Thread Haojian Zhuang
On 02/15/2018 11:41 PM, Leif Lindholm wrote: > On Mon, Feb 12, 2018 at 11:45:06AM +, Leif Lindholm wrote: >> On Sat, Feb 10, 2018 at 01:31:06AM +0800, Haojian Zhuang wrote: >>> With the SerialPortLib and DebugLib, Dxe runtime driver can't >>> be executed well o

[edk2] [PATCH v3 1/4] Platform/Hisilicon/HiKey: include DxePcdLib for HiiDatabase

2018-02-15 Thread Haojian Zhuang
Include DxePcdLib for HiiDatabase. Otherwise, PlatformBootManager can't be launched successfully. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang Reviewed-by: Leif Lindholm --- Platform/Hisilicon/HiKey/HiKey.dsc | 7 +-- 1 file changed, 5 inser

[edk2] [PATCH v3 0/4] support hikey960

2018-02-15 Thread Haojian Zhuang
r on HiKey. v1: * Support the skeleton of HiKey960. Haojian Zhuang (4): Platform/Hisilicon/HiKey: include DxePcdLib for HiiDatabase Platform/Hisilicon: move out SerialPortLib from common file Platform/Hisilicon/HiKey: use Hisilicon common file Platform/Hisilicon/HiKey960: add skeleto

[edk2] [PATCH v3 2/4] Platform/Hisilicon: move out SerialPortLib from common file

2018-02-15 Thread Haojian Zhuang
Dw8250SerialPortRuntimeLib only exists in D02. DebugLib isn't necessary on HiKey platform. So add CONFIG_NO_DEBUGLIB on it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- Platform/Hisilicon/D02/Pv660D02.dsc | 1 + Platform/Hisilicon/HiKey/HiKe

[edk2] [PATCH v3 4/4] Platform/Hisilicon/HiKey960: add skeleton of HiKey960

2018-02-15 Thread Haojian Zhuang
Add skeleton of HiKey960 platform. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang Reviewed-by: Leif Lindholm --- Platform/Hisilicon/HiKey960/HiKey960.dsc | 263 + Platform/Hisilicon/HiKey960/HiKey960.fdf | 214

[edk2] [PATCH v3 3/4] Platform/Hisilicon/HiKey: use Hisilicon common file

2018-02-15 Thread Haojian Zhuang
Use common file Hisilicon.dsc.inc/Hisilicon.fdf.inc to reduce redundant contents in both HiKey.dsc and HiKey.fdf. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang Reviewed-by: Leif Lindholm --- Platform/Hisilicon/HiKey/HiKey.dsc | 205

[edk2] [PATCH 0/2] Fix FvFile in ARM BDS

2016-01-14 Thread Haojian Zhuang
Fix to load Fv file from UEFI image. Haojian Zhuang (2): ArmPkg: Bds: check path first for supporting fs ArmPkg: Bds: tranverse handles for fv file ArmPkg/Library/BdsLib/BdsFilePath.c | 143 1 file changed, 80 insertions(+), 63 deletions(-) -- 1.9.1

[edk2] [PATCH 1/2] ArmPkg: Bds: check path first for supporting fs

2016-01-14 Thread Haojian Zhuang
ot file path in file system. Now check the device path first. If it's not file path in file system, return directly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- ArmPkg/Library/BdsLib/BdsFilePath.c | 8 +--- 1 file changed, 5 insertions(+),

[edk2] [PATCH 2/2] ArmPkg: Bds: tranverse handles for fv file

2016-01-14 Thread Haojian Zhuang
BdsConnectAndUpdateDevicePath() won't set right handle if device path is file path or memory mapped. Now try to tranverse all handles for FvFile in Fv. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- ArmPkg/Library/BdsLib/BdsFilePath.c

Re: [edk2] [PATCH 1/2] ArmPkg: Bds: check path first for supporting fs

2016-01-25 Thread Haojian Zhuang
On 01/15/2016 10:29 AM, Haojian Zhuang wrote: BdsFileSystemSupport() checks Handle first before validating device path of file. There's the potential issue at here. BdsConnectAndUpdateDevicePath() will skip to locate handle if it's file or memory mapped. Then BdsFileSystemSupport(

Re: [edk2] Porting UEFI to a ARM platform

2015-10-21 Thread Haojian Zhuang
On 21 October 2015 at 15:43, Laszlo Ersek wrote: > On 10/21/15 04:44, Yehuda Yitschak wrote: >> Hello everyone >> >> >> i started reading and experimenting with UEFI a month ago and i'm >> now considering to start porting it to one of Marvell's Aarch64 SOCs >> >> as a first stage i only want to ge

[edk2] [PATCH] MdePkg/BaseSynchronizationLib: fix return value

2015-10-27 Thread Haojian Zhuang
Fix the wrong return value of both InternalSyncIncrement() and InternalSyncDecrement(). The return value shouldn't be the address of input parameter. It should be the updated value of input parameter instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Z

Re: [edk2] Armv8 64bit: System error booting linux from the UEFI

2015-11-10 Thread Haojian Zhuang
On 11 November 2015 at 08:20, Vladimir Olovyannikov wrote: > Hello, > > I am not sure this is the right forum to ask this question, so I am sorry in > advance if this is an offtopic here (please point me to the proper one). > > I brought up UEFI on the device and am trying to load linux from the

[edk2] [PATCH v3 04/10] MmcDxe: add interface to change io width and speed

2016-09-21 Thread Haojian Zhuang
By default, MMC is initialized with 1-bit mode and less than 400KHz bus clock. It causes MMC working inefficiently. Add the interface to change the bus width and speed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol

[edk2] [PATCH v3 01/10] MmcDxe: wait OCR busy bit free

2016-09-21 Thread Haojian Zhuang
According to eMMC spec, OCR.PowerUp bit is also busy bit. If the busy bit is '0', CMD1 should be sent and OCR should be fetched again. And add a timeout counter on the repeated steps. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg

[edk2] [PATCH v3 02/10] MmcDxe: move ECSD into CardInfo structure

2016-09-21 Thread Haojian Zhuang
Since ECSD also describes the information of card, move it into structure CardInfo. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 + EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 5 ++--- 2

[edk2] [PATCH v3 00/10] enhance mmc

2016-09-21 Thread Haojian Zhuang
eMMC spec. * Define ECSD structure. * Add interface to set IO bus width and speed. * Support to access multiple blocks. Haojian Zhuang (10): MmcDxe: wait OCR busy bit free MmcDxe: move ECSD into CardInfo structure MmcDxe: add SPEC_VERS field in CSD structure MmcDxe: add interface to

[edk2] [PATCH v3 03/10] MmcDxe: add SPEC_VERS field in CSD structure

2016-09-21 Thread Haojian Zhuang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index f4e0aa0..b1c5153

[edk2] [PATCH v3 06/10] MmcDxe: set io bus width before reading EXTCSD

2016-09-21 Thread Haojian Zhuang
Set io bus width on both MMC controller and EXTCSD. Otherwise, it may cause unmatched failure case. And support more timing mode, high speed, HS200 & HS400 mode. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHo

[edk2] [PATCH v3 05/10] MmcDxe: declare ECSD structure

2016-09-21 Thread Haojian Zhuang
Declare fields in ECSD structure. And drop the original 128 words arrary. Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 157 ++- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 4 +- 2 files changed, 158 insertions(+), 3 deletions

[edk2] [PATCH v3 07/10] MmcDxe: Fix uninitialized mediaid for SD

2016-09-21 Thread Haojian Zhuang
When SD card is used, mediaid is not initialized and used directly. So fix it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a

[edk2] [PATCH v3 08/10] MmcDxe: set iospeed and bus width in SD stack

2016-09-21 Thread Haojian Zhuang
Add more SD commands to support 4-bit bus width & iospeed. It's not formal code. And it needs to be updated later. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHost.h | 3 + EmbeddedPkg/Univers

[edk2] [PATCH v3 09/10] MmcDxe: expand to support multiple blocks

2016-09-21 Thread Haojian Zhuang
Make use of DMA to transfer multiple blocks at one time. It could improve the performance on MMC/SD driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHost.h| 6 + EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c

[edk2] [PATCH v3 10/10] PL180: update for indentifying SD

2016-09-21 Thread Haojian Zhuang
When CMD6 & ACMD51 are added into indentifying SD process, PL180 should also support CMD6 & ACMD51. Otherwise, it'll hang when system tries to read expected data. Signed-off-by: Haojian Zhuang --- ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c | 15 ++- 1 file changed,

Re: [edk2] [PATCH v3 00/10] enhance mmc

2016-10-11 Thread Haojian Zhuang
On 12 October 2016 at 01:03, Ryan Harkin wrote: > On 11 October 2016 at 17:28, Ard Biesheuvel wrote: >> On 11 October 2016 at 17:27, Ryan Harkin wrote: >>> On 11 October 2016 at 17:24, Ard Biesheuvel >>> wrote: Hi Ryan, On 11 October 2016 at 17:22, Ryan Harkin wrote: [...]

Re: [edk2] [RFC 0/3] Rework the pl061 driver for better readability

2016-02-26 Thread Haojian Zhuang
在 02/10/2016 11:55 PM, Leif Lindholm 写道: Apologies to Haojian for not giving any feedback on his set of significant improvements to the pl061 GPIO controller driver. I found myself unable to review his modifications due to the complexity of the original driver, so I decided to refactor it ... o

[edk2] [PATCH 6/9] MmcDxe: set io bus width before reading EXTCSD

2016-02-26 Thread Haojian Zhuang
Set io bus width on both MMC controller and EXTCSD. Otherwise, it may cause unmatched failure case. And support more timing mode, high speed, HS200 & HS400 mode. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHo

[edk2] [PATCH 8/9] MmcDxe: set iospeed and bus width in SD stack

2016-02-26 Thread Haojian Zhuang
Add more SD commands to support 4-bit bus width & iospeed. It's not formal code. And it needs to be updated later. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHost.h | 1 + EmbeddedPkg/Univers

[edk2] [PATCH 1/9] MmcDxe: wait OCR busy bit free

2016-02-26 Thread Haojian Zhuang
According to eMMC spec, OCR.PowerUp bit is also busy bit. If the busy bit is '0', CMD1 should be sent and OCR should be fetched again. And add a timeout counter on the repeated steps. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg

[edk2] [PATCH 5/9] MmcDxe: declare ECSD structure

2016-02-26 Thread Haojian Zhuang
Declare fields in ECSD structure. And drop the original 128 words arrary. Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 157 ++- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 4 +- 2 files changed, 158 insertions(+), 3 deletions

[edk2] [PATCH 4/9] MmcDxe: add interface to change io width and speed

2016-02-26 Thread Haojian Zhuang
By default, MMC is initialized with 1-bit mode and less than 400KHz bus clock. It causes MMC working inefficiently. Add the interface to change the bus width and speed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol

[edk2] [PATCH 0/9] enhance mmc

2016-02-26 Thread Haojian Zhuang
* Wait OCR busy bit free according to eMMC spec. * Define ECSD structure. * Add interface to set IO bus width and speed. * Support to access multiple blocks. Haojian Zhuang (9): MmcDxe: wait OCR busy bit free MmcDxe: move ECSD into CardInfo structure MmcDxe: add SPEC_VERS field in CSD

[edk2] [PATCH 2/9] MmcDxe: move ECSD into CardInfo structure

2016-02-26 Thread Haojian Zhuang
Since ECSD also describes the information of card, move it into structure CardInfo. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 + EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 5 ++--- 2

[edk2] [PATCH 3/9] MmcDxe: add SPEC_VERS field in CSD structure

2016-02-26 Thread Haojian Zhuang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index f4e0aa0..b1c5153

[edk2] [PATCH 7/9] MmcDxe: Fix uninitialized mediaid for SD

2016-02-26 Thread Haojian Zhuang
When SD card is used, mediaid is not initialized and used directly. So fix it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a

[edk2] [PATCH 9/9] MmcDxe: expand to support multiple blocks

2016-02-26 Thread Haojian Zhuang
Make use of DMA to transfer multiple blocks at one time. It could improve the performance on MMC/SD driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHost.h| 6 + EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c

[edk2] [PATCH] ArmVExpressFastBoot: Add support for sparse Images

2016-02-26 Thread Haojian Zhuang
g place to implement this, Implementing it correctly in AndroidFastbootApp requires changing FASTBOOT_PLATFORM_FLASH with a "offset" parameter. Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Zhangfei Gao Signed-off-by: Riku Voipio Signed-off-by: Haojian Zhuang --- .../Ar

[edk2] [PATCH] EmbeddedPkg/AndroidFastboot: fix size with 64bit

2016-02-26 Thread Haojian Zhuang
Since there's percentage calcution, multiply on 32bit variable will cause overflow. So fix the variables as 64bit. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhangfei Gao Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Application/AndroidFastboot/AndroidFastboot

Re: [edk2] [PATCH 1/2] ArmPkg: Bds: check path first for supporting fs

2016-02-26 Thread Haojian Zhuang
在 01/26/2016 09:40 AM, Haojian Zhuang 写道: On 01/15/2016 10:29 AM, Haojian Zhuang wrote: BdsFileSystemSupport() checks Handle first before validating device path of file. There's the potential issue at here. BdsConnectAndUpdateDevicePath() will skip to locate handle if it's file

[edk2] [PATCH 2/2] EmbeddedPkg: FastbootUsb: add string descriptors

2016-02-26 Thread Haojian Zhuang
Support both manufacturer and product string descriptors. Otherwise, the manufacturer and product sub nodes won't be created in sysfs directory of linux host. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- .../Drivers/AndroidFastbootTransportU

[edk2] [PATCH 0/2] fix the index in usb string descriptor

2016-02-26 Thread Haojian Zhuang
Set the right value of Manufacturer, Product and SerialNumber in usb string descriptor. Haojian Zhuang (2): EmbeddedPkg: FastbootUsb: set serial number as 3 EmbeddedPkg: FastbootUsb: add string descriptors .../Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsb.c | 6 +++--- 1

[edk2] [PATCH 1/2] EmbeddedPkg: FastbootUsb: set serial number as 3

2016-02-26 Thread Haojian Zhuang
Set serial number as 3. If the serial number is 0, fastboot won't load real serial number from descriptor at all. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- .../Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsb.c | 2 +- 1

Re: [edk2] [PATCH 0/9] enhance mmc

2016-02-27 Thread Haojian Zhuang
On 2016/2/27 4:38, Leif Lindholm wrote: Hi Haojian, On Fri, Feb 26, 2016 at 05:27:47PM +0800, Haojian Zhuang wrote: * Wait OCR busy bit free according to eMMC spec. * Define ECSD structure. * Add interface to set IO bus width and speed. * Support to access multiple blocks. This is a

Re: [edk2] [PATCH 0/4] Rework the pl061 driver for better readability

2016-02-28 Thread Haojian Zhuang
series reworks the existing driver in preparation for the improvements. For the series: Reviewed-by: Ard Biesheuvel And me: Reviewed-by: Ryan Harkin Tested-by: Haojian Zhuang ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01

Re: [edk2] [PATCH] EmbeddedPkg/AndroidFastboot: fix size with 64bit

2016-02-29 Thread Haojian Zhuang
在 02/27/2016 04:42 AM, Leif Lindholm 写道: On Fri, Feb 26, 2016 at 05:34:50PM +0800, Haojian Zhuang wrote: Since there's percentage calcution, multiply on 32bit variable will cause overflow. So fix the variables as 64bit. So, this is not technically what it does - it changes the variabl

Re: [edk2] [PATCH] EmbeddedPkg/AndroidFastboot: fix size with 64bit

2016-02-29 Thread Haojian Zhuang
On 29 February 2016 at 17:53, Leif Lindholm wrote: > On Mon, Feb 29, 2016 at 04:36:00PM +0800, Haojian Zhuang wrote: >> 在 02/27/2016 04:42 AM, Leif Lindholm 写道: >> >On Fri, Feb 26, 2016 at 05:34:50PM +0800, Haojian Zhuang wrote: >> >>Since there's percentage ca

[edk2] [PATCH v2 0/1] fix data size in AndroidFastboot

2016-02-29 Thread Haojian Zhuang
Changelog: v2: * Avoid to use UINTN. Since UINTN means UINT32 on aarch32. Haojian Zhuang (1): EmbeddedPkg/AndroidFastboot: fix size with 64bit EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1

[edk2] [PATCH v2 1/1] EmbeddedPkg/AndroidFastboot: fix size with 64bit

2016-02-29 Thread Haojian Zhuang
Since there's percentage calcution, multiply on 32bit variable will cause overflow. So fix the variables as 64bit. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhangfei Gao Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Application/AndroidFastboot/AndroidFastboot

[edk2] [PATCH v5 0/2] support multiple PL061 gpio controllers

2016-03-13 Thread Haojian Zhuang
CONTROLLER structure in embedded gpio. * Support multiple PL061 gpio controllers in one platform. v2: * Append the patch to fix gpio pin mask macro. Haojian Zhuang (2): EmbeddedPkg: enhance for multiple gpio controllers ArmPlatformPkg: PL061: support multiple controller ArmPlatformP

[edk2] [PATCH v5 2/2] ArmPlatformPkg: PL061: support multiple controller

2016-03-13 Thread Haojian Zhuang
d-off-by: Haojian Zhuang --- ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c| 141 - .../Drivers/PL061GpioDxe/PL061GpioDxe.inf | 1 + ArmPlatformPkg/Include/Drivers/PL061Gpio.h | 46 --- 3 files changed, 129 insertions(+), 59 deletions(-) diff --

[edk2] [PATCH v5 1/2] EmbeddedPkg: enhance for multiple gpio controllers

2016-03-13 Thread Haojian Zhuang
EmbeddedGpio only supports one gpio controller in one platform. Now create PLATFORM_GPIO_CONTROLLER to support multiple gpio controllers in one platform. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/EmbeddedPkg.dec | 1

Re: [edk2] [PATCH v5 2/2] ArmPlatformPkg: PL061: support multiple controller

2016-03-14 Thread Haojian Zhuang
在 03/14/2016 09:19 PM, Leif Lindholm 写道: On Mon, Mar 14, 2016 at 01:30:37PM +0800, Haojian Zhuang wrote: Support multiple PL061 controllers. If platform gpio driver couldn't be found, PL061 gpio driver will continue to load PcdPL061GpioBase as the register base. It could be compatible

[edk2] [PATCH v2 0/9] enhance mmc

2016-03-22 Thread Haojian Zhuang
et IO bus width and speed. * Support to access multiple blocks. Haojian Zhuang (9): MmcDxe: wait OCR busy bit free MmcDxe: move ECSD into CardInfo structure MmcDxe: add SPEC_VERS field in CSD structure MmcDxe: add interface to change io width and speed MmcDxe: declare ECSD structure M

[edk2] [PATCH v2 3/9] MmcDxe: add SPEC_VERS field in CSD structure

2016-03-22 Thread Haojian Zhuang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index f4e0aa0..b1c5153

[edk2] [PATCH v2 2/9] MmcDxe: move ECSD into CardInfo structure

2016-03-22 Thread Haojian Zhuang
Since ECSD also describes the information of card, move it into structure CardInfo. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 + EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 5 ++--- 2

[edk2] [PATCH v2 7/9] MmcDxe: Fix uninitialized mediaid for SD

2016-03-22 Thread Haojian Zhuang
When SD card is used, mediaid is not initialized and used directly. So fix it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a

[edk2] [PATCH v2 4/9] MmcDxe: add interface to change io width and speed

2016-03-22 Thread Haojian Zhuang
By default, MMC is initialized with 1-bit mode and less than 400KHz bus clock. It causes MMC working inefficiently. Add the interface to change the bus width and speed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol

[edk2] [PATCH v2 6/9] MmcDxe: set io bus width before reading EXTCSD

2016-03-22 Thread Haojian Zhuang
Set io bus width on both MMC controller and EXTCSD. Otherwise, it may cause unmatched failure case. And support more timing mode, high speed, HS200 & HS400 mode. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHo

[edk2] [PATCH v2 5/9] MmcDxe: declare ECSD structure

2016-03-22 Thread Haojian Zhuang
Declare fields in ECSD structure. And drop the original 128 words arrary. Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 157 ++- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 4 +- 2 files changed, 158 insertions(+), 3 deletions

[edk2] [PATCH v2 8/9] MmcDxe: set iospeed and bus width in SD stack

2016-03-22 Thread Haojian Zhuang
Add more SD commands to support 4-bit bus width & iospeed. It's not formal code. And it needs to be updated later. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHost.h | 3 + EmbeddedPkg/Univers

[edk2] [PATCH v2 9/9] MmcDxe: expand to support multiple blocks

2016-03-22 Thread Haojian Zhuang
Make use of DMA to transfer multiple blocks at one time. It could improve the performance on MMC/SD driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/MmcHost.h| 6 + EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c

[edk2] [PATCH v2 1/9] MmcDxe: wait OCR busy bit free

2016-03-22 Thread Haojian Zhuang
According to eMMC spec, OCR.PowerUp bit is also busy bit. If the busy bit is '0', CMD1 should be sent and OCR should be fetched again. And add a timeout counter on the repeated steps. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg

Re: [edk2] [PATCH v2 8/9] MmcDxe: set iospeed and bus width in SD stack

2016-04-04 Thread Haojian Zhuang
t it's > trying to do, but I thought I'd tell you sooner because you might have > a better idea. > > On 22 March 2016 at 12:48, Haojian Zhuang wrote: >> Add more SD commands to support 4-bit bus width & iospeed. It's not >> formal code. And it needs to be u

Re: [edk2] [PATCH v2 8/9] MmcDxe: set iospeed and bus width in SD stack

2016-04-04 Thread Haojian Zhuang
On 5 April 2016 at 02:54, Ard Biesheuvel wrote: > On 4 April 2016 at 19:17, Ryan Harkin wrote: >> Hi Haojian, >> >> I've had time to investigate where TC2 is hanging with your patches >> applied and narrowed it down to the single line of code marked below. >> >> I'm going to read the code now and

Re: [edk2] [PATCH v2 8/9] MmcDxe: set iospeed and bus width in SD stack

2016-04-04 Thread Haojian Zhuang
On 5 April 2016 at 11:25, Tian, Feng wrote: > Hi, HaoJian > > We newly added EDKII SD/MMC stack to EDKII repo. If the SD/MMC host > controller follows SD PCI host controller spec, the whole stack should work. > > But looks like PL180 doesn't follow the SD PCI host controller spec, you > would ha

Re: [edk2] [PATCH v2 8/9] MmcDxe: set iospeed and bus width in SD stack

2016-04-05 Thread Haojian Zhuang
On 5 April 2016 at 17:49, Ryan Harkin wrote: > On 5 April 2016 at 09:37, Ryan Harkin wrote: >> On 5 April 2016 at 03:57, Haojian Zhuang wrote: >>> On 5 April 2016 at 01:17, Ryan Harkin wrote: >>>> Hi Haojian, >>>> >>>> I've had

[edk2] [PATCH] EmmcBlockIo: fix to get CSD data

2016-07-19 Thread Haojian Zhuang
The CSD structure is a 128-bit structure. But EmmcGetCsd() only loads 120 bits with 8-bit offset. Now fix it. Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe

Re: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data

2016-07-20 Thread Haojian Zhuang
esday, July 20, 2016 10:13 AM To: Haojian Zhuang Cc: edk2-devel@lists.01.org; guodong...@linaro.org; leif.lindh...@linaro.org; ard.biesheu...@linaro.org; Tian, Feng Subject: RE: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data Hi, Haojian Why I didn't get the lowest byte data is because

Re: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data

2016-07-20 Thread Haojian Zhuang
在 07/21/2016 09:51 AM, Haojian Zhuang 写道: Hi Feng, I think the main difference is who to handle the CRC bits. In the designware emmc/sd controller, the whole 128-bit value is loaded into the four response registers. There's no any shift on the 128-bit value to remove CRC. (Refer to: dr

[edk2] Question on eMMC and SD driver

2016-07-20 Thread Haojian Zhuang
Hi all, I have a few questions on eMMC/SD driver when I'm working on my driver. In my hikey platform, there's no PCI bus. So I create my own DwMmc driver to do the same thing as SdMmcPciHcDxe driver. There's one controller for eMMC and one controller for SD. 1. How to support both eMMC and S

Re: [edk2] Question on eMMC and SD driver

2016-07-20 Thread Haojian Zhuang
e all system variables into eMMC partition. So BlockVariableDxe is created to access variables on block devices. Thanks Feng -Original Message- From: Haojian Zhuang [mailto:haojian.zhu...@linaro.org] Sent: Thursday, July 21, 2016 10:34 AM To: Tian, Feng Cc: Leif Lindholm ; Ard Biesheuvel

Re: [edk2] Question on eMMC and SD driver

2016-07-20 Thread Haojian Zhuang
在 07/21/2016 11:41 AM, Andrew Fish 写道: On Jul 20, 2016, at 8:23 PM, Tian, Feng wrote: Hi, Haojian If there is no PCI bus, you could implement a fake one. Just like what we did at edk2\Omap35xxPkg\PciEmulation. Through this way, you can reuse SdMmcPciHc driver. For your questions: 1. The

Re: [edk2] Question on eMMC and SD driver

2016-07-20 Thread Haojian Zhuang
在 07/21/2016 11:23 AM, Tian, Feng 写道: Hi, Haojian If there is no PCI bus, you could implement a fake one. Just like what we did at edk2\Omap35xxPkg\PciEmulation. Through this way, you can reuse SdMmcPciHc driver. Oh, your eMMC/SD IP is compatible SDHC. But Designware eMMC/SD IP isn't com

Re: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data

2016-07-21 Thread Haojian Zhuang
On 2016/7/21 9:52, Haojian Zhuang wrote: 在 07/21/2016 09:51 AM, Haojian Zhuang 写道: Hi Feng, I think the main difference is who to handle the CRC bits. In the designware emmc/sd controller, the whole 128-bit value is loaded into the four response registers. There's no any shift on the 12

Re: [edk2] Instance of library class [ArmMmuLib] is not found

2016-07-21 Thread Haojian Zhuang
On 2016/7/21 19:27, Ard Biesheuvel wrote: On 20 July 2016 at 07:44, Michael Zimmermann wrote: Hi, since commit '5db1cce ArmPkg ArmVirtPkg MdeModulePkg: switch to separate ArmMmuLib' you need to add ArmMmuLib to your platform's dsc file: ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf I

Re: [edk2] Instance of library class [ArmMmuLib] is not found

2016-07-21 Thread Haojian Zhuang
On 2016/7/21 19:27, Ard Biesheuvel wrote: On 20 July 2016 at 07:44, Michael Zimmermann wrote: Hi, since commit '5db1cce ArmPkg ArmVirtPkg MdeModulePkg: switch to separate ArmMmuLib' you need to add ArmMmuLib to your platform's dsc file: ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf I

Re: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data

2016-07-21 Thread Haojian Zhuang
On 2016/7/21 19:24, Ard Biesheuvel wrote: On 21 July 2016 at 13:17, Haojian Zhuang wrote: On 2016/7/21 9:52, Haojian Zhuang wrote: 在 07/21/2016 09:51 AM, Haojian Zhuang 写道: Hi Feng, I think the main difference is who to handle the CRC bits. In the designware emmc/sd controller, the whole

Re: [edk2] Question on eMMC and SD driver

2016-07-21 Thread Haojian Zhuang
On 2016/7/21 11:23, Tian, Feng wrote: Hi, Haojian If there is no PCI bus, you could implement a fake one. Just like what we did at edk2\Omap35xxPkg\PciEmulation. Through this way, you can reuse SdMmcPciHc driver. For your questions: 1. The EDKII SD/MMC stack (SdMmcPciHc plus SdDxe and EmmcDxe

Re: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data

2016-07-21 Thread Haojian Zhuang
Designware case, You would have to have an override version as it doesn't follow SD/MMC specs. Thanks Feng -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Haojian Zhuang Sent: Thursday, July 21, 2016 9:40 PM To: Ard Biesheuvel ; Charles Gar

Re: [edk2] Question on eMMC and SD driver

2016-07-21 Thread Haojian Zhuang
hanks Feng -Original Message- From: af...@apple.com [mailto:af...@apple.com] Sent: Thursday, July 21, 2016 12:04 PM To: Haojian Zhuang Cc: Tian, Feng ; edk2-devel@lists.01.org; Leif Lindholm ; Ard Biesheuvel Subject: Re: [edk2] Question on eMMC and SD driver On Jul 20, 2016, at 8:59 P

Re: [edk2] Variable Storage Driver

2015-07-23 Thread Haojian Zhuang
wrote: > Hi Haojian > Thanks for the sharing. > > May I know if you have validated variable set in UEFI runtime? > I found it is marked as DXE driver instead of RUNTIME driver. But maybe I am > wrong. > > Thank you > Yao Jiewen > > > -Original Message-

[edk2] question on relocating kernel image

2015-07-23 Thread Haojian Zhuang
Hi all, There's efi_low_alloc() in $KERNEL/drivers/firmware/efi/libstub/efi-stub-helper.c. I have on question on the piece of code from efi_low_alloc(). /* * Don't allocate at 0x0. It will confuse code that * checks pointers against NULL. Skip the first 8 * bytes so we start at a nice even nu

Re: [edk2] [PATCH v3] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-23 Thread Haojian Zhuang
On Thu, 2015-07-23 at 15:25 +0200, Ard Biesheuvel wrote: > Hello Haojian, > > Apologies for the noise ... > > Could you please try *this* version v3 instead? v2 is just the same patch as > before ... > > -- > Ard. > Hi Ard, Thanks for your patch. It fixes the issue when DRAM_BASE is 0x0. Be

Re: [edk2] [PATCH v3] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

2015-07-23 Thread Haojian Zhuang
On Thu, 2015-07-23 at 16:52 +0200, Ard Biesheuvel wrote: > On 23 July 2015 at 16:05, Haojian Zhuang wrote: > > On Thu, 2015-07-23 at 15:25 +0200, Ard Biesheuvel wrote: > >> Hello Haojian, > >> > >> Apologies for the noise ... > >> > >> Coul

[edk2] [PATCH] ArmPlatformPkg: PL061: fix accessing gpio value

2015-08-11 Thread Haojian Zhuang
be read as 0, regardless of their value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe

Re: [edk2] [PATCH] ArmPlatformPkg: PL061: fix accessing gpio value

2015-08-11 Thread Haojian Zhuang
On Tue, 2015-08-11 at 09:42 +0200, Ard Biesheuvel wrote: > On 11 August 2015 at 09:11, Haojian Zhuang wrote: > > The way of accessing PL061 GPIODATA register is wrong. > > > > The spec said in below. > > > > In order to write to GPIODATA, the corresponding bits in

<    1   2   3   4   >