mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
risc-v/mpfs: enable up_systemreset()
This commit is contained in:
committed by
Xiang Xiao
parent
ec11643394
commit
f7cbed0256
@@ -64,6 +64,7 @@ config ARCH_CHIP_MPFS
|
|||||||
bool "MicroChip Polarfire (MPFS)"
|
bool "MicroChip Polarfire (MPFS)"
|
||||||
select ARCH_RV64GC
|
select ARCH_RV64GC
|
||||||
select ARCH_HAVE_MPU
|
select ARCH_HAVE_MPU
|
||||||
|
select ARCH_HAVE_RESET
|
||||||
---help---
|
---help---
|
||||||
MicroChip Polarfire processor (RISC-V 64bit core with GCVX extensions).
|
MicroChip Polarfire processor (RISC-V 64bit core with GCVX extensions).
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ CHIP_CSRCS = mpfs_allocateheap.c mpfs_clockconfig.c
|
|||||||
CHIP_CSRCS += mpfs_idle.c mpfs_irq.c mpfs_irq_dispatch.c
|
CHIP_CSRCS += mpfs_idle.c mpfs_irq.c mpfs_irq_dispatch.c
|
||||||
CHIP_CSRCS += mpfs_lowputc.c mpfs_serial.c
|
CHIP_CSRCS += mpfs_lowputc.c mpfs_serial.c
|
||||||
CHIP_CSRCS += mpfs_start.c mpfs_timerisr.c
|
CHIP_CSRCS += mpfs_start.c mpfs_timerisr.c
|
||||||
CHIP_CSRCS += mpfs_gpio.c
|
CHIP_CSRCS += mpfs_gpio.c mpfs_systemreset.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||||
CMN_CSRCS += riscv_task_start.c riscv_pthread_start.c
|
CMN_CSRCS += riscv_task_start.c riscv_pthread_start.c
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "hardware/mpfs_clint.h"
|
#include "hardware/mpfs_clint.h"
|
||||||
#include "hardware/mpfs_memorymap.h"
|
#include "hardware/mpfs_memorymap.h"
|
||||||
#include "hardware/mpfs_plic.h"
|
#include "hardware/mpfs_plic.h"
|
||||||
#include "hardware/mpfs_sysctl.h"
|
#include "hardware/mpfs_sysreg.h"
|
||||||
#include "hardware/mpfs_uart.h"
|
#include "hardware/mpfs_uart.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* arch/risc-v/src/mpfs/mpfs_systemreset.c
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership. The
|
||||||
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the
|
||||||
|
* License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <nuttx/arch.h>
|
||||||
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
|
#include <riscv_arch.h>
|
||||||
|
#include "hardware/mpfs_memorymap.h"
|
||||||
|
#include "hardware/mpfs_sysreg.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_systemreset
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Internal reset logic.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void up_systemreset(void)
|
||||||
|
{
|
||||||
|
putreg32(0xdead, MPFS_SYSREG_BASE + MPFS_SYSREG_MSS_RESET_CR_OFFSET);
|
||||||
|
|
||||||
|
/* Wait for the reset */
|
||||||
|
|
||||||
|
for (; ; );
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user