|
2 | 2 | * SPDX-License-Identifier: MIT |
3 | 3 | */ |
4 | 4 |
|
5 | | -#define GICD_BASE ( 0xAF000000UL ) /* Base of GIC Distributor on BaseR FVP */ |
6 | | -#define GICR_BASE_PER_CORE( core ) ( 0xAF100000 + (0x20000 * ( core ) ) ) /* Base of GIC Redistributor per core on BaseR FVP */ |
7 | | -#define SGI_BASE ( 0x10000 ) /* SGI Base */ |
8 | | -#define GICD_CTLR ( 0x000 ) /* Distributor Control Register */ |
9 | | -#define GICR_WAKER ( 0x14 ) /* ReDistributor Wake Register */ |
10 | | -#define GICR_PWRR ( 0x24 ) /* ReDistributor Power Register */ |
11 | | -#define GICR_IGROUPR0 ( SGI_BASE + 0x80 ) /* Interrupt Group Registers */ |
12 | | -#define GICR_ISENABLER0 ( SGI_BASE + 0x100 ) /* Interrupt Set-Enable Registers */ |
13 | | -#define GICR_IPRIORITYR( n ) ( SGI_BASE + ( 0x400 + ( 4 * n ) ) ) /* Interrupt Priority Registers */ |
14 | | -#define GICR_IGRPMODR0 ( SGI_BASE + 0xD00 ) /* Distributor Interrupt group modifier Register */ |
| 5 | +#ifndef GIC_H |
| 6 | +#define GIC_H |
15 | 7 |
|
16 | | -#define GICD_CTLR_ENABLEGRP1NS_BIT ( 1U ) /* GICD_CTRL.EnableGrp1NS bit */ |
17 | | -#define GICD_CTLR_ENABLEGRP1S_BIT ( 2U ) /* GICD_CTRL.EnableGrp1S bit */ |
18 | | -#define GICD_CTLR_ARES_BIT ( 4U ) /* GICD_CTRL.ARE_S bit */ |
19 | | -#define GICD_CTLR_DS_BIT ( 6U ) /* GICD_CTRL.DS bit */ |
| 8 | +#include "FreeRTOSConfig.h" |
20 | 9 |
|
21 | | -#define GICR_PWRR_RDPD_BIT ( 0U ) /* GICR_PWRR.RDPD bit */ |
| 10 | +#if ( configNUMBER_OF_CORES == 1 ) |
| 11 | + #define ucPortGetCoreID() ( 0 ) /* Single core system, always core 0 */ |
| 12 | +#endif |
22 | 13 |
|
23 | | -#define GICR_WAKER_PS_BIT ( 1U ) /* GICR_WAKER.PS bit */ |
24 | | -#define GICR_WAKER_CA_BIT ( 2U ) /* GICR_WAKER.CA bit */ |
| 14 | +#define GICD_BASE ( 0xAF000000UL ) /* Base of GIC Distributor on BaseR FVP */ |
| 15 | +#define GICR_BASE_PER_CORE( core ) ( 0xAF100000UL + ( 0x20000UL * ( core ) ) ) /* Base of GIC Redistributor per core on BaseR FVP */ |
| 16 | +#define SGI_BASE ( 0x10000UL ) /* SGI Base */ |
| 17 | +#define GICD_CTLR ( 0x000 ) /* Distributor Control Register */ |
| 18 | +#define GICR_WAKER ( 0x14 ) /* ReDistributor Wake Register */ |
| 19 | +#define GICR_PWRR ( 0x24 ) /* ReDistributor Power Register */ |
| 20 | +#define GICR_IGROUPR0 ( SGI_BASE + 0x80 ) /* Interrupt Group Registers */ |
| 21 | +#define GICR_ISENABLER0 ( SGI_BASE + 0x100 ) /* Interrupt Set-Enable Registers */ |
| 22 | +#define GICR_IPRIORITYR( n ) ( SGI_BASE + ( 0x400 + ( 4 * n ) ) ) /* Interrupt Priority Registers */ |
| 23 | +#define GICR_IGRPMODR0 ( SGI_BASE + 0xD00 ) /* Distributor Interrupt group modifier Register */ |
25 | 24 |
|
26 | | -#define GIC_MAX_INTERRUPT_ID ( 31UL ) /* Maximum Interrupt ID for PPIs and SGIs */ |
27 | | -#define GIC_WAIT_TIMEOUT ( 1000000U ) /* Timeout for waiting on GIC operations */ |
| 25 | +#define GICD_CTLR_ENABLEGRP1NS_BIT ( 1U ) /* GICD_CTRL.EnableGrp1NS bit */ |
| 26 | +#define GICD_CTLR_ENABLEGRP1S_BIT ( 2U ) /* GICD_CTRL.EnableGrp1S bit */ |
| 27 | +#define GICD_CTLR_ARES_BIT ( 4U ) /* GICD_CTRL.ARE_S bit */ |
| 28 | +#define GICD_CTLR_DS_BIT ( 6U ) /* GICD_CTRL.DS bit */ |
| 29 | + |
| 30 | +#define GICR_PWRR_RDPD_BIT ( 0U ) /* GICR_PWRR.RDPD bit */ |
| 31 | + |
| 32 | +#define GICR_WAKER_PS_BIT ( 1U ) /* GICR_WAKER.PS bit */ |
| 33 | +#define GICR_WAKER_CA_BIT ( 2U ) /* GICR_WAKER.CA bit */ |
| 34 | + |
| 35 | +#define GIC_MAX_INTERRUPT_ID ( 31UL ) /* Maximum Interrupt ID for PPIs and SGIs */ |
| 36 | +#define GIC_WAIT_TIMEOUT ( 1000000U ) /* Timeout for waiting on GIC operations */ |
28 | 37 |
|
29 | 38 | /** |
30 | 39 | * Assigns the specified interrupt to Group 1 and enables it |
@@ -66,3 +75,5 @@ void vGIC_SetPriority( uint32_t ulInterruptID, uint32_t ulPriority ); |
66 | 75 | * sets SGI0 to be a Group 1 interrupt, and enables delivery of Group-1 IRQs to EL1. |
67 | 76 | */ |
68 | 77 | void vGIC_SetupSgi0( void ); |
| 78 | + |
| 79 | +#endif /* GIC_H */ |
0 commit comments