Skip to content

Commit

Permalink
xtensa/esp32s3: Fix octal lines mode SPIRAM blocking issue
Browse files Browse the repository at this point in the history
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
  • Loading branch information
cwespressif authored and pkarashchenko committed Sep 15, 2023
1 parent fa620de commit 827c2df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions arch/xtensa/src/esp32s3/esp32s3_psram_octal.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ static size_t g_psram_size;
*
****************************************************************************/

static void set_psram_reg(int spi_num, const struct opi_psram_reg *in_reg)
static void IRAM_ATTR set_psram_reg(int spi_num,
const struct opi_psram_reg *in_reg)
{
esp_rom_spiflash_read_mode_t mode = ESP_ROM_SPIFLASH_OPI_DTR_MODE;
int cmd_len = 16;
Expand Down Expand Up @@ -234,7 +235,8 @@ static void set_psram_reg(int spi_num, const struct opi_psram_reg *in_reg)
*
****************************************************************************/

static void get_psram_reg(int spi_num, struct opi_psram_reg *out_reg)
static void IRAM_ATTR get_psram_reg(int spi_num,
struct opi_psram_reg *out_reg)
{
esp_rom_spiflash_read_mode_t mode = ESP_ROM_SPIFLASH_OPI_DTR_MODE;
int cmd_len = 16;
Expand Down Expand Up @@ -314,7 +316,7 @@ static void get_psram_reg(int spi_num, struct opi_psram_reg *out_reg)
*
****************************************************************************/

static void print_psram_reg(const struct opi_psram_reg *psram_reg)
static void IRAM_ATTR print_psram_reg(const struct opi_psram_reg *psram_reg)
{
minfo("vendor id : 0x%02x (%s)\n", psram_reg->mr1.vendor_id,
psram_reg->mr1.vendor_id == 0x0d ? "AP" : "UNKNOWN");
Expand Down Expand Up @@ -363,7 +365,7 @@ static void print_psram_reg(const struct opi_psram_reg *psram_reg)
*
****************************************************************************/

static void init_cs_timing(void)
static void IRAM_ATTR init_cs_timing(void)
{
/* SPI0/1 share the cs_hold / cs_setup, cd_hold_time / cd_setup_time,
* cs_hold_delay registers for PSRAM, so we only need to set SPI0
Expand Down Expand Up @@ -404,7 +406,7 @@ static void init_cs_timing(void)
*
****************************************************************************/

static void init_psram_pins(void)
static void IRAM_ATTR init_psram_pins(void)
{
uint32_t reg = REG_IO_MUX_BASE +
(CONFIG_ESP32S3_DEFAULT_PSRAM_CS_IO + 1) * 4;
Expand All @@ -429,7 +431,7 @@ static void init_psram_pins(void)
*
****************************************************************************/

static void config_psram_spi_phases(void)
static void IRAM_ATTR config_psram_spi_phases(void)
{
/* Config Write CMD phase for SPI0 to access PSRAM */

Expand Down
1 change: 1 addition & 0 deletions boards/xtensa/esp32s3/common/scripts/legacy_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ SECTIONS
*libarch.a:esp32s3_spiflash.*(.literal .text .literal.* .text.*)
*libarch.a:xtensa_cpupause.*(.literal .text .literal.* .text.*)
*libarch.a:xtensa_testset.*(.literal .text .literal.* .text.*)
*libarch.a:xtensa_modifyreg32.*(.literal.modifyreg32 .text.modifyreg32)

*libsched.a:irq_csection.*(.literal .text .literal.* .text.*)
*libsched.a:irq_dispatch.*(.literal .text .literal.* .text.*)
Expand Down

0 comments on commit 827c2df

Please sign in to comment.