-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32N6: add XSPI PSRAM support #85564
STM32N6: add XSPI PSRAM support #85564
Conversation
Test results of
|
da9e0a1
to
32d2ed1
Compare
32d2ed1
to
9271146
Compare
Rebased to fix conflicts |
drivers/memc/memc_stm32_xspi_psram.c
Outdated
cmd.DataMode = HAL_XSPI_DATA_8_LINES; | ||
cmd.DataLength = 2; | ||
cmd.DataDTRMode = HAL_XSPI_DATA_DTR_ENABLE; | ||
cmd.DummyCycles = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done by the cmd = {0};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
drivers/memc/memc_stm32_xspi_psram.c
Outdated
cmd.OperationType = HAL_XSPI_OPTYPE_READ_CFG; | ||
cmd.Instruction = READ_CMD; | ||
cmd.DummyCycles = DUMMY_CLK_CYCLES_READ; | ||
cmd.DQSMode = HAL_XSPI_DQS_ENABLE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already done at line 297
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
drivers/memc/memc_stm32_xspi_psram.c
Outdated
} | ||
|
||
mem_mapped_cfg.TimeOutActivation = HAL_XSPI_TIMEOUT_COUNTER_ENABLE; | ||
mem_mapped_cfg.TimeoutPeriodClock = 0x34; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is a 'magic' value coming from the stm32Cube
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, should I add a comment to say that?
9271146
to
4f72d27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
4f72d27
to
1a970c4
Compare
1a970c4
to
4784e0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
drivers/memc/memc_stm32_xspi_psram.c
Outdated
return 0; | ||
} | ||
|
||
uint32_t ap_memory_read_reg(XSPI_HandleTypeDef *hxspi, uint32_t address, uint8_t *value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint32_t ap_memory_read_reg(XSPI_HandleTypeDef *hxspi, uint32_t address, uint8_t *value, | |
static uint32_t ap_memory_read_reg(XSPI_HandleTypeDef *hxspi, uint32_t address, uint8_t *value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
c23fb7b
to
f2641c2
Compare
115b417
to
435df8c
Compare
Add bindings for STM32 XSPI PSRAM Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
435df8c
to
00d5467
Compare
static int ap_memory_write_reg(XSPI_HandleTypeDef *hxspi, uint32_t address, uint8_t *value) | ||
{ | ||
XSPI_RegularCmdTypeDef cmd = {0}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if cmd is {0], you probably save some init below assigning cmd.xx to a value which is also 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed lines that were already set at 0 but kept them in comment, I think they are still useful for a better understanding of the commands.
cfg.nCSOverride = HAL_XSPI_CSSEL_OVR_NCS1; | ||
cfg.IOPort = HAL_XSPIM_IOPORT_1; | ||
|
||
if (HAL_XSPIM_Config(&hxspi, &cfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (HAL_XSPIM_Config(&hxspi, &cfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { | |
if (HAL_XSPIM_Config(&hxspi, &cfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) { | |
LOG_ERR("XSPIMgr Init failed"); | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Add a driver for STM32 XSPI PSRAM in memory mapped mode. Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Add XSPI1 node for STM32N6 Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Enables XSPI PSRAM on the STM32N6570-DK board. Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
00d5467
to
e8d3d06
Compare
Add XSPI PSRAM support for STM32N6. Enable XSPI PSRAM on STM32N6570-DK.