public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif.lindholm@linaro.org>
To: Marcin Wojtas <mw@semihalf.com>
Cc: devel@edk2.groups.io, ard.biesheuvel@linaro.org,
	jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com
Subject: Re: [edk2-platforms: PATCH v3 1/9] Marvell/Armada7k8k: Fix 32-bit compilation
Date: Thu, 10 Oct 2019 23:47:11 +0100	[thread overview]
Message-ID: <20191010224711.GS25504@bivouac.eciton.net> (raw)
In-Reply-To: <1570686139-25182-2-git-send-email-mw@semihalf.com>

On Thu, Oct 10, 2019 at 07:42:11AM +0200, Marcin Wojtas wrote:
> It turned out, that the recently added features broke
> ARM compilation. Fix all issues:
> * Update signatures types in structures (UINTN -> UINT64)
> * Use fixed type for address in ICU
> * Limit memory for ARM build to 1GB and stop using non-existent PCD
> 
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h                       |  2 +-
>  Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h                       |  2 +-
>  Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h                       |  4 ++--
>  Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c      |  8 ++++++++
>  Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/ARM/ArmPlatformHelper.S | 11 -----------
>  5 files changed, 12 insertions(+), 15 deletions(-)
> 
> diff --git a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h
> index a6f551b..3b5a28c 100644
> --- a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h
> +++ b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h
> @@ -22,7 +22,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  
>  typedef struct {
>    MARVELL_BOARD_DESC_PROTOCOL   BoardDescProtocol;
> -  UINTN                   Signature;
> +  UINT64                  Signature;
>    EFI_HANDLE              Handle;
>    EFI_LOCK                Lock;
>  } MV_BOARD_DESC;
> diff --git a/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h b/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h
> index 1cb006a..ce683e7 100644
> --- a/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h
> +++ b/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h
> @@ -36,7 +36,7 @@ typedef struct {
>    EMBEDDED_GPIO     GpioProtocol;
>    GPIO_CONTROLLER  *SoCGpio;
>    UINTN             GpioDeviceCount;
> -  UINTN             Signature;
> +  UINT64            Signature;
>    EFI_HANDLE        Handle;
>  } MV_GPIO;
>  
> diff --git a/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h b/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h
> index 6432916..da7a41e 100644
> --- a/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h
> +++ b/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h
> @@ -109,8 +109,8 @@ typedef enum {
>  
>  typedef struct {
>    ICU_GROUP Group;
> -  UINTN     SetSpiAddr;
> -  UINTN     ClrSpiAddr;
> +  EFI_PHYSICAL_ADDRESS SetSpiAddr;
> +  EFI_PHYSICAL_ADDRESS ClrSpiAddr;
>  } ICU_MSI;
>  
>  typedef struct {
> diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c
> index a735fe5..cc19694 100644
> --- a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c
> +++ b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c
> @@ -36,6 +36,7 @@ GetDramSize (
>    IN OUT UINT64 *MemSize
>    )
>  {
> +#if defined(MDE_CPU_AARCH64)
>    ARM_SMC_ARGS SmcRegs = {0};
>    EFI_STATUS Status;
>  
> @@ -48,6 +49,13 @@ GetDramSize (
>    ArmCallSmc (&SmcRegs);
>  
>    *MemSize = SmcRegs.Arg0;
> +#else
> +  //
> +  // Use fixed value, as currently there is no support
> +  // in Armada early firmware for 32-bit SMC
> +  //
> +  *MemSize = FixedPcdGet64 (PcdSystemMemorySize);
> +#endif
>  
>    return EFI_SUCCESS;
>  }
> diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/ARM/ArmPlatformHelper.S b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/ARM/ArmPlatformHelper.S
> index 4416163..db43b0f 100644
> --- a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/ARM/ArmPlatformHelper.S
> +++ b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/ARM/ArmPlatformHelper.S
> @@ -28,17 +28,6 @@ ASM_FUNC(ArmPlatformPeiBootAction)
>    .err  PcdSystemMemoryBase should be 0x0 on this platform!
>    .endif
>  
> -  .if   FixedPcdGet64 (PcdSystemMemorySize) > FixedPcdGet32 (PcdDramRemapTarget)
> -    //
> -    // Use the low range for UEFI itself. The remaining memory will be mapped
> -    // and added to the GCD map later.
> -    //
> -    ADRL  (r0, mSystemMemoryEnd)
> -    MOV32 (r2, FixedPcdGet32 (PcdDramRemapTarget) - 1)
> -    mov   r3, #0
> -    strd  r2, r3, [r0]
> -  .endif
> -
>    bx    lr
>  
>  //UINTN
> -- 
> 2.7.4
> 

  reply	other threads:[~2019-10-10 22:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  5:42 [edk2-platforms: PATCH v3 0/9] Marvell Octeon CN913X SoC family support Marcin Wojtas
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 1/9] Marvell/Armada7k8k: Fix 32-bit compilation Marcin Wojtas
2019-10-10 22:47   ` Leif Lindholm [this message]
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 2/9] Marvell/Cn9130Db: Add ACPI tables Marcin Wojtas
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 3/9] Marvell/Cn9130Db: Introduce board support Marcin Wojtas
2019-10-10 22:52   ` Leif Lindholm
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 4/9] Marvell/Library: ArmadaSoCDescLib/MppLib: Extend Xenon information Marcin Wojtas
2019-10-10 22:55   ` Leif Lindholm
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 5/9] Marvell/Library: IcuLib: Fix debug information Marcin Wojtas
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 6/9] Marvell/Cn9131Db: Introduce board support Marcin Wojtas
2019-10-10 22:56   ` Leif Lindholm
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 7/9] Marvell/Cn9132Db: " Marcin Wojtas
2019-10-10 22:57   ` Leif Lindholm
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 8/9] Marvell/Drivers: SmbiosPlatformDxe: Load SMBIOS strings from PCD Marcin Wojtas
2019-10-10 23:04   ` Leif Lindholm
2019-10-10 23:33     ` Marcin Wojtas
2019-10-10 23:51       ` Leif Lindholm
2019-10-11  7:30         ` Marcin Wojtas
2019-10-11  8:17           ` Marcin Wojtas
2019-10-10  5:42 ` [edk2-platforms: PATCH v3 9/9] Marvell: Customize per-board SBMIOS strings Marcin Wojtas
2019-10-10 23:07   ` Leif Lindholm
2019-10-10 23:16     ` Marcin Wojtas

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=20191010224711.GS25504@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