]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
Get rid of use of old GIC APIs
authorKoan-Sin Tan <koansin.tan@gmail.com>
Mon, 18 Apr 2016 07:17:57 +0000 (15:17 +0800)
committerKoan-Sin Tan <koansin.tan@gmail.com>
Tue, 24 Jan 2017 02:50:14 +0000 (10:50 +0800)
Signed-off-by: Koan-Sin Tan <koansin.tan@gmail.com>
plat/mediatek/mt8173/bl31_plat_setup.c
plat/mediatek/mt8173/include/plat_macros.S
plat/mediatek/mt8173/include/plat_private.h
plat/mediatek/mt8173/include/platform_def.h
plat/mediatek/mt8173/plat_pm.c
plat/mediatek/mt8173/platform.mk

index fa6e00df8fafdb818a4cdf6740c21776fa20220a..92c3494ee5bf0c3d45e62be3b2beeab7bce53772 100644 (file)
@@ -27,7 +27,6 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#include <arm_gic.h>
 #include <assert.h>
 #include <bl_common.h>
 #include <common_def.h>
@@ -37,6 +36,7 @@
 #include <mcucfg.h>
 #include <mmio.h>
 #include <mtcmos.h>
+#include <plat_arm.h>
 #include <plat_private.h>
 #include <platform.h>
 #include <spm.h>
@@ -159,8 +159,8 @@ void bl31_platform_setup(void)
        generic_delay_timer_init();
 
        /* Initialize the gic cpu and distributor interfaces */
-       plat_mt_gic_init();
-       arm_gic_setup();
+       plat_arm_gic_driver_init();
+       plat_arm_gic_init();
 
 #if ENABLE_PLAT_COMPAT
        /* Topologies are best known to the platform. */
index 018a790a745372a6aaf156b364b20e783ecbe01c..f95fd5b4f5c790655ff4315d20ebde635ea2c1b0 100644 (file)
@@ -29,7 +29,8 @@
  */
 
 #include <cci.h>
-#include <gic_v2.h>
+#include <gic_common.h>
+#include <gicv2.h>
 #include <mt8173_def.h>
 
 .section .rodata.gic_reg_name, "aS"
index ae50e449327246829e52a4ff1b497ada45b14b94..9488b88b1c5a94e90d2412daf1fd8a10e4b22d80 100644 (file)
@@ -45,9 +45,6 @@ void plat_cci_init(void);
 void plat_cci_enable(void);
 void plat_cci_disable(void);
 
-/* Declarations for plat_mt_gic.c */
-void plat_mt_gic_init(void);
-
 /* Declarations for plat_topology.c */
 int mt_setup_topology(void);
 
index d06fa22ad7222b8544dce62a3ea7924ab9a1b901..4422e4f301b5dd89ed4aff5b48610e5e76a9dcf7 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef __PLATFORM_DEF_H__
 #define __PLATFORM_DEF_H__
 
+#include "mt8173_def.h"
+
 
 /*******************************************************************************
  * Platform binary types for linking
 #define CACHE_WRITEBACK_SHIFT  6
 #define CACHE_WRITEBACK_GRANULE        (1 << CACHE_WRITEBACK_SHIFT)
 
+
+#define PLAT_ARM_GICD_BASE      BASE_GICD_BASE
+#define PLAT_ARM_GICC_BASE      BASE_GICC_BASE
+
+#define PLAT_ARM_G1S_IRQS       MT_IRQ_SEC_SGI_0, \
+                               MT_IRQ_SEC_SGI_1, \
+                               MT_IRQ_SEC_SGI_2, \
+                               MT_IRQ_SEC_SGI_3, \
+                               MT_IRQ_SEC_SGI_4, \
+                               MT_IRQ_SEC_SGI_5, \
+                               MT_IRQ_SEC_SGI_6, \
+                               MT_IRQ_SEC_SGI_7
+
+#define PLAT_ARM_G0_IRQS
+
 #endif /* __PLATFORM_DEF_H__ */
