mirror of
https://github.com/apache/nuttx.git
synced 2026-09-02 15:12:59 +00:00
Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation.
106 lines
3.6 KiB
C
106 lines
3.6 KiB
C
/****************************************************************************
|
|
* arch/z80/src/common/z80_initialize.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/arch.h>
|
|
#include <nuttx/board.h>
|
|
#include <arch/board/board.h>
|
|
|
|
#include "chip/switch.h"
|
|
#include "z80_internal.h"
|
|
|
|
/****************************************************************************
|
|
* Public Data
|
|
****************************************************************************/
|
|
|
|
/* This holds a references to the current interrupt level register storage
|
|
* structure. It is non-NULL only during interrupt processing.
|
|
*/
|
|
|
|
volatile FAR chipreg_t *g_current_regs;
|
|
|
|
/****************************************************************************
|
|
* Public Functions
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Name: up_initialize
|
|
*
|
|
* Description:
|
|
* up_initialize will be called once during OS initialization after the
|
|
* basic OS services have been initialized. The architecture specific
|
|
* details of initializing the OS will be handled here. Such things as
|
|
* setting up interrupt service routines, starting the clock, and
|
|
* registering device drivers are some of the things that are different
|
|
* for each processor and hardware platform.
|
|
*
|
|
* up_initialize is called after the OS initialized but before the user
|
|
* initialization logic has been started and before the libraries have
|
|
* been initialized. OS services and driver services are available.
|
|
*
|
|
****************************************************************************/
|
|
|
|
void up_initialize(void)
|
|
{
|
|
/* Initialize global variables */
|
|
|
|
INIT_IRQCONTEXT();
|
|
|
|
#if CONFIG_MM_REGIONS > 1
|
|
/* Add any extra memory fragments to the memory manager */
|
|
|
|
z80_addregion();
|
|
#endif
|
|
|
|
#ifdef CONFIG_PM
|
|
/* Initialize the power management subsystem. This MCU-specific function
|
|
* must be called *very* early in the initialization sequence *before* any
|
|
* other device drivers are initialized (since they may attempt to register
|
|
* with the power management subsystem).
|
|
*/
|
|
|
|
up_pminitialize();
|
|
#endif
|
|
|
|
#ifdef CONFIG_ARCH_ADDRENV
|
|
/* Initialize the MMU for those that use it (only for the Z180). This
|
|
* needs to be done before any tasks are created.
|
|
*/
|
|
|
|
z80_mmu_initialize();
|
|
#endif
|
|
|
|
/* Initialize the serial device driver */
|
|
|
|
#ifdef USE_SERIALDRIVER
|
|
z80_serial_initialize();
|
|
#endif
|
|
|
|
/* Initialize the network */
|
|
|
|
z80_netinitialize();
|
|
|
|
board_autoled_on(LED_IRQSENABLED);
|
|
}
|