blob: 9df9bf58fea2d440593918240dac8a01c8b343f6 [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
Angel Ponsc0db9942020-06-14 15:23:58 +020065_GEN_TLA_SUBSTITUTIONS := \(g45\|ilk\|hsw\|skl\)
66
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, \
Nico Huber7f3e2802019-09-28 20:40:55 +020071 $(if $(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),skl)))))
Nico Huberadfe11f2018-06-10 14:59:04 +020072# GNATprove (GPL 2017) doesn't realize when a boolean expression
73# that depends both on static values and variables can be evalu-
74# ated at compile time (e.g. `False and then Variable` is always
75# `False` and GNAT acts appropriately). So for now, we generate
76# functions instead of constant expressions for these mixed ex-
77# pressions.
78_GEN_CONST_TARGET := <cpufunc> # set to `constant` to generate constants.
79
Nico Huber2600c362016-10-10 15:47:42 +020080hw-gfx-gma-config-ads := $(subst //,/,$(call src-to-obj,,$(dir)/hw-gfx-gma-config).ads)
81
Matt DeVillier8fc8e492020-05-15 15:44:47 -050082GFX_GMA_COMMON_SUBSTITUTIONS := \
83 -e's/<<GEN>>/$(CONFIG_GFX_GMA_GENERATION)/' \
Nico Hubere79babd2020-12-20 01:33:26 +010084 -e's/<<PCH>>/$(CONFIG_GFX_GMA_PCH)/' \
Nico Huber8a6e7bd2020-01-07 16:36:38 +010085 -e's/<<PANEL_1_PORT>>/$(CONFIG_GFX_GMA_PANEL_1_PORT)/' \
Nico Huber5dbaf4b2020-01-08 17:24:58 +010086 -e's/<<PANEL_2_PORT>>/$(CONFIG_GFX_GMA_PANEL_2_PORT)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +020087 -e's/<<ANALOG_I2C_PORT>>/$(CONFIG_GFX_GMA_ANALOG_I2C_PORT)/' \
88 -e's/<<DEFAULT_MMIO_BASE>>/$(CONFIG_GFX_GMA_DEFAULT_MMIO)/' \
Matt DeVillier2a3dbba2020-05-14 17:34:13 -050089 -e's/<<IGNORE_STRAPS>>/$(CONFIG_GFX_GMA_IGNORE_PRESENCE_STRAPS)/' \
Matt DeVillier8fc8e492020-05-15 15:44:47 -050090
91ifeq ($(CONFIG_GFX_GMA_DYN_CPU),y)
92$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
93 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
94 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huberce63df32021-06-13 20:45:32 +000095 -e'/constant Gen_CPU/d' \
Nico Huberadfe11f2018-06-10 14:59:04 +020096 -e's/<genbool>/constant Boolean/' \
Nico Huberf20f5fc2021-06-13 20:49:03 +000097 -e's/<\($(_GEN_TLA_SUBSTITUTIONS)\(...\)*\)bool>/<\1var> Boolean/' \
98 $(if $(_GEN_NONCONST),-e's/<\(...\)*$(_GEN_NONCONST)\(...\)*var>/<cpufunc>/') \
99 -e's/<$(_GEN_TLA_SUBSTITUTIONS)\(...\)*var>/$(_GEN_CONST_TARGET)/' \
Nico Huberadfe11f2018-06-10 14:59:04 +0200100 -e's/\(.*: *<cpufunc>.*:=\) *\(.*\);/\1\n (\2);/' \
101 -e's/\([^ ]\+\) *: *<cpufunc> \+\([^ ]*\) *:=/function \1 return \2 is/' \
Nico Huber6a996dc2018-06-17 16:30:33 +0200102 -e's/<cpunull>//' \
Nico Huberadfe11f2018-06-10 14:59:04 +0200103 $< >$@
104else
Nico Huber2600c362016-10-10 15:47:42 +0200105$(hw-gfx-gma-config-ads): $(dir)/hw-gfx-gma-config.ads.template $(cnf)
Nico Huber83693c82016-10-08 22:17:55 +0200106 printf " GENERATE $(patsubst /%,%,$(subst $(obj)/,,$@))\n"
Matt DeVillier8fc8e492020-05-15 15:44:47 -0500107 sed $(GFX_GMA_COMMON_SUBSTITUTIONS) \
Nico Huber6621a142018-06-07 23:56:54 +0200108 -e's/<<CPU>>/$(CONFIG_GFX_GMA_CPU)/' \
Nico Huber83693c82016-10-08 22:17:55 +0200109 -e's/<<CPU_VARIANT>>/$(CONFIG_GFX_GMA_CPU_VARIANT)/' \
Nico Huberf20f5fc2021-06-13 20:49:03 +0000110 -e's/<\(gen\|$(_GEN_TLA_SUBSTITUTIONS)\(...\)*\)bool>/constant Boolean/' \
111 -e's/<\($(_GEN_TLA_SUBSTITUTIONS)\(...\)*\)var>/constant/' \
Nico Huber6a996dc2018-06-17 16:30:33 +0200112 -e's/<cpunull>/ is null/' \
Nico Huber04f919c2021-06-13 20:37:17 +0000113 -f $(dir $<)/delete_dyncpu.sed \
Nico Huber83693c82016-10-08 22:17:55 +0200114 $< >$@
Nico Huberadfe11f2018-06-10 14:59:04 +0200115endif
Nico Huber2600c362016-10-10 15:47:42 +0200116gfxinit-gen-y += $(hw-gfx-gma-config-ads)
Nico Huber6a996dc2018-06-17 16:30:33 +0200117gfxinit-$(CONFIG_GFX_GMA_DYN_CPU) += dyncpu/hw-gfx-gma-config.adb
Nico Huber83693c82016-10-08 22:17:55 +0200118
Nico Huber6a996dc2018-06-17 16:30:33 +0200119ifneq ($(filter G45,$(CONFIG_GFX_GMA_GENERATION)),)
Arthur Heymans73ea0322018-03-28 17:17:07 +0200120subdirs-y += g45
Nico Huber6a996dc2018-06-17 16:30:33 +0200121else ifneq ($(filter Ironlake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200122subdirs-y += ironlake
Nico Huber6a996dc2018-06-17 16:30:33 +0200123else ifneq ($(filter Haswell,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200124subdirs-y += haswell_shared haswell
Nico Huber6a996dc2018-06-17 16:30:33 +0200125else ifneq ($(filter Broxton,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber21da5742017-01-20 14:00:53 +0100126subdirs-y += haswell_shared broxton
Nico Huber6a996dc2018-06-17 16:30:33 +0200127else ifneq ($(filter Skylake,$(CONFIG_GFX_GMA_GENERATION)),)
Nico Huber83693c82016-10-08 22:17:55 +0200128subdirs-y += haswell_shared skylake
129endif