Skip to content

Commit 02aeb57

Browse files
committed
MXRT1050: Update Flexspi driver to move functions to RAM
These functions are used to READ/WRITE to the Flexspi NOR Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent f469f71 commit 02aeb57

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/drivers/fsl_flexspi.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ uint32_t FLEXSPI_GetInstance(FLEXSPI_Type *base);
7878
* @param base FLEXSPI base pointer.
7979
* @param config Flash configuration parameters.
8080
*/
81-
static uint32_t FLEXSPI_ConfigureDll(FLEXSPI_Type *base, flexspi_device_config_t *config);
81+
AT_QUICKACCESS_SECTION_CODE(static uint32_t FLEXSPI_ConfigureDll(FLEXSPI_Type *base, flexspi_device_config_t *config));
8282

8383
/*!
8484
* @brief Check and clear IP command execution errors.
8585
*
8686
* @param base FLEXSPI base pointer.
8787
* @param status interrupt status.
8888
*/
89-
status_t FLEXSPI_CheckAndClearError(FLEXSPI_Type *base, uint32_t status);
89+
AT_QUICKACCESS_SECTION_CODE(status_t FLEXSPI_CheckAndClearError(FLEXSPI_Type *base, uint32_t status));
9090

9191
/*******************************************************************************
9292
* Variables
@@ -164,7 +164,7 @@ static uint32_t FLEXSPI_ConfigureDll(FLEXSPI_Type *base, flexspi_device_config_t
164164
}
165165
break;
166166
default:
167-
assert(false);
167+
//assert(false);
168168
break;
169169
}
170170

@@ -216,7 +216,7 @@ status_t FLEXSPI_CheckAndClearError(FLEXSPI_Type *base, uint32_t status)
216216
}
217217
else
218218
{
219-
assert(false);
219+
//assert(false);
220220
}
221221

222222
/* Clear the flags. */
@@ -246,7 +246,9 @@ void FLEXSPI_Init(FLEXSPI_Type *base, const flexspi_config_t *config)
246246

247247
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
248248
/* Enable the flexspi clock */
249-
CLOCK_EnableClock(s_flexspiClock[FLEXSPI_GetInstance(base)]);
249+
//CLOCK_EnableClock(s_flexspiClock[FLEXSPI_GetInstance(base)]);
250+
/* Access the register directly to avoid warnings accessing non ran functions */
251+
CCM->CCGR6 |= CCM_CCGR6_CG5_MASK;
250252
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
251253

252254
#if defined(FSL_FEATURE_FLEXSPI_HAS_RESET) && FSL_FEATURE_FLEXSPI_HAS_RESET
@@ -497,7 +499,7 @@ void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config,
497499
*/
498500
void FLEXSPI_UpdateLUT(FLEXSPI_Type *base, uint32_t index, const uint32_t *cmd, uint32_t count)
499501
{
500-
assert(index < 64U);
502+
//assert(index < 64U);
501503

502504
uint8_t i = 0;
503505
volatile uint32_t *lutBase;

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/drivers/fsl_flexspi.h

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ extern "C" {
346346
* @param base FLEXSPI peripheral base address.
347347
* @param config FLEXSPI configure structure.
348348
*/
349-
void FLEXSPI_Init(FLEXSPI_Type *base, const flexspi_config_t *config);
349+
AT_QUICKACCESS_SECTION_CODE(void FLEXSPI_Init(FLEXSPI_Type *base, const flexspi_config_t *config));
350350

351351
/*!
352352
* @brief Gets default settings for FLEXSPI.
353353
*
354354
* @param config FLEXSPI configuration structure.
355355
*/
356-
void FLEXSPI_GetDefaultConfig(flexspi_config_t *config);
356+
AT_QUICKACCESS_SECTION_CODE(void FLEXSPI_GetDefaultConfig(flexspi_config_t *config));
357357

358358
/*!
359359
* @brief Deinitializes the FLEXSPI module.
@@ -374,7 +374,9 @@ void FLEXSPI_Deinit(FLEXSPI_Type *base);
374374
* @param config Flash configuration parameters.
375375
* @param port FLEXSPI Operation port.
376376
*/
377-
void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port);
377+
AT_QUICKACCESS_SECTION_CODE(void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base,
378+
flexspi_device_config_t *config,
379+
flexspi_port_t port));
378380

