On 08/17/2016 02:57 AM, Ard Biesheuvel wrote:
On 17 August 2016 at 02:18, Daniil Egranov daniil.egranov@arm.com wrote:
The patch removes dependencies on platform specific libraries and direct calls to functions with a platform specific implementation. Added MarvelYukonDxe.dsc for platform independent builds including EBC: build -a <target_architecture> \ -p OpenPlatformPkg/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.dsc \ -m OpenPlatformPkg/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.inf \ -b DEBUG -t <toolchain>
Interesting! Have you managed to run the EBC build on Juno?
As far as the code changes are concerned, could you also replace CopyMem() with gBS->CopyMem()? The library version is very inefficient, since it will be compiled to EBC, while the Boot Service version is guaranteed to be native code.
Thanks, Ard.
Yes, I've been able to run EBC build on Juno.
Replacing CopyMeme() with gBS->CopyMem() as well as ZeroMem with gBS->SetMem and AllocateZeroPool with gBS->AllocatePoool + gBS->SetMem gave significant performance improvement. I'll resubmit the patch with these changes.
I see the following message while the driver is loading: ConvertPages: failed to find range 10000000 - 10037FFF
There are multiple calls to CoreConvertPagesEx() while the driver is loading but only very first one triggers that message. However, it does not prevent the driver from loading or effect the functionality.
Thanks, Daniil
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Daniil Egranov daniil.egranov@arm.com
NOTE: This patch is based on "OpenPlatformPkg/MarvellYukonDxe: Marvell Yukon NIC driver" v4 patch. This patch includes same fix as Alan Ott's "[PATCH 1/7] Drivers/Net/MarvellYukon: Remove ARM-specific include" patch. Depending on the apply order, the patch for DeviceConfig.c should be ignored in one of the cases.
Drivers/Net/MarvellYukonDxe/DeviceConfig.c | 1 - Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.dsc | 90 +++++++++++++++++++++++++ Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.inf | 1 - Drivers/Net/MarvellYukonDxe/if_msk.c | 8 +-- 4 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.dsc
diff --git a/Drivers/Net/MarvellYukonDxe/DeviceConfig.c b/Drivers/Net/MarvellYukonDxe/DeviceConfig.c index c64f82a..c64c064 100644 --- a/Drivers/Net/MarvellYukonDxe/DeviceConfig.c +++ b/Drivers/Net/MarvellYukonDxe/DeviceConfig.c @@ -12,7 +12,6 @@
**/
-#include <ArmPlatform.h> #include <Protocol/PciIo.h> #include <IndustryStandard/Pci.h> #include <Library/IoLib.h> diff --git a/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.dsc b/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.dsc new file mode 100644 index 0000000..72e09fb --- /dev/null +++ b/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.dsc @@ -0,0 +1,90 @@ +# +# Copyright (c) 2013-2016, 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, EITHER EXPRESS OR IMPLIED. +#
+################################################################################ +# +# Defines Section - statements that will be processed to create a Makefile. +# +################################################################################ +[Defines]
- PLATFORM_NAME = MarvellYukonDxe
- PLATFORM_GUID = 8391d2d4-63fc-11e6-82d5-7b6c1a2ff410
- PLATFORM_VERSION = 0.96
- DSC_SPECIFICATION = 0x00010005
- OUTPUT_DIRECTORY = Build/OpenPlatformPkg
- SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM|AARCH64
- BUILD_TARGETS = DEBUG|RELEASE|NOOPT
- SKUID_IDENTIFIER = DEFAULT
+[LibraryClasses]
- #
- # Entry point
- #
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- #
- # Basic
- #
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- #
- # UEFI & PI
- #
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- #
- # Generic Modules
- #
- TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
- NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- #
- # Misc
- #
- DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+[LibraryClasses.common.UEFI_DRIVER]
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
- #
- # It is not possible to prevent ARM compiler calls to generic intrinsic functions.
- # This library provides the instrinsic functions generated by a given compiler.
- # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
- #
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+[LibraryClasses.EBC]
- LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
+[PcdsFeatureFlag]
+[PcdsFixedAtBuild]
+[PcdsFixedAtBuild.IPF]
+################################################################################################### +# +# Components Section - list of all EDK II Modules included in the build +# +###################################################################################################
+[Components]
- OpenPlatformPkg/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.inf
diff --git a/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.inf b/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.inf index de1059d..cf3e870 100644 --- a/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.inf +++ b/Drivers/Net/MarvellYukonDxe/MarvellYukonDxe.inf @@ -56,7 +56,6 @@ DebugLib TimerLib NetLib
ArmLib DevicePathLib
[Pcd]
diff --git a/Drivers/Net/MarvellYukonDxe/if_msk.c b/Drivers/Net/MarvellYukonDxe/if_msk.c index 5e7da93..139c488 100644 --- a/Drivers/Net/MarvellYukonDxe/if_msk.c +++ b/Drivers/Net/MarvellYukonDxe/if_msk.c @@ -247,7 +247,7 @@ msk_phy_readreg ( GMAC_WRITE_2 (mSoftc, port, GM_SMI_CTRL, GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD);
for (i = 0; i < MSK_TIMEOUT; i++) {
- MicroSecondDelay (1);
- gBS->Stall (1); val = GMAC_READ_2 (mSoftc, port, GM_SMI_CTRL); if ((val & GM_SMI_CT_RD_VAL) != 0) { val = GMAC_READ_2 (mSoftc, port, GM_SMI_DATA);
@@ -275,7 +275,7 @@ msk_phy_writereg ( GMAC_WRITE_2 (mSoftc, port, GM_SMI_DATA, val); GMAC_WRITE_2 (mSoftc, port, GM_SMI_CTRL, GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); for (i = 0; i < MSK_TIMEOUT; i++) {
- MicroSecondDelay (1);
- gBS->Stall (1); if ((GMAC_READ_2 (mSoftc, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY) == 0) { break; }
@@ -2810,7 +2810,7 @@ msk_stop ( } else { break; }
- MicroSecondDelay (1);
- gBS->Stall (1); } if (i == MSK_TIMEOUT) { DEBUG ((EFI_D_NET, "Marvell Yukon: Tx BMU stop failed\n"));
@@ -2856,7 +2856,7 @@ msk_stop ( if (CSR_READ_1 (mSoftc, RB_ADDR (sc_if->msk_rxq, Q_RSL)) == CSR_READ_1 (mSoftc, RB_ADDR (sc_if->msk_rxq, Q_RL))) { break; }
- MicroSecondDelay (1);
- gBS->Stall (1); } if (i == MSK_TIMEOUT) { DEBUG ((EFI_D_NET, "Marvell Yukon: Rx BMU stop failed\n"));
-- 2.7.4
Linaro-uefi mailing list Linaro-uefi@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-uefi
Linaro-uefi mailing list Linaro-uefi@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-uefi