index 2a0ba827ce1832f485cc9b988a9bbba9aeaab47c..d727967e85d0736ca1b1ca8445f25b1e44b252c2 100644 (file)
  */
 
 #include <arch_helpers.h>
-#include <arm_gic.h>
 #include <assert.h>
 #include <bakery_lock.h>
 #include <cci.h>
 #include <console.h>
 #include <debug.h>
 #include <errno.h>
+#include <gicv2.h>
 #include <mcucfg.h>
 #include <mmio.h>
 #include <mt8173_def.h>
 #include <mt_cpuxgpt.h> /* generic_timer_backup() */
+#include <plat_arm.h>
 #include <plat_private.h>
 #include <power_tracer.h>
 #include <psci.h>
@@ -410,7 +411,7 @@ static void plat_affinst_off(unsigned int afflvl, unsigned int state)
                return;
 
        /* Prevent interrupts from spuriously waking up this cpu */
-       arm_gic_cpuif_deactivate();
+       gicv2_cpuif_disable();
 
        spm_hotplug_off(mpidr);
 
@@ -429,7 +430,7 @@ static void plat_power_domain_off(const psci_power_state_t *state)
        unsigned long mpidr = read_mpidr_el1();
 
        /* Prevent interrupts from spuriously waking up this cpu */
-       arm_gic_cpuif_deactivate();
+       gicv2_cpuif_disable();
 
        spm_hotplug_off(mpidr);
 
@@ -497,7 +498,7 @@ static void plat_affinst_suspend(unsigned long sec_entrypoint,
                generic_timer_backup();
                spm_system_suspend();
                /* Prevent interrupts from spuriously waking up this cpu */
-               arm_gic_cpuif_deactivate();
+               gicv2_cpuif_disable();
        }
 }
 #else
@@ -537,7 +538,7 @@ static void plat_power_domain_suspend(const psci_power_state_t *state)
                generic_timer_backup();
                spm_system_suspend();
                /* Prevent interrupts from spuriously waking up this cpu */
-               arm_gic_cpuif_deactivate();
+               gicv2_cpuif_disable();
        }
 }
 #endif
@@ -566,8 +567,8 @@ static void plat_affinst_on_finish(unsigned int afflvl, unsigned int state)
        }
 
        /* Enable the gic cpu interface */
-       arm_gic_cpuif_setup();
-       arm_gic_pcpu_distif_setup();
+       gicv2_cpuif_enable();
+       gicv2_pcpu_distif_init();
        trace_power_flow(mpidr, CPU_UP);
 }
 #else
@@ -593,8 +594,8 @@ static void plat_power_domain_on_finish(const psci_power_state_t *state)
                return;
 
        /* Enable the gic cpu interface */
-       arm_gic_cpuif_setup();
-       arm_gic_pcpu_distif_setup();
+       gicv2_cpuif_enable();
+       gicv2_pcpu_distif_init();
        trace_power_flow(mpidr, CPU_UP);
 }
 #endif
@@ -615,8 +616,7 @@ static void plat_affinst_suspend_finish(unsigned int afflvl, unsigned int state)
 
        if (afflvl >= MPIDR_AFFLVL2) {
                /* Enable the gic cpu interface */
-               arm_gic_setup();
-               arm_gic_cpuif_setup();
+               plat_arm_gic_init();
                spm_system_suspend_finish();
                enable_scu(mpidr);
        }
@@ -633,7 +633,7 @@ static void plat_affinst_suspend_finish(unsigned int afflvl, unsigned int state)
        if (afflvl < MPIDR_AFFLVL2)
                spm_mcdi_finish_for_on_state(mpidr, afflvl);
 
-       arm_gic_pcpu_distif_setup();
+       gicv2_pcpu_distif_init();
 }
 #else
 static void plat_power_domain_suspend_finish(const psci_power_state_t *state)
