All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] branding CA5DS to Corstone-500
@ 2020-11-24 11:36 Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 1/4] arm-bsp: " Abdellatif El Khlifi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Abdellatif El Khlifi @ 2020-11-24 11:36 UTC (permalink / raw)
  To: meta-arm, Lakshmi.Kailasanathan, Ross.Burton; +Cc: nd, Abdellatif El Khlifi

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

The patchset provides the following:

- Branding CA5DS to Corstone-500.
- Upgrading the kernel to v5.3.
- Using Yocto Gatesgarth.
- Upgrading Trusted firmware A to v2.3 with a fix for the system timer issue.
- Upgrading u-boot to 2020.07 with a fix for the generic timer MMIO access issue.

Abdellatif El Khlifi (4):
  arm-bsp: branding CA5DS to Corstone-500
  arm-bsp: use forcevariable override to set Corstone-500 kernel
  arm-bsp/u-boot: enabling the generic timer for Corstone-500
  arm-bsp/trusted-firmware-a: fix the Corstone-500 system timer issue

 meta-arm-bsp/conf/machine/a5ds.conf           | 27 -----------
 meta-arm-bsp/conf/machine/corstone500.conf    | 32 +++++++++++++
 .../documentation/{a5ds.md => corstone500.md} | 12 ++---
 ...inc => trusted-firmware-a-corstone500.inc} |  4 +-
 .../trusted-firmware-a_2.3.bbappend           |  2 +-
 ...g-generic-timer-access-through-MMIO.patch} | 48 +++++++++++++------
 ...002-board-arm-add-corstone500-board.patch} | 19 ++++----
 .../u-boot/u-boot_2020.07.bbappend            |  7 +--
 .../linux/linux-arm-platforms.inc             |  5 +-
 ...-a5ds-Fix-for-the-system-timer-issue.patch | 34 +++++++++++++
 .../trusted-firmware-a_2.3.bb                 |  2 +
 11 files changed, 128 insertions(+), 64 deletions(-)
 delete mode 100644 meta-arm-bsp/conf/machine/a5ds.conf
 create mode 100644 meta-arm-bsp/conf/machine/corstone500.conf
 rename meta-arm-bsp/documentation/{a5ds.md => corstone500.md} (67%)
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-a/{trusted-firmware-a-a5ds.inc => trusted-firmware-a-corstone500.inc} (85%)
 rename meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/{a5ds/0001-armv7-add-mmio-timer.patch => corstone500/0001-armv7-adding-generic-timer-access-through-MMIO.patch} (58%)
 rename meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/{a5ds/0002-board-arm-add-designstart-cortex-a5-board.patch => corstone500/0002-board-arm-add-corstone500-board.patch} (96%)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/files/0001-fdts-a5ds-Fix-for-the-system-timer-issue.patch

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] arm-bsp: branding CA5DS to Corstone-500
  2020-11-24 11:36 [PATCH 0/4] branding CA5DS to Corstone-500 Abdellatif El Khlifi
@ 2020-11-24 11:36 ` Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 2/4] arm-bsp: use forcevariable override to set Corstone-500 kernel Abdellatif El Khlifi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Abdellatif El Khlifi @ 2020-11-24 11:36 UTC (permalink / raw)
  To: meta-arm, Lakshmi.Kailasanathan, Ross.Burton; +Cc: nd, Abdellatif El Khlifi

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

This commit changes the name of CA5DS platform to Corstone-500

Change-Id: I7fc687aea8ce6bba6d7021963ad4cb38f30858d5
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
 .../machine/{a5ds.conf => corstone500.conf}   | 13 +++++--------
 .../documentation/{a5ds.md => corstone500.md} | 12 ++++++------
 ...inc => trusted-firmware-a-corstone500.inc} |  4 ++--
 .../trusted-firmware-a_2.3.bbappend           |  2 +-
 .../0001-armv7-add-mmio-timer.patch           |  0
 ...002-board-arm-add-corstone500-board.patch} | 19 +++++++++++--------
 .../u-boot/u-boot_2020.07.bbappend            |  7 ++++---
 .../linux/linux-arm-platforms.inc             |  5 ++---
 8 files changed, 31 insertions(+), 31 deletions(-)
 rename meta-arm-bsp/conf/machine/{a5ds.conf => corstone500.conf} (64%)
 rename meta-arm-bsp/documentation/{a5ds.md => corstone500.md} (67%)
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-a/{trusted-firmware-a-a5ds.inc => trusted-firmware-a-corstone500.inc} (85%)
 rename meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/{a5ds => corstone500}/0001-armv7-add-mmio-timer.patch (100%)
 rename meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/{a5ds/0002-board-arm-add-designstart-cortex-a5-board.patch => corstone500/0002-board-arm-add-corstone500-board.patch} (96%)

diff --git a/meta-arm-bsp/conf/machine/a5ds.conf b/meta-arm-bsp/conf/machine/corstone500.conf
similarity index 64%
rename from meta-arm-bsp/conf/machine/a5ds.conf
rename to meta-arm-bsp/conf/machine/corstone500.conf
index 8a4b36d..0358f1c 100644
--- a/meta-arm-bsp/conf/machine/a5ds.conf
+++ b/meta-arm-bsp/conf/machine/corstone500.conf
@@ -1,12 +1,10 @@
-# Configuration for Cortex-A5 DesignStart development board
-
 #@TYPE: Machine
-#@NAME: a5ds machine
-#@DESCRIPTION: Machine configuration for Cortex-A5 DesignStart
+#@NAME: Corstone-500 machine
+#@DESCRIPTION: Machine configuration for the Corstone-500 platform
 
 require conf/machine/include/tune-cortexa5.inc
 
-PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
 PREFERRED_VERSION_linux-yocto ?= "5.3%"
 KBUILD_DEFCONFIG = "multi_v7_defconfig"
 KCONFIG_MODE = "--alldefconfig"
@@ -19,9 +17,8 @@ SERIAL_CONSOLES = "115200;ttyAMA0"
 
 IMAGE_FSTYPES += "tar.bz2 cpio.gz"
 
-# Cortex-a5 u-boot configuration
-PREFERRED_VERSION_u-boot ?= "2020.07"
+# Corstone-500 u-boot configuration
 UBOOT_MACHINE = "designstart_ca5_defconfig"
 UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
 UBOOT_IMAGE_LOADADDRESS = "0x84000000"
-
+PREFERRED_VERSION_u-boot ?= "2020.07"
\ No newline at end of file
diff --git a/meta-arm-bsp/documentation/a5ds.md b/meta-arm-bsp/documentation/corstone500.md
similarity index 67%
rename from meta-arm-bsp/documentation/a5ds.md
rename to meta-arm-bsp/documentation/corstone500.md
index 38c719a..92f8a98 100644
--- a/meta-arm-bsp/documentation/a5ds.md
+++ b/meta-arm-bsp/documentation/corstone500.md
@@ -1,19 +1,19 @@
-# Cortex-A5 DesignStart A5DS Platform Support in meta-arm-bsp
+# Corstone-500 Platform Support in meta-arm-bsp
 
 ## Howto Build and Run
 
 ### Configuration:
 In the local.conf file, MACHINE should be set as follow:
-MACHINE ?= "a5ds"
-DISTRO ?= "iota-tiny"
+MACHINE ?= "corstone500"
+DISTRO ?= "poky-tiny"
 
 Or set environment variables with that values:
 
-MACHINE "a5ds"
-DISTRO "iota-tiny"
+MACHINE "corstone500"
+DISTRO "poky-tiny"
 
 ### Build:
-``bash$ bitbake iota-tiny-image```
+``bash$ bitbake arm-reference-image```
 
 ### Run:
 To run the result in a Fixed Virtual Platform please get:
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-a5ds.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone500.inc
similarity index 85%
rename from meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-a5ds.inc
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone500.inc
index d892794..4d3432c 100644
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-a5ds.inc
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-corstone500.inc
@@ -1,6 +1,6 @@
-# Cortex-A5 Designstart specific TFA support
+# Corstone-500 specific TFA support
 
-COMPATIBLE_MACHINE = "a5ds"
+COMPATIBLE_MACHINE = "corstone500"
 TFA_PLATFORM = "a5ds"
 TFA_DEBUG = "1"
 TFA_UBOOT = "1"
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bbappend b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bbappend
index 0e6fb1e..02e69a8 100644
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bbappend
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bbappend
@@ -2,7 +2,7 @@
 
 MACHINE_TFA_REQUIRE ?= ""
 MACHINE_TFA_REQUIRE_tc0 = "trusted-firmware-a-tc0.inc"
-MACHINE_TFA_REQUIRE_a5ds = "trusted-firmware-a-a5ds.inc"
+MACHINE_TFA_REQUIRE_corstone500 = "trusted-firmware-a-corstone500.inc"
 MACHINE_TFA_REQUIRE_foundation-armv8 = "trusted-firmware-a-fvp.inc"
 MACHINE_TFA_REQUIRE_fvp-base = "trusted-firmware-a-fvp.inc"
 MACHINE_TFA_REQUIRE_n1sdp = "trusted-firmware-a-n1sdp.inc"
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/a5ds/0001-armv7-add-mmio-timer.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-add-mmio-timer.patch
similarity index 100%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/a5ds/0001-armv7-add-mmio-timer.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-add-mmio-timer.patch
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/a5ds/0002-board-arm-add-designstart-cortex-a5-board.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0002-board-arm-add-corstone500-board.patch
similarity index 96%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/a5ds/0002-board-arm-add-designstart-cortex-a5-board.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0002-board-arm-add-corstone500-board.patch
index 204bdb3..33e1b15 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/a5ds/0002-board-arm-add-designstart-cortex-a5-board.patch
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0002-board-arm-add-corstone500-board.patch
@@ -1,4 +1,7 @@
-From eed15d394137616a18add204a85b0e9dd5b00e0b Mon Sep 17 00:00:00 2001
+Upstream-Status: Pending [Not submitted to upstream yet]
+Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
+
+From f58e263f575c0520926e4737694e11da31cb4886 Mon Sep 17 00:00:00 2001
 From: Rui Miguel Silva <rui.silva@linaro.org>
 Date: Wed, 8 Jan 2020 09:48:11 +0000
 Subject: [PATCH 2/2] board: arm: add designstart cortex-a5 board
@@ -22,7 +25,7 @@ Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
  create mode 100644 include/configs/designstart_ca5.h
 
 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 54d65f84889f..7bc12f0b4300 100644
+index 54d65f8488..7bc12f0b43 100644
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
 @@ -665,6 +665,12 @@ config ARCH_BCM6858
@@ -48,7 +51,7 @@ index 54d65f84889f..7bc12f0b4300 100644
  source "board/broadcom/bcm28155_ap/Kconfig"
 diff --git a/board/armltd/designstart/Kconfig b/board/armltd/designstart/Kconfig
 new file mode 100644
-index 000000000000..a9564e8655e2
+index 0000000000..a9564e8655
 --- /dev/null
 +++ b/board/armltd/designstart/Kconfig
 @@ -0,0 +1,12 @@
@@ -66,7 +69,7 @@ index 000000000000..a9564e8655e2
 +endif
 diff --git a/board/armltd/designstart/Makefile b/board/armltd/designstart/Makefile
 new file mode 100644
-index 000000000000..d2dc2b74ed85
+index 0000000000..d2dc2b74ed
 --- /dev/null
 +++ b/board/armltd/designstart/Makefile
 @@ -0,0 +1,8 @@
@@ -80,7 +83,7 @@ index 000000000000..d2dc2b74ed85
 +obj-y := designstart.o
 diff --git a/board/armltd/designstart/designstart.c b/board/armltd/designstart/designstart.c
 new file mode 100644
-index 000000000000..658057a00330
+index 0000000000..658057a003
 --- /dev/null
 +++ b/board/armltd/designstart/designstart.c
 @@ -0,0 +1,49 @@
@@ -135,7 +138,7 @@ index 000000000000..658057a00330
 +
 diff --git a/configs/designstart_ca5_defconfig b/configs/designstart_ca5_defconfig
 new file mode 100644
-index 000000000000..a2a756740295
+index 0000000000..a2a7567402
 --- /dev/null
 +++ b/configs/designstart_ca5_defconfig
 @@ -0,0 +1,37 @@
@@ -178,7 +181,7 @@ index 000000000000..a2a756740295
 +
 diff --git a/include/configs/designstart_ca5.h b/include/configs/designstart_ca5.h
 new file mode 100644
-index 000000000000..6db5b1cf4ac2
+index 0000000000..6db5b1cf4a
 --- /dev/null
 +++ b/include/configs/designstart_ca5.h
 @@ -0,0 +1,122 @@
@@ -305,5 +308,5 @@ index 000000000000..6db5b1cf4ac2
 +#define CONFIG_ENV_IS_IN_FLASH                1
 +#endif
 -- 
-2.28.0
+2.17.1
 
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend
index c1f8b01..c4bd3d2 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend
@@ -6,10 +6,11 @@ FILESEXTRAPATHS_prepend_fvp-base = "${THIS_DIR}/${BP}/fvp-common:"
 FILESEXTRAPATHS_prepend_foundation-armv8 = "${THIS_DIR}/${BP}/fvp-common:"
 
 #
-# Cortex-A5 DesignStart KMACHINE
+# Corstone-500 MACHINE
 #
-SRC_URI_append_a5ds = " file://0001-armv7-add-mmio-timer.patch \
-                        file://0002-board-arm-add-designstart-cortex-a5-board.patch"
+SRC_URI_append_corstone500 = " \
+                   file://0001-armv7-add-mmio-timer.patch \
+                   file://0002-board-arm-add-corstone500-board.patch"
 
 #
 # FVP FOUNDATION KMACHINE
diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc b/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc
index 62b1dec..5d71bab 100644
--- a/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc
+++ b/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc
@@ -18,10 +18,9 @@ SRC_URI_append_gem5-arm64 = " ${SRC_URI_KMETA}"
 SRCREV_arm-platforms-kmeta = "6147e82375aa9df8f2a162d42ea6406c79c854c5"
 
 #
-# Cortex-A5 DesignStart KMACHINE
+# Corstone-500 KMACHINE
 #
-COMPATIBLE_MACHINE_a5ds = "a5ds"
-KMACHINE_a5ds = "a5ds"
+COMPATIBLE_MACHINE_corstone500 = "corstone500"
 
 #
 # FVP FOUNDATION KMACHINE
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] arm-bsp: use forcevariable override to set Corstone-500 kernel
  2020-11-24 11:36 [PATCH 0/4] branding CA5DS to Corstone-500 Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 1/4] arm-bsp: " Abdellatif El Khlifi
@ 2020-11-24 11:36 ` Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 3/4] arm-bsp/u-boot: enabling the generic timer for Corstone-500 Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 4/4] arm-bsp/trusted-firmware-a: fix the Corstone-500 system timer issue Abdellatif El Khlifi
  3 siblings, 0 replies; 5+ messages in thread
