mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-10-06 10:59:48 +08:00
aarch64: Add imx93 BSP
This adds a BSP for the i.MX93 chip.
This commit is contained in:
committed by
Kinsey Moore
parent
e20a42b84d
commit
215b3c9f71
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief Core BSP definitions
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Rongjie Lee
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef LIBBSP_AARCH64_FRDM_IMX93_BSP_H
|
||||
#define LIBBSP_AARCH64_FRDM_IMX93_BSP_H
|
||||
|
||||
/**
|
||||
* @addtogroup RTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <bspopts.h>
|
||||
|
||||
#ifndef ASM
|
||||
|
||||
#include <bsp/default-initial-extension.h>
|
||||
#include <bsp/start.h>
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
/*IMX93 MMU initialization */
|
||||
BSP_START_TEXT_SECTION void frdm_imx93_setup_mmu_and_cache( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define BSP_ARM_GIC_DIST_BASE 0x48000000
|
||||
#define BSP_ARM_GIC_REDIST_BASE 0x48040000
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* ASM */
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* LIBBSP_AARCH64_FRDM_IMX93_BSP_H */
|
||||
@@ -0,0 +1,100 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsRTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief Peripheral definitions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Rongjie Lee
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef LIBBSP_FRDM_IMX93_BSP_FRDM_IMX93_H
|
||||
#define LIBBSP_FRDM_IMX93_BSP_FRDM_IMX93_H
|
||||
|
||||
#include <bspopts.h>
|
||||
#include <stdint.h>
|
||||
#include <bsp/utility.h>
|
||||
|
||||
/**
|
||||
* @name Register Macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define IMX93_REG( x ) ( *(volatile uint64_t *) ( x ) )
|
||||
#define IMX93_BIT( n ) ( 1 << ( n ) )
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Peripheral Base Register Address
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define IMX93_PERIPHERAL_1_BASE 0x44000000 /* AIPS Peripheral Bridge 1(NS) */
|
||||
#define IMX93_PERIPHERAL_1_SIZE 0x800000
|
||||
|
||||
#define IMX93_PERIPHERAL_2_BASE 0x42000000 /* AIPS Peripheral Bridge 2(NS) */
|
||||
#define IMX93_PERIPHERAL_2_SIZE 0x800000
|
||||
|
||||
#define IMX93_PERIPHERAL_3_BASE 0x42800000 /* AIPS Peripheral Bridge 3(NS) */
|
||||
#define IMX93_PERIPHERAL_3_SIZE 0x800000
|
||||
|
||||
#define IMX93_PERIPHERAL_4_BASE 0x49000000 /* AIPS Peripheral Bridge 4(NS) */
|
||||
#define IMX93_PERIPHERAL_4_SIZE 0x800000
|
||||
|
||||
#define IMX93_GPIO_BASE 0x43810000 /* GPIO2-4(NS) */
|
||||
#define IMX93_GPIO_SIZE 0x30000
|
||||
|
||||
#define IMX93_GIC_BASE 0x48000000 /* GIC Programming Registers(NS) */
|
||||
#define IMX93_GIC_SIZE 0x1000000
|
||||
|
||||
#define IMX93_MEDIAMIX_BASE 0x4AC10000 /* MEDIAMIX Block Control(NS) */
|
||||
#define IMX93_MEDIAMIX_SIZE 0x10000
|
||||
|
||||
#define IMX93_VIDEO_BASE 0x4AE00000
|
||||
#define IMX93_VIDEO_SIZE 0x50000
|
||||
|
||||
#define IMX93_USB_BASE 0x4C100000 /* USB(NS) */
|
||||
#define IMX93_USB_SIZE 0x200000
|
||||
|
||||
#define IMX93_LPUART1_BASE 0x44380000
|
||||
#define IMX93_LPUART2_BASE 0x44390000
|
||||
|
||||
#define IMX93_LPUART3_BASE 0x42570000
|
||||
#define IMX93_LPUART4_BASE 0x42580000
|
||||
#define IMX93_LPUART5_BASE 0x42590000
|
||||
#define IMX93_LPUART6_BASE 0x425A0000
|
||||
|
||||
#define IMX93_LPUART7_BASE 0x42690000
|
||||
#define IMX93_LPUART8_BASE 0x426A0000
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* LIBBSP_FRDM_IMX93_BSP_FRDM_IMX93_H */
|
||||
@@ -0,0 +1,55 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsRTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief Interrupt definitions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Rongjie Lee
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef LIBBSP_FRDM_IMX93_IRQ_H
|
||||
#define LIBBSP_FRDM_IMX93_IRQ_H
|
||||
|
||||
#ifndef ASM
|
||||
|
||||
#include <rtems.h>
|
||||
#include <dev/irq/arm-gic-irq.h>
|
||||
|
||||
/**
|
||||
* @defgroup imx93_interrupt Interrupt Support
|
||||
*
|
||||
* @ingroup RTEMSBSPsRTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief Interrupt support.
|
||||
*/
|
||||
#define BSP_INTERRUPT_VECTOR_COUNT 222
|
||||
#define BSP_TIMER_PHYS_NS_PPI 30
|
||||
|
||||
#endif /* ASM */
|
||||
#endif /* LIBBSP_FRDM_IMX93_IRQ_H */
|
||||
@@ -0,0 +1,97 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsRTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief UART register definitions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Rongjie Lee
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <bsp/utility.h>
|
||||
|
||||
#define UARTSTAT_TDRE BSP_BIT32( 23 )
|
||||
#define UARTSTAT_TC BSP_BIT32( 22 )
|
||||
#define UARTSTAT_RDRF BSP_BIT32( 21 )
|
||||
|
||||
#define UARTCTRL_TIE BSP_BIT32( 23 )
|
||||
#define UARTCTRL_TCIE BSP_BIT32( 22 )
|
||||
#define UARTCTRL_RIE BSP_BIT32( 21 )
|
||||
#define UARTCTRL_ILIE BSP_BIT32( 20 )
|
||||
#define UARTCTRL_TE BSP_BIT32( 19 )
|
||||
#define UARTCTRL_RE BSP_BIT32( 18 )
|
||||
#define UARTCTRL_SBK BSP_BIT32( 16 )
|
||||
#define IMX93_UARTCTRL_IDLECFG( reg, val ) BSP_FLD32SET( reg, val, 8, 10 )
|
||||
|
||||
#define IMX93_UART_DATA( val ) BSP_FLD32( val, 0, 15 )
|
||||
#define IMX93_UART_DATA_GET( reg ) BSP_FLD32GET( reg, 0, 9 )
|
||||
|
||||
#define UARTMODIR_TXCTSE BSP_BIT32( 0 )
|
||||
#define IMX93_UARTMODIR_RTSWATER( reg, val ) BSP_FLD32SET( reg, val, 8, 11 )
|
||||
|
||||
#define UARTFIFO_RXUF BSP_BIT32( 16 )
|
||||
#define UARTFIFO_TXFLUSH BSP_BIT32( 15 )
|
||||
#define UARTFIFO_RXFLUSH BSP_BIT32( 14 )
|
||||
#define UARTFIFO_TXFE BSP_BIT32( 7 )
|
||||
#define UARTFIFO_RXFE BSP_BIT32( 3 )
|
||||
#define IMX93_UARTFIFO( val ) BSP_FLD32( val, 0, 23 )
|
||||
#define IMX93_UARTFIFO_RXIDEN( reg, val ) BSP_FLD32SET( reg, val, 10, 12 )
|
||||
#define IMX93_UARTFIFO_RXFIFOSIZE_GET( reg ) BSP_FLD32GET( reg, 0, 3 )
|
||||
|
||||
#define UARTWATER_TXWATER_OFF 0
|
||||
#define UARTWATER_RXWATER_OFF 16
|
||||
#define UARTWARER_RXCNT_OFF 24
|
||||
|
||||
typedef struct {
|
||||
uint32_t VERID; /* 0x00 */
|
||||
uint32_t PARAM; /* 0x04 */
|
||||
uint32_t GLOBAL; /* 0x08 */
|
||||
uint32_t PINCFG; /* 0x0C */
|
||||
uint32_t BAUD; /* 0x10 */
|
||||
uint32_t STAT; /* 0x14 */
|
||||
uint32_t CTRL; /* 0x18 */
|
||||
uint32_t DATA; /* 0x1C */
|
||||
uint32_t MATCH; /* 0x20 */
|
||||
uint32_t MODIR; /* 0x24 */
|
||||
uint32_t FIFO; /* 0x28 */
|
||||
uint32_t WATER; /* 0x2C */
|
||||
uint32_t DATARO; /* 0x30 */
|
||||
|
||||
uint32_t reserved0[ 3 ]; /* 0x34-0x3C */
|
||||
|
||||
uint32_t MCR; /* 0x40 */
|
||||
uint32_t MSR; /* 0x44 */
|
||||
uint32_t REIR; /* 0x48 */
|
||||
uint32_t TEIR; /* 0x4C */
|
||||
uint32_t HDCR; /* 0x50 */
|
||||
uint32_t TOCR; /* 0x58 */
|
||||
uint32_t TOSR; /* 0x5C */
|
||||
|
||||
uint32_t TIMEOUTN[ 4 ]; /* 0x60-0x6C */
|
||||
|
||||
} imx93_uart;
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief BSP tm27 header
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2022 Mohd Noor Aman
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _RTEMS_TMTEST27
|
||||
#error "This is an RTEMS internal file you must not include directly."
|
||||
#endif
|
||||
|
||||
#ifndef __tm27_h
|
||||
#define __tm27_h
|
||||
|
||||
#include <dev/irq/arm-gic-tm27.h>
|
||||
|
||||
#endif /* __tm27_h */
|
||||
@@ -0,0 +1,49 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief BSP Startup
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2022 Mohd Noor Aman
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/bootcard.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
#include <bsp/linker-symbols.h>
|
||||
|
||||
void bsp_start( void )
|
||||
{
|
||||
bsp_interrupt_initialize();
|
||||
rtems_cache_coherent_add_area(
|
||||
bsp_section_nocacheheap_begin,
|
||||
(uintptr_t) bsp_section_nocacheheap_size
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief BSP Startup Hooks
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Rongjie Lee
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
#include <bsp/start.h>
|
||||
#include <rtems/score/cpu.h>
|
||||
|
||||
#ifdef BSP_START_ENABLE_EL3_START_SUPPORT
|
||||
BSP_START_TEXT_SECTION void bsp_start_hook_0( void )
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
#endif
|
||||
|
||||
BSP_START_TEXT_SECTION void bsp_start_hook_1( void )
|
||||
{
|
||||
AArch64_start_set_vector_base();
|
||||
bsp_start_copy_sections();
|
||||
frdm_imx93_setup_mmu_and_cache();
|
||||
bsp_start_clear_bss();
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup RTEMSBSPsAArch64FRDMIMX93
|
||||
*
|
||||
* @brief This source file contains the default MMU tables and setup.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Rongjie Lee
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/start.h>
|
||||
#include <bsp/aarch64-mmu.h>
|
||||
#include <bsp/frdm-imx93.h>
|
||||
#include <libcpu/mmu-vmsav8-64.h>
|
||||
|
||||
BSP_START_DATA_SECTION static const aarch64_mmu_config_entry
|
||||
frdm_imx93_mmu_config_table[] = {
|
||||
AARCH64_MMU_DEFAULT_SECTIONS,
|
||||
|
||||
{ .begin = IMX93_PERIPHERAL_1_BASE,
|
||||
.end = IMX93_PERIPHERAL_1_BASE + IMX93_PERIPHERAL_1_SIZE,
|
||||
.flags = AARCH64_MMU_DEVICE },
|
||||
|
||||
{ .begin = IMX93_PERIPHERAL_2_BASE,
|
||||
.end = IMX93_PERIPHERAL_2_BASE + IMX93_PERIPHERAL_2_SIZE,
|
||||
.flags = AARCH64_MMU_DEVICE },
|
||||
|
||||
{ .begin = IMX93_PERIPHERAL_3_BASE,
|
||||
.end = IMX93_PERIPHERAL_3_BASE + IMX93_PERIPHERAL_3_SIZE,
|
||||
.flags = AARCH64_MMU_DEVICE },
|
||||
|
||||
{ .begin = IMX93_PERIPHERAL_4_BASE,
|
||||
.end = IMX93_PERIPHERAL_4_BASE + IMX93_PERIPHERAL_4_SIZE,
|
||||
.flags = AARCH64_MMU_DEVICE },
|
||||
|
||||
{ .begin = IMX93_GIC_BASE,
|
||||
.end = IMX93_GIC_BASE + IMX93_GIC_SIZE,
|
||||
.flags = AARCH64_MMU_DEVICE }
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Make weak and let the user override.
|
||||
*/
|
||||
BSP_START_TEXT_SECTION void frdm_imx93_setup_mmu_and_cache( void )
|
||||
__attribute__(( weak ));
|
||||
|
||||
BSP_START_TEXT_SECTION void frdm_imx93_setup_mmu_and_cache( void )
|
||||
{
|
||||
aarch64_mmu_control *control = &aarch64_mmu_instance;
|
||||
|
||||
aarch64_mmu_setup();
|
||||
|
||||
aarch64_mmu_setup_translation_table(
|
||||
control,
|
||||
&frdm_imx93_mmu_config_table[ 0 ],
|
||||
RTEMS_ARRAY_SIZE( frdm_imx93_mmu_config_table )
|
||||
);
|
||||
|
||||
aarch64_mmu_enable( control );
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
actions:
|
||||
- get-string: null
|
||||
- split: null
|
||||
- env-append: null
|
||||
build-type: option
|
||||
copyrights:
|
||||
- Copyright (C) 2026 Rongjie Lee
|
||||
default:
|
||||
- enabled-by: true
|
||||
value:
|
||||
- -mcpu=cortex-a55
|
||||
- -march=armv8.2-a
|
||||
description: |
|
||||
ABI flags
|
||||
enabled-by: true
|
||||
links: []
|
||||
name: ABI_FLAGS
|
||||
type: build
|
||||
@@ -0,0 +1,70 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
arch: aarch64
|
||||
bsp: frdm_imx93
|
||||
build-type: bsp
|
||||
cflags: []
|
||||
copyrights:
|
||||
- Copyright (C) 2026 Rongjie Lee
|
||||
cppflags: []
|
||||
enabled-by: true
|
||||
family: frdm-imx93
|
||||
includes: []
|
||||
install:
|
||||
- destination: ${BSP_INCLUDEDIR}
|
||||
source:
|
||||
- bsps/aarch64/frdm-imx93/include/bsp.h
|
||||
- bsps/aarch64/frdm-imx93/include/tm27.h
|
||||
- destination: ${BSP_INCLUDEDIR}/bsp
|
||||
source:
|
||||
- bsps/aarch64/frdm-imx93/include/bsp/irq.h
|
||||
- bsps/aarch64/frdm-imx93/include/bsp/frdm-imx93.h
|
||||
- destination: ${BSP_INCLUDEDIR}/imx93
|
||||
source:
|
||||
- bsps/aarch64/frdm-imx93/include/imx93/imx93_uartreg.h
|
||||
links:
|
||||
- role: build-dependency
|
||||
uid: ../grp
|
||||
- role: build-dependency
|
||||
uid: ../start
|
||||
- role: build-dependency
|
||||
uid: ../optmmupages
|
||||
- role: build-dependency
|
||||
uid: abi
|
||||
- role: build-dependency
|
||||
uid: ../objclockarmgenerictimer
|
||||
- role: build-dependency
|
||||
uid: ../../obj
|
||||
- role: build-dependency
|
||||
uid: ../../objirq
|
||||
- role: build-dependency
|
||||
uid: ../../dev/irq/objarmgicv3
|
||||
- role: build-dependency
|
||||
uid: ../../objmem
|
||||
- role: build-dependency
|
||||
uid: ../../optcachedata
|
||||
- role: build-dependency
|
||||
uid: ../../optcacheinst
|
||||
- role: build-dependency
|
||||
uid: ../../opto2
|
||||
- role: build-dependency
|
||||
uid: ../../bspopts
|
||||
- role: build-dependency
|
||||
uid: linkercmds
|
||||
source:
|
||||
- bsps/aarch64/frdm-imx93/start/bspstart.c
|
||||
- bsps/aarch64/frdm-imx93/start/bspstarthooks.c
|
||||
- bsps/aarch64/frdm-imx93/start/bspstartmmu.c
|
||||
- bsps/aarch64/frdm-imx93/console/console.c
|
||||
- bsps/aarch64/shared/cache/cache.c
|
||||
- bsps/aarch64/shared/mmu/mmu-setup.c
|
||||
- bsps/aarch64/shared/mmu/vmsav8-64.c
|
||||
- bsps/aarch64/shared/start/start-cpu-mpidr.S
|
||||
- bsps/shared/dev/btimer/btimer-cpucounter.c
|
||||
- bsps/shared/dev/getentropy/getentropy-cpucounter.c
|
||||
- bsps/shared/dev/serial/console-termios-init.c
|
||||
- bsps/shared/dev/serial/console-termios.c
|
||||
- bsps/shared/irq/irq-default-handler.c
|
||||
- bsps/shared/start/bspreset-arm-psci.S
|
||||
- bsps/shared/start/gettargethash-default.c
|
||||
- bsps/shared/start/sbrk.c
|
||||
type: build
|
||||
@@ -0,0 +1,84 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
build-type: config-file
|
||||
content: |
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2026 Rongjie Lee
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
BSP_RAM_BASE = 0x80000000;
|
||||
BSP_RAM_END = 0x96000000;
|
||||
|
||||
BSP_RAM1_BASE = 0x98000000;
|
||||
BSP_RAM1_LENGTH = 0x68000000;
|
||||
|
||||
BSP_IMX93_LOADOFFSET = 0x80200000;
|
||||
|
||||
AARCH64_MMU_TT_PAGES_SIZE = 0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES};
|
||||
|
||||
MEMORY {
|
||||
RAM_MMU : ORIGIN = BSP_RAM_BASE, LENGTH = AARCH64_MMU_TT_PAGES_SIZE
|
||||
RAM : ORIGIN = BSP_IMX93_LOADOFFSET, LENGTH = BSP_RAM_END - BSP_IMX93_LOADOFFSET
|
||||
RAM1 : ORIGIN = BSP_RAM1_BASE, LENGTH = BSP_RAM1_LENGTH
|
||||
NOCACHE : ORIGIN = 0x80100000, LENGTH = 1M
|
||||
}
|
||||
|
||||
REGION_ALIAS ("REGION_START", RAM);
|
||||
REGION_ALIAS ("REGION_VECTOR", RAM);
|
||||
REGION_ALIAS ("REGION_TEXT", RAM);
|
||||
REGION_ALIAS ("REGION_TEXT_LOAD", RAM);
|
||||
REGION_ALIAS ("REGION_RODATA", RAM);
|
||||
REGION_ALIAS ("REGION_RODATA_LOAD", RAM);
|
||||
REGION_ALIAS ("REGION_DATA", RAM);
|
||||
REGION_ALIAS ("REGION_DATA_LOAD", RAM);
|
||||
REGION_ALIAS ("REGION_FAST_TEXT", RAM);
|
||||
REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);
|
||||
REGION_ALIAS ("REGION_FAST_DATA", RAM);
|
||||
REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);
|
||||
REGION_ALIAS ("REGION_BSS", RAM);
|
||||
REGION_ALIAS ("REGION_WORK", RAM);
|
||||
REGION_ALIAS ("REGION_STACK", RAM);
|
||||
REGION_ALIAS ("REGION_NOCACHE", NOCACHE);
|
||||
REGION_ALIAS ("REGION_NOCACHE_LOAD", NOCACHE);
|
||||
|
||||
bsp_stack_exception_size = DEFINED (bsp_stack_exception_size) ? bsp_stack_exception_size : 1024;
|
||||
|
||||
bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;
|
||||
|
||||
bsp_vector_table_in_start_section = 1;
|
||||
bsp_translation_table_base = ORIGIN (RAM_MMU);
|
||||
bsp_translation_table_end = ORIGIN (RAM_MMU) + LENGTH (RAM_MMU);
|
||||
|
||||
OUTPUT_FORMAT ("elf64-littleaarch64")
|
||||
OUTPUT_ARCH (aarch64)
|
||||
|
||||
INCLUDE linkcmds.base
|
||||
copyrights:
|
||||
- Copyright (C) 2026 Rongjie Lee
|
||||
enabled-by: true
|
||||
install-path: ${BSP_LIBDIR}
|
||||
links: []
|
||||
target: linkcmds
|
||||
type: build
|
||||
@@ -11,6 +11,7 @@ default:
|
||||
- aarch64/a53_lp64_qemu
|
||||
- aarch64/a72_ilp32_qemu
|
||||
- aarch64/a72_lp64_qemu
|
||||
- aarch64/frdm_imx93
|
||||
- aarch64/raspberrypi4b
|
||||
- aarch64/rk3399_rockpro64
|
||||
- aarch64/versal_aiedge
|
||||
|
||||
@@ -11,6 +11,7 @@ default:
|
||||
- aarch64/a53_lp64_qemu
|
||||
- aarch64/a72_ilp32_qemu
|
||||
- aarch64/a72_lp64_qemu
|
||||
- aarch64/frdm_imx93
|
||||
- aarch64/raspberrypi4b
|
||||
- aarch64/rk3399_rockpro64
|
||||
- aarch64/versal_aiedge
|
||||
|
||||
Reference in New Issue
Block a user