File tree Expand file tree Collapse file tree 19 files changed +215
-42
lines changed Expand file tree Collapse file tree 19 files changed +215
-42
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+ *
4+ * SPDX-License-Identifier: Apache-2.0 OR MIT
5+ */
6+
7+ #pragma once
8+
9+ #include <stdbool.h>
10+ #include <stdint.h>
11+
12+ #include <log.h>
13+
14+ /**
15+ * @brief SPI Flash init. CONFIG SPI is unsupported
16+ *
17+ * @param spiconfig: Deprecated compatibility API value, must be 0
18+ *
19+ * @param legacy: Deprecated compatibility API value, must be false
20+ *
21+ */
22+ extern void esp_rom_spiflash_attach (uint32_t spiconfig , bool legacy );
23+
24+ inline static
25+ void flash_impl_init_no_spiconfig (void )
26+ {
27+ STUB_LOG_TRACE ();
28+ esp_rom_spiflash_attach (0 , false);
29+ }
Original file line number Diff line number Diff line change 55 */
66#pragma once
77
8- #include <private/soc_utils .h>
8+ #include <bit_utils .h>
99#include "reg_base.h"
1010
1111#define REG_SPI_MEM_BASE (i ) (DR_REG_SPI0_BASE - (i) * 0x1000)
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+ *
4+ * SPDX-License-Identifier: Apache-2.0 OR MIT
5+ */
6+
7+ #pragma once
8+
9+ #include <soc/spi_mem_reg.h>
10+
11+ #define PERIPHS_SPI_FLASH_CMD SPI_MEM_CMD_REG(1)
12+ #define PERIPHS_SPI_FLASH_C0 SPI_MEM_W0_REG(1)
13+
14+ #define PERIPHS_SPI_FLASH_BITS_RDID SPI_MEM_FLASH_RDID
Original file line number Diff line number Diff line change 44 * SPDX-License-Identifier: Apache-2.0 OR MIT
55 */
66
7+ #include <stdint.h>
8+ #include <log.h>
79#include <target/flash.h>
10+ #include <target/impl/flash_init_no_spiconfig.h>
11+ #include <target/impl/flash_get_id_from_rom.h>
12+ #include <target/impl/flash_get_config_from_rom.h>
813
9- void stub_target_flash_init (void * state )
14+ void stub_target_flash_init (void )
1015{
11- ( void ) state ;
12- // TODO: Implement
16+ STUB_LOG_TRACE () ;
17+ flash_impl_init_no_spiconfig ();
1318}
1419
15- void stub_target_flash_deinit ( const void * state )
20+ uint32_t stub_target_flash_get_flash_id ( void )
1621{
17- (void )state ;
18- // TODO: Implement
22+ STUB_LOG_TRACE ();
23+ return flash_impl_get_id_from_rom ();
24+ }
25+
26+ const esp_rom_spiflash_chip_t * stub_target_flash_get_config (void )
27+ {
28+ return flash_impl_get_config_from_rom ();
1929}
Original file line number Diff line number Diff line change 55 */
66#pragma once
77
8- #include <private/soc_utils .h>
8+ #include <bit_utils .h>
99#include "reg_base.h"
1010
1111#define REG_SPI_MEM_BASE (i ) (DR_REG_SPIMEM0_BASE + (i) * 0x1000) // SPIMEM0 and SPIMEM1
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+ *
4+ * SPDX-License-Identifier: Apache-2.0 OR MIT
5+ */
6+
7+ #pragma once
8+
9+ #include <soc/spi1_mem_reg.h>
10+
11+ #define PERIPHS_SPI_FLASH_CMD SPI_MEM_CMD_REG(1)
12+ #define PERIPHS_SPI_FLASH_C0 SPI_MEM_W0_REG(1)
13+
14+ #define PERIPHS_SPI_FLASH_BITS_RDID SPI_MEM_FLASH_RDID
Original file line number Diff line number Diff line change 44 * SPDX-License-Identifier: Apache-2.0 OR MIT
55 */
66
7+ #include <stdint.h>
8+ #include <log.h>
79#include <target/flash.h>
10+ #include <target/impl/flash_init_no_spiconfig.h>
11+ #include <target/impl/flash_get_id_from_rom.h>
12+ #include <target/impl/flash_get_config_from_rom.h>
813
9- void stub_target_flash_init (void * state )
14+ void stub_target_flash_init (void )
1015{
11- ( void ) state ;
12- // TODO: Implement
16+ STUB_LOG_TRACE () ;
17+ flash_impl_init_no_spiconfig ();
1318}
1419
15- void stub_target_flash_deinit ( const void * state )
20+ uint32_t stub_target_flash_get_flash_id ( void )
1621{
17- (void )state ;
18- // TODO: Implement
22+ STUB_LOG_TRACE ();
23+ return flash_impl_get_id_from_rom ();
24+ }
25+
26+ const esp_rom_spiflash_chip_t * stub_target_flash_get_config (void )
27+ {
28+ return flash_impl_get_config_from_rom ();
1929}
Original file line number Diff line number Diff line change 55 */
66#pragma once
77
8- #include <private/soc_utils .h>
8+ #include <bit_utils .h>
99#include "reg_base.h"
1010
1111#define REG_SPI_MEM_BASE (i ) (DR_REG_SPI0_BASE + (i) * 0x1000) // SPIMEM0 and SPIMEM1
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+ *
4+ * SPDX-License-Identifier: Apache-2.0 OR MIT
5+ */
6+
7+ #pragma once
8+
9+ #include <soc/spi_mem_reg.h>
10+
11+ #define PERIPHS_SPI_FLASH_CMD SPI_MEM_CMD_REG(1)
12+ #define PERIPHS_SPI_FLASH_C0 SPI_MEM_W0_REG(1)
13+
14+ #define PERIPHS_SPI_FLASH_BITS_RDID SPI_MEM_FLASH_RDID
Original file line number Diff line number Diff line change 44 * SPDX-License-Identifier: Apache-2.0 OR MIT
55 */
66
7+ #include <stdint.h>
8+ #include <log.h>
79#include <target/flash.h>
10+ #include <target/impl/flash_init_no_spiconfig.h>
11+ #include <target/impl/flash_get_id_from_rom.h>
12+ #include <target/impl/flash_get_config_from_rom.h>
813
9- void stub_target_flash_init (void * state )
14+ void stub_target_flash_init (void )
1015{
11- ( void ) state ;
12- // TODO: Implement
16+ STUB_LOG_TRACE () ;
17+ flash_impl_init_no_spiconfig ();
1318}
1419
15- void stub_target_flash_deinit ( const void * state )
20+ uint32_t stub_target_flash_get_flash_id ( void )
1621{
17- (void )state ;
18- // TODO: Implement
22+ STUB_LOG_TRACE ();
23+ return flash_impl_get_id_from_rom ();
24+ }
25+
26+ const esp_rom_spiflash_chip_t * stub_target_flash_get_config (void )
27+ {
28+ return flash_impl_get_config_from_rom ();
1929}
You can’t perform that action at this time.
0 commit comments