blob: ba48f85359cf312a956534eab263182a6e589186 [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
34gfxinit-y += hw-gfx-gma-pipe_setup.adb
35gfxinit-y += hw-gfx-gma-pipe_setup.ads
36gfxinit-y += hw-gfx-gma-port_detect.ads
37gfxinit-y += hw-gfx-gma-registers.adb
38gfxinit-y += hw-gfx-gma-registers.ads
Nico Huber7ad2d652016-12-07 15:19:32 +010039gfxinit-y += hw-gfx-gma-transcoder.adb
40gfxinit-y += hw-gfx-gma-transcoder.ads
Nico Huber83693c82016-10-08 22:17:55 +020041gfxinit-y += hw-gfx-gma.adb
42gfxinit-y += hw-gfx-gma.ads
43gfxinit-y += hw-gfx-i2c.ads
44gfxinit-y += hw-gfx.ads
Nico Huber5374c3a2017-07-15 21:48:06 +020045gfxinit-y += hw-gfx-framebuffer_filler.adb
46gfxinit-y += hw-gfx-framebuffer_filler.ads
Nico Huber83693c82016-10-08 22:17:55 +020047
Nico Huber6621a142018-06-07 23:56:54 +020048CONFIG_GFX_GMA_GENERATION := $(call strip_quotes,$(CONFIG_GFX_GMA_GENERATION))
Nico Huber3e508272016-10-09 20:44:16 +020049CONFIG_GFX_GMA_CPU := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU))
50CONFIG_GFX_GMA_CPU_VARIANT := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU_VARIANT))
51CONFIG_GFX_GMA_INTERNAL_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_INTERNAL_PORT))
Nico Huberd55afeb2016-10-21 14:31:10 +020052CONFIG_GFX_GMA_ANALOG_I2C_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_ANALOG_I2C_PORT))
Nico Huber3e508272016-10-09 20:44:16 +020053
Nico Huberadfe11f2018-06-10 14:59:04 +020054_GEN_NONCONST := $(strip \
55 $(if $(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),ilk, \
56 $(if $(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),hsw, \
57 $(if $(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),skl))))
58# GNATprove (GPL 2017) doesn't realize when a boolean expression
59# that depends both on static values and variables can be evalu-
60# ated at compile time (e.g. `False and then Variable` is always
61# `False` and GNAT acts appropriately). So for now, we generate
62# functions instead of constant expressions for these mixed ex-
63# pressions.
64_GEN_CONST_TARGET := <cpufunc> # set to `constant` to generate constants.
65
Nico Huber2600c362016-10-10 15:47:42 +020066hw-gfx-gma-config-ads := $(subst //,/,$(call src-to-obj,,$(dir)/hw-gfx-gma-config).ads)
67
Nico Huberadfe11f2018-06-10 14:59:04 +020068ifeq ($(CONFIG_GFX_GMA_DYN_CPU),y)
69$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
70 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
71 sed -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
72 -e's/<<INTERNAL_PORT>>/$(CONFIG_GFX_GMA_INTERNAL_PORT)/' \
73 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
74 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
75 -e'/constant Gen_CPU\(_Var\)\?/d' \
76 -e's/<genbool>/constant Boolean/' \
77 -e's/<\(\(ilk\|hsw\|skl\)\(...\)\?\)bool>/<\1var> Boolean/' \
78 $(if $(_GEN_NONCONST),-e's/<\(...\)\?$(_GEN_NONCONST)\(...\)\?var>/<cpufunc>/') \
79 -e's/<\(ilk\|hsw\|skl\)\(...\)\?var>/$(_GEN_CONST_TARGET)/' \
80 -e's/\(.*: *<cpufunc>.*:=\) *\(.*\);/\1\n (\2);/' \
81 -e's/\([^ ]\+\) *: *<cpufunc> \+\([^ ]*\) *:=/function \1 return \2 is/' \
82 $< >$@
83else
Nico Huber2600c362016-10-10 15:47:42 +020084$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
Nico Huber83693c82016-10-08 22:17:55 +020085 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
Nico Huber6621a142018-06-07 23:56:54 +020086 sed -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
87 -e's/<<CPU>>/$(CONFIG_GFX_GMA_CPU)/' \
Nico Huber83693c82016-10-08 22:17:55 +020088 -e's/<<CPU_VARIANT>>/$(CONFIG_GFX_GMA_CPU_VARIANT)/' \
89 -e's/<<INTERNAL_PORT>>/$(CONFIG_GFX_GMA_INTERNAL_PORT)/' \
Nico Huberd55afeb2016-10-21 14:31:10 +020090 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
Nico Huber83693c82016-10-08 22:17:55 +020091 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020092 -e":s$$(printf '\n ')/,$$/{N;s/,\n.*Dyn_CPU\(_Var\)\?[^,)]*//;ts$$(printf '\n ')P;D;}" \
93 -e'/Dyn_CPU\(_Var\)\?/d' \
Nico Huberd9365612018-06-10 14:59:04 +020094 -e's/<\(gen\|\(ilk\|hsw\|skl\)\(...\)\?\)bool>/constant Boolean/' \
95 -e's/<\(\(ilk\|hsw\|skl\)\(...\)\?\)var>/constant/' \
Nico Huber83693c82016-10-08 22:17:55 +020096 $< >$@
Nico Huberadfe11f2018-06-10 14:59:04 +020097endif
Nico Huber2600c362016-10-10 15:47:42 +020098gfxinit-gen-y += $(hw-gfx-gma-config-ads)
Nico Huber83693c82016-10-08 22:17:55 +020099
Arthur Heymans73ea0322018-03-28 17:17:07 +0200100ifneq ($(filter G45,$(CONFIG_GFX_GMA_CPU)),)
101subdirs-y += g45
102else ifneq ($(filter Ironlake Sandybridge Ivybridge,$(CONFIG_GFX_GMA_CPU)),)
Nico Huber83693c82016-10-08 22:17:55 +0200103subdirs-y += ironlake
104else ifneq ($(filter Haswell Broadwell,$(CONFIG_GFX_GMA_CPU)),)
105subdirs-y += haswell_shared haswell
Nico Huber21da5742017-01-20 14:00:53 +0100106else ifneq ($(filter Broxton,$(CONFIG_GFX_GMA_CPU)),)
107subdirs-y += haswell_shared broxton
108else ifneq ($(filter Skylake,$(CONFIG_GFX_GMA_CPU)),)
Nico Huber83693c82016-10-08 22:17:55 +0200109subdirs-y += haswell_shared skylake
110endif