Skip to content

Commit 2051cc4

Browse files
committed
# This is a combination of 2 commits.
# This is the 1st commit message: cpu/rp2350_riscv: move to shared rp2350_common # The commit message #2 will be skipped: # fixup! cpu/rp2350_riscv: move to shared rp2350_common
1 parent 0662be4 commit 2051cc4

File tree

17 files changed

+12
-1115
lines changed

17 files changed

+12
-1115
lines changed

cpu/rp2350_riscv/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
MODULE = cpu
33

44
# add a list of subdirectories, that should also be built
5-
DIRS = $(RIOTCPU)/riscv_common periph
5+
DIRS = $(RIOTCPU)/rp2350_common $(RIOTCPU)/riscv_common
66

77
include $(RIOTBASE)/Makefile.base

cpu/rp2350_riscv/Makefile.dep

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
USEMODULE += periph
2-
31
FEATURES_REQUIRED += periph_xh3irq
4-
2+
include $(RIOTCPU)/rp2350_common/Makefile.dep
53
include $(RIOTCPU)/riscv_common/Makefile.dep

cpu/rp2350_riscv/Makefile.features

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
CPU_CORE := rv32imac
2+
CPU_FAM := RP2350
3+
CPU_MODEL = rp2350_hazard3
24

3-
FEATURES_PROVIDED += periph_gpio
4-
FEATURES_PROVIDED += periph_uart
55
FEATURES_PROVIDED += periph_xh3irq
66

7+
include $(RIOTCPU)/rp2350_common/Makefile.features
8+
79
include $(RIOTCPU)/riscv_common/Makefile.features

cpu/rp2350_riscv/Makefile.include

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
CFLAGS += -Wno-pedantic
2-
3-
ROM_LEN ?= 2097152 # = 2 MiB used in the RPi Pico
4-
ROM_OFFSET := 0 # bootloader size
5-
RAM_LEN := 0x82000 # 520kB = 532479 used in the RPi Pico 2350
6-
ROM_START_ADDR := 0x10000000 # XIP Non-Secure address for rp2350
7-
RAM_START_ADDR := 0x20000000 # Non-Secure RAM address for rp2350
8-
9-
INCLUDES += -I$(RIOTCPU)/rp2350_riscv/include
10-
INCLUDES += -isystem$(RIOTBASE)/build/pkg/picosdk/src/rp2_common/cmsis/stub/CMSIS/Core/Include
11-
INCLUDES += -isystem$(RIOTBASE)/build/pkg/picosdk/src/rp2_common/cmsis/stub/CMSIS/Device/RP2350/Include
12-
INCLUDES += -isystem$(RIOTBASE)/build/pkg/picosdk/src/rp2350/hardware_regs/include/hardware
13-
141
# CPU and architecture specific flags
152
CFLAGS += -D$(CPU_MODEL)
163
CFLAGS += -DROM_START_ADDR=$(ROM_START_ADDR)
@@ -24,9 +11,7 @@ LINKFLAGS += -Wl,--gc-sections
2411
LINKFLAGS += -Wl,--start-group -lc -lm -Wl,--end-group
2512
LINKFLAGS += -march=rv32imac_zicsr_zifencei_zba_zbb_zbkb_zbs
2613

27-
# Supported programmers and debuggers
28-
PROGRAMMERS_SUPPORTED := picotool openocd jlink
29-
PROGRAMMER ?= picotool
30-
OPENOCD_DEBUG_ADAPTER ?= dap
31-
14+
include $(RIOTCPU)/rp2350_common/Makefile.include
3215
include $(RIOTCPU)/riscv_common/Makefile.include
16+
17+
INCLUDES += -I$(RIOTCPU)/rp2350_riscv/include

cpu/rp2350_riscv/clock.c

Lines changed: 0 additions & 71 deletions
This file was deleted.

cpu/rp2350_riscv/cpu.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,13 @@
2525

2626
#include <sys/unistd.h>
2727

28-
void gpio_reset(void)
29-
{
30-
reset_component(RESET_PADS_BANK0, RESET_PADS_BANK0);
31-
reset_component(RESET_IO_BANK0, RESET_IO_BANK0);
32-
}
33-
3428
/**
3529
* @brief Initialize the CPU, set IRQ priorities, clocks, peripheral
3630
*/
3731
void cpu_init(void)
3832
{
39-
/* Reset GPIO state */
40-
gpio_reset();
41-
42-
/* Reset clock to default state */
43-
clock_reset();
44-
45-
/* initialize the CPU clock */
46-
cpu_clock_init();
47-
4833
/* initialize the RISC-V core */
4934
riscv_init();
5035

51-
/* initialize the early peripherals */
52-
early_init();
53-
54-
/* trigger static peripheral initialization */
55-
periph_init();
56-
57-
/* initialize the board */
58-
board_init();
36+
rp2350_init();
5937
}

cpu/rp2350_riscv/include/clock_conf.h

Lines changed: 0 additions & 159 deletions
This file was deleted.

cpu/rp2350_riscv/include/cpu_conf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ extern "C" {
2323

2424
#define CPU_DEFAULT_IRQ_PRIO 1u
2525
#define CPU_IRQ_NUMOF 52u
26+
/* This tells rp2350_common that we are using the RISC-V core */
27+
#define RP2350_USE_RISCV 1
2628

2729
#ifdef __cplusplus
2830
}

0 commit comments

Comments
 (0)