Hi folks, I'm looking at getting TianoCore/EDK2 running on a simulated SoC platform using a Cortex-A53 processor, which should bear some resemblance to SBSA. I'm a bit confused, though, about which EDK2 repo/branch would be best to use as a baseline at the moment? Also, I'm guessing OpenPlatformPkg is the way to go now for new ARM platform-specific code, rather than ArmPlatformPkg?
Cheers,
Scott.
Hi,
Jan has prepared v2 version of the patchset, which fixes minor issues
pointed in UTMI library. Also Reset functionality was re-implemented
in order to use ResetRuntimeDxe.
The patches are also available in the public github tree:
https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/opp…
Any comments or remarks would be welcome.
Best regards,
Marcin
Changelog v1->v2:
* Change ResetSystem driver to implementation of EfiResetSystemLibrary
- Use EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
- Adjust naming properly
- Replace 4K in size and 4K aligned memory allocation to 64K in size and 64K
aligned
* Sort #include entries and PCDs
* Change ResetLib documentation and UTMI-related files format to DOS
(remove CheckPatch errors)
* UTMI
- Remove debug info prints improperly marked as "DEBUG_ERROR"
- Break up long prints (over 80 characters), but unbreak format strings
* Rebase on top of the newest opp baseline
Bartosz Szczepanek (2):
Platforms/Marvell: Add MvResetSystemLib
Platforms/Marvell: Enable MvResetSystemLib for A70x0 platform
Jan Dąbroś (3):
Drivers/I2c: Fix enumaration of I2c devices
Platforms/Marvell: Add UtmiPhyLib
Platforms/Marvell: Enable UtmiPhyLib for Armada70x0 Platforms
Documentation/Marvell/PortingGuide/Reset.txt | 7 +
Documentation/Marvell/PortingGuide/Utmi.txt | 35 ++
Drivers/I2c/MvI2cDxe/MvI2cDxe.c | 13 +-
Platforms/Marvell/Armada/Armada.dsc.inc | 3 +-
Platforms/Marvell/Armada/Armada70x0.dsc | 11 +
.../Armada/Library/Armada70x0Lib/Armada70x0Lib.c | 2 +
.../Armada/Library/Armada70x0Lib/Armada70x0Lib.inf | 1 +
Platforms/Marvell/Include/Library/UtmiPhyLib.h | 43 +++
.../Library/ResetSystemLib/MvResetSystemLib.c | 153 +++++++++
.../Library/ResetSystemLib/MvResetSystemLib.inf | 58 ++++
Platforms/Marvell/Library/UtmiPhyLib/UtmiPhyLib.c | 353 +++++++++++++++++++++
Platforms/Marvell/Library/UtmiPhyLib/UtmiPhyLib.h | 110 +++++++
.../Marvell/Library/UtmiPhyLib/UtmiPhyLib.inf | 64 ++++
Platforms/Marvell/Marvell.dec | 11 +
14 files changed, 857 insertions(+), 7 deletions(-)
create mode 100644 Documentation/Marvell/PortingGuide/Reset.txt
create mode 100644 Documentation/Marvell/PortingGuide/Utmi.txt
create mode 100644 Platforms/Marvell/Include/Library/UtmiPhyLib.h
create mode 100644 Platforms/Marvell/Library/ResetSystemLib/MvResetSystemLib.c
create mode 100644 Platforms/Marvell/Library/ResetSystemLib/MvResetSystemLib.inf
create mode 100644 Platforms/Marvell/Library/UtmiPhyLib/UtmiPhyLib.c
create mode 100644 Platforms/Marvell/Library/UtmiPhyLib/UtmiPhyLib.h
create mode 100644 Platforms/Marvell/Library/UtmiPhyLib/UtmiPhyLib.inf
--
1.8.3.1
ARM TZASC-380 IP provides a mechanism to split memory regions being
protected via it into eight equal-sized sub-regions,
with a bit setting allowing the corresponding subregion to be disabled.
Several NXP/FSL SoCs support the TZASC-380 IP block and allow
the DDR connected via the TZASC to be partitioned into regions
having different security settings.
This patch enables this support and can be used for SoCs which
support such partition of DDR regions.
Details of the 'subregion_disable' register can be viewed here:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0431c/CJABCF…
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bhupesh Sharma <bhupesh.sharma(a)nxp.com>
Cc: Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
---
.../Library/ArmVExpressSecLibCTA9x4/CTA9x4Sec.c | 21 ++++++++++++++-------
ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c | 5 +++--
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibCTA9x4/CTA9x4Sec.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibCTA9x4/CTA9x4Sec.c
index 6fa0774..d358d65 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibCTA9x4/CTA9x4Sec.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibCTA9x4/CTA9x4Sec.c
@@ -72,18 +72,21 @@ ArmPlatformSecTrustzoneInit (
// NOR Flash 0 non secure (BootMon)
TZASCSetRegion(ARM_VE_TZASC_BASE,1,TZASC_REGION_ENABLED,
ARM_VE_SMB_NOR0_BASE,0,
- TZASC_REGION_SIZE_64MB, TZASC_REGION_SECURITY_NSRW);
+ TZASC_REGION_SIZE_64MB, TZASC_REGION_SECURITY_NSRW,
+ 0);
// NOR Flash 1. The first half of the NOR Flash1 must be secure for the secure firmware (sec_uefi.bin)
if (PcdGetBool (PcdTrustzoneSupport) == TRUE) {
//Note: Your OS Kernel must be aware of the secure regions before to enable this region
TZASCSetRegion(ARM_VE_TZASC_BASE,2,TZASC_REGION_ENABLED,
ARM_VE_SMB_NOR1_BASE + SIZE_32MB,0,
- TZASC_REGION_SIZE_32MB, TZASC_REGION_SECURITY_NSRW);
+ TZASC_REGION_SIZE_32MB, TZASC_REGION_SECURITY_NSRW,
+ 0);
} else {
TZASCSetRegion(ARM_VE_TZASC_BASE,2,TZASC_REGION_ENABLED,
ARM_VE_SMB_NOR1_BASE,0,
- TZASC_REGION_SIZE_64MB, TZASC_REGION_SECURITY_NSRW);
+ TZASC_REGION_SIZE_64MB, TZASC_REGION_SECURITY_NSRW,
+ 0);
}
// Base of SRAM. Only half of SRAM in Non Secure world
@@ -92,22 +95,26 @@ ArmPlatformSecTrustzoneInit (
//Note: Your OS Kernel must be aware of the secure regions before to enable this region
TZASCSetRegion(ARM_VE_TZASC_BASE,3,TZASC_REGION_ENABLED,
ARM_VE_SMB_SRAM_BASE,0,
- TZASC_REGION_SIZE_16MB, TZASC_REGION_SECURITY_NSRW);
+ TZASC_REGION_SIZE_16MB, TZASC_REGION_SECURITY_NSRW,
+ 0);
} else {
TZASCSetRegion(ARM_VE_TZASC_BASE,3,TZASC_REGION_ENABLED,
ARM_VE_SMB_SRAM_BASE,0,
- TZASC_REGION_SIZE_32MB, TZASC_REGION_SECURITY_NSRW);
+ TZASC_REGION_SIZE_32MB, TZASC_REGION_SECURITY_NSRW,
+ 0);
}
// Memory Mapped Peripherals. All in non secure world
TZASCSetRegion(ARM_VE_TZASC_BASE,4,TZASC_REGION_ENABLED,
ARM_VE_SMB_PERIPH_BASE,0,
- TZASC_REGION_SIZE_64MB, TZASC_REGION_SECURITY_NSRW);
+ TZASC_REGION_SIZE_64MB, TZASC_REGION_SECURITY_NSRW,
+ 0);
// MotherBoard Peripherals and On-chip peripherals.
TZASCSetRegion(ARM_VE_TZASC_BASE,5,TZASC_REGION_ENABLED,
ARM_VE_SMB_MB_ON_CHIP_PERIPH_BASE,0,
- TZASC_REGION_SIZE_256MB, TZASC_REGION_SECURITY_NSRW);
+ TZASC_REGION_SIZE_256MB, TZASC_REGION_SECURITY_NSRW,
+ 0);
}
/**
diff --git a/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c b/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c
index 070c0dc..5cd41ef 100644
--- a/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c
+++ b/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c
@@ -87,7 +87,8 @@ TZASCSetRegion (
IN UINTN LowAddress,
IN UINTN HighAddress,
IN UINTN Size,
- IN UINTN Security
+ IN UINTN Security,
+ IN UINTN SubregionDisableMask
)
{
UINT32* Region;
@@ -100,7 +101,7 @@ TZASCSetRegion (
MmioWrite32((UINTN)(Region), LowAddress&0xFFFF8000);
MmioWrite32((UINTN)(Region+1), HighAddress);
- MmioWrite32((UINTN)(Region+2), ((Security & 0xF) <<28) | ((Size & 0x3F) << 1) | (Enabled & 0x1));
+ MmioWrite32((UINTN)(Region+2), ((Security & 0xF) <<28) | ((SubregionDisableMask & 0xFF) << 8) | ((Size & 0x3F) << 1) | (Enabled & 0x1));
return EFI_SUCCESS;
}
--
1.9.1
Timer interrupt cannot be reported after EDK2 commit 7989300, for GIC
on D02/D03 is not fully ARM GIC compliant. The issue has been fixed on
newer chips so we use a WA for D02 and D03 only.
On D02 and D03, IRQ will be latched in GIC logic except virutal timer
interrupt IRQ #27, so we change to use virtual timer instead of physical
in UEFI.
Change-Id: Ie8eca7e4dea45a3a318ee32783ddaa15363065e2
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo(a)linaro.org>
---
Platforms/Hisilicon/D02/Pv660D02.dsc | 10 ++++++++--
Platforms/Hisilicon/D02/Pv660D02.fdf | 2 +-
Platforms/Hisilicon/D03/D03.dsc | 10 +++++++++-
Platforms/Hisilicon/D03/D03.fdf | 2 +-
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Platforms/Hisilicon/D02/Pv660D02.dsc b/Platforms/Hisilicon/D02/Pv660D02.dsc
index d025bdd..4b4a0b7 100644
--- a/Platforms/Hisilicon/D02/Pv660D02.dsc
+++ b/Platforms/Hisilicon/D02/Pv660D02.dsc
@@ -72,6 +72,13 @@
PlatformBdsLib|OpenPlatformPkg/Chips/Hisilicon/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+## GIC on D02/D03 is not fully ARM GIC compatible: IRQ cannot be cancelled when
+## input signal is deasserted, except for virtual timer interrupt IRQ #27. So
+## we choose to use virutal timer instead of physical one as a workaround.
+## This library instance is to override the one in Pv660.dsc.inc.
+[LibraryClasses.AARCH64]
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.inf
+
[LibraryClasses.common.SEC]
ArmPlatformLib|OpenPlatformPkg/Chips/Hisilicon/Library/ArmPlatformLibPv660/ArmPlatformLibSec.inf
@@ -341,8 +348,7 @@
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- #ArmPkg/Drivers/TimerDxe/TimerDxe
- ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ ArmPkg/Drivers/TimerDxe/TimerDxe.inf
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf
diff --git a/Platforms/Hisilicon/D02/Pv660D02.fdf b/Platforms/Hisilicon/D02/Pv660D02.fdf
index 69be1f1..fa0dc2d 100644
--- a/Platforms/Hisilicon/D02/Pv660D02.fdf
+++ b/Platforms/Hisilicon/D02/Pv660D02.fdf
@@ -195,7 +195,7 @@ READ_LOCK_STATUS = TRUE
#INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
INF ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
#
diff --git a/Platforms/Hisilicon/D03/D03.dsc b/Platforms/Hisilicon/D03/D03.dsc
index 83a18b1..ccf16a2 100644
--- a/Platforms/Hisilicon/D03/D03.dsc
+++ b/Platforms/Hisilicon/D03/D03.dsc
@@ -81,6 +81,14 @@
LpcLib|OpenPlatformPkg/Chips/Hisilicon/Binary/Hi1610/Library/LpcLib/LpcLib.inf
SerialPortLib|OpenPlatformPkg/Chips/Hisilicon/Binary/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.inf
+
+## GIC on D02/D03 is not fully ARM GIC compatible: IRQ cannot be cancelled when
+## input signal is deasserted, except for virtual timer interrupt IRQ #27. So
+## we choose to use virutal timer instead of physical one as a workaround.
+## This library instance is to override the one in Pv660.dsc.inc.
+[LibraryClasses.AARCH64]
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.inf
+
[LibraryClasses.common.SEC]
ArmPlatformLib|OpenPlatformPkg/Chips/Hisilicon/Library/ArmPlatformLibPv660/ArmPlatformLibSec.inf
@@ -396,7 +404,7 @@
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ ArmPkg/Drivers/TimerDxe/TimerDxe.inf
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf
diff --git a/Platforms/Hisilicon/D03/D03.fdf b/Platforms/Hisilicon/D03/D03.fdf
index 8144151..8ba3bd0 100644
--- a/Platforms/Hisilicon/D03/D03.fdf
+++ b/Platforms/Hisilicon/D03/D03.fdf
@@ -187,7 +187,7 @@ READ_LOCK_STATUS = TRUE
# Simple TextIn/TextOut for UEFI Terminal
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
INF ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
--
1.9.1
Timer interrupt cannot be reported after EDK2 commit 7989300, for GIC
on D02/D03 is not fully ARM GIC compliant. The issue has been fixed on
newer chips so we use a WA for D02 and D03 only.
On D02 and D03, IRQ will be latched in GIC logic except virutal timer
interrupt IRQ #27, so we change to use virtual timer instead of physical
in UEFI.
Change-Id: Ie8eca7e4dea45a3a318ee32783ddaa15363065e2
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo(a)linaro.org>
---
Platforms/Hisilicon/D02/Pv660D02.dsc | 10 ++++++++--
Platforms/Hisilicon/D02/Pv660D02.fdf | 2 +-
Platforms/Hisilicon/D03/D03.dsc | 10 +++++++++-
Platforms/Hisilicon/D03/D03.fdf | 2 +-
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/Platforms/Hisilicon/D02/Pv660D02.dsc b/Platforms/Hisilicon/D02/Pv660D02.dsc
index d025bdd..4b4a0b7 100644
--- a/Platforms/Hisilicon/D02/Pv660D02.dsc
+++ b/Platforms/Hisilicon/D02/Pv660D02.dsc
@@ -72,6 +72,13 @@
PlatformBdsLib|OpenPlatformPkg/Chips/Hisilicon/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+## GIC on D02/D03 is not fully ARM GIC compatible: IRQ cannot be cancelled when
+## input signal is deasserted, except for virtual timer interrupt IRQ #27. So
+## we choose to use virutal timer instead of physical one as a workaround.
+## This library instance is to override the one in Pv660.dsc.inc.
+[LibraryClasses.AARCH64]
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.inf
+
[LibraryClasses.common.SEC]
ArmPlatformLib|OpenPlatformPkg/Chips/Hisilicon/Library/ArmPlatformLibPv660/ArmPlatformLibSec.inf
@@ -341,8 +348,7 @@
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- #ArmPkg/Drivers/TimerDxe/TimerDxe
- ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ ArmPkg/Drivers/TimerDxe/TimerDxe.inf
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf
diff --git a/Platforms/Hisilicon/D02/Pv660D02.fdf b/Platforms/Hisilicon/D02/Pv660D02.fdf
index 69be1f1..fa0dc2d 100644
--- a/Platforms/Hisilicon/D02/Pv660D02.fdf
+++ b/Platforms/Hisilicon/D02/Pv660D02.fdf
@@ -195,7 +195,7 @@ READ_LOCK_STATUS = TRUE
#INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
INF ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
#
diff --git a/Platforms/Hisilicon/D03/D03.dsc b/Platforms/Hisilicon/D03/D03.dsc
index 83a18b1..ccf16a2 100644
--- a/Platforms/Hisilicon/D03/D03.dsc
+++ b/Platforms/Hisilicon/D03/D03.dsc
@@ -81,6 +81,14 @@
LpcLib|OpenPlatformPkg/Chips/Hisilicon/Binary/Hi1610/Library/LpcLib/LpcLib.inf
SerialPortLib|OpenPlatformPkg/Chips/Hisilicon/Binary/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.inf
+
+## GIC on D02/D03 is not fully ARM GIC compatible: IRQ cannot be cancelled when
+## input signal is deasserted, except for virtual timer interrupt IRQ #27. So
+## we choose to use virutal timer instead of physical one as a workaround.
+## This library instance is to override the one in Pv660.dsc.inc.
+[LibraryClasses.AARCH64]
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.inf
+
[LibraryClasses.common.SEC]
ArmPlatformLib|OpenPlatformPkg/Chips/Hisilicon/Library/ArmPlatformLibPv660/ArmPlatformLibSec.inf
@@ -396,7 +404,7 @@
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ ArmPkg/Drivers/TimerDxe/TimerDxe.inf
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf
diff --git a/Platforms/Hisilicon/D03/D03.fdf b/Platforms/Hisilicon/D03/D03.fdf
index 8144151..8ba3bd0 100644
--- a/Platforms/Hisilicon/D03/D03.fdf
+++ b/Platforms/Hisilicon/D03/D03.fdf
@@ -187,7 +187,7 @@ READ_LOCK_STATUS = TRUE
# Simple TextIn/TextOut for UEFI Terminal
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
- INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
+ INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
INF ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
--
1.9.1