forked from apache/nuttx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64/imx9: Add support for imx9 series SoMs, imx93 implemented
Adds support for NXP i.MX9-series System-on-Module chips. - Support for i.MX93 is added - CPU is Cortex A55 / ARMv8.2A - The chip also contains a Cortex M33, but no support is provided - Supported drivers include lpuart only for now
- Loading branch information
Showing
15 changed files
with
2,265 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/**************************************************************************** | ||
* arch/arm64/include/imx9/chip.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_ARM64_INCLUDE_IMX9_CHIP_H | ||
#define __ARCH_ARM64_INCLUDE_IMX9_CHIP_H | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
/**************************************************************************** | ||
* Pre-processor Definitions | ||
****************************************************************************/ | ||
|
||
/* Number of bytes in x kibibytes/mebibytes/gibibytes */ | ||
|
||
#define KB(x) ((x) << 10) | ||
#define MB(x) (KB(x) << 10) | ||
#define GB(x) (MB(UINT64_C(x)) << 10) | ||
|
||
#if defined(CONFIG_ARCH_CHIP_IMX93) | ||
|
||
#if CONFIG_ARM_GIC_VERSION == 3 || CONFIG_ARM_GIC_VERSION == 4 | ||
|
||
#define CONFIG_GICD_BASE 0x48000000 | ||
#define CONFIG_GICR_BASE 0x48040000 | ||
#define CONFIG_GICR_OFFSET 0x20000 | ||
|
||
#else | ||
|
||
#error CONFIG_ARM_GIC_VERSION should be 2, 3 or 4 | ||
|
||
#endif /* CONFIG_ARM_GIC_VERSION */ | ||
|
||
#define CONFIG_RAMBANK1_ADDR 0x80000000 | ||
#define CONFIG_RAMBANK1_SIZE MB(128) | ||
|
||
#define CONFIG_DEVICEIO_BASEADDR 0x40000000 | ||
#define CONFIG_DEVICEIO_SIZE MB(512) | ||
|
||
#define MPID_TO_CLUSTER_ID(mpid) ((mpid) & ~0xff) | ||
|
||
#endif | ||
|
||
/**************************************************************************** | ||
* Assembly Macros | ||
****************************************************************************/ | ||
|
||
#ifdef __ASSEMBLY__ | ||
|
||
.macro get_cpu_id xreg0 | ||
mrs \xreg0, mpidr_el1 | ||
ubfx \xreg0, \xreg0, #0, #8 | ||
.endm | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
|
||
#endif /* __ARCH_ARM64_INCLUDE_IMX9_CHIP_H */ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/**************************************************************************** | ||
* arch/arm64/include/imx9/irq.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. | ||
* | ||
****************************************************************************/ | ||
|
||
/* This file should never be included directly but, rather, | ||
* only indirectly through nuttx/irq.h | ||
*/ | ||
|
||
#ifndef __ARCH_ARM64_INCLUDE_IMX9_IRQ_H | ||
#define __ARCH_ARM64_INCLUDE_IMX9_IRQ_H | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
#if defined(CONFIG_ARCH_CHIP_IMX93) | ||
# include <arch/imx9/imx93_irq.h> | ||
#else | ||
# error "Unrecognized i.MX9 architecture" | ||
#endif | ||
|
||
/**************************************************************************** | ||
* Pre-processor Definitions | ||
****************************************************************************/ | ||
|
||
#define IMX9_IRQ_SOFTWARE0 (0) /* Cortex-A55 Software Generated Interrupt 0 */ | ||
#define IMX9_IRQ_SOFTWARE1 (1) /* Cortex-A55 Software Generated Interrupt 1 */ | ||
#define IMX9_IRQ_SOFTWARE2 (2) /* Cortex-A55 Software Generated Interrupt 2 */ | ||
#define IMX9_IRQ_SOFTWARE3 (3) /* Cortex-A55 Software Generated Interrupt 3 */ | ||
#define IMX9_IRQ_SOFTWARE4 (4) /* Cortex-A55 Software Generated Interrupt 4 */ | ||
#define IMX9_IRQ_SOFTWARE5 (5) /* Cortex-A55 Software Generated Interrupt 5 */ | ||
#define IMX9_IRQ_SOFTWARE6 (6) /* Cortex-A55 Software Generated Interrupt 6 */ | ||
#define IMX9_IRQ_SOFTWARE7 (7) /* Cortex-A55 Software Generated Interrupt 7 */ | ||
#define IMX9_IRQ_SOFTWARE8 (8) /* Cortex-A55 Software Generated Interrupt 8 */ | ||
#define IMX9_IRQ_SOFTWARE9 (9) /* Cortex-A55 Software Generated Interrupt 9 */ | ||
#define IMX9_IRQ_SOFTWARE10 (10) /* Cortex-A55 Software Generated Interrupt 10 */ | ||
#define IMX9_IRQ_SOFTWARE11 (11) /* Cortex-A55 Software Generated Interrupt 11 */ | ||
#define IMX9_IRQ_SOFTWARE12 (12) /* Cortex-A55 Software Generated Interrupt 12 */ | ||
#define IMX9_IRQ_SOFTWARE13 (13) /* Cortex-A55 Software Generated Interrupt 13 */ | ||
#define IMX9_IRQ_SOFTWARE14 (14) /* Cortex-A55 Software Generated Interrupt 14 */ | ||
#define IMX9_IRQ_SOFTWARE15 (15) /* Cortex-A55 Software Generated Interrupt 15 */ | ||
#define IMX9_IRQ_VIRTUALMAINTENANCE (25) /* Cortex-A55 Virtual Maintenance Interrupt */ | ||
#define IMX9_IRQ_HYPERVISORTIMER (26) /* Cortex-A55 Hypervisor Timer Interrupt */ | ||
#define IMX9_IRQ_VIRTUALTIMER (27) /* Cortex-A55 Virtual Timer Interrupt */ | ||
#define IMX9_IRQ_LEGACYFASTINT (28) /* Cortex-A55 Legacy nFIQ signal Interrupt */ | ||
#define IMX9_IRQ_SECUREPHYTIMER (29) /* Cortex-A55 Secure Physical Timer Interrupt */ | ||
#define IMX9_IRQ_NONSECUREPHYTIMER (30) /* Cortex-A55 Non-secure Physical Timer Interrupt */ | ||
#define IMX9_IRQ_LEGACYIRQ (31) /* Cortex-A55 Legacy nIRQ Interrupt */ | ||
|
||
#define IMX9_IRQ_EXT (32) /* Vector number of the first ext int */ | ||
|
||
#endif /* __ARCH_ARM64_INCLUDE_IMX9_IRQ_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# For a description of the syntax of this configuration file, | ||
# see the file kconfig-language.txt in the NuttX tools repository. | ||
# | ||
|
||
if ARCH_CHIP_IMX9 | ||
|
||
menu "i.MX9 Chip Selection" | ||
|
||
choice | ||
prompt "i.MX9 Core Configuration" | ||
default ARCH_CHIP_IMX93 | ||
|
||
config ARCH_CHIP_IMX93 | ||
bool "i.MX9 Application Processor" | ||
select ARCH_HAVE_MULTICPU | ||
select ARMV8A_HAVE_GICv3 | ||
select ARCH_CORTEX_A55 | ||
|
||
endchoice # i.MX9 Chip Selection | ||
|
||
endmenu # "i.MX9 Chip Selection" | ||
|
||
menu "i.MX9 Peripheral Selection" | ||
config IMX9_UART1 | ||
bool "UART1" | ||
default n | ||
select UART1_SERIALDRIVER | ||
endmenu # iMX Peripheral Selection | ||
|
||
endif # ARCH_CHIP_IMX9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
############################################################################ | ||
# arch/arm64/src/imx9/Make.defs | ||
# | ||
# 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. | ||
# | ||
############################################################################ | ||
|
||
include common/Make.defs | ||
|
||
# i.MX9-specific C source files | ||
|
||
CHIP_CSRCS = imx9_boot.c | ||
|
||
ifeq ($(CONFIG_ARCH_CHIP_IMX93),y) | ||
CHIP_CSRCS += imx9_lpuart.c | ||
ifeq ($(CONFIG_ARCH_EARLY_PRINT),y) | ||
CHIP_ASRCS = imx93_lowputc.S | ||
endif | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/**************************************************************************** | ||
* arch/arm64/src/imx9/chip.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_ARM64_SRC_IMX9_CHIP_H | ||
#define __ARCH_ARM64_SRC_IMX9_CHIP_H | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
#ifndef __ASSEMBLY__ | ||
# include <nuttx/arch.h> | ||
#endif | ||
|
||
/**************************************************************************** | ||
* Pre-processor Definitions | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Macro Definitions | ||
****************************************************************************/ | ||
|
||
#endif /* __ARCH_ARM64_SRC_IMX9_CHIP_H */ |
Oops, something went wrong.