From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web12.3552.1570747635521764018 for ; Thu, 10 Oct 2019 15:47:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=tJ1mxiPa; spf=pass (domain: linaro.org, ip: 209.85.221.68, mailfrom: leif.lindholm@linaro.org) Received: by mail-wr1-f68.google.com with SMTP id v8so9718234wrt.2 for ; Thu, 10 Oct 2019 15:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4g4XiYKfMWy/eBHUImVVrNMSSclSZJ626yKkTNmlshc=; b=tJ1mxiPaYcW3wP8xjV4spRB6zLdGB3QwX3ZeewkrgMpd3XUZAqAWhaJHoW+S/8HF1N R+DR49n7DVKL7CvUCTfbisE4RaLTiN9WtJFv5uVVgMJK0dnCrNRcAbKLFV/CPKfwd9g+ 8ld3SsszGK0DFf68J0V/CxHLQIUi0B7cn4MJKtfv1Xuh6mc5QDxHpZ0V1MGv/lJHSZCx MvfirAAO42JMlt61rGVldQI1ZsSSQhRrmnlyq9Vj9OdmOy8gBYFwIAwvZ2utAeFry0uY bijxQCYOOXmmy01iv6+FAtG3/zrM7kUAR8zuCGe4qos4eZ3SrrzLv6iC5AUmOB/JZ9zD KUnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4g4XiYKfMWy/eBHUImVVrNMSSclSZJ626yKkTNmlshc=; b=ZbXElus4//rDfgW/HeYfH7eog7CtdwzQ9u5Qa+y6kkYspTevoAZFXUnZmHBT3XppE8 CRqVV8vn5cjL0VmtbllGw4sNtEFfqih4Fx0o2KXicqPTu2GkUCFS6ObubeZEBRR0Og65 wSO+VcF0rgvgsHE9jrGQXGeKGOi1f0Y9LXnWo+gGiynkZJtRFKnFA5BiajfoBkO/TOr/ CYlm4ltYXKB9ffdABAhZi1H1y1yNFVa5nyU67xhZeoH9DLqvDkkMFiNe2rW3YG3MGQCW ZpiuPJYEEprKdNG5zCf/KcuoQyhfWnSzQd1FFpXYXRFDcmn2oY9/6VSdW7/ppq6Sw6wz FPJg== X-Gm-Message-State: APjAAAWoPuEXegrIqyX7ahTYlpeffC9N1j+uxtg/fPJw28cWre5EekpV dKDl7cHC8OqzQwUNUVmW0oyktg== X-Google-Smtp-Source: APXvYqzPhPhRNEfBONwL0Pi/YgyV/rLlfEX780iEuNca4E/SaJnoNjkLneDUOhkwlALnJPJU3ZeTRg== X-Received: by 2002:adf:9b89:: with SMTP id d9mr10168823wrc.275.1570747633906; Thu, 10 Oct 2019 15:47:13 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id o9sm11838687wrh.46.2019.10.10.15.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 15:47:13 -0700 (PDT) Date: Thu, 10 Oct 2019 23:47:11 +0100 From: "Leif Lindholm" To: Marcin Wojtas 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 Message-ID: <20191010224711.GS25504@bivouac.eciton.net> References: <1570686139-25182-1-git-send-email-mw@semihalf.com> <1570686139-25182-2-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1570686139-25182-2-git-send-email-mw@semihalf.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Reviewed-by: Leif Lindholm > --- > 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 >