summaryrefslogtreecommitdiff
path: root/bsp/zynqmp-a53-dfzu2eg/drivers/zynqmp.h
blob: 72da0549db9c2636c03a86e72b2dd54eb0c3b4fd (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
47
48
49
50
51
52
/*
 * Copyright (c) 2006-2024, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-04-11     liYony       the first version
 */

#ifndef __ZYNQMP_H__
#define __ZYNQMP_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)))

/* UART */
#define ZYNQMP_UART0_BASE    0xFF000000
#define ZYNQMP_UART0_SIZE    0x00010000
#define ZYNQMP_UART0_IRQNUM  (32 + 21)
#define ZYNQMP_UART0_CLK_FREQ_HZ (99999001)

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

/* GICv2 */
#define GIC400_DISTRIBUTOR_PPTR      0xF9010000U
#define GIC400_CONTROLLER_PPTR       0xF9020000U
#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 /* __ZYNQMP_H__ */