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
26include 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
35PLATFORM ?= PSOC_062_2M
36
37# supported platforms
38PLATFORMS := PSOC_062_2M PSOC_062_1M PSOC_062_512K
39
40ifneq ($(filter $(PLATFORM), $(PLATFORMS)),)
41else
42$(error Not supported platform: '$(PLATFORM)')
43endif
44
45# For which core this application is built
46CORE ?= 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
51ifeq ($(PLATFORM), PSOC_062_2M)
52# base kit CY8CPROTO-062-4343W
53DEVICE ?= CY8C624ABZI-D44
54PLATFORM_SUFFIX := 02
55else ifeq ($(PLATFORM), PSOC_062_1M)
56# base kit CY8CKIT-062-WIFI-BT
57DEVICE ?= CY8C6247BZI-D54
58PLATFORM_SUFFIX := 01
59else ifeq ($(PLATFORM), PSOC_062_512K)
60# base kit CY8CPROTO-062S3-4343W
61DEVICE ?= CY8C6245LQI-S3D72
62PLATFORM_SUFFIX := 03
63endif
64
65# Add device name to defines
66DEFINES += $(DEVICE)
67DEFINES += $(PLATFORM)
68
69# Convert defines to regular -DMY_NAME style
70ifneq ($(DEFINES),)
71	DEFINES_PLATFORM :=$(addprefix -D, $(subst -,_,$(DEFINES)))
72endif
73
74ifeq ($(MAKEINFO) , 1)
75$(info $(PLATFORM_SUFFIX))
76$(info $(DEVICE))
77$(info $(DEFINES_PLATFORM))
78endif
79