Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2017, Linaro Ltd |
| 3 | * SPDX-License-Identifier: Apache-2.0 |
| 4 | */ |
| 5 | |
| 6 | #ifndef H_TARGETS_TARGET_ |
| 7 | #define H_TARGETS_TARGET_ |
| 8 | |
| 9 | #if defined(MCUBOOT_TARGET_CONFIG) |
| 10 | /* |
| 11 | * Target-specific definitions are permitted in legacy cases that |
| 12 | * don't provide the information via DTS, etc. |
| 13 | */ |
| 14 | #include MCUBOOT_TARGET_CONFIG |
| 15 | #else |
| 16 | /* |
| 17 | * Otherwise, the Zephyr SoC header and the DTS provide most |
| 18 | * everything we need. |
| 19 | */ |
| 20 | #include <soc.h> |
| 21 | |
| 22 | #define FLASH_ALIGN FLASH_WRITE_BLOCK_SIZE |
| 23 | |
| 24 | /* |
| 25 | * TODO: remove soc_family_kinetis.h once its flash driver supports |
| 26 | * FLASH_PAGE_LAYOUT. |
| 27 | */ |
| 28 | #if defined(CONFIG_SOC_FAMILY_KINETIS) |
| 29 | #include "soc_family_kinetis.h" |
| 30 | #endif |
| 31 | #endif /* !defined(MCUBOOT_TARGET_CONFIG) */ |
| 32 | |
| 33 | /* |
| 34 | * Sanity check the target support. |
| 35 | */ |
| 36 | #if !defined(FLASH_DRIVER_NAME) || \ |
| 37 | !defined(FLASH_ALIGN) || \ |
| 38 | !defined(FLASH_AREA_IMAGE_0_OFFSET) || \ |
| 39 | !defined(FLASH_AREA_IMAGE_0_SIZE) || \ |
| 40 | !defined(FLASH_AREA_IMAGE_1_OFFSET) || \ |
| 41 | !defined(FLASH_AREA_IMAGE_1_SIZE) || \ |
| 42 | !defined(FLASH_AREA_IMAGE_SCRATCH_OFFSET) || \ |
| 43 | !defined(FLASH_AREA_IMAGE_SCRATCH_SIZE) |
| 44 | #error "Target support is incomplete; cannot build mcuboot." |
| 45 | #endif |
| 46 | |
| 47 | #endif |