blob: f2a2fbbc6ce4f862fcd27d50acf971f0f678f917 [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
Angel Ponsc0db9942020-06-14 15:23:58 +020060_GEN_TLA_SUBSTITUTIONS := \(g45\|ilk\|hsw\|skl\)
61
Nico Huberadfe11f2018-06-10 14:59:04 +020062_GEN_NONCONST := $(strip \
Nico Huber7f3e2802019-09-28 20:40:55 +020063 $(if $(filter G45,$(CONFIG_GFX_GMA_GENERATION)),g45, \
Nico Huberadfe11f2018-06-10 14:59:04 +020064 $(if $(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),ilk, \
65 $(if $(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),hsw, \
Nico Huber7f3e2802019-09-28 20:40:55 +020066 $(if $(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),skl)))))
Nico Huberadfe11f2018-06-10 14:59:04 +020067# GNATprove (GPL 2017) doesn't realize when a boolean expression
68# that depends both on static values and variables can be evalu-
69# ated at compile time (e.g. `False and then Variable` is always
70# `False` and GNAT acts appropriately). So for now, we generate
71# functions instead of constant expressions for these mixed ex-
72# pressions.
73_GEN_CONST_TARGET := <cpufunc> # set to `constant` to generate constants.
74
Nico Huber2600c362016-10-10 15:47:42 +020075hw-gfx-gma-config-ads := $(subst //,/,$(call src-to-obj,,$(dir)/hw-gfx-gma-config).ads)
76
Matt DeVillier8fc8e492020-05-15 15:44:47 -050077GFX_GMA_COMMON_SUBSTITUTIONS := \
78 -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
Nico Huber8a6e7bd2020-01-07 16:36:38 +010079 -e's/<<PANEL_1_PORT>>/$(CONFIG_GFX_GMA_PANEL_1_PORT)/' \
Nico Huber5dbaf4b2020-01-08 17:24:58 +010080 -e's/<<PANEL_2_PORT>>/$(CONFIG_GFX_GMA_PANEL_2_PORT)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020081 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
82 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
Matt DeVillier2a3dbba2020-05-14 17:34:13 -050083 -e's/<<IGNORE_STRAPS>>/$(CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS)/' \
Matt DeVillier8fc8e492020-05-15 15:44:47 -050084
85ifeq ($(CONFIG_GFX_GMA_DYN_CPU),y)
86$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
87 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
88 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huberadfe11f2018-06-10 14:59:04 +020089 -e'/constant Gen_CPU\(_Var\)\?/d' \
90 -e's/<genbool>/constant Boolean/' \
Angel Ponsc0db9942020-06-14 15:23:58 +020091 -e's/<\($(_GEN_TLA_SUBSTITUTIONS)\(...\)\?\)bool>/<\1var> Boolean/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020092 $(if $(_GEN_NONCONST),-e's/<\(...\)\?$(_GEN_NONCONST)\(...\)\?var>/<cpufunc>/') \
Angel Ponsc0db9942020-06-14 15:23:58 +020093 -e's/<$(_GEN_TLA_SUBSTITUTIONS)\(...\)\?var>/$(_GEN_CONST_TARGET)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020094 -e's/\(.*: *<cpufunc>.*:=\) *\(.*\);/\1\n (\2);/' \
95 -e's/\([^ ]\+\) *: *<cpufunc> \+\([^ ]*\) *:=/function \1 return \2 is/' \
Nico Huber6a996dc2018-06-17 16:30:33 +020096 -e's/<cpunull>//' \
Nico Huberadfe11f2018-06-10 14:59:04 +020097 $< >$@
98else
Nico Huber2600c362016-10-10 15:47:42 +020099$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
Nico Huber83693c82016-10-08 22:17:55 +0200100 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
Matt DeVillier8fc8e492020-05-15 15:44:47 -0500101 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huber6621a142018-06-07 23:56:54 +0200102 -e's/<<CPU>>/$(CONFIG_GFX_GMA_CPU)/' \
Nico Huber83693c82016-10-08 22:17:55 +0200103 -e's/<<CPU_VARIANT>>/$(CONFIG_GFX_GMA_CPU_VARIANT)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +0200104 -e":s$$(printf '\n ')/,$$/{N;s/,\n.*Dyn_CPU\(_Var\)\?[^,)]*//;ts$$(printf '\n ')P;D;}" \
105 -e'/Dyn_CPU\(_Var\)\?/d' \
Angel Ponsc0db9942020-06-14 15:23:58 +0200106 -e's/<\(gen\|$(_GEN_TLA_SUBSTITUTIONS)\(...\)\?\)bool>/constant Boolean/' \
107 -e's/<\($(_GEN_TLA_SUBSTITUTIONS)\(...\)\?\)var>/constant/' \
Nico Huber6a996dc2018-06-17 16:30:33 +0200108 -e's/<cpunull>/ is null/' \
Nico Huber83693c82016-10-08 22:17:55 +0200109 $< >$@
Nico Huberadfe11f2018-06-10 14:59:04 +0200110endif
Nico Huber2600c362016-10-10 15:47:42 +0200111gfxinit-gen-y += $(hw-gfx-gma-config-ads)
Nico Huber6a996dc2018-06-17 16:30:33 +0200112gfxinit-$(CONFIG_GFX_GMA_DYN_CPU) += dyncpu/hw-gfx-gma-config.adb
Nico Huber83693c82016-10-08 22:17:55 +0200113
Nico Huber6a996dc2018-06-17 16:30:33 +0200114ifneq ($(filter G45,$(CONFIG_GFX_GMA_GENERATION)),)
Arthur Heymans73ea0322018-03-28 17:17:07 +0200115subdirs-y += g45
Nico Huber6a996dc2018-06-17 16:30:33 +0200116else ifneq ($(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200117subdirs-y += ironlake
Nico Huber6a996dc2018-06-17 16:30:33 +0200118else ifneq ($(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200119subdirs-y += haswell_shared haswell
Nico Huber6a996dc2018-06-17 16:30:33 +0200120else ifneq ($(filter Broxton,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber21da5742017-01-20 14:00:53 +0100121subdirs-y += haswell_shared broxton
Nico Huber6a996dc2018-06-17 16:30:33 +0200122else ifneq ($(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200123subdirs-y += haswell_shared skylake
124endif