From: Abdellatif El Khlifi @ 2020-11-24 11:36 UTC (permalink / raw)
  To: meta-arm, Lakshmi.Kailasanathan, Ross.Burton; +Cc: nd, Abdellatif El Khlifi

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

Corstone-500 is built against poky-tiny distro.
poky-tiny sets PREFERRED_PROVIDER_virtual/kernel to linux-yocto-tiny.
Since distro config is evaluated after the machine config, we need to
use the strongest override possible (forcevariable) so the
PREFERRED_PROVIDER_virtual/kernel specified in the machine config will
apply.

Change-Id: Iafa9209bf39cf63e83faa6eefa2a442513992290
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
 meta-arm-bsp/conf/machine/corstone500.conf | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta-arm-bsp/conf/machine/corstone500.conf b/meta-arm-bsp/conf/machine/corstone500.conf
index 0358f1c..ec1d9e2 100644
--- a/meta-arm-bsp/conf/machine/corstone500.conf
+++ b/meta-arm-bsp/conf/machine/corstone500.conf
@@ -4,7 +4,15 @@
 
 require conf/machine/include/tune-cortexa5.inc
 
-PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+#
+# Corstone-500 is built against poky-tiny distro.
+# poky-tiny sets PREFERRED_PROVIDER_virtual/kernel to linux-yocto-tiny.
+# Since distro config is evaluated after the machine config, we need to
+# use the strongest override possible (forcevariable) so the
+# PREFERRED_PROVIDER_virtual/kernel specified in the machine config will
+# apply.
+#
+PREFERRED_PROVIDER_virtual/kernel_forcevariable = "linux-yocto"
 PREFERRED_VERSION_linux-yocto ?= "5.3%"
 KBUILD_DEFCONFIG = "multi_v7_defconfig"
 KCONFIG_MODE = "--alldefconfig"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] arm-bsp/u-boot: enabling the generic timer for Corstone-500
  2020-11-24 11:36 [PATCH 0/4] branding CA5DS to Corstone-500 Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 1/4] arm-bsp: " Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 2/4] arm-bsp: use forcevariable override to set Corstone-500 kernel Abdellatif El Khlifi
