blob: 9378f4106e3b95ed04220ad50754ba35f8a7592d [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 Huber6621a142018-06-07 23:56:54 +020050CONFIG_GFX_GMA_GENERATION := $(call strip_quotes,$(CONFIG_GFX_GMA_GENERATION))
Nico Huber3e508272016-10-09 20:44:16 +020051CONFIG_GFX_GMA_CPU := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU))
52CONFIG_GFX_GMA_CPU_VARIANT := $(call strip_quotes,$(CONFIG_GFX_GMA_CPU_VARIANT))
Nico Huber8a6e7bd2020-01-07 16:36:38 +010053CONFIG_GFX_GMA_PANEL_1_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_PANEL_1_PORT))
Nico Huberd55afeb2016-10-21 14:31:10 +020054CONFIG_GFX_GMA_ANALOG_I2C_PORT := $(call strip_quotes,$(CONFIG_GFX_GMA_ANALOG_I2C_PORT))
Nico Huber3e508272016-10-09 20:44:16 +020055
Nico Huberadfe11f2018-06-10 14:59:04 +020056_GEN_NONCONST := $(strip \
Nico Huber7f3e2802019-09-28 20:40:55 +020057 $(if $(filter G45,$(CONFIG_GFX_GMA_GENERATION)),g45, \
Nico Huberadfe11f2018-06-10 14:59:04 +020058 $(if $(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),ilk, \
59 $(if $(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),hsw, \
Nico Huber7f3e2802019-09-28 20:40:55 +020060 $(if $(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),skl)))))
Nico Huberadfe11f2018-06-10 14:59:04 +020061# GNATprove (GPL 2017) doesn't realize when a boolean expression
62# that depends both on static values and variables can be evalu-
63# ated at compile time (e.g. `False and then Variable` is always
64# `False` and GNAT acts appropriately). So for now, we generate
65# functions instead of constant expressions for these mixed ex-
66# pressions.
67_GEN_CONST_TARGET := <cpufunc> # set to `constant` to generate constants.
68
Nico Huber2600c362016-10-10 15:47:42 +020069hw-gfx-gma-config-ads := $(subst //,/,$(call src-to-obj,,$(dir)/hw-gfx-gma-config).ads)
70
Nico Huberadfe11f2018-06-10 14:59:04 +020071ifeq ($(CONFIG_GFX_GMA_DYN_CPU),y)
72$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
73 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
74 sed -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
Nico Huber8a6e7bd2020-01-07 16:36:38 +010075 -e's/<<PANEL_1_PORT>>/$(CONFIG_GFX_GMA_PANEL_1_PORT)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020076 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
77 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
78 -e'/constant Gen_CPU\(_Var\)\?/d' \
79 -e's/<genbool>/constant Boolean/' \
Nico Huber7f3e2802019-09-28 20:40:55 +020080 -e's/<\(\(g45\|ilk\|hsw\|skl\)\(...\)\?\)bool>/<\1var> Boolean/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020081 $(if $(_GEN_NONCONST),-e's/<\(...\)\?$(_GEN_NONCONST)\(...\)\?var>/<cpufunc>/') \
Nico Huber7f3e2802019-09-28 20:40:55 +020082 -e's/<\(g45\|ilk\|hsw\|skl\)\(...\)\?var>/$(_GEN_CONST_TARGET)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020083 -e's/\(.*: *<cpufunc>.*:=\) *\(.*\);/\1\n (\2);/' \
84 -e's/\([^ ]\+\) *: *<cpufunc> \+\([^ ]*\) *:=/function \1 return \2 is/' \
Nico Huber6a996dc2018-06-17 16:30:33 +020085 -e's/<cpunull>//' \
Nico Huberadfe11f2018-06-10 14:59:04 +020086 $< >$@
87else
Nico Huber2600c362016-10-10 15:47:42 +020088$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
Nico Huber83693c82016-10-08 22:17:55 +020089 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
Nico Huber6621a142018-06-07 23:56:54 +020090 sed -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
91 -e's/<<CPU>>/$(CONFIG_GFX_GMA_CPU)/' \
Nico Huber83693c82016-10-08 22:17:55 +020092 -e's/<<CPU_VARIANT>>/$(CONFIG_GFX_GMA_CPU_VARIANT)/' \
Nico Huber8a6e7bd2020-01-07 16:36:38 +010093 -e's/<<PANEL_1_PORT>>/$(CONFIG_GFX_GMA_PANEL_1_PORT)/' \
Nico Huberd55afeb2016-10-21 14:31:10 +020094 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
Nico Huber83693c82016-10-08 22:17:55 +020095 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020096 -e":s$$(printf '\n ')/,$$/{N;s/,\n.*Dyn_CPU\(_Var\)\?[^,)]*//;ts$$(printf '\n ')P;D;}" \
97 -e'/Dyn_CPU\(_Var\)\?/d' \
Nico Huber7f3e2802019-09-28 20:40:55 +020098 -e's/<\(gen\|\(g45\|ilk\|hsw\|skl\)\(...\)\?\)bool>/constant Boolean/' \
99 -e's/<\(\(g45\|ilk\|hsw\|skl\)\(...\)\?\)var>/constant/' \
Nico Huber6a996dc2018-06-17 16:30:33 +0200100 -e's/<cpunull>/ is null/' \
Nico Huber83693c82016-10-08 22:17:55 +0200101 $< >$@
Nico Huberadfe11f2018-06-10 14:59:04 +0200102endif
Nico Huber2600c362016-10-10 15:47:42 +0200103gfxinit-gen-y += $(hw-gfx-gma-config-ads)
Nico Huber6a996dc2018-06-17 16:30:33 +0200104gfxinit-$(CONFIG_GFX_GMA_DYN_CPU) += dyncpu/hw-gfx-gma-config.adb
Nico Huber83693c82016-10-08 22:17:55 +0200105
Nico Huber6a996dc2018-06-17 16:30:33 +0200106ifneq ($(filter G45,$(CONFIG_GFX_GMA_GENERATION)),)
Arthur Heymans73ea0322018-03-28 17:17:07 +0200107subdirs-y += g45
Nico Huber6a996dc2018-06-17 16:30:33 +0200108else ifneq ($(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200109subdirs-y += ironlake
Nico Huber6a996dc2018-06-17 16:30:33 +0200110else ifneq ($(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200111subdirs-y += haswell_shared haswell
Nico Huber6a996dc2018-06-17 16:30:33 +0200112else ifneq ($(filter Broxton,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber21da5742017-01-20 14:00:53 +0100113subdirs-y += haswell_shared broxton
Nico Huber6a996dc2018-06-17 16:30:33 +0200114else ifneq ($(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200115subdirs-y += haswell_shared skylake
116endif