Browse Source
Port IMX8M Quad SOC to HWMv2. Only the M4 core is enabled. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>collab-hwm
21 changed files with 48 additions and 204 deletions
@ -1,7 +0,0 @@
@@ -1,7 +0,0 @@
|
||||
# |
||||
# Copyright (c) 2017, NXP |
||||
# |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
# |
||||
|
||||
add_subdirectory(${SOC_SERIES}) |
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
# Copyright (c) 2017-2021, NXP |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
config SOC_FAMILY_IMX |
||||
bool |
||||
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE |
||||
|
||||
if SOC_FAMILY_IMX |
||||
|
||||
config SOC_FAMILY |
||||
string |
||||
default "nxp_imx" |
||||
|
||||
|
||||
# Used for default value in FLASH_MCUX_FLEXSPI_XIP |
||||
DT_CHOSEN_Z_FLASH := zephyr,flash |
||||
DT_COMPAT_FLEXSPI := nxp,imx-flexspi |
||||
# Macros to shorten Kconfig definitions |
||||
DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) |
||||
DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) |
||||
|
||||
|
||||
source "soc/soc_legacy/arm/nxp_imx/*/Kconfig.soc" |
||||
|
||||
config SOC_PART_NUMBER |
||||
default SOC_PART_NUMBER_IMX_RT5XX if SOC_SERIES_IMX_RT5XX |
||||
default SOC_PART_NUMBER_IMX_RT6XX if SOC_SERIES_IMX_RT6XX |
||||
default SOC_PART_NUMBER_IMX_RT if SOC_SERIES_IMX_RT |
||||
default SOC_PART_NUMBER_IMX_6X_M4 if SOC_SERIES_IMX_6X_M4 |
||||
default SOC_PART_NUMBER_IMX7_M4 if SOC_SERIES_IMX7_M4 |
||||
default SOC_PART_NUMBER_IMX8MM_M4 if SOC_SERIES_IMX8MM_M4 |
||||
default SOC_PART_NUMBER_IMX8ML_M7 if SOC_SERIES_IMX8ML_M7 |
||||
default SOC_PART_NUMBER_IMX8MQ_M4 if SOC_SERIES_IMX8MQ_M4 |
||||
|
||||
config FLASH_MCUX_FLEXSPI_XIP |
||||
bool "MCUX FlexSPI flash access with xip" |
||||
default $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) |
||||
depends on (CODE_FLEXSPI || CODE_FLEXSPI2 || SOC_SERIES_IMX_RT6XX || SOC_SERIES_IMX_RT5XX) |
||||
select XIP |
||||
help |
||||
Allows for the soc to safely initialize the clocks for the |
||||
FlexSpi when planning to execute code in FlexSpi Memory. |
||||
|
||||
|
||||
endif # SOC_FAMILY_IMX |
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, NXP |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
config SERIAL_INIT_PRIORITY |
||||
default 55 |
||||
depends on SERIAL |
||||
|
||||
source "soc/soc_legacy/arm/nxp_imx/*/Kconfig.defconfig.series" |
@ -1,4 +0,0 @@
@@ -1,4 +0,0 @@
|
||||
# Copyright (c) 2017, NXP |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
source "soc/soc_legacy/arm/nxp_imx/*/Kconfig.series" |
@ -1,18 +0,0 @@
@@ -1,18 +0,0 @@
|
||||
# i.MX8MQ M4 SoC series defconfig |
||||
|
||||
# Copyright (c) 2021, Kwon Tae-young <tykwon@m2i.co.kr> |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
if SOC_SERIES_IMX8MQ_M4 |
||||
|
||||
config SOC_SERIES |
||||
default "mimx8mq6_m4" |
||||
|
||||
config NUM_IRQS |
||||
int |
||||
# must be >= the highest interrupt number used |
||||
default 127 |
||||
|
||||
source "soc/soc_legacy/arm/nxp_imx/mimx8mq6_m4/Kconfig.defconfig.mimx8mq6_m4" |
||||
|
||||
endif # SOC_SERIES_IMX8MQ_M4 |
@ -1,14 +0,0 @@
@@ -1,14 +0,0 @@
|
||||
# i.MX8MQ M4 core series |
||||
|
||||
# Copyright (c) 2021, Kwon Tae-young <tykwon@m2i.co.kr> |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
config SOC_SERIES_IMX8MQ_M4 |
||||
bool "i.MX8MQ M4 Core Series" |
||||
select ARM |
||||
select CPU_CORTEX_M4 |
||||
select SOC_FAMILY_IMX |
||||
select CPU_HAS_FPU |
||||
select CPU_HAS_ARM_MPU |
||||
help |
||||
Enable support for i.MX8MQ M4 MCU series |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
# i.MX8MQ M4 SoC series |
||||
|
||||
# Copyright (c) 2021, Kwon Tae-young <tykwon@m2i.co.kr> |
||||
# SPDX-License-Identifier: Apache-2.0 |
||||
|
||||
choice |
||||
prompt "i.MX8MQ M4 Selection" |
||||
depends on SOC_SERIES_IMX8MQ_M4 |
||||
|
||||
config SOC_MIMX8MQ6 |
||||
bool "SOC_MIMX8MQ6" |
||||
select HAS_MCUX |
||||
select HAS_MCUX_CCM |
||||
select HAS_MCUX_RDC |
||||
select HAS_MCUX_IOMUXC |
||||
|
||||
endchoice |
||||
|
||||
if SOC_SERIES_IMX8MQ_M4 |
||||
|
||||
config SOC_PART_NUMBER_MIMX8MQ6DVAJZ |
||||
bool |
||||
|
||||
config SOC_PART_NUMBER_IMX8MQ_M4 |
||||
string |
||||
default "MIMX8MQ6DVAJZ" if SOC_PART_NUMBER_MIMX8MQ6DVAJZ |
||||
help |
||||
This string holds the full part number of the SoC. It is a hidden option |
||||
that you should not set directly. The part number selection choice defines |
||||
the default value for this string. |
||||
|
||||
endif # SOC_SERIES_IMX8MQ_M4 |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023, NXP |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
|
||||
#include <fsl_clock.h> |
||||
#include <fsl_flexspi.h> |
||||
#include <soc.h> |
||||
#include <errno.h> |
||||
#include <zephyr/irq.h> |
||||
#include <zephyr/dt-bindings/clock/imx_ccm_rev2.h> |
||||
|
||||
uint32_t flexspi_clock_set_freq(uint32_t clock_name, uint32_t rate) |
||||
{ |
||||
clock_name_t root; |
||||
uint32_t root_rate; |
||||
FLEXSPI_Type *flexspi; |
||||
clock_root_t flexspi_clk; |
||||
clock_ip_name_t clk_gate; |
||||
uint32_t divider; |
||||
|
||||
switch (clock_name) { |
||||
case IMX_CCM_FLEXSPI_CLK: |
||||
flexspi_clk = kCLOCK_Root_Flexspi1; |
||||
flexspi = (FLEXSPI_Type *)DT_REG_ADDR(DT_NODELABEL(flexspi)); |
||||
clk_gate = kCLOCK_Flexspi1; |
||||
break; |
||||
case IMX_CCM_FLEXSPI2_CLK: |
||||
flexspi_clk = kCLOCK_Root_Flexspi2; |
||||
flexspi = (FLEXSPI_Type *)DT_REG_ADDR(DT_NODELABEL(flexspi2)); |
||||
clk_gate = kCLOCK_Flexspi2; |
||||
break; |
||||
default: |
||||
return -ENOTSUP; |
||||
} |
||||
root = CLOCK_GetRootClockSource(flexspi_clk, |
||||
CLOCK_GetRootClockMux(flexspi_clk)); |
||||
/* Get clock root frequency */ |
||||
root_rate = CLOCK_GetFreq(root); |
||||
/* Select a divider based on root clock frequency. We round the
|
||||
* divider up, so that the resulting clock frequency is lower than |
||||
* requested when we can't output the exact requested frequency |
||||
*/ |
||||
divider = ((root_rate + (rate - 1)) / rate); |
||||
/* Cap divider to max value */ |
||||
divider = MIN(divider, CCM_CLOCK_ROOT_CONTROL_DIV_MASK); |
||||
|
||||
while (FLEXSPI_GetBusIdleStatus(flexspi) == false) { |
||||
/* Spin */ |
||||
} |
||||
FLEXSPI_Enable(flexspi, false); |
||||
|
||||
CLOCK_DisableClock(clk_gate); |
||||
|
||||
CLOCK_SetRootClockDiv(flexspi_clk, divider); |
||||
|
||||
CLOCK_EnableClock(clk_gate); |
||||
|
||||
FLEXSPI_Enable(flexspi, true); |
||||
|
||||
FLEXSPI_SoftwareReset(flexspi); |
||||
|
||||
return 0; |
||||
} |
Loading…
Reference in new issue