@ 2020-11-24 11:36 ` Abdellatif El Khlifi
  2020-11-24 11:36 ` [PATCH 4/4] arm-bsp/trusted-firmware-a: fix the Corstone-500 system timer issue Abdellatif El Khlifi
  3 siblings, 0 replies; 5+ messages in thread
From: Abdellatif El Khlifi @ 2020-11-24 11:36 UTC (permalink / raw)
  To: meta-arm, Lakshmi.Kailasanathan, Ross.Burton; +Cc: nd, Abdellatif El Khlifi

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

This commit updates the ARMv7 generic timer driver by configuring
and enabling the timer.

Change-Id: I1fc1df83f40e28869d8dd41ff7b202f6fa177a1f
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
 ...g-generic-timer-access-through-MMIO.patch} | 48 +++++++++++++------
 .../u-boot/u-boot_2020.07.bbappend            |  2 +-
 2 files changed, 35 insertions(+), 15 deletions(-)
 rename meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/{0001-armv7-add-mmio-timer.patch => 0001-armv7-adding-generic-timer-access-through-MMIO.patch} (58%)

diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-add-mmio-timer.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-adding-generic-timer-access-through-MMIO.patch
similarity index 58%
rename from meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-add-mmio-timer.patch
rename to meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-adding-generic-timer-access-through-MMIO.patch
index e59afea..8ba35be 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-add-mmio-timer.patch
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/corstone500/0001-armv7-adding-generic-timer-access-through-MMIO.patch
@@ -1,21 +1,33 @@
-From 4449a6c2de38bdeb09e3158f6d9318812966243a Mon Sep 17 00:00:00 2001
+Upstream-Status: Pending [Not submitted to upstream yet]
+Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
+
+From b6879fc62b5ec01e3c87c2772d3a5e0f51c35f1c Mon Sep 17 00:00:00 2001
 From: Rui Miguel Silva <rui.silva@linaro.org>
 Date: Wed, 18 Dec 2019 21:52:34 +0000
