public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Chandni Cherukuri <chandni.cherukuri@arm.com>
Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org
Subject: Re: [PATCH 2/2] Platform/ARM/Sgi: Pick ACPI tables to install based on platform ID
Date: Fri, 15 Jun 2018 11:22:32 +0100	[thread overview]
Message-ID: <20180615102232.ry2mv4wbbw7kls4g@bivouac.eciton.net> (raw)
In-Reply-To: <1529042132-29377-3-git-send-email-chandni.cherukuri@arm.com>

On Fri, Jun 15, 2018 at 11:25:32AM +0530, Chandni Cherukuri wrote:
> Use the platform ID and config ID values from the platform ID
> HOB to choose the right set of ACPI tables to be installed.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
> ---
>  .../ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c   | 33 ++++++++++++++++++----
>  .../ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf |  2 ++
>  Platform/ARM/SgiPkg/Include/SgiPlatform.h          | 24 ++++++++++++++--
>  Platform/ARM/SgiPkg/SgiPlatform.dsc                |  1 +
>  Platform/ARM/SgiPkg/SgiPlatform.fdf                |  1 +
>  5 files changed, 53 insertions(+), 8 deletions(-)
> 
> diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
> index edaae5b..d0d5808 100644
> --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
> +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
> @@ -14,6 +14,8 @@
>  
>  #include <Library/AcpiLib.h>
>  #include <Library/DebugLib.h>
> +#include <Library/HobLib.h>
> +#include <SgiPlatform.h>
>  
>  EFI_STATUS
>  InitVirtioBlockIo (
> @@ -28,20 +30,41 @@ ArmSgiPkgEntryPoint (
>    )
>  {
>    EFI_STATUS              Status;
> +  VOID                    *PlatformIdHob;
> +  SGI_PLATFORM_DESCRIPTOR *HobData;
> +  UINT32                  ConfigId;
> +  UINT32                  PartNum;
>  
> -  Status = LocateAndInstallAcpiFromFv (&gSgi575AcpiTablesiFileGuid);
> -  if (EFI_ERROR (Status)) {
> -    DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n", __FUNCTION__));
> -    return Status;
> +  PlatformIdHob = GetFirstGuidHob (&gArmSgiPlatformIdDescriptorGuid);
> +  if (PlatformIdHob == NULL) {
> +    DEBUG ((DEBUG_ERROR, "Platform ID Hob is NULL\n"));

HOB

> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  HobData = (SGI_PLATFORM_DESCRIPTOR *)(GET_GUID_HOB_DATA (PlatformIdHob));
> +
> +  PartNum = (HobData->PlatformId & SGI_PART_NUM_MASK);
> +  ConfigId = ((HobData->PlatformId >> SGI_CONFIG_SHIFT) & SGI_CONFIG_MASK);
> +
> +  if ((PartNum == SGI575_PART_NUM) && (ConfigId == SGI575_CONF_NUM)) {
> +    Status = LocateAndInstallAcpiFromFv (&gSgi575AcpiTablesiFileGuid);
> +    if (EFI_ERROR (Status)) {
> +      DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n", __FUNCTION__));
> +      return Status;
> +    }
> +  } else {
> +    DEBUG ((DEBUG_ERROR, "PlatformDxe: Unsupported Platform Id\n"));
> +    return EFI_UNSUPPORTED;
>    }
>  
> -  Status = EFI_REQUEST_UNLOAD_IMAGE;
>    if (FeaturePcdGet (PcdVirtioSupported)) {
>      Status = InitVirtioBlockIo (ImageHandle);
>      if (EFI_ERROR (Status)) {
>        DEBUG ((DEBUG_ERROR, "%a: Failed to install Virtio Block device\n",
>          __FUNCTION__));
>      }
> +  } else {
> +    Status = EFI_REQUEST_UNLOAD_IMAGE;
>    }
>  
>    return Status;
> diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
> index 51ad22f..b6b8209 100644
> --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
> +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
> @@ -30,10 +30,12 @@
>  
>  [LibraryClasses]
>    AcpiLib
> +  HobLib
>    UefiDriverEntryPoint
>    VirtioMmioDeviceLib
>  
>  [Guids]
> +  gArmSgiPlatformIdDescriptorGuid
>    gSgi575AcpiTablesiFileGuid
>  
>  [FeaturePcd]
> diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
> index 00ca7e9..756954c 100644
> --- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
> +++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
> @@ -12,8 +12,8 @@
>  *
>  **/
>  
> -#ifndef __SGI_PLATFORM_H__
> -#define __SGI_PLATFORM_H__
> +#ifndef SGI_PLATFORM_H_
> +#define SGI_PLATFORM_H_

Non-functional change. Please submit as separate change or not at all.

/
    Leif

>  
>  /***********************************************************************************
>  // Platform Memory Map
> @@ -68,4 +68,22 @@
>  #define SGI_SYSPH_SYS_REG_FLASH                   0x4C
>  #define SGI_SYSPH_SYS_REG_FLASH_RWEN              0x1
>  
> -#endif // __SGI_PLATFORM_H__
> +// SGI575_VERSION values
> +#define SGI575_CONF_NUM                           0x3
> +#define SGI575_PART_NUM                           0x783
> +
> +#define SGI_CONFIG_MASK                           0x0F
> +#define SGI_CONFIG_SHIFT                          0x1C
> +#define SGI_PART_NUM_MASK                         0xFFF
> +
> +//HwConfig DT structure^M
> +typedef struct {
> +  UINT64                  *HwConfigDtAddr;
> +} SGI_HW_CONFIG_INFO_PPI;
> +
> +// ARM platform description data.
> +typedef struct {
> +  UINTN  PlatformId;
> +} SGI_PLATFORM_DESCRIPTOR;
> +
> +#endif // SGI_PLATFORM_H_
> diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> index a56175e..f571897 100644
> --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> @@ -199,6 +199,7 @@
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
>    }
> +  Platform/ARM/SgiPkg/Library/SgiPlatformPeiLib/SgiPlatformPeiLib.inf
>  
>    #
>    # DXE
> diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/SgiPlatform.fdf
> index 17cdf48..05203a8 100644
> --- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
> +++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
> @@ -220,6 +220,7 @@ READ_LOCK_STATUS   = TRUE
>    INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
>    INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
>    INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
> +  INF Platform/ARM/SgiPkg/Library/SgiPlatformPeiLib/SgiPlatformPeiLib.inf
>  
>    FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
>      SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
> -- 
> 2.7.4
> 


      parent reply	other threads:[~2018-06-15 10:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15  5:55 [PATCH 0/2] ARM Dynamic Configuration Chandni Cherukuri
2018-06-15  5:55 ` [PATCH 1/2] Platform/ARM/Sgi: Install a Platform ID HOB Chandni Cherukuri
2018-06-15  6:16   ` Ard Biesheuvel
2018-06-15  6:19     ` Ard Biesheuvel
2018-06-15  9:03       ` Leif Lindholm
2018-06-15 10:18   ` Leif Lindholm
2018-06-15 12:10     ` chandni cherukuri
2018-06-15  5:55 ` [PATCH 2/2] Platform/ARM/Sgi: Pick ACPI tables to install based on platform ID Chandni Cherukuri
2018-06-15  6:18   ` Ard Biesheuvel
2018-06-15 10:22   ` Leif Lindholm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180615102232.ry2mv4wbbw7kls4g@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox