Skip to content

Commit 596b0c4

Browse files
committed
kernel/nortos/dpl/a53: fix gic for xen
- Change GIC address as the vGIC in Xen is at 0x30010000 - Remove SGI_PPI stuff as Xen does not support it Signed-off-by: Amneesh Singh <[email protected]>
1 parent eb9eda3 commit 596b0c4

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

source/drivers/.meta/system/system_config.c.xdt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,15 @@ void System_init(void)
7979
`system.getTemplate(sciclientInitTemplate)()`
8080
% }
8181

82+
#ifndef XEN_ENABLED
8283
`system.getTemplate("/kernel/dpl/pmu_init.c.xdt")()`
8384

8485
PowerClock_init();
8586
/* Now we can do pinmux */
8687
Pinmux_init();
8788
/* finally we initialize all peripheral drivers */
89+
#endif
90+
8891
% let driverOrder = system.getScript('/common').getDriverOpenOrder();
8992
% let orderedTemplates = [];
9093
% let otherTemplates = [];

source/kernel/nortos/dpl/a53/HwiP_armv8_gic.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,15 @@ void HwiP_init()
337337
/* Initialize the GIC V3 */
338338
CSL_gic500_gicdRegs *gicdRegs = (CSL_gic500_gicdRegs *)(HWIP_GIC_BASE_ADDR);
339339
CSL_gic500_gicrRegs_core_control *gicrRegs;
340+
#ifndef XEN_ENABLED
340341
CSL_gic500_gicrRegs_core_sgi_ppi *gicsRegs;
342+
#endif
341343

342344
/* update the redistributor and sgi_ppi address */
343345
gicrRegs = (CSL_gic500_gicrRegs_core_control *) (HWIP_GIC_BASE_ADDR + CSL_GIC500_GICR_CORE_CONTROL_CTLR(coreId));
346+
#ifndef XEN_ENABLED
344347
gicsRegs = (CSL_gic500_gicrRegs_core_sgi_ppi *) ((uintptr_t)gicrRegs + (uintptr_t) 0x10000U);
348+
#endif
345349

346350
/* Initialize the Interrupt controller */
347351
{
@@ -363,7 +367,9 @@ void HwiP_init()
363367
/*
364368
* Disable all interrupts at startup
365369
*/
370+
#ifndef XEN_ENABLED
366371
gicsRegs->ICENABLER0 = 0xFFFFFFFF;
372+
#endif
367373

368374
if(0 == coreId)
369375
{
@@ -384,7 +390,9 @@ void HwiP_init()
384390
}
385391

386392
/* Search for any previously active interrupts and acknowledge them */
393+
#ifndef XEN_ENABLED
387394
intrActiveReg = gicsRegs->ICACTIVER0;
395+
#endif
388396
if (intrActiveReg)
389397
{
390398
for (j = 0; j < HWIP_GICD_SGI_PPI_INTR_ID_MAX; j++)
@@ -420,7 +428,9 @@ void HwiP_init()
420428
/*
421429
* Clear any currently pending enabled interrupts
422430
*/
431+
#ifndef XEN_ENABLED
423432
gicsRegs->ICPENDR0 = 0xFFFFFFFF;
433+
#endif
424434
if(0 == coreId)
425435
{
426436
for (i = 0; i < HWIP_GICD_SPI_INTR_COUNT_MAX/32; i++)
@@ -432,7 +442,9 @@ void HwiP_init()
432442
/*
433443
* Clear all interrupt active status registers
434444
*/
445+
#ifndef XEN_ENABLED
435446
gicsRegs->ICACTIVER0 = 0xFFFFFFFF;
447+
#endif
436448
if(0 == coreId)
437449
{
438450
for (i = 0; i < HWIP_GICD_SPI_INTR_COUNT_MAX/32; i++)
@@ -467,7 +479,9 @@ void HwiP_init()
467479
*/
468480
for (i = 0; i < HWIP_GICD_SGI_PPI_INTR_ID_MAX/4; i++)
469481
{
482+
#ifndef XEN_ENABLED
470483
gicsRegs->IPRIORITYR[i]=0x20202020;
484+
#endif
471485
}
472486
if(0 == coreId)
473487
{
@@ -499,7 +513,9 @@ void HwiP_init()
499513
* b00 Interrupt is active-High level-sensitive
500514
* b10 Interrupt is rising edge-sensitive
501515
*/
516+
#ifndef XEN_ENABLED
502517
gicsRegs->ICFGR1 = 0;
518+
#endif
503519
if(0 == coreId)
504520
{
505521
for (i = 0; i < HWIP_GICD_SPI_INTR_COUNT_MAX/16; i++)

source/kernel/nortos/dpl/a53/HwiP_armv8_gic.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ extern "C"
5353
#define HWIP_GICD_SPI_INTR_COUNT_MAX (960U)
5454
#define HwiP_MAX_INTERRUPTS (1024u)
5555

56+
#ifndef XEN_ENABLED
5657
#define HWIP_GIC_BASE_ADDR (0x1800000UL)
58+
#else
59+
#define HWIP_GIC_BASE_ADDR (0x3001000UL)
60+
#endif
5761

5862
#define HWIP_GIC_DEFAULT_PRIORITY ((uint32_t) 0x9U)
5963

source/kernel/nortos/dpl/a53/boot_armv8_asm.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
.global CacheP_disableEL3
4444
.global HwiP_armv8GetGicxAddr
4545

46+
#ifndef XEN_ENABLED
4647
#define HWIP_GIC_BASE_ADDR (0x1800000U)
48+
#else
49+
#define HWIP_GIC_BASE_ADDR (0x3001000U)
50+
#endif
4751

4852
#ifdef SOC_AM62AX
4953
#include <kernel/nortos/dpl/a53/soc/gic_base_address_am62a.h>

0 commit comments

Comments
 (0)