-Subject: [PATCH 1/2] armv7: add mmio timer
+Subject: [PATCH] armv7: adding generic timer access through MMIO
+
+This driver enables the ARMv7 generic timer.
+
+The access to the timer registers is through memory mapping (MMIO).
+
+This driver can be used by u-boot to access to the timer through MMIO
+when arch_timer is not available in the core (access using system
+instructions not possible), for example, in case of Cortex-A5.
 
-This timer can be used by u-boot when arch-timer is not available in
-core, for example, Cortex-A5.
+This driver configures and enables the generic timer at
+the u-boot initcall level (timer_init) before u-boot relocation.
 
 Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
+Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
 ---
  arch/arm/cpu/armv7/Makefile     |  1 +
- arch/arm/cpu/armv7/mmio_timer.c | 56 +++++++++++++++++++++++++++++++++
+ arch/arm/cpu/armv7/mmio_timer.c | 64 +++++++++++++++++++++++++++++++++
  scripts/config_whitelist.txt    |  1 +
- 3 files changed, 58 insertions(+)
+ 3 files changed, 66 insertions(+)
  create mode 100644 arch/arm/cpu/armv7/mmio_timer.c
 
 diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
-index 8c955d0d5284..82af9c031277 100644
+index 8c955d0d52..82af9c0312 100644
 --- a/arch/arm/cpu/armv7/Makefile
 +++ b/arch/arm/cpu/armv7/Makefile
 @@ -28,6 +28,7 @@ obj-$(CONFIG_ARMV7_PSCI)	+= psci.o psci-common.o
@@ -28,10 +40,10 @@ index 8c955d0d5284..82af9c031277 100644
  obj-y += s5p-common/
 diff --git a/arch/arm/cpu/armv7/mmio_timer.c b/arch/arm/cpu/armv7/mmio_timer.c
 new file mode 100644
-index 000000000000..5d6f66172398
+index 0000000000..82ff3937b6
 --- /dev/null
 +++ b/arch/arm/cpu/armv7/mmio_timer.c
-@@ -0,0 +1,56 @@
+@@ -0,0 +1,64 @@
 +// SPDX-License-Identifier: GPL-2.0+
 +/*
 + * Copyright (c) 2019, Arm Limited. All rights reserved.
@@ -47,22 +59,30 @@ index 000000000000..5d6f66172398
 +
 +#define CNTCTLBASE    0x1a020000UL
 +#define CNTREADBASE   0x1a030000UL
++#define CNTEN         (1 << 0)
++#define CNTFCREQ      (1 << 8)
 +
 +static inline uint32_t mmio_read32(uintptr_t addr)
 +{
 +      return *(volatile uint32_t*)addr;
 +}
 +
-+int timer_init(void)
++static inline void mmio_write32(uintptr_t addr, uint32_t data)
 +{
-+      gd->arch.timer_rate_hz = mmio_read32(CNTCTLBASE);
++      *(volatile uint32_t*)addr = data;
++}
 +
++int timer_init(void)
++{
++      gd->arch.timer_rate_hz = COUNTER_FREQUENCY / CONFIG_SYS_HZ; /* calculating the frequency in ms */
++      mmio_write32(CNTCTLBASE + 0x20, COUNTER_FREQUENCY); /* configuring CNTFID0 register: setting the base frequency */
++      mmio_write32(CNTCTLBASE, CNTFCREQ | CNTEN); /* configuring CNTCR register: enabling the generic counter and selecting the first frequency entry */
 +      return 0;
 +}
 +
 +unsigned long long get_ticks(void)
 +{
-+      return ((mmio_read32(CNTCTLBASE + 0x4) << 32) |
++      return ((mmio_read32(CNTREADBASE + 0x4) << 32) |
 +              mmio_read32(CNTREADBASE));
 +}
 +
@@ -89,7 +109,7 @@ index 000000000000..5d6f66172398
 +      return gd->arch.timer_rate_hz;
 +}
 diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
-index 916768f361d9..c8fd8c6e355a 100644
+index 916768f361..c8fd8c6e35 100644
 --- a/scripts/config_whitelist.txt
 +++ b/scripts/config_whitelist.txt
 @@ -3075,6 +3075,7 @@ CONFIG_SYS_MMC_U_BOOT_DST
@@ -101,5 +121,5 @@ index 916768f361d9..c8fd8c6e355a 100644
  CONFIG_SYS_MONITOR_BASE
  CONFIG_SYS_MONITOR_BASE_EARLY
 -- 
-2.28.0
+2.17.1
 
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend
index c4bd3d2..1a1df27 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_2020.07.bbappend
@@ -9,7 +9,7 @@ FILESEXTRAPATHS_prepend_foundation-armv8 = "${THIS_DIR}/${BP}/fvp-common:"
 # Corstone-500 MACHINE
 #
 SRC_URI_append_corstone500 = " \
-                   file://0001-armv7-add-mmio-timer.patch \
+                   file://0001-armv7-adding-generic-timer-access-through-MMIO.patch \
                    file://0002-board-arm-add-corstone500-board.patch"
 
 #
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] arm-bsp/trusted-firmware-a: fix the Corstone-500 system timer issue
  2020-11-24 11:36 [PATCH 0/4] branding CA5DS to Corstone-500 Abdellatif El Khlifi
                   ` (2 preceding siblings ...)
  2020-11-24 11:36 ` [PATCH 3/4] arm-bsp/u-boot: enabling the generic timer for Corstone-500 Abdellatif El Khlifi
@ 2020-11-24 11:36 ` Abdellatif El Khlifi
  3 siblings, 0 replies; 5+ messages in thread
From: Abdellatif El Khlifi @ 2020-11-24 11:36 UTC (permalink / raw)
  To: meta-arm, Lakshmi.Kailasanathan, Ross.Burton
  Cc: nd, Abdellatif El Khlifi, lakshmi Kailasanathan

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

This commit applies the TF-A fix allowing to use the right FPGA system
timer clock frequency for Corstone-500.

Change-Id: Iaa09d33eb76d9b2b74cb3400897c8cc0e3c694db
Signed-off-by: lakshmi Kailasanathan <lakshmi.Kailasanathan@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
 ...-a5ds-Fix-for-the-system-timer-issue.patch | 34 +++++++++++++++++++
 .../trusted-firmware-a_2.3.bb                 |  2 ++
 2 files changed, 36 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/files/0001-fdts-a5ds-Fix-for-the-system-timer-issue.patch

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-fdts-a5ds-Fix-for-the-system-timer-issue.patch b/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-fdts-a5ds-Fix-for-the-system-timer-issue.patch
new file mode 100644
index 0000000..212eacd
--- /dev/null
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-fdts-a5ds-Fix-for-the-system-timer-issue.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Backport [e3c152d1156af8a4b6453376454ecdceaf81704c]
+Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
+
+From e3c152d1156af8a4b6453376454ecdceaf81704c Mon Sep 17 00:00:00 2001
+From: lakshmi Kailasanathan <lakshmi.Kailasanathan@arm.com>
+Date: Fri, 17 Apr 2020 12:52:19 +0100
+Subject: [PATCH] fdts: a5ds: Fix for the system timer issue.
+
+A5DS FPGA system timer clock frequency is 7.5Mhz.
+The dt is file updated inline with the hardware
+clock frequency.
+
+Change-Id: I3f6c2e0d4a7b293175a42cf398a8730448504af9
+Signed-off-by: lakshmi Kailasanathan <lakshmi.Kailasanathan@arm.com>
+---
+ fdts/a5ds.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fdts/a5ds.dts b/fdts/a5ds.dts
+index 7334c4559..c6f5be6fa 100644
+--- a/fdts/a5ds.dts
++++ b/fdts/a5ds.dts
+@@ -128,7 +128,7 @@
+ 		#size-cells = <1>;
+ 		ranges;
+ 		reg = <0x1a040000 0x1000>;
+-		clock-frequency = <50000000>;
++		clock-frequency = <7500000>;
+ 
+ 		frame@1a050000 {
+ 			frame-number = <0>;
+-- 
+2.17.1
+
diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
index 6c8308a..745ee70 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
@@ -12,6 +12,8 @@ SRCREV_tfa = "ecd27ad85f1eba29f6bf92c39dc002c85b07dad5"
 
 LIC_FILES_CHKSUM += "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
 
+SRC_URI += "file://0001-fdts-a5ds-Fix-for-the-system-timer-issue.patch"
+
 #
 # mbed TLS source
 # Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-24 11:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 11:36 [PATCH 0/4] branding CA5DS to Corstone-500 Abdellatif El Khlifi
2020-11-24 11:36 ` [PATCH 1/4] arm-bsp: " Abdellatif El Khlifi
2020-11-24 11:36 ` [PATCH 2/4] arm-bsp: use forcevariable override to set Corstone-500 kernel Abdellatif El Khlifi
2020-11-24 11:36 ` [PATCH 3/4] arm-bsp/u-boot: enabling the generic timer for Corstone-500 Abdellatif El Khlifi
2020-11-24 11:36 ` [PATCH 4/4] arm-bsp/trusted-firmware-a: fix the Corstone-500 system timer issue Abdellatif El Khlifi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.