diff options
author | Ning Yang <yangn0@qq.com> | 2024-04-16 18:19:49 +0800 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2024-04-24 16:41:08 -0500 |
commit | d6afec1859b2a589da52a0d26111affa0b6a1662 (patch) | |
tree | 05aced5a1f09b2db35b4790a29cd2920ee11e36e /bsps | |
parent | validation: Fix typo (diff) | |
download | rtems-master.tar.bz2 |
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.
Diffstat (limited to 'bsps')
-rw-r--r-- | bsps/aarch64/raspberrypi/include/bsp/irq.h | 14 | ||||
-rw-r--r-- | bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h | 9 |
2 files changed, 18 insertions, 5 deletions
diff --git a/bsps/aarch64/raspberrypi/include/bsp/irq.h b/bsps/aarch64/raspberrypi/include/bsp/irq.h index 1ff6ae80de..d493e83707 100644 --- a/bsps/aarch64/raspberrypi/include/bsp/irq.h +++ b/bsps/aarch64/raspberrypi/include/bsp/irq.h @@ -9,6 +9,7 @@ /** * Copyright (c) 2013 Alan Cudmore * Copyright (c) 2022 Mohd Noor Aman + * Copyright (c) 2024 Ning Yang * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -33,15 +34,18 @@ * @brief Interrupt support. */ -#define BCM2835_INTC_TOTAL_IRQ (64 + 8) +#define BCM2835_INTC_TOTAL_IRQ 216 #define BCM2835_IRQ_SET1_MIN 0 #define BCM2835_IRQ_SET2_MIN 32 -#define BCM2835_IRQ_ID_GPU_TIMER_M0 0 -#define BCM2835_IRQ_ID_GPU_TIMER_M1 1 -#define BCM2835_IRQ_ID_GPU_TIMER_M2 2 -#define BCM2835_IRQ_ID_GPU_TIMER_M3 3 +#define BCM2711_IRQ_VC_PERIPHERAL_BASE 96 + +/* Interrupt Vectors: System Timer */ +#define BCM2835_IRQ_ID_GPU_TIMER_M0 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 0) +#define BCM2835_IRQ_ID_GPU_TIMER_M1 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 1) +#define BCM2835_IRQ_ID_GPU_TIMER_M2 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 2) +#define BCM2835_IRQ_ID_GPU_TIMER_M3 (BCM2711_IRQ_VC_PERIPHERAL_BASE + 3) #define BCM2835_IRQ_ID_USB 9 #define BCM2835_IRQ_ID_AUX 29 diff --git a/bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h b/bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h index 55dd9ed1e9..f185d1df57 100644 --- a/bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h +++ b/bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h @@ -8,6 +8,7 @@ /* * Copyright (c) 2022 Mohd Noor Aman + * Copyright (c) 2024 Ning Yang * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -44,6 +45,7 @@ #define BCM2711_REG(x) (*(volatile uint64_t *)(x)) #define BCM2711_BIT(n) (1 << (n)) +#define BCM2835_REG(addr) (*(volatile uint32_t*)(addr)) /** @} */ @@ -198,6 +200,13 @@ #define BCM2711_GPU_TIMER_C2 (BCM2711_GPU_TIMER_BASE + 0x14) #define BCM2711_GPU_TIMER_C3 (BCM2711_GPU_TIMER_BASE + 0x18) +/** + * NOTE: compatible with the BCM2835 system timer + */ +#define BCM2835_GPU_TIMER_CS_M3 BCM2711_GPU_TIMER_CS_M3 +#define BCM2835_GPU_TIMER_C3 BCM2711_GPU_TIMER_C3 +#define BCM2835_GPU_TIMER_CLO BCM2711_GPU_TIMER_CLO +#define BCM2835_GPU_TIMER_CS BCM2711_GPU_TIMER_CS /** @} */ /** |