Commit 382f64a8 authored by Marti Bolivar's avatar Marti Bolivar
Browse files

zephyr: move STM32 target config to soc_family_stm32.h

This cleanup commit requires a bit more target-specific knowledge
that's a bit harder to read than board-specific headers, but it's
still an improvement over what we have now.

Signed-off-by: default avatarMarti Bolivar <marti.bolivar@linaro.org>
parent 61038df3
Loading
Loading
Loading
Loading
+2
Changes for boot/zephyr/include/target.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
/* SoC family configuration. */
#if defined(CONFIG_SOC_FAMILY_NRF5)
#include "soc_family_nrf5.h"
#elif defined(CONFIG_SOC_FAMILY_STM32)
#include "soc_family_stm32.h"
#endif

/*
−35

File deleted.

−23

File deleted.

−27

File deleted.

+29
Changes for boot/zephyr/targets/soc_family_stm32.h: 29 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*
 *  Copyright (C) 2017, Linaro Ltd
 *  SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <soc.h>

#define FLASH_DRIVER_NAME               CONFIG_SOC_FLASH_STM32_DEV_NAME

#if defined(CONFIG_SOC_SERIES_STM32F4X)
/*
 * The Zephyr flash driver will let us remove the need for
 * FLASH_AREA_IMAGE_SECTOR_SIZE at some point. It doesn't make sense
 * on these targets, anyway, as they have variable sized sectors.
 *
 * For now, let's rely on the fact that on all STM32F4 chips with at
 * most 16 flash sectors, all of the sectors after the first 128 KB
 * are equal sized.
 */
#if (!defined(FLASH_AREA_IMAGE_SECTOR_SIZE) && FLASH_SECTOR_TOTAL <= 16 && \
     FLASH_AREA_IMAGE_0_OFFSET >= KB(128))
#define FLASH_AREA_IMAGE_SECTOR_SIZE    0x20000
#endif
#define FLASH_ALIGN                     1
#elif defined(CONFIG_SOC_SERIES_STM32L4X) /* !CONFIG_SOC_SERIES_STM32F4X */
#define FLASH_ALIGN                     8
#define FLASH_AREA_IMAGE_SECTOR_SIZE    FLASH_PAGE_SIZE /* from the HAL */
#endif /* CONFIG_SOC_SERIES_STM32F4X */