luckfox-pico-sdk/sysdrv/source/uboot/u-boot/include/rk_timer_irq.h
luckfox-eng29 8f34c2760d project:build.sh: Added fastboot support; custom modifications to U-Boot and kernel implemented using patches.
project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between
the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door
for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more
usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp:
Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for
compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem.
sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device
tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately.
sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick
boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades.
sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for
fastboot.

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
2024-10-14 09:47:04 +08:00

91 lines
2.9 KiB
C

/*
* (C) Copyright 2022 Rockchip Electronics Co., Ltd
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef _RK_TIMER_IRQ_H
#define _RK_TIMER_IRQ_H
#include <irq-platform.h>
#ifdef CONFIG_ROCKCHIP_RK3399
#define TIMER_CTRL 0x1c
#else
#define TIMER_CTRL 0x10
#endif
#define TIMER_LOAD_COUNT0 0x00
#define TIMER_LOAD_COUNT1 0x04
#define TIMER_INTSTATUS 0x18
#define TIMER_EN BIT(0)
#define TIMER_INT_EN BIT(2)
#define TIMER_CLR_INT BIT(0)
#if defined(CONFIG_ROCKCHIP_RK3128)
#define TIMER_BASE (0x20044000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK322X)
#define TIMER_BASE (0x110C0000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3288)
#define TIMER_BASE (0xFF6B0000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3328)
#define TIMER_BASE (0xFF1C0000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3368)
/*
* Use timer0 and never change, because timer0 will be used in charge animation
* driver to support auto wakeup when system suspend. If core poweroff, PMU only
* support timer0(not all timer) as wakeup source.
*/
#define TIMER_BASE (0xFF810000 + 0x00) /* TIMER 0 */
#define TIMER_IRQ IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK3399)
#define TIMER_BASE (0xFF850000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3308)
#define TIMER_BASE (0xFF1a0000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_PX30)
/*
* Use timer0 and never change, because timer0 will be used in charge animation
* driver to support auto wakeup when system suspend. If core poweroff, PMU only
* support timer0(not all timer) as wakeup source.
*/
#define TIMER_BASE (0xFF210000 + 0x00) /* TIMER 0 */
#define TIMER_IRQ IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK1808)
#define TIMER_BASE (0xFF700000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RV1106)
#define TIMER_BASE (0xFF660000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RV1126)
#define TIMER_BASE (0xFF660000 + 0x20) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER1
#elif defined(CONFIG_ROCKCHIP_RK3528)
#define TIMER_BASE (0xFFAB0000 + 0x00) /* TIMER 0 */
#define TIMER_IRQ IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK3562)
#define TIMER_BASE (0xFFA50000 + 0x00) /* TIMER 0 */
#define TIMER_IRQ IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK3568)
/* Only timer0 can wakeup system suspend */
#define TIMER_BASE (0xFE5F0000 + 0x00) /* TIMER 1 */
#define TIMER_IRQ IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK3576)
#define TIMER_BASE (0x2acc0000 + 0x00) /* TIMER 0 */
#define TIMER_IRQ IRQ_TIMER0
#elif defined(CONFIG_ROCKCHIP_RK3588)
/* Only timer0 can wakeup system suspend */
#define TIMER_BASE (0xFEAE0000 + 0x00) /* TIMER 0 */
#define TIMER_IRQ IRQ_TIMER0
#else
"Missing definitions of timer module test"
#endif
#endif