Skip to content

Commit bcae196

Browse files
committed
[bsp\raspi4]move io to iomap.h
1 parent 098eccc commit bcae196

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

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

0 commit comments

Comments
 (0)