arch/nrf53: move SPU configuration to a separate file
This commit is contained in:
parent
74cc036536
commit
45a542cb14
@ -26,7 +26,8 @@ set(SRCS
|
||||
nrf53_allocateheap.c
|
||||
nrf53_lowputc.c
|
||||
nrf53_gpio.c
|
||||
nrf53_uid.c)
|
||||
nrf53_uid.c
|
||||
nrf53_spu.c)
|
||||
|
||||
if(CONFIG_NRF53_SYSTIMER_SYSTICK)
|
||||
list(APPEND SRCS nrf53_systick.c)
|
||||
|
@ -22,7 +22,7 @@ include armv8-m/Make.defs
|
||||
|
||||
CHIP_CSRCS += nrf53_start.c nrf53_clockconfig.c nrf53_irq.c nrf53_utils.c
|
||||
CHIP_CSRCS += nrf53_allocateheap.c nrf53_lowputc.c nrf53_gpio.c
|
||||
CHIP_CSRCS += nrf53_uid.c
|
||||
CHIP_CSRCS += nrf53_uid.c nrf53_spu.c
|
||||
|
||||
ifeq ($(CONFIG_NRF53_SYSTIMER_SYSTICK),y)
|
||||
CHIP_CSRCS += nrf53_systick.c
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <nuttx/semaphore.h>
|
||||
|
||||
#include "arm_internal.h"
|
||||
#include "hardware/nrf53_spu.h"
|
||||
|
||||
#include "nrf53_ipc.h"
|
||||
|
||||
@ -494,12 +493,6 @@ int nrf53_rptun_init(const char *shmemname, const char *cpuname)
|
||||
dev->master = false;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NRF53_APPCORE
|
||||
/* Set secure domain - this allows net core to access shared mem */
|
||||
|
||||
putreg32(SPU_EXTDOMAIN_SECUREMAPPING_SECATTR, NRF53_SPU_EXTDOMAIN(0));
|
||||
#endif
|
||||
|
||||
/* Subscribe to IPC */
|
||||
|
||||
#ifdef CONFIG_NRF53_APPCORE
|
||||
|
58
arch/arm/src/nrf53/nrf53_spu.c
Normal file
58
arch/arm/src/nrf53/nrf53_spu.c
Normal file
@ -0,0 +1,58 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/nrf53/nrf53_spu.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 "arm_internal.h"
|
||||
|
||||
#include "hardware/nrf53_spu.h"
|
||||
|
||||
#include "nrf53_spu.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_SPU_CONFIG
|
||||
/****************************************************************************
|
||||
* Name: nrf53_spu_configure
|
||||
****************************************************************************/
|
||||
|
||||
void nrf53_spu_configure(void)
|
||||
{
|
||||
#ifdef CONFIG_RPTUN
|
||||
/* Set secure domain - this allows net core to access shared mem */
|
||||
|
||||
putreg32(SPU_EXTDOMAIN_SECUREMAPPING_SECATTR, NRF53_SPU_EXTDOMAIN(0));
|
||||
#endif
|
||||
}
|
||||
#endif
|
55
arch/arm/src/nrf53/nrf53_spu.h
Normal file
55
arch/arm/src/nrf53/nrf53_spu.h
Normal file
@ -0,0 +1,55 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/nrf53/nrf53_spu.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_NRF53_NRF53_SPU_H
|
||||
#define __ARCH_ARM_SRC_NRF53_NRF53_SPU_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* SPU only for secure app core image */
|
||||
|
||||
#if defined(CONFIG_NRF53_APPCORE) && \
|
||||
!defined(CONFIG_ARCH_TRUSTZONE_NONSECURE)
|
||||
# define HAVE_SPU_CONFIG
|
||||
#else
|
||||
# undef HAVE_SPU_CONFIG
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_SPU_CONFIG
|
||||
/****************************************************************************
|
||||
* Name: nrf53_spu_configure
|
||||
****************************************************************************/
|
||||
|
||||
void nrf53_spu_configure(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_NRF53_NRF53_SPU_H */
|
@ -45,6 +45,7 @@
|
||||
#include "nrf53_cpunet.h"
|
||||
#include "nrf53_gpio.h"
|
||||
#include "nrf53_serial.h"
|
||||
#include "nrf53_spu.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -184,6 +185,12 @@ void __start(void)
|
||||
|
||||
__asm__ __volatile__ ("\tcpsid i\n");
|
||||
|
||||
#ifdef HAVE_SPU_CONFIG
|
||||
/* Configure SPU before cpunet boot */
|
||||
|
||||
nrf53_spu_configure();
|
||||
#endif
|
||||
|
||||
/* Handle APPROTECT configuration */
|
||||
|
||||
nrf53_approtect();
|
||||
|
Loading…
x
Reference in New Issue
Block a user