379381
/*!
380382
* @brief Software reset for the FLEXSPI logic.
@@ -384,7 +386,7 @@ void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config,
384386
*
385387
* @param base FLEXSPI peripheral base address.
386388
*/
387-
static inline void FLEXSPI_SoftwareReset(FLEXSPI_Type *base)
389+
AT_QUICKACCESS_SECTION_CODE(static inline void FLEXSPI_SoftwareReset(FLEXSPI_Type *base))
388390
{
389391
base->MCR0 |= FLEXSPI_MCR0_SWRESET_MASK;
390392
while (0U != (base->MCR0 & FLEXSPI_MCR0_SWRESET_MASK))
@@ -398,7 +400,7 @@ static inline void FLEXSPI_SoftwareReset(FLEXSPI_Type *base)
398400
* @param base FLEXSPI peripheral base address.
399401
* @param enable True means enable FLEXSPI, false means disable.
400402
*/
401-
static inline void FLEXSPI_Enable(FLEXSPI_Type *base, bool enable)
403+
AT_QUICKACCESS_SECTION_CODE(static inline void FLEXSPI_Enable(FLEXSPI_Type *base, bool enable))
402404
{
403405
if (enable)
404406
{
@@ -568,7 +570,7 @@ static inline uint32_t FLEXSPI_GetInterruptStatusFlags(FLEXSPI_Type *base)
568570
* @param base FLEXSPI peripheral base address.
569571
* @param interrupt status flag.
570572
*/
571-
static inline void FLEXSPI_ClearInterruptStatusFlags(FLEXSPI_Type *base, uint32_t mask)
573+
AT_QUICKACCESS_SECTION_CODE(static inline void FLEXSPI_ClearInterruptStatusFlags(FLEXSPI_Type *base, uint32_t mask))
572574
{
573575
base->INTR |= mask;
574576
}
@@ -637,7 +639,7 @@ static inline flexspi_ahb_error_code_t FLEXSPI_GetAHBCommandErrorCode(FLEXSPI_Ty
637639
* @retval true Bus is idle.
638640
* @retval false Bus is busy.
639641
*/
640-
static inline bool FLEXSPI_GetBusIdleStatus(FLEXSPI_Type *base)
642+
AT_QUICKACCESS_SECTION_CODE(static inline bool FLEXSPI_GetBusIdleStatus(FLEXSPI_Type *base))
641643
{
642644
return (0U != (base->STS0 & FLEXSPI_STS0_ARBIDLE_MASK)) && (0U != (base->STS0 & FLEXSPI_STS0_SEQIDLE_MASK));
643645
}
@@ -698,7 +700,8 @@ static inline void FLEXSPI_EnableAHBParallelMode(FLEXSPI_Type *base, bool enable
698700
* @param cmd Command sequence array.
699701
* @param count Number of sequences.
700702
*/
701-
void FLEXSPI_UpdateLUT(FLEXSPI_Type *base, uint32_t index, const uint32_t *cmd, uint32_t count);
703+
AT_QUICKACCESS_SECTION_CODE(void FLEXSPI_UpdateLUT(FLEXSPI_Type *base, uint32_t index,
704+
const uint32_t *cmd, uint32_t count));
702705

703706
/*!
704707
* @brief Writes data into FIFO.
@@ -735,7 +738,8 @@ static inline uint32_t FLEXSPI_ReadData(FLEXSPI_Type *base, uint8_t fifoIndex)
735738
* @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequence error detected
736739
* @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected
737740
*/
738-
status_t FLEXSPI_WriteBlocking(FLEXSPI_Type *base, uint32_t *buffer, size_t size);
741+
AT_QUICKACCESS_SECTION_CODE(status_t FLEXSPI_WriteBlocking(FLEXSPI_Type *base,
742+
uint32_t *buffer, size_t size));
739743

740744
/*!
741745
* @brief Receives a buffer of data bytes using a blocking method.
@@ -748,7 +752,8 @@ status_t FLEXSPI_WriteBlocking(FLEXSPI_Type *base, uint32_t *buffer, size_t size
748752
* @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequencen error detected
749753
* @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected
750754
*/
751-
status_t FLEXSPI_ReadBlocking(FLEXSPI_Type *base, uint32_t *buffer, size_t size);
755+
AT_QUICKACCESS_SECTION_CODE(status_t FLEXSPI_ReadBlocking(FLEXSPI_Type *base,
756+
uint32_t *buffer, size_t size));
752757

753758
/*!
754759
* @brief Execute command to transfer a buffer data bytes using a blocking method.
@@ -759,7 +764,8 @@ status_t FLEXSPI_ReadBlocking(FLEXSPI_Type *base, uint32_t *buffer, size_t size)
759764
* @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequence error detected
760765
* @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected
761766
*/
762-
status_t FLEXSPI_TransferBlocking(FLEXSPI_Type *base, flexspi_transfer_t *xfer);
767+
AT_QUICKACCESS_SECTION_CODE(status_t FLEXSPI_TransferBlocking(FLEXSPI_Type *base,
768+
flexspi_transfer_t *xfer));
763769
/*! @} */
764770

765771
/*!

0 commit comments

Comments
 (0)