@@ -645,8 +645,7 @@ static void plat_power_domain_suspend_finish(const psci_power_state_t *state)
 
        if (MTK_SYSTEM_PWR_STATE(state) == MTK_LOCAL_STATE_OFF) {
                /* Enable the gic cpu interface */
-               arm_gic_setup();
-               arm_gic_cpuif_setup();
+               plat_arm_gic_init();
                spm_system_suspend_finish();
                enable_scu(mpidr);
        }
@@ -665,7 +664,7 @@ static void plat_power_domain_suspend_finish(const psci_power_state_t *state)
                        spm_mcdi_finish_for_on_state(mpidr, MTK_PWR_LVL1);
        }
 
-       arm_gic_pcpu_distif_setup();
+       gicv2_pcpu_distif_init();
 }
 #endif
 
@@ -798,8 +797,7 @@ void mtk_system_pwr_domain_resume(void)
        /* Assert system power domain is available on the platform */
        assert(PLAT_MAX_PWR_LVL >= MTK_PWR_LVL2);
 
-       arm_gic_cpuif_setup();
-       arm_gic_pcpu_distif_setup();
+       plat_arm_gic_init();
 }
 #endif
 
index 54ca47590a5021df1689669e592942a86794fdea..e59125a53244998230716d379fa9911b4016301d 100644 (file)
@@ -33,6 +33,8 @@ MTK_PLAT_SOC          :=      ${MTK_PLAT}/${PLAT}
 
 PLAT_INCLUDES          :=      -I${MTK_PLAT}/common/                           \
                                -I${MTK_PLAT}/common/drivers/uart/              \
+                               -Iinclude/plat/arm/common                       \
+                               -Iinclude/plat/arm/common/aarch64               \
                                -I${MTK_PLAT_SOC}/drivers/crypt/                \
                                -I${MTK_PLAT_SOC}/drivers/mtcmos/               \
                                -I${MTK_PLAT_SOC}/drivers/pmic/                 \
@@ -44,12 +46,13 @@ PLAT_INCLUDES               :=      -I${MTK_PLAT}/common/                           \
 PLAT_BL_COMMON_SOURCES :=      lib/xlat_tables/xlat_tables_common.c            \
                                lib/xlat_tables/aarch64/xlat_tables.c           \
                                plat/common/aarch64/plat_common.c               \
-                               plat/common/plat_gic.c
+                               plat/arm/common/arm_gicv2.c                     \
+                               plat/common/plat_gicv2.c
 
 BL31_SOURCES           +=      drivers/arm/cci/cci.c                           \
-                               drivers/arm/gic/arm_gic.c                       \
-                               drivers/arm/gic/gic_v2.c                        \
-                               drivers/arm/gic/gic_v3.c                        \
+                               drivers/arm/gic/common/gic_common.c             \
+                               drivers/arm/gic/v2/gicv2_main.c                 \
+                               drivers/arm/gic/v2/gicv2_helpers.c              \
                                drivers/console/aarch64/console.S               \
                                drivers/delay_timer/delay_timer.c               \
                                drivers/delay_timer/generic_delay_timer.c       \
@@ -73,7 +76,6 @@ BL31_SOURCES          +=      drivers/arm/cci/cci.c                           \
                                ${MTK_PLAT_SOC}/drivers/spm/spm_mcdi.c          \
                                ${MTK_PLAT_SOC}/drivers/spm/spm_suspend.c       \
                                ${MTK_PLAT_SOC}/drivers/timer/mt_cpuxgpt.c      \
-                               ${MTK_PLAT_SOC}/plat_mt_gic.c                   \
                                ${MTK_PLAT_SOC}/plat_pm.c                       \
                                ${MTK_PLAT_SOC}/plat_sip_calls.c                \
                                ${MTK_PLAT_SOC}/plat_topology.c                 \