Skip to content

Commit 8c8ab7f

Browse files
committed
cpu/rp2350_riscv: add xh3irq support
1 parent 6b918bc commit 8c8ab7f

File tree

20 files changed

+282
-65
lines changed

20 files changed

+282
-65
lines changed

boards/rpi-pico-2-riscv/board.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,4 @@ void board_init(void) {
1212
* This is needed, esp. when the LED is used via
1313
* the define macros */
1414
gpio_init(LED0_PIN_ID, GPIO_OUT);
15-
16-
gpio_init(OSC_DEBUG_PIN_ID, GPIO_OUT);
17-
gpio_init(OSC_DEBUG_PIN_ID_2, GPIO_OUT);
1815
}

boards/rpi-pico-2-riscv/doc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@defgroup boards_rpi_pico_2 Raspberry Pi Pico 2
1+
@defgroup boards_rpi_pico_2_riscv Raspberry Pi Pico 2
22
@ingroup boards
3-
@brief Support for the RP2350 based Raspberry Pi Pico board
3+
@brief Support for the RP2350 RISCV based Raspberry Pi Pico board
44

55
@warning The support for the Raspberry Pi Pico 2 is still in a very early stage!
6-
See [Known Issues](#rpi_pico_2_known_issues).
6+
See [Known Issues](#rpi_pico_2_riscv_known_issues).
77

88
## Overview
99

@@ -100,7 +100,7 @@ However, it does not allow for debugging using GDB.
100100
RIOT will download and install the Picotool locally in the RIOT folder.
101101
This process will take some minutes to complete.
102102

103-
## Known Issues {#rpi_pico_2_known_issues}
103+
## Known Issues {#rpi_pico_2_riscv_known_issues}
104104

105105
Currently RP2350 support is rather minimal,
106106
as such peripheral support is extremely limited.

boards/rpi-pico-2-riscv/include/board.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#pragma once
88

99
/**
10-
* @ingroup boards_rpi_pico_2
10+
* @ingroup boards_rpi_pico_2_riscv
1111
* @{
1212
*
1313
* @file
@@ -28,9 +28,6 @@
2828
#define LED0_TOGGLE gpio_toggle(LED0_PIN_ID)
2929
#define LED0_NAME "LED(Green)"
3030

31-
#define OSC_DEBUG_PIN_ID 15u
32-
#define OSC_DEBUG_PIN_ID_2 14u
33-
3431
#ifdef __cplusplus
3532
extern "C" {
3633
#endif

boards/rpi-pico-2-riscv/include/periph_conf.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* @author Tom Hert <[email protected]>
1818
*/
1919

20+
#include "kernel_defines.h"
2021
#include <stdint.h>
2122

2223
#include "kernel_defines.h"
@@ -59,3 +60,5 @@ static const uart_conf_t uart_config[] = {
5960
#ifdef __cplusplus
6061
}
6162
#endif
63+
64+
/** @} */

cpu/riscv_common/include/xh3irq.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,30 @@ extern const void *vector_cpu[CPU_IRQ_NUMOF];
5757
* @return 1 if there are pending interrupts, 0 otherwise
5858
*/
5959
uint32_t xh3irq_has_pending(void);
60+
61+
/**
62+
* @brief The main IRQ handler, called from the assembly IRQ handler
63+
* @note This function must clear the pending interrupt in the interrupt controller
64+
*/
6065
void xh3irq_handler(void);
6166

67+
/**
68+
* @brief Enable the given IRQ number
69+
* @param irq_no The IRQ number to enable
70+
*/
6271
void xh3irq_enable_irq(uint32_t irq_no);
6372

73+
/**
74+
* @brief Disable the given IRQ number
75+
* @param irq_no The IRQ number to disable
76+
*/
6477
void xh3irq_disable_irq(uint32_t irq_no);
6578

79+
/**
80+
* @brief Force the given IRQ number to be pending
81+
* @param irq_no The IRQ number to force
82+
* @note The IRQ still must be enabled to be handled
83+
*/
6684
void xh3irq_force_irq(uint32_t irq_no);
6785

6886
#ifdef __cplusplus

cpu/rp2350_riscv/clock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @ingroup cpu_rp2350
8+
* @ingroup cpu_rp2350_riscv
99
* @{
1010
*
1111
* @file

cpu/rp2350_riscv/cpu.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
/*
2-
* Copyright (C) 2017, 2019 Ken Rabold, JP Bonn
3-
*
4-
* This file is subject to the terms and conditions of the GNU Lesser
5-
* General Public License v2.1. See the file LICENSE in the top level
6-
* directory for more details.
2+
* SPDX-FileCopyrightText: 2025 Tom Hert <[email protected]>
3+
* SPDX-FileCopyrightText: 2025 HAW Hamburg
4+
* SPDX-License-Identifier: LGPL-2.1-only
75
*/
86

97
/**
10-
* @ingroup cpu_fe310
8+
* @ingroup cpu_rp2350_riscv
119
* @{
1210
*
1311
* @file cpu.c
14-
* @brief Implementation of the CPU initialization for SiFive FE310
12+
* @brief Implementation of the CPU initialization for RP2350
1513
*
16-
* @author Ken Rabold
14+
* @author Tom Hert <[email protected]>
1715
* @}
1816
*/
1917

cpu/rp2350_riscv/doc.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
@defgroup cpu_fe310 SiFive fe310
2-
@ingroup cpu
3-
@brief SiFive fe310 RISC-V MCU specific implementation.
1+
@defgroup cpu_rp2350_riscv RP2350 RISCV MCUs
2+
@ingroup cpu
3+
@brief RP2350 RISCV MCU code and definitions
44

5-
This module contains SiFive fe310 specific code and definition.
6-
7-
@see cpu_riscv_common
5+
This module contains the code and definitions for MCUs of the RP2350 RISCV family used by the Pi Pico 2.

cpu/rp2350_riscv/include/clock_conf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#pragma once
88

99
/**
10-
* @ingroup cpu_rp2350
10+
* @ingroup cpu_rp2350_riscv
1111
* @{
1212
*
1313
* @file
@@ -89,7 +89,7 @@
8989
* clock */
9090
#define CLK_SYS_PERI_CTRL_ENABLE_BIT (1u << 0u)
9191
/** Selected field value for the system clock control register
92-
* to select the peripheral clock */
92+
* to select the peripheral clock */
9393
#define CLK_SYS_SELECTED_PERI_FIELD_VALUE 2u
9494
/** RIOT core clock frequency defined as the CPU frequency */
9595
#define CLOCK_CORECLOCK MHZ(12u)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Tom Hert <[email protected]>
3+
* SPDX-FileCopyrightText: 2025 HAW Hamburg
4+
* SPDX-License-Identifier: LGPL-2.1-only
5+
*/
6+
17
#pragma once
28

9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
313
#define __IM volatile const /*! Defines 'read only' structure member permissions */
414
#define __OM volatile /*! Defines 'write only' structure member permissions */
515
#define __IOM volatile /*! Defines 'read / write' structure member permissions */
16+
17+
#ifdef __cplusplus
18+
}
19+
#endif

0 commit comments

Comments
 (0)