blob: 906e1cd45dd8a795af1fe5320b4f02aad46e9dd3 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001gfxinit-y += hw-gfx-dp_aux_ch.adb
2gfxinit-y += hw-gfx-dp_aux_ch.ads
3gfxinit-y += hw-gfx-dp_defs.ads
Angel Pons8d5c24d2021-03-01 15:59:58 +01004gfxinit-y += hw-gfx-dp_dual_mode.adb
5gfxinit-y += hw-gfx-dp_dual_mode.ads
Nico Huber83693c82016-10-08 22:17:55 +02006gfxinit-y += hw-gfx-dp_info.adb
7gfxinit-y += hw-gfx-dp_info.ads
8gfxinit-y += hw-gfx-dp_training.adb
9gfxinit-y += hw-gfx-dp_training.ads
10gfxinit-y += hw-gfx-edid.adb
11gfxinit-y += hw-gfx-edid.ads
Nico Huber8c45bcf2016-11-20 17:30:57 +010012gfxinit-y += hw-gfx-gma-config_helpers.adb
13gfxinit-y += hw-gfx-gma-config_helpers.ads
Nico Huber83693c82016-10-08 22:17:55 +020014gfxinit-y += hw-gfx-gma-connector_info.adb
15gfxinit-y += hw-gfx-gma-connector_info.ads
16gfxinit-y += hw-gfx-gma-connectors.ads
Nico Huber8c45bcf2016-11-20 17:30:57 +010017gfxinit-y += hw-gfx-gma-display_probing.adb
18gfxinit-y += hw-gfx-gma-display_probing.ads
Nico Huber83693c82016-10-08 22:17:55 +020019gfxinit-y += hw-gfx-gma-dp_aux_ch.ads
20gfxinit-y += hw-gfx-gma-dp_aux_request.adb
21gfxinit-y += hw-gfx-gma-dp_aux_request.ads
Angel Pons8d5c24d2021-03-01 15:59:58 +010022gfxinit-y += hw-gfx-gma-dp_dual_mode.ads
Nico Huber83693c82016-10-08 22:17:55 +020023gfxinit-y += hw-gfx-gma-dp_info.ads
24gfxinit-y += hw-gfx-gma-i2c.adb
25gfxinit-y += hw-gfx-gma-i2c.ads
26gfxinit-y += hw-gfx-gma-panel.adb
27gfxinit-y += hw-gfx-gma-panel.ads
28gfxinit-y += hw-gfx-gma-pch-fdi.adb
29gfxinit-y += hw-gfx-gma-pch-fdi.ads
30gfxinit-y += hw-gfx-gma-pch-sideband.adb
31gfxinit-y += hw-gfx-gma-pch-sideband.ads
32gfxinit-y += hw-gfx-gma-pch-transcoder.adb
33gfxinit-y += hw-gfx-gma-pch-transcoder.ads
34gfxinit-y += hw-gfx-gma-pch-vga.adb
35gfxinit-y += hw-gfx-gma-pch-vga.ads
36gfxinit-y += hw-gfx-gma-pch.ads
Nico Huber312433c2019-09-28 03:15:48 +020037gfxinit-y += hw-gfx-gma-pcode.adb
38gfxinit-y += hw-gfx-gma-pcode.ads
Nico Huber83693c82016-10-08 22:17:55 +020039gfxinit-y += hw-gfx-gma-pipe_setup.adb
40gfxinit-y += hw-gfx-gma-pipe_setup.ads
41gfxinit-y += hw-gfx-gma-port_detect.ads
42gfxinit-y += hw-gfx-gma-registers.adb
43gfxinit-y += hw-gfx-gma-registers.ads
Nico Huber7ad2d652016-12-07 15:19:32 +010044gfxinit-y += hw-gfx-gma-transcoder.adb
45gfxinit-y += hw-gfx-gma-transcoder.ads
Nico Huber83693c82016-10-08 22:17:55 +020046gfxinit-y += hw-gfx-gma.adb
47gfxinit-y += hw-gfx-gma.ads
48gfxinit-y += hw-gfx-i2c.ads
49gfxinit-y += hw-gfx.ads
Nico Huber5374c3a2017-07-15 21:48:06 +020050gfxinit-y += hw-gfx-framebuffer_filler.adb
51gfxinit-y += hw-gfx-framebuffer_filler.ads
Nico Huber83693c82016-10-08 22:17:55 +020052
Nico Hubere79babd2020-12-20 01:33:26 +010053CONFIG_GFX_GMA_PCH ?= No_PCH
Nico Huber5dbaf4b2020-01-08 17:24:58 +010054CONFIG_GFX_GMA_PANEL_2_PORT ?= Disabled
55
Nico Huber6621a142018-06-07 23:56:54 +020056CONFIG_GFX_GMA_GENERATION := $(call strip_quotes,$(CONFIG_GFX_GMA_GENERATION))
Nico Huber3e508272016-10-09 20:44:16 +020057CONFIG_GFX_GMA_CPU := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU))
58CONFIG_GFX_GMA_CPU_VARIANT := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU_VARIANT))
Nico Hubere79babd2020-12-20 01:33:26 +010059CONFIG_GFX_GMA_PCH := $(call strip_quotes,$(CONFIG_GFX_GMA_PCH))
Nico Huber8a6e7bd2020-01-07 16:36:38 +010060CONFIG_GFX_GMA_PANEL_1_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_PANEL_1_PORT))
Nico Huber5dbaf4b2020-01-08 17:24:58 +010061CONFIG_GFX_GMA_PANEL_2_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_PANEL_2_PORT))
Nico Huberd55afeb2016-10-21 14:31:10 +020062CONFIG_GFX_GMA_ANALOG_I2C_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_ANALOG_I2C_PORT))
Matt DeVillier2a3dbba2020-05-14 17:34:13 -050063CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS := $(if $(filter y,$(CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS)),True,False)
Nico Huber3e508272016-10-09 20:44:16 +020064
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060065_GEN_TLA_SUBSTITUTIONS := g45 ilk hsw skl tgl
Angel Ponsc0db9942020-06-14 15:23:58 +020066
Nico Huberadfe11f2018-06-10 14:59:04 +020067_GEN_NONCONST := $(strip \
Nico Huber7f3e2802019-09-28 20:40:55 +020068 $(if $(filter G45,$(CONFIG_GFX_GMA_GENERATION)),g45, \
Nico Huberadfe11f2018-06-10 14:59:04 +020069 $(if $(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),ilk, \
70 $(if $(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),hsw, \
Tim Wawrzynczak605660b2022-06-08 12:48:19 -060071 $(if $(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),skl, \
72 $(if $(filter Tigerlake,$(CONFIG_GFX_GMA_GENERATION)),tgl))))))
Nico Huberadfe11f2018-06-10 14:59:04 +020073# GNATprove (GPL 2017) doesn't realize when a boolean expression
74# that depends both on static values and variables can be evalu-
75# ated at compile time (e.g. `False and then Variable` is always
76# `False` and GNAT acts appropriately). So for now, we generate
77# functions instead of constant expressions for these mixed ex-
78# pressions.
79_GEN_CONST_TARGET := <cpufunc> # set to `constant` to generate constants.
80
Nico Huber2600c362016-10-10 15:47:42 +020081hw-gfx-gma-config-ads := $(subst //,/,$(call src-to-obj,,$(dir)/hw-gfx-gma-config).ads)
82
Matt DeVillier8fc8e492020-05-15 15:44:47 -050083GFX_GMA_COMMON_SUBSTITUTIONS := \
84 -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
Nico Hubere79babd2020-12-20 01:33:26 +010085 -e's/<<PCH>>/$(CONFIG_GFX_GMA_PCH)/' \
Nico Huber8a6e7bd2020-01-07 16:36:38 +010086 -e's/<<PANEL_1_PORT>>/$(CONFIG_GFX_GMA_PANEL_1_PORT)/' \
Nico Huber5dbaf4b2020-01-08 17:24:58 +010087 -e's/<<PANEL_2_PORT>>/$(CONFIG_GFX_GMA_PANEL_2_PORT)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020088 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
89 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
Matt DeVillier2a3dbba2020-05-14 17:34:13 -050090 -e's/<<IGNORE_STRAPS>>/$(CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS)/' \
Matt DeVillier8fc8e492020-05-15 15:44:47 -050091
92ifeq ($(CONFIG_GFX_GMA_DYN_CPU),y)
93$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
94 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
95 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huberce63df32021-06-13 20:45:32 +000096 -e'/constant Gen_CPU/d' \
Nico Huberadfe11f2018-06-10 14:59:04 +020097 -e's/<genbool>/constant Boolean/' \
Nico Huberc47872c2021-06-13 20:56:03 +000098 $(foreach gen,$(_GEN_TLA_SUBSTITUTIONS), \
99 -e's/<\($(gen)\(...\)*\)bool>/<\1var> Boolean/') \
Nico Huberf20f5fc2021-06-13 20:49:03 +0000100 $(if $(_GEN_NONCONST),-e's/<\(...\)*$(_GEN_NONCONST)\(...\)*var>/<cpufunc>/') \
Nico Huberc47872c2021-06-13 20:56:03 +0000101 $(foreach gen,$(_GEN_TLA_SUBSTITUTIONS), \
102 -e's/<$(gen)\(...\)*var>/$(_GEN_CONST_TARGET)/') \
Nico Huberadfe11f2018-06-10 14:59:04 +0200103 -e's/\(.*: *<cpufunc>.*:=\) *\(.*\);/\1\n (\2);/' \
Nico Huber1b04c512021-06-13 21:05:47 +0000104 -e's/\([^ ][^ ]*\) *: *<cpufunc> *\([^ ]*\) *:=/function \1 return \2 is/' \
Nico Huber6a996dc2018-06-17 16:30:33 +0200105 -e's/<cpunull>//' \
Nico Huberadfe11f2018-06-10 14:59:04 +0200106 $< >$@
107else
Nico Huber2600c362016-10-10 15:47:42 +0200108$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
Nico Huber83693c82016-10-08 22:17:55 +0200109 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
Matt DeVillier8fc8e492020-05-15 15:44:47 -0500110 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huber6621a142018-06-07 23:56:54 +0200111 -e's/<<CPU>>/$(CONFIG_GFX_GMA_CPU)/' \
Nico Huber83693c82016-10-08 22:17:55 +0200112 -e's/<<CPU_VARIANT>>/$(CONFIG_GFX_GMA_CPU_VARIANT)/' \
Nico Huberc47872c2021-06-13 20:56:03 +0000113 -e's/<genbool>/constant Boolean/' \
114 $(foreach gen,$(_GEN_TLA_SUBSTITUTIONS), \
115 -e's/<$(gen)\(...\)*bool>/constant Boolean/' \
116 -e's/<$(gen)\(...\)*var>/constant/') \
Nico Huber6a996dc2018-06-17 16:30:33 +0200117 -e's/<cpunull>/ is null/' \
Nico Huber04f919c2021-06-13 20:37:17 +0000118 -f $(dir $<)/delete_dyncpu.sed \
Nico Huber83693c82016-10-08 22:17:55 +0200119 $< >$@
Nico Huberadfe11f2018-06-10 14:59:04 +0200120endif
Nico Huber2600c362016-10-10 15:47:42 +0200121gfxinit-gen-y += $(hw-gfx-gma-config-ads)
Nico Huber6a996dc2018-06-17 16:30:33 +0200122gfxinit-$(CONFIG_GFX_GMA_DYN_CPU) += dyncpu/hw-gfx-gma-config.adb
Nico Huber83693c82016-10-08 22:17:55 +0200123
Nico Huber6a996dc2018-06-17 16:30:33 +0200124ifneq ($(filter G45,$(CONFIG_GFX_GMA_GENERATION)),)
Arthur Heymans73ea0322018-03-28 17:17:07 +0200125subdirs-y += g45
Nico Huber6a996dc2018-06-17 16:30:33 +0200126else ifneq ($(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200127subdirs-y += ironlake
Nico Huber6a996dc2018-06-17 16:30:33 +0200128else ifneq ($(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200129subdirs-y += haswell_shared haswell
Nico Huber6a996dc2018-06-17 16:30:33 +0200130else ifneq ($(filter Broxton,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber21da5742017-01-20 14:00:53 +0100131subdirs-y += haswell_shared broxton
Nico Huber6a996dc2018-06-17 16:30:33 +0200132else ifneq ($(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200133subdirs-y += haswell_shared skylake
Tim Wawrzynczak605660b2022-06-08 12:48:19 -0600134else ifneq ($(filter Tigerlake,$(CONFIG_GFX_GMA_GENERATION)),)
135subdirs-y += tigerlake
Nico Huber83693c82016-10-08 22:17:55 +0200136endif