summaryrefslogtreecommitdiffstats
path: root/docs/resources/diagrams/Makefile
blob: c951754cfac76761e1ab07f0449642d664efec99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Copyright (c) 2015-2022, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#
# This Makefile generates the image files used in the Trusted Firmware-A
# document from the dia file.
#
# The PNG files in the present directory have been generated using Dia version
# 0.97.2, which can be obtained from https://wiki.gnome.org/Apps/Dia/Download
#

# generate_image use the tool dia generate png from dia file
#    $(1) = layers
#    $(2) = image file name
#    $(3) = image file format
#    $(4) = addition opts
#    $(5) = dia source file
define generate_image
	dia --show-layers=$(1) --filter=$(3) --export=$(2) $(4) $(5)
endef

RESET_DIA							= reset_code_flow.dia
RESET_PNGS							=		\
		default_reset_code.png 				\
		reset_code_no_cpu_check.png			\
		reset_code_no_boot_type_check.png 	\
		reset_code_no_checks.png			\

# The $(RESET_DIA) file is organized in several layers.
# Each image is generated by combining and exporting the appropriate set of
# layers.
default_reset_code_layers			= "Frontground,Background,cpu_type_check,boot_type_check"
reset_code_no_cpu_check_layers		= "Frontground,Background,no_cpu_type_check,boot_type_check"
reset_code_no_boot_type_check_layers= "Frontground,Background,cpu_type_check,no_boot_type_check"
reset_code_no_checks_layers			= "Frontground,Background,no_cpu_type_check,no_boot_type_check"

default_reset_code_opts          	=
reset_code_no_cpu_check_opts     	=
reset_code_no_boot_type_check_opts	=
reset_code_no_checks_opts			=

INT_DIA								= int_handling.dia
INT_PNGS							=		\
		sec-int-handling.png				\
		non-sec-int-handling.png

# The $(INT_DIA) file is organized in several layers.
# Each image is generated by combining and exporting the appropriate set of
# layers.
non-sec-int-handling_layers			= "non_sec_int_bg,legend,non_sec_int_note,non_sec_int_handling"
sec-int-handling_layers				= "sec_int_bg,legend,sec_int_note,sec_int_handling"

non-sec-int-handling_opts			= --size=1692x
sec-int-handling_opts				= --size=1570x

XLAT_DIA 							= xlat_align.dia
XLAT_PNG 							= xlat_align.png

xlat_align_layers					= "bg,translations"
xlat_align_opts						=

RMM_DIA					= rmm_cold_boot_generic.dia
RMM_PNG					= rmm_cold_boot_generic.png

rmm_cold_boot_generic_layers		= "background"
rmm_cold_boot_generic_opts		=

RMM_EL3_MANIFEST_DIA			= rmm_el3_manifest_struct.dia
RMM_EL3_MANIFEST_PNG			= rmm_el3_manifest_struct.png

rmm_el3_manifest_struct_layers		= "Background"
rmm_el3_manifest_struct_opts		=

PSA_FWU_DIA				= PSA-FWU.dia
PSA_FWU_PNG				= PSA-FWU.png

FWU-update_struct_layers		= "background"
FWU-update_struct_opts			=

all:$(RESET_PNGS) $(INT_PNGS) $(XLAT_PNG) $(RMM_PNG) $(RMM_EL3_MANIFEST_PNG) $(PSA_FWU_PNG)

$(RESET_PNGS):$(RESET_DIA)
	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)

$(INT_PNGS):$(INT_DIA)
	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)

$(XLAT_PNG):$(XLAT_DIA)
	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$(patsubst %.png,%.svg,$@),svg,$($(patsubst %.png,%_opts,$@)),$<)
	inkscape -z $(patsubst %.png,%.svg,$@) -e $@ -d 45

$(RMM_PNG):$(RMM_DIA)
	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)

$(RMM_EL3_MANIFEST_PNG):$(RMM_EL3_MANIFEST_DIA)
	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)

$(PSA_FWU_PNG):$(PSA_FWU_DIA)
	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)