From 5f6be9b4ceacaf282054550b451fc28e2f2a9379 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 6 Nov 2017 16:44:26 +0800 Subject: [PATCH] esp32: reconfigure SPI flash pins in esp_restart --- components/esp32/system_api.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/esp32/system_api.c b/components/esp32/system_api.c index ace292b8f0..e35973175e 100644 --- a/components/esp32/system_api.c +++ b/components/esp32/system_api.c @@ -308,16 +308,14 @@ void IRAM_ATTR esp_restart_noos() Cache_Read_Disable(0); Cache_Read_Disable(1); -#ifdef CONFIG_SPIRAM_SUPPORT - //External SPI RAM reconfigures some GPIO functions in a way that is not entirely undone in the boot rom. - //Undo them manually so we reboot correctly. + // 2nd stage bootloader reconfigures SPI flash signals. + // Reset them to the defaults expected by ROM. WRITE_PERI_REG(GPIO_FUNC0_IN_SEL_CFG_REG, 0x30); WRITE_PERI_REG(GPIO_FUNC1_IN_SEL_CFG_REG, 0x30); WRITE_PERI_REG(GPIO_FUNC2_IN_SEL_CFG_REG, 0x30); WRITE_PERI_REG(GPIO_FUNC3_IN_SEL_CFG_REG, 0x30); WRITE_PERI_REG(GPIO_FUNC4_IN_SEL_CFG_REG, 0x30); WRITE_PERI_REG(GPIO_FUNC5_IN_SEL_CFG_REG, 0x30); -#endif // Reset wifi/bluetooth/ethernet/sdio (bb/mac) DPORT_SET_PERI_REG_MASK(DPORT_CORE_RST_EN_REG,