public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
       [not found] <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662841.git.sean@starlabs.systems>
@ 2022-01-31 21:00 ` Sean Rhodes
  2022-02-07  1:47   ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 8+ messages in thread
From: Sean Rhodes @ 2022-01-31 21:00 UTC (permalink / raw)
  To: devel; +Cc: Sean Rhodes, Matt DeVillier

Internal eMMC devices often show multiple entries, so skip
any after the initial entry.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..e21ac2c510 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2175,12 +2175,14 @@ BmEnumerateBootOptions (
   EFI_BLOCK_IO_PROTOCOL         *BlkIo;
   UINTN                         Removable;
   UINTN                         Index;
+  UINTN                         EmmcCount;
   CHAR16                        *Description;
 
   ASSERT (BootOptionCount != NULL);
 
   *BootOptionCount = 0;
   BootOptions      = NULL;
+  EmmcCount        = 0;
 
   //
   // Parse removable block io followed by fixed block io
@@ -2219,6 +2221,16 @@ BmEnumerateBootOptions (
       }
 
       Description = BmGetBootDescription (Handles[Index]);
+      //
+      // Skip secondary entries for internal eMMC devices
+      //
+      if (StrCmp(Description, L"eMMC Device") == 0) {
+        EmmcCount++;
+        if (EmmcCount > 1) {
+          continue;
+        }
+      }
+
       BootOptions = ReallocatePool (
                       sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) * (*BootOptionCount),
                       sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) * (*BootOptionCount + 1),
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
  2022-01-31 21:00 ` [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries Sean Rhodes
@ 2022-02-07  1:47   ` gaoliming
  2022-02-10 21:35     ` [edk2-devel] " Sean Rhodes
  0 siblings, 1 reply; 8+ messages in thread
From: gaoliming @ 2022-02-07  1:47 UTC (permalink / raw)
  To: devel, sean; +Cc: 'Matt DeVillier'

Is this the generic logic for all eMMC device? If yes, can you point the
statement in public spec for eMMC entries?

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sean Rhodes
> 发送时间: 2022年2月1日 5:01
> 收件人: devel@edk2.groups.io
> 抄送: Sean Rhodes <sean@starlabs.systems>; Matt DeVillier
> <matt.devillier@gmail.com>
> 主题: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary
> eMMC entries
> 
> Internal eMMC devices often show multiple entries, so skip
> any after the initial entry.
> 
> Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index 962892d38f..e21ac2c510 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -2175,12 +2175,14 @@ BmEnumerateBootOptions (
>    EFI_BLOCK_IO_PROTOCOL         *BlkIo;
> 
>    UINTN                         Removable;
> 
>    UINTN                         Index;
> 
> +  UINTN                         EmmcCount;
> 
>    CHAR16                        *Description;
> 
> 
> 
>    ASSERT (BootOptionCount != NULL);
> 
> 
> 
>    *BootOptionCount = 0;
> 
>    BootOptions      = NULL;
> 
> +  EmmcCount        = 0;
> 
> 
> 
>    //
> 
>    // Parse removable block io followed by fixed block io
> 
> @@ -2219,6 +2221,16 @@ BmEnumerateBootOptions (
>        }
> 
> 
> 
>        Description = BmGetBootDescription (Handles[Index]);
> 
> +      //
> 
> +      // Skip secondary entries for internal eMMC devices
> 
> +      //
> 
> +      if (StrCmp(Description, L"eMMC Device") == 0) {
> 
> +        EmmcCount++;
> 
> +        if (EmmcCount > 1) {
> 
> +          continue;
> 
> +        }
> 
> +      }
> 
> +
> 
>        BootOptions = ReallocatePool (
> 
>                        sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) *
> (*BootOptionCount),
> 
>                        sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) *
> (*BootOptionCount + 1),
> 
> --
> 2.32.0
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#86264): https://edk2.groups.io/g/devel/message/86264
> Mute This Topic: https://groups.io/mt/88818205/4905953
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaoliming@byosoft.com.cn]
> -=-=-=-=-=-=
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
  2022-02-07  1:47   ` 回复: [edk2-devel] " gaoliming
@ 2022-02-10 21:35     ` Sean Rhodes
  2022-03-21  9:41       ` Sean Rhodes
  0 siblings, 1 reply; 8+ messages in thread
From: Sean Rhodes @ 2022-02-10 21:35 UTC (permalink / raw)
  To: gaoliming, devel

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

Hi Liming

It's not based on spec, just behaviour seen with coreboot and UefiPayloadPkg. I can wrap it in a build option if that would be preferable?

Thanks
Sean

[-- Attachment #2: Type: text/html, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
  2022-02-10 21:35     ` [edk2-devel] " Sean Rhodes
