blob: 1b9457707ab71c254fb3ee378f61460425cc1acc [file] [log] [blame]
/****************************************************************************
* arch/arm/src/qemu/qemu_cpuboot.c
*
* SPDX-License-Identifier: Apache-2.0
*
* 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 <assert.h>
#include <nuttx/arch.h>
#include <nuttx/sched.h>
#include <arch/irq.h>
#include "init/init.h"
#include "arm_internal.h"
#include "sctlr.h"
#include "scu.h"
#include "gic.h"
/* Symbols defined via the linker script */
extern uint8_t _vector_start[]; /* Beginning of vector block */
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: arm_cpu_boot
*
* Description:
* Continues the C-level initialization started by the assembly language
* __cpu[n]_start function. At a minimum, this function needs to
* initialize interrupt handling and, perhaps, wait on WFI for
* arm_cpu_start() to issue an SGI.
*
* This function must be provided by the each ARMv7-A MCU and implement
* MCU-specific initialization logic.
*
* Input Parameters:
* cpu - The CPU index. This is the same value that would be obtained by
* calling this_cpu();
*
* Returned Value:
* Does not return.
*
****************************************************************************/
#ifdef CONFIG_SMP
void arm_cpu_boot(int cpu)
{
/* Enable SMP cache coherency for the CPU */
arm_enable_smp(cpu);
/* Initialize the FPU */
arm_fpuconfig();
/* Initialize the Generic Interrupt Controller (GIC) for CPUn (n != 0) */
up_irqinitialize();
arm_timer_secondary_init(0);
/* Then transfer control to the IDLE task */
nx_idle_trampoline();
}
#endif /* CONFIG_SMP */