Skip to content

Commit

Permalink
mcux: add RT700 files
Browse files Browse the repository at this point in the history
add RT700 files from sdk github main branch

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
  • Loading branch information
lucien-nxp committed Oct 24, 2024
1 parent 99570ee commit 75378ac
Show file tree
Hide file tree
Showing 354 changed files with 1,229,639 additions and 384 deletions.
7 changes: 5 additions & 2 deletions mcux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ zephyr_compile_definitions(${MCUX_CPU})
# practice, drilling down like this avoids the need for repetitive
# build scripts for every mcux device.
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_clock.c)
if (${MCUX_DEVICE} MATCHES "LPC|MIMXRT6|MIMXRT5|RW6|MCXN.4.")
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
if (${MCUX_DEVICE} MATCHES "LPC|MIMXRT6|MIMXRT5|MIMXRT7|RW6|MCXN.4.")
# fsl_power.c contains ARM specific symbols, which shouldn't be included for Xtensa cores
if (NOT ${MCUX_DEVICE} MATCHES "_dsp|_hifi1|_hifi4")
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_power.c)
endif()
zephyr_library_sources(mcux-sdk/devices/${MCUX_DEVICE_PATH}/drivers/fsl_reset.c)
zephyr_library_sources_ifdef(CONFIG_HWINFO_RW61X mcux-sdk/devices/${MCUX_DEVICE}/drivers/fsl_ocotp.c)
endif()
Expand Down
8 changes: 7 additions & 1 deletion mcux/hal_nxp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ elseif (CONFIG_SOC_MCXN947_CPU1)
include(device_system_MCXN947_cm33_core1)
elseif (CONFIG_SOC_MCXN236)
include(device_system_MCXN236)
elseif (CONFIG_SOC_MIMXRT798S_CM33_CPU0)
include(device_system_MIMXRT798S_cm33_core0)
elseif (CONFIG_SOC_MIMXRT798S_CM33_CPU1)
include(device_system_MIMXRT798S_cm33_core1)
else()
include(device_system)
endif()
Expand All @@ -140,6 +144,7 @@ include_driver_ifdef(CONFIG_COUNTER_MCUX_CTIMER ctimer driver_ctimer)
include_driver_ifdef(CONFIG_COUNTER_MCUX_LPC_RTC lpc_rtc driver_lpc_rtc)
include_driver_ifdef(CONFIG_DMA_MCUX_LPC lpc_dma driver_lpc_dma)
include_driver_ifdef(CONFIG_GPIO_MCUX_LPC lpc_gpio driver_lpc_gpio)
include_driver_ifdef(CONFIG_GPIO_MCUX gpio driver_gpio)
include_driver_ifdef(CONFIG_NXP_PINT pint driver_pint)
include_driver_ifdef(CONFIG_NXP_PINT inputmux driver_inputmux)
include_driver_ifdef(CONFIG_I2C_MCUX_FLEXCOMM flexcomm driver_flexcomm)
Expand Down Expand Up @@ -264,6 +269,7 @@ include_driver_ifdef(CONFIG_MCUX_LPCMP lpcmp driver_lpcmp)
include_driver_ifdef(CONFIG_NXP_RF_IMU imu driver_imu)
include_driver_ifdef(CONFIG_TRDC_MCUX_TRDC trdc driver_trdc)
include_driver_ifdef(CONFIG_S3MU_MCUX_S3MU s3mu driver_s3mu)
include_driver_ifdef(CONFIG_HAS_GLIKEY glikey driver_glikey)
include_driver_ifdef(CONFIG_PINCTRL_NXP_KINETIS port driver_port)
if(CONFIG_BT_NXP)
include_driver_ifdef(CONFIG_SOC_SERIES_MCXW spc driver_spc)
Expand All @@ -276,7 +282,7 @@ endif()

