Skip to content

Commit cd249bf

Browse files
authored
Merge pull request #3548 from bigmagic123/fix_waring
Fix aarch64 waring
2 parents f406aab + 3afb24f commit cd249bf

File tree

9 files changed

+34
-22
lines changed

9 files changed

+34
-22
lines changed

bsp/raspberry-pi/raspi3-64/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ EXEC_PATH = r'E:/env_released_1.1.2/env/tools/gnu_gcc/arm_gcc/gcc-arm-8.3-2019.0
3131

3232
然后在`bsp\raspberry-pi\raspi3-64\`下输入scons编译即可。
3333

34+
**window环境搭建注意**
35+
36+
下载完成`gcc-arm-8.3-2019.03-i686-mingw32-aarch64-elf.tar.xz`交叉编译工具链后,最好采用7-zip解压工具进行两次解压。
37+
确保解压目录下的`/bin/aarch64-elf-ld.exe`文件的size不为0。
38+
否则编译会出现如下错误:
39+
40+
```
41+
collect2.exe:fatal error:CreateProcess:No such file or directory
42+
```
43+
3444
### 2.2 Linux上的环境搭建
3545

3646
Linux下推荐使用[gcc工具][2]。Linux版本下gcc版本可采用`gcc-arm-8.3-2019.03-x86_64-aarch64-elf`

bsp/raspberry-pi/raspi4/driver/board.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@
1818
#include "mmu.h"
1919

2020
static rt_uint64_t timerStep;
21-
// 0x40, 0x44, 0x48, 0x4c: Core 0~3 Timers interrupt control
22-
#define CORE0_TIMER_IRQ_CTRL HWREG32(0xFF800040)
23-
#define TIMER_IRQ 30
24-
#define NON_SECURE_TIMER_IRQ (1 << 1)
2521

2622
int rt_hw_get_gtimer_frq(void);
2723
void rt_hw_set_gtimer_val(rt_uint64_t value);
2824
int rt_hw_get_gtimer_val(void);
2925
int rt_hw_get_cntpct_val(void);
3026
void rt_hw_gtimer_enable(void);
3127

32-
void core0_timer_enable_interrupt_controller()
28+
void core0_timer_enable_interrupt_controller(void)
3329
{
3430
CORE0_TIMER_IRQ_CTRL |= NON_SECURE_TIMER_IRQ;
3531
}
@@ -94,4 +90,4 @@ void rt_hw_board_init(void)
9490
#ifdef RT_USING_COMPONENTS_INIT
9591
rt_components_board_init();
9692
#endif
97-
}
93+
}

bsp/raspberry-pi/raspi4/driver/board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define BOARD_H__
1313

1414
#include <stdint.h>
15+
#include "iomap.h"
1516

1617
extern unsigned char __bss_start;
1718
extern unsigned char __bss_end;
@@ -22,4 +23,3 @@ extern unsigned char __bss_end;
2223
void rt_hw_board_init(void);
2324

2425
#endif
25-

bsp/raspberry-pi/raspi4/driver/drv_gpio.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include "board.h"
1818
#include "interrupt.h"
1919

20-
#define GPIO_BASE (0xFE000000 + 0x00200000)
21-
2220
#define GPIO_REG_GPFSEL0(BASE) HWREG32(BASE + 0x00)
2321
#define GPIO_REG_GPFSEL1(BASE) HWREG32(BASE + 0x04)
2422
#define GPIO_REG_GPFSEL2(BASE) HWREG32(BASE + 0x08)

bsp/raspberry-pi/raspi4/driver/drv_uart.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
#include "drv_uart.h"
1717
#include "drv_gpio.h"
1818

19-
#define UART0_BASE (0xFE000000 + 0x00201000)
20-
#define PL011_BASE UART0_BASE
21-
#define IRQ_PL011 (121 + 32)
22-
23-
#define UART_REFERENCE_CLOCK 48000000
24-
2519
struct hw_uart_device
2620
{
2721
rt_ubase_t hw_base;

bsp/raspberry-pi/raspi4/driver/drv_uart.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,3 @@
8181
int rt_hw_uart_init(void);
8282

8383
#endif /* DRV_UART_H__ */
84-
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
#ifndef __RASPI4_H__
22
#define __RASPI4_H__
33

4-
#define ARM_GIC_NR_IRQS 512
5-
#define INTC_BASE 0xff800000
4+
//gpio
5+
#define GPIO_BASE (0xFE000000 + 0x00200000)
6+
7+
//uart
8+
#define UART0_BASE (0xFE000000 + 0x00201000)
9+
#define PL011_BASE UART0_BASE
10+
#define IRQ_PL011 (121 + 32)
11+
#define UART_REFERENCE_CLOCK (48000000)
12+
13+
// 0x40, 0x44, 0x48, 0x4c: Core 0~3 Timers interrupt control
14+
#define CORE0_TIMER_IRQ_CTRL HWREG32(0xFF800040)
15+
#define TIMER_IRQ 30
16+
#define NON_SECURE_TIMER_IRQ (1 << 1)
17+
18+
//gic max
19+
#define ARM_GIC_NR_IRQS (512)
20+
#define INTC_BASE (0xff800000)
621
#define GIC_V2_DISTRIBUTOR_BASE (INTC_BASE + 0x00041000)
722
#define GIC_V2_CPU_INTERFACE_BASE (INTC_BASE + 0x00042000)
823
#define GIC_V2_HYPERVISOR_BASE (INTC_BASE + 0x00044000)
@@ -11,4 +26,4 @@
1126
#define GIC_PL400_DISTRIBUTOR_PPTR GIC_V2_DISTRIBUTOR_BASE
1227
#define GIC_PL400_CONTROLLER_PPTR GIC_V2_CPU_INTERFACE_BASE
1328

14-
#endif
29+
#endif

components/finsh/finsh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#define HEAP_ALIGNMENT 4 /* heap alignment */
2828

2929
#define FINSH_GET16(x) (*(x)) | (*((x)+1) << 8)
30-
#define FINSH_GET32(x) (rt_uint32_t)(*(x)) | ((rt_uint32_t)*((x)+1) << 8) | \
31-
((rt_uint32_t)*((x)+2) << 16) | ((rt_uint32_t)*((x)+3) << 24)
30+
#define FINSH_GET32(x) (rt_ubase_t)(*(x)) | ((rt_ubase_t)*((x)+1) << 8) | \
31+
((rt_ubase_t)*((x)+2) << 16) | ((rt_ubase_t)*((x)+3) << 24)
3232

3333
#define FINSH_SET16(x, v) \
3434
do \

components/finsh/finsh_compiler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int finsh_compile(struct finsh_node* node)
191191
case FINSH_NODE_VALUE_NULL:
192192
case FINSH_NODE_VALUE_STRING:
193193
finsh_code_byte(FINSH_OP_LD_DWORD);
194-
finsh_code_dword((uint32_t)node->value.ptr);
194+
finsh_code_dword((rt_ubase_t)node->value.ptr);
195195
break;
196196

197197
/* arithmetic operation */

0 commit comments

Comments
 (0)