@ 2022-03-21  9:41       ` Sean Rhodes
  2022-04-01  2:08         ` 回复: " gaoliming
  2022-05-17 12:19         ` Sheng Lean Tan
  0 siblings, 2 replies; 8+ messages in thread
From: Sean Rhodes @ 2022-03-21  9:41 UTC (permalink / raw)
  To: Sean Rhodes, devel


[-- Attachment #1.1: Type: text/plain, Size: 142 bytes --]

Hi Liming

This is how the entries appear for multiple MMC drives. Can you advise how you'd like me to adjust the patch?

Thanks

Sean

[-- Attachment #1.2: Type: text/html, Size: 231 bytes --]

[-- Attachment #2: MMCentries.jpg --]
[-- Type: image/jpeg, Size: 65469 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* 回复: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
  2022-03-21  9:41       ` Sean Rhodes
@ 2022-04-01  2:08         ` gaoliming
  2022-04-01  2:18           ` Ni, Ray
  2022-05-17 12:19         ` Sheng Lean Tan
  1 sibling, 1 reply; 8+ messages in thread
From: gaoliming @ 2022-04-01  2:08 UTC (permalink / raw)
  To: devel, sean


[-- Attachment #1.1: Type: text/plain, Size: 660 bytes --]

Sean:

 You can implement the platform driver to install gEdkiiPlatformBootManagerProtocolGuid customize the boot option. This way doesn’t impact the generic UefiBootManagerLib.

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sean Rhodes
发送时间: 2022年3月21日 17:41
收件人: Sean Rhodes <sean@starlabs.systems>; devel@edk2.groups.io
主题: Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries

 

Hi Liming

This is how the entries appear for multiple MMC drives. Can you advise how you'd like me to adjust the patch?

Thanks

Sean





[-- Attachment #1.2: Type: text/html, Size: 4215 bytes --]

[-- Attachment #2: image001.jpg --]
[-- Type: image/jpeg, Size: 65561 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
  2022-04-01  2:08         ` 回复: " gaoliming
@ 2022-04-01  2:18           ` Ni, Ray
  0 siblings, 0 replies; 8+ messages in thread
From: Ni, Ray @ 2022-04-01  2:18 UTC (permalink / raw)
  To: devel@edk2.groups.io, Gao, Liming, Rhodes, Sean


[-- Attachment #1.1: Type: text/plain, Size: 1310 bytes --]

Sean,
Below function is called to make sure the description for each boot option doesn’t equal. Can you investigate why it doesn’t work for eMMC?
  BmMakeBootOptionDescriptionUnique (BootOptions, *BootOptionCount);

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming
Sent: Friday, April 1, 2022 10:09 AM
To: devel@edk2.groups.io; Rhodes, Sean <sean@starlabs.systems>
Subject: 回复: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries

Sean:
 You can implement the platform driver to install gEdkiiPlatformBootManagerProtocolGuid customize the boot option. This way doesn’t impact the generic UefiBootManagerLib.

Thanks
Liming
发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> 代表 Sean Rhodes
发送时间: 2022年3月21日 17:41
收件人: Sean Rhodes <sean@starlabs.systems<mailto:sean@starlabs.systems>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
主题: Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries

Hi Liming

This is how the entries appear for multiple MMC drives. Can you advise how you'd like me to adjust the patch?

Thanks

Sean
[cid:image001.jpg@01D845B1.D0991190]


[-- Attachment #1.2: Type: text/html, Size: 6155 bytes --]

[-- Attachment #2: image001.jpg --]
[-- Type: image/jpeg, Size: 65619 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
  2022-03-21  9:41       ` Sean Rhodes
  2022-04-01  2:08         ` 回复: " gaoliming
@ 2022-05-17 12:19         ` Sheng Lean Tan
  2022-05-17 13:58           ` Ni, Ray
  1 sibling, 1 reply; 8+ messages in thread
From: Sheng Lean Tan @ 2022-05-17 12:19 UTC (permalink / raw)
  To: devel, sean


[-- Attachment #1.1: Type: text/plain, Size: 780 bytes --]

Hi Liming,
Mind to help on this? This patch has been hanging on for a long time :(
Thank you.

Best Regards,
*Lean Sheng Tan*



9elements GmbH, Kortumstraße 19-21, 44787 Bochum, Germany
Email: sheng.tan@9elements.com
Phone: *+49 234 68 94 188 <+492346894188>*
Mobile: *+49 176 76 113842 <+4917676113842>*

Registered office: Bochum
Commercial register: Amtsgericht Bochum, HRB 17519
Management: Sebastian German, Eray Bazaar

Data protection information according to Art. 13 GDPR
<https://9elements.com/privacy>


On Mon, 21 Mar 2022 at 10:41, Sean Rhodes <sean@starlabs.systems> wrote:

> Hi Liming
>
> This is how the entries appear for multiple MMC drives. Can you advise how
> you'd like me to adjust the patch?
>
> Thanks
>
> Sean
> 
>
>

[-- Attachment #1.2: Type: text/html, Size: 3090 bytes --]

[-- Attachment #2: MMCentries.jpg --]
[-- Type: image/jpeg, Size: 65561 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
  2022-05-17 12:19         ` Sheng Lean Tan