if ((${MCUX_DEVICE} MATCHES "MIMXRT1[0-9][0-9][0-9]") AND (NOT (CONFIG_SOC_MIMXRT1166_CM4 OR CONFIG_SOC_MIMXRT1176_CM4 OR CONFIG_SOC_MIMXRT1189_CM33)))
include_driver_ifdef(CONFIG_HAS_MCUX_CACHE cache/armv7-m7 driver_cache_armv7_m7)
elseif((${MCUX_DEVICE} MATCHES "MIMXRT(5|6)") OR (${MCUX_DEVICE} MATCHES "RW61") OR (${MCUX_DEVICE} MATCHES "MCXN.4."))
elseif((${MCUX_DEVICE} MATCHES "MIMXRT(5|6|7)") OR (${MCUX_DEVICE} MATCHES "RW61") OR (${MCUX_DEVICE} MATCHES "MCXN.4."))
include_driver_ifdef(CONFIG_HAS_MCUX_CACHE cache/cache64 driver_cache_cache64)
elseif((${MCUX_DEVICE} MATCHES "MK(28|66)") OR (${MCUX_DEVICE} MATCHES "MKE(14|16|18)") OR (CONFIG_SOC_MIMXRT1166_CM4) OR (CONFIG_SOC_MIMXRT1176_CM4))
include_driver_ifdef(CONFIG_HAS_MCUX_CACHE cache/lmem driver_cache_lmem)
Expand Down
10 changes: 10 additions & 0 deletions mcux/mcux-sdk/boards/mimxrt700evk/flash_config/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause

# driver_flash_config_mimxrt700evk
config MCUX_USE_driver_flash_config_mimxrt700evk
bool "Flash config"
select MCUX_USE_driver_iap
help
flash config block
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Description: Flash config; user_visible: True
include_guard(GLOBAL)
message("driver_flash_config component is included.")

target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/flash_config.c
)

target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/.
)


include(driver_iap)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Description: Flash config; user_visible: True
include_guard(GLOBAL)
message("driver_flash_config_mimxrt700evk component is included.")

target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/flash_config.c
)

target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/.
)


include(driver_iap)
125 changes: 125 additions & 0 deletions mcux/mcux-sdk/boards/mimxrt700evk/flash_config/flash_config.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
* Copyright 2023 NXP
* All rights reserved.
*
* SPDXLicense-Identifier: BSD-3-Clause
*/
#include "flash_config.h"

/* Component ID definition, used by tools. */
#ifndef FSL_COMPONENT_ID
#define FSL_COMPONENT_ID "platform.drivers.flash_config"
#endif

/*******************************************************************************
* Code
******************************************************************************/
#if defined(BOOT_HEADER_ENABLE) && (BOOT_HEADER_ENABLE == 1)
#if defined(__ARMCC_VERSION) || defined(__GNUC__)
__attribute__((section(".flash_conf"), used))
#elif defined(__ICCARM__)
#pragma location = ".flash_conf"
#endif

