Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Documentation/platforms/risc-v/rp23xx-rv/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This is RISC-V version of the chip configuration.

This port is experimental and still a work in progress. Use with caution.

SMP (dual core configuration not supported yet)
SMP is supported, two cores available.

Peripheral Support
==================
Expand Down
4 changes: 3 additions & 1 deletion arch/risc-v/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,15 @@ config ARCH_CHIP_RP23XX_RV
select ARCH_RV_ISA_C
select ARCH_HAVE_RESET
select ARCH_HAVE_MULTICPU
select ARCH_HAVE_MISALIGN_EXCEPTION
select ARCH_HAVE_I2CRESET
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_DEBUG
select RISCV_STRING_FUNCTION
select ONESHOT
select ONESHOT_COUNT
select ONESHOT_FAST_DIVISION
select ALARM_ARCH
select ARCH_HAVE_I2CRESET
select ARCH_BOARD_COMMON
---help---
Raspberry Pi RP23XX architectures (RISC-V dual Hazard3).
Expand Down
6 changes: 6 additions & 0 deletions arch/risc-v/src/common/riscv_cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ ssize_t up_show_cpuinfo(char *buf, size_t buf_size, off_t file_off)
{
procfs_sprintf(buf, buf_size, &file_off, "processor\t: %d\n", i);
procfs_sprintf(buf, buf_size, &file_off, "hart\t\t: %d\n", i);
procfs_sprintf(buf, buf_size, &file_off, "BogoMIPS\t: %u.%02u\n",
(CONFIG_BOARD_LOOPSPERMSEC / 1000),
(CONFIG_BOARD_LOOPSPERMSEC / 10) % 100);
procfs_sprintf(buf, buf_size, &file_off, "cpu MHz\t\t: %u.%03u\n",
CONFIG_ARCH_CPUINFO_FREQ_KHZ / 1000,
CONFIG_ARCH_CPUINFO_FREQ_KHZ % 1000);

/* ISA */

Expand Down
3 changes: 2 additions & 1 deletion arch/risc-v/src/rp23xx-rv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ list(
rp23xx_pll.c)

if(CONFIG_SMP)
list(APPEND SRCS rp23xx_cpustart.c rp23xx_smpcall.c rp23xx_cpuidlestack.c)
list(REMOVE_ITEM SRCS riscv_smpcall.c riscv_cpustart.c)
list(APPEND SRCS rp23xx_cpustart.c rp23xx_smpcall.c)
endif()

if(CONFIG_RP23XX_RV_DMAC)
Expand Down
3 changes: 3 additions & 0 deletions arch/risc-v/src/rp23xx-rv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

comment "RP23XX Configuration Options"

config ARCH_RV_ISA_VENDOR_EXTENSIONS
default "zba_zbb_zbs_zbkb_zcb_zcmp"

config RP23XX_RV_RP2350B
bool "Use RP2350B variant (QFN-80)"
default n
Expand Down
2 changes: 1 addition & 1 deletion arch/risc-v/src/rp23xx-rv/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ CHIP_CSRCS += rp23xx_xosc.c
CHIP_CSRCS += rp23xx_pll.c

ifeq ($(CONFIG_SMP),y)
CMN_CSRCS := $(filter-out riscv_smpcall.c riscv_cpustart.c, $(CMN_CSRCS))
CHIP_CSRCS += rp23xx_cpustart.c
CHIP_CSRCS += rp23xx_smpcall.c
CHIP_CSRCS += rp23xx_cpuidlestack.c
endif

ifeq ($(CONFIG_RP23XX_RV_DMAC),y)
Expand Down
12 changes: 12 additions & 0 deletions arch/risc-v/src/rp23xx-rv/chip.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,23 @@

#include <arch/rp23xx-rv/chip.h>

#include "riscv_internal.h"

/****************************************************************************
* Macro Definitions
****************************************************************************/

#ifdef __ASSEMBLY__

#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
.macro setintstack tmp0, tmp1
up_cpu_index \tmp0
li \tmp1, STACKFRAME_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK)
mul \tmp1, \tmp0, \tmp1
la \tmp0, g_intstacktop
sub sp, \tmp0, \tmp1
.endm
#endif /* CONFIG_SMP && CONFIG_ARCH_INTERRUPTSTACK > 15 */

#endif /* __ASSEMBLY__ */
#endif /* __ARCH_RISCV_SRC_RP23XX_RV_CHIP_H */
4 changes: 3 additions & 1 deletion arch/risc-v/src/rp23xx-rv/hardware/rp23xx_hazard3.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
* Included Files
****************************************************************************/

#include "hardware/rp23xx_memorymap.h"
#include "rp23xx_memorymap.h"

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define hazard3_block() __asm__ volatile ("slt x0, x0, x0" ::: "memory")
#define hazard3_unblock() __asm__ volatile ("slt x0, x0, x1" ::: "memory")

#define hazard3_irqarray_read(csr, index) (READ_AND_SET_CSR(csr, (index)) >> 16)
#define hazard3_irqarray_write(csr, index, data) (WRITE_CSR(csr, (index) | ((uint32_t)(data) << 16)))
Expand Down
2 changes: 0 additions & 2 deletions arch/risc-v/src/rp23xx-rv/hardware/rp23xx_memorymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
* Included Files
****************************************************************************/

#include "hardware/rp23xx_memorymap.h"

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion arch/risc-v/src/rp23xx-rv/hardware/rp23xx_psm.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Included Files
****************************************************************************/

#include "hardware/rp23xx_memorymap.h"
#include "rp23xx_memorymap.h"

/****************************************************************************
* Pre-processor Definitions
Expand Down
2 changes: 1 addition & 1 deletion arch/risc-v/src/rp23xx-rv/hardware/rp23xx_resets.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Included Files
****************************************************************************/

#include "hardware/rp23xx_memorymap.h"
#include "rp23xx_memorymap.h"

/****************************************************************************
* Pre-processor Definitions
Expand Down
2 changes: 1 addition & 1 deletion arch/risc-v/src/rp23xx-rv/hardware/rp23xx_sio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Included Files
****************************************************************************/

#include "hardware/rp23xx_memorymap.h"
#include "rp23xx_memorymap.h"

/****************************************************************************
* Pre-processor Definitions
Expand Down
2 changes: 1 addition & 1 deletion arch/risc-v/src/rp23xx-rv/hardware/rp23xx_usbctrl_dpsram.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Included Files
****************************************************************************/

#include "hardware/rp23xx_memorymap.h"
#include "rp23xx_memorymap.h"

/****************************************************************************
* Pre-processor Definitions
Expand Down
2 changes: 1 addition & 1 deletion arch/risc-v/src/rp23xx-rv/hardware/rp23xx_usbctrl_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Included Files
****************************************************************************/

#include "hardware/rp23xx_memorymap.h"
#include "rp23xx_memorymap.h"

/****************************************************************************
* Pre-processor Definitions
Expand Down
93 changes: 0 additions & 93 deletions arch/risc-v/src/rp23xx-rv/rp23xx_cpuidlestack.c

This file was deleted.

Loading
Loading