Skip to content

Commit

Permalink
espressif: modify SOC_FAMILY according to new HWMv2
Browse files Browse the repository at this point in the history
Update FAMILY reference as needed.

Signed-off-by: Sylvio Alves <[email protected]>
  • Loading branch information
sylvioalves authored and almir-okato committed Mar 4, 2024
1 parent fefe701 commit b794d33
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ config MULTITHREADING
default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING
default y if BOOT_USB_DFU_GPIO || BOOT_USB_DFU_WAIT
default n if SOC_FAMILY_NRF
default n if SOC_FAMILY_ESP32 && MCUBOOT
default n if SOC_FAMILY_ESPRESSIF_ESP32 && MCUBOOT
default y

config LOG_PROCESS_THREAD
Expand Down
2 changes: 1 addition & 1 deletion boot/zephyr/flash_map_extended.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BOOT_LOG_MODULE_DECLARE(mcuboot);
#define FLASH_DEVICE_BASE 0
#define FLASH_DEVICE_NODE DT_INST(0, jedec_spi_nor)

#elif defined(CONFIG_SOC_FAMILY_ESP32)
#elif defined(CONFIG_SOC_FAMILY_ESPRESSIF_ESP32)

#define FLASH_DEVICE_ID SPI_FLASH_0_ID
#define FLASH_DEVICE_BASE 0
Expand Down
2 changes: 1 addition & 1 deletion boot/zephyr/include/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
#if (!defined(CONFIG_XTENSA) && !DT_HAS_CHOSEN(zephyr_flash_controller)) || \
(defined(CONFIG_XTENSA) && !DT_NODE_EXISTS(DT_INST(0, jedec_spi_nor)) && \
!defined(CONFIG_SOC_FAMILY_ESP32)) || \
!defined(CONFIG_SOC_FAMILY_ESPRESSIF_ESP32)) || \
!defined(FLASH_ALIGN) || \
!(FIXED_PARTITION_EXISTS(slot0_partition)) || \
!(FIXED_PARTITION_EXISTS(slot1_partition) || CONFIG_SINGLE_APPLICATION_SLOT) || \
Expand Down
12 changes: 6 additions & 6 deletions boot/zephyr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "flash_map_backend/flash_map_backend.h"

/* Check if Espressif target is supported */
#ifdef CONFIG_SOC_FAMILY_ESP32
#ifdef CONFIG_SOC_FAMILY_ESPRESSIF_ESP32

#include <bootloader_init.h>
#include <esp_loader.h>
Expand All @@ -63,7 +63,7 @@
#define IMAGE1_PRIMARY_SIZE \
DT_PROP_BY_IDX(DT_NODE_BY_FIXED_PARTITION_LABEL(image_1), reg, 1)

#endif /* CONFIG_SOC_FAMILY_ESP32 */
#endif /* CONFIG_SOC_FAMILY_ESPRESSIF_ESP32 */

#ifdef CONFIG_MCUBOOT_SERIAL
#include "boot_serial/boot_serial.h"
Expand Down Expand Up @@ -225,7 +225,7 @@ static void do_boot(struct boot_rsp *rsp)

#elif defined(CONFIG_XTENSA) || defined(CONFIG_RISCV)

#ifndef CONFIG_SOC_FAMILY_ESP32
#ifndef CONFIG_SOC_FAMILY_ESPRESSIF_ESP32

#define SRAM_BASE_ADDRESS 0xBE030000

Expand Down Expand Up @@ -254,7 +254,7 @@ static void copy_img_to_SRAM(int slot, unsigned int hdr_offset)
done:
flash_area_close(fap);
}
#endif /* !CONFIG_SOC_FAMILY_ESP32 */
#endif /* !CONFIG_SOC_FAMILY_ESPRESSIF_ESP32 */

/* Entry point (.ResetVector) is at the very beginning of the image.
* Simply copy the image to a suitable location and jump there.
Expand All @@ -266,7 +266,7 @@ static void do_boot(struct boot_rsp *rsp)
BOOT_LOG_INF("br_image_off = 0x%x\n", rsp->br_image_off);
BOOT_LOG_INF("ih_hdr_size = 0x%x\n", rsp->br_hdr->ih_hdr_size);

#ifdef CONFIG_SOC_FAMILY_ESP32
#ifdef CONFIG_SOC_FAMILY_ESPRESSIF_ESP32
int slot = (rsp->br_image_off == IMAGE0_PRIMARY_START_ADDRESS) ?
PRIMARY_SLOT : SECONDARY_SLOT;
/* Load memory segments and start from entry point */
Expand All @@ -278,7 +278,7 @@ static void do_boot(struct boot_rsp *rsp)
/* Jump to entry point */
start = (void *)(SRAM_BASE_ADDRESS + rsp->br_hdr->ih_hdr_size);
((void (*)(void))start)();
#endif /* CONFIG_SOC_FAMILY_ESP32 */
#endif /* CONFIG_SOC_FAMILY_ESPRESSIF_ESP32 */
}

#else
Expand Down

0 comments on commit b794d33

Please sign in to comment.