const fc_static_platform_config_t flash_config = {
.xspi_fcb_block = {
.memConfig =
{
.tag = FC_XSPI_CFG_BLK_TAG,
.version = FC_XSPI_CFG_BLK_VERSION,
.readSampleClkSrc = kXSPIReadSampleClk_ExternalInputFromDqsPad,
.csHoldTime = 3,
.csSetupTime = 3,
.deviceModeCfgEnable = 1,
.deviceModeType = 2,
.waitTimeCfgCommands = 1,
.deviceModeSeq =
{
.seqNum = 1,
.seqId = 6, /* See Lookup table for more details */
.reserved = 0,
},
.deviceModeArg = 2, /* Enable OPI DDR mode */
.controllerMiscOption =
(1u << Fc_XspiMiscOffset_SafeConfigFreqEnable) | (1u << Fc_XspiMiscOffset_DdrModeEnable),
.deviceType = 1,
.sflashPadType = 8,
.serialClkFreq = Fc_XspiSerialClk_200MHz,
.sflashA1Size = 64ul * 1024u * 1024u,
.busyOffset = 0u,
.busyBitPolarity = 0u,
.lookupTable =
{
/*Read*/
[0] =
FC_XSPI_LUT_SEQ(FC_CMD_DDR, FC_XSPI_8PAD, 0xEE, FC_CMD_DDR, FC_XSPI_8PAD, 0x11),
[1] =
FC_XSPI_LUT_SEQ(FC_CMD_RADDR_DDR, FC_XSPI_8PAD, 0x20, FC_CMD_DUMMY_SDR, FC_XSPI_8PAD, 0x12),
[2] =
FC_XSPI_LUT_SEQ(FC_CMD_DUMMY_SDR, FC_XSPI_8PAD, 0x2, FC_CMD_READ_DDR, FC_XSPI_8PAD, 0x4),
[3] =
FC_XSPI_LUT_SEQ(FC_CMD_STOP, FC_XSPI_8PAD, 0x0, 0, 0, 0),

/*Read status SPI*/
[5 * 1 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_SDR, FC_XSPI_1PAD, 0x05, FC_CMD_READ_SDR, FC_XSPI_1PAD, 0x04),

/* Read Status OPI */
[5 * 2 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_DDR, FC_XSPI_8PAD, 0x05, FC_CMD_DDR, FC_XSPI_8PAD, 0xFA),
[5 * 2 + 1] =
FC_XSPI_LUT_SEQ(FC_CMD_RADDR_DDR, FC_XSPI_8PAD, 0x20, FC_CMD_DUMMY_SDR, FC_XSPI_8PAD, 0x12),
[5 * 2 + 2] =
FC_XSPI_LUT_SEQ(FC_CMD_DUMMY_SDR, FC_XSPI_8PAD, 0x2, FC_CMD_READ_DDR, FC_XSPI_8PAD, 0x4),
[5 * 2 + 3] =
FC_XSPI_LUT_SEQ(FC_CMD_STOP, FC_XSPI_8PAD, 0x0, 0, 0, 0),

/*Write enable*/
[5 * 3 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_SDR, FC_XSPI_1PAD, 0x06, FC_CMD_STOP, FC_XSPI_1PAD, 0x04),

/* Write Enable - OPI */
[5 * 4 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_DDR, FC_XSPI_8PAD, 0x06, FC_CMD_DDR, FC_XSPI_8PAD, 0xF9),

/* Erase Sector */
[5 * 5 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_DDR, FC_XSPI_8PAD, 0x21, FC_CMD_DDR, FC_XSPI_8PAD, 0xDE),
[5 * 5 + 1] =
FC_XSPI_LUT_SEQ(FC_CMD_RADDR_DDR, FC_XSPI_8PAD, 0x20, FC_CMD_STOP, FC_XSPI_8PAD, 0x0),

/* Enable OPI DDR mode */
[5 * 6 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_SDR, FC_XSPI_1PAD, 0x72, FC_CMD_SDR, FC_XSPI_1PAD, 0x00),
[5 * 6 + 1] =
FC_XSPI_LUT_SEQ(FC_CMD_SDR, FC_XSPI_1PAD, 0x00, FC_CMD_SDR, FC_XSPI_1PAD, 0x00),
[5 * 6 + 2] =
FC_XSPI_LUT_SEQ(FC_CMD_SDR, FC_XSPI_1PAD, 0x00, FC_CMD_WRITE_SDR, FC_XSPI_1PAD, 0x01),

/* Page program */
[5 * 9 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_DDR, FC_XSPI_8PAD, 0x12, FC_CMD_DDR, FC_XSPI_8PAD, 0xED),
[5 * 9 + 1] =
FC_XSPI_LUT_SEQ(FC_CMD_RADDR_DDR, FC_XSPI_8PAD, 0x20, FC_CMD_WRITE_DDR, FC_XSPI_8PAD, 0x4),

/* Erase Chip */
[5 * 11 + 0] =
FC_XSPI_LUT_SEQ(FC_CMD_DDR, FC_XSPI_8PAD, 0x60, FC_CMD_DDR, FC_XSPI_8PAD, 0x9F),
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.ipcmdSerialClkFreq = 1u,
.serialNorType = 2u,
.blockSize = 64u * 1024u,
.flashStateCtx = 0x07008200u,
},
#ifdef BOOT_ENABLE_XSPI1_PSRAM
.psram_config_block = {
.xmcdHeader = 0xC0010008,
.xmcdOpt0 = 0xC0000700,
},
#endif
};

#endif /* BOOT_HEADER_ENABLE */
Loading

0 comments on commit 75378ac

Please sign in to comment.