summaryrefslogtreecommitdiff
path: root/bsp/cvitek/cv18xx_aarch64/board/cv18xx.h
blob: bf7b52631ec8396566cc05ece92b9be21e6eba0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Copyright (c) 2006-2024, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-04-15     liYony       the first version
 */

#ifndef __CV18XX_H__
#define __CV18XX_H__

#include <rtdef.h>
#include <ioremap.h>

#ifdef RT_USING_SMART
#include <mmu.h>
#endif

#define __REG32(x)          (*((volatile unsigned int *)(x)))
#define __REG16(x)          (*((volatile unsigned short *)(x)))

/* GIC */
#define MAX_HANDLERS        116
#define GIC_IRQ_START       0
#define ARM_GIC_NR_IRQS     116
#define ARM_GIC_MAX_NR      1

/* GICv2 */
#define GIC400_DISTRIBUTOR_PPTR      0x01F01000U
#define GIC400_CONTROLLER_PPTR       0x01F02000U
#define GIC400_SIZE                  0x00001000U

/* the basic constants and interfaces needed by gic */
rt_inline rt_ubase_t platform_get_gic_dist_base(void)
{
    return GIC400_DISTRIBUTOR_PPTR;
}

rt_inline rt_ubase_t platform_get_gic_cpu_base(void)
{
    return GIC400_CONTROLLER_PPTR;
}

#endif /* __CV18XX_H__ */