diff options
author | Jun Nie <jun.nie@linaro.org> | 2018-08-28 09:51:11 +0800 |
---|---|---|
committer | Jun Nie <jun.nie@linaro.org> | 2018-08-28 09:59:22 +0800 |
commit | f9b9224ca035062e166c269d940705c300e4f58e (patch) | |
tree | d266f4e2da69643840f2fc17db2522f4366261e2 | |
parent | d09152b2aedcc5985a16b1b3bde5ecf9124294c6 (diff) |
warp7: register platform timer
register nxp timer as platform timer to provide timeout interrupt service.
Signed-off-by: Jun Nie <jun.nie@linaro.org>
-rw-r--r-- | plat/nxp/board/warp7/include/platform_def.h | 4 | ||||
-rw-r--r-- | plat/nxp/board/warp7/platform.mk | 4 | ||||
-rw-r--r-- | plat/nxp/common/nxp_common.mk | 3 | ||||
-rw-r--r-- | plat/nxp/common/plat_timers.c (renamed from plat/nxp/common/nxp_timers.c) | 12 |
4 files changed, 13 insertions, 10 deletions
diff --git a/plat/nxp/board/warp7/include/platform_def.h b/plat/nxp/board/warp7/include/platform_def.h index d5adfcb..7011d33 100644 --- a/plat/nxp/board/warp7/include/platform_def.h +++ b/plat/nxp/board/warp7/include/platform_def.h @@ -62,6 +62,10 @@ /* Base address of non-trusted watchdog */ #define IMX7S_WDOG_BASE 0x30280000 +/* general timer1 */ +#define GPT1_BASE_ADDR (AIPS1_BASE + 0x2d0000) +#define IRQ_GPT1 87 + /* Memory mapped Generic timer(system counter) interfaces. */ #define SYS_CNT_BASE1 (AIPS2_BASE + 0x2c0000) diff --git a/plat/nxp/board/warp7/platform.mk b/plat/nxp/board/warp7/platform.mk index cf08d58..eee1018 100644 --- a/plat/nxp/board/warp7/platform.mk +++ b/plat/nxp/board/warp7/platform.mk @@ -28,13 +28,11 @@ # POSSIBILITY OF SUCH DAMAGE. # -PLAT_INCLUDES := -Iplat/nxp/board/warp7/include/ +PLAT_INCLUDES := -Iplat/nxp/board/warp7/include/ -Iinclude/drivers/nxp PLAT_SOURCES := drivers/arm/gic/arm_gic_v2.c \ drivers/arm/gic/gic_v2.c \ drivers/arm/timer/private_timer.c \ - drivers/arm/timer/system_timer.c \ - plat/arm/common/arm_timers.c \ plat/nxp/board/warp7/aarch32/plat_helpers.S \ plat/nxp/board/warp7/warp7_pwr_state.c \ plat/nxp/board/warp7/warp7_topology.c \ diff --git a/plat/nxp/common/nxp_common.mk b/plat/nxp/common/nxp_common.mk index aa16c27..9ea6457 100644 --- a/plat/nxp/common/nxp_common.mk +++ b/plat/nxp/common/nxp_common.mk @@ -31,9 +31,10 @@ PLAT_INCLUDES += -Iinclude/plat/nxp/common/ PLAT_SOURCES += drivers/arm/gic/gic_common.c \ + drivers/nxp/timer/nxp_timer.c \ drivers/nxp/uart/nxp_console.S \ plat/nxp/common/nxp_setup.c \ - plat/nxp/common/nxp_timers.c + plat/nxp/common/plat_timers.c ifeq (${USE_NVM},1) PLAT_SOURCES += drivers/io/io_storage.c \ diff --git a/plat/nxp/common/nxp_timers.c b/plat/nxp/common/plat_timers.c index b9d9f12..9137601 100644 --- a/plat/nxp/common/nxp_timers.c +++ b/plat/nxp/common/plat_timers.c @@ -31,17 +31,17 @@ #include <assert.h> #include <platform.h> #include <stddef.h> -#include <system_timer.h> +#include <nxp_timer.h> #include <timer.h> #pragma weak plat_initialise_timer_ops static const plat_timer_t plat_timers = { - .program = program_systimer, - .cancel = cancel_systimer, - .handler = handler_systimer, + .program = nxp_timer_program, + .cancel = nxp_timer_cancel, + .handler = nxp_timer_handler, .timer_step_value = 2, - .timer_irq = IRQ_CNTPSIRQ1 + .timer_irq = IRQ_GPT1 }; int plat_initialise_timer_ops(const plat_timer_t **timer_ops) @@ -50,7 +50,7 @@ int plat_initialise_timer_ops(const plat_timer_t **timer_ops) *timer_ops = &plat_timers; /* Initialise the system timer */ - init_systimer(SYS_CNT_BASE1); + nxp_timer_init(GPT1_BASE_ADDR); return 0; } |