7778a261586e8cdd57cf5df793e7318a16f2d1ce
[openwrt/openwrt.git] / package / boot / arm-trusted-firmware-mvebu / Makefile
1 #
2 # Copyright (C) 2019 Sartura Ltd.
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_VERSION:=2.3
11 PKG_RELEASE:=1
12 PKG_HASH:=37f917922bcef181164908c470a2f941006791c0113d738c498d39d95d543b21
13
14 PKG_MAINTAINER:=Vladimir Vid <vladimir.vid@sartura.hr>
15
16 include $(INCLUDE_DIR)/trusted-firmware-a.mk
17 include $(INCLUDE_DIR)/package.mk
18
19 define Trusted-Firmware-A/Default
20 BUILD_TARGET:=mvebu
21 BUILD_SUBTARGET:=cortexa53
22 TFA_IMAGE:=flash-image.bin uart-images.tgz
23 UBOOT:=
24 DDR_TOPOLOGY:=
25 CLOCKSPRESET:=
26 endef
27
28
29 define Trusted-Firmware-A/espressobin-512mb
30 NAME:=Marvell ESPRESSObin (512MB)
31 DEPENDS:=+u-boot-espressobin
32 BUILD_DEVICES:=globalscale_espressobin
33 UBOOT:=espressobin
34 DDR_TOPOLOGY:=0
35 CLOCKSPRESET:=CPU_800_DDR_800
36 PLAT:=a3700
37 endef
38
39 define Trusted-Firmware-A/espressobin-v3-v5-1gb-1cs
40 NAME:=Marvell ESPRESSObin V3-V5 (1GB 1CS)
41 DEPENDS:=+u-boot-espressobin
42 BUILD_DEVICES:=globalscale_espressobin
43 UBOOT:=espressobin
44 DDR_TOPOLOGY:=4
45 CLOCKSPRESET:=CPU_800_DDR_800
46 PLAT:=a3700
47 endef
48
49 define Trusted-Firmware-A/espressobin-v3-v5-1gb-2cs
50 NAME:=Marvell ESPRESSObin V3-V5 (1GB, 2CS)
51 DEPENDS:=+u-boot-espressobin
52 BUILD_DEVICES:=globalscale_espressobin
53 UBOOT:=espressobin
54 DDR_TOPOLOGY:=2
55 CLOCKSPRESET:=CPU_800_DDR_800
56 PLAT:=a3700
57 endef
58
59 define Trusted-Firmware-A/espressobin-v3-v5-2gb
60 NAME:=Marvell ESPRESSObin V3-V5 (2GB)
61 DEPENDS:=+u-boot-espressobin
62 BUILD_DEVICES:=globalscale_espressobin
63 UBOOT:=espressobin
64 DDR_TOPOLOGY:=7
65 CLOCKSPRESET:=CPU_800_DDR_800
66 PLAT:=a3700
67 endef
68
69 define Trusted-Firmware-A/espressobin-v7-1gb
70 NAME:=Marvell ESPRESSObin V7 (1GB)
71 DEPENDS:=+u-boot-espressobin
72 BUILD_DEVICES:=globalscale_espressobin-v7
73 UBOOT:=espressobin
74 DDR_TOPOLOGY:=5
75 CLOCKSPRESET:=CPU_800_DDR_800
76 PLAT:=a3700
77 endef
78
79 define Trusted-Firmware-A/espressobin-v7-2gb
80 NAME:=Marvell ESPRESSObin V7 (2GB)
81 DEPENDS:=+u-boot-espressobin
82 BUILD_DEVICES:=globalscale_espressobin-v7
83 UBOOT:=espressobin
84 DDR_TOPOLOGY:=6
85 CLOCKSPRESET:=CPU_800_DDR_800
86 PLAT:=a3700
87 endef
88
89 define Trusted-Firmware-A/udpu
90 NAME:=Methode uDPU
91 DEPENDS:=+u-boot-uDPU
92 BUILD_DEVICES:=methode_udpu
93 UBOOT:=uDPU
94 DDR_TOPOLOGY:=0
95 CLOCKSPRESET:=CPU_1000_DDR_800
96 PLAT:=a3700
97 endef
98
99
100 TFA_TARGETS:= \
101 espressobin-512mb \
102 espressobin-v3-v5-1gb-1cs \
103 espressobin-v3-v5-1gb-2cs \
104 espressobin-v3-v5-2gb \
105 espressobin-v7-1gb \
106 espressobin-v7-2gb \
107 udpu
108
109 TFA_MAKE_FLAGS += \
110 CROSS_CM3=$(STAGING_DIR_IMAGE)/$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION)/bin/arm-linux-gnueabi- \
111 BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \
112 MV_DDR_PATH=$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \
113 WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \
114 DDR_TOPOLOGY=$(DDR_TOPOLOGY) \
115 CLOCKSPRESET=$(CLOCKSPRESET) \
116 all \
117 fip
118
119 A3700_UTILS_NAME:=a3700-utils
120 A3700_UTILS_RELEASE:=09679790
121 A3700_UTILS_SOURCE=$(A3700_UTILS_NAME)-$(A3700_UTILS_RELEASE).tar.bz2
122
123 define Download/a3700-utils
124 FILE:=$(A3700_UTILS_SOURCE)
125 PROTO:=git
126 URL:=https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
127 VERSION:=096797908ddd69a679fd55595c41fc02809829a9
128 MIRROR_HASH:=9276d63d41b2e221c2fd5cceee988ca26eff5005747787f084868b3940173b7a
129 SUBDIR:=$(A3700_UTILS_NAME)
130 endef
131
132 MV_DDR_NAME:=mv-ddr-marvell
133 MV_DDR_RELEASE:=mainline
134 MV_DDR_SOURCE:=$(MV_DDR_NAME)-$(MV_DDR_RELEASE).tar.bz2
135
136 define Download/mv-ddr-marvell
137 FILE:=$(MV_DDR_SOURCE)
138 PROTO:=git
139 URL:=https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
140 VERSION:=a881467ef0f0185e6570dd0483023fde93cbb5f5
141 MIRROR_HASH:=19f34817616c583b2b5f2612705857cf2120f6c2132355217899b1403c3fd336
142 SUBDIR:=$(MV_DDR_NAME)
143 endef
144
145 LINARO_NAME:=gcc-linaro
146 LINARO_RELEASE:=6
147 LINARO_VERSION:=5.0-2018.12-$(HOST_ARCH)_arm-linux-gnueabi
148 LINARO_SOURCE=$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION).tar.xz
149
150 define Download/gcc-linaro
151 FILE:=$(LINARO_SOURCE)
152 URL:=https://releases.linaro.org/components/toolchain/binaries/latest-$(LINARO_RELEASE)/arm-linux-gnueabi/
153 HASH:=2d4a92d6c8b384ae404b2e02c1c412e3ec18f9b714135acf046b2b1b510e9ace
154 endef
155
156 define Build/Prepare
157 # Download sources
158 $(eval $(call Download,a3700-utils))
159 $(eval $(call Download,mv-ddr-marvell))
160 $(eval $(call Download,gcc-linaro))
161
162 $(call Build/Prepare/Default,)
163
164 mkdir -p $(STAGING_DIR_IMAGE)
165 $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE)
166 $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MV_DDR_SOURCE)
167 $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(LINARO_SOURCE)
168 endef
169
170 $(eval $(call BuildPackage/Trusted-Firmware-A))