MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / platform_get_gic_redist_base

Function platform_get_gic_redist_base

bsp/phytium/board/phytium_cpu.h:55–96  ·  view source on GitHub ↗

the basic constants and interfaces needed by gic */

Source from the content-addressed store, hash-verified

53
54/* the basic constants and interfaces needed by gic */
55rt_inline uintptr_t platform_get_gic_redist_base(void)
56{
57 uintptr_t redis_base, mpidr_aff, gicr_typer_aff;
58 mpidr_aff = (uintptr_t)(GetAffinity() & CORE_AFF_MASK);
59
60 for (redis_base = GICV3_RD_BASE_ADDR; redis_base < GICV3_RD_BASE_ADDR + GICV3_RD_SIZE; redis_base += GICV3_RD_OFFSET)
61 {
62#ifdef RT_USING_SMART
63 uintptr_t redis_base_virtual = (uintptr_t)rt_ioremap((void *)redis_base, GICV3_RD_OFFSET);
64 rt_hw_tlb_invalidate_all();
65 if (redis_base_virtual == 0)
66 {
67 continue;
68 }
69#if defined(TARGET_ARMV8_AARCH64)
70 gicr_typer_aff = GIC_RDIST_TYPER(redis_base_virtual) >> 32;
71#else
72 gicr_typer_aff = GIC_RDIST_TYPER(redis_base_virtual + 0x4);
73#endif
74 if (mpidr_aff == gicr_typer_aff)
75 {
76 return redis_base_virtual;
77 }
78 else
79 {
80 rt_iounmap(redis_base_virtual);
81 }
82#else
83#if defined(TARGET_ARMV8_AARCH64)
84 gicr_typer_aff = GIC_RDIST_TYPER(redis_base) >> 32;
85#else
86 gicr_typer_aff = GIC_RDIST_TYPER(redis_base + 0x4);
87#endif
88 if (mpidr_aff == gicr_typer_aff)
89 {
90 return redis_base;
91 }
92#endif
93 }
94
95 return 0;
96}
97
98
99#if defined(TARGET_ARMV8_AARCH64)

Callers 5

phytium_interrupt_initFunction · 0.85
rt_hw_board_aarch32_initFunction · 0.85
secondary_cpu_c_startFunction · 0.85
rt_hw_interrupt_initFunction · 0.85

Calls 3

rt_ioremapFunction · 0.85
rt_iounmapFunction · 0.85
rt_hw_tlb_invalidate_allFunction · 0.50

Tested by

no test coverage detected