diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/clock/arm/armv7-a/cortex-a9/imx6q-sabrelite/clock.c b/Ubiquitous/XiZi_AIoT/hardkernel/clock/arm/armv7-a/cortex-a9/imx6q-sabrelite/clock.c index 2ac07efe0..123093c1d 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/clock/arm/armv7-a/cortex-a9/imx6q-sabrelite/clock.c +++ b/Ubiquitous/XiZi_AIoT/hardkernel/clock/arm/armv7-a/cortex-a9/imx6q-sabrelite/clock.c @@ -34,13 +34,30 @@ Modification: #include "clock_common_op.h" #include "irq_numbers.h" +#include "multicores.h" static void _sys_clock_init() { uint32_t freq = get_main_clock(IPG_CLK); gpt_init(CLKSRC_IPG_CLK, freq / 1000000, RESTART_MODE, WAIT_MODE_EN | STOP_MODE_EN); - gpt_set_compare_event(kGPTOutputCompare1, OUTPUT_CMP_DISABLE, 1000); - gpt_counter_enable(kGPTOutputCompare1); + switch (cur_cpuid()) { + case 0: + gpt_set_compare_event(kGPTOutputCompare1, OUTPUT_CMP_DISABLE, 1000); + gpt_counter_enable(kGPTOutputCompare1); + break; + case 1: + gpt_set_compare_event(kGPTOutputCompare2, OUTPUT_CMP_DISABLE, 1000); + gpt_counter_enable(kGPTOutputCompare2); + break; + case 2: + gpt_set_compare_event(kGPTOutputCompare3, OUTPUT_CMP_DISABLE, 1000); + gpt_counter_enable(kGPTOutputCompare3); + break; + case 3: + gpt_set_compare_event(kGPTOutputCompare1, OUTPUT_CMP_DISABLE, 1000); + gpt_counter_enable(kGPTOutputCompare1); + break; + } } static uint32_t _get_clock_int() diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/intr/Makefile b/Ubiquitous/XiZi_AIoT/hardkernel/intr/Makefile index 7e69489a2..b199fd1e3 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/intr/Makefile +++ b/Ubiquitous/XiZi_AIoT/hardkernel/intr/Makefile @@ -1,3 +1,4 @@ SRC_DIR := arm/armv7-a/cortex-a9 +SRC_FILES := spinlock.c include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/intr/arm/armv7-a/cortex-a9/Makefile b/Ubiquitous/XiZi_AIoT/hardkernel/intr/arm/armv7-a/cortex-a9/Makefile index 8ea2c7e2f..ebcd0d1ff 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/intr/arm/armv7-a/cortex-a9/Makefile +++ b/Ubiquitous/XiZi_AIoT/hardkernel/intr/arm/armv7-a/cortex-a9/Makefile @@ -1,5 +1,5 @@ -SRC_FILES := vector.S trampoline.S $(BOARD)/trap_common.c error_debug.c spinlock.c hard_spinlock.S +SRC_FILES := vector.S trampoline.S $(BOARD)/trap_common.c error_debug.c hard_spinlock.S ifeq ($(BOARD), imx6q-sabrelite) SRC_DIR := gicv2 @@ -9,7 +9,6 @@ ifeq ($(BOARD), zynq7000-zc702) # SRC_DIR := gicv2 SRC_DIR := gicv3 SRC_FILES += $(BOARD)/xil_assert.c -# SRC_FILES := vector.S trampoline.S imx6q-sabrelite/trap_common.c error_debug.c spinlock.c hard_spinlock.S endif diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/intr/arm/armv7-a/cortex-a9/spinlock.c b/Ubiquitous/XiZi_AIoT/hardkernel/intr/spinlock.c similarity index 99% rename from Ubiquitous/XiZi_AIoT/hardkernel/intr/arm/armv7-a/cortex-a9/spinlock.c rename to Ubiquitous/XiZi_AIoT/hardkernel/intr/spinlock.c index 05098c6d1..210edfabd 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/intr/arm/armv7-a/cortex-a9/spinlock.c +++ b/Ubiquitous/XiZi_AIoT/hardkernel/intr/spinlock.c @@ -19,13 +19,12 @@ #include #include -#include "assert.h" -#include "multicores.h" #include "spinlock.h" -#include "task.h" #include "trap_common.h" +#include "assert.h" #include "list.h" +#include "multicores.h" struct lock_node { int cpu_id;