@ 2022-05-17 13:58           ` Ni, Ray
  0 siblings, 0 replies; 8+ messages in thread
From: Ni, Ray @ 2022-05-17 13:58 UTC (permalink / raw)
  To: devel@edk2.groups.io, Tan, Lean Sheng, Rhodes, Sean


[-- Attachment #1.1: Type: text/plain, Size: 1419 bytes --]

Sean,
Below function is called to make sure the description for each boot option doesn’t equal. Can you investigate why it doesn’t work for eMMC?
  BmMakeBootOptionDescriptionUnique (BootOptions, *BootOptionCount);


From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sheng Lean Tan
Sent: Tuesday, May 17, 2022 8:19 PM
To: devel@edk2.groups.io; Rhodes, Sean <sean@starlabs.systems>
Subject: Re: [edk2-devel] 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries

Hi Liming,
Mind to help on this? This patch has been hanging on for a long time :(
Thank you.

Best Regards,
Lean Sheng Tan

[http://static.9elements.com/logo-signature.png]
9elements GmbH, Kortumstraße 19-21, 44787 Bochum, Germany
Email: sheng.tan@9elements.com<mailto:sheng.tan@9elements.com>
Phone: +49 234 68 94 188<tel:+492346894188>
Mobile: +49 176 76 113842<tel:+4917676113842>

Registered office: Bochum
Commercial register: Amtsgericht Bochum, HRB 17519
Management: Sebastian German, Eray Bazaar

Data protection information according to Art. 13 GDPR<https://9elements.com/privacy>


On Mon, 21 Mar 2022 at 10:41, Sean Rhodes <sean@starlabs.systems<mailto:sean@starlabs.systems>> wrote:
Hi Liming

This is how the entries appear for multiple MMC drives. Can you advise how you'd like me to adjust the patch?

Thanks

Sean
[cid:image001.jpg@01D86A39.4B0D42B0]


[-- Attachment #1.2: Type: text/html, Size: 8132 bytes --]

[-- Attachment #2: image001.jpg --]
[-- Type: image/jpeg, Size: 65619 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-17 13:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662841.git.sean@starlabs.systems>
2022-01-31 21:00 ` [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries Sean Rhodes
2022-02-07  1:47   ` 回复: [edk2-devel] " gaoliming
2022-02-10 21:35     ` [edk2-devel] " Sean Rhodes
2022-03-21  9:41       ` Sean Rhodes
2022-04-01  2:08         ` 回复: " gaoliming
2022-04-01  2:18           ` Ni, Ray
2022-05-17 12:19         ` Sheng Lean Tan
2022-05-17 13:58           ` Ni, Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox