forked from Imagelibrary/rtems
bsps/aarch64/raspberrypi: Add system timer support
The clock from the ARM timer is derived from the system clock. This clock can change dynamically e.g. if the system goes into reduced power or in low power mode. Thus the clock speed adapts to the overall system performance capabilities. For accurate timing it is recommended to use the system timers. if BSP_CLOCK_USE_SYSTEMTIMER = 1, use the System Timer, otherwise use the ARM Timer.
This commit is contained in:
@@ -12,9 +12,6 @@ install:
|
||||
source:
|
||||
- bsps/aarch64/include/bsp/linker-symbols.h
|
||||
- bsps/aarch64/include/bsp/start.h
|
||||
- destination: ${BSP_INCLUDEDIR}/dev/clock
|
||||
source:
|
||||
- bsps/include/dev/clock/arm-generic-timer.h
|
||||
- destination: ${BSP_INCLUDEDIR}/dev/irq
|
||||
source:
|
||||
- bsps/aarch64/include/dev/irq/arm-gic-arch.h
|
||||
|
||||
@@ -19,6 +19,10 @@ install:
|
||||
- bsps/aarch64/raspberrypi/include/bsp/irq.h
|
||||
- bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
|
||||
links:
|
||||
- role: build-dependency
|
||||
uid: objclock
|
||||
- role: build-dependency
|
||||
uid: objsystemtimer
|
||||
- role: build-dependency
|
||||
uid: ../grp
|
||||
- role: build-dependency
|
||||
@@ -50,10 +54,8 @@ source:
|
||||
- bsps/aarch64/raspberrypi/start/bspstart.c
|
||||
- bsps/aarch64/raspberrypi/start/bspstarthooks.c
|
||||
- bsps/aarch64/raspberrypi/start/bspstartmmu.c
|
||||
- bsps/aarch64/shared/clock/arm-generic-timer-aarch64.c
|
||||
- bsps/aarch64/shared/cache/cache.c
|
||||
- bsps/aarch64/shared/mmu/vmsav8-64.c
|
||||
- bsps/shared/dev/clock/arm-generic-timer.c
|
||||
- bsps/shared/dev/irq/arm-gicv2.c
|
||||
- bsps/shared/dev/irq/arm-gicv2-get-attributes.c
|
||||
- bsps/shared/dev/serial/console-termios-init.c
|
||||
|
||||
31
spec/build/bsps/aarch64/raspberrypi/objclock.yml
Normal file
31
spec/build/bsps/aarch64/raspberrypi/objclock.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
copyrights:
|
||||
- Copyright (C) 2022 Mohd Noor Aman
|
||||
- Copyright (C) 2023 Utkarsh Verma
|
||||
- Copyright (C) 2024 Ning Yang
|
||||
|
||||
type: build
|
||||
enabled-by:
|
||||
not: BSP_CLOCK_USE_SYSTEMTIMER
|
||||
|
||||
build-type: objects
|
||||
cflags: []
|
||||
cppflags: []
|
||||
cxxflags: []
|
||||
includes: []
|
||||
install:
|
||||
- destination: ${BSP_INCLUDEDIR}/dev/clock
|
||||
source:
|
||||
- bsps/include/dev/clock/arm-generic-timer.h
|
||||
|
||||
source:
|
||||
- bsps/aarch64/shared/clock/arm-generic-timer-aarch64.c
|
||||
- bsps/shared/dev/clock/arm-generic-timer.c
|
||||
|
||||
links:
|
||||
- role: build-dependency
|
||||
uid: ../optgtusevirt
|
||||
- role: build-dependency
|
||||
uid: ../optgtuseps
|
||||
- role: build-dependency
|
||||
uid: optsystemtimer
|
||||
23
spec/build/bsps/aarch64/raspberrypi/objsystemtimer.yml
Normal file
23
spec/build/bsps/aarch64/raspberrypi/objsystemtimer.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
copyrights:
|
||||
- Copyright (C) 2024 Ning Yang
|
||||
|
||||
type: build
|
||||
enabled-by:
|
||||
- BSP_CLOCK_USE_SYSTEMTIMER
|
||||
|
||||
build-type: objects
|
||||
cflags: []
|
||||
cppflags: []
|
||||
cxxflags: []
|
||||
includes: []
|
||||
install: []
|
||||
|
||||
source:
|
||||
- bsps/shared/dev/clock/bcm2835-system-timer.c
|
||||
- bsps/shared/dev/cpucounter/cpucounterfrequency.c
|
||||
- bsps/shared/dev/cpucounter/cpucounterread.c
|
||||
|
||||
links:
|
||||
- role: build-dependency
|
||||
uid: optsystemtimer
|
||||
25
spec/build/bsps/aarch64/raspberrypi/optsystemtimer.yml
Normal file
25
spec/build/bsps/aarch64/raspberrypi/optsystemtimer.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
copyrights:
|
||||
- Copyright (C) 2024 Ning Yang
|
||||
|
||||
type: build
|
||||
build-type: option
|
||||
|
||||
enabled-by: true
|
||||
name: BSP_CLOCK_USE_SYSTEMTIMER
|
||||
description: |
|
||||
The clock from the ARM timer is derived from the system clock. This clock can
|
||||
change dynamically e.g. if the system goes into reduced power or in low power
|
||||
mode. Thus the clock speed adapts to the overall system performance
|
||||
capabilities. For accurate timing it is recommended to use the system timers.
|
||||
|
||||
actions:
|
||||
- get-boolean: null
|
||||
- define-condition: null
|
||||
- env-enable: null
|
||||
default:
|
||||
- enabled-by:
|
||||
- aarch64/raspberrypi4b
|
||||
value: false
|
||||
|
||||
links: []
|
||||
Reference in New Issue
Block a user