From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=yMuK5cla; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.167.68, mailfrom: mw@semihalf.com) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by groups.io with SMTP; Wed, 14 Aug 2019 19:54:33 -0700 Received: by mail-lf1-f68.google.com with SMTP id s19so702934lfb.9 for ; Wed, 14 Aug 2019 19:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sfeLRagyHfhJ6MPDelZnboevv0KHC8C3xWEaqD6zT90=; b=yMuK5claeCEMV2wBkZ3Fked/459lwRlDIBmDqZ9YvYgbcugqk/5hBqzdcsQGHiD4Ge 78uc2z5qG5dTR8pe5llj55k1ADsNXflpU7zmetGMX6W/KhGXbbPPl0TEMZZ3rZigae/e kzkE4JRfGTvoiVwtPoXqCnJ7fciQHHYxzam7PIcOL7jR2J1rBO3xVCW1MenAUN9T+5D8 QG+0ckiaMgWCF/J776/VOKKAJr3tdJmmgsWSZ6oqyCuyEoxXPxc7HXaqQSRg5qX4rXxr pAlRrAuL4cGvG2+QebUQlbYl8rfjis8WtUvqCjfsDS+Vi1nZ4rPBDevfmwHCg1P4iRrn 7pbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sfeLRagyHfhJ6MPDelZnboevv0KHC8C3xWEaqD6zT90=; b=nq6+R5q/lML+WR0Wc8jP03uxpuknOE7PT1uSuJZIGq3kgUOGt8Yo2VDDj1tfwTQm6n 7eEmAkwY+1uCp/jgL1j0EpZpIynb035NTrcH2aj/NHSRRnQi6Sq0QyS6ECCadi2O1+Es 2w+LHY0kWfZe7MicmtHQPRd0osj1/KthrW8uy86tMvLXHfNa8U7td1u436vcgNctALBI SlbMI18rv5RcSBlg8AsO6qdNCIxx1fDDTNXqmWJUSxZYJy56N2EzaQ3/NRCsbtTqtHbi zGwNRH34rsp+2kpygpdbcZHDJkYmzXl4NfBoR9kdNYnMq3KsI38J/f5de44krxsL21gD 1vow== X-Gm-Message-State: APjAAAVitvRHtJe00YssKm+06zckc448Y3Ocw9BQ/3IUZJp0Obt248zP bXxu/6WOn85llPuqLetEdlHqV7b10tBeBg== X-Google-Smtp-Source: APXvYqxDt8437lUe/mPwkrKjqRKbf0ZhTpjiaY0NzWYStAJ9+VxX8+LxvFWpNg8evf9Qb5m0kwdsFg== X-Received: by 2002:ac2:48bc:: with SMTP id u28mr1359987lfg.126.1565837671367; Wed, 14 Aug 2019 19:54:31 -0700 (PDT) Return-Path: Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id n17sm214035lfi.37.2019.08.14.19.54.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Aug 2019 19:54:30 -0700 (PDT) From: "Marcin Wojtas" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com Subject: [edk2-platforms: PATCH v2 01/10] Marvell/Armada7k8k: Fix 32-bit compilation Date: Thu, 15 Aug 2019 04:54:05 +0200 Message-Id: <1565837654-13258-2-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565837654-13258-1-git-send-email-mw@semihalf.com> References: <1565837654-13258-1-git-send-email-mw@semihalf.com> It turned out, that the recently added features broke ARM compilation. Fix all issues: * Use SIGNATURE_32 only * Do not shift address by 32-bit in ICU * Limit memory for ARM build to 1GB and stop using non-existent PCD Signed-off-by: Marcin Wojtas --- Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h | 2 +- Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h | 2 +- Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c | 4 ++++ Silicon/Marvell/Library/IcuLib/IcuLib.c | 7 ++++++- Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/ARM/ArmPlatformHelper.S | 11 ----------- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h index a6f551b..7ecb4e1 100644 --- a/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h +++ b/Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.h @@ -18,7 +18,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include -#define MV_BOARD_DESC_SIGNATURE SIGNATURE_64 ('M', 'V', 'B', 'R', 'D', 'D', 'S', 'C') +#define MV_BOARD_DESC_SIGNATURE SIGNATURE_32 ('B', 'D', 'S', 'C') typedef struct { MARVELL_BOARD_DESC_PROTOCOL BoardDescProtocol; diff --git a/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h b/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h index 1cb006a..600d5db 100644 --- a/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h +++ b/Silicon/Marvell/Drivers/Gpio/MvGpioDxe/MvGpioDxe.h @@ -23,7 +23,7 @@ #include -#define MV_GPIO_SIGNATURE SIGNATURE_64 ('M', 'V','_','G', 'P', 'I','O',' ') +#define MV_GPIO_SIGNATURE SIGNATURE_32 ('G', 'P', 'I', 'O') // Marvell MV_GPIO Controller Registers #define MV_GPIO_DATA_OUT_REG (0x0) diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kLib/Armada7k8kLibMem.c index a735fe5..5ff6bb1 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,9 @@ GetDramSize ( ArmCallSmc (&SmcRegs); *MemSize = SmcRegs.Arg0; +#else + *MemSize = FixedPcdGet64 (PcdSystemMemorySize); +#endif return EFI_SUCCESS; } diff --git a/Silicon/Marvell/Library/IcuLib/IcuLib.c b/Silicon/Marvell/Library/IcuLib/IcuLib.c index 343c21b..422388c 100644 --- a/Silicon/Marvell/Library/IcuLib/IcuLib.c +++ b/Silicon/Marvell/Library/IcuLib/IcuLib.c @@ -185,10 +185,15 @@ IcuConfigure ( for (Index = 0; Index < IcuGroupMax; Index++, Msi++) { MmioWrite32 (IcuBase + ICU_SET_SPI_AL (Msi->Group), Msi->SetSpiAddr & 0xFFFFFFFF); - MmioWrite32 (IcuBase + ICU_SET_SPI_AH (Msi->Group), Msi->SetSpiAddr >> 32); MmioWrite32 (IcuBase + ICU_CLR_SPI_AL (Msi->Group), Msi->ClrSpiAddr & 0xFFFFFFFF); +#if defined(MDE_CPU_AARCH64) + MmioWrite32 (IcuBase + ICU_SET_SPI_AH (Msi->Group), Msi->SetSpiAddr >> 32); MmioWrite32 (IcuBase + ICU_CLR_SPI_AH (Msi->Group), Msi->ClrSpiAddr >> 32); +#else + MmioWrite32 (IcuBase + ICU_SET_SPI_AH (Msi->Group), 0); + MmioWrite32 (IcuBase + ICU_CLR_SPI_AH (Msi->Group), 0); +#endif } /* Mask all ICU interrupts */ 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