Skip to content

Conversation

@mmahadevan108
Copy link
Contributor

The MEMC driver is initialized before the FlexSPI driver and hangs during FlexSPI init. Initialize the FlexSPI clock to 50MHz before the speed is set to the optimum speed by the FlexSPI driver.

Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which memc driver are you talking about? it should be clarified in the commit message first of all, and need to know if we need to find a better solution if this problem will occur generally

@danieldegrasse
Copy link
Contributor

The MEMC driver is initialized before the FlexSPI driver and hangs during FlexSPI init. Initialize the FlexSPI clock to 50MHz before the speed is set to the optimum speed by the FlexSPI driver.

Is the issue here that the FlexSPI was previously not being clocked prior to memc init, causing a hang? If so, I think this solution generally follows the pattern we are currently using for other peripheral clocking

@mmahadevan108
Copy link
Contributor Author

which memc driver are you talking about? it should be clarified in the commit message first of all, and need to know if we need to find a better solution if this problem will occur generally

Commit message updated to include the memc driver details.

@mmahadevan108
Copy link
Contributor Author

The MEMC driver is initialized before the FlexSPI driver and hangs during FlexSPI init. Initialize the FlexSPI clock to 50MHz before the speed is set to the optimum speed by the FlexSPI driver.

Is the issue here that the FlexSPI was previously not being clocked prior to memc init, causing a hang? If so, I think this solution generally follows the pattern we are currently using for other peripheral clocking

Yes. FlexSPI clock is left un initialized at boot time causing a hang.

@decsny
Copy link
Member

decsny commented Apr 18, 2024

which memc driver are you talking about? it should be clarified in the commit message first of all, and need to know if we need to find a better solution if this problem will occur generally

Commit message updated to include the memc driver details.

The commit message should also say what the "flexspi driver" is, as there are multiple flexspi drivers just like there are multiple memc drivers.

danieldegrasse
danieldegrasse previously approved these changes Apr 19, 2024
@mmahadevan108 mmahadevan108 requested a review from decsny April 19, 2024 15:38
@mmahadevan108
Copy link
Contributor Author

@decsny, kindly re-review

decsny
decsny previously approved these changes Apr 22, 2024
@decsny
Copy link
Member

decsny commented Apr 22, 2024

I still think this should not have to be done in board code but don't know the complications so not blocking it right now

@mmahadevan108
Copy link
Contributor Author

@dleach02, can you please review and approve

The MEMC driver in memc_mcux_flexspi.c is initialized
before the FlexSPI driver (flash_mcux_flexspi_nor.c)
and hangs during FlexSPI init. Initialize the FlexSPI
clock to 50MHz before the speed is set to the optimum
speed by the FlexSPI driver.

Signed-off-by: Mahesh Mahadevan <[email protected]>
Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reapprove

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it this (board.c used for clock setup) is an interim solution until we have something like #70467 available?

@fabiobaltieri fabiobaltieri merged commit 4968021 into zephyrproject-rtos:main Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants