Re: [edk2-devel] [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it by default

2021-02-08 Thread Bob Feng
Matt,

I helped to convert the endling character for those PosixLike scripts and 
created a PR https://github.com/tianocore/edk2/pull/1415

Liming,

I verified the your pervious comments on this patch.

Thanks,
Bob

-Original Message-
From: Chen, Christine  
Sent: Tuesday, February 9, 2021 10:32 AM
To: matthewfcarl...@gmail.com; devel@edk2.groups.io
Cc: Feng, Bob C ; Liming Gao 
Subject: RE: [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it 
by default

Reviewed-by: Yuwei Chen

> -Original Message-
> From: matthewfcarl...@gmail.com 
> Sent: Tuesday, February 9, 2021 8:51 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Liming Gao
> ; Chen, Christine ;
> Matthew Carlson 
> Subject: [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it by
> default
> 
> From: Matthew Carlson 
> 
> Use the new edk2-basetools pip module.
> Includes a helpful message in setup to let users know which has been
> selected.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> 
> Reviewed-by: Bob Feng 
> 
> Signed-off-by: Matthew Carlson 
> ---
>  .pytool/CISettings.py
>| 51
> +++-
>  BaseTools/BinPipWrappers/PosixLike/AmlToC
>| 14
> ++
>  BaseTools/BinPipWrappers/PosixLike/BPDG  
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/BrotliCompress
>|
> 34 +
>  BaseTools/BinPipWrappers/PosixLike/DevicePath
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/Ecc   
>| 13
> +
>  BaseTools/BinPipWrappers/PosixLike/EfiRom
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenCrc32  
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenDepex  
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/GenFds
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/GenFfs
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenFv 
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenFw 
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable  
>|
> 12 +
>  BaseTools/BinPipWrappers/PosixLike/GenSec
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenerateCapsule   
>|
> 12 +
>  BaseTools/BinPipWrappers/PosixLike/LzmaCompress  
>|
> 29 +++
>  BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress   
>|
> 19 
>  BaseTools/BinPipWrappers/PosixLike/PatchPcdValue 
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign 
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys
> | 12 +
>  BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign 
>|
> 12 +
>  BaseTools/BinPipWrappers/PosixLike/Split 
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/TargetTool
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/TianoCompress 
>|
> 29 +++
>  BaseTools/BinPipWrappers/PosixLike/Trim  
>| 13
> +
>  BaseTools/BinPipWrappers/PosixLike/UPT   
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/VfrCompile
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/VolInfo   
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/build 
>| 12
> +
>  BaseTools/{BinWrappers =>
> BinPipWrappers}/PosixLike/posix_path_env.yaml | 21 
>  BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat  
>|
> 3 ++
>  BaseTools/BinPipWrappers/WindowsLike/BPDG.bat
>|
> 3 ++
>  BaseTools/BinPipWrappers/WindowsLike/Ecc.bat 
>|  3
> ++
>  BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat
> |  3 ++
>  BaseTools/BinPipWrappers/WindowsLike/GenFds.bat  
>|
> 3 ++
>  BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat
> |  3 ++
>  BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat
> |  1 +
>  

Re: [edk2-devel] Does EDK2 ArmVirtPkg has support for a virtio-mmio-blk device

2021-02-08 Thread Ying Fang
(Adding Ard, just in case -- the topic is set by the first quoted
question below)

On 02/08/21 04:24, Ying Fang wrote:

> 
> Hi, Does anybody know whether the EDK2 ArmVirtPkg has support for a
> virtio-mmio-device ?

> virtio-mmio is a virtio transport type, not a particular device.

Sorry, the description is not that accurate.
I mean vritio-blk-device over virtio-mmio transport. Thanks for pointing it out.

> (1) ArmVirtPkg + OvmfPkg support the following three virtio transports:
>
> (1a) Virtio PCI, virtio spec version 0.9.5,
> [OvmfPkg/VirtioPciDeviceDxe]
>
> (1b) Virtio PCI, virtio spec version 1.0,
> [OvmfPkg/Virtio10Dxe]
>
> (1c) Virtio MMIO, virtio spec version 0.9.5 *only*
> [ArmVirtPkg/VirtioFdtDxe]
> [OvmfPkg/Library/VirtioMmioDeviceLib]
>
> (2) Additionally, OvmfPkg offers the following virtio device drivers:
>
> - VirtioBlkDxe
> - VirtioFsDxe [1.0 only]
> - VirtioGpuDxe [1.0 only]
> - VirtioNetDxe
> - VirtioRngDxe
> - VirtioScsiDxe
>
> (2a) The drivers marked "1.0 only" will only work on top of the
> transport mentioned in point (1b).
>
> Put differently, they will only drive the following virtio-1.0 QEMU
> device models:
>
> - VirtioFsDxe: "vhost-user-fs-pci"
> - VirtioGpuDxe: "virtio-gpu-pci"
>
> (2b) The drivers *not* marked "1.0 only" will work on top of *either*
> virtio transport that's noted in (1a), (1b), (1c).

Thanks so much for the information,  since i am a freshman to EDK2, it is 
really useful for us.

> This implies that, using the ArmVirtQemu firmware platform, you can use
> the following QEMU device models *too*:
>
> - VirtioBlkDxe: "virtio-blk-device"
> - VirtioNetDxe: "virtio-net-device"
> - VirtioRngDxe: "virtio-rng-device"
> - VirtioScsiDxe: "virtio-scsi-device"

> 
> I am using EDK2 ArmVirtPkg v2.70 as the default UEFI for my devel program.

> A commit hash would be more useful (not sure if it matters for now, but
> in case it does, a commit hash is best).

I am using the EDK2 tag: edk2-stable202008.

> 
> Since we have not implemented the PCI/PCIe suff, a virtio-mmio-blk device
> is used as the image disk.

> There is no such device model ("virtio-mmio-blk") in QEMU, as far as I
> can tell.
>
> Do you mean "virtio-blk-device"?

yes you are right, I mean a virtio-blk-device over mmio transport instead of 
PCI.

> 
> We can boot the EDK2 ArmVirtPkg into UEFI shell, and the Mapping table
> message shows
> 
> Mapping table:
> BLK0: Alias(s):
> VenHw(xxx, 00)

> Do you have an EFI system partition on the virtio block device?
>

We do have a virtio-block-device with EFI system partition.

> Because, the "map" UEFI shell command (executed automatically at shell
> startup) should list such a filesystem as "FS0:" here.

I did not see the "FS0:" flag.

> 
> However when I chose the “Boot From File” menu item, I can not see the
> virtio-mmio-blk device.

> That's not surprising, minimally because the MAP command above does not
> list "FS0:".

Yes.

> 
> So does anybody know whether the EDK2 ArmVirtPkg has support for a
> virtio-mmio-device ?

> The virtio-blk-device is supported, yes, using the virtio-mmio (0.9.5)
> transport type. But in order to actually boot from the device, you need
> more things. Such as:

I now realize that we emulate the virtio-blk-device over mmio, and we only 
emulate virtio-1.0 spec.
As mentioned in (1c) , EDK2 only supports virtio-0.95 spec for now, so this 
maybe a big problem.
Since it may not handshake ok if we only emulate virtio-1.0.

I will try to emulate the virtio-0.95 later to see if it is the root cause.

> - an EFI system partition / FAT filesystem on the device,
>
> - bootable UEFI binaries (matching the guest architecture),
>
> - a correctly populated "bootorder" fw_cfg file, so that the UEFI boot
> order be updated as well. This "bootorder" fw_cfg file is created by
> QEMU upon use of the "bootindex" device properties, and it is acted upon
> by the following components:

We do pass the "bootorder" via the fw_cfg interface to EDK2 and the log
says EDK2 has recognized it.

> ArmVirtPkg/Library/PlatformBootManagerLib
> OvmfPkg/Library/QemuBootOrderLib
>
> Thanks
> Laszlo

Well, thanks so much for the reply.
The information provided is really helpfull for us.

BTW, I found it really hard to read and understand the EDK2 code for me, there 
is a long way to go.

Thanks.
Ying.


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




Re: [edk2-devel] reg: iPxe Boot in NetworkPkg

2021-02-08 Thread Sivaraman Nainar
Maciej:

I am checking with the customer on the real use case. 

I understand the customer is trying to run reboot test for 1000 times with 
Network Enabled and I am waiting to know why the network chain loading is 
enabled.

-Siva
-Original Message-
From: Rabeda, Maciej [mailto:maciej.rab...@linux.intel.com] 
Sent: Monday, February 8, 2021 11:56 PM
To: devel@edk2.groups.io; mc...@ipxe.org; Sivaraman Nainar
Subject: Re: [edk2-devel] reg: iPxe Boot in NetworkPkg

Siva,

Just as Michael mentioned - the log you have provided suggests that you are 
recurse-booting iPXE.
Next server: 10.0.84.155
Filename: ipxe.efi
tftp://10.0.84.155/ipxe.efi... ok

May I ask why?

Thanks,
Maciej

On 05-Feb-21 11:10, Michael Brown wrote:
> On 05/02/2021 08:28, Sivaraman Nainar wrote:
>> Hello Maciej:
>>
>> I met an issue when tried to do the PXE boot with keeping the 
>> ipxe.efi as boot file.
>>
>> When iPXE.efi is set as boot file once it downloaded it again starts, 
>> it does the download and start of iPXE continuously and at some point 
>> it asserts in MNP Driver.
>
> Do you mean that you have set up an infinite loop in which UEFI loads 
> ipxe.efi which loads ipxe.efi which loads ipxe.efi which loads 
> ipxe.efi etc?
>
> If so, then my guess is that you are simply running out of stack 
> space. As far as I can tell, there is no memory protection around the 
> stack in EDK2: once you have set up any kind of infinite recursion 
> scenario then you are guaranteed to eventually underrun the stack and 
> start overwriting random areas of memory.
>
> Michael
>
>
> 
>
>



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




Re: [edk2-devel] [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it by default

2021-02-08 Thread Yuwei Chen
Reviewed-by: Yuwei Chen

> -Original Message-
> From: matthewfcarl...@gmail.com 
> Sent: Tuesday, February 9, 2021 8:51 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Liming Gao
> ; Chen, Christine ;
> Matthew Carlson 
> Subject: [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it by
> default
> 
> From: Matthew Carlson 
> 
> Use the new edk2-basetools pip module.
> Includes a helpful message in setup to let users know which has been
> selected.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> 
> Reviewed-by: Bob Feng 
> 
> Signed-off-by: Matthew Carlson 
> ---
>  .pytool/CISettings.py
>| 51
> +++-
>  BaseTools/BinPipWrappers/PosixLike/AmlToC
>| 14
> ++
>  BaseTools/BinPipWrappers/PosixLike/BPDG  
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/BrotliCompress
>|
> 34 +
>  BaseTools/BinPipWrappers/PosixLike/DevicePath
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/Ecc   
>| 13
> +
>  BaseTools/BinPipWrappers/PosixLike/EfiRom
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenCrc32  
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenDepex  
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/GenFds
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/GenFfs
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenFv 
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenFw 
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable  
>|
> 12 +
>  BaseTools/BinPipWrappers/PosixLike/GenSec
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/GenerateCapsule   
>|
> 12 +
>  BaseTools/BinPipWrappers/PosixLike/LzmaCompress  
>|
> 29 +++
>  BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress   
>|
> 19 
>  BaseTools/BinPipWrappers/PosixLike/PatchPcdValue 
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign 
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys
> | 12 +
>  BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign 
>|
> 12 +
>  BaseTools/BinPipWrappers/PosixLike/Split 
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/TargetTool
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/TianoCompress 
>|
> 29 +++
>  BaseTools/BinPipWrappers/PosixLike/Trim  
>| 13
> +
>  BaseTools/BinPipWrappers/PosixLike/UPT   
>| 12
> +
>  BaseTools/BinPipWrappers/PosixLike/VfrCompile
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/VolInfo   
>| 29
> +++
>  BaseTools/BinPipWrappers/PosixLike/build 
>| 12
> +
>  BaseTools/{BinWrappers =>
> BinPipWrappers}/PosixLike/posix_path_env.yaml | 21 
>  BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat  
>|
> 3 ++
>  BaseTools/BinPipWrappers/WindowsLike/BPDG.bat
>|
> 3 ++
>  BaseTools/BinPipWrappers/WindowsLike/Ecc.bat 
>|  3
> ++
>  BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat
> |  3 ++
>  BaseTools/BinPipWrappers/WindowsLike/GenFds.bat  
>|
> 3 ++
>  BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat
> |  3 ++
>  BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat
> |  1 +
>  BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat
> |  3 ++
>  BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat   
>|
> 3 ++
>  BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat
> |  1 +
>  BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat
> |  3 ++
>  BaseTools/BinPipWrappers/WindowsLike/Split.bat   
>|  3
> ++
>  BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat  
>|
> 3 ++
>  

Re: [edk2-devel] [PATCH] UefiPayloadPkg/PlatformBootManager: Connect console after EndOfDxe

2021-02-08 Thread Wang, Sunny (HPS SW)
Sorry for the delay.
Thanks for clarifying and further checking this, Dong.
I think some platforms in https://github.com/tianocore/edk2-platforms would do 
this before EndOfDxe. 
Yeah, I agree with Dong. If UefiPayloadPkg doesn't support trusted console and 
may not support it in the future, I also think it's fine to have this change. 

Reviewed-by: Sunny Wang < sunnyw...@hpe.com>

Regards,
Sunny Wang

-Original Message-
From: Dong, Guo  
Sent: Saturday, February 6, 2021 7:16 AM
To: Patrick Rudolph ; Wang, Sunny (HPS SW) 

Cc: devel@edk2.groups.io; Park, Aiden ; You, Benjamin 
; philipp.deppenwi...@9elements.com; Ma, Maurice 

Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg/PlatformBootManager: Connect 
console after EndOfDxe


Trusted console is required for TCG Physical Presence and only trusted console 
could be connected before EndOfDxe. Since TCG Physical Presence is not enabled 
yet in the UefiPayloadPkg, I think it is ok to have this change. 

Reviewed-by: Guo Dong 

> -Original Message-
> From: Patrick Rudolph 
> Sent: Wednesday, February 3, 2021 3:26 AM
> To: Wang, Sunny (HPS SW) 
> Cc: devel@edk2.groups.io; Park, Aiden ; You, 
> Benjamin ; philipp.deppenwi...@9elements.com; 
> Ma, Maurice ; Dong, Guo 
> Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/PlatformBootManager:
> Connect console after EndOfDxe
> 
> Hi Sunny,
> none of the other packages are doing this before EndOfDxe. And there's 
> no point in having trusted console as earlier as possible, as nothing 
> is displayed in PlatformBootManagerBeforeConsole().
> Please explain your use case. I don't see one here.
> 
> Kind Regards,
> Patrick Rudolph
> 
> On Wed, Feb 3, 2021 at 10:32 AM Wang, Sunny (HPS SW) 
>  wrote:
> >
> > Hi Patrick,
> >
> > I'm not familiar with UefiPayloadPkg. However, since we may want to 
> > enable
> the trusted console as earlier as possible, you may still need to keep 
> the
> PlatformConsoleInit() call at the beginning of
> PlatformBootManagerBeforeConsole() to support the platform that has 
> trusted/on-board Consoles.
> >
> > Regards,
> > Sunny Wang
> >
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of 
> > Patrick
> Rudolph
> > Sent: Tuesday, February 2, 2021 4:34 PM
> > To: devel@edk2.groups.io
> > Cc: aiden.p...@intel.com; benjamin@intel.com;
> philipp.deppenwi...@9elements.com; maurice...@intel.com; 
> guo.d...@intel.com
> > Subject: [edk2-devel] [PATCH] UefiPayloadPkg/PlatformBootManager:
> Connect console after EndOfDxe
> >
> > Currently the console is connected before EndOfDxe causing 
> > OptionsROMs to
> be loaded, but their drivers aren't used and thus no GOP is installed.
> >
> > To make use of 3rdparty OptionROMs connect the console after EndOfDxe.
> >
> > Tested on Intel CFL board using Nvidia Quadro GPU.
> >
> > Signed-off-by: Patrick Rudolph 
> > ---
> >  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
> > |
> 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> > index c5c6af0abc..7fa3a048b7 100644
> > ---
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> > +++
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
> > +++ c
> > @@ -157,8 +157,6 @@ PlatformBootManagerBeforeConsole (
> >EFI_INPUT_KEYDown;
> >EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
> >
> > -  PlatformConsoleInit ();
> > -
> >//
> >// Register ENTER as CONTINUE key
> >//
> > @@ -192,6 +190,8 @@ PlatformBootManagerBeforeConsole (
> >// Dispatch deferred images after EndOfDxe event and ReadyToLock
> installation.
> >//
> >EfiBootManagerDispatchDeferredImages ();
> > +
> > +  PlatformConsoleInit ();
> >  }
> >
> >  /**
> > --
> > 2.26.2
> >
> >
> >
> > 
> >
> >


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




Re: [edk2-devel] [PATCH v4] IntelFsp2Pkg: Add YAML file generation support

2021-02-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Loo Tung Lun 
> Sent: Monday, February 8, 2021 1:04 PM
> To: devel@edk2.groups.io
> Cc: Loo, Tung Lun ; Ma, Maurice
> ; Desimone, Nathaniel L
> ; Zeng, Star ; Chiu,
> Chasel 
> Subject: [PATCH v4] IntelFsp2Pkg: Add YAML file generation support
> 
> Add support for YAML format file generation in addition
> to current BSF structure. Configuration of YAML format
> output will be supported by an open source ConfigEditor.
> 
> Reference to YAML code, test and ConfigEditor is at
> https://github.com/joshloo/fsp_yaml_cfg/tree/master/Tools
> 
> A unit test is also added in Tests folder. This test compares
> the generated yaml file against the expected output to know
> if it is constructing the yaml data structure as expected.
> 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Chasel Chiu 
> Signed-off-by: Loo Tung Lun 
> ---
>  IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py   | 877
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> 
>  IntelFsp2Pkg/Tools/GenCfgOpt.py| 470
> +
> +
> +
> +
> +
> +--
> --
>  IntelFsp2Pkg/Tools/Tests/ExpectedFspUpd.h  |  16 
> 
>  IntelFsp2Pkg/Tools/Tests/ExpectedFspmUpd.h |  75
> +
> ++
>  IntelFsp2Pkg/Tools/Tests/ExpectedFspsUpd.h |  69
> +
> 
>  IntelFsp2Pkg/Tools/Tests/ExpectedFsptUpd.h |  87
> +
> ++
>  IntelFsp2Pkg/Tools/Tests/ExpectedOutput.bsf|  88
> +
> +++
>  IntelFsp2Pkg/Tools/Tests/ExpectedOutput.yaml   | 267
> +
> +
> +
> +
> +++
>  IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc| 469
> +
> +
> +
> +
> +
> +
> +
> ++
>  IntelFsp2Pkg/Tools/Tests/test_yaml.py  |  96
> +
> +++
>  IntelFsp2Pkg/Tools/UserManuals/FspDscBsf2YamlUserManual.md |  39
> +++
>  11 files changed, 2421 insertions(+), 132 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py
> b/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py
> new file mode 100644
> index 00..cad9b60e73
> --- /dev/null
> +++ b/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py
> @@ -0,0 +1,877 @@
> +#!/usr/bin/env python
> 
> +## @ FspDscBsf2Yaml.py
> 
> +# This script convert DSC or BSF format file into YAML format
> 
> +#
> 
> +# Copyright(c) 2021, Intel Corporation. All rights reserved.
> 
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +#
> 
> +##
> 
> +
> 
> +import os
> 
> +import re
> 
> +import sys
> 
> +from datetime import date
> 
> 

[edk2-devel] [PATCH v5 1/1] BaseTools: Use pip module if available, CI uses it by default

2021-02-08 Thread Matthew Carlson
From: Matthew Carlson 

Use the new edk2-basetools pip module.
Includes a helpful message in setup to let users know which has been
selected.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 

Reviewed-by: Bob Feng 

Signed-off-by: Matthew Carlson 
---
 .pytool/CISettings.py  
 | 51 +++-
 BaseTools/BinPipWrappers/PosixLike/AmlToC  
 | 14 ++
 BaseTools/BinPipWrappers/PosixLike/BPDG
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/BrotliCompress  
 | 34 +
 BaseTools/BinPipWrappers/PosixLike/DevicePath  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/Ecc 
 | 13 +
 BaseTools/BinPipWrappers/PosixLike/EfiRom  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenCrc32
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenDepex
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/GenFds  
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/GenFfs  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenFv   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenFw   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/GenSec  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenerateCapsule 
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/LzmaCompress
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress 
 | 19 
 BaseTools/BinPipWrappers/PosixLike/PatchPcdValue   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Split   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/TargetTool  
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/TianoCompress   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/Trim
 | 13 +
 BaseTools/BinPipWrappers/PosixLike/UPT 
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/VfrCompile  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/VolInfo 
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/build   
 | 12 +
 BaseTools/{BinWrappers => BinPipWrappers}/PosixLike/posix_path_env.yaml
 | 21 
 BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/BPDG.bat  
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/Ecc.bat   
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat  
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/GenFds.bat
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/GenPatchPcdTable.bat  
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/GenerateCapsule.bat   
 |  1 +
 BaseTools/BinPipWrappers/WindowsLike/PatchPcdValue.bat 
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/Pkcs7Sign.bat 
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat 
 |  1 +
 BaseTools/BinPipWrappers/WindowsLike/Rsa2048Sha256Sign.bat 
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/Split.bat 
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/TargetTool.bat
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/Trim.bat  
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/UPT.bat   
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/build.bat 
 |  3 ++
 BaseTools/{BinWrappers => 
BinPipWrappers}/WindowsLike/win_build_tools_path_env.yaml |  3 +-
 

[edk2-devel] [PATCH v5 0/1] Use Pip version of BaseTools

2021-02-08 Thread Matthew Carlson
From: Matthew Carlson 

Hello all,

This patch adds the capability to leverage the pip based BaseTools.
The BaseTools master is current with EDK2 master (as of 3pm Nov 2, 2020).
While I could rehash a lot of what has gone out on the mailing list, I think
it might be better just to link the discussion.

In a nutshell, setup will detect if edk2-basetools is installed, and if it
is, use the other verison of BinWrappers (BinPipWrappers). This should
provide an easy and convenient way to transition over. By default, CI
uses the pip version.

The pipeline is setup. Every commit that gets pushed to master on basetools
get published to pypi and tagged. This should offer bisectability and easier
debugging. Additionally, the pip requirements file tracks a specific version.

We'd like to set a date for when PR's no longer go into EDK2 for BaseTools
and instead go exclusively into the new basetools repo.

V5 Changes: Add Split.bat and removed BrotliCompress.bat
V4 Changes: converted files to DOX line ending, added executable chmod to unix
binwrappers, and removed unnecessary binwrappers.
V3 Changes: converted some files to unix line ending

Ref: https://edk2.groups.io/g/devel/topic/76572200#64993
Ref: https://github.com/tianocore/edk2-basetools
Ref: https://github.com/tianocore/edk2/pull/1072

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Sean Brogan 
Cc: Michael Kinney 

Matthew Carlson (1):
  BaseTools: Use pip module if available, CI uses it by default

 .pytool/CISettings.py  
 | 51 +++-
 BaseTools/BinPipWrappers/PosixLike/AmlToC  
 | 14 ++
 BaseTools/BinPipWrappers/PosixLike/BPDG
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/BrotliCompress  
 | 34 +
 BaseTools/BinPipWrappers/PosixLike/DevicePath  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/Ecc 
 | 13 +
 BaseTools/BinPipWrappers/PosixLike/EfiRom  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenCrc32
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenDepex
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/GenFds  
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/GenFfs  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenFv   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenFw   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenPatchPcdTable
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/GenSec  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/GenerateCapsule 
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/LzmaCompress
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/LzmaF86Compress 
 | 19 
 BaseTools/BinPipWrappers/PosixLike/PatchPcdValue   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Pkcs7Sign   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256GenerateKeys   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Rsa2048Sha256Sign   
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/Split   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/TargetTool  
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/TianoCompress   
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/Trim
 | 13 +
 BaseTools/BinPipWrappers/PosixLike/UPT 
 | 12 +
 BaseTools/BinPipWrappers/PosixLike/VfrCompile  
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/VolInfo 
 | 29 +++
 BaseTools/BinPipWrappers/PosixLike/build   
 | 12 +
 BaseTools/{BinWrappers => BinPipWrappers}/PosixLike/posix_path_env.yaml
 | 21 
 BaseTools/BinPipWrappers/WindowsLike/AmlToC.bat
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/BPDG.bat  
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/Ecc.bat   
 |  3 ++
 BaseTools/BinPipWrappers/WindowsLike/GenDepex.bat  
 |  3 ++
 

Re: [edk2-devel] [PATCH 3/8] TigerlakeOpenBoardPkg: Add library instances

2021-02-08 Thread Chaganty, Rangasai V
Also, PeiFspSiPolicyInitLib.c is only including three header files. Please 
double check and remove this file if these header files are already included by 
the callers.

-Original Message-
From: Chaganty, Rangasai V 
Sent: Monday, February 08, 2021 4:43 PM
To: Luo, Heng ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L 
Subject: RE: [PATCH 3/8] TigerlakeOpenBoardPkg: Add library instances

In BasePlatformHookLib.c, the code below It8628SioSerialPortInit () can be 
removed.

Thanks,
Sai

-Original Message-
From: Luo, Heng  
Sent: Saturday, February 06, 2021 9:38 PM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Desimone, Nathaniel L 

Subject: [PATCH 3/8] TigerlakeOpenBoardPkg: Add library instances

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3175

Adds the following library instances:
  * FspWrapper/Library/PeiFspPolicyInitLib
  * FspWrapper/Library/PeiSiDefaultPolicyInitLib
  * FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib
  * Library/BasePlatformHookLib
  * Library/SmmSpiFlashCommonLib
  * Policy/Library/DxeSiliconPolicyUpdateLib

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Signed-off-by: Heng Luo 
---
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c
|  79 
+++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c
 |  51 
+++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c
  |  27 +++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c
| 372 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
   | 308 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h
   | 187 
+++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
 | 184 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c
 | 240 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c
   |  49 +
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSiPolicyInitLib.c
 |  10 ++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c
   |  39 +++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf
 |  38 ++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c
   |  40 
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf
 |  38 ++
 
Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
  | 460 

Re: [edk2-devel] [PATCH 3/8] TigerlakeOpenBoardPkg: Add library instances

2021-02-08 Thread Chaganty, Rangasai V
In BasePlatformHookLib.c, the code below It8628SioSerialPortInit () can be 
removed.

Thanks,
Sai

-Original Message-
From: Luo, Heng  
Sent: Saturday, February 06, 2021 9:38 PM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Desimone, Nathaniel L 

Subject: [PATCH 3/8] TigerlakeOpenBoardPkg: Add library instances

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3175

Adds the following library instances:
  * FspWrapper/Library/PeiFspPolicyInitLib
  * FspWrapper/Library/PeiSiDefaultPolicyInitLib
  * FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib
  * Library/BasePlatformHookLib
  * Library/SmmSpiFlashCommonLib
  * Policy/Library/DxeSiliconPolicyUpdateLib

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Signed-off-by: Heng Luo 
---
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c
|  79 
+++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c
 |  51 
+++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c
  |  27 +++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c
| 372 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
   | 308 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h
   | 187 
+++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
 | 184 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c
 | 240 

 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c
   |  49 +
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSiPolicyInitLib.c
 |  10 ++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c
   |  39 +++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf
 |  38 ++
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c
   |  40 
 
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf
 |  38 ++
 
Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
  | 460 

 
Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf
   

Re: [edk2-devel] [PATCH 1/1] ArmPkg: add DebugLib to OemMiscLibNull

2021-02-08 Thread Rebecca Cran

On 2/8/21 4:48 PM, Leif Lindholm wrote:

The just added OemMiscLibNull fails to build due to DebugLib.h not
being included, missing the ASSERT definition. Add the include and the
library dependency.

Cc: Rebecca Cran 
Cc: Ard Biesheuvel 
Signed-off-by: Leif Lindholm 
---
  ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf | 2 +-
  ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c   | 1 +
  2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf 
b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
index b21eeade64b5..5c4268f68b4a 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
@@ -28,4 +28,4 @@ [Packages]
  
  [LibraryClasses]

BaseMemoryLib
-
+  DebugLib
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c 
b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 767fc08d166b..73cebef2d1b9 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -11,6 +11,7 @@
  
  #include 

  #include 
+#include 
  #include 
  
  #include 




Reviewed-by: Rebecca Cran 

--
Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71489): https://edk2.groups.io/g/devel/message/71489
Mute This Topic: https://groups.io/mt/80492440/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] ArmPkg: add DebugLib to OemMiscLibNull

2021-02-08 Thread Leif Lindholm
The just added OemMiscLibNull fails to build due to DebugLib.h not
being included, missing the ASSERT definition. Add the include and the
library dependency.

Cc: Rebecca Cran 
Cc: Ard Biesheuvel 
Signed-off-by: Leif Lindholm 
---
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf | 2 +-
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf 
b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
index b21eeade64b5..5c4268f68b4a 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
@@ -28,4 +28,4 @@ [Packages]
 
 [LibraryClasses]
   BaseMemoryLib
-
+  DebugLib
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c 
b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 767fc08d166b..73cebef2d1b9 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
-- 
2.20.1



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




Re: [edk2-devel] [PATCH v8 00/21] ArmPkg,MdePkg: Add Universal/Smbios, and related changes

2021-02-08 Thread Leif Lindholm
On Mon, Feb 08, 2021 at 12:02:08 -0700, Rebecca Cran wrote:
> On 2/8/21 11:55 AM, Leif Lindholm wrote:
> 
> > These are all trailing newlines at EOF, which git am complains about
> > when importing the patches, and an additional fix to aforementioned
> > macro.
> > 
> > Are you OK with me doing this?
> 
> Yes, please do.

Thanks - for the remaining patch:
Reviewed-by: Leif Lindholm 

Pushed as 472276f59bba..ecc267fec55a.

/
Leif


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




Re: [edk2-devel] [PATCH v8 00/21] ArmPkg,MdePkg: Add Universal/Smbios, and related changes

2021-02-08 Thread Rebecca Cran

On 2/8/21 11:55 AM, Leif Lindholm wrote:


These are all trailing newlines at EOF, which git am complains about
when importing the patches, and an additional fix to aforementioned
macro.

Are you OK with me doing this?


Yes, please do.

--
Rebecca Cran


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




Re: [edk2-devel] [BUG/PATCH] Platform/RaspberryPi: Only enable IORT when 3G limit is disabled.

2021-02-08 Thread Jeremy Linton

On 2/8/21 11:36 AM, Andrei Warkentin wrote:

I'd rather we not set the PcdRamMoreThan3GB on a device with 1 or 2GB. I 
recognise you're using this to choose behavior for an old Linux version, but 
it's still non-sensical to the end user and it becomes a maintenance burden 
since the logic is no longer clear, so you might as well add a boot option to 
disable the IORT (and document as being for older Linux kernels) or just not 
install it if you explicitly being booted on a system with less RAM. I.e.

  if (PcdGet32 (PcdRamLimitTo3GB) || mModelInstalledMB < 2 * 1024) {

   return FALSE;

 }


Yah that works now too I guess. I split this off from the emmc2 patch 
where I was lowering the IORT limit to 1G to force lower allocation.


But I ended up just providing an option to disable DMA, which is more 
reliable anyway.




From: devel@edk2.groups.io  on behalf of Jeremy Linton via 
groups.io 
Sent: Monday, February 1, 2021 4:44 PM
To: devel@edk2.groups.io 
Cc: p...@akeo.ie ; Andrei Warkentin ; samer.el-haj-mahm...@arm.com 
; l...@nuviainc.com ; ard.biesheu...@arm.com 
; Jeremy Linton 
Subject: [edk2-devel] [BUG/PATCH] Platform/RaspberryPi: Only enable IORT when 
3G limit is disabled.

The 3G limit, and the 2G IORT are intended to solve
the same linux problem, and limit PCI DMA operations
to the first 3G of RAM. Older linux kernels, as
used with RHEL/Centos, trigger an assertion*
when a DMA operation starts that doesn't fit within
the 2G range specified by the IORT.

The simple solution is to only enable the IORT
when the 3G flag is disabled.

* 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpftf%2FRPi4%2Fissues%2F123data=04%7C01%7Cawarkentin%40vmware.com%7C92f310e07997434a267408d8c702f698%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637478162838925480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=dKbis45PDc6ciBMWvSime3ZhQJGOwYLN0OHTnhMSvvU%3Dreserved=0

Fixes: dac891da5cf3 ("Platform/RaspberryPi/AcpiTables: add a IORT ACPI table to 
limit XHCI DMA")
Signed-off-by: Jeremy Linton 
---
  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 26 +-
  1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 19ef950f10..9581bc41e1 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -217,13 +217,23 @@ SetupVariables (
  ASSERT_EFI_ERROR (Status);

}



-  if (mModelFamily >= 4 && mModelInstalledMB > 3 * 1024) {

+  if (mModelFamily >= 4) {

+if (mModelInstalledMB > 3 * 1024) {

+  /*

+   * This allows changing PcdRamLimitTo3GB in forms.

+   */

+  Status = PcdSet32S (PcdRamMoreThan3GB, 1);

+  ASSERT_EFI_ERROR (Status);

+} else {

+  Status = PcdSet32S (PcdRamMoreThan3GB, 0);

+  ASSERT_EFI_ERROR (Status);

+}

+

  /*

- * This allows changing PcdRamLimitTo3GB in forms.

+ * Enable the "3G ram limit" on 2GB device because we

+ * are going to utlize that limit as a new/old kernel

+ * flag and also disable the IORT if the 3G limit is set.

   */

-Status = PcdSet32S (PcdRamMoreThan3GB, 1);

-ASSERT_EFI_ERROR (Status);

-

  Size = sizeof (UINT32);

  Status = gRT->GetVariable (L"RamLimitTo3GB",

 ,

@@ -755,6 +765,12 @@ HandleDynamicNamespace (
  DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n"));



  return FALSE;

+  case SIGNATURE_32 ('I', 'O', 'R', 'T'):

+// only enable the IORT on machines with >3G and no limit

+// to avoid problems with rhel/centos

+if (PcdGet32 (PcdRamLimitTo3GB)) {

+  return FALSE;

+}

}



return TRUE;

--
2.13.7



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71032): 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F71032data=04%7C01%7Cawarkentin%40vmware.com%7C92f310e07997434a267408d8c702f698%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637478162838925480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=asFWjKVaiPH31M3SCUx8TQtzDoucFNTf8TqcYW%2Bo0uY%3Dreserved=0
Mute This Topic: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F80300339%2F4387333data=04%7C01%7Cawarkentin%40vmware.com%7C92f310e07997434a267408d8c702f698%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637478162838925480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Njvni%2BMK0z38Xi3rw2xwPNiMBmesole6evqVHwZB87c%3Dreserved=0
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 

Re: [edk2-devel] [PATCH v8 00/21] ArmPkg,MdePkg: Add Universal/Smbios, and related changes

2021-02-08 Thread Leif Lindholm
On Sun, Feb 07, 2021 at 17:52:33 -0700, Rebecca Cran wrote:
> Much of the data for the SMBIOS tables is generic, and need not be
> duplicated for each platform. This patch series introduces
> ArmPkg/Universal/Smbios, which is largely copied from
> edk2-platforms/Silicon/HiSilicon/Drivers/Smbios and generates SMBIOS
> tables 0,1,2,3,4,7,13,32 and uses a combination of PCDs and calls into a
> new OemMiscLib to get information which varies between platforms.
> 
> I plan to submit a patch against SbsaQemu to update it to use this new
> functionality.
> 
> Changes from v7 to v8:
> 
> o Changed associativity function to return 1-based value.
> o Changed cache level parameter and return values to be 1-based.
> o Other changes based on Leif's review feedback.

There was also a change to a macro in 7/21 (more below).

I think this set is good to go in now, but I'd like to fold in the
following changes if you're OK with that:

diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf 
b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
index b21eeade64b5..dc4e02966ca8 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
@@ -28,4 +28,3 @@ [Packages]
 
 [LibraryClasses]
   BaseMemoryLib
-
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf 
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
index 60d8fe31c219..2d68cc0fe2e2 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
@@ -85,5 +85,3 @@ [Guids]
 
 [Depex]
   gEfiSmbiosProtocolGuid
-
-
diff --git a/ArmPkg/Library/ArmLib/ArmLibPrivate.h 
b/ArmPkg/Library/ArmLib/ArmLibPrivate.h
index 1818a1994dc3..42a49b4dec7d 100644
--- a/ArmPkg/Library/ArmLib/ArmLibPrivate.h
+++ b/ArmPkg/Library/ArmLib/ArmLibPrivate.h
@@ -145,7 +145,7 @@ typedef enum {
   ClidrCacheTypeMax
 } CLIDR_CACHE_TYPE;
 
-#define CLIDR_GET_CACHE_TYPE(x, level) ((x >> (3 * (level))) & 0b111)
+#define CLIDR_GET_CACHE_TYPE(x, level) (((x) >> (3 * (level))) & 0b111)
 
 VOID
 CPSRMaskInsert (
diff --git 
a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorAArch64.c 
b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorAArch64.c
index ddd774b16f83..b214b6d0d217 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorAArch64.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorAArch64.c
@@ -90,4 +90,3 @@ SmbiosProcessorGetCacheAssociativity (
 
   return Associativity;
 }
-
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c 
b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
index 0be4403c765f..546628934319 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c
@@ -96,4 +96,3 @@ ArmGetCacheAssociativity (
 
   return Associativity;
 }
-
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c 
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c
index eb7f4cb4c16d..daf548cc2b4d 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscEntryPoint.c
@@ -220,4 +220,3 @@ SmbiosMiscGetLinkTypeHandle(
 }
   }
 }
-
diff --git 
a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguages.uni
 
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguages.uni
index 3af7a01653d8..1d959b1a4bdb 100644
--- 
a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguages.uni
+++ 
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type13/MiscNumberOfInstallableLanguages.uni
@@ -39,5 +39,3 @@
 
 #string STR_MISC_BIOS_LANGUAGES_SIMPLECH_ABBREVIATE  #language en-US  "zhCN"
 #string STR_MISC_BIOS_LANGUAGES_SIMPLECH_LONG#language en-US  
"zh|CN|unicode"
-
-

These are all trailing newlines at EOF, which git am complains about
when importing the patches, and an additional fix to aforementioned
macro.

Are you OK with me doing this?

Best Regards,

Leif

> More changes are needed to support reporting boot status etc., but with the
> series getting rather large I think it might be good to get this committed
> and make a follow-up series with the additional changes.
> 
> Testing:
> 
> o Ran Ecc tool 
> 
> o Ran smbiosview in the UEFI Shell
> 
> 
> Rebecca Cran (21):
>   ArmPkg: Add ARM SMC Architecture functions to ArmStdSmc.h
>   MdePkg: Update IndustryStandard/SmBios.h with processor status data
>   ArmPkg: Add register encoding definition for MMFR2
>   ArmPkg: Add helper to read the Memory Model Features Register 2
>   ArmPkg: Add helper function to read the Memory Model Feature Register
> 4
>   ArmPkg: Fix the return type of the ReadCCSIDR function
>   ArmPkg: Update ArmLibPrivate.h with cache register definitions
>   ArmPkg: Add definition of the maximum cache level in ARMv8-A
>   ArmPkg: 

Re: [edk2-devel] reg: iPxe Boot in NetworkPkg

2021-02-08 Thread Maciej Rabeda

Siva,

Just as Michael mentioned - the log you have provided suggests that you 
are recurse-booting iPXE.

Next server: 10.0.84.155
Filename: ipxe.efi
tftp://10.0.84.155/ipxe.efi... ok

May I ask why?

Thanks,
Maciej

On 05-Feb-21 11:10, Michael Brown wrote:

On 05/02/2021 08:28, Sivaraman Nainar wrote:

Hello Maciej:

I met an issue when tried to do the PXE boot with keeping the 
ipxe.efi as boot file.


When iPXE.efi is set as boot file once it downloaded it again starts, 
it does the download and start of iPXE continuously and at some point 
it asserts in MNP Driver.


Do you mean that you have set up an infinite loop in which UEFI loads 
ipxe.efi which loads ipxe.efi which loads ipxe.efi which loads 
ipxe.efi etc?


If so, then my guess is that you are simply running out of stack 
space. As far as I can tell, there is no memory protection around the 
stack in EDK2: once you have set up any kind of infinite recursion 
scenario then you are guaranteed to eventually underrun the stack and 
start overwriting random areas of memory.


Michael









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71483): https://edk2.groups.io/g/devel/message/71483
Mute This Topic: https://groups.io/mt/80401588/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 0/1] Introduce DxeMmUnblockMemoryLib Interface

2021-02-08 Thread Kun Qin
Hi Hao,

These 2 modules seems to be the only ones need to be updated when we scrubbed 
and validated our code base.

I will prepare for the tcg2 and variable module patches.

Thanks,
Kun


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




Re: [edk2-devel] [RFC 1/3] rpi4: Add XHCI/PCI selection menu

2021-02-08 Thread Andrei Warkentin
Suggest changing the strings to reflect that the coming PCIe functionality 
relies on the SMC conduit...

Reviewed-by: Andrei Warkentin 

From: devel@edk2.groups.io  on behalf of Jeremy Linton 
via groups.io 
Sent: Tuesday, January 12, 2021 4:27 PM
To: devel@edk2.groups.io 
Cc: p...@akeo.ie ; Andrei Warkentin ; 
samer.el-haj-mahm...@arm.com ; l...@nuviainc.com 
; ard.biesheu...@arm.com ; Jeremy 
Linton 
Subject: [edk2-devel] [RFC 1/3] rpi4: Add XHCI/PCI selection menu

ARM has standardized a SMC PCI conduit that can be used
to access the PCI config space in a standardized way. This
functionality doesn't yet exist in many OS/Distro's. Lets
add another advanced config item that allows the user
to toggle between presenting the XHCI on the base rpi4
as a platform device, or presenting this newer PCIe
conduit.

Signed-off-by: Jeremy Linton 
---
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 32 ++
 .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf|  3 ++
 .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni |  5 
 .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 13 +
 Platform/RaspberryPi/Include/ConfigVars.h  |  4 +++
 Platform/RaspberryPi/RPi3/RPi3.dsc |  9 ++
 Platform/RaspberryPi/RPi4/RPi4.dsc | 11 
 Platform/RaspberryPi/RaspberryPi.dec   |  3 ++
 8 files changed, 80 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 6fcbdcdd17..7a3b8e9068 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -266,6 +266,38 @@ SetupVariables (
 ASSERT_EFI_ERROR (Status);

   }



+  if (mModelFamily >= 4) {

+Size = sizeof (UINT32);

+Status = gRT->GetVariable (L"XhciPci",

+   ,

+   NULL, , );

+if (EFI_ERROR (Status) || (Var32 != 2)) {

+  // enable Xhci by default

+  Status = PcdSet32S (PcdXhciPci, 1);

+  ASSERT_EFI_ERROR (Status);

+  Status = PcdSet32S (PcdXhci, 1);

+  ASSERT_EFI_ERROR (Status);

+  Status = PcdSet32S (PcdPci, 0);

+  ASSERT_EFI_ERROR (Status);

+} else {

+  // enable PCIe

+  Status = PcdSet32S (PcdXhciPci, 2);

+  ASSERT_EFI_ERROR (Status);

+  Status = PcdSet32S (PcdXhci, 0);

+  ASSERT_EFI_ERROR (Status);

+  Status = PcdSet32S (PcdPci, 1);

+  ASSERT_EFI_ERROR (Status);

+}

+  } else {

+// disable pcie and xhci

+Status = PcdSet32S (PcdXhciPci, 0);

+ASSERT_EFI_ERROR (Status);

+Status = PcdSet32S (PcdXhci, 0);

+ASSERT_EFI_ERROR (Status);

+Status = PcdSet32S (PcdPci, 0);

+ASSERT_EFI_ERROR (Status);

+  }

+

   Size = sizeof (AssetTagVar);

   Status = gRT->GetVariable (L"AssetTag",

   ,

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
index 544e3b3e10..aa0fbc7e25 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
@@ -92,6 +92,9 @@
   gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB

   gRaspberryPiTokenSpaceGuid.PcdFanOnGpio

   gRaspberryPiTokenSpaceGuid.PcdFanTemp

+  gRaspberryPiTokenSpaceGuid.PcdXhciPci

+  gRaspberryPiTokenSpaceGuid.PcdXhci

+  gRaspberryPiTokenSpaceGuid.PcdPci



 [Depex]

   gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
index 2afe8f32ae..34efb82f57 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
@@ -57,6 +57,11 @@
 #string STR_ADVANCED_FANTEMP_PROMPT   #language en-US "ACPI fan temperature"

 #string STR_ADVANCED_FANTEMP_HELP #language en-US "Cycle a fan at C"



+#string STR_ADVANCED_XHCIPCI_PROMPT   #language en-US "ACPI XHCI/PCIe"

+#string STR_ADVANCED_XHCIPCI_HELP #language en-US "OS sees XHCI USB 
platform device or PCIe bridge"

+#string STR_ADVANCED_XHCIPCI_XHCI #language en-US "XHCI"

+#string STR_ADVANCED_XHCIPCI_PCIE #language en-US "PCIe"

+

 #string STR_ADVANCED_ASSET_TAG_PROMPT #language en-US "Asset Tag"

 #string STR_ADVANCED_ASSET_TAG_HELP   #language en-US "Set the system Asset 
Tag"



diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
index de5e43471a..4d5876eb24 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
@@ -56,6 +56,11 @@ formset
   name  = FanTemp,

   guid  = CONFIGDXE_FORM_SET_GUID;



+efivarstore ADVANCED_XHCIPCI_VARSTORE_DATA,

+  attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS | 

Re: [edk2-devel] [BUG/PATCH] Platform/RaspberryPi: Only enable IORT when 3G limit is disabled.

2021-02-08 Thread Andrei Warkentin
I'd rather we not set the PcdRamMoreThan3GB on a device with 1 or 2GB. I 
recognise you're using this to choose behavior for an old Linux version, but 
it's still non-sensical to the end user and it becomes a maintenance burden 
since the logic is no longer clear, so you might as well add a boot option to 
disable the IORT (and document as being for older Linux kernels) or just not 
install it if you explicitly being booted on a system with less RAM. I.e.

 if (PcdGet32 (PcdRamLimitTo3GB) || mModelInstalledMB < 2 * 1024) {

  return FALSE;

}

From: devel@edk2.groups.io  on behalf of Jeremy Linton 
via groups.io 
Sent: Monday, February 1, 2021 4:44 PM
To: devel@edk2.groups.io 
Cc: p...@akeo.ie ; Andrei Warkentin ; 
samer.el-haj-mahm...@arm.com ; l...@nuviainc.com 
; ard.biesheu...@arm.com ; Jeremy 
Linton 
Subject: [edk2-devel] [BUG/PATCH] Platform/RaspberryPi: Only enable IORT when 
3G limit is disabled.

The 3G limit, and the 2G IORT are intended to solve
the same linux problem, and limit PCI DMA operations
to the first 3G of RAM. Older linux kernels, as
used with RHEL/Centos, trigger an assertion*
when a DMA operation starts that doesn't fit within
the 2G range specified by the IORT.

The simple solution is to only enable the IORT
when the 3G flag is disabled.

* 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpftf%2FRPi4%2Fissues%2F123data=04%7C01%7Cawarkentin%40vmware.com%7C92f310e07997434a267408d8c702f698%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637478162838925480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=dKbis45PDc6ciBMWvSime3ZhQJGOwYLN0OHTnhMSvvU%3Dreserved=0

Fixes: dac891da5cf3 ("Platform/RaspberryPi/AcpiTables: add a IORT ACPI table to 
limit XHCI DMA")
Signed-off-by: Jeremy Linton 
---
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 19ef950f10..9581bc41e1 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -217,13 +217,23 @@ SetupVariables (
 ASSERT_EFI_ERROR (Status);

   }



-  if (mModelFamily >= 4 && mModelInstalledMB > 3 * 1024) {

+  if (mModelFamily >= 4) {

+if (mModelInstalledMB > 3 * 1024) {

+  /*

+   * This allows changing PcdRamLimitTo3GB in forms.

+   */

+  Status = PcdSet32S (PcdRamMoreThan3GB, 1);

+  ASSERT_EFI_ERROR (Status);

+} else {

+  Status = PcdSet32S (PcdRamMoreThan3GB, 0);

+  ASSERT_EFI_ERROR (Status);

+}

+

 /*

- * This allows changing PcdRamLimitTo3GB in forms.

+ * Enable the "3G ram limit" on 2GB device because we

+ * are going to utlize that limit as a new/old kernel

+ * flag and also disable the IORT if the 3G limit is set.

  */

-Status = PcdSet32S (PcdRamMoreThan3GB, 1);

-ASSERT_EFI_ERROR (Status);

-

 Size = sizeof (UINT32);

 Status = gRT->GetVariable (L"RamLimitTo3GB",

,

@@ -755,6 +765,12 @@ HandleDynamicNamespace (
 DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n"));



 return FALSE;

+  case SIGNATURE_32 ('I', 'O', 'R', 'T'):

+// only enable the IORT on machines with >3G and no limit

+// to avoid problems with rhel/centos

+if (PcdGet32 (PcdRamLimitTo3GB)) {

+  return FALSE;

+}

   }



   return TRUE;

--
2.13.7



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71032): 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F71032data=04%7C01%7Cawarkentin%40vmware.com%7C92f310e07997434a267408d8c702f698%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637478162838925480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=asFWjKVaiPH31M3SCUx8TQtzDoucFNTf8TqcYW%2Bo0uY%3Dreserved=0
Mute This Topic: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F80300339%2F4387333data=04%7C01%7Cawarkentin%40vmware.com%7C92f310e07997434a267408d8c702f698%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637478162838925480%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Njvni%2BMK0z38Xi3rw2xwPNiMBmesole6evqVHwZB87c%3Dreserved=0
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 

Re: [edk2-devel] [PATCH v2 4/4] Platform/RaspberryPi: Invert default Arasan, Emmc2 routing

2021-02-08 Thread Andrei Warkentin
Reviewed-by: Andrei Warkentin 

From: Jeremy Linton 
Sent: Monday, February 1, 2021 4:53 PM
To: devel@edk2.groups.io 
Cc: p...@akeo.ie ; Andrei Warkentin ; 
samer.el-haj-mahm...@arm.com ; l...@nuviainc.com 
; ardb+tianoc...@kernel.org ; 
Jeremy Linton 
Subject: [PATCH v2 4/4] Platform/RaspberryPi: Invert default Arasan, Emmc2 
routing

In order for the wifi to work, and the SD to run at full
speed we need to bind the sd slot to the eMMC2 controller.

Since we now have a driver for the eMMC2 controller
there isn't any reason to leave the SD card bound
to the older Arasan controller.

Signed-off-by: Jeremy Linton 
---
 Platform/RaspberryPi/RPi4/RPi4.dsc  | 2 +-
 Platform/RaspberryPi/RPi4/Readme.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc 
b/Platform/RaspberryPi/RPi4/RPi4.dsc
index 9962df0076..e0fad6f744 100644
--- a/Platform/RaspberryPi/RPi4/RPi4.dsc
+++ b/Platform/RaspberryPi/RPi4/RPi4.dsc
@@ -475,7 +475,7 @@
   # SD-related.

   #



-  
gRaspberryPiTokenSpaceGuid.PcdSdIsArasan|L"SdIsArasan"|gConfigDxeFormSetGuid|0x0|1

+  
gRaspberryPiTokenSpaceGuid.PcdSdIsArasan|L"SdIsArasan"|gConfigDxeFormSetGuid|0x0|0

   
gRaspberryPiTokenSpaceGuid.PcdMmcForce1Bit|L"MmcForce1Bit"|gConfigDxeFormSetGuid|0x0|0

   
gRaspberryPiTokenSpaceGuid.PcdMmcForceDefaultSpeed|L"MmcForceDefaultSpeed"|gConfigDxeFormSetGuid|0x0|0

   
gRaspberryPiTokenSpaceGuid.PcdMmcSdDefaultSpeedMHz|L"MmcSdDefaultSpeedMHz"|gConfigDxeFormSetGuid|0x0|25

diff --git a/Platform/RaspberryPi/RPi4/Readme.md 
b/Platform/RaspberryPi/RPi4/Readme.md
index 3b2ed44e3c..80899f4ca4 100644
--- a/Platform/RaspberryPi/RPi4/Readme.md
+++ b/Platform/RaspberryPi/RPi4/Readme.md
@@ -181,7 +181,7 @@ Limit RAM to 3 GB| `RamLimitTo3GB` | Disable = 
`0x`  Ena
 System Table Selection   | `SystemTableMode`| ACPI = `0x` 
(default) ACPI + Devicetree = `0x0001`  Devicetree = `0x0002`

 Asset Tag| `AssetTag` | String, 32 characters or less 
(e.g. `L"ABCD123"`) (default `L""`)

 **SD/MMC Configuration** |

-uSD/eMMC Routing | `SdIsArasan` | Arasan SDHC = `0x0001` 
(default)  eMMC2 SDHCI = `0x`

+uSD/eMMC Routing | `SdIsArasan` | Arasan SDHC = `0x0001`  
eMMC2 SDHCI = `0x` (default)

 Multi-Block Support  | `MmcDisableMulti` | Multi-block transfers = 
`0x` (default) Single block transfers = `0x0001`

 uSD Max Bus Width| `MmcForce1Bit` | 4-bit Mode = `0x`  
(default) 1-bit Mode = `0x0001`

 uSD Force Default Speed  | `MmcForceDefaultSpeed` | Allow High Speed = 
`0x` (default) Force Default Speed = `0x0001`

--
2.13.7



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71479): https://edk2.groups.io/g/devel/message/71479
Mute This Topic: https://groups.io/mt/80300535/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/4] Platform/RaspberryPi: User control of eMMC2 DMA

2021-02-08 Thread Andrei Warkentin
Reviewed-by: Andrei Warkentin 

From: Pete Batard 
Sent: Monday, February 8, 2021 11:08 AM
To: Jeremy Linton ; devel@edk2.groups.io 

Cc: Andrei Warkentin ; samer.el-haj-mahm...@arm.com 
; l...@nuviainc.com ; 
ardb+tianoc...@kernel.org 
Subject: Re: [PATCH v2 3/4] Platform/RaspberryPi: User control of eMMC2 DMA

On 2021.02.01 22:53, Jeremy Linton wrote:
> DMA translation on the eMMC2 vary based on SOC, and
> this is made worse by the poor _DMA support in linux.
>
> For now the "safe" option is to simply run the eMMC2
> controller in PIO mode. More advanced users or !linux
> operating systems may choose to enable this to gain
> a perf boost.
>
> Signed-off-by: Jeremy Linton 
> ---
>   Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c  | 16 
> +++-
>   Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf|  1 +
>   Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni |  5 +
>   Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 17 
> +
>   Platform/RaspberryPi/Include/ConfigVars.h   |  8 
>   Platform/RaspberryPi/RPi3/RPi3.dsc  |  1 +
>   Platform/RaspberryPi/RPi4/RPi4.dsc  |  1 +
>   Platform/RaspberryPi/RaspberryPi.dec|  1 +
>   8 files changed, 49 insertions(+), 1 deletion(-)
>
> diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
> b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
> index 7f26f7b4be..1b8b360ddc 100644
> --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
> +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
> @@ -346,6 +346,15 @@ SetupVariables (
> }
>
>
>
> Size = sizeof (UINT32);
>
> +  Status = gRT->GetVariable (L"MmcEnableDma",
>
> +  ,
>
> +  NULL, , );
>
> +  if (EFI_ERROR (Status)) {
>
> +Status = PcdSet32S (PcdMmcEnableDma, PcdGet32 (PcdMmcEnableDma));
>
> +ASSERT_EFI_ERROR (Status);
>
> +  }
>
> +
>
> +  Size = sizeof (UINT32);
>
> Status = gRT->GetVariable (L"DebugEnableJTAG",
>
> ,
>
> NULL, , );
>
> @@ -730,6 +739,11 @@ STATIC CONST AML_NAME_OP_REPLACE SsdtNameOpReplace[] = {
> { }
>
>   };
>
>
>
> +STATIC CONST AML_NAME_OP_REPLACE SsdtEmmcNameOpReplace[] = {
>
> +  { "SDMA", PcdToken (PcdMmcEnableDma) },
>
> +  { }
>
> +};
>
> +
>
>   STATIC CONST NAMESPACE_TABLES SdtTables[] = {
>
> {
>
>   SIGNATURE_64 ('R', 'P', 'I', 'T', 'H', 'F', 'A', 'N'),
>
> @@ -741,7 +755,7 @@ STATIC CONST NAMESPACE_TABLES SdtTables[] = {
>   SIGNATURE_64 ('R', 'P', 'I', '4', 'E', 'M', 'M', 'C'),
>
>   0,
>
>   PcdToken(PcdSdIsArasan),
>
> -NULL
>
> +SsdtEmmcNameOpReplace
>
> },
>
> {
>
>   SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0),
>
> diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf 
> b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
> index 544e3b3e10..d51e54e010 100644
> --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
> +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
> @@ -84,6 +84,7 @@
> gRaspberryPiTokenSpaceGuid.PcdMmcSdDefaultSpeedMHz
>
> gRaspberryPiTokenSpaceGuid.PcdMmcSdHighSpeedMHz
>
> gRaspberryPiTokenSpaceGuid.PcdMmcDisableMulti
>
> +  gRaspberryPiTokenSpaceGuid.PcdMmcEnableDma
>
> gRaspberryPiTokenSpaceGuid.PcdDebugEnableJTAG
>
> gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes
>
> gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot
>
> diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni 
> b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
> index 2afe8f32ae..6abccc1fdb 100644
> --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
> +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
> @@ -94,6 +94,11 @@
>   #string STR_MMC_SD_HS_PROMPT #language en-US "SD High Speed (MHz)"
>
>   #string STR_MMC_SD_HS_HELP   #language en-US "Override default 50Mhz"
>
>
>
> +#string STR_MMC_EMMC_PROMPT  #language en-US "Enable eMMC DMA modes"
>
> +#string STR_MMC_EMMC_PIO #language en-US "PIO"
>
> +#string STR_MMC_EMMC_DMA #language en-US "SDMA/ADMA2"
>
> +#string STR_MMC_EMMC_HELP#language en-US "Enable eMMC DMA modes for 
> OS's that support ACPI _DMA() translations"

For consistency, since that's what we already use for other UI strings,
the plural of OS should be "OSes" rather than "OS's"

>
> +

(very minor) Extra line added here.

>
>
>
>   /*
>
>* Display settings.
>
> diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr 
> b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
> index de5e43471a..cc7a09cfb7 100644
> --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
> +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
> @@ -96,6 +96,11 @@ formset
> name  = MmcSdHighSpeedMHz,
>
> guid  = CONFIGDXE_FORM_SET_GUID;
>
>
>
> +efivarstore MMC_EMMC_DMA_VARSTORE_DATA,

Re: [edk2-devel] [PATCH] Platform/RaspberryPi/Acpitables: Add eMMC2 device and tweak Arasan

2021-02-08 Thread Andrei Warkentin
[with all of Pete's comments]

Reviewed-by: Andrei Warkentin 

From: Jeremy Linton 
Sent: Monday, February 1, 2021 4:53 PM
To: devel@edk2.groups.io 
Cc: p...@akeo.ie ; Andrei Warkentin ; 
samer.el-haj-mahm...@arm.com ; l...@nuviainc.com 
; ardb+tianoc...@kernel.org ; 
Jeremy Linton 
Subject: [PATCH] Platform/RaspberryPi/Acpitables: Add eMMC2 device and tweak 
Arasan

The primarly problem with the rpi Arasan controller working
with a default SDHCI driver is the lack of a meaningful
capabilities register. As such if we add a _DSD entry
to provide that information, we can then bind it to
the linux sdhci_iproc driver which already
hardcodes the remaining controller bugs.

Further we have gotten BRCME88C approved as the HID
for the newer eMMC2 controller. So lets define an
ACPI object to describe it.

Of course both devices are sharing an interrupt so
we should also indicate that in the table as well.

Signed-off-by: Jeremy Linton 
---
 Platform/RaspberryPi/AcpiTables/AcpiTables.inf |   1 +
 Platform/RaspberryPi/AcpiTables/Emmc.asl   | 131 +
 Platform/RaspberryPi/AcpiTables/Sdhc.asl   |  18 ++-
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c |   6 +
 4 files changed, 153 insertions(+), 3 deletions(-)
 create mode 100644 Platform/RaspberryPi/AcpiTables/Emmc.asl

diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf 
b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
index d2cce074e5..743261afcf 100644
--- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
+++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
@@ -35,6 +35,7 @@
   Spcr.aslc

   Pptt.aslc

   SsdtThermal.asl

+  Emmc.asl



 [Packages]

   ArmPkg/ArmPkg.dec

diff --git a/Platform/RaspberryPi/AcpiTables/Emmc.asl 
b/Platform/RaspberryPi/AcpiTables/Emmc.asl
new file mode 100644
index 00..f089068556
--- /dev/null
+++ b/Platform/RaspberryPi/AcpiTables/Emmc.asl
@@ -0,0 +1,131 @@
+/** @file
+ *
+ *  Copyright (c) 2021 Arm. All rights reserved.
+ *
+ *  SPDX-License-Identifier: BSD-2-Clause-Patent
+ *
+ **/
+
+#include 
+#include 
+
+#include "AcpiTables.h"
+
+DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4EMMC", 2)
+{
+  Scope (\_SB_)
+  {
+#if (RPI_MODEL == 4)
+Device (GDV1) {
+  Name (_HID, "ACPI0004")
+  Name (_UID, 0x0)
+  Name (_CCA, 0x0)
+
+  Name (RBUF, ResourceTemplate ()
+  {
+  MEMORY32FIXED (ReadWrite, 0, MMCHS2_LENGTH, RMEM)
+  })
+  Method (_CRS, 0x0, Serialized)
+  {
+MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS2_OFFSET)
+Return (^RBUF)
+  }
+
+  Name (_DMA, ResourceTemplate() {
+/*
+ * XHC0 is limited to DMA to first 3GB. Note this
+ * only applies to PCIe, not GENET or other devices
+ * next to the A72.
+ */
+QWordMemory (ResourceConsumer,
+,
+MinFixed,
+MaxFixed,
+NonCacheable,
+ReadWrite,
+0x0,
+0xC000, // MIN
+0x, // MAX
+0x4000, // TRA
+0x4000, // LEN
+,
+,
+)
+  })
+
+  // emmc2 Host Controller. (brcm,bcm2711-emmc2)
+  Device (SDC3)
+  {
+Name (_HID, "BRCME88C")
+Name (_UID, 0x1)
+   Name (_CCA, 0x0)
+   Name (_S1D, 0x1)
+   Name (_S2D, 0x1)
+   Name (_S3D, 0x1)
+   Name (_S4D, 0x1)
+   Name (SDMA, 0x2)
+   Method (_STA)
+   {
+ Return(0xf)
+   }
+   Name (RBUF, ResourceTemplate ()
+   {
+ MEMORY32FIXED (ReadWrite, 0, MMCHS2_LENGTH, RMEM)
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 
BCM2836_MMCHS1_INTERRUPT }
+   })
+   Method (_CRS, 0x0, Serialized)
+   {
+ MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS2_OFFSET)
+ Return (^RBUF)
+   }
+
+// Unfortunatly this controller doesn't honor the
+// standard sdhci voltage control registers
+// (or at least linux's standard code can't
+// lower the voltage) So, UHS mode is disabled with caps
+Name (DSD1, Package () {
+ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+Package () {
+   Package () { "sdhci-caps-mask", 0x00050008 },
+   }
+})
+   // We also disable both SDMA and ADMA2 until the linux
+   // _DMA() mask/translate works properly
+Name (DSD2, Package () {
+ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+Package () {
+   Package () { "sdhci-caps-mask", 0x00050448 },
+   }
+})
+   Method (_DSD, 0x0, Serialized)
+{
+  if (SDMA == 0)
+  {
+return (^DSD2)
+  }
+  else
+  {
+return (^DSD1)
+  }
+}
+
+//
+// A child device that represents the
+// sd card, which 

Re: [edk2-devel] [PATCH v2 1/4] Platform/RaspberryPi: Add Negative table check

2021-02-08 Thread Andrei Warkentin
Reviewed-by: Andrei Warkentin 

From: Pete Batard 
Sent: Monday, February 8, 2021 11:08 AM
To: Jeremy Linton ; devel@edk2.groups.io 

Cc: Andrei Warkentin ; samer.el-haj-mahm...@arm.com 
; l...@nuviainc.com ; 
ardb+tianoc...@kernel.org 
Subject: Re: [PATCH v2 1/4] Platform/RaspberryPi: Add Negative table check

Looks good to me.

On 2021.02.01 22:53, Jeremy Linton wrote:
> Turns out its helpful to have a !PcdToken flag
> that enables a DSDT/SSDT. That simplifies
> both the emmc2 SSDT (it only installs when
> !SdIsArasan) and later for the XHCI/PCIe switch
> where we want to install one of two tables
> depending on whether a single Pcd is set.
>
> Signed-off-by: Jeremy Linton 
> ---
>   Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 6 ++
>   1 file changed, 6 insertions(+)
>
> diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
> b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
> index 9581bc41e1..ca7533cbee 100644
> --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
> +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
> @@ -616,6 +616,7 @@ typedef struct {
>   typedef struct {
>
> UINT64  OemTableId;
>
> UINTN   PcdToken;
>
> +  UINTN   PcdTokenNot;
>
> CONST AML_NAME_OP_REPLACE   *SdtNameOpReplace;
>
>   } NAMESPACE_TABLES;
>
>
>
> @@ -713,6 +714,9 @@ VerifyUpdateTable (
> if (SdtTable->PcdToken && !LibPcdGet32 (SdtTable->PcdToken)) {
>
>   Result = FALSE;
>
> }
>
> +  if (SdtTable->PcdTokenNot && LibPcdGet32 (SdtTable->PcdTokenNot)) {
>
> +Result = FALSE;
>
> +  }
>
> if (Result && SdtTable->SdtNameOpReplace) {
>
>   UpdateSdtNameOps (AcpiHeader, SdtTable->SdtNameOpReplace);
>
> }
>
> @@ -730,11 +734,13 @@ STATIC CONST NAMESPACE_TABLES SdtTables[] = {
> {
>
>   SIGNATURE_64 ('R', 'P', 'I', 'T', 'H', 'F', 'A', 'N'),
>
>   PcdToken(PcdFanOnGpio),
>
> +0,
>
>   SsdtNameOpReplace
>
> },
>
> {
>
>   SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0),
>
>   0,
>
> +0,
>
>   NULL
>
> },
>
> { }
>

Reviewed-by: Pete Batard 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71476): https://edk2.groups.io/g/devel/message/71476
Mute This Topic: https://groups.io/mt/80300531/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 4/4] Platform/RaspberryPi: Invert default Arasan, Emmc2 routing

2021-02-08 Thread Pete Batard

On 2021.02.01 22:53, Jeremy Linton wrote:

In order for the wifi to work, and the SD to run at full
speed we need to bind the sd slot to the eMMC2 controller.


For consistency, you might want to capitalize SD here, since it's 
capitalized before and after.



Since we now have a driver for the eMMC2 controller
there isn't any reason to leave the SD card bound
to the older Arasan controller.

Signed-off-by: Jeremy Linton 
---
  Platform/RaspberryPi/RPi4/RPi4.dsc  | 2 +-
  Platform/RaspberryPi/RPi4/Readme.md | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc 
b/Platform/RaspberryPi/RPi4/RPi4.dsc
index 9962df0076..e0fad6f744 100644
--- a/Platform/RaspberryPi/RPi4/RPi4.dsc
+++ b/Platform/RaspberryPi/RPi4/RPi4.dsc
@@ -475,7 +475,7 @@
# SD-related.

#

  


-  
gRaspberryPiTokenSpaceGuid.PcdSdIsArasan|L"SdIsArasan"|gConfigDxeFormSetGuid|0x0|1

+  
gRaspberryPiTokenSpaceGuid.PcdSdIsArasan|L"SdIsArasan"|gConfigDxeFormSetGuid|0x0|0


gRaspberryPiTokenSpaceGuid.PcdMmcForce1Bit|L"MmcForce1Bit"|gConfigDxeFormSetGuid|0x0|0


gRaspberryPiTokenSpaceGuid.PcdMmcForceDefaultSpeed|L"MmcForceDefaultSpeed"|gConfigDxeFormSetGuid|0x0|0


gRaspberryPiTokenSpaceGuid.PcdMmcSdDefaultSpeedMHz|L"MmcSdDefaultSpeedMHz"|gConfigDxeFormSetGuid|0x0|25

diff --git a/Platform/RaspberryPi/RPi4/Readme.md 
b/Platform/RaspberryPi/RPi4/Readme.md
index 3b2ed44e3c..80899f4ca4 100644
--- a/Platform/RaspberryPi/RPi4/Readme.md
+++ b/Platform/RaspberryPi/RPi4/Readme.md
@@ -181,7 +181,7 @@ Limit RAM to 3 GB| `RamLimitTo3GB` | Disable = 
`0x`  Ena
  System Table Selection   | `SystemTableMode`| ACPI = `0x` (default) 
ACPI + Devicetree = `0x0001`  Devicetree = `0x0002`

  Asset Tag| `AssetTag` | String, 32 characters or less (e.g. 
`L"ABCD123"`) (default `L""`)

  **SD/MMC Configuration** |

-uSD/eMMC Routing | `SdIsArasan` | Arasan SDHC = `0x0001` (default) 
 eMMC2 SDHCI = `0x`

+uSD/eMMC Routing | `SdIsArasan` | Arasan SDHC = `0x0001`  
eMMC2 SDHCI = `0x` (default)

  Multi-Block Support  | `MmcDisableMulti` | Multi-block transfers = 
`0x` (default) Single block transfers = `0x0001`

  uSD Max Bus Width| `MmcForce1Bit` | 4-bit Mode = `0x`  
(default) 1-bit Mode = `0x0001`

  uSD Force Default Speed  | `MmcForceDefaultSpeed` | Allow High Speed = 
`0x` (default) Force Default Speed = `0x0001`



Reviewed-by: Pete Batard 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71475): https://edk2.groups.io/g/devel/message/71475
Mute This Topic: https://groups.io/mt/80300535/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/4] Platform/RaspberryPi: User control of eMMC2 DMA

2021-02-08 Thread Pete Batard

On 2021.02.01 22:53, Jeremy Linton wrote:

DMA translation on the eMMC2 vary based on SOC, and
this is made worse by the poor _DMA support in linux.

For now the "safe" option is to simply run the eMMC2
controller in PIO mode. More advanced users or !linux
operating systems may choose to enable this to gain
a perf boost.

Signed-off-by: Jeremy Linton 
---
  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c  | 16 +++-
  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf|  1 +
  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni |  5 +
  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 17 +
  Platform/RaspberryPi/Include/ConfigVars.h   |  8 
  Platform/RaspberryPi/RPi3/RPi3.dsc  |  1 +
  Platform/RaspberryPi/RPi4/RPi4.dsc  |  1 +
  Platform/RaspberryPi/RaspberryPi.dec|  1 +
  8 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 7f26f7b4be..1b8b360ddc 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -346,6 +346,15 @@ SetupVariables (
}

  


Size = sizeof (UINT32);

+  Status = gRT->GetVariable (L"MmcEnableDma",

+  ,

+  NULL, , );

+  if (EFI_ERROR (Status)) {

+Status = PcdSet32S (PcdMmcEnableDma, PcdGet32 (PcdMmcEnableDma));

+ASSERT_EFI_ERROR (Status);

+  }

+

+  Size = sizeof (UINT32);

Status = gRT->GetVariable (L"DebugEnableJTAG",

,

NULL, , );

@@ -730,6 +739,11 @@ STATIC CONST AML_NAME_OP_REPLACE SsdtNameOpReplace[] = {
{ }

  };

  


+STATIC CONST AML_NAME_OP_REPLACE SsdtEmmcNameOpReplace[] = {

+  { "SDMA", PcdToken (PcdMmcEnableDma) },

+  { }

+};

+

  STATIC CONST NAMESPACE_TABLES SdtTables[] = {

{

  SIGNATURE_64 ('R', 'P', 'I', 'T', 'H', 'F', 'A', 'N'),

@@ -741,7 +755,7 @@ STATIC CONST NAMESPACE_TABLES SdtTables[] = {
  SIGNATURE_64 ('R', 'P', 'I', '4', 'E', 'M', 'M', 'C'),

  0,

  PcdToken(PcdSdIsArasan),

-NULL

+SsdtEmmcNameOpReplace

},

{

  SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0),

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
index 544e3b3e10..d51e54e010 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf
@@ -84,6 +84,7 @@
gRaspberryPiTokenSpaceGuid.PcdMmcSdDefaultSpeedMHz

gRaspberryPiTokenSpaceGuid.PcdMmcSdHighSpeedMHz

gRaspberryPiTokenSpaceGuid.PcdMmcDisableMulti

+  gRaspberryPiTokenSpaceGuid.PcdMmcEnableDma

gRaspberryPiTokenSpaceGuid.PcdDebugEnableJTAG

gRaspberryPiTokenSpaceGuid.PcdDisplayEnableScaledVModes

gRaspberryPiTokenSpaceGuid.PcdDisplayEnableSShot

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
index 2afe8f32ae..6abccc1fdb 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni
@@ -94,6 +94,11 @@
  #string STR_MMC_SD_HS_PROMPT #language en-US "SD High Speed (MHz)"

  #string STR_MMC_SD_HS_HELP   #language en-US "Override default 50Mhz"

  


+#string STR_MMC_EMMC_PROMPT  #language en-US "Enable eMMC DMA modes"

+#string STR_MMC_EMMC_PIO #language en-US "PIO"

+#string STR_MMC_EMMC_DMA #language en-US "SDMA/ADMA2"

+#string STR_MMC_EMMC_HELP#language en-US "Enable eMMC DMA modes for OS's 
that support ACPI _DMA() translations"


For consistency, since that's what we already use for other UI strings, 
the plural of OS should be "OSes" rather than "OS's"




+


(very minor) Extra line added here.



  


  /*

   * Display settings.

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
index de5e43471a..cc7a09cfb7 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr
@@ -96,6 +96,11 @@ formset
name  = MmcSdHighSpeedMHz,

guid  = CONFIGDXE_FORM_SET_GUID;

  


+efivarstore MMC_EMMC_DMA_VARSTORE_DATA,

+  attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,

+  name  = MmcEnableDma,

+  guid  = CONFIGDXE_FORM_SET_GUID;

+

  efivarstore DEBUG_ENABLE_JTAG_VARSTORE_DATA,

attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,

name  = DebugEnableJTAG,

@@ -275,6 +280,18 @@ formset
   maximum = 100,

   default = 50,

  endnumeric;

+#if (RPI_MODEL == 4)

+grayoutif ideqval SdIsArasan.Routing == 1;

+   

Re: [edk2-devel] [PATCH] Platform/RaspberryPi/Acpitables: Add eMMC2 device and tweak Arasan

2021-02-08 Thread Pete Batard

On 2021.02.01 22:53, Jeremy Linton wrote:

The primarly problem with the rpi Arasan controller working


Small typo: primarly -> primary


with a default SDHCI driver is the lack of a meaningful
capabilities register. As such if we add a _DSD entry
to provide that information, we can then bind it to
the linux sdhci_iproc driver which already
hardcodes the remaining controller bugs.

Further we have gotten BRCME88C approved as the HID
for the newer eMMC2 controller. So lets define an
ACPI object to describe it.

Of course both devices are sharing an interrupt so
we should also indicate that in the table as well.

Signed-off-by: Jeremy Linton 
---
  Platform/RaspberryPi/AcpiTables/AcpiTables.inf |   1 +
  Platform/RaspberryPi/AcpiTables/Emmc.asl   | 131 +
  Platform/RaspberryPi/AcpiTables/Sdhc.asl   |  18 ++-
  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c |   6 +
  4 files changed, 153 insertions(+), 3 deletions(-)
  create mode 100644 Platform/RaspberryPi/AcpiTables/Emmc.asl

diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf 
b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
index d2cce074e5..743261afcf 100644
--- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
+++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf
@@ -35,6 +35,7 @@
Spcr.aslc

Pptt.aslc

SsdtThermal.asl

+  Emmc.asl

  


  [Packages]

ArmPkg/ArmPkg.dec

diff --git a/Platform/RaspberryPi/AcpiTables/Emmc.asl 
b/Platform/RaspberryPi/AcpiTables/Emmc.asl
new file mode 100644
index 00..f089068556
--- /dev/null
+++ b/Platform/RaspberryPi/AcpiTables/Emmc.asl
@@ -0,0 +1,131 @@
+/** @file
+ *
+ *  Copyright (c) 2021 Arm. All rights reserved.
+ *
+ *  SPDX-License-Identifier: BSD-2-Clause-Patent
+ *
+ **/
+
+#include 
+#include 
+
+#include "AcpiTables.h"
+
+DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4EMMC", 2)
+{
+  Scope (\_SB_)
+  {
+#if (RPI_MODEL == 4)
+Device (GDV1) {
+  Name (_HID, "ACPI0004")
+  Name (_UID, 0x0)
+  Name (_CCA, 0x0)
+
+  Name (RBUF, ResourceTemplate ()
+  {
+  MEMORY32FIXED (ReadWrite, 0, MMCHS2_LENGTH, RMEM)
+  })
+  Method (_CRS, 0x0, Serialized)
+  {
+MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS2_OFFSET)
+Return (^RBUF)
+  }
+
+  Name (_DMA, ResourceTemplate() {
+/*
+ * XHC0 is limited to DMA to first 3GB. Note this
+ * only applies to PCIe, not GENET or other devices
+ * next to the A72.
+ */


I don't think this comment, that appears to have been lifted from a 
copy/paste of 
https://github.com/tianocore/edk2-platforms/blob/master/Platform/RaspberryPi/AcpiTables/Xhci.asl#L62-L82, 
applies here, since you are no longer describing a [0x, 
0xbfff] range here (or dealing with the XHC0 ACPI device) but 
applying a translation.


I would either remove the comment or make it explain why the translation 
is needed.



+QWordMemory (ResourceConsumer,
+,
+MinFixed,
+MaxFixed,
+NonCacheable,
+ReadWrite,
+0x0,
+0xC000, // MIN
+0x, // MAX
+0x4000, // TRA
+0x4000, // LEN
+,
+,
+)
+  })
+
+  // emmc2 Host Controller. (brcm,bcm2711-emmc2)
+  Device (SDC3)
+  {
+Name (_HID, "BRCME88C")
+Name (_UID, 0x1)





+   Name (_CCA, 0x0)
+   Name (_S1D, 0x1)
+   Name (_S2D, 0x1)
+   Name (_S3D, 0x1)
+   Name (_S4D, 0x1)
+   Name (SDMA, 0x2)
+   Method (_STA)
+   {
+ Return(0xf)
+   }
+   Name (RBUF, ResourceTemplate ()
+   {
+ MEMORY32FIXED (ReadWrite, 0, MMCHS2_LENGTH, RMEM)
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 
BCM2836_MMCHS1_INTERRUPT }
+   })
+   Method (_CRS, 0x0, Serialized)
+   {
+ MEMORY32SETBASE (RBUF, RMEM, RBAS, MMCHS2_OFFSET)
+ Return (^RBUF)
+   }


^
Section above uses tabs instead of spaces.
I believe edk2/BaseTools/Scripts/PatchCheck.py, when run, should warn 
you about this.



+
+// Unfortunatly this controller doesn't honor the


Small typo: Unfortunatly -> Unfortunately


+// standard sdhci voltage control registers
+// (or at least linux's standard code can't
+// lower the voltage) So, UHS mode is disabled with caps
+Name (DSD1, Package () {
+ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+Package () {
+   Package () { "sdhci-caps-mask", 0x00050008 },
+   }
+})





+   // We also disable both SDMA and ADMA2 until the linux
+   // _DMA() mask/translate works properly


^
Another tabbed section

Also, the "also" above seems to imply that DSD1 applies on top of DSD2, 
whereas, per the code further down, we 

Re: [edk2-devel] [PATCH v2 1/4] Platform/RaspberryPi: Add Negative table check

2021-02-08 Thread Pete Batard

Looks good to me.

On 2021.02.01 22:53, Jeremy Linton wrote:

Turns out its helpful to have a !PcdToken flag
that enables a DSDT/SSDT. That simplifies
both the emmc2 SSDT (it only installs when
!SdIsArasan) and later for the XHCI/PCIe switch
where we want to install one of two tables
depending on whether a single Pcd is set.

Signed-off-by: Jeremy Linton 
---
  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 9581bc41e1..ca7533cbee 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -616,6 +616,7 @@ typedef struct {
  typedef struct {

UINT64  OemTableId;

UINTN   PcdToken;

+  UINTN   PcdTokenNot;

CONST AML_NAME_OP_REPLACE   *SdtNameOpReplace;

  } NAMESPACE_TABLES;

  


@@ -713,6 +714,9 @@ VerifyUpdateTable (
if (SdtTable->PcdToken && !LibPcdGet32 (SdtTable->PcdToken)) {

  Result = FALSE;

}

+  if (SdtTable->PcdTokenNot && LibPcdGet32 (SdtTable->PcdTokenNot)) {

+Result = FALSE;

+  }

if (Result && SdtTable->SdtNameOpReplace) {

  UpdateSdtNameOps (AcpiHeader, SdtTable->SdtNameOpReplace);

}

@@ -730,11 +734,13 @@ STATIC CONST NAMESPACE_TABLES SdtTables[] = {
{

  SIGNATURE_64 ('R', 'P', 'I', 'T', 'H', 'F', 'A', 'N'),

  PcdToken(PcdFanOnGpio),

+0,

  SsdtNameOpReplace

},

{

  SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0),

  0,

+0,

  NULL

},

{ }



Reviewed-by: Pete Batard 


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




Re: [edk2-devel] [edk2-test PATCH v1 2/2] SctPkg: Enable RISCV64 support using AARCH64 sources

2021-02-08 Thread Heinrich Schuchardt
On 08.02.21 16:09, Daniel Schaefer wrote:
> Hi Leif,
>
> thanks very much for the review!
> I've cleaned up the patchset and addressed the issues. I'll send out
> another set soon.
> See comments below.
>
> Thanks,
> Daniel
>
> On 12/2/20 8:04 PM, Leif Lindholm wrote:
>> On Wed, Dec 02, 2020 at 00:17:52 +0800, Daniel Schaefer wrote:
>>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042
>>>
>>> TODO: Need to check whether we can avoid copying Aarch64 sources.
>>>
>>> Cc: Leif Lindholm 
>>> Cc: Heinrich Schuchardt 
>>> Cc: Abner Chang 
>>> Cc: Gilbert Chen 
>>> Cc: Eric Jin 
>>> Cc: G Edhaya Chandran 
>>> Cc: Barton Gao 
>>> Cc: Samer El-Haj-Mahmoud 
>>> Signed-off-by: Daniel Schaefer 
>>> ---
>>>  
>>> uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h 
>>>   
>>> |  32 +++
>>>  
>>> uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c   
>>>   
>>> |  45 
>>>  
>>> uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
>>>   
>>> |  45 
>>>  
>>> uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
>>>   
>>> | 182 +
>>>  
>>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c 
>>>   
>>> |  88 +++
>>>  
>>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c  
>>>   
>>> |  68 +
>>>  
>>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
>>>   
>>> | 134 ++
>>>  
>>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
>>>   
>>> |  48 
>>>  
>>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
>>> 
>>> | 137 ++
>>>  
>>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
>>> | 276 
>>>  
>>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
>>> 
>>> |  30 +++
>>>  
>>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/Riscv64/TimerInterrupt.c
>>> 
>>> |  51 
>>>  
>>> uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
>>> 
>>> |  55 
>>>  
>>> uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c
>>>    
>>> |  55 
>>>   14 files changed, 1246 insertions(+)
>>>
>>> diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
>>> b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
>>> new file mode 100644
>>> index ..ee7c656b
>>> --- /dev/null
>>> +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
>>> @@ -0,0 +1,32 @@
>>> +/** @file
>>> +
>>> +  Copyright 2006 - 2012 Unified EFI, Inc.
>>> +  Copyright (c) 2011 - 2012, ARM 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.
>>> +
>>> +**/
>>> +/*++
>>> +
>>> +Module Name:
>>> +
>>> +  SctLibPlat.h
>>> +
>>> +Abstract:
>>> +
>>> +  AArch64 specific defines
>>
>> *cough*
>
> For the next patch series I went through everything and made sure that
> there's no Aarch64 or ARM anymore.
>
>>> +
>>> +--*/
>>> +
>>> +#ifndef _EFI_LIB_PLAT_H_
>>> +#define _EFI_LIB_PLAT_H_
>>
>> No leading _ in macros.
>
> This is a common pattern in the code. Even in EDK2.
>
>>> +
>>> +#define MIN_ALIGNMENT_SIZE  8
>>> +
>>> +#endif
>>> diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
>>> b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
>>> new file mode 100644
>>> index ..a48bb2f3
>>> --- /dev/null
>>> +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
>>> @@ -0,0 +1,45 @@
>>> +/** @file
>>> +
>>> +  Copyright 2006 - 2012 Unified EFI, Inc.
>>> +  Copyright (c) 2011 - 2012, ARM 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
>>> +  

Re: [edk2-devel] [PATCH v2 1/2] Maintainers.txt: Remove Jordan Justen from EmulatorPkg

2021-02-08 Thread Laszlo Ersek
On 02/04/21 20:49, Jordan Justen wrote:
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Signed-off-by: Jordan Justen 
> Reviewed-by: Andrew Fish 
> ---
>  Maintainers.txt | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 2cd356551e..96e792ab66 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -197,7 +197,6 @@ M: Ard Biesheuvel 
>  EmulatorPkg
>  F: EmulatorPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/EmulatorPkg
> -M: Jordan Justen 
>  M: Andrew Fish 
>  M: Ray Ni 
>  S: Maintained
> 

Series merged as commit range 43a113385e37..472276f59bba, via
.

Thanks,
Laszlo



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




Re: [edk2-devel] [edk2-test PATCH v1 0/2] Add RISCV64 support to SctPkg

2021-02-08 Thread Heinrich Schuchardt
On 08.02.21 15:30, Daniel Schaefer wrote:
> On 12/2/20 1:37 AM, Heinrich Schuchardt wrote:
>> On 12/1/20 6:11 PM, Daniel Schaefer wrote:
>>> On 12/2/20 12:59 AM, Heinrich Schuchardt wrote:
 On 12/1/20 5:17 PM, Daniel Schaefer wrote:
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042
>
> With this patch series we can build the UEFI SCT for RISCV64. It was
> confirmed
> to be working on the U-Boot UEFI implementation by Heinrich.
> It hasn't been tested on EDK2 yet.
>
> Build requirements are the same as for the EDK2 RISCV64 port and
> detailed here:
> https://github.com/riscv/riscv-uefi-edk2-docs
>
> The second patch is a big one because it adds architecture specific
> files by
> copying them from the Aarch64 directory. Only a single file, an
> assembly file
> needed modifications. I'm not sure why the other ones are in an
> architecture
> specific directory. They're all C files and seem to be generic. We
> can probably
> unify them.

 Hello Daniel,

 thanks a lot for your patches.

 You address the uefi-sct/SctPkg/TestCase/UEFI/EFI directory.

 Are you planning future patches for uefi-sct/SctPkg/TestCase/UEFI/IHV
 too?
>>>
>>> I grepped the repo for strings related to arm64 and aarch64. I ported
>>> what I found.
>>> Do you see anything that's not ported?
>>
>> uefi-sct/SctPkg/UEFI/IHV_SCT.dsc is the only IHV related file with
>> AARCH64 in it and that one is covered by your patch series.
>>
>>>
>>> The only thing I see, is in
>>> Protocol/UsbIo/BlackBoxTest/UsbIoTestConformance.c
>>> where some code is not used for ARM because:
>>>
>>>    // Note: This function uses the EDKII Glu library from EDKII
>>> compatibility pkg.
>>>
>>>    // which is not ported to ARM yet. Hence for the time being just
>>> return success.
>>>
>>>
>>> I'm not yet sure what library that's referring to, but most likely it's
>>> also
>>> not implemented for RISC-V.
>>
>> I assume this refers to:
>> https://github.com/tianocore/edk/tree/master/Foundation/Library/EdkIIGlueLib
>>
>>
>> The files of this library are in edk2/MdePkg/Library now.
>
> Wow, that code is ancient then. I'm not gonna ifdef it out for RISC-V.
> If it works for x86 it might work for RISC-V now.
> Maybe the ARM people can try it on ARM first ;)
>
>>> Thanks for testing!
>>> Does the SCT result look like what you expect? Or are some tests failing
>>> that you expect to succeed?
>>
>> Not all tests have run yet. Running SCT on QEMU is really slow.
>>
>> But from what I can see there is no difference to AARCH64 results on
>> QEMU.
>
> Sounds great! I assume all the tests have succeeded now?

The SCT version built for RISC-V with you patches returned equivalent
results to ARM for U-Boot.

Best regards

Heinrich


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




Re: [edk2-devel] [edk2-test PATCH v1 1/2] SctPkg: Add RISCV64 support

2021-02-08 Thread Daniel Schaefer

On 12/2/20 7:44 PM, Leif Lindholm wrote:

On Wed, Dec 02, 2020 at 00:17:51 +0800, Daniel Schaefer wrote:

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

TODO: Need to check whether we can avoid copying Aarch64 sources.

Cc: Leif Lindholm 
Cc: Heinrich Schuchardt 
Cc: Abner Chang 
Cc: Gilbert Chen 
Cc: Eric Jin 
Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Samer El-Haj-Mahmoud 
Signed-off-by: Daniel Schaefer 
---
  uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
  |  3 +
  uefi-sct/SctPkg/Library/SctLib/SctLib.inf 
  |  6 ++
  uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf  
  |  6 ++
  uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
  |  7 +++
  
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
 |  6 ++
  uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf 
  |  4 ++
  uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf   
  |  4 ++
  uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf  
  |  5 ++
  uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile   
  |  3 +
  uefi-sct/SctPkg/UEFI/IHV_SCT.dsc  
  | 14 -
  uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h  
  | 62 +++-
  uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc 
  | 14 -
  uefi-sct/SctPkg/build.sh  
  | 10 +++-
  13 files changed, 140 insertions(+), 4 deletions(-)

diff --git a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h 
b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
index a7815580..3a7c8f31 100644
--- a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
+++ b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
@@ -32,6 +32,9 @@
  #elif defined(EFIAARCH64)
#define INSTALL_SCT_PLATFORM_SHORT_NAME   L"aarch64"
#define INSTALL_SCT_PLATFORM_NAME L"AARCH64"
+#elif defined(EFIRISCV64)
+  #define INSTALL_SCT_PLATFORM_SHORT_NAME   L"riscv64"
+  #define INSTALL_SCT_PLATFORM_NAME L"RISCV64"
  #else
#error "Architecture not supported"
  #endif
diff --git a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf 
b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
index 23cb77fb..6f59d974 100644
--- a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
+++ b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
@@ -62,6 +62,12 @@
Aarch64/initplat.c
Math.c
  
+# TODO: Copied source from AARCH64, need to check if they need to be adjusted


TODOs need to go, throughout.


All resolved in the next patch series.


+[sources.RISCV64]
+  Riscv64/SctLibPlat.h
+  Riscv64/initplat.c
+  Math.c
+
  [sources.ia32]
ia32/SctLibPlat.h
ia32/initplat.c
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf 
b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
index 7aca6e30..66de4cac 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
@@ -39,6 +39,12 @@
Aarch64/GoVirtual.asm | RVCT
Aarch64/GoVirtual.S | GCC
  
+# TODO: Copied source from AARCH64, need to check if they need to be adjusted

+#   ASM is adjusted but not sure if it is correct
+[sources.RISCV64]
+  Riscv64/VirtualMemory.c
+  Riscv64/GoVirtual.S | GCC
+
  [sources.ia32]
ia32/VirtualMemory.c
ia32/GoVirtual.asm | MSFT
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf 
b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
index ad0eb0f8..bc0ade5b 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
@@ -69,6 +69,13 @@
Aarch64/Dump.c
Aarch64/Debug.c
  
+# TODO: Copied source from AARCH64, need to check if they need to be adjusted

+[sources.RISCV64]
+  Riscv64/Io.c
+  Riscv64/Io.h
+  Riscv64/Dump.c
+  Riscv64/Debug.c
+
  [sources.common]
Guid.h
Guid.c
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
index 799f86fd..7010c7f1 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
@@ -67,6 +67,12 @@
Aarch64/DebugSupportBBTestExceptionCallbackFunction.c
Aarch64/DebugSupportBBTestCacheFunction.c
  
+# TODO: Copied source from AARCH64, need to check if they need to be adjusted

+[sources.RISCV64]
+  Riscv64/PlatformIsa.c
+  Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
+  Riscv64/DebugSupportBBTestCacheFunction.c
+
  [Packages]
SctPkg/SctPkg.dec

Re: [edk2-devel] [edk2-test PATCH v1 2/2] SctPkg: Enable RISCV64 support using AARCH64 sources

2021-02-08 Thread Daniel Schaefer

Hi Leif,

thanks very much for the review!
I've cleaned up the patchset and addressed the issues. I'll send out another 
set soon.
See comments below.

Thanks,
Daniel

On 12/2/20 8:04 PM, Leif Lindholm wrote:

On Wed, Dec 02, 2020 at 00:17:52 +0800, Daniel Schaefer wrote:

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

TODO: Need to check whether we can avoid copying Aarch64 sources.

Cc: Leif Lindholm 
Cc: Heinrich Schuchardt 
Cc: Abner Chang 
Cc: Gilbert Chen 
Cc: Eric Jin 
Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Samer El-Haj-Mahmoud 
Signed-off-by: Daniel Schaefer 
---
  uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h   
 |  32 +++
  uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c 
 |  45 
  uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S  
 |  45 
  uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c  
 | 182 +
  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c   
 |  88 +++
  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
 |  68 +
  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c  
 | 134 ++
  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h  
 |  48 
  
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
 | 137 ++
  
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
 | 276 
  
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
 |  30 +++
  
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/Riscv64/TimerInterrupt.c
 |  51 
  
uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
 |  55 
  
uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c 
   |  55 
  14 files changed, 1246 insertions(+)

diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h 
b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
new file mode 100644
index ..ee7c656b
--- /dev/null
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
@@ -0,0 +1,32 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.
+  Copyright (c) 2011 - 2012, ARM 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.
+
+**/
+/*++
+
+Module Name:
+
+  SctLibPlat.h
+
+Abstract:
+
+  AArch64 specific defines


*cough*


For the next patch series I went through everything and made sure that there's 
no Aarch64 or ARM anymore.


+
+--*/
+
+#ifndef _EFI_LIB_PLAT_H_
+#define _EFI_LIB_PLAT_H_


No leading _ in macros.


This is a common pattern in the code. Even in EDK2.


+
+#define MIN_ALIGNMENT_SIZE  8
+
+#endif
diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c 
b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
new file mode 100644
index ..a48bb2f3
--- /dev/null
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
@@ -0,0 +1,45 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.
+  Copyright (c) 2011 - 2012, ARM 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.
+
+**/
+/*++
+
+Module Name:
+
+  initplat.c
+
+Abstract:
+
+  Math routines for compatibility with native EFI library routines.
+
+--*/
+
+#include "SctLibInternal.h"
+
+VOID
+InitializeLibPlatform (
+IN EFI_HANDLE   ImageHandle,
+IN EFI_SYSTEM_TABLE *SystemTable
+)
+
+{
+  // No platform-specific initializations
+}
+
+UINT64
+SctReadTsc (
+  VOID
+  )
+{
+  return 0;
+}
diff --git 

Re: [edk2-devel] [PATCH v7 13/21] ArmPkg: Add Universal/Smbios/ProcessorSubClassDxe

2021-02-08 Thread Rebecca Cran

On 2/3/21 8:18 AM, Leif Lindholm wrote:
> On Sun, Jan 31, 2021 at 16:25:03 -0700, Rebecca Cran wrote:

+// At each level of cache, we can have a single type (unified, instruction 
or data),
+// or two types - separate data and instruction caches. If we have separate
+// instruction and data caches, then on the first iteration (CacheSubLevel 
= 0)
+// process the instruction cache.
+for (DataCacheType = 0; DataCacheType <= 1; DataCacheType++) {
+  // If there's no separate data/instruction cache, skip the second 
iteration
+  if (DataCacheType > 0 && !SeparateCaches) {
+continue;
+  }
+
+  Type7Record = AllocateAndInitCacheInformation (CacheLevel,
+ DataCacheType == 0 && 
SeparateCaches,
+ DataCacheType == 1,
+ DataCacheType == 0 && 
!SeparateCaches
+ );


This is a bit too clever for my poor brain.
Could we pass DataCacheType and SeparateCaches and do the logic
conversion in the function?


I hope you don't mind, but I kept the DataCache and UnifiedCache 
parameters in the v8 version and just passed !SeparateCaches instead, 
which I think is neater.



It feels like this is still somewhat encoding ARM architectural
behaviour in the API? SMBIOS defines
typedef enum {
   CacheTypeOther   = 0x01,
   CacheTypeUnknown = 0x02,
   CacheTypeInstruction = 0x03,
   CacheTypeData= 0x04,
   CacheTypeUnified = 0x05
} CACHE_TYPE_DATA;

OK, let's worry about that aspect later, but please, move the logic
into the functions.


I don't think there should be any left, now: just a generic assumption 
about caches either being split I/D or unified.


--
Rebecca Cran


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




Re: [edk2-devel] [edk2-test PATCH v1 0/2] Add RISCV64 support to SctPkg

2021-02-08 Thread Daniel Schaefer

On 12/2/20 1:37 AM, Heinrich Schuchardt wrote:

On 12/1/20 6:11 PM, Daniel Schaefer wrote:

On 12/2/20 12:59 AM, Heinrich Schuchardt wrote:

On 12/1/20 5:17 PM, Daniel Schaefer wrote:

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

With this patch series we can build the UEFI SCT for RISCV64. It was
confirmed
to be working on the U-Boot UEFI implementation by Heinrich.
It hasn't been tested on EDK2 yet.

Build requirements are the same as for the EDK2 RISCV64 port and
detailed here:
https://github.com/riscv/riscv-uefi-edk2-docs

The second patch is a big one because it adds architecture specific
files by
copying them from the Aarch64 directory. Only a single file, an
assembly file
needed modifications. I'm not sure why the other ones are in an
architecture
specific directory. They're all C files and seem to be generic. We
can probably
unify them.


Hello Daniel,

thanks a lot for your patches.

You address the uefi-sct/SctPkg/TestCase/UEFI/EFI directory.

Are you planning future patches for uefi-sct/SctPkg/TestCase/UEFI/IHV
too?


I grepped the repo for strings related to arm64 and aarch64. I ported
what I found.
Do you see anything that's not ported?


uefi-sct/SctPkg/UEFI/IHV_SCT.dsc is the only IHV related file with
AARCH64 in it and that one is covered by your patch series.



The only thing I see, is in
Protocol/UsbIo/BlackBoxTest/UsbIoTestConformance.c
where some code is not used for ARM because:

   // Note: This function uses the EDKII Glu library from EDKII
compatibility pkg.

   // which is not ported to ARM yet. Hence for the time being just
return success.


I'm not yet sure what library that's referring to, but most likely it's
also
not implemented for RISC-V.


I assume this refers to:
https://github.com/tianocore/edk/tree/master/Foundation/Library/EdkIIGlueLib

The files of this library are in edk2/MdePkg/Library now.


Wow, that code is ancient then. I'm not gonna ifdef it out for RISC-V.
If it works for x86 it might work for RISC-V now.
Maybe the ARM people can try it on ARM first ;)


Thanks for testing!
Does the SCT result look like what you expect? Or are some tests failing
that you expect to succeed?


Not all tests have run yet. Running SCT on QEMU is really slow.

But from what I can see there is no difference to AARCH64 results on QEMU.


Sounds great! I assume all the tests have succeeded now?


Best regards

Heinrich




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




Re: [edk2-devel] Does EDK2 ArmVirtPkg has support for a virtio-mmio-blk device

2021-02-08 Thread Laszlo Ersek
(Adding Ard, just in case -- the topic is set by the first quoted
question below)

On 02/08/21 04:24, Ying Fang wrote:
> Hi, Does anybody know whether the EDK2 ArmVirtPkg has support for a 
> virtio-mmio-device ?

virtio-mmio is a virtio transport type, not a particular device.

(1) ArmVirtPkg + OvmfPkg support the following three virtio transports:

(1a) Virtio PCI, virtio spec version 0.9.5,
 [OvmfPkg/VirtioPciDeviceDxe]

(1b) Virtio PCI, virtio spec version 1.0,
 [OvmfPkg/Virtio10Dxe]

(1c) Virtio MMIO, virtio spec version 0.9.5 *only*
 [ArmVirtPkg/VirtioFdtDxe]
 [OvmfPkg/Library/VirtioMmioDeviceLib]

(2) Additionally, OvmfPkg offers the following virtio device drivers:

- VirtioBlkDxe
- VirtioFsDxe   [1.0 only]
- VirtioGpuDxe  [1.0 only]
- VirtioNetDxe
- VirtioRngDxe
- VirtioScsiDxe

(2a) The drivers marked "1.0 only" will only work on top of the
transport mentioned in point (1b).

Put differently, they will only drive the following virtio-1.0 QEMU
device models:

- VirtioFsDxe:  "vhost-user-fs-pci"
- VirtioGpuDxe: "virtio-gpu-pci"

(2b) The drivers *not* marked "1.0 only" will work on top of *either*
virtio transport that's noted in (1a), (1b), (1c).

This implies that, using the ArmVirtQemu firmware platform, you can use
the following QEMU device models *too*:

- VirtioBlkDxe:  "virtio-blk-device"
- VirtioNetDxe:  "virtio-net-device"
- VirtioRngDxe:  "virtio-rng-device"
- VirtioScsiDxe: "virtio-scsi-device"


> I am using EDK2 ArmVirtPkg v2.70 as the default UEFI for my devel program.

A commit hash would be more useful (not sure if it matters for now, but
in case it does, a commit hash is best).


> Since we have not implemented the PCI/PCIe suff, a virtio-mmio-blk device is 
> used as the image disk.

There is no such device model ("virtio-mmio-blk") in QEMU, as far as I
can tell.

Do you mean "virtio-blk-device"?


> We can boot the EDK2 ArmVirtPkg into UEFI shell, and the Mapping table 
> message shows
> 
> Mapping table:
> BLK0: Alias(s):
>   VenHw(xxx, 00)

Do you have an EFI system partition on the virtio block device?

Because, the "map" UEFI shell command (executed automatically at shell
startup) should list such a filesystem as "FS0:" here.


> However when I chose the “Boot From File” menu item, I can not see the 
> virtio-mmio-blk device.

That's not surprising, minimally because the MAP command above does not
list "FS0:".


> So does anybody know whether the EDK2 ArmVirtPkg has support for a 
> virtio-mmio-device ?

The virtio-blk-device is supported, yes, using the virtio-mmio (0.9.5)
transport type. But in order to actually boot from the device, you need
more things. Such as:

- an EFI system partition / FAT filesystem on the device,

- bootable UEFI binaries (matching the guest architecture),

- a correctly populated "bootorder" fw_cfg file, so that the UEFI boot
order be updated as well. This "bootorder" fw_cfg file is created by
QEMU upon use of the "bootindex" device properties, and it is acted upon
by the following components:

  ArmVirtPkg/Library/PlatformBootManagerLib
  OvmfPkg/Library/QemuBootOrderLib

Thanks
Laszlo



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




Re: [edk2-devel] [PATCH edk2-platforms v1 1/1] Maintainers.txt: Update Arm platform maintainer

2021-02-08 Thread Thomas Abraham
On Monday, February 8, 2021 3:41 PM, Sami Mujawar wrote:
> Update maintainer for Arm Ltd. Platforms in
> edk2-platforms (
>   F: Platform/ARM/
>   F: Silicon/ARM/
>   )
> based on discussions on the mailing list at:
> https://edk2.groups.io/g/devel/message/71354
> 
> Cc: Ard Biesheuvel 
> Cc: Thomas Abraham 
> Cc: Leif Lindholm 
> Signed-off-by: Sami Mujawar 
> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index
> 34f0b585815f36e44c0e7f3366a39ebe9cfb5cfd..8c561166c17b3babc89459b3e7
> 7b1c6c5c869554 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -105,7 +105,7 @@ F: Platform/ARM/
>  F: Silicon/ARM/
>  R: Ard Biesheuvel 
>  R: Thomas Abraham 
> -M: Leif Lindholm 
> +M: Sami Mujawar 
> 
>  BeagleBoard:
>  F: Platform/BeagleBoard/

Reviewed-by: Thomas Abraham 

> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




回复: [edk2-devel] UEFI BUG

2021-02-08 Thread gaoliming
Have you the full build log? Seemly, AFeatureEnablerDxe driver is not
generated correctly. 

 

Thanks

Liming

发件人: bounce+27952+71433+4905953+8761...@groups.io
 代表 宋涛
发送时间: 2021年2月7日 20:54
收件人: devel@edk2.groups.io
主题: [edk2-devel] UEFI BUG

 

Hi,I face a problem, and it suggested that I can ask help from you. The
following is the call stack trace. The privacy is replaced with "***"

 

 

build.py...

 : error C0DE: Unknown fatal error when processing
[/home/disk/***/EblCmdLib/EblCmdLib.inf [AARCH64, CLANG100LINUX, RELEASE]]

 

(Please send email to devel@edk2.groups.io 
for help, attaching following call stack trace!)

 

(Python 2.7.17 on linux2) Traceback (most recent call last):

  File "/home/disk/***/edk2/BaseTools/Source/Python/build/build.py", line
2596, in Main

MyBuild.Launch()

  File "/home/disk/***/edk2/BaseTools/Source/Python/build/build.py", line
2389, in Launch

self._BuildPlatform()

  File "/home/disk/***/edk2/BaseTools/Source/Python/build/build.py", line
1753, in _BuildPlatform

CmdListDict = self._GenFfsCmd(Wa.ArchList)

  File "/home/disk/***/edk2/BaseTools/Source/Python/build/build.py", line
2003, in _GenFfsCmd

GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self,
ArchList, GlobalData)

  File "/home/disk/***/edk2/BaseTools/Source/Python/GenFds/GenFds.py", line
544, in GenFfsMakefile

FvObj.AddToBuffer(Buffer=None, Flag=True)

  File "/home/disk/***/edk2/BaseTools/Source/Python/GenFds/Fv.py", line 127,
in AddToBuffer

FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress,
IsMakefile=Flag, FvName=self.UiFvName)

  File
"/home/disk/***/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
line 518, in GenFfs

InputSectList, InputSectAlignments =
self.__GenComplexFileSection__(Rule, FvChildAddr, FvParentAddr,
IsMakefile=IsMakefile)

  File
"/home/disk/***/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
line 969, in __GenComplexFileSection__

SectList, Align = Sect.GenSection(self.OutputPath, self.ModuleGuid,
SecIndex, self.KeyStringList, self, IsMakefile = IsMakefile)

  File "/home/disk/***/edk2/BaseTools/Source/Python/GenFds/EfiSection.py",
line 321, in GenSection

IsMakefile=IsMakefile

  File
"/home/disk/***/edk2/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py"
, line 502, in GenerateSection

if (os.path.getsize(Output) >= GenFdsGlobalVariable.LARGE_FILE_SIZE and

  File
"/home/disk/***/edk2/BaseTools/Source/Python/Common/LongFilePathOsPath.py",
line 21, in getsize

return os.path.getsize(LongFilePath(filename))

  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize

return os.stat(filename).st_size

OSError: [Errno 2] No such file or directory:
'/home/disk/***/RELEASE_CLANG100LINUX/FV/Ffs/1C04F529-0612-4319-9315-B2E75C1
6810AFeatureEnablerDxe/1C04F529-0612-4319-9315-B2E75C16810ASEC2.1.pe32'

 

If you have any idea, please contact with me with no worries. Thank you!

 


 





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




[edk2-devel] [PATCH v2 14/26] ArmPkg: Fix Ecc error 6001 in ArmSoftFloatLib

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
All include file contents should be guarded by
a #ifndef statement.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Library/ArmSoftFloatLib/platform.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/ArmPkg/Library/ArmSoftFloatLib/platform.h 
b/ArmPkg/Library/ArmSoftFloatLib/platform.h
index 07800a9d5b79..fddf9de04d52 100644
--- a/ArmPkg/Library/ArmSoftFloatLib/platform.h
+++ b/ArmPkg/Library/ArmSoftFloatLib/platform.h
@@ -1,11 +1,17 @@
 /*
  * Copyright (c) 2019, Linaro Limited
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-2-Clause-Patent
  */

+#ifndef ARM_SOFT_FLOAT_LIB_H_
+#define ARM_SOFT_FLOAT_LIB_H_
+
 #define LITTLEENDIAN 1
 #define INLINE static inline
 #define SOFTFLOAT_BUILTIN_CLZ 1
 #define SOFTFLOAT_FAST_INT64
 #include "opts-GCC.h"
+
+#endif // ARM_SOFT_FLOAT_LIB_H_
--
2.17.1



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




[edk2-devel] [PATCH v2 10/26] ArmPkg: Fix Ecc error 10014 in SemihostLib

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
No used module files found

The source files
[ArmPkg/Library/SemihostLib/SemihostPrivate.h]
is existing in module
ArmPkg/Library/SemihostLib/SemihostLib.inf
but is not described in the INF file.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Library/SemihostLib/SemihostLib.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Library/SemihostLib/SemihostLib.inf 
b/ArmPkg/Library/SemihostLib/SemihostLib.inf
index a46618d30eef..2a4409f6573b 100644
--- a/ArmPkg/Library/SemihostLib/SemihostLib.inf
+++ b/ArmPkg/Library/SemihostLib/SemihostLib.inf
@@ -2,7 +2,7 @@
 # Semihosting JTAG lib
 #
 # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-# Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
+# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -25,6 +25,7 @@ [Defines]
 #
 [Sources.common]
   SemihostLib.c
+  SemihostPrivate.h

 [Sources.ARM]
   Arm/GccSemihost.S | GCC
--
2.17.1



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




[edk2-devel] [PATCH v2 03/26] ArmPkg: Fix Ecc error 8001 in ArmArchTimerLib

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Only capital letters are allowed to be used for #define
declarations

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c 
b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
index 24d9dae4e660..875c835706d6 100644
--- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
+++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
@@ -1,7 +1,7 @@
 /** @file
   Generic ARM implementation of TimerLib.h

-  Copyright (c) 2011-2016, ARM Limited. All rights reserved.
+  Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -20,9 +20,9 @@

 // Select appropriate multiply function for platform architecture.
 #ifdef MDE_CPU_ARM
-#define MultU64xN MultU64x32
+#define MULT_U64_X_N MultU64x32
 #else
-#define MultU64xN MultU64x64
+#define MULT_U64_X_N MultU64x64
 #endif


@@ -121,7 +121,7 @@ MicroSecondDelay (
   //  = MicroSeconds x TICKS_PER_MICRO_SEC
   //  = MicroSeconds x Frequency.10^-6
   TimerTicks64 = DivU64x32 (
-   MultU64xN (
+   MULT_U64_X_N (
  MicroSeconds,
  GetPlatformTimerFreq ()
  ),
@@ -263,7 +263,7 @@ GetTimeInNanoSecond (
   // Time = - x 1,000,000,000
   //Frequency
   //
-  NanoSeconds = MultU64xN (
+  NanoSeconds = MULT_U64_X_N (
   DivU64x32Remainder (
 Ticks,
 TimerFreq,
@@ -276,7 +276,7 @@ GetTimeInNanoSecond (
   // will not overflow 64-bit.
   //
   NanoSeconds += DivU64x32 (
-   MultU64xN (
+   MULT_U64_X_N (
  (UINT64) Remainder,
  10U),
TimerFreq
--
2.17.1



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




[edk2-devel] [PATCH v2 13/26] ArmPkg: Fix Ecc error 6001 in MmCommunicationDxe

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
All include file contents should be guarded by
a #ifndef statement.

This patch replaces a "#if !defined [...]" statement
by a "#ifndef [...]" statement, preventing Ecc to
throw an error.

Edk2 coding standard stating that:
"Names starting with one or two underscores, such as
_MACRO_GUARD_FILE_NAME_H_, must not be used."
the include guard is also updated.

Ref:
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/
5_source_files/53_include_files#
5-3-5-all-include-file-contents-must-be-protected-by-a-include-guard

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h 
b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h
index fcc346ba7e3e..32753947e1cb 100644
--- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h
+++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h
@@ -1,13 +1,13 @@
 /** @file

-  Copyright (c) 2016-2018, ARM Limited. All rights reserved.
+  Copyright (c) 2016-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/

-#if !defined _MM_COMMUNICATE_H_
-#define _MM_COMMUNICATE_H_
+#ifndef MM_COMMUNICATE_H_
+#define MM_COMMUNICATE_H_

 #define MM_MAJOR_VER_MASK0xEFFF
 #define MM_MINOR_VER_MASK0x
@@ -19,4 +19,4 @@
 #define MM_CALLER_MAJOR_VER  0x1UL
 #define MM_CALLER_MINOR_VER  0x0

-#endif /* _MM_COMMUNICATE_H_ */
+#endif /* MM_COMMUNICATE_H_ */
--
2.17.1



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




[edk2-devel] [PATCH v2 24/26] ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID_CLOCK

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c   | 12 ++--
 ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c  | 10 +-
 ArmPkg/Include/Protocol/ArmScmiClockProtocol.h | 10 +-
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c
index c84ce97f15ac..2c6206be9368 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c
@@ -69,9 +69,9 @@ BaseGetTotalProtocols (

 /** Common function which returns vendor details.

-  @param[in] MessageId   SCMI_MESSAGE_ID_BASE_DISCOVER_VENDOR
+  @param[in] MessageId   ScmiMessageIdBaseDiscoverVendor
  OR
- SCMI_MESSAGE_ID_BASE_DISCOVER_SUB_VENDOR
+ ScmiMessageIdBaseDiscoverSubVendor

   @param[out] VendorIdentifier ASCII name of the vendor/subvendor.

@@ -133,7 +133,7 @@ BaseDiscoverVendor (
   )
 {
   return BaseDiscoverVendorDetails (
-   SCMI_MESSAGE_ID_BASE_DISCOVER_VENDOR,
+   ScmiMessageIdBaseDiscoverVendor,
VendorIdentifier
);
 }
@@ -156,7 +156,7 @@ BaseDiscoverSubVendor (
   )
 {
   return BaseDiscoverVendorDetails (
-   SCMI_MESSAGE_ID_BASE_DISCOVER_SUB_VENDOR,
+   ScmiMessageIdBaseDiscoverSubVendor,
VendorIdentifier
);
 }
@@ -184,7 +184,7 @@ BaseDiscoverImplVersion (
   UINT32PayloadLength;

   Cmd.ProtocolId = ScmiProtocolIdBase;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_BASE_DISCOVER_IMPLEMENTATION_VERSION;
+  Cmd.MessageId  = ScmiMessageIdBaseDiscoverImplementationVersion;

   PayloadLength = 0;

@@ -251,7 +251,7 @@ BaseDiscoverListProtocols (
   }

   Cmd.ProtocolId = ScmiProtocolIdBase;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_BASE_DISCOVER_LIST_PROTOCOLS;
+  Cmd.MessageId  = ScmiMessageIdBaseDiscoverListProtocols;

   Skip = 0;

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
index b7892bfd7771..9cd3a7ed232d 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
@@ -123,7 +123,7 @@ ClockGetClockAttributes (
   *MessageParams = ClockId;

   Cmd.ProtocolId = ScmiProtocolIdClock;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_ATTRIBUTES;
+  Cmd.MessageId  = ScmiMessageIdClockAttributes;

   PayloadLength = sizeof (ClockId);

@@ -204,7 +204,7 @@ ClockDescribeRates (
   }

   Cmd.ProtocolId = ScmiProtocolIdClock;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_DESCRIBE_RATES;
+  Cmd.MessageId  = ScmiMessageIdClockDescribeRates;

   *MessageParams++  = ClockId;

@@ -321,7 +321,7 @@ ClockRateGet (
   *MessageParams  = ClockId;

   Cmd.ProtocolId  = ScmiProtocolIdClock;
-  Cmd.MessageId   = SCMI_MESSAGE_ID_CLOCK_RATE_GET;
+  Cmd.MessageId   = ScmiMessageIdClockRateGet;

   PayloadLength = sizeof (ClockId);

@@ -375,7 +375,7 @@ ClockRateSet (
   ClockRateSetAttributes->Rate.High  = (UINT32)(Rate >> 32);

   Cmd.ProtocolId = ScmiProtocolIdClock;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_RATE_SET;
+  Cmd.MessageId  = ScmiMessageIdClockRateSet;

   PayloadLength = sizeof (CLOCK_RATE_SET_ATTRIBUTES);

@@ -422,7 +422,7 @@ ClockEnable (
   ClockConfigSetAttributes->Attributes = Enable ? BIT0 : 0;

   Cmd.ProtocolId = ScmiProtocolIdClock;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_CONFIG_SET;
+  Cmd.MessageId  = ScmiMessageIdClockConfigSet;

   PayloadLength = sizeof (CLOCK_CONFIG_SET_ATTRIBUTES);

diff --git a/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h 
b/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
index 85b5b8d1e764..cd62f05a58fd 100644
--- a/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
@@ -22,11 +22,11 @@ extern EFI_GUID gArmScmiClockProtocolGuid;

 // Message Type for clock management protocol.
 typedef enum {
-  SCMI_MESSAGE_ID_CLOCK_ATTRIBUTES = 0x3,
-  SCMI_MESSAGE_ID_CLOCK_DESCRIBE_RATES = 0x4,
-  SCMI_MESSAGE_ID_CLOCK_RATE_SET   = 0x5,
-  SCMI_MESSAGE_ID_CLOCK_RATE_GET   = 0x6,
-  SCMI_MESSAGE_ID_CLOCK_CONFIG_SET = 0x7
+  ScmiMessageIdClockAttributes= 0x3,
+  ScmiMessageIdClockDescribeRates = 0x4,
+  ScmiMessageIdClockRateSet   = 0x5,
+  ScmiMessageIdClockRateGet   = 0x6,
+  ScmiMessageIdClockConfigSet = 0x7
 } SCMI_MESSAGE_ID_CLOCK;

 typedef enum {
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71459): https://edk2.groups.io/g/devel/message/71459
Mute This Topic: 

[edk2-devel] [PATCH v2 25/26] ArmPkg: Fix Ecc error 8005 for SCMI_CLOCK_RATE_FORMAT

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c   | 8 
 ArmPkg/Include/Protocol/ArmScmiClock2Protocol.h | 6 +++---
 ArmPkg/Include/Protocol/ArmScmiClockProtocol.h  | 8 
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
index 9cd3a7ed232d..cc223d672028 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
@@ -152,10 +152,10 @@ ClockGetClockAttributes (
   @param[in] ThisA pointer to SCMI_CLOCK_PROTOCOL Instance.
   @param[in] ClockId Identifier for the clock device.

-  @param[out] Format  SCMI_CLOCK_RATE_FORMAT_DISCRETE: Clock device
+  @param[out] Format  ScmiClockRateFormatDiscrete: Clock device
   supports range of clock rates which are non-linear.

-  SCMI_CLOCK_RATE_FORMAT_LINEAR: Clock device supports
+  ScmiClockRateFormatLinear: Clock device supports
   range of linear clock rates from Min to Max in steps.

   @param[out] TotalRates  Total number of rates.
@@ -236,7 +236,7 @@ ClockDescribeRates (
   *TotalRates = NUM_RATES (DescribeRates->NumRatesFlags)
 + NUM_REMAIN_RATES (DescribeRates->NumRatesFlags);

-  if (*Format == SCMI_CLOCK_RATE_FORMAT_DISCRETE) {
+  if (*Format == ScmiClockRateFormatDiscrete) {
  RequiredArraySize = (*TotalRates) * sizeof (UINT64);
   } else {
  // We need to return triplet of 64 bit value for each rate
@@ -251,7 +251,7 @@ ClockDescribeRates (

 RateOffset = 0;

-if (*Format == SCMI_CLOCK_RATE_FORMAT_DISCRETE) {
+if (*Format == ScmiClockRateFormatDiscrete) {
   for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); 
RateNo++) {
 Rate = >Rates[RateOffset++];
 // Non-linear discrete rates.
diff --git a/ArmPkg/Include/Protocol/ArmScmiClock2Protocol.h 
b/ArmPkg/Include/Protocol/ArmScmiClock2Protocol.h
index 950141cbd2da..0e26491a62c4 100644
--- a/ArmPkg/Include/Protocol/ArmScmiClock2Protocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiClock2Protocol.h
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+  Copyright (c) 2017-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -89,10 +89,10 @@ EFI_STATUS
   @param[in] ThisA pointer to SCMI_CLOCK2_PROTOCOL Instance.
   @param[in] ClockId Identifier for the clock device.

-  @param[out] Format  SCMI_CLOCK_RATE_FORMAT_DISCRETE: Clock device
+  @param[out] Format  ScmiClockRateFormatDiscrete: Clock device
   supports range of clock rates which are non-linear.

-  SCMI_CLOCK_RATE_FORMAT_LINEAR: Clock device supports
+  ScmiClockRateFormatLinear: Clock device supports
   range of linear clock rates from Min to Max in steps.

   @param[out] TotalRates  Total number of rates.
diff --git a/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h 
b/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
index cd62f05a58fd..4210a53cf98d 100644
--- a/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
@@ -30,8 +30,8 @@ typedef enum {
 } SCMI_MESSAGE_ID_CLOCK;

 typedef enum {
-  SCMI_CLOCK_RATE_FORMAT_DISCRETE, // Non-linear range.
-  SCMI_CLOCK_RATE_FORMAT_LINEAR// Linear range.
+  ScmiClockRateFormatDiscrete, // Non-linear range.
+  ScmiClockRateFormatLinear// Linear range.
 } SCMI_CLOCK_RATE_FORMAT;

 // Clock management protocol version.
@@ -139,10 +139,10 @@ EFI_STATUS
   @param[in] ThisA pointer to SCMI_CLOCK_PROTOCOL Instance.
   @param[in] ClockId Identifier for the clock device.

-  @param[out] Format  SCMI_CLOCK_RATE_FORMAT_DISCRETE: Clock device
+  @param[out] Format  ScmiClockRateFormatDiscrete: Clock device
   supports range of clock rates which are non-linear.

-  SCMI_CLOCK_RATE_FORMAT_LINEAR: Clock device supports
+  ScmiClockRateFormatLinear: Clock device supports
   range of linear clock rates from Min to Max in steps.

   @param[out] TotalRates  Total number of rates.
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71460): https://edk2.groups.io/g/devel/message/71460
Mute This Topic: https://groups.io/mt/80474643/21656
Group Owner: 

[edk2-devel] [PATCH v2 26/26] ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID_PERFORMANCE

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 .../ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h |  4 ++--
 .../Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c   | 12 ++--
 .../Include/Protocol/ArmScmiPerformanceProtocol.h  | 14 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h 
b/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h
index b274b5ab2ad4..b178aa3fdf10 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h
+++ b/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+  Copyright (c) 2017-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -22,7 +22,7 @@
 #define NUM_REMAIN_PERF_LEVELS_SHIFT  16
 #define NUM_REMAIN_PERF_LEVELS(Lvls) (Lvls >> NUM_REMAIN_PERF_LEVELS_SHIFT)

-/** Return values for SCMI_MESSAGE_ID_PERFORMANCE_DESCRIBE_LEVELS command.
+/** Return values for ScmiMessageIdPerformanceDescribeLevels command.
   SCMI Spec section 4.5.2.5
 **/
 typedef struct {
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c
index 51cad4d2c602..684ed713d52c 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c
@@ -108,7 +108,7 @@ PerformanceDomainAttributes (
   *MessageParams = DomainId;

   Cmd.ProtocolId = ScmiProtocolIdPerformance;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_PERFORMANCE_DOMAIN_ATTRIBUTES;
+  Cmd.MessageId  = ScmiMessageIdPerformanceDomainAttributes;

   PayloadLength = sizeof (DomainId);

@@ -180,7 +180,7 @@ PerformanceDescribeLevels (
   *MessageParams++ = DomainId;

   Cmd.ProtocolId = ScmiProtocolIdPerformance;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_PERFORMANCE_DESCRIBE_LEVELS;
+  Cmd.MessageId  = ScmiMessageIdPerformanceDescribeLevels;

   do {

@@ -259,7 +259,7 @@ PerformanceLimitsSet (
   *MessageParams   = Limits->RangeMin;

   Cmd.ProtocolId = ScmiProtocolIdPerformance;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_SET;
+  Cmd.MessageId  = ScmiMessageIdPerformanceLimitsSet;

   PayloadLength = sizeof (DomainId) + sizeof (SCMI_PERFORMANCE_LIMITS);

@@ -305,7 +305,7 @@ PerformanceLimitsGet (
   *MessageParams = DomainId;

   Cmd.ProtocolId = ScmiProtocolIdPerformance;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_GET;
+  Cmd.MessageId  = ScmiMessageIdPerformanceLimitsGet;

   PayloadLength = sizeof (DomainId);

@@ -355,7 +355,7 @@ PerformanceLevelSet (
   *MessageParams   = Level;

   Cmd.ProtocolId = ScmiProtocolIdPerformance;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_SET;
+  Cmd.MessageId  = ScmiMessageIdPerformanceLevelSet;

   PayloadLength = sizeof (DomainId) + sizeof (Level);

@@ -400,7 +400,7 @@ PerformanceLevelGet (
   *MessageParams = DomainId;

   Cmd.ProtocolId = ScmiProtocolIdPerformance;
-  Cmd.MessageId  = SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_GET;
+  Cmd.MessageId  = ScmiMessageIdPerformanceLevelGet;

   PayloadLength = sizeof (DomainId);

diff --git a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h 
b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
index 96a4d66737bd..8c70aa75281e 100644
--- a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+  Copyright (c) 2017-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -247,12 +247,12 @@ typedef struct _SCMI_PERFORMANCE_PROTOCOL {
 } SCMI_PERFORMANCE_PROTOCOL;

 typedef enum {
-  SCMI_MESSAGE_ID_PERFORMANCE_DOMAIN_ATTRIBUTES = 0x3,
-  SCMI_MESSAGE_ID_PERFORMANCE_DESCRIBE_LEVELS   = 0x4,
-  SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_SET= 0x5,
-  SCMI_MESSAGE_ID_PERFORMANCE_LIMITS_GET= 0x6,
-  SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_SET = 0x7,
-  SCMI_MESSAGE_ID_PERFORMANCE_LEVEL_GET = 0x8,
+  ScmiMessageIdPerformanceDomainAttributes = 0x3,
+  ScmiMessageIdPerformanceDescribeLevels   = 0x4,
+  ScmiMessageIdPerformanceLimitsSet= 0x5,
+  ScmiMessageIdPerformanceLimitsGet= 0x6,
+  ScmiMessageIdPerformanceLevelSet = 0x7,
+  ScmiMessageIdPerformanceLevelGet = 0x8,
 } SCMI_MESSAGE_ID_PERFORMANCE;

 #endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71461): https://edk2.groups.io/g/devel/message/71461
Mute 

[edk2-devel] [PATCH v2 23/26] ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID_BASE

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h 
b/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h
index 2f93ec92325e..73ad3e32a2f5 100644
--- a/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+  Copyright (c) 2017-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -158,10 +158,10 @@ typedef struct _SCMI_BASE_PROTOCOL {

 // SCMI Message IDs for Base protocol.
 typedef enum {
-  SCMI_MESSAGE_ID_BASE_DISCOVER_VENDOR  = 0x3,
-  SCMI_MESSAGE_ID_BASE_DISCOVER_SUB_VENDOR  = 0x4,
-  SCMI_MESSAGE_ID_BASE_DISCOVER_IMPLEMENTATION_VERSION  = 0x5,
-  SCMI_MESSAGE_ID_BASE_DISCOVER_LIST_PROTOCOLS  = 0x6
+  ScmiMessageIdBaseDiscoverVendor = 0x3,
+  ScmiMessageIdBaseDiscoverSubVendor  = 0x4,
+  ScmiMessageIdBaseDiscoverImplementationVersion  = 0x5,
+  ScmiMessageIdBaseDiscoverListProtocols  = 0x6
 } SCMI_MESSAGE_ID_BASE;

 #endif /* ARM_SCMI_BASE_PROTOCOL_H_ */
--
2.17.1



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




[edk2-devel] [PATCH v2 21/26] ArmPkg: Fix Ecc error 8005 for SCMI_STATUS

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/Scmi.c|  2 +-
 ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h | 22 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
index 25f6cc3371af..a1bf1b95c052 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
@@ -123,7 +123,7 @@ ScmiCommandExecute (

   Response = (SCMI_MESSAGE_RESPONSE*)MtlGetChannelPayload (Channel);

-  if (Response->Status != SCMI_SUCCESS) {
+  if (Response->Status != ScmiSuccess) {
 DEBUG ((DEBUG_ERROR, "SCMI error: ProtocolId = 0x%x, MessageId = 0x%x, 
error = %d\n",
   Command->ProtocolId,
   Command->MessageId,
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
index 6de57a5c9514..118961dbe219 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
@@ -30,17 +30,17 @@ typedef enum {

 // SCMI response error codes.
 typedef enum {
-  SCMI_SUCCESS=  0,
-  SCMI_NOT_SUPPORTED  = -1,
-  SCMI_INVALID_PARAMETERS = -2,
-  SCMI_DENIED = -3,
-  SCMI_NOT_FOUND  = -4,
-  SCMI_OUT_OF_RANGE   = -5,
-  SCMI_BUSY   = -6,
-  SCMI_COMMS_ERROR= -7,
-  SCMI_GENERIC_ERROR  = -8,
-  SCMI_HARDWARE_ERROR = -9,
-  SCMI_PROTOCOL_ERROR = -10
+  ScmiSuccess   =  0,
+  ScmiNotSupported  = -1,
+  ScmiInvalidParameters = -2,
+  ScmiDenied= -3,
+  ScmiNotFound  = -4,
+  ScmiOutOfRange= -5,
+  ScmiBusy  = -6,
+  ScmiCommsError= -7,
+  ScmiGenericError  = -8,
+  ScmiHardwareError = -9,
+  ScmiProtocolError = -10
 } SCMI_STATUS;

 // SCMI message IDs common to all protocols.
--
2.17.1



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




[edk2-devel] [PATCH v2 22/26] ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/Scmi.c| 6 +++---
 ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
index a1bf1b95c052..3793c0663666 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
@@ -195,7 +195,7 @@ ScmiGetProtocolVersion (

   Status = ScmiProtocolDiscoveryCommon (
  ProtocolId,
- SCMI_MESSAGE_ID_PROTOCOL_VERSION,
+ ScmiMessageIdProtocolVersion,
  (UINT32**)
  );
   if (EFI_ERROR (Status)) {
@@ -224,7 +224,7 @@ ScmiGetProtocolAttributes (
 {
   return ScmiProtocolDiscoveryCommon (
ProtocolId,
-   SCMI_MESSAGE_ID_PROTOCOL_ATTRIBUTES,
+   ScmiMessageIdProtocolAttributes,
ReturnValues
);
 }
@@ -246,7 +246,7 @@ ScmiGetProtocolMessageAttributes (
 {
   return ScmiProtocolDiscoveryCommon (
ProtocolId,
-   SCMI_MESSAGE_ID_PROTOCOL_MESSAGE_ATTRIBUTES,
+   ScmiMessageIdProtocolMessageAttributes,
ReturnValues
);
 }
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
index 118961dbe219..e56c9e0dc342 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
@@ -45,9 +45,9 @@ typedef enum {

 // SCMI message IDs common to all protocols.
 typedef enum {
-  SCMI_MESSAGE_ID_PROTOCOL_VERSION= 0x0,
-  SCMI_MESSAGE_ID_PROTOCOL_ATTRIBUTES = 0x1,
-  SCMI_MESSAGE_ID_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2
+  ScmiMessageIdProtocolVersion   = 0x0,
+  ScmiMessageIdProtocolAttributes= 0x1,
+  ScmiMessageIdProtocolMessageAttributes = 0x2
 } SCMI_MESSAGE_ID;

 // Not defined in SCMI specification but will help to identify a message.
--
2.17.1



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




[edk2-devel] [PATCH v2 19/26] ArmPkg: Fix Ecc error 8005 for SCMI_PROTOCOL_ID

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c   | 12 ++--
 ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c  | 14 +++---
 ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c| 10 +-
 .../ArmScmiDxe/ScmiPerformanceProtocol.c   | 18 +-
 ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h| 14 +++---
 5 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c
index d89587f9edf3..c84ce97f15ac 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+  Copyright (c) 2017-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -34,7 +34,7 @@ BaseGetVersion (
   OUT UINT32  *Version
   )
 {
-  return ScmiGetProtocolVersion (SCMI_PROTOCOL_ID_BASE, Version);
+  return ScmiGetProtocolVersion (ScmiProtocolIdBase, Version);
 }

 /** Return total number of SCMI protocols supported by the SCP firmware.
@@ -57,7 +57,7 @@ BaseGetTotalProtocols (
   EFI_STATUS  Status;
   UINT32  *ReturnValues;

-  Status = ScmiGetProtocolAttributes (SCMI_PROTOCOL_ID_BASE, );
+  Status = ScmiGetProtocolAttributes (ScmiProtocolIdBase, );
   if (EFI_ERROR (Status)) {
 return Status;
   }
@@ -91,7 +91,7 @@ BaseDiscoverVendorDetails (
   SCMI_COMMAND  Cmd;
   UINT32PayloadLength;

-  Cmd.ProtocolId = SCMI_PROTOCOL_ID_BASE;
+  Cmd.ProtocolId = ScmiProtocolIdBase;
   Cmd.MessageId  = MessageId;

   PayloadLength = 0;
@@ -183,7 +183,7 @@ BaseDiscoverImplVersion (
   SCMI_COMMAND  Cmd;
   UINT32PayloadLength;

-  Cmd.ProtocolId = SCMI_PROTOCOL_ID_BASE;
+  Cmd.ProtocolId = ScmiProtocolIdBase;
   Cmd.MessageId  = SCMI_MESSAGE_ID_BASE_DISCOVER_IMPLEMENTATION_VERSION;

   PayloadLength = 0;
@@ -250,7 +250,7 @@ BaseDiscoverListProtocols (
 return EFI_BUFFER_TOO_SMALL;
   }

-  Cmd.ProtocolId = SCMI_PROTOCOL_ID_BASE;
+  Cmd.ProtocolId = ScmiProtocolIdBase;
   Cmd.MessageId  = SCMI_MESSAGE_ID_BASE_DISCOVER_LIST_PROTOCOLS;

   Skip = 0;
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
index 5c06e31bda22..b7892bfd7771 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
@@ -52,7 +52,7 @@ ClockGetVersion (
   OUT UINT32   *Version
   )
 {
-  return ScmiGetProtocolVersion (SCMI_PROTOCOL_ID_CLOCK, Version);
+  return ScmiGetProtocolVersion (ScmiProtocolIdClock, Version);
 }

 /** Return total number of clock devices supported by the clock management
@@ -76,7 +76,7 @@ ClockGetTotalClocks (
   EFI_STATUS  Status;
   UINT32 *ReturnValues;

-  Status = ScmiGetProtocolAttributes (SCMI_PROTOCOL_ID_CLOCK, );
+  Status = ScmiGetProtocolAttributes (ScmiProtocolIdClock, );
   if (EFI_ERROR (Status)) {
 return Status;
   }
@@ -122,7 +122,7 @@ ClockGetClockAttributes (

   *MessageParams = ClockId;

-  Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
+  Cmd.ProtocolId = ScmiProtocolIdClock;
   Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_ATTRIBUTES;

   PayloadLength = sizeof (ClockId);
@@ -203,7 +203,7 @@ ClockDescribeRates (
 return Status;
   }

-  Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
+  Cmd.ProtocolId = ScmiProtocolIdClock;
   Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_DESCRIBE_RATES;

   *MessageParams++  = ClockId;
@@ -320,7 +320,7 @@ ClockRateGet (
   // Fill arguments for clock protocol command.
   *MessageParams  = ClockId;

-  Cmd.ProtocolId  = SCMI_PROTOCOL_ID_CLOCK;
+  Cmd.ProtocolId  = ScmiProtocolIdClock;
   Cmd.MessageId   = SCMI_MESSAGE_ID_CLOCK_RATE_GET;

   PayloadLength = sizeof (ClockId);
@@ -374,7 +374,7 @@ ClockRateSet (
   ClockRateSetAttributes->Rate.Low   = (UINT32)Rate;
   ClockRateSetAttributes->Rate.High  = (UINT32)(Rate >> 32);

-  Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
+  Cmd.ProtocolId = ScmiProtocolIdClock;
   Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_RATE_SET;

   PayloadLength = sizeof (CLOCK_RATE_SET_ATTRIBUTES);
@@ -421,7 +421,7 @@ ClockEnable (
   ClockConfigSetAttributes->ClockId= ClockId;
   ClockConfigSetAttributes->Attributes = Enable ? BIT0 : 0;

-  Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;
+  Cmd.ProtocolId = ScmiProtocolIdClock;
   Cmd.MessageId  = SCMI_MESSAGE_ID_CLOCK_CONFIG_SET;

   PayloadLength = sizeof (CLOCK_CONFIG_SET_ATTRIBUTES);
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
index e95f56e670ed..d5890a7633a2 

[edk2-devel] [PATCH v2 20/26] ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_TYPE

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/Scmi.c| 2 +-
 ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
index 847868a7749e..25f6cc3371af 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c
@@ -95,7 +95,7 @@ ScmiCommandExecute (
   // Fill in message header.
   MessageHeader = SCMI_MESSAGE_HEADER (
 Command->MessageId,
-SCMI_MESSAGE_TYPE_COMMAND,
+ScmiMessageTypeCommand,
 Command->ProtocolId
 );

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
index 5f1225f54cd9..6de57a5c9514 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h
@@ -23,9 +23,9 @@ typedef enum {

 // SCMI message types.
 typedef enum {
-  SCMI_MESSAGE_TYPE_COMMAND  = 0,
-  SCMI_MESSAGE_TYPE_DELAYED_RESPONSE = 2, // Skipping 1 is deliberate.
-  SCMI_MESSAGE_TYPE_NOTIFICATION = 3
+  ScmiMessageTypeCommand = 0,
+  ScmiMessageTypeDelayedResponse = 2, // Skipping 1 is deliberate.
+  ScmiMessageTypeNotification= 3
 } SCMI_MESSAGE_TYPE;

 // SCMI response error codes.
--
2.17.1



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




[edk2-devel] [PATCH v2 18/26] ArmPkg: Fix Ecc error 8005/8007 in ArmDisassemblerLib

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
8005:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

8007:
There should be no use of short (single character) variable names

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 .../ArmDisassemblerLib/ArmDisassembler.c  | 159 +-
 .../ArmDisassemblerLib/ThumbDisassembler.c| 158 -
 2 files changed, 163 insertions(+), 154 deletions(-)

diff --git a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c 
b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c
index e67e13a50ace..03a9f1fbe2e5 100644
--- a/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c
+++ b/ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c
@@ -71,7 +71,7 @@ CHAR8 *gLdmStack[] = {


 #define SIGN(_U)  ((_U) ? "" : "-")
-#define WRITE(_W) ((_W) ? "!" : "")
+#define WRITE(_Write) ((_Write) ? "!" : "")
 #define BYTE(_B)  ((_B) ? "B":"")
 #define USER(_B)  ((_B) ? "^" : "")

@@ -159,23 +159,24 @@ DisassembleArmInstruction (
   )
 {
   UINT32OpCode;
-  CHAR8 *Type, *Root;
-  BOOLEAN   I, P, U, B, W, L, S, H;
+  CHAR8 *Type;
+  CHAR8 *Root;
+  BOOLEAN   Imm, Pre, Up, WriteBack, Write, Load, Sign, Half;
   UINT32Rn, Rd, Rm;
-  UINT32imode, offset_8, offset_12;
+  UINT32IMod, Offset8, Offset12;
   UINT32Index;
-  UINT32shift_imm, shift;
+  UINT32ShiftImm, Shift;

   OpCode = **OpCodePtr;

-  I = (OpCode & BIT25) == BIT25;
-  P = (OpCode & BIT24) == BIT24;
-  U = (OpCode & BIT23) == BIT23;
-  B = (OpCode & BIT22) == BIT22;  // Also called S
-  W = (OpCode & BIT21) == BIT21;
-  L = (OpCode & BIT20) == BIT20;
-  S = (OpCode & BIT6) == BIT6;
-  H = (OpCode & BIT5) == BIT5;
+  Imm = (OpCode & BIT25) == BIT25; // I
+  Pre = (OpCode & BIT24) == BIT24; // P
+  Up = (OpCode & BIT23) == BIT23; // U
+  WriteBack = (OpCode & BIT22) == BIT22; // B, also called S
+  Write = (OpCode & BIT21) == BIT21; // W
+  Load = (OpCode & BIT20) == BIT20; // L
+  Sign = (OpCode & BIT6) == BIT6; // S
+  Half = (OpCode & BIT5) == BIT5; // H
   Rn = (OpCode >> 16) & 0xf;
   Rd = (OpCode >> 12) & 0xf;
   Rm = (OpCode & 0xf);
@@ -189,7 +190,7 @@ DisassembleArmInstruction (

   // LDREX, STREX
   if ((OpCode  & 0x0fe000f0) == 0x01800090) {
-if (L) {
+if (Load) {
   // A4.1.27  LDREX{} , []
   AsciiSPrint (Buf, Size, "LDREX%a %a, [%a]", COND (OpCode), gReg[Rd], 
gReg[Rn]);
 } else {
@@ -201,89 +202,89 @@ DisassembleArmInstruction (

   // LDM/STM
   if ((OpCode  & 0x0e00) == 0x0800) {
-if (L) {
+if (Load) {
   // A4.1.20 LDM{} {!}, 
   // A4.1.21 LDM{} , ^
   // A4.1.22 LDM{} {!}, ^
-  AsciiSPrint (Buf, Size, "LDM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn 
,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B));
+  AsciiSPrint (Buf, Size, "LDM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn 
,(OpCode >> 23) & 3), gReg[Rn], WRITE (Write), MRegList (OpCode), USER 
(WriteBack));
 } else {
   // A4.1.97 STM{} {!}, 
   // A4.1.98 STM{} , ^
-  AsciiSPrint (Buf, Size, "STM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn 
,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B));
+  AsciiSPrint (Buf, Size, "STM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn 
,(OpCode >> 23) & 3), gReg[Rn], WRITE (Write), MRegList (OpCode), USER 
(WriteBack));
 }
 return;
   }

   // LDR/STR Address Mode 2
   if ( ((OpCode  & 0x0c00) == 0x0400) || ((OpCode & 0xfd70f000 ) == 
0xf550f000) ) {
-offset_12 = OpCode & 0xfff;
+Offset12 = OpCode & 0xfff;
 if ((OpCode & 0xfd70f000 ) == 0xf550f000) {
   Index = AsciiSPrint (Buf, Size, "PLD");
 } else {
-  Index = AsciiSPrint (Buf, Size, "%a%a%a%a %a, ", L ? "LDR" : "STR", COND 
(OpCode), BYTE (B), (!(P) && W) ? "T":"", gReg[Rd]);
+  Index = AsciiSPrint (Buf, Size, "%a%a%a%a %a, ", Load ? "LDR" : "STR", 
COND (OpCode), BYTE (WriteBack), (!(Pre) && Write) ? "T":"", gReg[Rd]);
 }
-if (P) {
-  if (!I) {
+if (Pre) {
+  if (!Imm) {
 // A5.2.2 [, #+/-]
 // A5.2.5 [, #+/-]
-AsciiSPrint ([Index], Size - Index, "[%a, #%a0x%x]%a", gReg[Rn], 
SIGN (U), offset_12, WRITE (W));
+AsciiSPrint ([Index], Size - Index, "[%a, #%a0x%x]%a", gReg[Rn], 
SIGN (Up), Offset12, WRITE (Write));
   } else if ((OpCode & 0x03000ff0) == 0x0300) {
 // A5.2.3 [, +/-]
 // A5.2.6 [, +/-]!
-AsciiSPrint ([Index], Size - Index, "[%a, #%a%a]%a", gReg[Rn], 
SIGN (U), WRITE (W));
+AsciiSPrint ([Index], Size - Index, "[%a, #%a%a]%a", gReg[Rn], 
SIGN (Up), WRITE (Write));
   } else {
 // A5.2.4 [, +/-, LSL #]
 // A5.2.7 [, +/-, LSL #]!
-shift_imm = (OpCode >> 7) & 0x1f;
-shift = 

[edk2-devel] [PATCH v2 17/26] ArmPkg: Fix Ecc error 7008 for OPTEE_MESSAGE_PARAM

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Complex types should be typedef-ed

The error is due to the a nested structure declaration.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Include/Library/OpteeLib.h | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/Include/Library/OpteeLib.h 
b/ArmPkg/Include/Library/OpteeLib.h
index d71636143373..8ceab117d132 100644
--- a/ArmPkg/Include/Library/OpteeLib.h
+++ b/ArmPkg/Include/Library/OpteeLib.h
@@ -2,6 +2,7 @@
   OP-TEE specific header file.

   Copyright (c) 2018, Linaro Ltd. All rights reserved.
+  Copyright (c) 2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -45,12 +46,14 @@ typedef struct {
   UINT64C;
 } OPTEE_MESSAGE_PARAM_VALUE;

+typedef union {
+  OPTEE_MESSAGE_PARAM_MEMORY   Memory;
+  OPTEE_MESSAGE_PARAM_VALUEValue;
+} OPTEE_MESSAGE_PARAM_UNION;
+
 typedef struct {
   UINT64 Attribute;
-  union {
-OPTEE_MESSAGE_PARAM_MEMORY   Memory;
-OPTEE_MESSAGE_PARAM_VALUEValue;
-  } Union;
+  OPTEE_MESSAGE_PARAM_UNION Union;
 } OPTEE_MESSAGE_PARAM;

 #define OPTEE_MAX_CALL_PARAMS   4
--
2.17.1



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




[edk2-devel] [PATCH v2 16/26] ArmPkg: Fix Ecc error 7008 for SCMI_CLOCK_RATE

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Complex types should be typedef-ed

The error is due to the a nested structure declaration.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c  | 12 
 ArmPkg/Include/Protocol/ArmScmiClockProtocol.h | 14 ++
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
index c66c414385dd..5c06e31bda22 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
@@ -255,22 +255,26 @@ ClockDescribeRates (
   for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); 
RateNo++) {
 Rate = >Rates[RateOffset++];
 // Non-linear discrete rates.
-RateArray[RateIndex++].Rate = ConvertTo64Bit (Rate->Low, Rate->High);
+RateArray[RateIndex++].DiscreteRate.Rate =
+  ConvertTo64Bit (Rate->Low, Rate->High);
   }
 } else {
   for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); 
RateNo++) {
 // Linear clock rates from minimum to maximum in steps
 // Minimum clock rate.
 Rate = >Rates[RateOffset++];
-RateArray[RateIndex].Min = ConvertTo64Bit (Rate->Low, Rate->High);
+RateArray[RateIndex].ContinuousRate.Min =
+  ConvertTo64Bit (Rate->Low, Rate->High);

 Rate = >Rates[RateOffset++];
 // Maximum clock rate.
-RateArray[RateIndex].Max = ConvertTo64Bit (Rate->Low, Rate->High);
+RateArray[RateIndex].ContinuousRate.Max =
+  ConvertTo64Bit (Rate->Low, Rate->High);

 Rate = >Rates[RateOffset++];
 // Step.
-RateArray[RateIndex++].Step = ConvertTo64Bit (Rate->Low, Rate->High);
+RateArray[RateIndex++].ContinuousRate.Step =
+  ConvertTo64Bit (Rate->Low, Rate->High);
   }
 }
   } while (NUM_REMAIN_RATES (DescribeRates->NumRatesFlags) != 0);
diff --git a/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h 
b/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
index b4d970dee3e2..85b5b8d1e764 100644
--- a/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiClockProtocol.h
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+  Copyright (c) 2017-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -57,12 +57,18 @@ typedef enum {
either Rate or Min/Max/Step triplet is valid.
 */
 typedef struct {
-  union {
   UINT64 Min;
-  UINT64 Rate;
-  };
   UINT64 Max;
   UINT64 Step;
+} SCMI_CLOCK_RATE_CONTINUOUS;
+
+typedef struct {
+  UINT64 Rate;
+} SCMI_CLOCK_RATE_DISCRETE;
+
+typedef union {
+  SCMI_CLOCK_RATE_CONTINUOUS ContinuousRate;
+  SCMI_CLOCK_RATE_DISCRETE DiscreteRate;
 } SCMI_CLOCK_RATE;

 #pragma pack()
--
2.17.1



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




[edk2-devel] [PATCH v2 15/26] ArmPkg: Rename include guard in ArmGicLib.h

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

Edk2 coding standard states that:
"Names starting with one or two underscores, such as
_MACRO_GUARD_FILE_NAME_H_, must not be used."

Ref:
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/
5_source_files/53_include_files#
5-3-5-all-include-file-contents-must-be-protected-by-a-include-guard

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Include/Library/ArmGicLib.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/Include/Library/ArmGicLib.h 
b/ArmPkg/Include/Library/ArmGicLib.h
index 7bcfc001115b..b4c320be119b 100644
--- a/ArmPkg/Include/Library/ArmGicLib.h
+++ b/ArmPkg/Include/Library/ArmGicLib.h
@@ -1,13 +1,13 @@
 /** @file
 *
-*  Copyright (c) 2011-2018, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2021, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
 **/

-#ifndef __ARMGIC_H
-#define __ARMGIC_H
+#ifndef ARMGIC_H_
+#define ARMGIC_H_

 #include 

@@ -333,4 +333,4 @@ ArmGicV3SetPriorityMask (
   IN UINTN  Priority
   );

-#endif
+#endif // ARMGIC_H_
--
2.17.1



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




[edk2-devel] [PATCH v2 05/26] ArmPkg: Fix Ecc error 10006 in ArmPkg.dsc

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
There should be no unnecessary inclusion of library
classes in the INF file

This comes with the additional information:
The Library Class [BootLogoLib]
is not used in any platform
The Library Class [DxeServicesLib]
is not used in any platform
The Library Class [UefiBootManagerLib]
is not used in any platform
The Library Class [PeCoffExtraActionLib]
is not used in any platform

ArmPkg/ArmPkg.dsc builds the modules requiring thses libraries,
but doesn't build the required libraries. This patch adds
the missing libraries to the [LibraryClasses.common] section.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/ArmPkg.dsc | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 48059cf38ed3..ddab84f92165 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -2,7 +2,7 @@
 # ARM processor package.
 #
 # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.
-# Copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.
+# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.
 # Copyright (c) Microsoft Corporation.
 #
@@ -35,14 +35,17 @@ [PcdsFixedAtBuild]
 [LibraryClasses.common]
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
   
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
+  
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
   
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
   
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
   UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
@@ -50,6 +53,7 @@ [LibraryClasses.common]
   
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
+  
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf

   
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
   HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
--
2.17.1



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




[edk2-devel] [PATCH v2 06/26] ArmPkg: Fix Ecc error 10016 in StandaloneMmMmuLib

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Module file has FILE_GUID collision with other
module file

The two .inf files with clashing GUID are:
ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf

As ArmMmuBaseLib.inf is older than ArmMmuStandaloneMmLib.inf,
it has precedence.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf 
b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
index 85973687f5ad..0a147fff18c0 100644
--- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
+++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
@@ -1,6 +1,6 @@
 #/** @file
 #
-#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -10,7 +10,7 @@
 [Defines]
   INF_VERSION= 0x0001001A
   BASE_NAME  = ArmMmuStandaloneMmCoreLib
-  FILE_GUID  = da8f0232-fb14-42f0-922c-63104d2c70bd
+  FILE_GUID  = 44a741c2-655f-41fc-b066-179f5a9aa78a
   MODULE_TYPE= MM_CORE_STANDALONE
   VERSION_STRING = 1.0
   LIBRARY_CLASS  = StandaloneMmMmuLib
--
2.17.1



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




[edk2-devel] [PATCH v2 12/26] ArmPkg: Fix Ecc error 5003 in ArmExceptionLib

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Function name should be left justified,
followed by the beginning of the parameter list,
with the closing parenthesis on its own line,
indented two spaces

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Library/ArmExceptionLib/AArch64/AArch64Exception.c | 4 +++-
 ArmPkg/Library/ArmExceptionLib/Arm/ArmException.c | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ArmPkg/Library/ArmExceptionLib/AArch64/AArch64Exception.c 
b/ArmPkg/Library/ArmExceptionLib/AArch64/AArch64Exception.c
index 514f80a2d47a..fcf3dd16443e 100644
--- a/ArmPkg/Library/ArmExceptionLib/AArch64/AArch64Exception.c
+++ b/ArmPkg/Library/ArmExceptionLib/AArch64/AArch64Exception.c
@@ -2,6 +2,7 @@
 *  Exception Handling support specific for AArch64
 *
 *  Copyright (c) 2016 HP Development Company, L.P.
+*  Copyright (c) 2021, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -27,7 +28,8 @@ RegisterEl0Stack (
   IN  VOID*Stack
   );

-RETURN_STATUS ArchVectorConfig(
+RETURN_STATUS
+ArchVectorConfig (
   IN  UINTN   VectorBaseAddress
   )
 {
diff --git a/ArmPkg/Library/ArmExceptionLib/Arm/ArmException.c 
b/ArmPkg/Library/ArmExceptionLib/Arm/ArmException.c
index 36c9f3f92616..40857c7f1faf 100644
--- a/ArmPkg/Library/ArmExceptionLib/Arm/ArmException.c
+++ b/ArmPkg/Library/ArmExceptionLib/Arm/ArmException.c
@@ -2,7 +2,7 @@
 *  Exception handling support specific for ARM
 *
 * Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-* Copyright (c) 2014, ARM Limited. All rights reserved.
+* Copyright (c) 2014 - 2021, Arm Limited. All rights reserved.
 * Copyright (c) 2016 HP Development Company, L.P.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -26,7 +26,8 @@ PHYSICAL_ADDRESSgExceptionVectorAlignmentMask = 
ARM_VECTOR_TABLE_ALIGNME
 // NOTE: This code assumes vectors are ARM and not Thumb code
 UINTN   gDebuggerNoHandlerValue = 0xEAFE;

-RETURN_STATUS ArchVectorConfig(
+RETURN_STATUS
+ArchVectorConfig (
   IN  UINTN   VectorBaseAddress
   )
 {
--
2.17.1



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




[edk2-devel] [PATCH v2 11/26] ArmPkg: Remove ArmGic/ArmGicSecLib.c

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

Commit: 142fa386eb907df55c239311cd5fa2d40f5007dd
removes the ArmGicSecLib. The file ArmGic/ArmGicSecLib.c
was exclusively used by this library. Thus, this file should
also be removed.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmGic/ArmGicSecLib.c | 58 
 1 file changed, 58 deletions(-)
 delete mode 100644 ArmPkg/Drivers/ArmGic/ArmGicSecLib.c

diff --git a/ArmPkg/Drivers/ArmGic/ArmGicSecLib.c 
b/ArmPkg/Drivers/ArmGic/ArmGicSecLib.c
deleted file mode 100644
index 4af98bb6ec93..
--- a/ArmPkg/Drivers/ArmGic/ArmGicSecLib.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @file
-*
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.
-*
-*  SPDX-License-Identifier: BSD-2-Clause-Patent
-*
-**/
-
-#include 
-#include 
-#include 
-#include 
-
-/*
- * This function configures the interrupts set by the mask to be secure.
- *
- */
-VOID
-EFIAPI
-ArmGicSetSecureInterrupts (
-  IN  UINTN GicDistributorBase,
-  IN  UINTN*GicSecureInterruptMask,
-  IN  UINTN GicSecureInterruptMaskSize
-  )
-{
-  UINTN  Index;
-  UINT32 InterruptStatus;
-
-  // We must not have more interrupts defined by the mask than the number of 
available interrupts
-  ASSERT(GicSecureInterruptMaskSize <= (ArmGicGetMaxNumInterrupts 
(GicDistributorBase) / 32));
-
-  // Set all the interrupts defined by the mask as Secure
-  for (Index = 0; Index < GicSecureInterruptMaskSize; Index++) {
-InterruptStatus = MmioRead32 (GicDistributorBase + ARM_GIC_ICDISR + (Index 
* 4));
-MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4), 
InterruptStatus & (~GicSecureInterruptMask[Index]));
-  }
-}
-
-VOID
-EFIAPI
-ArmGicEnableDistributor (
-  IN  INTN  GicDistributorBase
-  )
-{
-  // Turn on the GIC distributor
-  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 1);
-}
-
-VOID
-EFIAPI
-ArmGicSetupNonSecure (
-  IN  UINTN MpId,
-  IN  INTN  GicDistributorBase,
-  IN  INTN  GicInterruptInterfaceBase
-  )
-{
-  ArmGicV2SetupNonSecure (MpId, GicDistributorBase, GicInterruptInterfaceBase);
-}
--
2.17.1



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




[edk2-devel] [PATCH v2 09/26] ArmPkg: Fix Ecc error 10014 in MmCommunicationDxe

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
No used module files found

The source files
[ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h]
is existing in module
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
but is not described in the INF file.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf 
b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
index 2465fb77c58e..05b6de73ff34 100644
--- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
+++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
@@ -2,7 +2,7 @@
 #
 #  DXE MM Communicate driver
 #
-#  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+#  Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -24,6 +24,7 @@ [Defines]
 #

 [Sources.AARCH64]
+  MmCommunicate.h
   MmCommunication.c

 [Packages]
--
2.17.1



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




[edk2-devel] [PATCH v2 01/26] ArmPkg: Fix Ecc error 8001 in Chipset

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Only capital letters are allowed to be used
for #define declarations

Edk2 coding standard stating that:
"Names starting with one or two underscores, such as
_MACRO_GUARD_FILE_NAME_H_, must not be used."
the include guard of ArmCortexA5x.h is also updated.

Ref:
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/
5_source_files/53_include_files#
5-3-5-all-include-file-contents-must-be-protected-by-a-include-guard

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

Notes:
v2:
 - Only use one trailing underscore for the
   ARM_CORTEX_A5x_H__ include guard. [Sami]
 - 2 patches had the same name and fixed the same
   Ecc error in V1. They are merged in V2. [Pierre]

 ArmPkg/Include/Chipset/AArch64.h | 12 ++--
 ArmPkg/Include/Chipset/AArch64Mmu.h  |  4 ++--
 ArmPkg/Include/Chipset/ArmCortexA5x.h|  8 
 ArmPkg/Include/Chipset/ArmV7.h   |  4 ++--
 .../ArmExceptionLib/AArch64/ExceptionSupport.S   | 10 +-
 ArmPlatformPkg/PrePeiCore/AArch64/Exception.S| 10 +-
 6 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/ArmPkg/Include/Chipset/AArch64.h b/ArmPkg/Include/Chipset/AArch64.h
index 0ade5cce91c3..d49f4d60b15d 100644
--- a/ArmPkg/Include/Chipset/AArch64.h
+++ b/ArmPkg/Include/Chipset/AArch64.h
@@ -1,7 +1,7 @@
 /** @file

   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-  Copyright (c) 2011 - 2017, ARM Ltd. All rights reserved.
+  Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -39,7 +39,7 @@
 // MIDR - Main ID Register definitions
 #define ARM_CPU_TYPE_SHIFT  4
 #define ARM_CPU_TYPE_MASK   0xFFF
-#define ARM_CPU_TYPE_AEMv8  0xD0F
+#define ARM_CPU_TYPE_AEMV8  0xD0F
 #define ARM_CPU_TYPE_A530xD03
 #define ARM_CPU_TYPE_A570xD07
 #define ARM_CPU_TYPE_A720xD08
@@ -97,10 +97,10 @@
 #define ARM_VECTOR_CUR_SP0_FIQ  0x100
 #define ARM_VECTOR_CUR_SP0_SERR 0x180

-#define ARM_VECTOR_CUR_SPx_SYNC 0x200
-#define ARM_VECTOR_CUR_SPx_IRQ  0x280
-#define ARM_VECTOR_CUR_SPx_FIQ  0x300
-#define ARM_VECTOR_CUR_SPx_SERR 0x380
+#define ARM_VECTOR_CUR_SPX_SYNC 0x200
+#define ARM_VECTOR_CUR_SPX_IRQ  0x280
+#define ARM_VECTOR_CUR_SPX_FIQ  0x300
+#define ARM_VECTOR_CUR_SPX_SERR 0x380

 #define ARM_VECTOR_LOW_A64_SYNC 0x400
 #define ARM_VECTOR_LOW_A64_IRQ  0x480
diff --git a/ArmPkg/Include/Chipset/AArch64Mmu.h 
b/ArmPkg/Include/Chipset/AArch64Mmu.h
index 606fe7420d67..6c7ada16b18a 100644
--- a/ArmPkg/Include/Chipset/AArch64Mmu.h
+++ b/ArmPkg/Include/Chipset/AArch64Mmu.h
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2021, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -190,7 +190,7 @@

 // The value written to the T*SZ fields are defined as 2^(64-T*SZ). So a 39Bit
 // Virtual address range for 512GB of virtual space sets T*SZ to 25
-#define INPUT_ADDRESS_SIZE_TO_TxSZ(a)(64 - a)
+#define INPUT_ADDRESS_SIZE_TO_TXSZ(a)(64 - a)

 // Uses LPAE Page Table format

diff --git a/ArmPkg/Include/Chipset/ArmCortexA5x.h 
b/ArmPkg/Include/Chipset/ArmCortexA5x.h
index 847a6e00430b..e597eee947cf 100644
--- a/ArmPkg/Include/Chipset/ArmCortexA5x.h
+++ b/ArmPkg/Include/Chipset/ArmCortexA5x.h
@@ -1,13 +1,13 @@
 /** @file

-  Copyright (c) 2012-2014, ARM Limited. All rights reserved.
+  Copyright (c) 2012 - 2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/

-#ifndef __ARM_CORTEX_A5x_H__
-#define __ARM_CORTEX_A5x_H__
+#ifndef ARM_CORTEX_A5X_H_
+#define ARM_CORTEX_A5X_H_

 //
 // Cortex A5x feature bit definitions
@@ -41,4 +41,4 @@ ArmUnsetCpuExCrBit (
   IN  UINT64Bits
   );

-#endif
+#endif // ARM_CORTEX_A5X_H_
diff --git a/ArmPkg/Include/Chipset/ArmV7.h b/ArmPkg/Include/Chipset/ArmV7.h
index fe91031ef33d..025f87a56d16 100644
--- a/ArmPkg/Include/Chipset/ArmV7.h
+++ b/ArmPkg/Include/Chipset/ArmV7.h
@@ -1,7 +1,7 @@
 /** @file

   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-  Copyright (c) 2011-2015, ARM Ltd. All rights reserved.
+  Copyright (c) 2011-2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -70,7 +70,7 @@
 // MIDR - Main ID Register definitions
 #define ARM_CPU_TYPE_SHIFT  4
 #define ARM_CPU_TYPE_MASK   0xFFF
-#define ARM_CPU_TYPE_AEMv8  0xD0F
+#define ARM_CPU_TYPE_AEMV8  0xD0F
 #define ARM_CPU_TYPE_A530xD03
 #define ARM_CPU_TYPE_A570xD07
 #define ARM_CPU_TYPE_A150xC0F
diff --git a/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S 
b/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
index 5b10a1339ac1..9202952ee9c0 100644
--- 

[edk2-devel] [PATCH v2 08/26] ArmPkg: Fix Ecc error 10014 in GenericWatchdogDxe

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
No used module files found

The source files
[ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdog.h]
is existing in module
ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
but is not described in the INF file.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf 
b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
index d725a2c85839..7dbd30783892 100644
--- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
+++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
+#  Copyright (c) 2013-2021, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -13,6 +13,7 @@ [Defines]
   ENTRY_POINT= GenericWatchdogEntry

 [Sources.common]
+  GenericWatchdog.h
   GenericWatchdogDxe.c

 [Packages]
--
2.17.1



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




[edk2-devel] [PATCH v2 07/26] ArmPkg: Fix Ecc error 10014 in ArmScmiDxe

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
No used module files found

The source files
[ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h]
[ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h]
[ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.h]
[ArmPkg/Drivers/ArmScmiDxe/ArmScmiBaseProtocolPrivate.h]
[ArmPkg/Drivers/ArmScmiDxe/ArmScmiClockProtocolPrivate.h]
are existing in module
ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
but are not described in INF the file.

The patch also re-orders the files in the
[Sources.common] section.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf 
b/ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
index 6cd3aa1c82ec..fc5f841c2b7c 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
+++ b/ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
@@ -1,6 +1,6 @@
 #/** @file
 #
-#  Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+#  Copyright (c) 2017-2021, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -18,11 +18,16 @@ [Defines]
   ENTRY_POINT= ArmScmiDxeEntryPoint

 [Sources.common]
-  Scmi.c
+  ArmScmiBaseProtocolPrivate.h
+  ArmScmiClockProtocolPrivate.h
+  ArmScmiPerformanceProtocolPrivate.h
   ScmiBaseProtocol.c
+  Scmi.c
   ScmiClockProtocol.c
   ScmiDxe.c
+  ScmiDxe.h
   ScmiPerformanceProtocol.c
+  ScmiPrivate.h

 [Packages]
   ArmPkg/ArmPkg.dec
--
2.17.1



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




[edk2-devel] [PATCH v2 04/26] ArmPkg: Fix Ecc error 9005 in CpuDxe

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Only Doxygen commands '@bug', '@todo', '@example', '@file',
'@attention', '@param', '@post', '@pre', '@retval', '@return',
'@sa', '@since', '@test', '@note', '@par', '@endcode', '@code',
'@{', '@}' are allowed to mark the code

This patch removes the ":" character following the "@param"
doxygen command.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Drivers/CpuDxe/CpuMpCore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Drivers/CpuDxe/CpuMpCore.c 
b/ArmPkg/Drivers/CpuDxe/CpuMpCore.c
index d16ae3979207..8a9e8c2fa3a2 100644
--- a/ArmPkg/Drivers/CpuDxe/CpuMpCore.c
+++ b/ArmPkg/Drivers/CpuDxe/CpuMpCore.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2021, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -32,7 +32,7 @@ ARM_PROCESSOR_TABLE mArmProcessorTableTemplate = {
 };

 /** Publish ARM Processor Data table in UEFI SYSTEM Table.
- * @param:  HobStart   Pointer to the beginning of the HOB List 
from PEI.
+ * @param  HobStart   Pointer to the beginning of the HOB List 
from PEI.
  *
  * Description : This function iterates through HOB list and finds ARM 
processor Table Entry HOB.
  *   If  the ARM processor Table Entry HOB is found, the HOB data 
is copied to run-time memory
--
2.17.1



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




[edk2-devel] [PATCH v2 00/26] Fix Ecc reported errors in ArmPkg

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

The Ecc tools available in the BaseTools package checks for
good practice coding standards. Some errors reported while
running Ecc on the ArmPkg require modifications.

The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

v2:
For ArmPkg: Fix Ecc error 8001 in Chipset
 - Only use one trailing underscore for the
   ARM_CORTEX_A5x_H__ include guard. [Sami]
 - 2 patches had the same name and fixed the same
   Ecc error in V1. They are merged in V2. [Pierre]

Pierre Gondois (26):
  ArmPkg: Fix Ecc error 8001 in Chipset
  ArmPkg: Fix Ecc error 8001 in SemihostLib
  ArmPkg: Fix Ecc error 8001 in ArmArchTimerLib
  ArmPkg: Fix Ecc error 9005 in CpuDxe
  ArmPkg: Fix Ecc error 10006 in ArmPkg.dsc
  ArmPkg: Fix Ecc error 10016 in StandaloneMmMmuLib
  ArmPkg: Fix Ecc error 10014 in ArmScmiDxe
  ArmPkg: Fix Ecc error 10014 in GenericWatchdogDxe
  ArmPkg: Fix Ecc error 10014 in MmCommunicationDxe
  ArmPkg: Fix Ecc error 10014 in SemihostLib
  ArmPkg: Remove ArmGic/ArmGicSecLib.c
  ArmPkg: Fix Ecc error 5003 in ArmExceptionLib
  ArmPkg: Fix Ecc error 6001 in MmCommunicationDxe
  ArmPkg: Fix Ecc error 6001 in ArmSoftFloatLib
  ArmPkg: Rename include guard in ArmGicLib.h
  ArmPkg: Fix Ecc error 7008 for SCMI_CLOCK_RATE
  ArmPkg: Fix Ecc error 7008 for OPTEE_MESSAGE_PARAM
  ArmPkg: Fix Ecc error 8005/8007 in ArmDisassemblerLib
  ArmPkg: Fix Ecc error 8005 for SCMI_PROTOCOL_ID
  ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_TYPE
  ArmPkg: Fix Ecc error 8005 for SCMI_STATUS
  ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID
  ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID_BASE
  ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID_CLOCK
  ArmPkg: Fix Ecc error 8005 for SCMI_CLOCK_RATE_FORMAT
  ArmPkg: Fix Ecc error 8005 for SCMI_MESSAGE_ID_PERFORMANCE

 ArmPkg/ArmPkg.dsc |   6 +-
 ArmPkg/Drivers/ArmGic/ArmGicSecLib.c  |  58 ---
 ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf  |   9 +-
 .../ArmScmiPerformanceProtocolPrivate.h   |   4 +-
 ArmPkg/Drivers/ArmScmiDxe/Scmi.c  |  10 +-
 ArmPkg/Drivers/ArmScmiDxe/ScmiBaseProtocol.c  |  24 +--
 ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c |  44 ++---
 ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c   |  10 +-
 .../ArmScmiDxe/ScmiPerformanceProtocol.c  |  30 ++--
 ArmPkg/Drivers/ArmScmiDxe/ScmiPrivate.h   |  48 +++---
 ArmPkg/Drivers/CpuDxe/CpuMpCore.c |   4 +-
 .../GenericWatchdogDxe/GenericWatchdogDxe.inf |   3 +-
 .../MmCommunicationDxe/MmCommunicate.h|   8 +-
 .../MmCommunicationDxe/MmCommunication.inf|   3 +-
 ArmPkg/Include/Chipset/AArch64.h  |  12 +-
 ArmPkg/Include/Chipset/AArch64Mmu.h   |   4 +-
 ArmPkg/Include/Chipset/ArmCortexA5x.h |   8 +-
 ArmPkg/Include/Chipset/ArmV7.h|   4 +-
 ArmPkg/Include/Library/ArmGicLib.h|   8 +-
 ArmPkg/Include/Library/OpteeLib.h |  11 +-
 ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h |  10 +-
 .../Include/Protocol/ArmScmiClock2Protocol.h  |   6 +-
 .../Include/Protocol/ArmScmiClockProtocol.h   |  32 ++--
 .../Protocol/ArmScmiPerformanceProtocol.h |  14 +-
 .../Library/ArmArchTimerLib/ArmArchTimerLib.c |  12 +-
 .../ArmDisassemblerLib/ArmDisassembler.c  | 159 +-
 .../ArmDisassemblerLib/ThumbDisassembler.c| 158 -
 .../AArch64/AArch64Exception.c|   4 +-
 .../AArch64/ExceptionSupport.S|  10 +-
 .../ArmExceptionLib/Arm/ArmException.c|   5 +-
 ArmPkg/Library/ArmSoftFloatLib/platform.h |   6 +
 ArmPkg/Library/SemihostLib/SemihostLib.c  |  26 +--
 ArmPkg/Library/SemihostLib/SemihostLib.inf|   3 +-
 ArmPkg/Library/SemihostLib/SemihostPrivate.h  |  80 -
 .../ArmMmuStandaloneMmLib.inf |   4 +-
 ArmPlatformPkg/PrePeiCore/AArch64/Exception.S |  10 +-
 36 files changed, 416 insertions(+), 431 deletions(-)
 delete mode 100644 ArmPkg/Drivers/ArmGic/ArmGicSecLib.c

--
2.17.1



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




[edk2-devel] [PATCH v2 02/26] ArmPkg: Fix Ecc error 8001 in SemihostLib

2021-02-08 Thread PierreGondois
From: Pierre Gondois 

This patch fixes the following Ecc reported error:
Only capital letters are allowed to be used
for #define declarations

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2/tree/1552_Ecc_ArmPkg_BIS_v2

 ArmPkg/Library/SemihostLib/SemihostLib.c | 26 +++
 ArmPkg/Library/SemihostLib/SemihostPrivate.h | 80 ++--
 2 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/ArmPkg/Library/SemihostLib/SemihostLib.c 
b/ArmPkg/Library/SemihostLib/SemihostLib.c
index a75d45850d43..d66de71182c8 100644
--- a/ArmPkg/Library/SemihostLib/SemihostLib.c
+++ b/ArmPkg/Library/SemihostLib/SemihostLib.c
@@ -44,7 +44,7 @@ SemihostFileOpen (
   OpenBlock.Mode= Mode;
   OpenBlock.NameLength  = AsciiStrLen(FileName);

-  Result = Semihost_SYS_OPEN();
+  Result = SEMIHOST_SYS_OPEN ();

   if (Result == -1) {
 return RETURN_NOT_FOUND;
@@ -66,7 +66,7 @@ SemihostFileSeek (
   SeekBlock.Handle   = FileHandle;
   SeekBlock.Location = Offset;

-  Result = Semihost_SYS_SEEK();
+  Result = SEMIHOST_SYS_SEEK ();

   // Semihosting does not behave as documented. It returns the offset on
   // success.
@@ -95,7 +95,7 @@ SemihostFileRead (
   ReadBlock.Buffer = Buffer;
   ReadBlock.Length = *Length;

-  Result = Semihost_SYS_READ();
+  Result = SEMIHOST_SYS_READ ();

   if ((*Length != 0) && (Result == *Length)) {
 return RETURN_ABORTED;
@@ -122,7 +122,7 @@ SemihostFileWrite (
   WriteBlock.Buffer = Buffer;
   WriteBlock.Length = *Length;

-  *Length = Semihost_SYS_WRITE();
+  *Length = SEMIHOST_SYS_WRITE ();

   if (*Length != 0)
 return RETURN_ABORTED;
@@ -135,7 +135,7 @@ SemihostFileClose (
   IN UINTN  FileHandle
   )
 {
-  if (Semihost_SYS_CLOSE () == -1) {
+  if (SEMIHOST_SYS_CLOSE () == -1) {
 return RETURN_INVALID_PARAMETER;
   } else {
 return RETURN_SUCCESS;
@@ -154,7 +154,7 @@ SemihostFileLength (
 return RETURN_INVALID_PARAMETER;
   }

-  Result = Semihost_SYS_FLEN();
+  Result = SEMIHOST_SYS_FLEN ();

   if (Result == -1) {
 return RETURN_ABORTED;
@@ -195,7 +195,7 @@ SemihostFileTmpName(
   TmpNameBlock.Identifier = Identifier;
   TmpNameBlock.Length = Length;

-  Result = Semihost_SYS_TMPNAME ();
+  Result = SEMIHOST_SYS_TMPNAME ();

   if (Result != 0) {
 return  RETURN_ABORTED;
@@ -220,7 +220,7 @@ SemihostFileRemove (
   RemoveBlock.FileName= FileName;
   RemoveBlock.NameLength  = AsciiStrLen(FileName);

-  Result = Semihost_SYS_REMOVE();
+  Result = SEMIHOST_SYS_REMOVE ();

   if (Result == 0) {
 return RETURN_SUCCESS;
@@ -258,7 +258,7 @@ SemihostFileRename(
   RenameBlock.NewFileName   = NewFileName;
   RenameBlock.NewFileNameLength = AsciiStrLen (NewFileName);

-  Result = Semihost_SYS_RENAME ();
+  Result = SEMIHOST_SYS_RENAME ();

   if (Result != 0) {
 return  RETURN_ABORTED;
@@ -272,7 +272,7 @@ SemihostReadCharacter (
   VOID
   )
 {
-  return Semihost_SYS_READC();
+  return SEMIHOST_SYS_READC ();
 }

 VOID
@@ -280,7 +280,7 @@ SemihostWriteCharacter (
   IN CHAR8 Character
   )
 {
-  Semihost_SYS_WRITEC();
+  SEMIHOST_SYS_WRITEC ();
 }

 VOID
@@ -288,7 +288,7 @@ SemihostWriteString (
   IN CHAR8 *String
   )
 {
-  Semihost_SYS_WRITE0(String);
+  SEMIHOST_SYS_WRITE0 (String);
 }

 UINT32
@@ -301,5 +301,5 @@ SemihostSystem (
   SystemBlock.CommandLine   = CommandLine;
   SystemBlock.CommandLength = AsciiStrLen(CommandLine);

-  return Semihost_SYS_SYSTEM();
+  return SEMIHOST_SYS_SYSTEM ();
 }
diff --git a/ArmPkg/Library/SemihostLib/SemihostPrivate.h 
b/ArmPkg/Library/SemihostLib/SemihostPrivate.h
index 8d1fc6d6eb5a..30103b04b53f 100644
--- a/ArmPkg/Library/SemihostLib/SemihostPrivate.h
+++ b/ArmPkg/Library/SemihostLib/SemihostPrivate.h
@@ -1,7 +1,7 @@
 /** @file

   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-  Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved.
+  Copyright (c) 2013 - 2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -151,19 +151,19 @@ _Semihost_SYS_SYSTEM(
   IN SEMIHOST_SYSTEM_BLOCK *SystemBlock
   );

-#define Semihost_SYS_OPEN(OpenBlock)_Semihost_SYS_OPEN(0x01, OpenBlock)
-#define Semihost_SYS_CLOSE(Handle)  _Semihost_SYS_CLOSE(0x02, Handle)
-#define Semihost_SYS_WRITE0(String) _Semihost_SYS_WRITE0(0x04, String)
-#define Semihost_SYS_WRITEC(Character)  _Semihost_SYS_WRITEC(0x03, 
Character)
-#define Semihost_SYS_WRITE(WriteBlock)  _Semihost_SYS_WRITE(0x05, 
WriteBlock)
-#define Semihost_SYS_READ(ReadBlock)_Semihost_SYS_READ(0x06, ReadBlock)
-#define Semihost_SYS_READC()_Semihost_SYS_READC(0x07, 0)
-#define Semihost_SYS_SEEK(SeekBlock)_Semihost_SYS_SEEK(0x0A, SeekBlock)
-#define Semihost_SYS_FLEN(Handle)   _Semihost_SYS_FLEN(0x0C, Handle)
-#define Semihost_SYS_TMPNAME(TmpNameBlock)  _Semihost_SYS_TMPNAME(0x0D, 
TmpNameBlock)
-#define Semihost_SYS_REMOVE(RemoveBlock)_Semihost_SYS_REMOVE(0x0E, 
RemoveBlock)

[edk2-devel] [PATCH edk2-platforms v1 1/1] Maintainers.txt: Update Arm platform maintainer

2021-02-08 Thread Sami Mujawar
Update maintainer for Arm Ltd. Platforms in
edk2-platforms (
  F: Platform/ARM/
  F: Silicon/ARM/
  )
based on discussions on the mailing list at:
https://edk2.groups.io/g/devel/message/71354

Cc: Ard Biesheuvel 
Cc: Thomas Abraham 
Cc: Leif Lindholm 
Signed-off-by: Sami Mujawar 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 
34f0b585815f36e44c0e7f3366a39ebe9cfb5cfd..8c561166c17b3babc89459b3e77b1c6c5c869554
 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -105,7 +105,7 @@ F: Platform/ARM/
 F: Silicon/ARM/
 R: Ard Biesheuvel 
 R: Thomas Abraham 
-M: Leif Lindholm 
+M: Sami Mujawar 
 
 BeagleBoard:
 F: Platform/BeagleBoard/
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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