Skip to content

Commit 74fad89

Browse files
committed
esp32: pinmux spi pins whitelist
esp32 pinmux driver doesn't re-initialize the SPI pins if flash cache is used. Signed-off-by: Gautier Seidel <[email protected]>
1 parent 2a4a86f commit 74fad89

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/pinmux/pinmux_esp32.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,17 @@ static int pinmux_initialize(struct device *device)
164164
u32_t pin;
165165

166166
for (pin = 0; pin < ARRAY_SIZE(pin_mux_off); pin++) {
167+
#if (CONFIG_ESP32_FLASH_CACHE == 1)
167168
/* pin 6 to 11 are configured for SPI by the second stage bootloader.
168169
* We should not change them, otherwise we can't access the flash
169-
* anymore. */
170+
* anymore.
171+
* These pins are only ignored during pinmux driver initialization
172+
* (= zephyr image boot-up), so anyone is still allowed to reconfigure
173+
* these pins during run-time. */
170174
if (pin < 6 && pin > 11) {
171175
pinmux_set(NULL, pin, 0);
172176
}
177+
#endif
173178
}
174179

175180
ARG_UNUSED(device);

0 commit comments

Comments
 (0)