summaryrefslogtreecommitdiff
path: root/bsp/renesas/rzn2l_etherkit/board/board.h
blob: 8d16dfc1c4d3037dd03108b795b2362ec61e279d (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
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-03-11    Wangyuqiang   first version
 */

#ifndef __BOARD_H__
#define __BOARD_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <rtdef.h>
#include <cp15.h>
#include <hal_data.h>

#define RZ_SRAM_SIZE    1536 /* The SRAM size of the chip needs to be modified */
#define RZ_SRAM_END     (0x10000000 + RZ_SRAM_SIZE * 1024 - 1)

#ifdef __ARMCC_VERSION
extern int Image$$RAM_END$$ZI$$Base;
#define HEAP_BEGIN  ((void *)&Image$$RAM_END$$ZI$$Base)
#elif __ICCARM__
#pragma section="CSTACK"
#define HEAP_BEGIN      (__segment_end("CSTACK"))
#else
extern int __bss_end__;
#define HEAP_BEGIN      ((void *)&__bss_end__)
#endif

#define HEAP_END        RZ_SRAM_END

/***********************************************************************************************************************
 * Macro definitions
 **********************************************************************************************************************/
#define MAX_HANDLERS BSP_VECTOR_TABLE_MAX_ENTRIES
#define GIC_IRQ_START   0
#define GIC_ACK_INTID_MASK  (0x000003FFU)
/* number of interrupts on board */
#define ARM_GIC_NR_IRQS     (448)
/* only one GIC available */
#define ARM_GIC_MAX_NR      1
/*  end defined */

#define GICV3_DISTRIBUTOR_BASE_ADDR     (0x100000)

/* the basic constants and interfaces needed by gic */
rt_inline rt_uint32_t platform_get_gic_dist_base(void)
{
    rt_uint32_t gic_base;

    __get_cp(15, 1, gic_base, 15, 3, 0);
    return gic_base + GICV3_DISTRIBUTOR_BASE_ADDR;
}

#ifdef __cplusplus
}
#endif

#endif