Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # \file platforms.mk |
| 3 | # \version 1.0 |
| 4 | # |
| 5 | # \brief |
| 6 | # Makefile to describe supported boards and platforms for Cypress MCUBoot based applications. |
| 7 | # |
| 8 | ################################################################################ |
| 9 | # \copyright |
| 10 | # Copyright 2018-2019 Cypress Semiconductor Corporation |
| 11 | # SPDX-License-Identifier: Apache-2.0 |
| 12 | # |
| 13 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 14 | # you may not use this file except in compliance with the License. |
| 15 | # You may obtain a copy of the License at |
| 16 | # |
| 17 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 18 | # |
| 19 | # Unless required by applicable law or agreed to in writing, software |
| 20 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 21 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 22 | # See the License for the specific language governing permissions and |
| 23 | # limitations under the License. |
| 24 | ################################################################################ |
| 25 | |
| 26 | include host.mk |
| 27 | |
| 28 | # Target platform is built for. PSOC_062_2M is set by default |
| 29 | # Supported: |
| 30 | # - PSOC_062_2M |
| 31 | # - PSOC_062_1M |
| 32 | # - PSOC_062_512K |
| 33 | |
| 34 | # default PLATFORM |
| 35 | PLATFORM ?= PSOC_062_2M |
| 36 | |
| 37 | # supported platforms |
| 38 | PLATFORMS := PSOC_062_2M PSOC_062_1M PSOC_062_512K |
| 39 | |
| 40 | ifneq ($(filter $(PLATFORM), $(PLATFORMS)),) |
| 41 | else |
| 42 | $(error Not supported platform: '$(PLATFORM)') |
| 43 | endif |
| 44 | |
| 45 | # For which core this application is built |
| 46 | CORE ?= CM0P |
| 47 | |
| 48 | # MCU device selection, based on target device. |
| 49 | # Default chips are used for supported platforms |
| 50 | # This can be redefined in case of other chip usage |
| 51 | ifeq ($(PLATFORM), PSOC_062_2M) |
| 52 | # base kit CY8CPROTO-062-4343W |
| 53 | DEVICE ?= CY8C624ABZI-D44 |
| 54 | PLATFORM_SUFFIX := 02 |
| 55 | else ifeq ($(PLATFORM), PSOC_062_1M) |
| 56 | # base kit CY8CKIT-062-WIFI-BT |
| 57 | DEVICE ?= CY8C6247BZI-D54 |
| 58 | PLATFORM_SUFFIX := 01 |
| 59 | else ifeq ($(PLATFORM), PSOC_062_512K) |
| 60 | # base kit CY8CPROTO-062S3-4343W |
| 61 | DEVICE ?= CY8C6245LQI-S3D72 |
| 62 | PLATFORM_SUFFIX := 03 |
| 63 | endif |
| 64 | |
| 65 | # Add device name to defines |
| 66 | DEFINES += $(DEVICE) |
| 67 | DEFINES += $(PLATFORM) |
| 68 | |
| 69 | # Convert defines to regular -DMY_NAME style |
| 70 | ifneq ($(DEFINES),) |
| 71 | DEFINES_PLATFORM :=$(addprefix -D, $(subst -,_,$(DEFINES))) |
| 72 | endif |
| 73 | |
| 74 | ifeq ($(MAKEINFO) , 1) |
| 75 | $(info $(PLATFORM_SUFFIX)) |
| 76 | $(info $(DEVICE)) |
| 77 | $(info $(DEFINES_PLATFORM)) |
| 78 | endif |