blob: e01bdc2c8b99097d57e81925b2db23ed1ddc2afe [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
4gfxinit-y += hw-gfx-dp_info.adb
5gfxinit-y += hw-gfx-dp_info.ads
6gfxinit-y += hw-gfx-dp_training.adb
7gfxinit-y += hw-gfx-dp_training.ads
8gfxinit-y += hw-gfx-edid.adb
9gfxinit-y += hw-gfx-edid.ads
Nico Huber8c45bcf2016-11-20 17:30:57 +010010gfxinit-y += hw-gfx-gma-config_helpers.adb
11gfxinit-y += hw-gfx-gma-config_helpers.ads
Nico Huber83693c82016-10-08 22:17:55 +020012gfxinit-y += hw-gfx-gma-connector_info.adb
13gfxinit-y += hw-gfx-gma-connector_info.ads
14gfxinit-y += hw-gfx-gma-connectors.ads
Nico Huber8c45bcf2016-11-20 17:30:57 +010015gfxinit-y += hw-gfx-gma-display_probing.adb
16gfxinit-y += hw-gfx-gma-display_probing.ads
Nico Huber83693c82016-10-08 22:17:55 +020017gfxinit-y += hw-gfx-gma-dp_aux_ch.ads
18gfxinit-y += hw-gfx-gma-dp_aux_request.adb
19gfxinit-y += hw-gfx-gma-dp_aux_request.ads
20gfxinit-y += hw-gfx-gma-dp_info.ads
21gfxinit-y += hw-gfx-gma-i2c.adb
22gfxinit-y += hw-gfx-gma-i2c.ads
23gfxinit-y += hw-gfx-gma-panel.adb
24gfxinit-y += hw-gfx-gma-panel.ads
25gfxinit-y += hw-gfx-gma-pch-fdi.adb
26gfxinit-y += hw-gfx-gma-pch-fdi.ads
27gfxinit-y += hw-gfx-gma-pch-sideband.adb
28gfxinit-y += hw-gfx-gma-pch-sideband.ads
29gfxinit-y += hw-gfx-gma-pch-transcoder.adb
30gfxinit-y += hw-gfx-gma-pch-transcoder.ads
31gfxinit-y += hw-gfx-gma-pch-vga.adb
32gfxinit-y += hw-gfx-gma-pch-vga.ads
33gfxinit-y += hw-gfx-gma-pch.ads
Nico Huber312433c2019-09-28 03:15:48 +020034gfxinit-y += hw-gfx-gma-pcode.adb
35gfxinit-y += hw-gfx-gma-pcode.ads
Nico Huber83693c82016-10-08 22:17:55 +020036gfxinit-y += hw-gfx-gma-pipe_setup.adb
37gfxinit-y += hw-gfx-gma-pipe_setup.ads
38gfxinit-y += hw-gfx-gma-port_detect.ads
39gfxinit-y += hw-gfx-gma-registers.adb
40gfxinit-y += hw-gfx-gma-registers.ads
Nico Huber7ad2d652016-12-07 15:19:32 +010041gfxinit-y += hw-gfx-gma-transcoder.adb
42gfxinit-y += hw-gfx-gma-transcoder.ads
Nico Huber83693c82016-10-08 22:17:55 +020043gfxinit-y += hw-gfx-gma.adb
44gfxinit-y += hw-gfx-gma.ads
45gfxinit-y += hw-gfx-i2c.ads
46gfxinit-y += hw-gfx.ads
Nico Huber5374c3a2017-07-15 21:48:06 +020047gfxinit-y += hw-gfx-framebuffer_filler.adb
48gfxinit-y += hw-gfx-framebuffer_filler.ads
Nico Huber83693c82016-10-08 22:17:55 +020049
Nico Huber5dbaf4b2020-01-08 17:24:58 +010050CONFIG_GFX_GMA_PANEL_2_PORT ?= Disabled
51
Nico Huber6621a142018-06-07 23:56:54 +020052CONFIG_GFX_GMA_GENERATION := $(call strip_quotes,$(CONFIG_GFX_GMA_GENERATION))
Nico Huber3e508272016-10-09 20:44:16 +020053CONFIG_GFX_GMA_CPU := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU))
54CONFIG_GFX_GMA_CPU_VARIANT := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU_VARIANT))
Nico Huber8a6e7bd2020-01-07 16:36:38 +010055CONFIG_GFX_GMA_PANEL_1_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_PANEL_1_PORT))
Nico Huber5dbaf4b2020-01-08 17:24:58 +010056CONFIG_GFX_GMA_PANEL_2_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_PANEL_2_PORT))
Nico Huberd55afeb2016-10-21 14:31:10 +020057CONFIG_GFX_GMA_ANALOG_I2C_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_ANALOG_I2C_PORT))
Matt DeVillier2a3dbba2020-05-14 17:34:13 -050058CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS := $(if $(filter y,$(CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS)),True,False)
Nico Huber3e508272016-10-09 20:44:16 +020059
Nico Huberadfe11f2018-06-10 14:59:04 +020060_GEN_NONCONST := $(strip \
Nico Huber7f3e2802019-09-28 20:40:55 +020061 $(if $(filter G45,$(CONFIG_GFX_GMA_GENERATION)),g45, \
Nico Huberadfe11f2018-06-10 14:59:04 +020062 $(if $(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),ilk, \
63 $(if $(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),hsw, \
Nico Huber7f3e2802019-09-28 20:40:55 +020064 $(if $(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),skl)))))
Nico Huberadfe11f2018-06-10 14:59:04 +020065# GNATprove (GPL 2017) doesn't realize when a boolean expression
66# that depends both on static values and variables can be evalu-
67# ated at compile time (e.g. `False and then Variable` is always
68# `False` and GNAT acts appropriately). So for now, we generate
69# functions instead of constant expressions for these mixed ex-
70# pressions.
71_GEN_CONST_TARGET := <cpufunc> # set to `constant` to generate constants.
72
Nico Huber2600c362016-10-10 15:47:42 +020073hw-gfx-gma-config-ads := $(subst //,/,$(call src-to-obj,,$(dir)/hw-gfx-gma-config).ads)
74
Matt DeVillier8fc8e492020-05-15 15:44:47 -050075GFX_GMA_COMMON_SUBSTITUTIONS := \
76 -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
Nico Huber8a6e7bd2020-01-07 16:36:38 +010077 -e's/<<PANEL_1_PORT>>/$(CONFIG_GFX_GMA_PANEL_1_PORT)/' \
Nico Huber5dbaf4b2020-01-08 17:24:58 +010078 -e's/<<PANEL_2_PORT>>/$(CONFIG_GFX_GMA_PANEL_2_PORT)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020079 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
80 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
Matt DeVillier2a3dbba2020-05-14 17:34:13 -050081 -e's/<<IGNORE_STRAPS>>/$(CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS)/' \
Matt DeVillier8fc8e492020-05-15 15:44:47 -050082
83ifeq ($(CONFIG_GFX_GMA_DYN_CPU),y)
84$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
85 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
86 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huberadfe11f2018-06-10 14:59:04 +020087 -e'/constant Gen_CPU\(_Var\)\?/d' \
88 -e's/<genbool>/constant Boolean/' \
Nico Huber7f3e2802019-09-28 20:40:55 +020089 -e's/<\(\(g45\|ilk\|hsw\|skl\)\(...\)\?\)bool>/<\1var> Boolean/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020090 $(if $(_GEN_NONCONST),-e's/<\(...\)\?$(_GEN_NONCONST)\(...\)\?var>/<cpufunc>/') \
Nico Huber7f3e2802019-09-28 20:40:55 +020091 -e's/<\(g45\|ilk\|hsw\|skl\)\(...\)\?var>/$(_GEN_CONST_TARGET)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020092 -e's/\(.*: *<cpufunc>.*:=\) *\(.*\);/\1\n (\2);/' \
93 -e's/\([^ ]\+\) *: *<cpufunc> \+\([^ ]*\) *:=/function \1 return \2 is/' \
Nico Huber6a996dc2018-06-17 16:30:33 +020094 -e's/<cpunull>//' \
Nico Huberadfe11f2018-06-10 14:59:04 +020095 $< >$@
96else
Nico Huber2600c362016-10-10 15:47:42 +020097$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
Nico Huber83693c82016-10-08 22:17:55 +020098 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
Matt DeVillier8fc8e492020-05-15 15:44:47 -050099 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huber6621a142018-06-07 23:56:54 +0200100 -e's/<<CPU>>/$(CONFIG_GFX_GMA_CPU)/' \
Nico Huber83693c82016-10-08 22:17:55 +0200101 -e's/<<CPU_VARIANT>>/$(CONFIG_GFX_GMA_CPU_VARIANT)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +0200102 -e":s$$(printf '\n ')/,$$/{N;s/,\n.*Dyn_CPU\(_Var\)\?[^,)]*//;ts$$(printf '\n ')P;D;}" \
103 -e'/Dyn_CPU\(_Var\)\?/d' \
Nico Huber7f3e2802019-09-28 20:40:55 +0200104 -e's/<\(gen\|\(g45\|ilk\|hsw\|skl\)\(...\)\?\)bool>/constant Boolean/' \
105 -e's/<\(\(g45\|ilk\|hsw\|skl\)\(...\)\?\)var>/constant/' \
Nico Huber6a996dc2018-06-17 16:30:33 +0200106 -e's/<cpunull>/ is null/' \
Nico Huber83693c82016-10-08 22:17:55 +0200107 $< >$@
Nico Huberadfe11f2018-06-10 14:59:04 +0200108endif
Nico Huber2600c362016-10-10 15:47:42 +0200109gfxinit-gen-y += $(hw-gfx-gma-config-ads)
Nico Huber6a996dc2018-06-17 16:30:33 +0200110gfxinit-$(CONFIG_GFX_GMA_DYN_CPU) += dyncpu/hw-gfx-gma-config.adb
Nico Huber83693c82016-10-08 22:17:55 +0200111
Nico Huber6a996dc2018-06-17 16:30:33 +0200112ifneq ($(filter G45,$(CONFIG_GFX_GMA_GENERATION)),)
Arthur Heymans73ea0322018-03-28 17:17:07 +0200113subdirs-y += g45
Nico Huber6a996dc2018-06-17 16:30:33 +0200114else ifneq ($(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200115subdirs-y += ironlake
Nico Huber6a996dc2018-06-17 16:30:33 +0200116else ifneq ($(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200117subdirs-y += haswell_shared haswell
Nico Huber6a996dc2018-06-17 16:30:33 +0200118else ifneq ($(filter Broxton,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber21da5742017-01-20 14:00:53 +0100119subdirs-y += haswell_shared broxton
Nico Huber6a996dc2018-06-17 16:30:33 +0200120else ifneq ($(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200121subdirs-y += haswell_shared skylake
122endif