xref: /rk3399_ARM-atf/docs/resources/diagrams/Makefile (revision 69447290863426c3f1360d89811ade6263a22814)
1a2c320a8SPaul Beesley#
2*69447290SJavier Almansa Sobrino# Copyright (c) 2015-2022, Arm Limited and Contributors. All rights reserved.
3a2c320a8SPaul Beesley#
4a2c320a8SPaul Beesley# SPDX-License-Identifier: BSD-3-Clause
5a2c320a8SPaul Beesley#
6a2c320a8SPaul Beesley#
7bd97f83aSJohn Tsichritzis# This Makefile generates the image files used in the Trusted Firmware-A
8a2c320a8SPaul Beesley# document from the dia file.
9a2c320a8SPaul Beesley#
10a2c320a8SPaul Beesley# The PNG files in the present directory have been generated using Dia version
11a2c320a8SPaul Beesley# 0.97.2, which can be obtained from https://wiki.gnome.org/Apps/Dia/Download
12a2c320a8SPaul Beesley#
13a2c320a8SPaul Beesley
14a2c320a8SPaul Beesley# generate_image use the tool dia generate png from dia file
15a2c320a8SPaul Beesley#    $(1) = layers
16a2c320a8SPaul Beesley#    $(2) = image file name
17a2c320a8SPaul Beesley#    $(3) = image file format
18a2c320a8SPaul Beesley#    $(4) = addition opts
19a2c320a8SPaul Beesley#    $(5) = dia source file
20a2c320a8SPaul Beesleydefine generate_image
21a2c320a8SPaul Beesley	dia --show-layers=$(1) --filter=$(3) --export=$(2) $(4) $(5)
22a2c320a8SPaul Beesleyendef
23a2c320a8SPaul Beesley
24a2c320a8SPaul BeesleyRESET_DIA							= reset_code_flow.dia
25a2c320a8SPaul BeesleyRESET_PNGS							=		\
26a2c320a8SPaul Beesley		default_reset_code.png 				\
27a2c320a8SPaul Beesley		reset_code_no_cpu_check.png			\
28a2c320a8SPaul Beesley		reset_code_no_boot_type_check.png 	\
29a2c320a8SPaul Beesley		reset_code_no_checks.png			\
30a2c320a8SPaul Beesley
31a2c320a8SPaul Beesley# The $(RESET_DIA) file is organized in several layers.
32a2c320a8SPaul Beesley# Each image is generated by combining and exporting the appropriate set of
33a2c320a8SPaul Beesley# layers.
34a2c320a8SPaul Beesleydefault_reset_code_layers			= "Frontground,Background,cpu_type_check,boot_type_check"
35a2c320a8SPaul Beesleyreset_code_no_cpu_check_layers		= "Frontground,Background,no_cpu_type_check,boot_type_check"
36a2c320a8SPaul Beesleyreset_code_no_boot_type_check_layers= "Frontground,Background,cpu_type_check,no_boot_type_check"
37a2c320a8SPaul Beesleyreset_code_no_checks_layers			= "Frontground,Background,no_cpu_type_check,no_boot_type_check"
38a2c320a8SPaul Beesley
39a2c320a8SPaul Beesleydefault_reset_code_opts          	=
40a2c320a8SPaul Beesleyreset_code_no_cpu_check_opts     	=
41a2c320a8SPaul Beesleyreset_code_no_boot_type_check_opts	=
42a2c320a8SPaul Beesleyreset_code_no_checks_opts			=
43a2c320a8SPaul Beesley
44a2c320a8SPaul BeesleyINT_DIA								= int_handling.dia
45a2c320a8SPaul BeesleyINT_PNGS							=		\
46a2c320a8SPaul Beesley		sec-int-handling.png				\
47a2c320a8SPaul Beesley		non-sec-int-handling.png
48a2c320a8SPaul Beesley
49a2c320a8SPaul Beesley# The $(INT_DIA) file is organized in several layers.
50a2c320a8SPaul Beesley# Each image is generated by combining and exporting the appropriate set of
51a2c320a8SPaul Beesley# layers.
52a2c320a8SPaul Beesleynon-sec-int-handling_layers			= "non_sec_int_bg,legend,non_sec_int_note,non_sec_int_handling"
53a2c320a8SPaul Beesleysec-int-handling_layers				= "sec_int_bg,legend,sec_int_note,sec_int_handling"
54a2c320a8SPaul Beesley
55a2c320a8SPaul Beesleynon-sec-int-handling_opts			= --size=1692x
56a2c320a8SPaul Beesleysec-int-handling_opts				= --size=1570x
57a2c320a8SPaul Beesley
58a2c320a8SPaul BeesleyXLAT_DIA 							= xlat_align.dia
59a2c320a8SPaul BeesleyXLAT_PNG 							= xlat_align.png
60a2c320a8SPaul Beesley
61a2c320a8SPaul Beesleyxlat_align_layers					= "bg,translations"
62a2c320a8SPaul Beesleyxlat_align_opts						=
63a2c320a8SPaul Beesley
64*69447290SJavier Almansa SobrinoRMM_DIA					= rmm_cold_boot_generic.dia
65*69447290SJavier Almansa SobrinoRMM_PNG					= rmm_cold_boot_generic.png
66*69447290SJavier Almansa Sobrino
67*69447290SJavier Almansa Sobrinormm_cold_boot_generic_layers		= "background"
68*69447290SJavier Almansa Sobrinormm_cold_boot_generic_opts		=
69*69447290SJavier Almansa Sobrino
70*69447290SJavier Almansa SobrinoRMM_EL3_MANIFEST_DIA			= rmm_el3_manifest_struct.dia
71*69447290SJavier Almansa SobrinoRMM_EL3_MANIFEST_PNG			= rmm_el3_manifest_struct.png
72*69447290SJavier Almansa Sobrino
73*69447290SJavier Almansa Sobrinormm_el3_manifest_struct_layers		= "Background"
74*69447290SJavier Almansa Sobrinormm_el3_manifest_struct_opts		=
75*69447290SJavier Almansa Sobrino
76*69447290SJavier Almansa Sobrinoall:$(RESET_PNGS) $(INT_PNGS) $(XLAT_PNG) $(RMM_PNG) $(RMM_EL3_MANIFEST_PNG)
77a2c320a8SPaul Beesley
78a2c320a8SPaul Beesley$(RESET_PNGS):$(RESET_DIA)
79a2c320a8SPaul Beesley	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
80a2c320a8SPaul Beesley
81a2c320a8SPaul Beesley$(INT_PNGS):$(INT_DIA)
82a2c320a8SPaul Beesley	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
83a2c320a8SPaul Beesley
84a2c320a8SPaul Beesley$(XLAT_PNG):$(XLAT_DIA)
85a2c320a8SPaul Beesley	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$(patsubst %.png,%.svg,$@),svg,$($(patsubst %.png,%_opts,$@)),$<)
86a2c320a8SPaul Beesley	inkscape -z $(patsubst %.png,%.svg,$@) -e $@ -d 45
87*69447290SJavier Almansa Sobrino
88*69447290SJavier Almansa Sobrino$(RMM_PNG):$(RMM_DIA)
89*69447290SJavier Almansa Sobrino	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
90*69447290SJavier Almansa Sobrino
91*69447290SJavier Almansa Sobrino$(RMM_EL3_MANIFEST_PNG):$(RMM_EL3_MANIFEST_DIA)
92*69447290SJavier Almansa Sobrino	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
93