2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
9 #include <interrupt_props.h>
11 #include <platform_def.h>
15 static uintptr_t uniphier_rdistif_base_addrs
[PLATFORM_CORE_COUNT
];
17 static const interrupt_prop_t uniphier_interrupt_props
[] = {
21 INTR_PROP_DESC(8, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP0
,
24 INTR_PROP_DESC(14, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP0
,
30 INTR_PROP_DESC(29, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP1S
,
33 INTR_PROP_DESC(9, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP1S
,
36 INTR_PROP_DESC(10, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP1S
,
39 INTR_PROP_DESC(11, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP1S
,
42 INTR_PROP_DESC(12, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP1S
,
45 INTR_PROP_DESC(13, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP1S
,
48 INTR_PROP_DESC(15, GIC_HIGHEST_SEC_PRIORITY
, INTR_GROUP1S
,
52 static unsigned int uniphier_mpidr_to_core_pos(u_register_t mpidr
)
54 return plat_core_pos_by_mpidr(mpidr
);
57 static const struct gicv3_driver_data uniphier_gic_driver_data
[] = {
58 [UNIPHIER_SOC_LD11
] = {
59 .gicd_base
= 0x5fe00000,
60 .gicr_base
= 0x5fe40000,
61 .interrupt_props
= uniphier_interrupt_props
,
62 .interrupt_props_num
= ARRAY_SIZE(uniphier_interrupt_props
),
63 .rdistif_num
= PLATFORM_CORE_COUNT
,
64 .rdistif_base_addrs
= uniphier_rdistif_base_addrs
,
65 .mpidr_to_core_pos
= uniphier_mpidr_to_core_pos
,
67 [UNIPHIER_SOC_LD20
] = {
68 .gicd_base
= 0x5fe00000,
69 .gicr_base
= 0x5fe80000,
70 .interrupt_props
= uniphier_interrupt_props
,
71 .interrupt_props_num
= ARRAY_SIZE(uniphier_interrupt_props
),
72 .rdistif_num
= PLATFORM_CORE_COUNT
,
73 .rdistif_base_addrs
= uniphier_rdistif_base_addrs
,
74 .mpidr_to_core_pos
= uniphier_mpidr_to_core_pos
,
76 [UNIPHIER_SOC_PXS3
] = {
77 .gicd_base
= 0x5fe00000,
78 .gicr_base
= 0x5fe80000,
79 .interrupt_props
= uniphier_interrupt_props
,
80 .interrupt_props_num
= ARRAY_SIZE(uniphier_interrupt_props
),
81 .rdistif_num
= PLATFORM_CORE_COUNT
,
82 .rdistif_base_addrs
= uniphier_rdistif_base_addrs
,
83 .mpidr_to_core_pos
= uniphier_mpidr_to_core_pos
,
87 void uniphier_gic_driver_init(unsigned int soc
)
89 assert(soc
< ARRAY_SIZE(uniphier_gic_driver_data
));
91 gicv3_driver_init(&uniphier_gic_driver_data
[soc
]);
94 void uniphier_gic_init(void)
97 gicv3_rdistif_init(plat_my_core_pos());
98 gicv3_cpuif_enable(plat_my_core_pos());
101 void uniphier_gic_cpuif_enable(void)
103 gicv3_cpuif_enable(plat_my_core_pos());
106 void uniphier_gic_cpuif_disable(void)
108 gicv3_cpuif_disable(plat_my_core_pos());
111 void uniphier_gic_pcpu_init(void)
113 gicv3_rdistif_init(plat_my_core_pos());