Skip to content

Commit cddf01d

Browse files
davidmissaelnashif
authored andcommitted
samples: drivers: memc: enable support for FRDM_RW612
Enable support for FRDM_RW612 with memc driver sample, using attached aps6404l PSRAM. Signed-off-by: David Missael Maciel <[email protected]>
1 parent 05acc88 commit cddf01d

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# In order to safely access the PSRAM on port B of the RW FlexSPI peripheral,
5+
# the QSPI flash on port A must be configured by the application. Otherwise,
6+
# the PSRAM configuration will overwrite the LUT entries for the QSPI flash,
7+
# and the application will no longer be able to XIP from the flash.
8+
# To make sure the QSPI flash is configured, enable flash drivers.
9+
CONFIG_FLASH=y
10+
11+
# Initialization priorities are critical here. The FlexSPI MEMC driver must
12+
# initialize first. Then, the QSPI flash driver must initialize to program
13+
# the LUT table for port A. Finally, the PSRAM driver can initialize and
14+
# program the LUT table for port B
15+
CONFIG_MEMC_MCUX_FLEXSPI_INIT_PRIORITY=0
16+
CONFIG_FLASH_INIT_PRIORITY=50
17+
CONFIG_MEMC_INIT_PRIORITY=60
18+
19+
# This board has the PSRAM attached to the same FLEXSPI device as the flash
20+
# chip used for XIP, so we must explicitly enable the FLEXSPI MEMC driver
21+
# to reconfigure the flash device it is executing from
22+
CONFIG_MEMC_MCUX_FLEXSPI_INIT_XIP=y
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
sram-ext = &aps6404l;
10+
};
11+
};
12+
13+
&w25q512jvfiq {
14+
/*
15+
* Lower max FlexSPI frequency to 109MHz, as the PSRAM does not support
16+
* higher frequencies at 3.3V
17+
*/
18+
spi-max-frequency = <109000000>;
19+
};
20+
21+
&aps6404l {
22+
status = "okay";
23+
};
24+
25+
&pinctrl {
26+
pinmux_flexspi_safe: pinmux-flexspi-safe {
27+
group0 {
28+
pinmux = <IO_MUX_QUAD_SPI_PSRAM_IO35
29+
IO_MUX_QUAD_SPI_PSRAM_IO36
30+
IO_MUX_QUAD_SPI_PSRAM_IO38
31+
IO_MUX_QUAD_SPI_PSRAM_IO39
32+
IO_MUX_QUAD_SPI_PSRAM_IO40
33+
IO_MUX_QUAD_SPI_PSRAM_IO41>;
34+
slew-rate = "normal";
35+
};
36+
37+
group1 {
38+
pinmux = <IO_MUX_QUAD_SPI_PSRAM_IO37>;
39+
slew-rate = "normal";
40+
bias-pull-down;
41+
};
42+
};
43+
};
44+
45+
/* Override pin control state to use one that only changes the PSRAM pin
46+
* configuration
47+
*/
48+
&flexspi {
49+
pinctrl-0 = <&pinmux_flexspi_safe>;
50+
pinctrl-names = "default";
51+
};

0 commit comments

Comments
 (0)