* [PATCH 1/2] ArmPlatformPkg: Juno networking build option
2017-09-13 18:16 [PATCH 0/2] Options to remove code evan.lloyd
@ 2017-09-13 18:16 ` evan.lloyd
2017-09-13 18:16 ` [PATCH 2/2] ArmPlatformPkg: Remove DT code when unsupported evan.lloyd
2017-09-15 14:46 ` [PATCH 0/2] Options to remove code Leif Lindholm
2 siblings, 0 replies; 4+ messages in thread
From: evan.lloyd @ 2017-09-13 18:16 UTC (permalink / raw)
To: edk2-devel; +Cc: Ard Biesheuvel, Leif Lindholm, Matteo Carlini, nd
From: Sami <sami.mujawar@arm.com>
When network functionality is not required, the boot process is
impeded by redundant network timeouts. Moreover Juno is a mobile
platform so it makes sense to have an option to disable the
(ethernet) networking support. We therefore introduce the
DISABLE_NETWORK build option.
By default ArmJunoDxe configures the MAC address. This is redundant
when networking is disabled, so the MAC Address configuration is
removed when the DISABLE_NETWORK build option is defined.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---
ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index 18491c7378523f365644658c270de95e711c5ac1..456e21ba47db7ec440ac1ef5554eccd5e4d2bcf9 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2013-2015, ARM Limited. All rights reserved.
+* Copyright (c) 2013-2017, 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
@@ -71,6 +71,7 @@ STATIC CONST EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mPciRootComplexDevicePath = {
EFI_EVENT mAcpiRegistration = NULL;
+#ifndef DISABLE_NETWORK
/**
This function reads PCI ID of the controller.
@@ -355,6 +356,7 @@ ArmJunoSetNicMacAddress ()
return EFI_SUCCESS;
}
+#endif
/**
Notification function of the event defined as belonging to the
@@ -395,10 +397,12 @@ OnEndOfDxe (
Status = gBS->ConnectController (Handle, NULL, PciRootComplexDevicePath, FALSE);
ASSERT_EFI_ERROR (Status);
+#ifndef DISABLE_NETWORK
Status = ArmJunoSetNicMacAddress ();
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "ArmJunoDxe: Failed to set Marvell Yukon NIC MAC address\n"));
}
+#endif
}
EFI_STATUS
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ArmPlatformPkg: Remove DT code when unsupported
2017-09-13 18:16 [PATCH 0/2] Options to remove code evan.lloyd
2017-09-13 18:16 ` [PATCH 1/2] ArmPlatformPkg: Juno networking build option evan.lloyd
@ 2017-09-13 18:16 ` evan.lloyd
2017-09-15 14:46 ` [PATCH 0/2] Options to remove code Leif Lindholm
2 siblings, 0 replies; 4+ messages in thread
From: evan.lloyd @ 2017-09-13 18:16 UTC (permalink / raw)
To: edk2-devel; +Cc: Ard Biesheuvel, Leif Lindholm, Matteo Carlini, nd
From: Sami Mujawar <sami.mujawar@arm.com>
>From the UEFI perspective Device Tree is a non standard extra.
There is, thus, an existing build flag DT_SUPPORTED.
This change removes Device Tree specific code unless DT_SUPPORTED is
set.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---
ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index 456e21ba47db7ec440ac1ef5554eccd5e4d2bcf9..893dd80b6755d68a05b8c2b4dedb8f60401b503b 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -414,9 +414,11 @@ ArmJunoEntryPoint (
{
EFI_STATUS Status;
EFI_PHYSICAL_ADDRESS HypBase;
+#ifdef DT_SUPPORTED
CHAR16 *TextDevicePath;
UINTN TextDevicePathSize;
VOID *Buffer;
+#endif
UINT32 JunoRevision;
EFI_EVENT EndOfDxeEvent;
@@ -530,6 +532,7 @@ ArmJunoEntryPoint (
);
}
+#ifdef DT_SUPPORTED
//
// Set up the device path to the FDT.
//
@@ -549,6 +552,7 @@ ArmJunoEntryPoint (
);
return Status;
}
+#endif
return Status;
}
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Options to remove code
2017-09-13 18:16 [PATCH 0/2] Options to remove code evan.lloyd
2017-09-13 18:16 ` [PATCH 1/2] ArmPlatformPkg: Juno networking build option evan.lloyd
2017-09-13 18:16 ` [PATCH 2/2] ArmPlatformPkg: Remove DT code when unsupported evan.lloyd
@ 2017-09-15 14:46 ` Leif Lindholm
2 siblings, 0 replies; 4+ messages in thread
From: Leif Lindholm @ 2017-09-15 14:46 UTC (permalink / raw)
To: evan.lloyd; +Cc: edk2-devel, Ard Biesheuvel, Matteo Carlini, nd
Hi Evan,
On Wed, Sep 13, 2017 at 07:16:19PM +0100, evan.lloyd@arm.com wrote:
> From: EvanLloyd <evan.lloyd@arm.com>
>
> There are a number of cases where it is desirable to remove unused code.
> An obvious instance might be on an emulator, where executing irrelevant
> code can add hours to the boot time. This change enables removal of
> some code that might not be relevant, using build options that can be
> configured in the platform build.
In principle, I'm fine with this change.
However, I would have expected a companion patch to this (for
edk2-platforms) to add a CFLAGS statement to the platform build if
some build option was specified with -D. Or am I missing some way of
doing this directly on the build command line?
Also, this patch by Sami
> Sami (1):
> ArmPlatformPkg: Juno networking build option
and this patch by Sami
> Sami Mujawar (1):
> ArmPlatformPkg: Remove DT code when unsupported
have different author names, which also confuses this cover letter
somewhat.
/
Leif
> ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> --
> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
>
^ permalink raw reply [flat|nested] 4+ messages in thread